NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

stagger batch sequence

I am using Teststand 3 - with batch sequence (single pass) and LabVIEW 7.

CYC1 CYC2 CYC3 CYC4 CYC5 CYC6 CYC7 CYC8
UUT1
UUT2 UUT1
UUT3 UUT2 UUT1
UUT4 UUT3 UUT2 UUT1
UUT4 UUT3 UUT2 UUT1
UUT4 UUT3 UUT2 UUT1
UUT4 UUT3 UUT2 UUT1
UUT4 UUT3 UUT2 UUT1
UUT4 UUT3 UUT2
UUT4 UUT3
UUT4

I have a temperature chamber test that tests 4 units using shared test equipment through 8 cycles. Cycles 1,3
,4,5,6, and seven are identical. Cycles 2 and 8 are identical. Each unit will be in its own individual temperature chamber.

Unit 1 will go through 1 cycle, then Unit 2 will start. Therefore unit 1 will be in its second cycle while unit 2 is in its first. When unit two finishes, the third unit starts and so on. It is a requirement that only 1 unit can control the test equipment during its cycle test.

Can someone explain how to do this. This is my first time writing a batch sequence and have never used the semaphore step types.

Thanks
0 Kudos
Message 1 of 6
(3,718 Views)
Raceman,

If I understand your situation correctly, you have two different types of equipment - 6 sets of type 1 equipment for cycles 1,3,4,5,6,7 and 2 sets of type 2 equipment for cycles 2,8.

If that is the case, you can write two sequences (one for cycles 1,3,4,5,6,7 and one for cycles 2,8) Then make 8 sequence calls (each in a new thread) to the appropriate sequence for whatever cycle you are on.

To ensure that only one unit can control a specific cycle's test equipment at a time, you can use locks (semaphores would work as well). At the beginning of both sequences, grab the appropriate lock. Of course, if you only have one set of type 1 equipment and one set of type 2 equipment, you may need to add two more locks corresponding to each set of equi
pment (otherwise, Cycles 1 and 3 could be trying to access your only set of type 1 equipment).

I've attached an example of this below. Notice that I am making use of a Sequence File Global array called CycleCounter, in order to keep track of what cycle each UUT is on, so we know what lock to grab.

Hope that gets you started.

Matt Pickard
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,718 Views)
Thanks for the answer Matt, but I think I may have asked the question giving out too many of the issues and not organizing my question well. Let me try to simplify it below. Thanks

I have a main sequence that I will loop 8 times. When the first UUT gets done the first iteration I want the second UUT to begin its first iteration while at the same time the first UUT begins its second iteration. This will be done in parallel - not sequential. Therefore the test will not wait until all UUT's are finished the first iteration to start the second.

Thanks
0 Kudos
Message 3 of 6
(3,717 Views)
Raceman,

I'm not sure how your simplified description fundamentally differs from the first description. So, please reply with further details. Consider explaining why my first reply won't meet your needs.

In the meantime, let's clarify some terminology to make sure we are on the same page. I understand "iteration" to be a series of steps/tests. You then want to perform this "iteration" on each UUT 8 times, which would really require "looping the main sequence" more than 8 times because there is the overhead of "filling" and "emptying" the pipe.

By "parallel," I understand that you need UUT1 Cycle2 and UUT2 Cycle1, etc. to be done simultaneously, which requires separate threads. "Sequential" would be performing all the iterations on UUT1, t
hen performing all the iterations on UUT2, and so forth.

Also, it would be different if you wanted the first UUT to run the first step, then the second UUT run the first step while the first UUT runs the second step, and so forth. In that case, you could use a single main sequence full of steps and put a lock on each step so only on UUT can run that step at a time. If I understand your needs correctly, the locks need to apply to a series of steps (iteration), in which case encapsulating each "iteration" in a sequence is a possible solution.

Matt Pickard
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(3,718 Views)
It may be that your solution works but I am unable to determine it. It appears to me when I run it that the order of the pop ups are:
cycle1 UUT3, cycle1 UUT2, cycle1 UUT1, cycle1 UUT0,
cycle2 UUT3, cycle2 UUT2, cycle2 UUT1, cycle2 UUT0,

...etc. If this is not the case then I appologize.

My intent is for the pops ups to go in this order:
cycle 1 UUT0,
cycle 2 UUT0, cycle 1 UUT1,
cycle 3 UUT0, cycle 2 UUT1, cycle 1 UUT2
cycle 4 UUT0, cycle 3 UUT1, cycle 2 UUT2, cycle 1 UUT3
cycle 5 UUT0, cycle 4 UUT1, cycle 3 UUT2, cycle 2 UUT3
cycle 6 UUT0, cycle 5 UUT1, cycle 4 UUT2, cycle 3 UUT3
cycle 7 UUT0, cycle 6 UUT1, cycle 5 UUT2, cycle 4 UUT3
cycle 8 UUT0, cycle 7 UUT1, cycle 6 UUT2, cycle 5 UUT3
cycle 8
UUT1, cycle 7 UUT2, cycle 6 UUT3
cycle 8 UUT2, cycle 7 UUT3
cycle 8 UUT3
END OF TEST:

Maybe there is a way that you can display the batch sequence using a wait step instead of a popup so that I can see what cycle each UUT is in. Your help is extemely appreciated, once again thank you for responding.
0 Kudos
Message 5 of 6
(3,717 Views)
Raceman,

In the Batch Model, I see the pop-ups in this order:

UUT 1: Cycle 1
UUT 2: Cycle 1
UUT 1: Cycle 2
UUT 3: Cycle 1
UUT 2: Cycle 2
UUT 1: Cycle 3
UUT 4: Cycle 1
UUT 1: Cycle 4
UUT 3: Cycle 2
UUT 2: Cycle 3
....


If you are seeing the UUTs execute the cycles in the reverse order, you could insert a wait step at the beginning of the main sequence which waits for RunState.TestSockets.MyIndex seconds. This would help ensure UUT0 grabs the first lock first. Just as I see it on my side, you probably won't see the UUTs go through the cycles in the strict pipeline order you've specified. That's just not the nature of multi-threaded operations. Once you spawn off a new thread, you are at the mercy of the OS to sched
ule it, unless you use a lot of locks. You can try placing more locks in the sequence I originally sent to make the order of execution stricter, but you should probably ask a few questions first:

1) Are the results of separate cycles and UUTs dependent upon each other (for instance, the result of UUT(n+1) depends upon how UUT(n) tests out)?

2) What is the ultimate goal of your application? to ensure that only one UUT accesses one resource at a time? to complete the tests as quickly as possible?

3) Why does your application need the strict-pipeline structure?


Yes, if it helps you can replace the popup message with a wait.


Matt Pickard
Application Engineer
National Instruments
0 Kudos
Message 6 of 6
(3,718 Views)