LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Edit command line parameters without restarting LabVIEW

Solved!
Go to solution
Is there a way to edit the command line parameters passed to a VI WITHOUT having to restart LabVIEW?  Perhaps I'm accustomed to how it works in just about every other development environment, but having to do so is quite frustrating.
0 Kudos
Message 1 of 18
(4,435 Views)

Hi Ron,

      Hope you don't mind a [probably] silly question: why not copy the command-line parameters into a global or some other data-structure which can be updated?

 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 18
(4,412 Views)

Hi ronbrown,

you get the command line parameters as an array. To test other parameters you can connect a array constant to your function and check how it works.

 

Mike

0 Kudos
Message 3 of 18
(4,404 Views)
Well sure, I can certainly hack my way around the issue, I just wanted to know if there was a way to do it without workarounds. 
0 Kudos
Message 4 of 18
(4,375 Views)
Solution
Accepted by ronbrown

ronbrown,

 

Unfortunatley you are going to have to close LabVIEW in order to pass parameters into a VI from the command prompt. You can build your VI into an executable and then pass the parameters in from the command prompt.  Because the program is its own executable, it is not dependent on wheter LabVIEW is open.  

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner
0 Kudos
Message 5 of 18
(4,349 Views)

Yes, I have done that, though it makes debugging more difficult.

 

I'm just surprised that LabVIEW doesn't have just a simple "command line parameters" option somewhere in the VI options for debugging purposes, just like Visual Studio and other deveopment environments.  It would be incredibly useful, and certainly less of a hassle than these workarounds.

0 Kudos
Message 6 of 18
(4,346 Views)

Hi ronbrown,

maybe i don't understand, but where is the problem to replace a property node with an array constant with your values?

 

Mike

0 Kudos
Message 7 of 18
(4,327 Views)

ronbrown wrote:


I'm just surprised that LabVIEW doesn't have just a simple "command line parameters" option somewhere in the VI options for debugging purposes, just like Visual Studio and other deveopment environments.


If memory serves, Visual Studio runs the compiled program as a separate process. That should make it easier to give it separate switches. In LabVIEW, if you let the user change the parameters, you would have to do some conflict resolution, since this is a global setting (e.g. did the changes you make affect everything or a single VI/hierarchy/app instance, are the original switches lost or can you get them back somehow and when).

 

If you want a workaround, I suggest you create a simple subVI with a 1D array output and a 1D array control on its FP or BD. If the control has something in it, use it. Otherwise, use the CLA[] property. Alternatively, you can check if you're running in the IDE or use a boolean, etc. Personally, the only time I think I needed to use switches, I believe the code was simple and I simply tested it by building the EXE. It probably took longer to figure out that I needed to explicitly turn on CLA support for the EXE than the actual testing.


___________________
Try to take over the world!
Message 8 of 18
(4,322 Views)

MikeS81 wrote:

Hi ronbrown,

maybe i don't understand, but where is the problem to replace a property node with an array constant with your values?

 

Mike


The problem is that replacing property nodes with a constant completely sidesteps the command line parsing, which is part of what I'd like to test.  You know, things like missing quotes in paths and things like that.

 

Thanks for the help everyone, I have plenty of ways to work around it, I just wanted to make sure I wasn't missing a setting somewhere in the options.

0 Kudos
Message 9 of 18
(4,303 Views)
I would normally expect that command-line parsing would be the least of your worries, but if that is all you need to test, it would probably be easiest to setup a separate VI/Project specifically for debugging it yourself, then you could just run that as a separate executable and not need LabView for debugging either -- since command-line processing is automatic and there is nothing to debug if you set up your test project to display all relevant infomation.
Message 10 of 18
(4,278 Views)