Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Launch particular labview VI from VB

I want to launch a particular Vi when I start Labview. This is done by passing an argument to the Labview executable which launches an 'Untitled.vi'. I want to launch a particular VI instead of the 'Untitled.vi'
0 Kudos
Message 1 of 2
(3,074 Views)
You can get better control over this if you use the LabVIEW automation interface. For example, create a new VB application, go to the Project/References menu item, and check "LabVIEW 6.0 Type Library". Add a button to the form, double-click on the button, and try the following code:

Dim app As labview.Application
Set app = New labview.Application

Dim path As String
path = app.ApplicationDirectory & "\examples\dll\hostname\hostname.vi"

Dim vi As labview.VirtualInstrument
Set vi = app.GetVIReference(path)

vi.FPWinOpen = True
vi.FPWinIsFrontMost = True
vi.Run

Check out the other properties and methods in the LabVIEW automation interface to see other interesting things that you can do. Hope this he
lps.

- Elton
0 Kudos
Message 2 of 2
(3,074 Views)