LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recording Data From Multiple DAQ Assistants (LabVIEW 2010)

In the attached VI, I have 3 DAQ assistants sampling sensors at differnet rates.  The first samples analog signals at 20 - 30 Hz.  The second samples thermocouple inputs at 1 Hz.  The final DAQ assitant samples load cells at 100Hz.  My goal is to temporarily store the sampled data in local variables.  Then, at a syncronous time, I'd like to write the most current samples to a data file.  For example, every 30 - 60 Hz I'd like to record the most recently sampled data. 

 

Please provide suggestions for how I can do this better.  The current VI doesn't allow me to change the recording frequency.  I'd like to understand how to better implement what I've described above.

 

Thanks.

0 Kudos
Message 1 of 7
(5,419 Views)

Hello,

 

Thanks for posting.  Let me make sure I understand your objective.  You are acquiring three different sets of data, each acquiring at their own rate.  You then want to write the most recent sample at a different, synchronous rate (30-60 Hz).

 

The way that your code is set up in your current VI has the Write to Measurement File function timed by software.  This means that it will write data whenever the software decides to run the loop.  To give a good possible solution, it would help to know a little bit about your application.  Why are you trying to set up your data logging this way?  Why does it need to be at that specific rate?  What hardware are you using?  Let us know, thanks!

 

Regards,

Joe S.

0 Kudos
Message 2 of 7
(5,394 Views)

This is my solution (without a look at your VI):

Put each DAQa in its own while-loop. Set the DAQa's to execute on single sample. Set the loops to execute with a timer. Use your local variables. Set a fourth while loop with the writing script. I am just unaware if you can do software timed DAQ at 100hz.

Good Luck.

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

Joe,

 

Yes, I'm acquiring different sets of data because I think it makes sense to sample different types of sensors at different rates.  For example, since I know that my temperature will change slowly, I will only sample at 1Hz.  However, my load cell data may change very quickly, so I'd like to sample at 100Hz to catch the updates. 

 

I want to record at ~60Hz because the system I'm monitoring rotates at approximately 30 revolutions per second.  I would like to be able to take a snapshot in time twice per revolution.  This way for graphing purposes, etc. I can easily watch whats happening and ensure that my resolution is such that i can see changes (if they occur) from revolution of the system to next revolution of the system. 

 

I have a CDAQ 9188.  I may also try to use another DAQ b/c I think I'm overloading the one I have.  When I log data from my sensors (without a digital frequency counter that I'm using to sense RPM) I can make records at 64Hz.  However, if I add the digital frequency counter back into my VI, then I can only make records at the rate that the counter is counting revolutions.  (If I use the RPM counter in a VI by itself, I can achieve records at 64 Hz again.)  So, I may explore using 2 physical DAQs.  I have a CRIO also (that I"m currently not using). 

 

It's possible that your suggestions to improve my VI will enable me to use the RPM data acquisition loop in the same VI.  This is preferred.

 

Let me know if you have any additional questions.  I appreciate your help!

 

-Kim

 

 
0 Kudos
Message 4 of 7
(5,381 Views)

Kim,

 

Thanks for posting.  If I understand your application correctly, you want to log the most recent data point from all three signals at a rate of 60 Hz.  This means that your log file will have 60 duplicates of your 1 Hz data point, three duplicates of your 20 Hz data point and you will be missing several points from your 100 Hz signal.  Is this the behavior that you are aiming for?

 

My recommendation would be to combine all three acquisitions into the same task, sample all three channels at 60 Hz and use DAQmx Configure Logging to record data into a file.  This is because using the Write to Measurement File VI will not give you much control over the exact time when data is recorded.  By acquiring data at 60 Hz, you can record all samples at log the data at that specific rate.  An example showing how to do this can be found here.  Hope this helps!

 

Regards,

Joe S. 

0 Kudos
Message 5 of 7
(5,352 Views)

Hi Joe.  Thanks for that example.  There is something I can't figure out, however.  I am using a 9402 module for digital frequency counting.  I can see this module in the 3rd slot of my C-9188 DAQ when looking in Measurement and Automation Explorer.  However, when I look at the front panel of the vi example you pointed me to, the Physical Channel pull down menu sees every other module except for the 9402.  (I'm also using:  9205 for Analog Voltage Inputs; 9213 for thermocouple inputs; 9234 for accelerometer inputs; and 9237 for load cell inputs.)  Do you know why this might be? 

 

The frequency counter is the sensor that's been giving me all my trouble.  I'm counting falling edges to get RPM.  I have a target that passes through an optical sensor.  It's 5V all the time and then goes down to 0V when the target passes through the sensor. 

 

Please provide any thoughts you have on this.  I was hoping to be able to select a channel from the 9402 module to use with the sample VI you provided.

 

Thanks for any help you can provide.

0 Kudos
Message 6 of 7
(5,334 Views)

Kim,

 

The task in the example I linked defaults to an analog input voltage task and would need to be adapted slightly in order to perform a frequency measurement.  This could be the cause of the behavior you are seeing.  If you change the task to a Counter Input » Frequency task, it should allow you to select your 9402 module.  Other changes to some of the DAQmx calls might be needed as well to perform a frequency measurement.  If you are not familiar with the DAQmx functions, a good tutorial to look at can be found here.

 

Regards,

Joe S.

0 Kudos
Message 7 of 7
(5,318 Views)