LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inputting multi-part command prompt arguments into System Exec VI

Solved!
Go to solution

I'm trying to streamline some data analysis tasks by consolidating several steps into a single LabView program. As part of that project, I'm trying to figure out how to run an existing data analysis program in a LabView VI so I can then pass it on to a graphing program I've already written. The program is written in C, and is usually accessed by navigating to it on Command prompt, then entering the arguments "bint3r.exe (the program's name) inputfilename.t3r outputfilename.txt size of time bin (e.g. 0.1)" -- so, for instance "bint3r.exe input.t3r output.txt 0.1". I'm trying to input these arguments as a string fed into the System Exec VI, C:\Users\Me\Desktop\bint3r.exe input.t3r output.txt 0.1, but it seems it's only reading up to .exe, then ignoring the rest of the input, causing the program to fail due to a lack of parameters. Is there a way to make the System Exec VI read the full argument? 

0 Kudos
Message 1 of 3
(2,265 Views)
Solution
Accepted by topic author bkmacdonald96

First thing I'd try is to quote the argument:

cmd /k "C:\Users\b846m601\Desktop\bint3r.exe hmstrep2_003.t3r test.txt 0.1"

 

Do you need the cmd /k? Have you tried:

C:\Users\b846m601\Desktop\bint3r.exe hmstrep2_003.t3r test.txt 0.1

 

The cmd /k returns to the command prompt, which seems irrelevant in this situation.

0 Kudos
Message 2 of 3
(2,212 Views)

Ah, I had tried inputting C:\Users\etc\"bint3r.exe etc.", which hadn't worked, but I hadn't realized I needed to put the full file path in parenthesis. Doing it how you wrote it worked. The cmd /k was just to leave the command prompt open to help me diagnose what was going wrong; I'm dropping it from the finished code.

0 Kudos
Message 3 of 3
(2,207 Views)