From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview command-line interface

Hi,
 
I have another simple Labview question.   I am trying to determine if Labview is suitable for my purposes.  I have no data acquisiton needs and Labview was suggested to me as a language for GUI development.  I am going to start learning Labview to give it a fair shake for GUI development, because I have some experience in C# and Java.  However, the graphical programming aspect of Labview might be advantageous.  My question is Can Labview be used to develop a command-line application?
 
Thanks for your help,
 
Will
0 Kudos
Message 1 of 14
(6,022 Views)
It can be, although the overhead may not be what you want. In order for a LabVIEW application to run it requires the LabVIEW Runtime Engine to be installed. Loading this up and then starting your application will be noticeable, especially if your command-line application is supposed to be simple. What does your command-line application do?
0 Kudos
Message 2 of 14
(6,016 Views)
The application takes calculated data from a FORTRAN subroutine.  Several calls are made and the data is organized (possibly in Labview).  Once organized, text output files are outputted to consolidate the runs.  Currently, Labview is used to produce a GUI interface.  However, it might be useful to create a CLI interface also for testing.  The CLI program can be easily scripted using batch files or a makefile.  This application has no data acquisition.
 
Will
0 Kudos
Message 3 of 14
(6,003 Views)
OK, so you just need a command-line version of the application you already have? LabVIEW has an application method that allows you to get the command-line arguments passed into a LabVIEW app:



This will allow you to call a LabVIEW app from the command line and pass in some arguments. The LabVIEW app doesn't need to display a GUI.

Note that when I say "LabVIEW app" I mean code that you've compiled into an application that you run with the LabVIEW Runtime Engine. I'm not referring to the LabVIEW application itself.


Message Edited by smercurio_fc on 03-06-2008 12:28 PM
0 Kudos
Message 4 of 14
(5,998 Views)

hi,

I have given inputs to .vi file through command prompt using the command

"C:\Program Files\National Instruments\LabVIEW 7.1\LabVIEW.exe" "C:\test.vi" –– 4 5

 test.vi is configured for addition operation, now how can i get output  to be printed on command prompt

0 Kudos
Message 5 of 14
(5,205 Views)

Hi Prathyusha,

 

you can't.

LabVIEW generates executables with their own GUI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 14
(5,155 Views)

As Gerd already pointed out you can't do that in LabVIEW directly. You need to develop a LabVIEW application and then build an executable from it.

 

However process creation under Windows is a pretty expensive thing to do in comparison to Unix variants. That means that everytime the command line process is created it takes some significant time and if you do that often by calling a command line tool repeatedly, this will get slow. LabVIEW as full featured GUI application does add its own extra startup time to this until the entire runtime system is initialized. It doesn't mean you can do it and for occasional commands it's perfectly fine but if you do lots and lots of commands to the tool it really will start to appear slow.

 

Under Windows the predominant choice for linking application code together is either by using shared libraries, ActiveX components or .Net assemblies. These techniques all have the advantage that the extra component is linked in at load time once and incures the initialization time only then and after that its funcitonality can be called very quickly. LabVIEW supports calling all three of these and to create sshared libraries and .Net assmblies. This might be another possible approach by making your other application the master and link it with a LabVIEW component either in the form of a shared library or .Net assembly.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 14
(5,136 Views)

@WilliamLee wrote:
However, it might be useful to create a CLI interface also for testing.  The CLI program can be easily scripted using batch files or a makefile.  This application has no data acquisition.
 

If it's just testing that you want the command-line interface for, VI Server and VI Scripting allows you manipulate a VI / LabVIEW executable programmatically while it is running.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 8 of 14
(5,117 Views)

Thanks for your response.

Is it Possible to  call labview from C language.if it is so, is there any APIs ?

can you please let me Know

0 Kudos
Message 9 of 14
(5,111 Views)

Yes, you can build DLLs in LabVIEW which you can call from other languages and you can also use the ActiveX interface to control/communicate with a LabVIEW application. Of course, you can also use TCP/UDP or any other communications method to communicate between a LabVIEW application and another application.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 10 of 14
(5,094 Views)