LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

executive and progress bar

Solved!
Go to solution

Hi all,

I need to do a firmware programming via system exec.

Currently, i just able to update my progress bar using a while loop which unable to let me to end the process if output come out early from the system exec is not correct.

Anyone can give me a better idea in order to save time if the firmware programming is not successful?

thank you in advance.

 

0 Kudos
Message 1 of 5
(4,946 Views)
Solution
Accepted by topic author bslee86

Very simple solution:

Use a communication method (e.g. notifier) to notify your while loop that the system exec has finished. Put the send notification just after the system exec VI and then inside your while loop, wait for notifications (with a low timeout) and if you receive the notifier, exit the loop.

 

More advanced solution:

Does your command line programmer have an output that shows the status of the programming? If it does...you could try to catch the console output while the system exec is running (e.g. pipe the console out to a file and read-only read the file - like a tail operation in linux). I think there are other ways of catching the console output while it's running but I can't remember (perhaps with .NET?) - I'm sure a search of the forums will give you details.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 5
(4,911 Views)

Put your time calculations into a functional global with a 'Time' input and 'Progress' and 'Done' outputs. Add error clusters for sequencing.

Program the function cases as follows: 

Start - store the total time of the progress bar and the current time in two shift registers

Read - calculate the time percentage for the progress bar (output 'Progress') and set boolean output 'Done' if time exceeded.

Stop - force Progress to 100% and Done=true

 

In your main program, before the loop, initialise the timer by calling it with 'Start' and the time you want (90?)

In the loop, call it with 'Read' - wire the 'Progress' output to your progress bar and use the 'Done' output to stop the loop.

After your Sys Exec completes, wire the error cluster to another timer vi error in with the 'Stop' function selected.

 

The timer vi will run for the selected time updating the progress and set Done when the time is up, or you stop it early by calling it with 'Stop' after your exec completes.

0 Kudos
Message 3 of 5
(4,904 Views)

Hi Sam,

 

Thank you for your advise. I had try out the notifier method you mention and it works. 

Currently, I try to train myself able to write out a good software architexture. I think some of technique are important in order to do so like queue.

Hopefully can learn more from you guys.

 

Thanks. 

0 Kudos
Message 4 of 5
(4,860 Views)

Hi Stuart,

 

Thank you for your advise.

Due to it was only a dynamic vi that will call by the platform so I wish to try using more simple method in order to settle this problem.

I using notifier mention by sam to do so.

Thank you very much for your advise.

 

Rgrds,

0 Kudos
Message 5 of 5
(4,858 Views)