06-26-2011 06:25 AM
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 !
Solved! Go to Solution.
06-26-2011 06:26 AM
PFA the other two sub VI's.
06-26-2011 06:27 AM
Here's the modified program which I tried using shifte registers. This progarm executes even more slowly.
06-26-2011 06:28 AM
These are the other two subVI's of the modified program
06-26-2011 09:34 AM
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
06-26-2011 10:46 AM
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! 🙂
06-26-2011 10:54 AM
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.
06-26-2011 10:42 PM
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
06-27-2011 08:16 AM
I do not have access to that VI until later in the day. I will try to post it tonight.
Lynn