OutputMessages
- Updated2024-10-09
- 1 minute(s) read
OutputMessages
This collection class contains elements of the OutputMessage type. You can post an output message to TestStand by calling the Engine.NewOutputMessage method to create a new message object and by calling the OutputMessage.Post method on the object. You can also call the OutputMessage expression function .
When the number of items in the collection changes from zero to one, TestStand sends a UIMsg_OutputMessages message to the TestStand application.
TestStand adds only messages to the collection and sends a UIMsg_OutputMessages message if you enable the Engine.OutputMessagesEnabled property.
An application can retrieve the latest output messages by transferring messages from the collection TestStand maintains to a new collection the application creates, as shown in the following pseudocode:
// C# example if (uiMsg.Event == UIMessageCodes.UIMsg_OutputMessages) { OutputMessages outputMessages = uiMsg.ActiveXData as OutputMessages; OutputMessages appOutputMessages = engine.NewOutputMessages();
outputMessages.CopyMessagesToCollection(appOutputMessages); for(i = 0; i < appOutputMessages.Count; i++) { uiControl.Add(appOutputMessages[i].Message); } }
// C++ example if (uiMsg->Event == UIMsg_OutputMessages) { TS::OutputMessagesPtr outputMessages = uiMsg->ActiveXData; TS::OutputMessagesPtr appOutputMessages = engine->NewOutputMessages();
outputMessages->CopyMessagesToCollection(appOutputMessages); for(i = 0; i < appOutputMessages->Count; i++) { uiControl.Add(appOutputMessages->Item[i]->Message); } } TestStand always sends output messages to a debugger if you enable the DebugOptions_SendOutputMessagesToDebugger option of the StationOptions.DebugOptions property.