From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

UI Messaging from executable back to sequence file

Solved!
Go to solution

how can i pass a UI message from the executable back to a sequence file?  

TS_PropertySetValString( ) doesn't seem to work like i want it to.  I get an error that the variable in the lookup string is not recognized.  

any help?


thanks

 

0 Kudos
Message 1 of 7
(4,054 Views)

UI Messages are always generated by TestStand. So the "flow" is always from your test execution to the UI, not the other way round.

 

What you have to do to get data back from the UI is to send a UI Msg as a "question":

Pass the SequenceContext as ActiveXParam and then use the TS_SetVal-functions to put the data in the executions' data space. Sure you have to know the lookup string as you have to write the data back. You should use unique UIMsg codes for determining the lookup string (e.g. 10050 is "Locals.MyNumber" whereas 10051 is "Locals.MyString").

 

An empty lookup string most often does not make sense.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 7
(4,043 Views)

Norbert, hi and thanks!

you say to "Pass the SequenceContext as ActiveXParam"

yes!  And i almost understand what you're trying to tell me!   LOL Smiley Happy   (i do know enough to know that this is what i need to do, so there is that...)

what i understand so far is how to use ActiveX Parameters to send data from the Sequence File during runtime, to my UI.     Using the following ActiveX/COM module:

server: TestStand 2010 SP1 API
obj ref: RunState.Thread
class: Thread
Call Method: "PostUIMessageEx"

i am able to successfully pass stuff "by value" to the exectuable via UI Message, using my own #defined UserMessageBase (10000+) event codes

I catch the callbacks using TSUI__ApplicationMgrEventRegOnUserMessage(), and pull out the data i need via TS_UIMessageGetStringData()

I thought i might be able to do the same process to pass stuff back "by reference", but clearly i was misunderstanding how this works.  I see now that "PostUIMessageEx" is a one way function, as you said, from the TestStand Sequence execution back to the User Interface executable.

now when you say, "Pass the SequenceContext", do you mean to Call Method: GetSequenceContext (instead of PostUIMessageEx)?

I hope i'm on the right track.  any clarification you could add would be greatly appreciated.

Regards
Rob



 

0 Kudos
Message 3 of 7
(4,021 Views)
Solution
Accepted by topic author rjohnson

You still need to use PostUIMessageEx.

 

As the activeXDataParam pass ThisContext.  All one word.  ThisContext refers to the current SequenceContext so you can always be assured that you are referring to the current context.

 

 

Here is an example that demonstrates how ThisContext works: http://zone.ni.com/devzone/cda/epd/p/id/5838

 

Intead of passing it as a parameter you are passing it as a UIMessage.

 

Hope this helps,

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

jigg, thanks for the response.   

just for the record, I am using TestStand in conjunction with LabWindows/CVI   (not LabVIEW), so i can't use the example,  but i think i get what you're trying to say.

0 Kudos
Message 5 of 7
(4,012 Views)
i got it. thanks for your help both of you. once i point to the vatiables within ThisContext, it'sall easy peasy. Thanks!
0 Kudos
Message 6 of 7
(3,988 Views)
i want to give you both credit for solution but i could only pick one. how unfair! 🙂
0 Kudos
Message 7 of 7
(3,986 Views)