01-18-2017 07:23 AM
Hello all!!
I`m trying to execute a command to system using the System Exec.vi
The command is:
start /max chrome "http://www.ford.com"
This command works proprely when I run it directly from Prompt command but when using LabVIEW through System Exec.vi it gives the error:
Error 2 occurred at System Exec.vi. Command was "start /max iexplore "http://www.google.com" Possible reason(s): LabVIEW: Memory is full. ========================= NI-488: No Listeners on the GPIB.
Block diagram image:
someone could help me with that?
Solved! Go to Solution.
01-18-2017 07:36 AM
Prepend cmd /c, i.e. your command line should look like this:
cmd /c start /max chrome "http://www.ford.com"
01-18-2017 07:42 AM - edited 01-18-2017 07:45 AM
Error 2 is misleading. System Exec.vi simply does not find the EXE file you reference.
Passing 'C:\Program Files (x86)\Internet Explorer\iexplore.exe http://www.google.com' as command line to System Exec.vi works on my system.
EDIT: Sorry, cannot remove that stupid hyperlink as Lithium seems to automatically add the hyperlink once posting.
01-18-2017 07:54 AM - edited 01-18-2017 07:58 AM
Norbert_B escreveu:
Error 2 is misleading. System Exec.vi simply does not find the EXE file you reference.
Passing 'C:\Program Files (x86)\Internet Explorer\iexplore.exe http://www.google.com' as command line to System Exec.vi works on my system.
EDIT: Sorry, cannot remove that stupid hyperlink as Lithium seems to automatically add the hyperlink once posting.
Tks Norbert. The disadvantage of your solution is about compatibility and repeatability to operational systems with language different of english without edit the code just befause you have specified the absolute (full) path to the program.
However, tks for replying!
01-18-2017 07:59 AM
@clebermarques wrote:
[...] operational systems with language different to english without changes in the code once you have specified the absolute (full) path to the program.
Point taken. However, as of Windows 7, the paths for installed software should always be english. The OS only changes indication in the file explorer if language setting is not english.
But you are correct that dan_u's solution is far better.
01-18-2017 07:59 AM
01-18-2017 08:28 AM
And in addition to GerdWs first reply it is useful to have a look on all "cmd.exe"- options with
"cmd /?" in the console- window.
01-18-2017 10:14 AM
@clebermarques wrote:
Norbert_B escreveu:
Error 2 is misleading. System Exec.vi simply does not find the EXE file you reference.
Passing 'C:\Program Files (x86)\Internet Explorer\iexplore.exe http://www.google.com' as command line to System Exec.vi works on my system.
EDIT: Sorry, cannot remove that stupid hyperlink as Lithium seems to automatically add the hyperlink once posting.
Tks Norbert. The disadvantage of your solution is about compatibility and repeatability to operational systems with language different of english without edit the code just befause you have specified the absolute (full) path to the program.
However, tks for replying!
You can use %Programfiles(x86)%\Internet Explorer\iexplore.exe to use the current system path.
/Y
01-18-2017 10:48 AM
FYI - I googled "labview error 2 system exec" and this was the very first hit:
http://digital.ni.com/public.nsf/allkb/EA1600EBA422E97286256AA20073C616
You could've saved ten minutes by asking google first. 😉