NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Recommendations for one-time HW initialization/de-initialization in multi-execution environment

Hello,

We have an existing Sequential Model process model and sequence file
framework that assumed a single sequence execution per machine. We would
now like to add multiple sequence executions running in parallel on the same
machine. I must confess I have never used the Parallel Model or Batch
Model process models. Rather than investing significant time in wholesale
conversion of our Sequential Model to a Parallel Model, I was hoping to just
be able to run multiple Sequential Model executions, with maybe some minor
changes. However, I've encountered a small problem I hope someone can help
me with, or at least point me in the right direction.

These multiple sequence executions will share a common set of VXI and GPIB
data-acquisition hardware. The hardware is controlled via a CVI DLL someone
here wrote a while ago. The CVI DLL isn't written specifically to support
multi-thread access to the hardware.

I was planning to arbitrate each sequence execution's access to the CVI DLL
at a gross level using TestStand Locks. In other words, Sequence 1 grabs
the lock, executes its tests then releases the lock, Sequence 2 grabs it,
executes its tests then releases the lock, etc. Each execution just has to
take care to reset the hardware to a known state before releasing the lock.
This seemed to work fine in my experimenting, until I considered the issue
of one-time hardware initialization and termination.

It turns out we also need to perform some very time-consuming one-time
hardware initialization and hardware termination before and after executing
the sequences. We can't have this initialization and termination occur
within the each sequence executions' test list as it is way too costly
time-wise, and doesn't need to be performed multiple times anyway. Ideally,
I would like TestStand (or the CVI DLL) to perform the one-time
initialization only when the very first sequence execution starts and
perform the one time termination only when the very last sequence execution
ends. The problem is complicated further because the individual sequence
executions can start and stop asynchronously. Ideally, I would also like to
be able to elegantly handle premature termination of one or more sequence
executions (as long as the CVI DLL Terminate function gets called in some
Cleanup step group).

Hopefully, the above makes sense...

Is there a way to accomplish anything like this at the TestStand level using
multiple Sequential Model process model sequence executions? Is this issue
addressed in the Parallel Model process model? Is my only hope to switch
over to a Parallel Model process model?

Thanks in advance for any advice...

---
Joe
0 Kudos
Message 1 of 2
(3,181 Views)
Hi Joe,

Have you looked at the example \Examples\MultiUUT\BatchUUT.seq.

Its only a small sequence but it has all the examples you are trying to achieve.
A. Once only setup
B. synchronization of a task to avoid bus conflict.
C. parallel tasks running.

Although this sequencefile is run using the Batch process model. You can set steps in your sequencefile to run only one thread (ie only one execution for all the batch). See the settings of the step 'Set Chamber Temperature'.

The step Pulse Test - this runs one at a time using batch synchronization.

Where as Frequency Sweep runs in parallal.

I hope this will help you.
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 2
(3,181 Views)