Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to to auto increment a data field in a CAN-message during perodically sending?

Here's my problem:

I've to send a can message periodically and auto increment a 16-bit counter on position of byte 3+4 inside this CAN message.

Can I do this with the periodically sending mechanism provided by LabVIEW or have I program this feature on my own, e.g. in an own thread?
0 Kudos
Message 1 of 5
(3,744 Views)
Until now, I have developped all my applications with the CAN Frame API vis. As far as I know, it is not possible to do that with these vis.

But a quick overview of the new CAN Channel API vis gives new hope to solve this problem !
From the help for several vis (CAN Init Start, Create message...) :


Output Recent
Output channel data to CAN messages for transmit. This mode is used with sample rate greater than zero (periodic transmit). Use CAN Write.vi to provide a single sample per channel. Each periodic message uses the sample values from the most recent CAN Write.vi.


Unfortunately I have no time to test this right now and therefore I can only hope that this answer will lead you to a solution.
0 Kudos
Message 2 of 5
(3,744 Views)
Yes, you can do this by using the frame api or the channel api. With the frame you can use the write periodically feature inside a while loopfor updating the counter values.
With channel api it is much more comfortable because you can do the scaling within max .
Both api´s have examples to get a quick start solution.
Message 3 of 5
(3,744 Views)
Yes, you are right ! I didn't know that it is possible to transmit periodically a non constant message with the Frame API. Thank you very much !

For Roland : see ..\LabVIEW 7.0\examples\nican\Frame - Basic.llb\CAN Transmit - periodic.vi
0 Kudos
Message 4 of 5
(3,744 Views)
Great! Many thanks for your responses!
0 Kudos
Message 5 of 5
(3,744 Views)