NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve messages from TestStand Output Message Pane?

Solved!
Go to solution
The get GetOutputMessages function from Engine class is now obsolete. I want to use the OutputMessages object but I can't seem to expose it from within TestStand Sequence editor. Any help is appreciated.
0 Kudos
Message 1 of 6
(2,774 Views)
Solution
Accepted by topic author raffythegreat

I'm convinced that the only way to access that is through the UI Message called out in the help.

 

However, you can create your own OutputMessages object and use it:

Locals.OutputMessages = RunState.Engine.NewOutputMessages()

 

Then use:

Locals.OutputMessages.AsOutputMessages.Add(RunState.Engine.NewOutputMessage("Hi There", "Hello", OutputMessageSeverity_Information, Nothing))

 

Then to read it us:

Locals.OutputMessages.AsOutputMessages.Item(0).Message

 

The only downside to all of this is that it doesn't post, so no UI Message this way.  However, you still get all the functionality of the OutputMessages.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 6
(2,758 Views)

Thanks jiggawax! I see what you're proposing, I think can make use of that technique less the posting part for what I'm trying to accomplish.

0 Kudos
Message 3 of 6
(2,727 Views)

Note that when TestStand obsoletes API, that API is still functional. The new API supports the notion of having multiple clients, such as the Sequence Editor control, and other customer created components, which might be your use case.

Scott Richardson
National Instruments
0 Kudos
Message 4 of 6
(2,684 Views)

Scott,

 

How do you make your own created collection of output messages post a UI Message?  The only post API functions I see are for the ones in the collection owned by TestStand.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 6
(2,675 Views)

You can call engine.NewOutputMessages to create an empty collection for your UI component to manage. There is code in the help for the OutputMessages collection that illustrates how you might use it. If you want to maintain the collection outside of the scope of the callback then you would create the collection on init and store as a member of your control or form. Does that answer your question?

 

// 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);
     }
}

Scott Richardson
National Instruments
0 Kudos
Message 6 of 6
(2,656 Views)