10-21-2014 12:16 PM
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.
10-22-2014 08:41 PM
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.
10-23-2014 02:55 PM
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