NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display the Output messages on LabVIEW

Hi,

I'm building a simple user interface on LabVIEW and I have the following question:

 - TestStand has an Output Tab where I display some messages using Engine.OutputMessage; How can I do the same thing on my UI?

I've attached a printscreen of my TestStand sequence as an example of what I want do do on LabVIEW.

 

I apreciate all the help.

Thanks in advance.

 

Regards,

 

Daniel Coelho

 

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 1 of 10
(9,994 Views)

I've not ever used Engine.OutputMessages but I'm guessing that UI Messages will be your best bet.  It is the best way to get info from the sequence to your User Interface.  There are a bunch of documents on NIs website about UIMessages.  Just do a search and you'll find them.  Here's a basic one to understand what they are: http://zone.ni.com/devzone/cda/tut/p/id/4532 There are also examples and other stuff out there.  If you took the course one of the exercises was doing this exact thing.  It's very common.

 

The other option is that it looks like a property of the Engine so since you already have a reference to the engine in your User Interface then you can just use the Property Nodes or Invoke nodes to get it. 

 

Let me know if you have any questions about it.

Message Edited by ~jiggawax~ on 10-09-2008 09:35 AM
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 10
(9,975 Views)

Sorry, from your post in the LabVIEW board I did not understand that it was the Output message that you were looking for.

I thought you wanted the results from your test steps displayed on the user interface. 

It is the “Output Panel” in the sequence editor that displays your output message, but I do not know if there is default Output panel activeX indicator for user interface that the TestStand engine would update automatically like it does the execution view.

Maybe someone else knows 

As also pointed out, the UI messages is your other option.

The Output Message event number is 40 

http://zone.ni.com/devzone/cda/epd/p/id/3879

 

UIMsg_OutputMessages–(Value: 40) TestStand sends this message at periodic intervals when it holds references to output messages that calls to the OutputMessage.Post method queue. TestStand transfers the queued messages to an OutputMessages collection attached to the UIMessage.ActiveXData property for this event. An application that processes output messages should copy the output message references from the collection in UIMessage.ActiveXData to its own private OutputMessages collection by passing its private collection to the OutputMessages.CopyMessagesToCollection method. An application calls the Engine.NewOutputMessages method to create a private OutputMessage collection. TestStand generates this event only if the Engine.OutputMessagesEnabled property is True. Because there can be more than one handler for this event, the application should not modify the OutputMessages collection the UIMessage.ActiveXData property holds.

 

Omar

Message Edited by OmarGator on 10-09-2008 10:12 AM
0 Kudos
Message 3 of 10
(9,969 Views)

Hi

thank you for your reply.

I made the changes that where on the link you provided, but I don't know what to do now.

I created a callback vi to handle UserMessages, what should I do in that VI? And on the rest of the code?

Also, I tried looking the Invoke Nodes and Property Nodes of the Engine but found nothing and I believe too that with the Engine ref I should be able to do it.

Any more hints you could help me with?

 

Daniel Coelho

 

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 4 of 10
(9,962 Views)

Omar, thank you for keeping on this issue.

I trying some things aiming to understand this UIMessage.

One thing is on my mind. UIMessage isn't the same as Output Panel, is it?

My problem is that the sequence is using this kind of step to print results to the Output Panel and I have to maintain everything as it is.

My goal is only to provide with a simpler User Interface.

So, can I maintain the sequence as shown in the attachement and use UIMessage?

Sorry if all this questions sound senseless, but this is my first experience with TestStands API on LabVIEW.

 

Daniel Coelho

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 5 of 10
(9,957 Views)

Hey Daniel,

 

You are correct.  In the API reference in the TestStand help it shows GetOutputMessages as one of the Engine methods.  However in LabVIEW it does not show it in the invoke node.  That is really weird.  Maybe they didn't expose that through the API?  But then why would they show it in the Help?????  CRAZINESS.  Maybe someone from NI can shed light on that.

 

Ok so I guess you have to go through the UI Messages as explained before. 

 

So when you set up the activex step to send the UIMessage there is an event code.  You assigned it something like UIMsg_UserMessageBase + Offset.  Well, UIMsg_UserMessageBase is 10000 according to the TS Help.  So in that callback VI you need to have a case statement that handles 10000 + offset.  In there you will update the control on your front panel which can be passed into there through the User Parameters as a reference.

 

Here is an example of this done in 3.0 http://zone.ni.com/devzone/cda/epd/p/id/3879 

 

It doesn't have the reference to your front panel control going into the VI but you would just pipe that in and flaten it to a variant and then put it into User Parameter.  If you still can't get it then let me know.

 

Regards,

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

OutputMessages are not the same as UI Messages.  However, there is a UI Message that lets you know there are OutputMessages available.  Also, this API changed from 4.0 to 4.1.  Which version of TestStand are you using?

 

I think jigg might be confused about Output Messages vs. UI Messages.  Chances are you DO want to use OutputMessages as outlined by Omar.  There are no ActiveX controls that will automatically display them for you.  You'll have to listen for the appropriate UI Messages, and update a table in your UI whenever you get an update.  It's not a trivial task, but it can be done.  

 

Allen P.

NI

0 Kudos
Message 7 of 10
(9,935 Views)

You're rigth, AllenP.

I wanted OutputMessages, but since I'm forced to use UIMessage too, I'm going to change the sequence to send UIMessage instead of Post OutputMessage.

I wanted to do an UI that is similar to TestStand, meaning, if a sequence displays a message on the Output Panel I want my UI to display the message too.

But, I'm short on time. I'll go around and use UIMessage and if I can manage more time, I'll try to understand how to do the GetOutputMessage method on LabVIEW.

At this time I'm prompting the UIMessages on LabVIEW. As soon as I can, I'll get back to doing the same thing with the OutputMessage.

 

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 8 of 10
(9,929 Views)

Well I can trap on the output message when a Output message is sent.

 

But I can not seem to get the actual message that was sent.

 

Question how do you get a reference to the engine from inside the callback VI (see OutputMessageCallback.vi)

 

 

0 Kudos
Message 9 of 10
(9,928 Views)

Daniel,

 

If you are really wanting to use the engine, then the best way to get it will be to pass it in, or use the ControlRef control (which is a reference to the AppMgr) to create a GetEngine() invoke node.

 

If you want the running execution, then you should use uiMsg.Thread or uiMsg.Execution.

0 Kudos
Message 10 of 10
(9,738 Views)