LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open exe file, wite and the read the output of file

Hello,
I am trying to open a exe file then type V + return and then view the outputed version of firmware running on a device so then I can verify a pass or fail. I have gotten so far as to open the file, then simulate key presses and it returns the current version of firmware. Although, as it runs it is on a window outside of LabVIEW and I can not get it to output in the front panel.


It would be nice to send a string V + Return (propablly "V\r") instead of simulating key presses, but I could not make this work.


How can I run the exe without it poping up in the forground and then see everything outputed to the front panel? here are some snapshots. Any suggestions would be helpful, Thanks

 

 

Montn_0-1598499638285.png

 

Montn_1-1598499664411.png

 

 

 

Actual Exe view

Montn_2-1598499680454.png

 

0 Kudos
Message 1 of 5
(1,128 Views)

You might want to check out Greg Payne's solution using .NET callbacks to interact with a command line terminal.

LabVIEW System Exec with callbacks (blog post) 

Bitbucket repository 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(1,073 Views)

Many .exe can take command line arguments, so you could e.g. send fc3 -v and avoid the need to send a key press. Check the manual/help.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 5
(1,068 Views)

@Yamaeda wrote:

Many .exe can take command line arguments, so you could e.g. send fc3 -v and avoid the need to send a key press. Check the manual/help.


Just expand on that idea a bit.  The output probably gets sent to stdout.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 5
(1,050 Views)

not sure how to utalize the .NET callback as the link given implies .  Does that mean changing the exeisting library for "system exec.vi" with what offered in Bitbucket repository 

 

you would think that the standard input is where I would enter "v + return".

 

The standard output never displays any information.   I can get a bat file the will ping localhost and the works with no problem. In fact anything that runs in the command prompt works great. I just can't it to output anyting when I ring the fc3.exe file, and it runs in the foreground even when it is ran set to run minimized.  Bill what do you mean expand the idea a little bit. not sure what you were appling this to.   

Is there any way I can add to the command line input (cmd/c start "FC3.exe") so that it writes more such as "cmd/c start "FC3.exe" / v return .

 

0 Kudos
Message 5 of 5
(1,022 Views)