01-16-2009 02:15 PM
Solved! Go to Solution.
01-18-2009 01:21 AM
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?
01-18-2009 04:13 AM
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
01-19-2009 09:03 AM
01-19-2009 03:28 PM
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.
01-19-2009 03:36 PM
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.
01-20-2009 12:45 AM
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
01-20-2009 02:07 AM
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.
01-20-2009 08:42 AM
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.
01-21-2009 12:46 AM