Jump to content

CANopen Synchronous PDOs


_Y_

Recommended Posts

Hello,

I am trying to use CANopen LabVIEW library to replace conventional CAN-communicating code. As I understand, this library allows moving the load from computer to internal processor of the NI CAN card Series 2. Unfortunately, help/examples of the library are not sufficient for newcomers.

1) The main question is: How can Synchronous PDOs be implemented? The program must get a sync message from an external device and reply with an information-containing frame. I created a simplified code that does the work but does not appear as an efficient solution. This is the diagram. The VI is attached (LabVIEW 2009).

post-15502-0-61764100-1289824059_thumb.g

Every time when the program gets a frame with ID=x80, it replies with the information-carrying frame (ID=x123). However, the implementation looks unreasonable. Data feed to the CANopen PDO Write.vi are rarely changed but they are read from data control each time. Is it only the way to implement such behaviour?

Besides, I have some additional questions:

2) What is the role for the NodeID? I have tried several values but did not get any difference.

3) What is the role for PDO type? It can take one of 8 values grouped by 4+4. As I understand, the groups differ by the direction (read or write). However, changing the PDO type within the group does not have any effect.

4) Is there a good description of this library? My experiments with Google have not provided any good result.

Thank you

CanOpenSync.vi

Link to comment

Hi _Y_,

the last time I used the NI CANopen library (LV (8.6) it didn't support sending PDOs upon receiving sync frames. It could only create a cyclic sync frame that was sent by the CAN card. You can also create cyclic PDOs that are sent hardware timed, but as far as I know you are not able to react on a sync sent by another controller.

The Node ID is used for building the arbitration ID and for network management functions. I recommend you to read the CiA 301 Standard which also explains the different PDO types.

It can be received for free (after registraion) from http://www.can-cia.org

Cheers,

Swen

Hello,

...

  • Like 1
Link to comment

I am trying to use CANopen LabVIEW library to replace conventional CAN-communicating code. As I understand, this library allows moving the load from computer to internal processor of the NI CAN card Series 2. Unfortunately, help/examples of the library are not sufficient for newcomers.

1) The main question is: How can Synchronous PDOs be implemented? The program must get a sync message from an external device and reply with an information-containing frame. I created a simplified code that does the work but does not appear as an efficient solution. This is the diagram. The VI is attached (LabVIEW 2009).

I'm not familiar with CANopen, but I've implemented CAN with the new card and driver. The serious improvements are in transmitting periodic signals and commonality with the DAQmx library. The new card and driver can simulate an entire vehicle where the old driver would run out of "bandwidth" somewhere (I'm told it was not the card, but the driver). The only way I've seen to do what you're discribing is to read in the message into a VI and then write the response.

Tim

Link to comment
  • 2 weeks later...

Thank you for the answers. The problems above are solved in some way but struggling with CANopen is going on.

New questrion: How can I listen for a frame having ID = 0?

If I set COB ID to 0, the ID used by the CAN frame is assembled on base of the combination of two CANopen parameters: PDO type and node ID. I could not find any combination of these parameters that could give ID=0 in the CAN frame.

Thank you.

Link to comment

New questrion: How can I listen for a frame having ID = 0?

If by ID you are referring to the arbitration ID (I don't know if ID means something else in CANopen terms), I don't believe the CAN protocol allows the arbitration ID to be 0, so you should never see that value.

Link to comment
...I don't believe the CAN protocol allows the arbitration ID to be 0...
CAN protocol does. The equpment sends this frame and the frame carries the data. However, I am not sure that CANopen can receive such a frame. This is actually my question:

How can I use CANopen library to receive the CAN frame with arbID=0?

Link to comment

I am slowly progressing through the problem. Now the question can be re-formulated (sorry for this iterative way of questioning).

As I understand (now :yes: ) The frame with arbID=0 is normally sent by "main" unit in the CAN network in order to control states of other units. The CANopen library provides a VI to send such kind of frames:

post-15502-0-01860900-1291195518_thumb.g

However, I cannot find a way to receive this frame if the frame is sent by an external unit. My LabVIEW program is not the "main" unit of the network. So, it has to receive the frame and act accordingly.

Could you advice please? May be I misunderstand some concept?

Edited by _Y_
Link to comment

The CANopen Library from NI seems to be designed for acting as a master in the network, not for acting as a slave. That is, you can create sync frames, heartbeats etc. and control slaves by sending NMT frames. But you can not react on them.

Maybe you want to use a second CAN module in parallel, e.g. the USB8473s and use the CAN-Frame/CAN-Channel API to react on frames like sync or NMT.

Link to comment

The CANopen Library from NI seems to be designed for acting as a master in the network, not for acting as a slave

Ops! The life is full of small disasters :(

Is any way around this limitation?

The main motivation of using the CANopen library is the good integration with NI CAN Series 2 cards.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...

Important Information

By using this site, you agree to our Terms of Use.