Posting Messages to Status Text Controls in the Parallel Process Model's UUT Dialog

Updated Jan 16, 2019

Reported In

Software

  • TestStand
  • LabWindows/CVI

Issue Details

The Test UUTs execution entry point of the Parallel process model displays a UUT dialog that contains status information for each test socket that is currently executing. I would like to include my own personal custom messages in the status text controls. Is this possible?

Solution

Yes, it is possible to include custom messages in the status text controls. 

The Parallel UUT Dialog functionality is implemented in the modelsupport2.dll found in the <TestStand>\Components\Models\TestStandModels\modelsupport2 directory. By default, the status text controls will only display standard status messages. However, it is possible to modify the source code of the modelsupport2.dll to enable custom messages. Refer to the steps below to modify the source code to allow custom messages to be included in the status text controls:

(Note: Before you modify any source files, copy the TestStandModels directory over to the <TestStand Public>\Components\Models\modelsupport2 directory.)

1. Launch LabWindows/CVI and open the modelsupport2 project (modelsupport2.prj).
2. Inside the Project Tree, open the paralleluutdlg.c source file located under the Source Files folder.
3. Scroll to the bottom of the source file and insert the following code: 
 
int DLLEXPORT _stdcall PostParallelUUTDialogStatusMessage(int dlgHandle, int testSocketIndex, char *statusMsg)
{     int error = 0;
      ERRORINFO errorInfo;
 
      int panelId = dlgHandle;
      int childPanel = -1;
 
      PUUT_PanelData *panelData = NULL;
      TestSocketData *testSocketData = NULL;
 
      errChk( GetPanelAttribute (panelId, ATTR_FIRST_CHILD, &childPanel));
      errChk( GetPanelAttribute (panelId, ATTR_CALLBACK_DATA, &panelData));
      testSocketData = &(panelData->testSocketDataArray[testSocketIndex]);
 
      errChk( ResetTextBox (childPanel, testSocketData->ctrls[kTSCtrl_Status], statusMsg));
 
      Error:
 
      return error;
}


This function accepts three parameters which are:
  • dlgHandle - Refers to the UUT dialog handle which is represented as an integer.
  • testSocketIndex - Refers to the current UUT index of the current Execution.
  • statusMsg - Refers to the string to be inserted into the status text control.
This function acquires the handle to the status text control based on the test socket index. It then posts the statusMsg string to the status text control using the ResetTextBox function call.
 
4. Rebuild the modelsupport2.dll:
  • From LabWindows/CVI 2012 or earlier: Select Build»Create Release Dynamic Link Library.
  • From LabWindows/CVI 2013 or later: Select Build»Build.

5. To post a message to the function, create a new step in the TestStand Sequence Editor that uses the C/C++ DLL Adapter and use the following parameters:
  • dlgHandle (int) - Handle to the UUT Dialog which is stored in the Locals of the Test UUT entry point sequence of the Parallel process model. This handle is created by the modelsupport2.dll and stored in the Locals.ModelData.DialogHandle variable. To access the dialog handle from a client sequence, use RunState.Root.Parameters.ModelData.DialogHandle.
  • testSocketIndex (int) - The TestSocket index is stored in RunState.TestSockets.MyIndex.
  • statusMsg (char *) - Custom string that will be shown in the status text control.

    WAS THIS ARTICLE HELPFUL?

    Not Helpful