NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to access new data in User Message Event Callback?

Solved!
Go to solution

I am using the Simple LabVIEW OI as the model for my TestStand user interface.

The sequence sends a User Message to the OI to request the string array of tests to run.

 

But I am having great difficulty making this string array data available to the event callback VI.

 

I do not want to use a global variable and so my unsuccessful method so far has been as follows:

 

1. Use a Refnum to the Array and pass it into the Config Event Callbacks VI via the cluster 

 

CropperCapture[16].Png

 

2. The "Selected Tests" in the input cluster in the Config Event Callbacks VI is a generic Control Refnum

 

CropperCapture[17].Png

 

3. This Selected Tests (at the bottom) is then bundled and passed into the User Parameter

 

CropperCapture[18].Png

 

4. But how do I convert the Selected Tests Control refnum back into the original string array in the actual callback?

 

CropperCapture[19].Png???????

 

Also if there is anyone that can suggest a better way of doing this then please let me know.

 

The bottom line is - how to get the latest data into the event callback function when it is called?

 

Many thanks,

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 1 of 4
(3,772 Views)

Hi,

 

You need to make sure your cluster order matches your input cluster order.

 

Select the input control and select Cluster Order. Set the Selected Tests as the fifth item.

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 4
(3,766 Views)

Hi Ray,

 

The 'Selected Tests' array refnum is #4 in the cluster order and matches all the way through - so I think that's OK.

 

In the final diagram above, I can get the Selected Tests cluster from the 'User Parameter', but it is still in the form of a refnum.

 

My problem is a lack of understanding in how to convert this 'Selected Tests' refnum back to the original data type (a string array).

 

Basically I want to get the string array from the 'Selected Tests' refnum.

 

As you can see from above I tried to use a property node. I've also tried to 'cast' the refnum to a 'more specific class' by choosing 'Array' but it's still ends up as a refnum.

 

I hope you see what I mean?

 

Thanks,

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 3 of 4
(3,758 Views)
Solution
Accepted by topic author Believer
In the end to get this working, I gave up on the string array, and changed to a ListBox instead. It was easy then to access the listbox properties through the refnum. Probably a major flaw in my understanding of how refnum string arrays work.
TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 4 of 4
(3,751 Views)