LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why I have to set "Wait Until Completion" to F in order to make my vi work properly work when I pass param to system exec.vi

Hi there,

 

I had a weird problem: I have to set "Wait Until Completion" to F in order to make my vi work properly work when I pass param to system exec.vi, otherwise the .exe that I'm calling will be crashed. But I need to get the result from standard output, so I need to set "Wait Until Completion" to Ture. Please see attached picture. Can anyone help? Greatly appreciate about it!

 

 

Thanks,

Weny

 

 

0 Kudos
Message 1 of 15
(2,836 Views)

What VISA resource are you closing after you run the System Exec.vi?

0 Kudos
Message 2 of 15
(2,818 Views)

I use COM11, this is a virtual USB serial port in windows 7. The .exe I'm calling is same as Hyperterminal transfer a file via Xmodem and the language I'm using for this exe is VB(.net), and the binary file I'm tranferring is a voice prompts file(audio). 

 

Thanks!

Weny

0 Kudos
Message 3 of 15
(2,786 Views)

I don't know why what you are seeing happens, but I can offer a solution that I have tried a few times when System Exec.vi did strange things. Write the command itself to a temporary batch file and then execute the batch file.

 

Also shouldn't there be a "\" after the colon in the file name?

 

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 4 of 15
(2,770 Views)

If I want to use a batch file, is the command line input " cmd /c runme.bat "?

The content in runme.bat is "mercierxmodem COM11 c:\MercierPromptsEN.bin"

 

For Also shouldn't there be a "\" after the colon in the file name?

If you mean the working directory, Labview added the "\" automaticlly...

0 Kudos
Message 5 of 15
(2,756 Views)

No, the command line input would just be "runme.bat".

 

In the snippet that you posted, there is no "\" in the command line. It read cmd /c "mercierxmodem COM11 c:MercierPromptsEN.bin"

 

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 15
(2,749 Views)

my runme is "mercierxmodem COM11 "xmodem" c:\MercierPromptsEN.bin". I run this at cmd.exe, it works fine. But when I send "runme.bat" to command line in system exec.vi, it gives me an error 2 no matter I set Wait until Completion to T or F.

 

 

0 Kudos
Message 7 of 15
(2,742 Views)

I'm sorry, you have to give the whole path to the temporary batch file. If you create the batch file in the LV temp directory, it will be a simple matter to find it.

 

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 8 of 15
(2,736 Views)

Sorry Mike, I think I'm kind of lost: do you mean I should give a whole path about the batch file (runme.bat) to the working directory of system exec.vi?

0 Kudos
Message 9 of 15
(2,723 Views)

No the command line should be the entire path to the batch file. Say the file is in a directory called my_batches off the root of your c drive. The command line would be:

 

c:\my_batches\temp.bat

 

Using the LV temp directory node (as in my snippet) allows you to build the path easily - you will of course need to convert the path into a string.

 

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 10 of 15
(2,719 Views)