NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Progress of long tests

I found this pretty slick example in the <TestStand>\Examples\DisplayingProgressAndStatus\UsingLabVIEW.  I've attached it (LongTest.vi).  Anyway, it displays (back at TestStand) the progress of a long test.  I have a definite need for this.  I'm just not quite clear how some things work in the VI. 
1) How are the values of the TestStand - Create Test Data Cluster.vi actually filled.  I don't see any wires going to this subVI and I don't see any references.
2) What tells the TestStand OI where to display this progress information?
3) I would like to modify this VI so that I can call it from my different (lengthy) VIs as a subVI to kick it off if the VI stops due to error or any other valid reason, the progress bar can also be stopped.
 
Any suggestions on these questions?
 
Download All
0 Kudos
Message 1 of 11
(4,294 Views)
mrbean,
For 1) the create test data cluster.vi is a legacy VI for the old teststand version.  You don't have to use it.  Also, in the example they are not wiring anyting to is so it will just output the default values.  The old version of teststand was very strict as to what controls and indicators you were allowed to have on any VI called by teststand.  This VI was an aid to make sure developers created the correct output cluster. With the new versions of Teststand you are not limited in that way.
 
For number 2) I am pretty sure that it is going to the status bar.  It is using a built in UI message to update an ActiveX control.
 
Hope this helps and that was a very good example that I was not awair of, so your post helps me too.
Message 2 of 11
(4,274 Views)
It is going to the status bar. To see how that works, look at the shipping LabVIEW example for the full-featured OI.
0 Kudos
Message 3 of 11
(4,272 Views)
Thank you for the info on (1) and (2).  (3), however, is the one that's causing me grief.  The example VI is self contained.  But I'd like to make this a subVI that our team can call in their various tests (if justified), but I need to have some more control over it.  Any design suggestions on how to approach this?
0 Kudos
Message 4 of 11
(4,266 Views)

The attachment below shows what is important. There are the two properties for updating the progress bar and % complete. Whatever value you pass into this by the 'percent' control will be displayed. How you use this in your code will depend on the code. If you have a loop that iterates a certain number of times, you can calculate the percentage pretty easily. If it executes for a known amount of time, then that too can be implemented. The shipping example does that by getting the start time at the beginning and the current time with each iteration.

Message Edited by Dennis Knutson on 02-08-2007 10:10 AM

Message 5 of 11
(4,257 Views)
I was going to test this and I realized that I didn't account for the case where the developer just wants to run his VI standalone (without TestStand), in which case, the thread reference would be invalid.  Should I pass in a boolean (such as CalledFromTestStand) that I check before performing the code?  I'm sure there is a cleaner way.
0 Kudos
Message 6 of 11
(4,244 Views)
You should be able to test the refnum first before trying to use it.  Use the NaN/Path/Refnum? in the comparision palate.
Put the code in a case statment and execute the status update code only if the refnum is valid.

Message Edited by paulmw on 02-08-2007 01:29 PM

Message 7 of 11
(4,242 Views)
I modified my code to resemble Dennis' example and it works great for deterministic tests.  However, I have a test of an Oscilloscope that after a couple of Open Session calls, goes into a vendor-supplied Self Test VI that doesn't return for about 6 min.  Is there a good way to set up a dual while loop (parallel) where one is running the self test, and the other is updating TestStand (every 10s) with a progress status?
0 Kudos
Message 8 of 11
(4,226 Views)
Like you said, you just have to create a second parallel while loop. The shipping example is a good example of a while loop that updates the percent complete based on a start time and a target time. The time it takes for the self-test to complete can be measured and you can put that in the while loop as the stop time. I would also recomend that you set it up so that the while loop terminates when the self-test completes. That way your VI is not taking any extra time. You could set an occurence when the self-test subVI returns.
Message 9 of 11
(4,223 Views)

Here's a simple example of what you could do. A queue is created and in the bottom while loop, the queue is read and when the queue is released, the while loop stops. The percent complete could be obtained from the Long Test subVI since it can write to the queue. If the Long Test subVI cannot write (i.e. in the case of a self test going off and taking x amount of time, use a start and stop time in the bottom loop like the shipping example does.

Message Edited by Dennis Knutson on 02-09-2007 08:24 AM

0 Kudos
Message 10 of 11
(4,215 Views)