LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send periodic CAN frames using NI-CAN

I need to do something very simple and yet I can't find a way to do it.
I need to send periodic CAN frames on a CAN bus using NI-CAN and a PXI
CAN Card. It's very simple to do using the Frame API and the
"Configure Object" VI. You just set up the object to send
periodically. However, this only allows you to periodically send CAN
frames with the same ID number. I need to periodically send CAN frames
with multiple ID numbers. In other words I would like to be able to
write any CAN message to the write queue that I want and have the CAN
card automatically send them at 5ms (or 10ms or whatever) intervals.
These CAN messages will have different ID numbers and different Data.

0 Kudos
Message 1 of 2
(3,339 Views)
 

Hi,

Unfortunately, this kind of hardware timed periodic output is only working for a specific ID. You cannot configure a global period for the whole board memory. The only chance is to do it in software. You could use the "write mult net" function to send all your IDs and data in one burst or with a specific time difference. If you do this within a timed while loop, you should be able get it periodic, however windows sometimes makes it difficult to have it reliable. In this case and if you need ms timing, the only chance is a Realtime OS.

The new NI-CAN driver brings an example for Write mult:

NI_CAN 2.4

DirkW

0 Kudos
Message 2 of 2
(3,324 Views)