03-21-2016 06:11 AM
Hi guys. i'm having a very strange problem with my labview code and my DAQmx block. i set the sample rate to 1kiloHz then i write to a mesurement but if i let the acquisition running for 1 second i dont get 1000 samples in the txt file. what could be the reason??
03-21-2016 06:18 AM
Hi Cargio,
can you give us some more information and maybe attach your VI?
What is the number of samples in your file? Did you set the correct number of samples to be read?
03-21-2016 06:19 AM
03-21-2016 07:59 AM
Here is my VI. thank you in advance
03-21-2016 08:25 AM
03-21-2016 08:45 AM
It seems not working. now it only write 1 value because this way ( as i expected) in 1 seconds he acquires 1000 samples ( sample rate : 1000hz) than he makes the average of 1000 samples ( mean operation after the data file of N samples) obtaining a single number.
Could it be the writing operation being too slow? should i use the queue?
03-21-2016 08:58 AM
Sorry, I misread your question. Usually samples are the result of the acquisition, not the processed data.
Yes you should use a queue and you should use continuous acquisition mode. Only the DAQmx Read.vi and the Enqueue vi should be in the acquisition loop. Have a look at the Voltage-Continuous Input.vi from the LabVIEW exemples (Help - Find Examples... Hardware Input and Output - DAQmx - Analog Input)
Ben64
03-21-2016 09:17 AM
OK. it´s good with the writing but then how can i do with the meaning operation?
03-21-2016 09:55 AM - edited 03-21-2016 09:56 AM
As far as I can see your program behaves logically...
You acquire 1000 samples and calculate the mean value of them which gives you one value.
The question is: What do you want? 1000 samples or the mean value?
03-21-2016 10:05 AM
Do it in the consumer loop (when you dequeue the acquired data). All the processing and writing to file shoulb be in the consumer loop. I assume you are familiar with producer/consumer design pattern since you know about queues. If you're not have a look at the Producer/Consumer (data) desing pattern from the menu: File - new... VI - From Template - Frameworks - Design Patterns.
Ben64