Jump to content

canopen vs a Cavotec remote control display


muzel

Recommended Posts

I have a V130plc v/canopen communication to a Cavotec remotecontroller.

the canopen config is done and working . i got remote IO's working too. send and receiving with SDO upload/download STR.

my problem is to send text and a number from an MI to the display on the remote CAN device.

the remote diodes that are working got these setting : SDO object index =2003

SDO Subobject index=2

the display got one Subobject index for each character, from 3-34

how do i get a 4 digit value from an MI split up into 4 different MI, and then send each digit to their subobject indexes in the display?

or is there a easier way to send many digits split out to the subobject indexes?

Link to comment
Share on other sites

Hi,

Do you need the each digit as a number or as ASCII?

If you need it as number then you can divide the number by 1000 then 100 and 10 and put the resutls in 4 MIs.

If you need it as ASCII you first need to convert the number to ASCII you NUM to ASCII function (Strings menu)then using the function Map register bytes you can set in each MI one byte which is one character.

Later if you need to send each character to a different sub index then you will need to excute the SDO download 4 times.

You can prepare a data table with sub index ID and character and each time before sending the character you can check from the data table to which sub index to send.

Link to comment
Share on other sites

tanks for feedback. i read through the help file from Cavotec. at first it didnt tell me anything. it was just lika a foreign language.

but i have gotten an example file from our suppliers of Unitronics plc's.

I went through the file up and down back and forth many times. trying to understand the example file

when i then read through the file from Cavotec again i found this :

--------------------------------------

Sub-Index 001

Description Downlink Byte 1

Entry Category Optional

Data Type UNSIGNED8

Access RWW

PDO Mapping Yes

Default Value 0x0

to

Sub-Index 088

Description Downlink Byte 88

Entry Category Optional

Data Type UNSIGNED8

Access RWW

PDO Mapping Yes

Default Value 0x0

-----------------------------------------

the important thing i found here was the line - Data Type UNSIGNED8

that means its just regular numbers i need to send.

i then made a INCREMENT loop and Download STR. and i got it. my display is updating the Subindex i choosen. and goes through the whole list of characters, the dispaly can show.

now ill just divide my MI with 1000, 100 ,10 as Ofir mentioned ;)

Link to comment
Share on other sites

If you need it as number then you can divide the number by 1000 then 100 and 10 and put the resutls in 4 MIs.

cant find a way to split the digits.

ive tried with division in many different ways.. but if my MI is 1234. the first digit will store fine as 1.

but the second devided with 100 will be 12 i want 2. and the third divided by 10 will be 123 i want 3

this is how i want the result if= MI 1234 store 1 to MI 2

store 2 to MI 3

store 3 to MI 4

store 4 to MI 5

MI 1 is a value that goes up to 9999 and down back to 0

Link to comment
Share on other sites

I found a way to fix all my problems.

got some help from friend, a C(++) programmer .

to split a four digit number i had to use the MOD% command first then DIV

1234 DIV 1000= 1

1234 (MOD 1000) DIV 100 = 2

1234 (MOD 100) DIV 10 = 3

1234(MOD 10) =4

this can be good to use on 7segment displays i think.

when u want 4 digit number spit over 4pieces of 7segment displays ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...