NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I modify the example CVI user interface to loop test a unit X number of times?

Anybody have experience with setting the CVI user interface to TestStand to loop X number of times ezach time the run test button is pressed?  I have set it up to do this, but it appears I have inadvertantly caused a memorry leak, and wonder if I am missing some handles that need to be deallocated.  Any pointers out there?
0 Kudos
Message 1 of 5
(3,166 Views)

Jeffster,

If you need to execute a test x number of times in a loop you could implement a loop within your sequence.

For example you could move your test to a different sequence and use the sequence call step type to call it.

From the step properties go to the Loop options and configure the number of loops for the sequence call step.

In that way your test would run X number of times while you hit the test (Run) button without the necessity of modifying the operator interface.

You could even make your sequence display a dialog asking for the number of loops you want to execute.

Best Regards.

Check the Step Properties Dialog Box  help in the TestStand environment Reference Help.

0 Kudos
Message 2 of 5
(3,159 Views)
Thanks for the idea.  Unfortunately, I can't call this sequence from another sequence due to configuration management issues with my employer (changes to the sequence steps require much paperwork).  If I could, I'd just loop the main sequence call.  What I'd like to see is the user able to enter a number into a control in the front panel, press the go button & walk away while the station runs the test X times & creates X reports.  This way, the code is the exact same regardless if I am running loops in the lab, or operators are running product on the floor.
0 Kudos
Message 3 of 5
(3,158 Views)

Hi Jeffster,

I'll first point out that I agree with Antonio that modifying the sequence is going to be many times faster than going through the OI, but if this is not a possibility, then we should be able to do it in the OI.  You'll want to do the following:

  1. Create a CVI Button (Not a TestStand OI ActiveX Button) and a numeric edit for the number of times to loop.
  2. In the callback of the CVI Button, use the SequenceFileViewMgrGetCommand to get the CommandKind_ExecutionEntryPoints_Set Command (The index should be set to the 0-indexed value of the Entry Point for which you want to run your sequence).
  3. In a for loop which executes the number of times in your numeric edit, you'll want to use the CommandExecute method to execute that command.

This will create seperate executions for each run of the sequence.  This should get you on the right track, but if you have any questions, please feel free to let me know.  Have a good one.

0 Kudos
Message 4 of 5
(3,135 Views)

If you loop on Command.Execute for an entry point command, you will get parallel executions. This doesn't sound like what is desired.

The desited behavior would be easiest to implement in the process model.  In the TestUUTs entry point, there is already a loop that exits when the user cancels it.  TestUUTs could be changed to instead initially prompt for an iteration count.  You can make a new entry point by copying TestUUTs so that you would still have the TestUUTs entry point.

To implement this looping in the OI, you should probably restart an execution or launch a new one in response to the ApplicationMgr.EndExecution event.  Your OI would need to track which executions are being looped and which iteration they are on.

0 Kudos
Message 5 of 5
(3,129 Views)