LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to update the progress bar output according to the vi execution time at real time

hi wolfgangsimeth,

Actually i have no idea how to get the real time status of excel report code execution...i think it is the key point how to fix the problem...i placed the source code in the attachment

 

Download All
0 Kudos
Message 11 of 19
(1,862 Views)

yuanjieping ha scritto:

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?


I supposed you had the possibility to detect the status of the excel report creator in real time, so that the problem would have been limited to communicating the data between the two VIs; this is why I suggested to use a queue, which provides almost zero time delay (unless the producer enqueueing is faster than the consumer processing). In this way the VI creating the report could communicate its status in multiple moments during its execution, not only after its conclusion.

Unfortunately I run an earlier version of LV (2012), so I can't open the VIs you attached in your last post.

0 Kudos
Message 12 of 19
(1,850 Views)

hi cente90,

i am not able to detect the status in real time.. do you have any idea?

0 Kudos
Message 13 of 19
(1,846 Views)

You´re right. That´s the problem. You won´t be able to update a progress bar if you don´t know the progress status of your SubVI. And I´m afraid, there is no way to get that information from a SubVI. You can tell whether it´s running or not, but that´s it.

0 Kudos
Message 14 of 19
(1,845 Views)

yuanjieping ha scritto:

hi cente90,

i am not able to detect the status in real time.. do you have any idea?


Without being able to open the VI it's impossible for me to have a try, you should save it for a previous version or create a snippet for a previous version.

0 Kudos
Message 15 of 19
(1,838 Views)

An absolute shot in the dark: if you do not have any for loop or piece of code of which you can determine execution time inside the VI that creates the report, would it be possible to divide it into logical sequences and send an artificial but reasonable approximation of its time execution state after each sequence?

 

Example: the VI I want to trace multiplies two numbers and adds the result to a third one: I don't know how much time is required to perform the two operations, but I can estimate each of them takes 50% of the total VI execution time. Therefore, as soon as the multiplication is completed, I send via the queue the value 50% to the progress bar VI, and after the sum I send 100%.

0 Kudos
Message 16 of 19
(1,833 Views)

i enclosed the snippet in the attachment. actually i also use the queue to transfer the message to the progress bar....And if it is a counting VI it will be no problem to estimate the execution time with a Loop, but for creating report, i have no idea.

Download All
0 Kudos
Message 17 of 19
(1,824 Views)

That's the Report Generation Toolkit if I'm not mistaking, so trying editing the subVIs to make them communicate their state is probably not a good idea. I'm afraid there is not very much to do then: the only alternative to the idea of my previous post is to run the report generator some times by yourself and determine how much time is takes on average to execute, and then set up a loop running in parallel inside the report generator block diagram, calibrated to last the same average execution time of the four subVIs sequence you've determined; that loop would be easy to monitor in terms of progress, and you could also force it to exit if the report generation finishes before it. This is seriously approximative (the report generator execution time depends for sure on the PC technical specifications, and also on the strings array size, I guess - you should calibrate the parallel loop with respect to it), but I can't figure out many different solutions.

0 Kudos
Message 18 of 19
(1,801 Views)

anyway thanks for your help. i will have a try with your solution.

0 Kudos
Message 19 of 19
(1,792 Views)