NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Save OutputMessages at the end of a sequence

I have a TestStand system which generates debug messages as OutputMessages from compiled code modules (LabVIEW PPLs / dll's etc). I need to save the OutputMessages to a file at the end of execution.

I am unable to find a reference to OutputMessages, I am aware of the CopyMessagesToCollection method once I have the aforementioned reference. I cannot do this is in a user interface as that is locked down too and I only have control over the top level sequence.

Thanks in advance.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 1 of 5
(2,259 Views)

I don’t see how you can achieve this if you don’t have a reference to the Output Messages being used by the UI.

 

 

Regards
Ray Farmer
0 Kudos
Message 2 of 5
(2,185 Views)

I'm not aware of any way to get the OutputMessages object other than reading the UIMsg_OutputMessages UI Message:

https://zone.ni.com/reference/en-XX/help/370052W-01/tsapiref/reftopics/uimessagecodes/

 

The only way that comes to mind without changing the UI is that you could turn on "Station Options » Preferences » Debug Options » Send Output Messages to the Debugger" option and then use a tool like DebugView from Microsoft to read them all: https://docs.microsoft.com/en-us/sysinternals/downloads/debugview

 

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 3 of 5
(2,157 Views)

I asked support a similar question a while ago. The bottom line of the answer is: No.

---

My two cents:

If it is your intention to log data from inside steps then consider to use the "Additional Results" and grab the data from "Locals.ResultList". Depending on what you want to achive the default behavior is good enough for you that shows the additional results in the standard report.

0 Kudos
Message 4 of 5
(2,060 Views)

I wouldn't say this is supported, and you might hit a problem, but I've been able to get UIMessages in arbitrary code modules by.

 

1. Instantiate the engine if you don't have it. It is a singleton, so this is just a way to get to it.

2. ApplicationMgr appMgr = (ApplicationMgr)engine.GetInternalOption(InternalOption_ApplicationManager)  // presumes you are in an app that uses the ApplicationMgr control

3. Subscribe/connect to appMgr.UIMessageEvent, look for UIMsg_OutputMessages

 

You might need to subscribe in a new thread that has a message pump if your current thread can't be relied on to stay around and pump messages.  I don't remember off the top of my head if the thread needs to be STA or not.

 

I'm not recommending this if you have other options, since it is off the beaten path, but it can enable things that wouldn't be possible otherwise.

0 Kudos
Message 5 of 5
(2,045 Views)