LabRat Posted June 11, 2004 Report Share Posted June 11, 2004 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 Quote Link to comment
snooper Posted June 14, 2004 Report Share Posted June 14, 2004 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 Quote Link to comment
LabRat Posted June 14, 2004 Author Report Share Posted June 14, 2004 Thanks for the reply! I found under preferences "Open VIs in run mode" also "Skip navigation dialog on launch" however they don't seem to work. Quote Link to comment
Khalid Posted June 16, 2004 Report Share Posted June 16, 2004 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.