LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Improving the speed of execution

Solved!
Go to solution

 

HI again,

 

I am attaching a VI developed which takes in data from an external source (engine in this case) and stores data. However, its rate of execution is very slow.

I am assuming it happens so because I'm writing data onto the hard disk in the "Block Average VI". I have tried using shift registers, but they dont seem to work in this case.

Please see the attached VI and suggest how to improve its speed as it will be used for high-speed data acquisition.

 

Thanks !

Dheeraj Bharadwaj
IIT-Madras
Download All
0 Kudos
Message 1 of 9
(2,842 Views)

PFA the other two sub VI's.

Dheeraj Bharadwaj
IIT-Madras
Download All
0 Kudos
Message 2 of 9
(2,841 Views)

Here's the modified program which I tried using shifte registers. This progarm executes even more slowly.

Dheeraj Bharadwaj
IIT-Madras
Download All
0 Kudos
Message 3 of 9
(2,839 Views)

These are the other two subVI's of the modified program

Dheeraj Bharadwaj
IIT-Madras
Download All
0 Kudos
Message 4 of 9
(2,838 Views)
Solution
Accepted by topic author dheeraj2102

Dheeraj,

 

Is see several things which may contribute to your slow execution.

1. In Channels DT.vi you create channels, configure timing, start the task, read data, and stop the task.  The configuration does not change from one iteration to the next so why repeat all this? Set up for a continuous read and move everyuhing except the DAQmx Read outside the loop.

2. Since you are working with arrays, why not read the data as a 2D array rather than an array of waveforms which then gets converted to dynamic data then back to arrays?  A single Index Array function would replace the Split Signal and all the Convert from Dynamic Date primitives.  In addition with the Index Array it is clearly obvious what is happening. Dynamic Data structures and functions tend to hide things behind configuration dialogs.

3. The Express calculators are probably quite slow compared to the Polynomial Evaluation VIs which operate directly on numeric data types.

4. The Block Average Dt.vi performs exactly the same averaging calculation as the Instantaneous Average DT.vi and then does a bit more.  Why do the calculation twice?  Just bring the Instantaneous Average output as an additional output from Block Average DT.vi and eliminate Instantaneous Average (or use it as a suVI to Block Average.

5. You have several Quotient and Remainder functions and comparison functions which duplicate calculations.  Just use the result of one of them in several places.

6. If the values of the controls cannot change during a run, move them outside the loop.  The loop does not need to read them each time.  The values are treated as constants inside the loop.  Obviously Stop needs to be inside the loop because it changes during a run.

7. Wires running behind other objects and wires make the diagram difficult to read.

 

See the image below for a cleaned up version of DT.  At the top of the loop is a construction showing what I was talking about in items 2 and 3.

 

Lynn

DT.2.png

Message 5 of 9
(2,817 Views)

 

Thanks a ton! I'll try this out in the lab tomorrow !!!!

 

BTW, how do u manage to get such small icons for indicators/controls? I usually get large ones, which occupy a lot of space!

 

Thanks again! 🙂

Dheeraj Bharadwaj
IIT-Madras
0 Kudos
Message 6 of 9
(2,811 Views)

Right click on the terminals and uncheck View as Icon.

 

But for them to be placed as the smaller terminal by default, go to Tools/Options/Block Diagram, and uncheck Place Front Panel Terminals as Icons.

0 Kudos
Message 7 of 9
(2,806 Views)

Thanks a lot for the solution, but I'd be really elighted if you could attach the VI you created 🙂 I will choose your reply as the solution!

Pls send it in version 8.5

Dheeraj Bharadwaj
IIT-Madras
0 Kudos
Message 8 of 9
(2,787 Views)

I do not have access to that VI until later in the day.  I will try to post it tonight.

 

Lynn

0 Kudos
Message 9 of 9
(2,754 Views)