NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Looping through parallel model starts at index 1 instead of 0 on second execution

Solved!
Go to solution

Hello forum

 

I have an issue with looping through the UUT loop. Even though I configured the loop to start at 0 it starts at 1 from the second time I start the test without stopping and restarting the sequence. I attached the modification to the process model as a screenshot.

 

Thanks for any help!

Raphael

loop.png

0 Kudos
Message 1 of 10
(4,871 Views)

What is you purpose exactly ?

Test only 3 UUT on a socket, and then stop the socket execution ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 2 of 10
(4,845 Views)

yes, loop three times then stop and wait for the next start command from the GUI.

0 Kudos
Message 3 of 10
(4,838 Views)
Solution
Accepted by topic author raphael.wittwer

Why do you keep the counter in a SG ?

This loop is for a specific socket to run as much as needed. If you keep a counter as normal, but use a variable (local) to set the max number of loops I guess you won't have any problems.

From what I see, it should work, but keeping the counter in a SG sounds weird to me.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 4 of 10
(4,827 Views)

The idea behind the station global was that after a crash the sequence would start with the right batch, but as it is now I don't need this functionality. I will try a normal local variable and see what happens.

 

Thanks!

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

HI Raphael,

 

 just ran into this few days ago : in case of a crash (meaning complete app crash or PC being unplugged for example) there is a chance that your SG won't be saved !

Indeed SG are saved whne the Engine shuts down or if you call a specific Commit method.

 

See here : https://www.ni.com/docs/en-US/bundle/teststand/page/station-global-variables.html

 

 

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 6 of 10
(4,818 Views)

I tried locals for this counter and propagated it through the sequences, unfortunately this has the side effect that the sequence starts running without user input. I undid the change since this seemingly breaks other things.

 

I will need to find a point to reset this counter since the loop does not work as I expected, probably right after the GUI is called.

0 Kudos
Message 7 of 10
(4,812 Views)

I tried today reinitialising the for loop after the GUI gets called, unfortunately this does not change anything. The "first" iteration still is 1 instead of 0 on the second pass. On top of that I noticed that the loop counter goes up to 4, which should be impossible with the parameters from above.

 

2020-11-27_13-42-40.png

0 Kudos
Message 8 of 10
(4,785 Views)

the solution was to use Locals.xy and propagate them into and from the sequences. What was missing the first time I tried was the parallel model was still using the state from the station global instead of the local which led to unexpected behaviour.

 

Thanks for your help!

 

 

0 Kudos
Message 9 of 10
(4,781 Views)

I didn't do much !

Glad you found a solution ! 🙂

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 10 of 10
(4,778 Views)