06-01-2012 04:39 AM
Hi everybody,
I use the myDAQ to measure speed, ampere, and voltage of a battery driven motor. (For Current measurement, i use a Sensor which outputs a 0-10 V signal). I placed all DAQ-Assitants in a while loop with a [Wait until next ms multiple] clock and set a value of 100 ms. I thougt, Labview will now write into my text file 10 times a second all values. In fact, as you can see in the attached text file, Labview only writes in a unsteady interval of 1-2 seconds a value, which is too less.
The question: Did I do anything wrong, how can you create VI that writes you lets say 10 values a second into text file? Or is simply the DigitalMultimeter input of the myDAQ not able to sample a rate of 10 Hz? I couldn´t find any information in the specification handbook about the sample rate of the DMM?
If anyone can help me would be great! Thanx a lot, Markus
06-01-2012 08:09 AM
Acquire your data. After acquisition has stopped. Write the data to a *.csv file that is easily imported into Excel.
06-01-2012 08:50 AM
Hi nyc,
thanx for your reply, i am afraid you missunderstood my problem or my english was too bad to explai it correctly:
Logging the data to excel works without problem if i select the path and "filename.xls"
I want to log 3 different Voltage signals with a sample rate of 10 Hz. But I am afraid the Digital Multimeter Input of the MyDAQ which is used also for reading a voltage signal is not able to measure this rate...
If I only measure "measured speed" and "measured current" which you can see in my above attached VI, LabView writes the correct number of 10 values a second into my "xls" (From AI0, AI1). Only if I add the DAQ assistant which reads the DigitalMultimeter Voltage, it slows my whole "while-loop" down...
Do you have any idea to solve this problem?...
06-01-2012 09:25 AM
Your VI doesn't work because it can't write the data fast enough.
Acquire the data. THEN write the data.
06-01-2012 09:52 AM
File I/O is not very efficient. I recommend that you do you file logging in a parallel task. Have one task do your data acquision. This task would then pass the data to be logged to the logging task via a queue. That way your file operations do not impact your data acquision. Also, express VIs are not very efficient. You would be better off accessing that directly using the DAQ VIs. The express VIs contain lots of steps that do not need to be done every time you call it such as initializing the device.
06-01-2012 09:55 AM
Ok i understand. So you think the reason why its so slow is not the DAQ (See http://www.ni.com/mydaq/specifications.htm, I couldn´t find any information about the maximum sampling rate of the integrated Digital Multimeter) but rather the software that it can´t write as fast..
In fact I have no idea how its possible in Labview to acquire data and write later because I just startet LabVIEW programming. Is there an example VI or help where I could learn that?
Thanx Again!
Markus
06-01-2012 09:59 AM
Look at the examples for queues, producer/consumer architecture, DAQ programming, parallel tasks just to name a few. LabvIEW ships with some very good examples. Also, take some time and work through the online tutorials.
06-01-2012 10:03 AM
Ok Mark thanx a lot, i will check that out next week....
06-01-2012 10:07 AM
No, that is not what was said.
Both your use of file output in the acquisition loop and the Express VIs for data acquisition are inefficient. You've already said that if you remove the dmm function, the loop speeds up considerably. Doesn't that answer your question as to the cause?
I'm not at all that familiar with MyDaq but have you tried using the second analog input channel to measure the voltage instead of the DMM. You can just add a new channel to the existing current DAQ Assistant.