LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert dynamic data array to double

Dear all,

 

I am going to use a USB-6008 DAQ to measure voltage and temperature over a long period of time. (say 1-2 hours) 

 

I've been building a VI but I've encountered a problem. In my VI i use a simulated signal for testing purposes. (signaltoarray.vi is the latest)

 

The problem is that the output of the simulated signal is a 1-D array of dynamic data. It has to be 1-D array of doubles. How can I manage this conversion?

 

The goal of this VI is to take some measurements every second, put it in a array, then repeat this and put it in the second column, etc...  In the end I want to take the avarage of each column (because I have noise on my signal). I want to use these avarage values to create a graph so I can see the voltage and temperature change over time. (But I didn't add this yet)

 

I have found a thread with a similar problem, but using that solution I ended up with a 3D array!

 

Thanks in advance for your time.

Download All
0 Kudos
Message 1 of 5
(17,936 Views)

1: Sorry for double posting

2: I threw away the simulated part and inserted the things I needed to get real readings, so the original problem is gone. (DAQ express VI = misery? )

3: I'm sorry for my English: it's average, not avarage

4: I attached my current VI. It still doesnt give me the avarage of the colums, but it's a start

 

Could anyone point me what I am doing wrong? (I suppose I am)

0 Kudos
Message 2 of 5
(17,931 Views)
Here you go.
Message 3 of 5
(17,916 Views)

I'm pretty sure you don't need the loop with STOP2. 

The DAQmx VI will take 1000 points, no need to be in a secondary loop.

 

 

Do you need to save all the data ? or just the mean of each acquisition?

A simple technique is shown below. You could add data saving as required.

 

mean.JPG

 

 

 

 

0 Kudos
Message 4 of 5
(17,915 Views)

Hello,

 

I have some question about the goal of the code you wrote:

 

A) In the "simulated" VI you confugured the simulate signal express VI to take every second 5 samples at 100Hz. Is this what you really want?

5 samples in the first 50 ms and the nothing?

 

B) In the "real" VI you use a task that is not configured in the VI. Is it defined somewhere else? If it is then how is it configured? (with regards to sample rate, continous/finite (N) sampling,... )

As jeff said, the second stop loop (with stop 2) around the DAQmx read function should be removed.

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 5 of 5
(17,875 Views)