NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

LIN Bus Wake-up

I am building a sequence that tests a LIN bus slave device.  If the bus is inactive for 4 second the device will go into sleep mode.  Once this happens a refresh signal (throw away command) needs to be issued to wake the slave.  Therefore, if the bus does go inactive inadvertently, the first command to be issued after this 4 second period will be ignored and not processed.

 

What would be the best way to track this bus sleep period and send a refresh signal (interupting main sequence to do so) only when this 4 seconds of inactivity has ellapsed?  Thanks in advance for any suggestions.

0 Kudos
Message 1 of 3
(4,619 Views)

Keeping track of the state of the LIN bus might be a little harder to do but it seems possible. If you have a bogus command that you can use for a "heartveat" you could just have TestStand send out that command every 4 seconds. If you need to actually monitor the connection you could set up a post step action that checks to see if the connection is good and if asleep, send the bogus command to wake it up. TestStand has the capability, but it somewhat depends on what functions you have available to use to monitor/wake up the hardware. 

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(4,583 Views)

One of the ways to do it is create a seperate thread which tracks for bus inactivity for 4 seconds and automatically sends the refresh signal.

 

we need to ensure that :

LIN command is not sent simultaneously by both main sequence and thread ( using locks or variables)

The reset counter is reset each time a LIN command is send.

 

Hope this helps.

 

Ravi

0 Kudos
Message 3 of 3
(4,561 Views)