Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read out message cycle time from Vector CANdb file?

Hello LabVIEW friends,

I tried to open a Vector CAN Database (*.dbc) using the NI-CAN 2.3.2 Channel API and read out the cycle time of a message.
The CAN get property.vi should provide the sample rate which is described as followed:

Input parameter of the CAN Init Start function.
The sample rate specifies whether to transfer data in a periodic or event-driven manner.
For periodic behavior, the rate specifies the number of read/write samples to perform per second.

But for all messages in my database I get the value 0.
When I connect a sample rate to the CAN Initialize.vi I will get it's value.


Could anybody help?
Thank You.

Greets,
Marcus
0 Kudos
Message 1 of 4
(13,339 Views)

Hi,

unfortunately there is no way to use the cycle time property from your DBC file, because the NI driver is not able to read this information.

This is because the cycletime is stored in different places for different users and only Vector itself can read this information back.

In your case, you have to figure out this information by yourself and you can use the sample rate input of the init or initstart function to configure the cycle time in Hz.

If you need different cycle times for different messages, see the attached example.

DirkW

Message 2 of 4
(13,338 Views)
That's too bad. It would've been nice!
 
0 Kudos
Message 3 of 4
(13,323 Views)
So you cannot get the cycle time for a message.

Here is a related question:

If a message in the .dbc file has a value table for a message, such as message 'SwitchStatus' that shows a 0 = open and 1 = closed, is there a way to read this value table into Labview?

As another option, the .dbc if an ASCii file and therefore can be decoded as such, which is what I may resort to if there is not way to read the 'value table' in Labview.
0 Kudos
Message 4 of 4
(13,182 Views)