LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increasing Execution Speed

Solved!
Go to solution

I have been working on a old program, adding another instrument to this VI.

 

It is a simple loop that monitors up to 3 DVM devices and takes measurements.  It also takes those measurement values and tells you whether or not they are above or below a certain threshold.

 

With the "Measure Every (s)" control set to 0 (the fastest possible execution time) I am able to clock:

 

1 reading with 1 DVM every 0.78 seconds.

1 reading with 2 DVMs every 1.5 seconds.

1 reading with 3 DVMs every 2.14 seconds.

 

I would like to speed this up.  In an older version of this program, I didn't use the "EMI Read Sub.vi" which you can see in the center of the program, and supposedly it was faster when the code was programmed right into the main block diagram and didn't use the sub.vi.

 

I am just wondering if anyone has any suggestions on how to speed this program up.  Does the use of sub.vis actually slow the execution speed down?

0 Kudos
Message 1 of 5
(3,116 Views)

Nothing in the code screenshot you provided would produce such long interation times. Without knowing what is in those subVI's or what instruments you are interfacing with it is impossible to say for sure. It could be a limitation of the instrument, or how the measurement is configured on the instruments, or a timeout on the GPIB comminucations that limits the number or communications that can happen in a given period.


Corey Rotunno

Message 2 of 5
(3,108 Views)

Thanks for giving it a look.

 

Attached is the screenshot of the "EMI Read Sub.VI" shown in the previous image.  You can see the Agilent 34401 user .vis that came with the LabView software.  It looks like by initializing once at the beginning, rather than each time the sub.vi is executed, I will be able to get my measurement readings in quicker succession.

0 Kudos
Message 3 of 5
(3,090 Views)
Solution
Accepted by topic author TerryBozio

This is true, but if the 3 meters are at different GPIB addresses that may not work and they will have to be initialized separately. What type of measurement are you making? I am looking at the data sheet for the Agilent 34401A and there are parameters that could cause any type of measurement to take a while. For instance, AC signals the measurement time is a function of the input signal frequency along with the level of filtering you choose. For most other types of measurements the resolution you choose greatly affects measurement time.

 

https://engineering.purdue.edu/ME588/SpecSheets/34401_UserGuide.pdf

 

 


Corey Rotunno

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

Using 3 Agilent 34401 DVMs I have reduced the cycle time from 2.14 seconds for 1 measurement from 3 DVMs to 1.33 seconds for 1 measurement from 3 DVMs.  Quite an improvement, though I would ultimately like to get it down to an even 1 second.

 

I did this by pulling the initialize and configure vis out of the sub.vi (shown in my last post) and putting them in their own sub.vi that only executes (3 times, 1 for each DVM) during the first iteration of the while loop.

 

I am using this program to take single point, 2 wire voltage readings, either AC or DC.

0 Kudos
Message 5 of 5
(3,038 Views)