Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How Can I call to VI from VisualBasic

I have a aplications in Visual Basic and need to call a Vi make in Labview with Data Acquisition
0 Kudos
Message 1 of 5
(6,268 Views)
You can do this via LabVIEW's automation interface. In Visual Basic, go to the Project menu, then References, then check the item for LabVIEW 7.0 Type Library (or another version if you don't have LabVIEW 7.0). In your application, you can get to the VI like this:

Dim lv As LabVIEW.Application
Set lv = New LabVIEW.Application

Dim path As String
' Set path to the path of the vi that you want to run.

Dim vi As VirtualInstrument
Set vi = lv.GetVIReference(path)

There are several properties that you can set on the VI and you can set values on the controls on the front panel via the SetControlValue method. Ultimately, once you have everything set up, you can run the VI via the Run method.

- Elton
0 Kudos
Message 2 of 5
(6,268 Views)
When executing this code appears the following Error.Procedure or function nondefined (lvGetVIReference)
0 Kudos
Message 3 of 5
(6,268 Views)
Your comment says lvGetVIReference. Is that correct or was that a typo? If that is correct, the problem is that you need a period between lv and GetVIReference (lv.GetVIReference).

- Elton
0 Kudos
Message 4 of 5
(6,268 Views)
When doing this opens the frontal panel of labview. I only want to call to the feasible
0 Kudos
Message 5 of 5
(6,268 Views)