NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get socket Termination State in PostBatch callback?

Hi,

I would like to exit the batch loop when at least one execution have TermState = ExecTermState_Terminating (Value: 2). When a socket is terminated with RunState.Execution.Terminate() (e.g. because of error), the sequence goes to PostBatch, and after status dialog, I would like to set ContinueTesting flag to False (if any TermState = 2) to exit the batch loop and goes to ProcessCleanup.

 

 

I tried many things: storing RunState.Execution from socket MainSequence in an array and use it in PostBatch with GetStates method, I tried Parameters.ModelData.TestSockets[0].TermState, and some other weird ideas, but everything failed... 

 

This information is obviously stored somewhere because status dialog displays that socket is terminated, but I can't find it 😞

 

I would really avoid process model modifications.

 

An example in the attachment.

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
0 Kudos
Message 1 of 2
(2,987 Views)

Hi Bienieck,

 

the BUUT_ShowStatus function that presents this dialog box is called from modelsupport2.dll. The source code of modelsupport2.dll is available in the C:\Program Files (x86)\National Instruments\TestStand [version]\Components\Models\TestStandModels\modelsupport2 folder, batchuutdlg.c contains the source of this function. Based on the source code the Parameters.ModelData.TestSockets[socket_index].MainSequenceResults->Status string is checked to determine termination status ("Terminated" value.)

 

Best regards,

Dániel Fülöp
Field Application Engineer (CLA, CTA)
National Instruments
0 Kudos
Message 2 of 2
(2,770 Views)