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.
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.
08-27-2013 06:54 PM
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
Solved! Go to Solution.
08-28-2013 01:56 AM - edited 08-28-2013 01:56 AM
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
08-28-2013 01:47 PM - edited 08-28-2013 01:48 PM
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 (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
08-28-2013 03:23 PM
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,
08-28-2013 03:35 PM
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.
08-29-2013 11:03 AM
08-29-2013 11:09 AM