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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting execution time of a VI

Solved!
Go to solution

Hi,

I want to calculate the time my VI is running.

Suppose if my VI has run for about 10 min then I want to pop up some message.

But how do I get this time.

I have tried using the "Elapsed time VI" , but its not giving me the required output.

Any suggestions.

 

Regards,

Runjhun A.

0 Kudos
Message 1 of 12
(8,462 Views)

There might be a better solution, but this is one way to do it

 

Paul

0 Kudos
Message 2 of 12
(8,448 Views)

Oooops. The shift register is no necessary 🙂

0 Kudos
Message 3 of 12
(8,443 Views)
Solution
Accepted by topic author RJ_15

Hello Runjhun,

 

I have modified the VI from above so that it functions as I believe you wish it to. I have only placed a simple dialogue box to alert you when 10 minutes is up but this could easily be edited to create a custom pop-up dialogue box.

 

I hope this helps and let me know if you need any more assistance.

 

Regards

David B
Applications Engineer
National Instruments UK
0 Kudos
Message 4 of 12
(8,430 Views)

Thanks to both of you.

It may be quite niche as I have started learning LV few months ago.

I thought of building an application that will execute in background (or for the time being user will launch) and if some specified time is completed, lets say 1 hour then it should pop up some warning message that will temporarily disable all the programs running in the system.

Kinda Windows programming stuff.

Do you have any idea about it in LabVIEW 9.0 or later or may be you can suggest me something worth.

 

Regards,

Runjhun A.

0 Kudos
Message 5 of 12
(8,429 Views)

Hi RJ,

 

To find out the execution time of your VI there is a nice built-in application in LabVIEW which can provide you with this information, this can be found at:

 

Tools >> Profile >> Performance and Memory...

 

If you want to hard code the execution time of your VI it is possible to do so using a sub-VI which is set to dialog mode in the main VI properties. I have quickly created a example version of this code and attached it to this post.

 

I hope this helps, if you have any more questions or need further insight please do not hesitate to post.

 

Regards,

 

 


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

0 Kudos
Message 6 of 12
(8,416 Views)

Hi Laurence,

I have used the suggested methood and attached the results.

 

The application run continuously in loop for ~10sec for 5 loops. However, according to the profile high level VI ("Example_Apache") ran in total for 358msec.

Could you please explain the differences? 

 

Thanks,

0 Kudos
Message 7 of 12
(5,932 Views)

Hi Buleon,

 

you only get "real" processing times.

When the CPU is idling (like in Wait functions) it doesn't contribute to processing time…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(5,918 Views)

Hi GerdW,

 

Does it make sense that in the middle of VI execution there will be CPU "wait" states?

Is it proactively used inside invoked *.dll?

 

The issue is that relatively simple programs takes ~2sec for cycle, while real cpu processing 20 times shorter.

BR,

Igal

0 Kudos
Message 9 of 12
(5,907 Views)

Hi Buleon,

 

there is a simple rule: when you have problems with YOUR VI and you want us to provide solutions/suggestions you should attach YOUR VI here! (Attach VIs or snippets, but not pure images.)

 

Does it make sense that in the middle of VI execution there will be CPU "wait" states?

What is the "middle" of your VI?

 

Is it proactively used inside invoked *.dll?

Which DLL and which functions are you talking about?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(5,885 Views)