From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

preconditions vs step containment

I'm wondering if there is a 'best practice' when it comes to making your steps self contained?  I have a sequence that first performs an initialization step (or sequence) that basically ensures all test equipment is powered up and ready.  Each subsequent test, obviously, depends on the success of this step.  In a different application we created, all tests that followed the initialization had a precondition that this test passed.  In our current app, however, we want each the operator to have the ability to run each step independently.  So, even though we need the initialization to have run successfully, is there a way to get around having to give each post-initialization test a precondition?
0 Kudos
Message 1 of 4
(2,930 Views)

Hi mrbean,

If you put the (any) initialisation in the Setup with the post action set if unsuccessful going to the Cleanup. Therefore if the execution has reached the Main, then the initialisation must have been successful. Hence no precondition will be required.

This will work for Selected Step(s) because the Setup Group is always executed first, then the selected steps.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 4
(2,928 Views)

I understand what you're suggesting.  We have a little twist, however.  In normall TestUUT mode, we want to initialize, run all tests and cleanup (power down the UUT in this case).  If the user is going to perform run selected tests, as it stands right now, initialize (in setup) would happen, then the specified test(s), then cleanup.  What we want (during run selected) is to run initialize, run the specified test(s), and not do cleanup (yet) because the operator may just want to keep running selected tests to help isolate a problem.  In this case, he doesn't even want to have to perform initialize (especially if it's a fairly involved BIT) every time. 

I think I'm talking my way into creating a customized version of the SequentialModel.seq, where modified functionality (and different HMI capability) occurs depending on the entry point selected.

0 Kudos
Message 3 of 4
(2,918 Views)
mrbean,

You are correct, if you want the initialization to occur before your TestUUTs and the Clean-Up to only occur at the end of all tests, then you would need to modify the SequentialModel.seq OR override the ProcessModel Callbacks in your sequence file. To do this, go to Edit>>Sequence File Callbacks and from there you'll probably want to override PreUUTLoop (for initialization) and PostUUTLoop (for clean-up). This way, you execute these sequences before any of your UUTs execute and after they all execute (respectively).

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 4 of 4
(2,894 Views)