NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Buffer in step not initialized

My environment is: TestStand 3.0 and CVI 7.0 on a Windows 2000 platform.
 
I have some customized TestStand steps which are identical to the supplied NI steps with the exception of an additional text buffer named Info. I have an sprintf-like utility function which formats text and then appends it to the Info buffer. I have customized the report generator to insert the contents of the Info text buffer into the test report after the normal step output.
 
The problem that I am having is that for the most part this works beautifully and inserts the additional text into the test report. But periodically, it appears that the Info buffer did not get cleared at the beginning of a step and I find the Info output from some previous steps in my test report. I can manually clear the Info buffer in the affected step by inserting (Step.Result.Info = "") into the pre-expression of the step.
 
While this solution works great, it's like swatting flies. Each occurrence has to be treated individually. I am looking for a global solution that I can apply once and be done with it. Does anyone have such a solution?
 
Hurst C.
0 Kudos
Message 1 of 6
(3,197 Views)
Hey Hurst,

This is a little hard to troubleshoot why it is happening without knowing more details about your custom step, and how you are inserting data into Step.Result.Info. One workaround might be to edit your custom step so that it has a default pre expression of the Step.Result.Info = "" so that all new steps used would already have that in the pre expression. However to apply these changes to all steps you would have to open all sequences that use that step and then select the "Apply Changes in this Dialog to all Loaded Steps" checkbox at the bottom of the Step Type Properties Dialog.  

Another possibility would be to create a custom pre step substep that used the TestStand API to automatically set the Step.Result.Info to an empty string. If you have a small sequence that reproduces the problem, you could post it here for everyone to take a look at. Hope this helps!

Message Edited by Patrick P. on 05-11-2007 09:33 AM

Pat P.
Software Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,190 Views)

Patrick,

I have a number of power supplies (same model nr) that I am testing. Each power supply calls the same sequence to do the testing, resulting in steps being called multiple times. Each time a step is called, all of the steps history is in the buffer.

 

I was looking in the callbacks and see that there is a pre-step engine callback in the process model. I guess if I implemented the buffer clearing there, the effect should be global. I just wonder how much the pre-step callback will slow down the test since I also have to determine if the Infobuf even exists before I access it.

Hurst

0 Kudos
Message 3 of 6
(3,177 Views)

You can get a value from a previous sequence run if you don't clear the value and the Edit>>Sequence Properties>>Optimize Non-Reentrant Calls to This Sequence option is set.

This option is set by default to improve performance. The help for the option has more information.

However, you can also see a previous property value within a single sequence run if you branch back to a step with a goto or a loop. This behavior is by design, both for function and performance.

Thus you should probably clear the buffer, or overwrite it instead of appending. 

 

0 Kudos
Message 4 of 6
(3,174 Views)

Pre and Post step callbacks have the overhead of a sequence call. If your steps take a long time on average, you won't notice it. However, if your steps are very fast and you have a lot of them, you will see a slow down.

 

Step properties are not a good place to store history information. For example, if you call the same subsequence in parallel threads (or executions) or call it recursively, you'll have multiple instances of the steps, inadvertantly splitting the histories.

 

If possible, it would be better to store history information somewhere else, perhaps in fileglobals. Also note that if you put the property in the step result, you could reconstruct the history for each step by iterating the result list after the test completes and finding the set of results generated by each step.

 

0 Kudos
Message 5 of 6
(3,165 Views)

I am NOT trying to store history information.

My utility function works like a printf call. Multiple printf calls in a step just append their output to the buffer. What I meant by history was:

when the first power supply calls the sequence, its output appears in its section of the test report.

when the second power supply calls the sequence, what appears in the test report for its section is the output from power supply #1 followed by the output from power supply #2.

Finally when the eigth power supply called the sequence step the test report section for the eigth power supply contained the outputs of all eight visits to this step.

I am testing a whole system, so I can't test the individual components seperately.

 

Hurst C.

 

0 Kudos
Message 6 of 6
(3,159 Views)