From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

any way to talk to command prompt without using system exec.vi

Solved!
Go to solution

If you look at the detailed help on the system exec vi, it calls for "cmd /c" if you want the command to be run directly to the command prompt, which in this case I do. The app that I am calling is sitting directly in the c drive. i have checked multiple times to see i the com port has switched on my and everytime it has been in the same spot. Finding the corret com port is not the issue. For some reason, the system exec vi doesn't want to give me an output in labview from the command prompt whenever i call on this wifi1vc app.

0 Kudos
Message 11 of 25
(1,490 Views)

@KovAcevich7 wrote:

If you look at the detailed help on the system exec vi, it calls for "cmd /c" if you want the command to be run directly to the command prompt, which in this case I do. 


The VI you attached has "cmd c/" not "cmd /c"

cmd.png

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 12 of 25
(1,484 Views)

oops, typo. I did have it cmd /c in the actually code that I am using and it was not working still.

0 Kudos
Message 13 of 25
(1,479 Views)

Well since I dont have the wifi1vc program I don't have any more ideas.

 

When I run the vi (with /c) and the "wait until completion" set to false I can see the standard  "wifi1vc is not recognized as an internal or external command, operable program or batch file" error flash by on the cmd window.

 

So the systemexec is working and I am still thinking it's a path or command line problem.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 14 of 25
(1,474 Views)

You don't need cmd /c to run your own executable.  cmd /c is for calls that have to be run from the cmd prompt, such as dir and del, that are contained with the command executable. 

 

Are you able to run "ipconfig" or "ping localhost" and get standard output?  Make sure Wait Until Completion is set to true or you won't get output.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 15 of 25
(1,465 Views)

whenever i type in commands like "ipconfig" or "netsh wlan show hostednetwork" into the system exec.vi through the command line input, the output shows me exactly what I would expect, they work perfectly. I can call on the .bat file through the command prompt directly and it works fine. But when I call on the .bat file to connect and disconnect from the network, then not only does it not work through labview, but it also fails to work in through the command prompt directly unless i power cycle the board. I have no idea. I feel like it might be something with the .bat file, and the unfortunate thing there is the creator of that file is gone all week 😄

0 Kudos
Message 16 of 25
(1,436 Views)

correction to that last post, once I try to send the .bat file commands to connect and disconnect the board through labview, the commands won't work wither directly in the cmd prompt or in labview unless i power cycle the computer and start fresh.

0 Kudos
Message 17 of 25
(1,432 Views)

That sounds like it might be a "Port in Use" issue.  Maybe the port is not being closed down properly.  Hard to say.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 18 of 25
(1,429 Views)

@aputman wrote:

That sounds like it might be a "Port in Use" issue.  Maybe the port is not being closed down properly.  Hard to say.


I agree, whatever program you are calling in your batch file is is proably not releasing the port properly.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 19 of 25
(1,426 Views)

would I be able to fix this without messing with the app file?

0 Kudos
Message 20 of 25
(1,420 Views)