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: 

Echo verbose from command prompt to Labview

Solved!
Go to solution

Hello everyone,

 

I need some direction into getting progress verbose back from windows command prompt.

I need to run AVRdude through labview to perform firmware updates. AVRdude is an executable that communicates with the bootloader ont he chip to upload the binary file. the process could take a minute or two depending on the size of the hex file.

During that time, I would like to display some progress bar or some verbose dictating the progress.

I know how to run the executabel from labview but I only can get the result at the end of the upload process. which is different from when you run the process manually . If I run the same command manually , I can see the progress on the cmd window.

Here is a screenshot of the result, the code I used is attached.

trans.png

 

and here is the result I get at the end of the process :

trans.png

Thanks for your help and guidance.

 

0 Kudos
Message 1 of 7
(4,863 Views)
Solution
Accepted by topic author mam1nej

I doubt that is possible using the System Exec VI.  That VI is just like any other VI that you might write, in that the output is not available at the terminals until the VI finishes execution. 

 

If the code that you are calling from the command line was written by you, you could output the verbose data to a file and read it in thru Labview.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 7
(4,857 Views)

How about not running system exec minimized?

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 3 of 7
(4,834 Views)

Thanks for your suggestions. I redirected the stdErr to a logfile and iteratively read from the generated text file. That did it.

 

Thanks

0 Kudos
Message 4 of 7
(4,754 Views)

I know you already found a solution - but you can also use the .NET process library to interactively read from a command-line application.

 

I posted about it previously here: http://forums.ni.com/t5/LabVIEW/Real-time-Command-Line-Interface-System-Exec/m-p/3183320#M921212


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 5 of 7
(4,749 Views)

In looking for a response for this thread, I was thinking there had to be a way to call a command prompt from .NET but I didn't really spend much time researching for a way to do it.  Nice job Sam.

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 6 of 7
(4,744 Views)

Sounds really interesting. I remember doign this with C# and was easily able  to redirect asterr and atsout with .Net.

I will try this out.

 

Thanks

0 Kudos
Message 7 of 7
(4,738 Views)