LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Command Line Arguments in Labview

Does anyone know if it is possible to invoke a program developed with
Labiew with command line arguments and then use those arguments within
the program?

If so, how can I do this?

Thanks ... Dave
0 Kudos
Message 1 of 4
(2,745 Views)
Dave,

It is possible, but very tricky... When in an application it is relatively
easy to get the command line arguments using GetCommandLine (Kernel32 win32
API).

When running VI's the messages are send to LabVIEW.exe and are harder to
get.

Regards,

Wiebe.


"David" wrote in message
news:5ff19f23.0108131224.2ff1cd13@posting.google.com...
> Does anyone know if it is possible to invoke a program developed with
> Labiew with command line arguments and then use those arguments within
> the program?
>
> If so, how can I do this?
>
> Thanks ... Dave
0 Kudos
Message 2 of 4
(2,745 Views)
Dave,

More about the tricky part... Windows returns an array of strings. The
elements are seperated with zero's (\00). LabVIEW sees this as the end of
the string. So the result is an empty string.

The trick is to get the pointer of the string, and the string at the
pointer. Concatenate the string with an extra space, and add the string
length to the pointer. Repeat until the string length is zero.

BTW. use GetCommandLineA, not GetCommandLineW.

I'll send you the VI I've made. If anyone else want it, send me a mail.
Please use >GetCommandLine< as subject.

Regards,

Wiebe.




"AIR" wrote in message
news:997882549.27984.0.pluto.d4ee054f@news.demon.nl...
> Dave,
>
> It is possible, but very tricky... When in an application it is relatively
> easy to get t
he command line arguments using GetCommandLine (Kernel32
win32
> API).
>
> When running VI's the messages are send to LabVIEW.exe and are harder to
> get.
>
> Regards,
>
> Wiebe.
>
>
> "David" wrote in message
> news:5ff19f23.0108131224.2ff1cd13@posting.google.com...
> > Does anyone know if it is possible to invoke a program developed with
> > Labiew with command line arguments and then use those arguments within
> > the program?
> >
> > If so, how can I do this?
> >
> > Thanks ... Dave
>
>
0 Kudos
Message 3 of 4
(2,745 Views)
Check out this link:
http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&92E30EBE228E30638625696100757FA3&cat=2E4161187E3DEB30862568660020BCC8

and others off of it.
0 Kudos
Message 4 of 4
(2,745 Views)