NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Step details

Hi
 
I am in need of customizing the OI(in C# .net), after executing every step i want to store the step result details (on the fly) in to a file. is there  any event (or UI message ) in the test manager controls that will trigger after every step execution. so that i can able capture the executed step details (like parameters, step name,execution time etc.);
 
also i need one more help. if the user press abort it has to abort the execution and when the user press restart it has to restart from the aborted step. also the remain step result report needs to be appended with the previous one. how can i do this. any sample codes,link appreciated
 
Thanks in advance
Regards,
Srini
0 Kudos
Message 1 of 6
(3,972 Views)

Hi

With regard to the first bit.  You could configure the TestStand SequenceFilePostStep Engine callback to post a UI Message to your Operator interface, that message could pass any data you like to your OI.  Your OI would have to handle the UI Message and then process the data.  See TestStand II Customisation Course notes for handlnig UI Messages.

Hope this helps

Steve

There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 2 of 6
(3,952 Views)
Howdy Srini -

Steve was right on with his suggestion - the SequenceFilePostStep Engine callback can be used, and within that callback you can post any number of UI messages to communicate the step data back to the OI.  You could also consider the ProcessModelPostStep Engine callback, which would be defined in your process model.  This engine callback would have higher scope.  When any client sequence is run by that process model, the engine would call the ProcessModelPostStep callback.  Also, in addition to the TestStand II course manual, you can also find more information in chapter 10 of the TestStand Reference Manual (found in <TestStand>\Doc\Manuals\ ). 

The abort button functionality is quite a bit more complex.  It sounds as if you would almost prefer a "pause" to an "abort" for your user abort.  You could use the BreakExecution method.  This method generates a Break event.  Within the break event, you could take a few steps to append the current results to the report:
- Since the break event includes the sequence context as a parameter, you can find the current ResultList under the locals variables of the sequence.
- You would then need to turn the ResultList into a formatting string for the type of report you are doing (ASCII, XML, HTML).  This part will be complex.  I would suggest taking a look at some of the code modules the process model calls to create the formatted string from the resultlist.  You may be able to use one of same DLL calls the process model uses to accomplish this section of the task.
- Get the current report object from the sequence context, and use Report.Append to append the current string into the report.
- Clear the current ResultList so that the report data will not be written to the report twice.

Alternatively, you could write the current ResultList to a file and look at the file to see exactly what is happening with the sequence context at that point.

I've attached an example which includes a "retry" button functionality.  For this example, you need to have StationOptions.BreakOnStepFailure set to True.  It may help you quite a bit in getting started.

Let me know if you have any other questions.

Have a great day!

Andrew W || Applications Engineer
NI
0 Kudos
Message 3 of 6
(3,946 Views)

Hi andrew and steve thanks for ur reply..

i could not able to find SequenceFilePostStep Engine callback and ProcessModelPostStep Engine callback. i thing i have to add these call backs into my process model using Edit-> Sequence File Callbacks -> SequenceFilePostStep  - yes ->click Ok        is  it correct??

if it so But where i have to  configure this callback how to post UI messages from this callback?. and when will it be called (will it be called after every step execution) ? i thing i have to create one action step in  the SequenceFilePostStep which will call Thread.PostUIMessageEx ( eventCode, numericDataParam, stringDataParam, activeXDataParam, synchronous) there i can pass ThisContext as parameter to this function. and in my code how can i access the current step properties?.... (like step parameters,result,execution times when it was started as like in report ) but using this SequenceContext.Step function i can view the result only how to get the other things that i mentioned in the brackets?

 

2 Andrew :

 

I dont have VI software could you please send me the same example in VB or C# or C

 

TIA

Regards,

Srini 

 

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

Hi Srini

 

You can access the parameters from inside the ProcessModelPostStepFailure using lookup strings of the type RunState.CallingStep.Result.Status.  There are loads of others that can be used, best to look around inside the property browser having stopped at a break point in your ProcessModelPostStepFailure sequence. 

 

You can pass both numeric and string data to your OI using Thread.PostUIMessage and you can call it multiple times. Identify different types of messages using the event code parameter that must be UIMsg_UserMessageBase and above.  It is important that you include a UI messge callback function in you OI code that handles each type of event code message sent from your ProcessModelPostStepFailure.

 

Contact NI for examples on positng and processing UI Messages.

 

Steve

There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 5 of 6
(3,912 Views)
Howdy Srini -

Again, to reiterate Steve's points, you can just pass the sequence context, and use lookup strings to access the information.

Unfortunately, the example was only created in LabVIEW, and we currently do not have a similar example in any of the text based languages you mentioned.


Andrew
0 Kudos
Message 6 of 6
(3,886 Views)