PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set a front panel contol value using VBA of an executable VI?

Sub Load_Timer_Click()
Set oLVApp = CreateObject("LabVIEW.Application")
Set oLVVI = oLVApp.GetVIReference("C:\Timer\5 ch timer with trigger query\5 ch timer with trigger query.vi", False)
BUBDelay = ActiveCell.Offset(1, 3)
LVControlBUBDelay = oLVVI.SetControlValue("BUB Delay", BUBDelay)
TSDelay = ActiveCell.Offset(1, 2)
LVControlTSDelay = oLVVI.SetControlValue("TS Delay", TSDelay)
End Sub

I'm presently using the above code to set the front panel control of a VI; however, I'd like to do the same to an executable.
0 Kudos
Message 1 of 2
(3,104 Views)
I think I can help you out a bit with this one, Rich. Building this application will be a bit different than just accessing a VI. This is because now you are accessing a completely different application. When you are changing a VI, you access LabVIEW through ActiveX. Now you need to access the executable. So, the first thing you will want to do is to register the slave application as an ActiveX server.

Now you can access this ActiveX server. You want to use the three properties Exported VIs, Application Directory, and AppName to build the path to the VI inside the application. From this, you can now obtain a VI reference. Now use this VI reference as you did above to access the VI inside the executable and be able to set the control value.
J.R. Allen
0 Kudos
Message 2 of 2
(3,104 Views)