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.
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.
11-23-2016 04:11 AM
hi all,
i am now considering to write a progress bar vi to calculate the vi execution time(like creating the excel report). up to now the progress bar vi is finished using while loop. but i have no idea how to update the vi execution time at real time since i use loop count to 100 by increasing 1 each step.
could any1 help me? it will be appreciated if you could give me some advice. thanks
11-23-2016 05:03 AM
Hi yuanjieping,
Some time ago I created the piece of code attached to estimate the remaining execution time of a for loop, basing on the previous iterations time. Hope it can help you.
11-23-2016 09:02 AM
my describing might cause some missunderstanding.
i have 1 sub vi which will create excel report. another progress bar vi will monitor the running status of the excel vi. when the excel report successfully set up, the progress bar should display 100%. The procedure of executing excel vi should be synchronized with progress bar.
11-23-2016 09:51 AM
You need to transfer data between VIs executing in parallel then. What about setting up a queue? The VI creating the excel report (producer) could enqueue its progress state in any moment, and it would be received and displayed by the progress bar VI (consumer); as soon as the consumer gets the 100% value it should exit the dequeueing loop in order not to get stuck.
11-23-2016 09:52 AM
Make a state machine out of the code and have the progress bar update with each state completed.
11-23-2016 07:28 PM
hi cente90,
do you means that after the excel report (producer) finished, one state will be enqueued, and then the progress bar VI (consumer) received the queue? if so, it looks like one time delay function is used after the excel report VI.
do i right understand?
11-23-2016 07:30 PM
hi bill,
do you means put the the two VI (excel report and progress bar) into the state machine, let them run one after another?
11-23-2016 11:33 PM
Actually my solution kind of dovetails with the one above it.
11-24-2016 12:25 AM
sorry i do not quite undetstand your solution. could you please be a little specific? As i understand your solution is trying to put the vi into 2 different state of the machine and let them run one after another.
11-24-2016 02:50 AM
Hello yuanjieping,
it´s no problem place the progress bar in another SubVI then the code that creats your excel report. But how does your excel report code tells you his status of execution? Could you post that code please?