Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Periodic Signal Transmition

Hi,

I am trying to send 3 CAN signals every 0.5 Sec and another 3 Signals every 1 sec. What is the easy way to do this? Is there is any VI availbale that I can set the seignals and the transmision period?

Please advice me

thanks

//Suresh
0 Kudos
Message 1 of 4
(4,177 Views)
Hi Suresh,

You can do that. With both APIs (Frame & Channel) there are periodic transmissions provided.
When using the Frame API configure a CAN Object with the communication type set to ‘Transmit Data Periodically’ and set the period to 1000 (ms).
When using the Channel API, initialize an output channel with a rate of 1 (Hz) to make this channel being transmit every 1sec.

For both of the above you can find examples that come with NI-CAN. Open the NI Example Finder and search for the term ‘periodic’. You might want to start with ‘CAN Transmit – periodic.vi’ and ‘Single Sample Periodic Output’, depending on which API you prefer.

-B2k
0 Kudos
Message 2 of 4
(4,159 Views)
Thanks B2K,

Is there is a way to programtcally change the output rate of the Channel API?. What I am doing right now is closing the Task and initializing with new output rate. I am wondering may be there is a way to do this without closing the task.
0 Kudos
Message 3 of 4
(4,149 Views)
Hi Suresh,

Your programming sequence is correct. There is currently no way to modify the rate of a periodic transmission after the transmission is initialized.
However, you might want to consider the following:
Usually, when periods are slow, the accuracy (jitter) of the period does not matter much. If that is the case for your application, you could perform the timing on the host computer. Specifically you could create a task with a sample rate of ‘0’ and call the CAN Write for that task with the different periods.

-B2k
0 Kudos
Message 4 of 4
(4,146 Views)