LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way of timing how long a VI takes to execute?

Hello,

 

I am developing some code which is receiving data from a serial port. I am sending three data packets with a 500ms gap between each one. There is a minimum of 1300 seconds before the next set of data is sent out.

 

The time my labview code takes to run seems to have become as issue, I am doing a some of array manipulation, and a few other things.

 

It seems to miss out some data and I want to be sure that the code is running within my timing limits. But surely LabVIEW can't be that slow that it takes 500ms to run a VI (or part of one in my case)?

 

Is there anyway way of timing how long it takes to run a VI or part of a VI?

 

 

Thanks,

 

Jack

0 Kudos
Message 1 of 6
(4,971 Views)

Hi Jack,

see "Tools -> profile -> performance and memory...". It shows how long a vi needs to execute.

 

Mike

0 Kudos
Message 2 of 6
(4,966 Views)

Have you considered using a timed loop to call your subvi code? This has the output node Finished Late?, which you can use to determine during runtime whether your loops are taking too long to complete.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 6
(4,951 Views)

In addition to the above susggsetions you can do benchmarks to comapre different code constructs. THe following is an image where I was comparing 4 different methods of stoping a VI.

 

 

Post an image of your code and we can probably tell you what is taking too much time.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 6
(4,944 Views)

Hi,

 

As Ben suggested, you could use sequence structures and tick counts to find how long your vi is taking to excute. Also, try setting ur vis execution properties for optimal performance by removing debugging, increasing the priority of execution.. etc 

-Mallya

" Appreciate and motivate those who help"
0 Kudos
Message 5 of 6
(4,927 Views)

mallyaprs wrote:

Hi,

 

As Ben suggested, you could use sequence structures and tick counts to find how long your vi is taking to excute. Also, try setting ur vis execution properties for optimal performance by removing debugging, increasing the priority of execution.. etc 


NO!

 

First fix the code. Mucking with priority (without a good understanding OS Scheduling operations) is a bad idea.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(4,923 Views)