LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reduce dynamic data to scalar conversion time

Hi!

 

I'm running an experiment that requires comparison of an input voltage signal against a constant in order to generate a digital output signal. For this purpose, I'm using the 'From DDT' operator (signal manipuation tab in the functions palette) to convert dynamic data to static data, which can hence be compared against the constant. The conversion process is taking too long (around 4-5 seconds) but my experiment itself has a very short time frame (less than a second). Any suggestions on how this can be speeded up?

 

I've attached a sample of my VI for reference.

 

Thanks!

0 Kudos
Message 1 of 9
(3,143 Views)

Sorry, I cannot look at the exrepss VI configuration, because I don't have DAQ installed. How is it configured?

How do you know that the "from ddt" conversion is the slow step?

How do you measure the loop time?

 

If performance is critical, use low level DAQ and avoid dynamic data completely.

Your formula could be replaced by a simple comparison followed by "boolean to 0,1".

0 Kudos
Message 2 of 9
(3,127 Views)

The express VI is configured to acquire 100k samples at 1M values/sec data rate. 

I ran the data acquisition, 'from ddt' conversion and digital signal generation modules of the code independently and found that the 'from ddt' conversion was the slowest step. I tried the above procedure for reduced data sample sizes as well and found no major difference in the time taken for conversion.

 

I agree, the formula could be replaced by a boolean but I cannot avoid dynamic data altogether as my input signals are received from transducers.  Any suggestions?

0 Kudos
Message 3 of 9
(3,120 Views)

Use low level function so you get the data as a 1D array of doubles (or singles for better performance) and skip the From DDT step.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 9
(3,110 Views)

@keerthi_b wrote:

The express VI is configured to acquire 100k samples at 1M values/sec data rate. 

I ran the data acquisition, 'from ddt' conversion and digital signal generation modules of the code independently and found that the 'from ddt' conversion was the slowest step.


I would have expected the file IO to be the slowest step, but you don't even mention it....

0 Kudos
Message 5 of 9
(3,093 Views)

I did not mention it as time delay in file I/O is not extremely important for my experiment whereas dynamic data conversion was imperative.

0 Kudos
Message 6 of 9
(3,075 Views)

Why wouldn't the time of the file I/O not be important?

 

The iteration time of the entire loop is going to be whatever takes the longest in the loop.

0 Kudos
Message 7 of 9
(3,055 Views)

@keerthi_b wrote:

I did not mention it as time delay in file I/O is not extremely important for my experiment whereas dynamic data conversion was imperative.


If you are worrying about that small amount of time of converting from the DDT, then you care about how long it takes to write the file.  Since everything is in a single loop, the slowest thing determines your loop rate.

 

But if you really want to get rid of the DDT (which you really should anyways), then learn the DAQmx API and the File IO functions.  The Exxpress VIs tend to have extra overhead anyways that you can easily program out.  I would also redo your Formula Node using the camparison functions and Select.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 9
(3,018 Views)

To demonstrate that altenbach, Dennis, and crossrulz know what they are talking about, I put some diagram disable structures in your VI. I moved the DAQ Read outside the loop and replaced it with a simulated signal. I disabled the DAQ Write inside the case structure because I do not have DAQmx.

 

Write to file takes about 0.8 seconds. With that disabled the loop executes in less than 1 millisecond in all other options.  The Split Signal and From DDT take about 200 microseconds longer than the other options (see what Yameada recommended). The Formula node is probably slightly slower than the simple comparison but this test has too much other variation to reveal it.

 

To get good timing comparisons there are many other things which need to be done like disabling debugging. Search for the many posts on the subject, especially those by altenbach if you want to do really meaningful timing comparisons.

 

The DAQ Read and the File Write by far dominate the timing in your VI.  DDT is somewhat slower than other methods of getting the data but the time it takes is insignificant compared to the File Write time. Since the File Write and the data conversion occur in parallel, the conversion time does not really matter.

 

Lynn

Message 9 of 9
(3,006 Views)