NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronize section within a sequence runnin over parallel model

Have this sequence using the parallel model, I want to synchronize some section of it such that the steps been executed only in one of the executions; the Batch Synchronization steps didn't worked, apparently they work only if running the batch model. Tnx.
0 Kudos
Message 1 of 8
(4,115 Views)
Hi,

You might try using the auto schedule, see example \TestStand\Examples\Auto Schedule\..

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 8
(4,109 Views)
Why not use the Batch model? It sounds like it might more closely fit what you are trying to do.

Otherwise if there is a step that you always want to run in only a specific execution you could use the testsocket index to conditionally decide whether to run it in its precondition.

-Doug
0 Kudos
Message 3 of 8
(4,100 Views)
Ray,
I'm affraid my TS version (2.0.1) doesn't yet support the possible option you are suggesting.

Best Regards.
0 Kudos
Message 4 of 8
(4,096 Views)
Doug,
I wonder myself too, why not to use something like batch model, unfortunatelly here they use a custom model which is used in a number of testers and has a NI Parallel Model shape, never used before for batch type testing. I tryed this:

i) Use a Randevois before my Only One Thread Synchronized (OOTS to abbreviate) section.
ii) Enclose OOTS steps in a separated sequence.
iii)Call this OOTS sequence after the Randevois but conditioned to only executed by socket 0 (like you suggest using socket index).
iv) The calling to the OOTS sequence its been done launching a separated thread, and storing this in an ActiveX reference
v) Set a Wait for Thread step after the calling, in this way every thread will wait and know about the result of OOTS steps.

Comments are welcome.

Regards.
0 Kudos
Message 5 of 8
(4,095 Views)
The One Thread Only setting will only apply for the Batch model.

Your method of checking the SocketIndex as a precondition on calling a sequence (or even a precondition on several steps) will certainly work. Another way, rather than waiting for thread, is to simply use another rendezvos after the section of code that is called. So your sequence will look like this:



Step (1 thread)
Step (1 thread)
....



Allen P
NI
0 Kudos
Message 6 of 8
(4,072 Views)
My syntax got taken out, so I will retry that last post.

--Create Rendezvous--
--Rendezvous--

step 1 --one thread only--
step 2 --one thread only--

--Rendezvous--
0 Kudos
Message 7 of 8
(4,065 Views)
Looks simpler but on every thread I have to be aware of the result of the steps executed on only one of them in order to decide whether to continue or not.

Pako.
0 Kudos
Message 8 of 8
(4,060 Views)