LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Using system exec to run a DOS command

Solved!
Go to solution
Highlighted

I am currently writing a piece of functional test software that confirms basic functionality of a programmed module. 

 

Confirmation of the programming will be done by finding the module in the device manager. With the program, I would like to use the system exec VI with a command line prompt. The prompt used is 

 

wmic path win32_pnpentity where name="Kohler Multilink Lite Module"

 

When the device is plugged in and is programmed properly, the command line returns a long string that displays the information on the device. When is it not plugged in, it returns "No Instance(s) available."

 

Currently, the VI does not return what I had hoped. 

 

My current block diagram to get this to work is attached, along with the output from System Exec. Can someone point me in the right direction? 

 

Thank You. 

0 Kudos
Message 1 of 4
(203 Views)
Solution
Accepted by topic author BHopkins123
01-15-2019 09:09 AM

It works just fine for me. Make sure to wire the command line with the command to execute. And use the standard error output which outputs you the error information if the device has not been found.

 

 

Exec.png

0 Kudos
Message 2 of 4
(196 Views)

Well that's odd. I've wired in the error to view that as well and no matter what, it kicks back "No instances found." The standard output does not give a string either.

 

I also did it again on the command prompt and it works without issue. I wonder what I could be missing. 

0 Kudos
Message 3 of 4
(187 Views)

Well now I feel dumb. I mistyped and put "Lite" before "Multilink. Thanks for the help

Message 4 of 4
(181 Views)