LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to take voltage measurements every minute

Solved!
Go to solution

Hi all,

 

I am currently new to labview and i am trying to take timed voltage measurements.  Here is what i am trying to do;

 

 I am using labview 2010 and I am trying to take temperature and humidity readings in sync with each other.  To measure the temperature i am using a cDaq and mudule 9213, for humiduty i am using the voltage from module 9234 and converting it using the ambient temperature and voltage from my humidity sensor.  

 

Now what i want to do is take voltage and temperature measurements say every minute or 30 seconds, but my buffer fills from the voltage readings and gives me an error or the table takes values from what im assuming is the buffer, one by one, instead of grabbing the current data from the module.  

 

My real question here is how do i take current voltage measurements every 30 seconds?

 

Thank you for any advice.



-Matt
0 Kudos
Message 1 of 15
(3,949 Views)

Show what you've done.  Which DAQmx functions did you use?

 

Use Read 1 sample 1 channel, and put it in a case structure triggered by the Elapsed Time express VI.

0 Kudos
Message 2 of 15
(3,940 Views)

Hii matt,

 

There could some circumstances which might slow down rate of your acquisition loop. It may include file writings and other things. To avoid buffer from getting full you should not perform time consuming operation in acquisition loop. On rest I am agree with Ravensfan. 

CLAD
Passionate for LabVIEW
0 Kudos
Message 3 of 15
(3,905 Views)

I attached a photo of what ive been messing around with.  The sample clock is set to finite samples, hw timed, and one sample per channel.  The read is set to one sample dbl as well.   You can see in the photo that the waveform chart is changing as i change the power supply, but that the table does not see the change.  I assume this is due to the buffer. 



-Matt
0 Kudos
Message 4 of 15
(3,845 Views)

Did you stop your VI when changing voltages?  It would make since if you did since the chart will retain its memory while the table's Express VI is reset with each run.


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 5 of 15
(3,832 Views)

I did not because as the humidity changes, the voltage from the humidity sensor will change and i want a real time update of this voltage.  I am trying to use the ni 9234 module, which is a designated accelerameter meter, but it does take the voltage readings in the range id like.  I will then take these voltage readings and convert them to humidity readings.  I guess possibly an easier solution to this problem is filtering the data before it goes to the table.  If it was possible to take the most recent data everytime the while loop runs, then put that into the data table with a time stamp, that would suit this test.  I simply do not have a need for so much data that is being generated when using the onboard clock.



-Matt
0 Kudos
Message 6 of 15
(3,823 Views)

Also, the table does update, but with the incorrect data.  It appears to me that it is taking data from the buffer in order that the measurements are taken.  I want the current data read when the while loop is ran.



-Matt
0 Kudos
Message 7 of 15
(3,819 Views)

Raven,

 

I placed the read 1 channel 1 sample inside a case structure with the elapsed time vi. triggering it every 5 seconds.  I still can not overcome the buffer issue.  I get an error that the buffer is full. The timing for this module can only be set by a master timebase and the lowest possible rate is still higher than what i need and i dont have the cabability to do 1 sample on demand or hw timed sampling.  Is this is an issue for what i am trying to do?



-Matt
0 Kudos
Message 8 of 15
(3,802 Views)

Your image doesn't look at all like what I was telling you to do.

 

The elapsed Time Express VI is supposed to drive a case structure.  Put the 1 channel 1 sample read inside of that case structure.

 

Get rid of the sample clock function, all you want to do is read one sample on demand.

 

If you still have problems, read N damples with a -1 wired into it so it reads all available samples, then just use a Delete From Array function so that you only get the last of the N samples you just acquired.

0 Kudos
Message 9 of 15
(3,794 Views)

Hello raven,

 

The vi i posted was my original vi i was working with.  I did put the read in a case structure and it performed just as the other vi does.  I dont have the capability to measure one sample on demand with this device, but i do believe your array function idea may work quite well.  Do you have an example of how to delete all but the most recent measurement from the array?



-Matt
0 Kudos
Message 10 of 15
(3,744 Views)