05-02-2014 08:23 PM
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.
Solved! Go to Solution.
05-02-2014 10:38 PM
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.
05-03-2014 06:01 AM
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.
05-05-2014 10:45 AM
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.
05-05-2014 11:07 AM
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.
05-05-2014 12:10 PM
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.
05-05-2014 12:12 PM
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.
05-05-2014 02:01 PM
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?
05-05-2014 02:27 PM
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.
05-07-2014 01:44 PM
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?