NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

updating custom fields in CVI operator interface using TestStand 3.1

We have customized operator interfaces with information that needs to be updated from within test programs.

Using TestStand 2.0, the way we did this was by making an ActiveX call to Thread.PostUIMessage from within the Sequence file. In the CVI operator interface, this message was intercepted using the a UI Message callback, registered with Engine.RegisterUIMessageCallback (expanding on the example given in engine.c). This method seemed to be a bit kludgy, but it got the job done.

In TestStand 3.1, is there a better mechanism to do this? The use of Caption Sources seems to supplant much of the custom UI Message passing in the TestStand 2.0 operator interface, but is there a way to add information to a caption that is not in the list of predefined Caption Source Macros? For example, we want to have a label that displays the current temperature. The value is supplied by the client sequence file running the test.

TestStand 3.1f1
CVI 7.1
0 Kudos
Message 1 of 4
(3,115 Views)
Captions simplify the display of commonly useful information that TestStand is aware of. For application specific information, such as a temperature measurement, a custom UI message is still a good way to ask the UI to display it. You can create a handler for the ApplicationMgr.UIMessageEvent event and then check to see if the event code of the message you receive is the code for your custom message.
0 Kudos
Message 2 of 4
(3,114 Views)
Each execution has an item in the listbar on the lefthand side with associated text. This is set via the DisplayExpression property of the corresponding ExecutionListConnection. The example from NI uses some macros like %CurrentExecution% and %UUTSerialNumber% within what appears to be a TestStand expression with the standard set of operators and functions. Based on this observation, I was able to reference a variable that I defined in the StationGlobals from within the display expression. I'm not a big fan of overusing the StationGlobals, but this seems like a better way than Thread.PostUIMessage to get data into the operator interface. Is there any way to access other TestStand variables from within this expression (Globals, Locals, etc.)? For my example display expression, I have the following:

"\"%CurrentExecution%\\n\" + Temperature: + StationGlobals.CurrentTemp"

(where StationGlobals.CurrentTemp is a string containing the current temperature)

It appears that this expression undergoes macro expansion, and then gets evaluated to a string.
0 Kudos
Message 3 of 4
(3,094 Views)
Hello,

UI messaging is the only recommended way of communicating data between a running sequence and the operator interface (OI). In fact, the "Caption connections", which are a specific type of the broader category of "Information Source Connection" controls, is really hidden UI messaging as well. All of the same type of information that is passed automatically could also be passed using the same Thread.PostUIMessage method. In addition to the defined ones, you can also post custom UI messages for any additional information you would like to pass.


Regards,

Aaron B.
National Instruments
0 Kudos
Message 4 of 4
(3,076 Views)