Jump to content

how to Launch and run vi from VB6


Recommended Posts

The following code will start labview 5.0 with the dialog box, but it doesn't open and run a vi. I need to launch and run the application without a user pushing bottons. Help! :headbang:

Dim LV As LabVIEW.Application

Private Sub Form_Load()

Set LV = New LabVIEW.Application

Debug.Print LV.ApplicationDirectory = "C:\LabViewProgs"

Debug.Print LV.AppName = "MyApp.vi"

End Sub

Link to comment

How about starting labview.exe with the parameter "viname.vi" and make the vi autorun when openend.

You can run executables with the shell methods [shell(Pathname,vbWindowstyle)]. Please note that Labview.exe is not always installed on the same directory, thus track down the latest version and find the appropriate application directory in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\LabVIEW\7.0\Path

Good luck

Link to comment

Hello LabRat,

Did you try the shipping example which shows how to do this? It can be found under examples\comm\VBtoLV.vbp. I am not sure if this example shipped with LabVIEW 5.0 however.

LV.AppName = "MyApp.vi"

In any case, you should not be using LV.AppName. This is a read-only property that outputs "LabVIEW.exe" (or whatever the built executable's name is). Instead, you should use the Call method on the VI class (passing it the parameter names and values). For details, see LabVIEW Help for 'VI class (ActiveX)'.

Hope this helps. Again, check out the shipping example. I just tried and it works fine. If you do not have the example, you can take a look at the following one from NI's DevZone (I haven't tried this one though):

http://sine.ni.com/apps/we/niepd_web_displ...source=External

Regards,

Khalid

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.