LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I update continously the status output from "System Exec.vi"?!

How can I update continously the status output from "System Exec.vi" when I do run my DOS-app with the
"system exex.vi"?! I only can get the status at the end when my app. is done. The problem is that I
need all information which I've got from my app during the time it runs. It sends every second the current
status back to the DOS-box. This status I do need to proceed in my LabView app. I'm using LV 7.1 under W2k/SP2.

Thanks for your help in advance.



Daniel
0 Kudos
Message 1 of 12
(5,945 Views)
Yeah with System exe you will be able to get data from the dos exe only when it comes out,better way i suggest is keep updating some file with the data from the Dos pg and write you LV code such a way that you will be reading the data file ,thus the output of the LV code will be determined by the dos pg.
cheers
vicky
Message 2 of 12
(5,943 Views)
Actually there is a way of continuously monitoring the dos program running "System Exec.vi".

We did this a couple of years ago. Actually we had to run two, where the second one was interpreting the received data.

However... I can't remeber what we did that was special for this.. 😞

I will look around (also because I don't want to forget).
I still keep in touch with the person where I developped this. Maybe he can send me that vi and it will refresh my memory. I do remember putting the "System Exec.vi" in a loop.. Something like this:

System.vi #1: Starts the dos application

System.vi #2 inside loop: monitors the echoed data. (it is parsed, stored, manipulated, and sent to another executable). This one ran for a given duration (I think it was 2 minutes).

System.vi #3 outside loop: closes the dos application.


As I said.. I cannot fully remember, but I think it was something like what I described above. I may have posted a question for that back in 2003. I will search for it.

Remember: "where there is a will, there is a way"

😄

JLV
Message 3 of 12
(5,942 Views)
Found something:

Check out this link.

I now remember that we did set "the wait until completion of System Exec to false."

I will continue searching.
Message 4 of 12
(5,940 Views)
Sounds good so far, but how can I interpreting the received data during the 'System Exec.vi' doesn't finished yet?
In your attached link, it's said that you can store the echoed data in a txt-File. How can I do that?
If I could do this it will be easy the re-read this txt-File and monitor it in a parallel loop.
Joe, it would be great if you could send me the .vi in which you already realized it!

Thanks
Norick
0 Kudos
Message 5 of 12
(5,918 Views)
Hi Norick,

I'm the one who wrote the bit about redirecting the output to a file. It's actually written in the other thread how to do this, but I'll repeat here for simplicity:

If your command is (for example) "runsomething.exe arg1 arg2" then changing it to "runsomething.exe arg1 arg2 >textfile.txt" will redirect what would normally be seen on the screen to the file "textfile.txt".

By reading in this file in parallel, you'll have what you want.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 6 of 12
(5,915 Views)
Thanks for your fast input Shane. I checked it out and it works 🙂 The only problem I've got is, that the update process from the logfile.txt
is quite slow. It takes seconds (>10s) until the file is saved although my DOS-app updates it every second. Is there a way to speed it up?!

Thanks
Norick
0 Kudos
Message 7 of 12
(5,906 Views)
You need to make sure your "read" code isn't waiting for the System exec to finish. If this is the case, you obviously won't read anything until the DOS prompt disappears. Try launching both the System exec and the read routine in parallel (no data dependency).

I've tried this out and it works fine. You just need to make sure that the "read" loop is stopped whan the system exec is exited (local variable will do for now).

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 8 of 12
(5,900 Views)
Just to clarify:

The file will be updated consistently while the DOS prompt is running. On my system when I use the redirect function ">txtfile.txt" I don't actually SEE the DOS window. Are you saying you get a file AND a dos window?

Like I said earlier, you need to make sure the two functions aren't waiting for each other to finish.

I have a really ugly example I could post, but only if you don't manage it yourself. It runs a nasty batch file generating files of several megabytes (dir /a/s called multiple times).

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 9 of 12
(5,897 Views)
I think we did this without writing to a file.

I may have a backup copy of this somewhere.
I will look for it and post it on this thread.

JLV
Message 10 of 12
(5,894 Views)