03-10-2006 12:23 PM
03-10-2006 01:04 PM
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).
03-10-2006 05:50 PM
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
03-13-2006 08:29 AM
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.
03-13-2006 09:29 AM
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