Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

XNet Raw Frames for CANopen

Hey everyone,

 

I'm planning on developing a data logger using the cDAQ system. As a controller I would like to use NI-cDAQ 9134 since it has a CAN port.

I will be logging some analogue data which doesn't concern me much, but I also have to read some parameters from a CANopen device.

 

Since the controller only supports CAN I was thinking I could use the NI XNet API to read the data in 'raw frame format' and use the raw data to 'convert' it to CANopen.

 

Another thought was to use the Conversion Function of the XNet API and convert to a signal, which I could then use in a similar way.

 

I'm not sure if I'm heading in the right direction with this, please let me know what you think or if you have any ideas on how to establish the communication between the CAN controller and the CANopen device!

 

Thank you!

0 Kudos
Message 1 of 9
(6,063 Views)

Writing your own CANopen library for use with the built in XNET port is certainly possible. I do not believe there is a technical reason that would prevent you from doing so. It will require a strong knowledge of CANopen and XNET. Creating your own library will also require a fairly large investment in development time.

 

If you have an empty slot available the faster/easier approach would be to include a NI-9881 and use the NI-Industrial Communications for CANopen library.

Jeff L
National Instruments
0 Kudos
Message 2 of 9
(6,054 Views)

Thanks for your reply.

Unfortunately, I can't use the NI-9881 since I'm working with a cDAQ system which only supports CAN modules, such as the NI-9862.

Otherwise I would've taken a CANopen module of course, but since this is not an option I have to use CAN and XNET.

I have not worked with XNET yet, which is why I was not sure if it is possible for me to e.g. accesss the raw CAN frame without XNET changing it for further use first.

0 Kudos
Message 3 of 9
(6,028 Views)

XNET does allow you to access the 11 or 29 bit identifier, the frame type, the payload length, and the payload from a CAN frame.

 

In your case, you will probably want to start with a stream input/output sessions to read the frames and then do your processing.  The stream and queued session types use buffers to ensure that you do not miss any information. The Queued session type helps you work with specific IDs that are defined in a database while the stream session types give you full control over what is sent and recieved.

 

Jeff L
National Instruments
0 Kudos
Message 4 of 9
(6,022 Views)

I just wanted to confirm what Jeff said-- I've found it is possible to use the XNET Database Editor and an NI XNET C series card (9862) to communicate to an external device which operates using CANOpen. The CANOpen C series card (9881) was not required.

Erin D.
0 Kudos
Message 5 of 9
(4,447 Views)

Great Erin but how you do this please?

0 Kudos
Message 6 of 9
(4,379 Views)

Hi Erin,

do you have any documentation, examples or VIs to show how the 9862 could be used with a CANopen device?

Regards,

 

Vincent

0 Kudos
Message 7 of 9
(3,734 Views)

Hi everybody.

I saw that IXXAT have a library to communicate with their interface USB-TO-CAN.

I have an example with the driver VCI V3 but I work on Windows 10 so I have to use the VCI V4 driver.

I would like to know if someone have an example using IXXAT library with VCI V4 driver?

Thank you.

0 Kudos
Message 8 of 9
(3,727 Views)

Hi Erin,

 

I am stuck in this regard for quite some time to read data from a CANopen device. Is it possible for you to share any documentation with respect to your work that can help me?

 

Thanks,

Prasaanth

0 Kudos
Message 9 of 9
(3,043 Views)