From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I run two asynchronous copies of multi slot sequences each one using the batch model?

Hi All,
 
I am using TestStand 3.1 & Labwindows CVI. I wish to develop my app. using
the Batch model and start execution from the Test UUTs entry point.
I will be using a single test station with two Enviro. chambers.
 
A batch of UUT's will be loaded into chamber #1 and testing on that batch will
begin. At some point in time, another batch off UUT's will be ready to be
loaded into chamber #2 for testing. 
 
Will I be able run these two batches asynchronously?
Would I launch the second batch as a new execution? How?
If I use a new execution for the second batch, will I be able
to manage the test station resources between the two?
 
Regards,
Bill
 
 
0 Kudos
Message 1 of 5
(3,190 Views)

There should be no problem running multiple batch executions at the same time.

Resource management should be no different than any other multithreaded scenario.  Use synchronization steps/options as usual to ensure exclusive access to shared resources. Just remember that the batch synchronization options only apply to the batch they are used in. So, for example, if you are using Serial batch synchronization to ensure exclusive resource access, you will have to add additional synchronization for that resource, such as a lock, to protect against usage from the other simultaneous executions that use the resource (batch or otherwise).

0 Kudos
Message 2 of 5
(3,178 Views)

Hi James,

Thanks a lot for the reply.

My plan then would be for the operator to launch the first instance of the sequence (using batch model), allow the

station to be initialized (obtain instrument handles etc) and then begin testing in chamber #1.

Then some time later launch the second instance of the sequence for chamber #2 while the first instance is still running.

What mechanism do I use to let the second instance know that the station has already been initialized and how do I get the

instrument handles from the first instance to the second? 

Regards,

Bill

 

0 Kudos
Message 3 of 5
(3,165 Views)

Bk1,

There's no pre-configured way to do what you're asking built into TestStand that I know of. I've been investigating doing something similar, and have the following suggestions -

1. Put your instrument handles into StationGlobal containers, which are shared across all executions. Then use a flagging mechanism and/or counter to tell loaded sequences if they need to initialize the instrument in question or not. Each attempt to initialize an instrument would increment the counter for that instrument, but only the first would actually obtain a shared handle. Then when your close out your sequences, each close would decrement the counter, and only the last one would actually close the instrument session. Alternatively, if you're using VISA (and maybe IVI; don't know - don't use 'em) drivers, you should be able to obtain multiple handles to the same instrument that are all valid at the same time.

2. If you use the container mentioned above, you can also create a locking mechanism using TestStand Synchronization steps to ensure that shared resources are properly protected from resource contention.

3. Any other shared information could be maintained in your custom StationGlobal containers as necessary.
 
Hope that helps somewhat.
 
-Jack
0 Kudos
Message 4 of 5
(3,148 Views)

Jack,

Thanks for the reply.

I'm leaning toward using a station global boolean that the 'initializing' execution sets, and then clears when

it's execution is complete. Whenever  the second instance of execution  starts it can check for the state of

that boolean.

For the instrument handles,  I'm going to obtain and then release the handle each time I must access a

particular instrument. I'll use the appropriate locks where required.

Regards,

Bill

 

0 Kudos
Message 5 of 5
(3,144 Views)