NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

execute a sub-sequence (or a Step) in one thread only in a parallel model

Solved!
Go to solution

I have multiple threads running - I only want the first one turning a certain device on and the rest of them just skipping this sub-sequence.

Rather than designing a system of flags - I was hoping there is a way to rig syncronization behavior similar to the batch synchronization option of "one thread only"?

 

 

Is there a way to have all the sequence by pass the step at the end that turns this device off and the last one executing the turn off?

0 Kudos
Message 1 of 10
(5,116 Views)
Solution
Accepted by topic author rsmrostov

Hi rsmrostov-

 

Refer to this topic: http://forums.ni.com/t5/NI-TestStand/Implementation-of-synchronization-steps-without-using-batch-or/...

 

Batch Synchronization Step Types will only work when using the Batch Process Model (without additional implementation on your part to synchronize the threads executing in the Parallel Process Model).

 

TestStand offers the Batch Specification step to define a group of threads; enabling you to perform Batch Synchronization in a non-Batch Process Model. Refer to the attached Sequence File for a reference to an implementation using Batch Specification steps.

 

-Jeff

Message 2 of 10
(5,110 Views)

Move it to the ProcessSetup and ProcessCleanup callbacks.  That way it will only occur once because these happen before and after the threading.

 

 If you cannot move it to those callbacks then I would recommend you use the batch model.  Synchronizing the parallel model for this purpose within the threading voids the purpose of the parallel model.  At that point you may as well do the batch.

 

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 3 of 10
(5,109 Views)

Thank you so much, that's exactly what I need!!!

0 Kudos
Message 4 of 10
(5,095 Views)

may be I jumped the gun - with what you are suggesting all threads still go into the sequence, only doing it 1 by 1....I need the first one to go in, and the rest to skip.

0 Kudos
Message 5 of 10
(5,073 Views)

Neither one is feasible for me:

I can't touch the process model - because this will alter the behaviour of the rest of the tests

I can't change the process model for the same reason as above.

0 Kudos
Message 6 of 10
(5,072 Views)

rsmrostov-

 

In that case, just put the SequenceCall step inside the Batch Synchronization section (see attached image for an example).

 

-Jeff

0 Kudos
Message 7 of 10
(5,069 Views)

That is exactly what I am doing - what I am observing is one thread enters the batch - executes, other one waits, than also enters the batch and executes - what you gave me works like a lock functionality.

 

Even if you run the example you have given me - you can run each SN through your batch, while the goal is to execute the first one that comes in and bypass all others

0 Kudos
Message 8 of 10
(5,044 Views)

Ignore this post.  It was an accident.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 10
(5,034 Views)

Do you need to synchronize the threads at that point?  If so then I'd recommend using a rendezvous.  I've thrown together a little example.  Check it out.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 10 of 10
(5,034 Views)