NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

unlock a lock on runtime error or abort termination

I have inhereted a sequence and it has 24 parallell procese with a modified parallel process model.

 

In the setup stage it has a lock and a bunch of procedures followed up by unlock statement.  In case this crushes and you go to clean up it has another early unlock statement and all works fine.  However, sometimes the sequence freezes, when the DUT is in a funky state, and I can't have it go to clean up by termination (only abort works).  Consequently the lock stays and all the consecutive threads waiting for the lock to be released are sitting and waiting.

 

Is there a TestStand option that would clear locks or any other way for me to accomplish this? 

 

I have looked at this method and it's great, however, it doesn't help, when you freeze amidst a locked sequence of steps and the lock is never released , to get the consequent threads going. 

 

Then there's time out, but I start this parallel threads one by one and from DUT1 - DUT24 could be an hour difference, so time out of 1 hour doesn't really help me either.

 

Is there an expression that I could put in the time-out that would help me?

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

The TestStand lock step type has the option to make the lock lifetime the same as the current sequence, or thread, or you can provide an object reference variable of your own which will control the lifetime of the lock operation. So a lock operation always has a lifetime to it, regardless of whether or not you terminate or abort or whether or not you even call early unlock. The object reference option is the most flexible and should make it possible to get the behavior you want, that is if the sequence lifetime isn't sufficient. You should use the sequence lifetime if at all possible since that will simplify your code.

 

To use the object reference lifetime I would recommend holding the lifetime object at local variable scope during the critical parts of your sequence where you want it to cleanup automatically on abort.

 

See the documentation for the lock step type for more details.

 

Hope this helps,

-Doug

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