LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Exec

Hi,

I want to use the System Exec-VI to call other applications.
I use it to execute a Matlab m-file and it works fine.
However, I also have to call another, company-internal program and this call fails.
I used exactly the same syntax as in the command window or in a batch file and there it works, so the syntax cannot be wrong.

I have to open the saved project fiIes of this programme and tried the following calls two calls:
V:\sandbox\GWE\08_test_database\TTX-Disturb\download_test_case.dpj
START /D "V:\sandbox\GWE\08_test_database\TTX-Disturb" download_test_case.dpj
The error code I receive is 193 and it is undefined.

Also double-clicking the project file in Windows Explorer works.
Opening the exe of the program works in LabView with the following call:
C:\TTAutomotive\TTX-Disturb\1.104.3\TTXdisturb.exe

Any ideas what might be the problem and what I can try?

Regards,

Gerald


0 Kudos
Message 1 of 10
(5,290 Views)
Create a batch file and execute?

Paul
Message 2 of 10
(5,289 Views)
But why is it not working in LabView?
I thought it does the same as a batch file.

Regards,

Gerald

0 Kudos
Message 3 of 10
(5,285 Views)
I have found limitations in the command line vi.  Sometimes, playing around with the comma's works.  Beyond that, i usually create a batch file. Dynamically write it to disk, execute it, then delete it.  Keeps my code fairly clean, no extra files to lug around on deployment.  I never stopped to ask why.  Just sort of rolled with it. 

Paul
Message 4 of 10
(5,282 Views)
From the System Exec.vi help:

To launch an executable with options using the syntax filename.exe -option1 -option2, create a filename.bat file that calls the executable with the options syntax and use this VI to call the filename.bat file.

From my understanding, you can't use this VI to call programs if you're using command line options. You said you're trying to use start /d, this will cause problems. Like Stradis said, creating a batch file should work.
Message 5 of 10
(5,270 Views)
I don't think that's a problem, I use:
ipconfig /all
all the time and it works...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 10
(5,250 Views)
did you try forgetting the Start /d?
" V:\sandbox\GWE\08_test_database\TTX-Disturb" download_test_case.dpj

afterall I have used this command line at it works flawlessly

"
C:\Documents and Settings\Owner\Local Settings\Temp\lvtemporary_53166.snmpBin\snmpget.exe" -c public -v 2c -M +"C:\Documents and Settings\Owner\Local Settings\Temp\lvtemporary_53166.snmpBin" wfm.stradis.int WFM-MIB::jitMeasurement.0

As you can see, many command line parameters, long directory paths.  The other two things I can think of, is putting the dpj file in quotes Or putting the entire path to the dpj file there in quotes.



Paul
Message 7 of 10
(5,232 Views)
Two things to try:

FIrst, I think the command might be malformed. Try START /D "V:\sandbox\GWE\08_test_database\TTX-Disturb\download_test_case.dpj", come to think of it, you shouldn't really need the quotes at all since there are no spaces in the path\filename.

Second, you might want to add the path part of the command to the DOS Environment Variable PATH. This would add that path to the list of disk locations that DOS looks in to find stuff. The result is the command would be reduced to simply:
START /D download_test_case.dpj

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 8 of 10
(5,229 Views)


@mikeporter wrote:
Two things to try:

Second, you might want to add the path part of the command to the DOS Environment Variable PATH. This would add that path to the list of disk locations that DOS looks in to find stuff. The result is the command would be reduced to simply: START /D download_test_case.dpj

Mike...


Mike,

I think you may be on to something there.  First, I am assuming that a file with extension .dbj is associated with that TTXdisturb program.  If so, I would think windows would know where to find it by way of the registry settings.  But let's say it is an issue with the program needing to be executed from its working directory.  If you click it from explorer, then windows is actually starting it up in that directory as its working directory.  If you put it all in a command line, it may be trying to use a default windows directory as its working directory.

Gerald,

Try wiring up the path of V:\sandbox\GWE\08_test_database\TTX-Disturb\ to the working directory input of the system exec.vi.

0 Kudos
Message 9 of 10
(5,196 Views)
I tried all your suggestions, but it doesn't work.
Most of the time I get the error message: "LabView: Memory is full"
I don't understand it, but I am now using the option to create a batch file at runtime and call this file with the System Exec VI.

regards,

Gerald

0 Kudos
Message 10 of 10
(5,158 Views)