LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control the timing of LIN messages

I want to control a number of LEDs on a LIN bus.  I am using the USB-8476 to interface the network.  I need to send 6 messages to six LEDs to set their individual colors, and then send 6 new messages to make it appear the colors are moving down the line, one at a time.  I can't get the timing right, so I reduced the network to just two LEDs.  The messages are sent in a Timed Sequence of two frames, and that is inside a While Loop.  I have tried various combinations of Configured Time Sequence and Next Frame Timing, as well as various Wait Timers inside the While Loop, but I can't get anything remotely close to steady timing.

0 Kudos
Message 1 of 4
(2,548 Views)

Define "steady timing".

 

Assuming you are running this code on a Windows system there will always be some variability in timing because Windows is not a deterministic OS, and using timed loops won't help that...

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(2,525 Views)

You may have better luck with an XNET LIN interface, which does onboard scheduing of message.

0 Kudos
Message 3 of 4
(2,520 Views)

Thanks for your replies.  I had some help from an AE at NI who explained I don't need the timed sequences unless I am using RT systems, so after scrapping all the timed sequences and loops, and just putting all the frames sends together with a small delay inside each case, everything works pretty good now.  Amazing how well this works once you see the correct way to code it!  Now if I can just figure out the build executable function, I will be successful.

0 Kudos
Message 4 of 4
(2,506 Views)