I have a simple program, test.vi, that uses the system exec.vi command
to run a program from the command prompt. Intermittently, I am getting
an error 2 "System Exec.vi. Command was "SIC.EXE -T C:\Horiz.rf" "Error
2 occurred at System Exec.vi. Command was "SIC.EXE -T C:\Horiz.rf"
Possible reason(s):
LabVIEW: Memory is full."
JUST RUN THE TRUE CASE ["Use Copy"] WHICH IS THE DEFAULT CASE, at least
at first. (The False case, which is the really simple case seems
to work fine (until you have messed up the DOS command prompt situation
by running the True case; you can try this too if you like.)
To exactly duplicate for running the TRUE case, you will have to create
the directory: "C:\Program Files\National Instruments\ROTH
LABVIEW\SONIX CSCAN\Ceramic Wedge" and place Horiz.RF file in this
directory. (For running the FALSE CASE, place Horiz.RF file in c:)
Also, first place the program sic.exe in c:. This code takes an
".rf" file and creates .NDF and .NEU files from it. If you run it
from a DOS window, it works every time using the syntax: SIC.EXE -T
c:\Horiz.rf
Any idea why I might be getting the error? Needed another set of eyes on this one.
Thanks,
Don
test.zip:
http://forums.ni.com/attachments/ni/170/145190/1/test.zip
Have you tried using "cmd /c SIC.EXE -T Horiz.RF" instead for the
command line? For more information on this please refer to the
following knowledge base document: <a href="http://digital.ni.com/public.nsf/websearch/EA1600EBA422E97286256AA20073C616?OpenDocument" target="_blank"> Error 2 (Memory Full) When Using the System Exec VI</a>.
I did not get error 2 trying your VI with this command, but let me know if this doesn't solve the problem.
Good luck and best regards,
Shakhina P.
Applications Engineer
National Instruments
Sorry for a late reply. When I run your VI as is, I get Error 2 in both cases. But when I change the command to "cmd
/c SIC.EXE -T Horiz.RF", both cases execute correctly. I have tried
executing the True case multiple times and it worked as expected each
time (just removed Horiz.rf, Horiz.ndf and Horiz.neu from C:\ each
time, since otherwise Copy function returns <Not A Path> ).
I am using LabVIEW 7.1 on Windows XP SP2. Which version of LabVIEW and which OS are you using?
- Skip the rest of the code if the file dialog is cancelled.
- Handle the situation if "copy" causes an error.
- Test if sic.exe exists.
- Test if output files already exist (your code seems to stall if this happens).
- etc.
I also think it is poor practice to operate in the root of the C drive for things like that. Files related to this program should be encapsulated in their own subfolder.
path.png:
http://forums.ni.com/attachments/ni/170/146685/1/path.png
system_exec_attempt.png:
http://forums.ni.com/attachments/ni/170/146693/1/system_exec_attempt.png