CAN Communication _ Help needed_ Urgent

5 years 3 months ago #29530827 by buchjyot
Hi,

I want to send the speed data over the CAN. I am using Open CAN. I want to know the microbasic reference, for sending the data over CAN. How do you exactly define the standard identifier that is 11 bit, How do I define that pattern in my micro basic script. I seriously think you guys should put micro basic CAN communication command for references, I am using following script.

Speed1 = GetValue(_ABSPEED, 1) ' Read the encoder speed in RPM
SetCommand(_CS, speed1)
wait(1000)

Set command will directly send this message to CAN, How? please provide some reference to send data packet. or should i set parameters one by one, for each message. 'setcommand(_CS, 1, 0x181) '0X180 + 1 Node
please help.

Please Log in or Create an account to join the conversation.

5 years 3 months ago #29530828 by roboteq
Replied by roboteq on topic CAN Communication _ Help needed_ Urgent
You cannot send data.

It is for your other device to read the data from the controller using SDO commands.

The controller can send data if you turn on the TPDOs. Then all you have to do is to have a script that continuously reads the _ABSPEED and stors it in a _VAR, using setcommand(_VAR, varnumber, value)

If SDO and TPDO are unfamiliar term, pls refer to the short wikipedia intro.

See also the CANOpen section of the manual

Please Log in or Create an account to join the conversation.

5 years 3 months ago #29530830 by buchjyot
I got the answere, thank you thank you very much..
this is my script now, if you can just verify me the syntax.

SetCommand(_CTPS,1,100)
Speed1 = GetValue(_ABSPEED, 1) ' Read the encoder speed in RPM
SetCommand(_VAR,1,Speed1)
wait(1000)

Thanks

Please Log in or Create an account to join the conversation.

5 years 3 months ago #29530834 by TechSupport
It appears correct. The way to know is to click the "Build" button to compile the code. If there are any errors, it will let you know.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.099 seconds