From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Batch Synchronization

Solved!
Go to solution

Hello,

i have a model with 4 sockets where i run a sequence (screenshot attached) and using  Batch Synchronization. All Batch-Settings in column "Settings" are set to "One Threead only".

Each of the three "Batch Synchronization "Enter"-Steps are also finished with an Exit Batch.

The question is now why do i get after the while loop the attached error?

 

Thanks

Download All
0 Kudos
Message 1 of 6
(3,993 Views)

Your Break step is breaking the While loop.  NOT the  If statement.  Hence the error.  Because you aren't exiting your CHECK and IF synchronization steps the engine expects to see those before the EXIT While synchronization step.

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 6
(3,976 Views)

Yes, i want to quit the while-loop with the break

Can i simply copy the two exit steps also in the if-statement before the break happens?

 

Another thing is:

The While-loop is set to OneThreadOnly. Later the subsequence "ExecuteSomething" is running for all four threads. Two steps later the LabviewProgram calculates the variable to quit the WhileLoop.

Currently i see that suddenly only thread 1 (of 4) is executing the whileloop and the other three threads stopped (I see it as the teststep results for thread 2,3,4 are suddenly missing). How can this happen?

Normally all 4 threads should execute or do you see any error that some threads can quit the while looop earlier?

Thanls

0 Kudos
Message 3 of 6
(3,967 Views)

I found out where the problem is (but not how to solve it yet):

In the attached file (for 4 sockets) i only have the While Loop that executes a subsequence.

In the subsequence is a popup that displays Str(RunState.TestSockets.MyIndex). So it shows 0,1,2 or 3

The while-loop is set in Synchronisation properties to "One thread only".

When i execute the program i see 0,1,2,3 for the first loop and for all other loops only 0,0,0,0,0,0,0,0

So exactly my problem.

 

When changing Synchronisation properties to "No synchronisation" then it shows correct always 0,1,2,3 for all loops.

So is it correct to set it to "No synchronisation"?

As i only want to execute the whileloop once and not four times parallel while-loops (what does not happen?)

 

Thx

 

Download All
0 Kudos
Message 4 of 6
(3,958 Views)
Solution
Accepted by topic author OnlyOne

By setting the While step to One Thred Only you are telling the other sockets to just run through the code once (i.e. as if the While step did not exist for the other loops).  Hence why they exit the looping on the first iteration and only the socket that was the "one thread" will finish off the looping. 

 

I think I'm a little confused on exactly what you want the code to do.  I think you need the while loops to execute for all threads if you want all of the sockets to loop.  There isn't a way around that.  Why don't you want the While step to execute for each thread?

 

Regards,

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

Thanks for explaining.
I changed my While thread to run for all Threads (No synchronisation).

I want that all sockets are looping.

 

(I thought up to now that is enough if the while loop is done by one thread. And that the subsequence inside of this while loop is still done for all four threads as i didnt specify a special Synchronisation there. I thought if i have four while loops which execute a subsequence with four threads will result in 16 parallel threads os i set the whileLoop to OnlyOneThread. But now i know i was wrong :-). It seems as the WhileLoop exists only once and not four times parallel)

 

Thanks

 

0 Kudos
Message 6 of 6
(3,945 Views)