10-07-2010 01:37 PM
Hello all,
I have a sequence like this:
Create Notification, MyNoti
Run VI Asychronously, MyVI
Set Notification, set MyNoti
MyVI is a labview file with an Invoke Node for INotification - GetInfo. This way I am able to receive a notification when the notification is set.
In TestStand, in the set notification settings, I have an option of entering "Data Value (optional)", but I don't know how to get MyVI to read that setting using the Invoke Node.
Thanks.
10-07-2010 10:06 PM
You should use Notification.Wait() rather than GetInfo(). You can create a destination PropertyObject to store the data using Engine.NewPropertyObject(). See the online help for more information.
Hope this helps,
-Doug
10-27-2010 06:32 PM
I am even more lost now. This is what I have, which is pretty simple. According to you, I am suppose to use the destinationPropObj to store my data. I don't really understand how to do that.
10-28-2010 11:33 AM
What kind of data are you storing in the notification? This affects how you need to create the destinationPropObj. Basically you will use the IEngine.NewPropertyObject method to create it. If the data you are expecting from the notification is a simple data type (i.e. string, number, boolean), then you just need to create a string, number, or boolean object with that engine API. If it is a container with other data in it then you can create an Object Reference variable with the engine API. And once your wait is successful you can access it by calling GetValInterface on it and using the PropertyObject API on the resulting interface to access your data. Please see the API help for Notification Wait to see all of the intricate details based on what settings you are using when you set the notification and what you are using for the destinationPropObj.
Hope this helps,
-Doug
10-28-2010 12:00 PM
Sorry, I am really new at this.
I am only trying to a pass a number.
I am looking at my TestStand Sequence Editor and I just don't see anywhere I can type "Engine.NewPropertyObject". This is some kind of scripting language that can be used with TestStand or does this just refer to a button?
Again, sorry, I am just starting to learn this. Thanks.
10-29-2010 11:55 AM - edited 10-29-2010 11:56 AM
That is an API method. Are you passing the engine into your VI (i.e. RunState.Engine)? NewPropertyObject is a method on the engine interface. Since you are just passing a number you would use the following parameters:
NewPropertyObject(PropValType_Number, false, "", 0);
Then after a successful wait you can get the value from your propertyobject using
GetValNumber("", 0);
Don't forget to close the reference to the propertyobject when you are done with it or you will have a leak.
Hope this helps,
-Doug