NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

UI Message Basic Example

Solved!
Go to solution

Hi, 

 

I'm probably missing something very simple here. 

I am trying to Post a UI Message from the Sequence Editor to a LabVIEW VI. 

RunState.Thread.PostUIMessageEx(
UIMsg_UserMessageBase+1,
123,
"",
Nothing,
True)

kross8_1-1697460436710.png

 

Below: LabVIEW Action Step

kross8_0-1697460423984.png

Below: The VI being Async called

kross8_2-1697460473640.png

 

In the call back I am just throwing up a 1-button dialog

kross8_3-1697460516929.png

 

Where am I go wrong?

 

Once ive got this going, I want to Post a UI message from LabVIEW to the Sequence Editor.

 

 

Again sorry for such a basic question and thank in advance for any pointers in the right direction

0 Kudos
Message 1 of 5
(1,468 Views)

This is not the proper use of UI Messages.  You  need to read up on how to use them correctly.

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x3tWCAQ&l=en-US

 

They are meant for the User Interface.  Not for communicating between your sequence file and VIs.  Use the Sequence Context for that.

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

Hi jigg, 

 

Thanks for your reply and sharing the link. 


I am properly confused...

"TestStand uses UI message objects to pass information about the state of the engine and the current executions to the Operator Interface or Sequence Editor"

Am I misunderstand this then, I cant post a UI Message from the sequence Editor to my LabVIEW UI (VI)?

 

Even if it is the same TS Engine and Same execution?


What would you suggest as a method for communicating to my Async VI being called through the sequence Editor.

I saw this and thought this would work
"UI messages are the best way to communicate between the TestStand User Interface and sequence files"
I guess I'm misunderstanding again. 

Thanks in advance for your support.

 

Kev

 

 

0 Kudos
Message 3 of 5
(1,417 Views)
Solution
Accepted by topic author kross8

I think you are confused as to what a UI (User Interface or sometimes called Operator Interface) in TestStand means.  It has a very specific meaning.  A UI in TestStand means that it is an application that has an Application Manager control and possibly the other two manager controls, as well as many TestStand activeX UI components.  Calling a VI that pops up from you sequence file is NOT a UI.  It is what we would refer to as a code module.  The Sequence Editor is a UI (underneath the hood there is an application manager running).

 

You CANNOT have 2 UIs in TestStand share the same engine.  It is impossible.  UI Messages are used to pass data from your sequence file to the UI (in many cases Sequence Editor).  UI Messages are not meant, nor should they be, used to pass data from your sequence file to a code module (in your case a LabVIEW VI).  

 

Here's a document on stopping an Asynchronous VI: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000g0sqSAA&l=en-US#:~:text=In%20the%20Ru....

 

I think the same thing would apply for passing data to and from the Asynch VI as well.

 

If you want to do it in the UI then you would use UI Messages and create a custom UI.

 

Let me know if you have other questions or need clarification on anything.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 4 of 5
(1,403 Views)

Thanks for the clear explanation, that makes sense now! I have created a File Global in my Sequence File and read that by my Async VI, works a treat. 

 

Thank you for being patient with me and educating me! Greatly appreciated!

 

On to the next one =]

0 Kudos
Message 5 of 5
(1,379 Views)