07-31-2003 06:27 PM
08-01-2003 05:21 PM
04-24-2009 04:03 PM
Hello Elaine,
I just saw this post and wonder if there is a way to use the PostUIMessageEX for passing a TS 4.0 container to UI in Labview.
I guess the explanation will apply to TS container as well but you talk about example.
Please explain or direct me to an example how to handle the TS container especially in the Labview callback module.
Thank you.
Elik
04-24-2009 04:26 PM
You can pass arrays, containers, or just about anything via the activeXDataParam property. However, LabVIEW will see the data as an ActiveX object. It will let you access PropertyObject (or another interface if you pass a non-PropertyObject) methods and properties to get the values within your TestStand array or container. However, no LabVIEW node such as Variant to Data is going to know how to convert an arbitrary ActiveX object to its most analogous LabVIEW data type, presuming there even is one, which there happens to be in the case of numeric arrays.The LabVIEW adapter contains code which can do conversions like this, but you have to call a VI directly from TestStand to use it.
You could write your own VI that takes a reference to a TestStand array and outputs a labview array, or you could just use the PropertyObject members to access the TestStand array within Labview (which is the same method you would use to implement the afore mentioned conversion VI).
04-27-2009 04:43 PM
Thank you James.
I assume that on the TS side I set the RunState.SequenceContext as the reference object and extract Locals.MyCluster on the receiving side.
Using the UI custom message call back VIOn the receiving side I invoked the property nodes UIMessage>>Thread>>GetSequenceContext>>SequenceContext>>AsPropertyObject. From here I'm a bit confused.
I might figure it all wrong.
Thanks again.
Elik
04-27-2009 04:54 PM
I would set Locals.MyCluster as the reference object for ActiveXData on the sending side. That avoids anything bad happening if the locals go out of scope before you access them (better to be safe). Also, you don't have to dig as deep to get your values.
On the receiving side, you'd do:
PropertyObject myCluster = (PropertyObject)uiMessage.ActiveXData;
Boolean myBooleanValue = myCluster.GetValBoolean("MyBooleanClusterField", PropOptions_NoOptions);
etc...