NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

sharing locks among different sequences

Solved!
Go to solution

The way my main seq is set up is it does nothing by itself, just makes calls to other sequences (call them seq1, seq2, etc.).  I now want to have two UUTs using the parallel model but, since I only have one multimeter, wanted to use locks.   Will a UUT in seq2, for example, recognize a lock that was set up in seq1?? 

 

All sequences use the dmm in one way or another. The reason I dont want to use the locks in the main sequence is that there are things inside the individual calls(serial writing, waits, etc.) that I have no problem doing in paralell, because in those instances I have more than one piece of hardware.

 

So, for example, when UUT1 is measuring current in seq2, UUT2 is reading/writing diagnostics through its own serial port in seq 1 . After UUT1 releases the dmm, UUT2 gets access. 

 

Also, the calls need to be in order (seq2 after seq1 is completed) for every UUT. 

 

 

 

0 Kudos
Message 1 of 4
(3,742 Views)
Solution
Accepted by topic author jcarellanov1

If you begin a lock name with an asterisk (*) then it becomes global to the station.  For example "*DMM" as the name of your lock will be shared across the station.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(3,683 Views)

I've been playing around with it today, one thing I was trying is putting an early unlock in the main's cleanup (in case of individual sequence failure, the test goes straight to the main's cleanup). I'm getting a run-time exception "Attempted to unlock a lock that is not locked by this thread". 

 

Isn't this better than putting the unlock in every sequence's cleanup?

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

I wouldn't say that is better. It works against modularity to unecessarily separate the unlocks from the locks. Better to have the sub-sequences cleanup properly in all cases rather than hard-code assumptions about how they are implemented into calling sequences.

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