Showing results for 
Search instead for 
Did you mean: 

How to get CAN message periodicity programmatically?

Go to solution

When I have messages with different periodicity in CAN data base file(.dbc), how do I programmatically know what is the periodicity of a given message? In the X-Net data base editor I can see the periodicity, but is there any way to get it in labview code?


Also, some of the messages are to-be-transmitted and some are to-be-received. How can I separate these channels/messages  programmatically?

0 Kudos
Message 1 of 8
Accepted by topic author ArunJ

You can use the XNET database VIs to browse XNET Aliases (.dbc files) and from there you can browse down from Cluster -> ECU -> Frame (message) and get the properties of the frame to read the transmit period.


You can also read any extra attributes from the .dbc file (name/value pairs) with the XNET functions as well (we commonly have a message timeout attribute).


There are some good examples of navigating an XNET database in LabVIEW in the example finder. Look at the 'Exploring Database with Tree' example for how to open the .dbc file and navigate through the messages/signals to get the information you need.

LabVIEW Champion, CLA, CLED, CTD
0 Kudos
Message 2 of 8

Hi Sam,

Your reply was very helpfull. 

Is itpossible to do these things using NI-CAN channel API/Frame API?

Currently I am using frame API because  X-Net does not support my CAN module (PXI-8461).

0 Kudos
Message 3 of 8

I don't know - I've never used the older CAN API, only XNET. However...


I am currently working on an application that uses an FPGA chassis with an FPGA CAN module (i.e. not an XNET CAN module) and we actually use XNET to parse the CAN data clusters from the module (via a FIFO to windows) into CAN signals. Essentially we load in the .dbc files into a :memory: database and then use the XNET convert VIs to convert from Frame to Signal and vice-versa. Maybe you can apply the same methodology to your own application (but I'm not sure as I've not worked with any other hardware - only C-Series FPGA CAN modules and X-NET for converting).

LabVIEW Champion, CLA, CLED, CTD
0 Kudos
Message 4 of 8

Yes, that is what I am doing now. Instead of X-Net driver, I was using the CAN Frame-Channel conversion library, downloaded from NI website.

0 Kudos
Message 5 of 8

First the Automotive subforum maybe of more help if you don't find the answers you need here.


Next I'd like to say I despise that conversion library and wish NI would take it off of this site.  It hasn't been updated in 5 years and it won't be updated again.  XNet has the same frame signal conversion functionality, and you don't need a XNet hardware to use it.  It also has bugs that I've reported to NI and their suggestion was to just use XNet so that is my suggestion to you.


Now back to the original question.  No the older cheap NI-CAN devices do not have a hardware retransmit functionality.  You must call the write function every time you want to perform a write.  This usually means a while loop which just runs, and resends out all the frames you want ever N milliseconds.  You can do this easily with the elapsed timer VI or make your own timer.

0 Kudos
Message 6 of 8
Thanks for the suggestions.😊
0 Kudos
Message 7 of 8

We can use Python to verify the periodicity.


Please use the following link for the CAN Periodicity: 


0 Kudos
Message 8 of 8