Menu

Topic-icon CTPS command query

More
1 year 4 months ago #29533914 by pugwng
CTPS command query was created by pugwng
I am trying to figure out one way to send TPDO messages only on event (eg. when VARxx changes its value). In order to do that, I have came across a post suggesting to change CTPS configuration to zero in script in order to send the TPDO immediately. I tried this approach, but I realized that once you change one CTPS configurations (eg. for TPDO 1) it sends all 4 TPDOs. Is that an issue, or an expected behavior?
Also, you could implement different transmission type for TPDOs (and/or SYNC).

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

More
1 year 4 months ago #29533916 by pugwng
Replied by pugwng on topic CTPS command query
Also, I just found out that if I set SetConfig(_CTPS, 1, 0), its doesn't send the CURRENT VAR1 / VAR2, but PREVIOUSLY saved values.
Otherwise, if I set SetConfig(_CTPS, 1, 1), it updates the TPDO1 buffer to the LATEST VAR1 / VAR2 values. As I DON'T want burst of messages on my CANBus, I need to re-set CTPS to 0 again.
In order to send TPDO1 by event, differently from the solution proposed in this forum ( www.roboteq.com/index.php/support/forum-...for-canopen#29532190 ), I first tried something like this:

FIRST CODE:
BEGIN:
counter = 0
GoTo TOP

TOP:
SetCommand(_VAR, 1, counter)
If ((counter Mod 10) = 0)
SetConfig(_CTPS, 1, 0)
End If
counter++
wait(500)
GoTo TOP


Output from console AND from PC terminal sniffing can:
0
can0 182 [8] 00 00 00 00 00 00 00 00
can0 282 [8] 00 00 00 00 00 00 00 00
can0 382 [8] 00 00 00 00 00 00 00 00
can0 482 [8] 00 00 00 00 00 00 00 00
10
can0 182 [8] 00 00 00 00 00 00 00 00
can0 282 [8] 00 00 00 00 00 00 00 00
can0 382 [8] 00 00 00 00 00 00 00 00
can0 482 [8] 00 00 00 00 00 00 00 00
20
can0 182 [8] 0A 00 00 00 00 00 00 00
can0 282 [8] 00 00 00 00 00 00 00 00
can0 382 [8] 00 00 00 00 00 00 00 00
can0 482 [8] 00 00 00 00 00 00 00 00
30
can0 182 [8] 14 00 00 00 00 00 00 00
can0 282 [8] 00 00 00 00 00 00 00 00
can0 382 [8] 00 00 00 00 00 00 00 00
can0 482 [8] 00 00 00 00 00 00 00 00



SECOND CODE:
BEGIN:
counter = 0
GoTo TOP

TOP:
SetCommand(_VAR, 1, counter)
If ((counter Mod 10) = 0)
SetConfig(_CTPS, 1, 1)
wait(1)
SetConfig(_CTPS, 1, 0)
End If
counter++
wait(500)
GoTo TOP


Output from console AND from PC terminal sniffing can:
0
can0 182 [8] 00 00 00 00 00 00 00 00
can0 182 [8] 00 00 00 00 00 00 00 00
can0 282 [8] 00 00 00 00 00 00 00 00
can0 382 [8] 00 00 00 00 00 00 00 00
can0 482 [8] 00 00 00 00 00 00 00 00
10
can0 182 [8] 0A 00 00 00 00 00 00 00
can0 182 [8] 0A 00 00 00 00 00 00 00
can0 282 [8] 00 00 00 00 00 00 00 00
can0 382 [8] 00 00 00 00 00 00 00 00
can0 482 [8] 00 00 00 00 00 00 00 00
20
can0 182 [8] 14 00 00 00 00 00 00 00
can0 182 [8] 14 00 00 00 00 00 00 00
can0 282 [8] 00 00 00 00 00 00 00 00
can0 382 [8] 00 00 00 00 00 00 00 00
can0 482 [8] 00 00 00 00 00 00 00 00
30
can0 182 [8] 1E 00 00 00 00 00 00 00
can0 182 [8] 1E 00 00 00 00 00 00 00
can0 282 [8] 00 00 00 00 00 00 00 00
can0 382 [8] 00 00 00 00 00 00 00 00
can0 482 [8] 00 00 00 00 00 00 00 00

Could you please suggest me a better approach if there is any? I'd prefer not to listen to TPDO 2, 3 and 4 all the time that TPDO1 changes.

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

  • Gabriel_Isko
  • Gabriel_Isko's Avatar
1 year 4 months ago #29533920 by Gabriel_Isko
Replied by Gabriel_Isko on topic CTPS command query
Hey, this is all expected behavior, and I'm not sure that what you are describing is allowable in CANOpen. In a CANOpen network, you operate with a master device and and slave device, and our controllers are only capable of acting as slave devices in their CANOpen implementation. If you would like to send event driven data over CAN, you will have to implement your own RAWCan frames.

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

Moderators: tonysantoni
Time to create page: 0.138 seconds
Go to top