NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop a running parallel-sequence

Hello,

in the SeqFileLoad of My Model i execute a sequence-file as "new execution". This file is looping all the time in parallel and checks the com-port. If a special-character is read then a ExecuteTestUut of my real measurement-sequence is executed. So all test-starts are only run via serial-port

Everything works fine. The only problem is: How do i stop this parallel-sequence?

I tried it with a varaible that jumps out of the loop with a Goto.

Then i wanted to set this variable in the SeqFileUnload of the ModelSequence.

But this is not working - immidiately after i close the TS-window i get a popup that says "you have incomplete executions - Abort - Shutdown -...".

 

So how can i easy stop my sequence? Is there an event somewhere that "sees" if someone closes TS?

 

Thanks for all help

0 Kudos
Message 1 of 8
(4,670 Views)

Hi,

 

the best would be to post your code so I can have a look at it and see where's the problem located.

 

Best regards

Suse

______________________________
Certified LabVIEW Developer (CLD)
0 Kudos
Message 2 of 8
(4,651 Views)

Like Suse said it would be better to post some example code that shows the problem.

 

If I understand your problem correctly: You should send a notifier from the main sequence then add a wait for execution to stop. In the sub sequence (the one reading the com port) you should read the notifier if TRUE then stop the sequence.

 

Hope this helps

Rodéric L
Certified LabVIEW Architect
0 Kudos
Message 3 of 8
(4,649 Views)

Sequence files cannot unload while they are being used by an execution, thus, if your unload callback is in the same file as the sequence that is executing, it won't ever get called while the execution is running. You could split it up so that the new execution is in a different sequence file. That would let the original sequence file's unload callback run. But that might not give you the behavior you want because if you press the close button in the sequence editor, it's going to prompt you about running executions before it tries to close anything (at least I think it does, you might give it a try).

 

-Doug

0 Kudos
Message 4 of 8
(4,637 Views)

Let me try to explain.

I have one modelsequence-file.

I have one ParallelSequence-file

I have one measurement-sequence-file

 

When starting TestStand then the model-sequence execute the SeqFileLoad.

In the SeqFileLoad i have a call to the ParallelSequence.

The ParallelSequence is looping alle the time and polls the comport.

If a special-character is read at the comport then i stark a TestUut for the measurement-sequence.

The ParallelSequence is waiting for the end of measurement with a Notification and after its finished the loop continues.

 

Now i set in the SeqFileUNLOAD of the modelsequence a variable. Lets say itc called "StationGlobals.Exit == True".

I use this variable in the looping parallel-sequence and check in each loop if this variable is True. If it would be true then i exit the loop with a GOTO END.

 

But the probem is as @dug9000 says, that the Close-Button does not care about the Unload-sequence of the model and immidiately shows the popup with "incomplete executions".

0 Kudos
Message 5 of 8
(4,629 Views)

I have an example that might help you, it runs two processes in parallel, I'll post it tomorow morning (I use the sequential model but it may help you)

Rodéric L
Certified LabVIEW Architect
0 Kudos
Message 6 of 8
(4,625 Views)

Hi,

 

You may want to try calling the Engine.TerminateAll method to terminate all of the executions at the same point where you currently set your Exit station global.  This will terminate any running executions (assuming no threads are in a code module when the call is made). Once the executions are terminated, you shouldn't see any object not released errors when closing.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 7 of 8
(4,613 Views)

Hi,

 

this is an example sequence that might help you.

 

Main sequence launches 2 sub sequences that communicate using a FIFO, if a particular element is enqueued then all sequences stop. (here if element "stop" is enqueued), in your case it would be any element read by your comport.

 

 

@Ballington: I'm not sure calling the Engine.TerminateAll method is the "right" way to go, but it should work anyway...

 

 

Regards

Rodéric L
Certified LabVIEW Architect
0 Kudos
Message 8 of 8
(4,602 Views)