Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CANopen Library : opening and closing objects

I'm using the NI CANopen library together with a 2 Port PCI-CAN card.
 
At this moment i would like to start the implementation of a much larger vi that will be used as a diagnostic tool for more then 10  CANopen slave nodes.
(The Labview application is not the master -there is another master on the network- so i only use SDO's to monitor certain Object Dictionary entry's)
 
I'm only in doubt on opening and closing the SDO objects. Offcoarse i only create 1 interface object. Do i split from there the interface object into a 'SDO create' for each node ? And should all the SDO reads  for one node be 'in series' from there ? I tried to split it into several SDO reads, but that results in read errors.
 
As this is a diagnostic tool, it could be that some entry's are non-existing, or that some nodes are not in the network. So i would like that the application always keeps running
(Even worse, nodes could fail at runtime)
 
It seems that the Close object closes also the interface, how would i continue if one  node is missing and all the reads fail ? Close the object and restart the interface ?
 
Is there any good general white paper on how to use object in Labview ?
 
Thx
0 Kudos
Message 1 of 4
(4,467 Views)
Well your application should be very easy to realize. See the example attached to this request.
The Interface create function configures your can port and is allways needed for every port you are using. The handle is used for the SDO create to initiate a connection to the object dictionary of one server device. In your case you need to create 10 SDOs and the only difference is the node ID which changes from device to device.
Then you can use 10 SDO read object functions to read sequentially from the 10 different handles. If you need to read only ones, you can close the SDO handles then, but don't close the Interface handle if you need to initialize again, otherwise close all handles if you stop the program.
 
DirkW
0 Kudos
Message 2 of 4
(4,463 Views)
Hi Dirk,
 
Thanks for your quick reply.
 
In fact, you use the 'CANopen Close' VI after each read. But you also use  it for closing the interface itself. Isn't their a danger that the interfaces closes before all the reads are finished ?
Stijn
0 Kudos
Message 3 of 4
(4,456 Views)

Hi Stijn,

No , the SDO request is allways a two message client-server issue. That means the SDO read waits for the Server answer, until it proceeds to the next function.Thus the close function can not interrupt any SDO call.

DirkW

0 Kudos
Message 4 of 4
(4,436 Views)