Jump to content

Is it possible to call a VI with options?


Recommended Posts

Dear all

Is it possible to call a vi with options like, you would do with dos commands "dir h:\" then similar would be "dir.vi h:\" in a windows short-cut? If it is possible how do I get the option data?

Essentially I want to call vi with a specific ini-fil.

Do you mean that you would compile a VI into an exe? Or do you mean you first open LabVIEW and then run a VI inside LabVIEW? Or do you mean you do not compile VI into a binary but you would like to open LabVIEW and get it automatically to run a VI with some command line args.

Command line arguments can be read using property node for Application class. Application class has a propety called Application -> Comman Line Arguments.

-jimi-

Link to comment
Do you mean that you would compile a VI into an exe? Or do you mean you first open LabVIEW and then run a VI inside LabVIEW? Or do you mean you do not compile VI into a binary but you would like to open LabVIEW and get it automatically to run a VI with some command line args.

Command line arguments can be read using property node for Application class. Application class has a propety called Application -> Comman Line Arguments.

-jimi-

I mean do not compile VI into a binary but you would like to open LabVIEW and get it automatically to run a VI with some command line args.

Link to comment
I mean do not compile VI into a binary but you would like to open LabVIEW and get it automatically to run a VI with some command line args.

Checking LabVIEW help is always a good point to start with... :book:

Application:Command Line Arguments Property

Property of Application.

Returns an array of user-defined command-line arguments passed when LabVIEW launched. User-defined arguments start after two hyphens (--) surrounded by spaces in the command line.

The first string in the array is the name of the executable launched. This property does not return the name of the VI launched or the LLB that contains the VI. If a user-defined command-line argument contains double quotation marks ("), this property returns the argument without the quotation marks.

If you use this property in a stand-alone application, you can pass all arguments as user-defined arguments so you do not need to enter the two hyphens before user-defined arguments in the command line.

This property is similar to the Pass all command line arguments to application option on the Advanced page of the Application Properties dialog box. Example

Remarks

The following table lists the characteristics of this property.

Remote access disallowed No

Available in Run-Time Engine and Real-Time Operating System Yes (Read Only)

Permissions Read Only

Example

Refer to the CommandLine VI in the labview\examples\viserver\cmdline.llb for an example of using the Application:Command Line Arguments property.

Open example Browse related examples

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.