LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add running indicator to a System Exec block

So I have to run a DOS style progam with LabView to convert a file from one format to another.  This process can take anywhere from a few seconds to a few minutes.  While it is converting, the program just sits there like it's in an infinite loop (which I know it isn't, but another user would not know).  I'm trying to add a run indicator to it and I have tried everything I can think of to make it work.  Just a LED Indicator would be fine, but I do have a counter thing with a while loop that would show that the program is still responding (which should work the same way as an LED Indicator, except move).  I wish I could post a screenshot of what I'm working on, but I do not have LabView on this machine, and the LabView machine cannot go online here at work. This may be something very simple that I am overlooking, as I am two weeks new to LabView. 
0 Kudos
Message 1 of 10
(4,078 Views)

cursorSet.png

 

You could set the cursor busy when you begin and unset it when the process finishes.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 10
(4,068 Views)

Is the duration of the program linear (consistent) with size?  If so, you can do a calculation showing the percentage complete based on time (I know it is not fully accurrate, but gives you an idea). 

 

From memory (no LabVIEW here), I think you can set the VI to wait until complete before your code continues from the SysExec vi.  You can set a trigger before running it and after it completes to start and stop the progress counter routine (loop, etc).

 

R

0 Kudos
Message 3 of 10
(4,062 Views)

Since you wrote


RyanNaz wrote:
... ... but I do have a counter thing with a while loop that would show that the program is still responding ...... 

If you also know the maximum value of that counter, you could use a "Horizontal progress bar".

0 Kudos
Message 4 of 10
(4,059 Views)
Thanks for the help.  Maybe I can clarify it a little.  How do I know when the process starts and stops?  There is no way of me knowing how long this process will take as it will convert many different sizes of files.
0 Kudos
Message 5 of 10
(4,048 Views)
How would I add a trigger?  I tried the sequential block without any success.
0 Kudos
Message 6 of 10
(4,047 Views)

I've been away from LV for too long 😉

 

Attached is an example.  I did it quickly tonight and did not optimize the code within the loop....  I'm sure it will show up in the Rube Goldberg code LOL! 🙂

 

The file size would normally be wired directly to whatever you use to open a file, or from a file property VI.

The command line is where you call your program (you have that already).

The ratio time/size is how long in seconds that it takes on average to process a given size of file.  Example, if a 1024000 byte file takes 1 sec then the ratio would be 1024000.  Try to do it in seconds per bytes because the file size property will be in bytes.

 

The bottom loop will stop under 2 conditions:

1.  the number of expected seconds have elapsed

2.  the SysExec was done

 

The indicator will go to 100% maximum and should not roll over.  You may need a property node to reset the slide in your code.  I'll put it into the example.

 

The sale indicator will update every second. 

 

The rest of the code should be self-explanatory and had some comments.

 

Hope it helps.

 

R

Message 7 of 10
(4,027 Views)
Well no solutions here really worked for me.  There's no way to tell how long the process would take because the file size would always change, plus it was going to be used on multiple computers.  I ended up just using a seperate VI that would show a nice graphic.  Thanks for the help though!  It did give me the idea that I went with.
0 Kudos
Message 8 of 10
(4,006 Views)

I seem to recall that there was a small vi that was created which was a running horse / dog / or man.. 

I think it was posted by tst.  I will look for it.  You could replace the progress bar with the animated icon.

 

R

0 Kudos
Message 9 of 10
(3,994 Views)

Here is what DFGrey suggested:

 

"To roll your own, do the following:

  1. Do an advanced image search in Google and look for "animated running dog" in the GIF or PNG format - at this point you can just paste it onto the front panel of your VI, or, for more control...
  2. Take the image you find and decompose it into its separate frames (most photo editors will do this - if you don't have one, I know GIMP works, but it is somewhat user unfriendly)
  3. Paste the separate frames into successive frames of a pict ring control.
  4. Set up a While loop to iteratively go through the frames of the pict ring (just set its value at each loop iteration).  You can adjust the timing and sequencing to your liking."

0 Kudos
Message 10 of 10
(3,992 Views)