LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using vbscript to call labview

Is it possible to call a labview vi or application from vbscript using activex? or can you only do this from Visual Basic
0 Kudos
Message 1 of 4
(2,555 Views)
If you just want to run a LabView VI, you can do that in vbscript without ActiveX.
Use the Shell command to run LabView and give it the name of your VI as a command line parameter. Note: if the path to you VI has spaces in it, you need to enclose the path in quotes within the string using Chr$(34).
If you installed LabView 6.1 in the default directory and you want to run a VI named Test VI.vi in c:\My Documents\LabView, the statement in your vbscript macro would be:
lvTaskID = Shell("C:\Program Files\National Instruments\LabVIEW 6.1\LabVIEW.exe " & Chr$(34) & "c:\My Documents\LabView\Test VI.vi" & Chr$(34), vbNormalFocus)
0 Kudos
Message 2 of 4
(2,555 Views)
Thank you very much for your answer. This means that you have to have the LabVIEW software on your pc. If you use the application (.exe)of your VI does this mean you don't need Labview on the P.C. that it is running on? This would be even better for me. Is it possible to call the .exe instead of .vi?
Mar
0 Kudos
Message 3 of 4
(2,555 Views)
Yes, the example Shell statement in my answer runs LabView to run a VI. If you used the application builder to create an EXE from your VI, just include the path to that EXE (and not LabView.exe) in the Shell statement.
0 Kudos
Message 4 of 4
(2,555 Views)