NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing parameters from VC++ to Labview?

Hi,
I was looking through the example for TestStand of how to create a worker thread to display an MFC dialog in LabVIEW using the Call Library Function, and my question is how can I have the user enter say an integer into the dialog box and then be able to display what the user entered in LabVIEW (say in a numeric indicator). So to recap I have the CLF calling a function in my Dll which in turn starts a thread which displays an MFC dialog box. The box has an edit field where the user enters a number then the dialog box closes, BUT the number gets lost. If you have any idea as to how I can pass back this number from my dialog class to my worker thread and then back into LabView I'd really appreciate it,
THanks in a
dvance,
0 Kudos
Message 1 of 2
(3,201 Views)
Hi,

If you look at the Process Model 'TestStandModel' and view the sequence PreUUT.

This has a function which displays a dialog for entering in the Serial Number. A Local variable exists in the sequence in the Locals Group called 'SerialNumber'. Ok I know its of type String but the principle is the same.

The function DisplayUUTInformationDialog writes the Serial Number entry using the TestStand API SetValString method. In you case you would use the SetValNumber method.

In a LabVIEW VI you would use the ActiveX VI Invoke Node and select the GetValNumber method to be able to get the value of the SerialNumber into you VIs. The GetValNumber method requires two input parameters, A Lookup string and an option value, It returns a numeric of type double. For the examp
le above the Lookup string would be 'Locals.SerialNumber'. The option parameter you can set as 0. In effect when you install TestStand and have LabVIEW on your system you will get a set of VI's for use in TestStand. These are found in the User Library. There you will find a SetValNumber and GetValNumber VIs already for you to use.


Hope this helps.

Ray.
Regards
Ray Farmer
Message 2 of 2
(3,201 Views)