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 it's a port shutdown issue, probably not.  Try to avoid prematurely exiting the app because that won't allow for proper cleanup of the connections, unless that situation is specifically handled.  

 

Maybe you could try calling VISA Close VI from within Labview before executing your app.  I don't know if Labview would be able to close a connection that it wasn't responsible for in the first place but it might be worth a shot.  

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 21 of 25
(1,161 Views)

@aputman wrote:

If it's a port shutdown issue, probably not.  Try to avoid prematurely exiting the app because that won't allow for proper cleanup of the connections, unless that situation is specifically handled.  

 

Maybe you could try calling VISA Close VI from within Labview before executing your app.  I don't know if Labview would be able to close a connection that it wasn't responsible for in the first place but it might be worth a shot.  


There is an...

 

Options >>> Environment >>> Automatically Close VISA Sessions

 

that could help with that idea.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 22 of 25
(1,159 Views)

@aputman wrote:

If it's a port shutdown issue, probably not.  Try to avoid prematurely exiting the app because that won't allow for proper cleanup of the connections, unless that situation is specifically handled.  

 

Maybe you could try calling VISA Close VI from within Labview before executing your app.  I don't know if Labview would be able to close a connection that it wasn't responsible for in the first place but it might be worth a shot.  


I don't think that will work as LabVIEW did not open the port. So the port is probably locked and nither LabVIEW or VISA will be able to access it to close it.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 23 of 25
(1,154 Views)

@RTSLVU wrote:

@aputman wrote:

If it's a port shutdown issue, probably not.  Try to avoid prematurely exiting the app because that won't allow for proper cleanup of the connections, unless that situation is specifically handled.  

 

Maybe you could try calling VISA Close VI from within Labview before executing your app.  I don't know if Labview would be able to close a connection that it wasn't responsible for in the first place but it might be worth a shot.  


I don't think that will work as LabVIEW did not open the port. So the port is probably locked and nither LabVIEW or VISA will be able to access it to close it.


That's what I assume as well.  It was a long shot.

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 24 of 25
(1,150 Views)
Solution
Accepted by topic author KovAcevich7

I got it working now and it was a stupid fix.... we had "wait until completion?" set to true, "cmd" goint into the "command line" input, "C:\" going into the "working directory" input and then made a control going into the "standard input" input. from the front panel we would type our commands into the standard input control and after we would type in the commands, we would hit enter while still in the control, and then hit run. So all we did was add a new line after our commands and now it works fine? It is possible that i originally had a new line in my original code when it was working perfectly and then I went in and deleted it thinking that i was cleaning up my vi. But the problem has been solved. Add a new line after the commands and everything is fine. Thanks for the help and suggestions guys!

 

p.s. we tried closing the port with a close VISA function and like you guys said, it was a long shot and it failed.

0 Kudos
Message 25 of 25
(1,141 Views)