NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to terminate TestStand Application after a LabView error.

Solved!
Go to solution

Sury -

 

Could you provide more detail as to the use case for doing this? Through the command line you can currently execute two sequences simultaneously, is it absolutely necessary that you execute them one after another? Why couldn't these sequences be called as subsequences of a top-level sequence so that their order of execution was more easily controlled?

 

Perhaps if I had a better understanding of the use case and end goal, I could help provide a better solution than the one you are currently after.

Manooch H.
National Instruments
0 Kudos
Message 11 of 20
(2,313 Views)

Software: Labview 2009 and Teststand 4.2

Requirement : We need to run sequence/s based on their existence in a particular folder. This process should be a 24X7 and we don't want teststand to run continuously for 24X7.

Solution what we thought: Run a labview exe 24X7,which looks for sequences in that particular folder and if found, take the list, run a for loop accordingly and execute run command for teststand using command line giving the sequence to run. Once done as the teststand completes its execution it quits, runs the next sequence. Now every time we close and open teststand for a new sequence. If sequences not present, exe will be in Idle state, waiting for an sequence in the folder (event).

Problem: we don't every time teststand to close and open for a new sequence. Once it finds sequence/s, list out and run a for loop till it completes sequence/s execution and then look if new sequences present. If not close teststand.

 

These sequences come from a network drive programatically to this folder, there is totally different labview EXE do this.

We want labview to run instead to teststand because of report generation issue. As long as teststand sequence runs, we have a report generating which we don't want it to happen.

 

Thanks & regards,

Surya.

0 Kudos
Message 12 of 20
(2,298 Views)

Sury -

 

If my understanding is correct, the reason you chose the approach of a LabVIEW exe is because if you were to use TestStand, you would have unneccessary results generated in your report. Is this correct?

 

If so, are you aware that you can disable result collection for certain steps and sequences such that they are not shown in the generated report? For steps, you can disable result recording in the Step Properties under the Run Options. For sequences, you can disable result recording in the Sequence Properties under the General tab.

 

It might be easier for you to have a sequence that runs 24/7 which calls into LabVIEW VIs to check if sequence files exist in the specific network location. When they do, the VI could return an array of paths to sequence files that need to be executed and then these could be executed in a loop. All of these steps except for the step that calls the necessary sequences would have result recording disabled. Here is some pseudo code of what this might look like:

 

While (continueExecutionFlag)  //Disable Results for this step

 

     Call LabVIEW VI to check for sequence files in the network location //This step will return array of paths. Disable Results for this step

 

     For (number of elements in the array path returned from the VI)  //Disable Results for this step

 

          Set Sequence File Path for Call Sequence Step using current array index  //This step will programmatically specify the sequence file to call in the Call

                                                                                                                      //Sequence Step. Disable Results for this step

 

          Set Sequence Name for Call Sequence Step  //This step will programmatically specify the sequence name to call in the Call Sequence Step.

                                                                             //Disable Results for this step

 

          Call Sequence Step //Call the appropriate sequence in a new execution using the Single Pass entry point.

                                       //Make sure the Wait for Execution to Complete option is set to Before executing next step in the

                                       //Sequence Call Advanced Settings. Also make sure the Close Window when Done option is checked in the

                                       //Sequence Call Advanced Settings.

 

     End  //End For Loop. Disable Results for this step

 

End  //End While Loop. Disable Results for this step

 

 

This controlling sequence file would ideally be set to not use a Process Model. This can be configured in the Sequence File Properties Advanced tab.

 

You could obviously modify this a bit if necessary, and I'd be happy to help out with that. Please let me know if this sounds like a viable solution. Hope this helps.

Message Edited by Manooch_H on 03-02-2010 11:10 AM
Manooch H.
National Instruments
Message 13 of 20
(2,293 Views)

This is one of the best logic to implement, this was my first thought of implementing the requriement, but there are few more contraints which makes our team to move towards labview instead of running continuously teststand for 24X7. 

One of the major is memory leaks, as the project started a year ago, the team which has implemented the code modules have left and our team has taken over this project where time constraint was major issue or we were pretty much confident in Labview compared to Teststand so thought of moving most of the implementation towards LV which made our production faster. The code implemented by previous team contains lots of memory leaks which requires time to go through each and every modules and modify, which we are limited by time factor.

So finally, we thought when ever we have no sequences left to run we can close teststand so that memory leaks go away, though its a temperory solution.

 

If we are able to handle memory leaks programatically through teststand, we will defiently implement your suggested logic.

 

 

Thanks,

Surya.

0 Kudos
Message 14 of 20
(2,274 Views)

Sury -

 

If you are referring to memory increasing from Result Collection, as long as you do not record results from your controlling execution, then I don't believe you would run into any memory leaks. Especially considering the fact that each call to a sequence would be performed in a new execution which eventually completes and closes (causing the execution object to be destroyed and the memory it stores to be discarded).

 

Furthermore, if you're concerned about memory issues because of modules being loaded into memory, you could simply call Engine.UnloadAllModules() as the last step of the outer, While loop iteration to ensure that the only module in memory would be the LabVIEW VI that checks for available sequence files on the network drive.

 

I think this approach is at the very least, worth a shot. It would probably not take much time to implement and test out. I can even provide an example for you if that's what it takes.

Manooch H.
National Instruments
0 Kudos
Message 15 of 20
(2,261 Views)

That would be good if you provide with an example.

 

Thanks a lot.

Surya.

 

 

0 Kudos
Message 16 of 20
(2,259 Views)

Surya -

 

Here you go. Please note that you will have to browse to the VI that will return an array of Sequence File Paths. Store the array in Locals.SeqFilePaths. The While loop runs indefinately so you will either need to change the flag to something that is controlled by the VI, or use a Break step with some sort of precondition. Give it a shot and let me know if this works for you or if you have any questions.

 

Hope this helps.

Message Edited by Manooch_H on 03-02-2010 06:46 PM
Message Edited by Support on 03-03-2010 12:39 PM
Manooch H.
National Instruments
0 Kudos
Message 17 of 20
(2,255 Views)

Thanks a lot Manooch.

I will definetly try this out and will come back to you with updates soon.

 

Surya.

0 Kudos
Message 18 of 20
(2,250 Views)

Surya -

 

I've updated the example just a bit to allow the CPU to provide resources to other threads during the execution. I just placed a Wait step in the For Each loop, assuming that the LabVIEW VI you call will have a wait in its loop or some sort of event structure to perform blocking while you wait for files. I also implemented the unload all modules in the Sequence Call step as opposed to using a statement step.

Manooch H.
National Instruments
Message 19 of 20
(2,217 Views)

Hi Manooch,

 

 "ControllingExecution_40.seq" worked out for us.

 Once again thank you for driving us to the right path for the solution.

 

Best Regards,

 

Surya

 

0 Kudos
Message 20 of 20
(2,116 Views)