LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving DAQ output at a lower sample rate

Solved!
Go to solution

Hi All

I am relatively new to labview and all its feature. The problem I have having is I don't know of a way to sample a continuous signal again. This is my problem, the LabView DAQ assistant continuously samples at 1 KHz so that the Voltage meter is smooth as the voltage changes. I don't want to have to save each 1000 data points each second though to the .csv, so I have been trying lots of different ways to 'resample' the data at a given rate of about 1-10hz.

So far I have tried to use the timer loop, I have no idea how this functions though and it didn't get me very far. I have also tried to put all the values into an array of a specified size (in relation to the sample hz), take index 0, delete it and start filling the array again. This kind of worked but not at all how I wanted.

Sorry I cant provide any pictures or a vi as I have changed it so many times it doesnt look anything like what I have tried previously.

 

Some assistance in this matter would be much appreciated,

 

Cheers

 

Microtechno

0 Kudos
Message 1 of 7
(3,456 Views)

Hi microtechno,

  I want more details on your problem like  the daq card you are using and about the mode (finite,continuos) you configured the daq assistant?And also before continuing on this have a look on these tutorials..www.ni.com/pdf/manuals/320997e.pdf

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 2 of 7
(3,448 Views)

Just post your VI then we can start a discussion. In order to get help you must put in some effort. And tell us what you have done so far. And why and how you struggle.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 7
(3,440 Views)

Hey guys

sorry for such a delay, I havent been at uni for the past two weeks and so havnet been able to get my VI. I dont have labview at home.

 

I have attached the block diagram below of the VI. Currently though there are is nothing connecting the 'write to measurment file' as I cannot get it to work properly.

 

The usb device that I am using is the NI USB-6009. This side of the VI works, well as I understand it. As currently when I change the input voltage between 0-5 on ports 1-2 on the 6009 the output graph changes. The sampling frequency of this is 1kHz, which provides a smooth output when anything changes.

 

What I dont want is 1000 samples being written per second to the output csv, as this project could be running for 5-10 minutes and after that long the file will become increadibly large and filled with a lot of repeated values. As the voltage wont change too much once set.

 

So what I would like to do is make it possible to only write values at about 5-10Hz, that way there is enough data and it wont make a massive file.

 

I hope that this helps you in understanding my problem.

 

Cheers

 

signalout.JPG

0 Kudos
Message 4 of 7
(3,369 Views)

Use the Elapsed Time function and wire it to the enable input of your write.

0 Kudos
Message 5 of 7
(3,359 Views)

I just tried using the elapsed time connected to the enable pin.

This works for the first write then stops with an error (with the write to mesurment file). The error could possibly be with the filename, as this is only passed once into the loop. Is there a way to 'buffer' this information.

 

Also using this I am still getting multiple results in my csv. I am getting 0 -> 0.09 10 results when I only want one.

 

Cheers

0 Kudos
Message 6 of 7
(3,350 Views)
Solution
Accepted by topic author microtechno

Use a shift register for the filenme.

 

You did not post your code so I have no idea how you have the DAQ Assistant configured. You would get a write of all the DAQ data each time the file write is called. If you only want a scalar from the DAQ Assistant, do something as basic as calculating the mean of the signal.

0 Kudos
Message 7 of 7
(3,348 Views)