Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

change data frame periodically

Hello,

I need to create a ramp of data frame : using a NI CAN board, i would like to know how to generate a data frame of 40ms , at each period , the data have to increase ( of 10 units fo example). Actually I need to simulate several frames (some have fixed data) and for two of these frames, i have to create a ramp ( ramp 1 : period 40 ms, ramp 2 : period 100 ms). Is it not possible to use the board like an MIO continuous buffered generation?
What do you think of using the channel API instead the frame API?

Regards,
0 Kudos
Message 1 of 2
(3,200 Views)
Hello tkee

You should try to use the Frame API for that. There is a CAN Object ("Transmit Periodic Waveform") which cycles through a fixed number of CAN frames and transmits them on a periodical basis. This CAN Object executes directly on the CAN card, the period (40 respectively 100 ms) will not be dependent on the Windows OS.
You can create multiple of those CAN Objects for different arbitration IDs, but you can't create multiple CAN Objects for the same arbitration ID (which shouldn't be the case in your application).

Unless you're using LabVIEW Real-Time, which allows deterministic execution of LabVIEW code, you won't have much luck with the Channel API as it would need to be timed in software on your Windows OS and that doesn't guarantee you any loop rates.

-B2k
0 Kudos
Message 2 of 2
(3,195 Views)