LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple sampling rates with cDAQ-9172

I'm using a NI cDAQ-9172 with 2 NI 9211 modules and a NI 9215 module. I'm wanting to measure 8 thermocouples with the 9211s and 2 frequencies (voltage pulses) with the 9215. Ideally, it'd be nice if I could use the DAQ Assistant in LabVIEW to sample the thermocouples at around 1kS/s and the frequencies at 100kS/s/ch. If you have used DAQ Assistant, you know that once you specify a sampling rate, it applies for all channels, even though I'm using seperate hardware. I tried to set up two DAQ Assisitants, one to capture the thermocouples and one to capture the frequencies, but LabVIEW doesn't like it and spits a bunch of error codes at me, such as -50103, -225202, and -200279. Anyone have a suggestion for me? It is critical that I get this to work some way and it needs to be done last week. So any help is EXTREMELY appreciated.
0 Kudos
Message 1 of 9
(5,332 Views)

Hello Noidea,

I would suggest converting both DAQ Assistants into DAQmx code.  (Right-click on the DAQ Assistant >> Generate NI-DAQmx Code)  If they are both continuous, you might want to make sure that you setup the sampling rate and samples to read correctly.  The samples to read should be approximately 10% of the sampling rate. (e.g. Sampling Rate: 1kHz and Samples to Read: 100)  The samples to read will be your buffer size under continuous acquisition mode. 

You could also try to separate while loops for each task once you convert the DAQ Assistants into DAQmx Subvis.  The last error that you received (-200279) is telling me that you were overrunning your buffer.  (Help >> Explain Error)  I don’t think that you are reading from each DAQ Assistant fast enough.  One DAQ Assistant is should be acquiring data 100 faster than the other DAQ Assistant.  Therefore the slow DAQ Assistant is preventing the faster DAQ Assistant from overwriting its buffer.

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 2 of 9
(5,301 Views)
Hi Noidea,

In addition to what Robert said, the cDAQ-9172 only has one AI timing engine, so it can't run multiple AI tasks at the same time. This is why you get -50103 ("The specified resource is reserved..."). Modules with slow sample rates like the NI 9211 will repeat samples instead of limiting the overall sample rate. You can put all of your AI channels in one task, set the sample rate to 100 kS/s, and decimate or average the thermocouple data. For more information about how slow sample rate modules are handled, check out the "Analog Input" chapter of the NI cDAQ-9172 User Guide and Specifications.

Brad
---
Brad Keryan
NI R&D
Message 3 of 9
(5,295 Views)
So are you talking about using the "Time Averaging" Express VI for the thermocouples? Should have an express vi for each signal right before it is displayed or will it still work ok if I have my dynamic data come into just one time averaging express vi?
0 Kudos
Message 4 of 9
(5,279 Views)

Hello Noidea,

The cDAQ-9172 only has one hardware timing engine onboard for analog inputs.  This is the master clock that will tell the hardware when to actually acquire data.  You could create a clock pulse using a counter and use that signal for data acquisition.  (Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Generating Digital Pulses >> Gen Dig Pulse Train-Continuous.vi)  You can only access the counters on the cDAQ from slots 5 & 6. (Great KnowledgeBase)

You would need to synchronize by tasks.  (Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Synchronization >> Multi-Function >> Multi-Function AI-AO.vi)  This example demonstrates how to make one task a slave and the other a master.  Start the slave task first and have it trigger when the master task starts.  Once the master task starts, the slave task will start at the same time and both of the tasks will by hardware synchronized. 

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 5 of 9
(5,263 Views)
NoIdea,

When using the NI cDAQ-9172 you can only have 1 single timed AI task running at a time.   As a result you cannot use counters to run the 9211 at one rate and the 9215 at another.  The hardware simply does not support it.  However, you can still accomplish your application using the DAQ Assistant given you set it up correctly.  This is a more complex DAQ Assistant application since you have two channel types, but it can still be accomplished.  Follow the following steps:

  1. Place the DAQ Assistant on the Block Diagram
  2. Set up the task for only the thermocouple channels by:
    1. Click Acquire Signals
    2. Click Analog Input
    3. Click Temperature
    4. Click Thermocouple
    5. Select your Physical Channel (s) on the 9211
    6. Click Finish
  3. Set up channel parameters such as thermocouple type, CJC source, and Min and Max Temperatures
  4. Under Channel Settings click the + symbol and select Voltage
  5. Select the appropriate voltage channels on the 9215
  6. Set up 9215 channels by setting Max and Min
  7. Under Timing Setting set Acquisition Mode to Continuous Samples
  8. Set Samples to Read to 10k
  9. Set Rate(Hz) to 100k
  10.  Click OK
  11. Click Yes when asked if you would like to add a loop.
You will need to apply averaging techniques on the thermocouple channel to reduce the number of samples per second.  You can do this by placing a split signals Express VI on the block diagram and wiring the output of the DAQ Assistant to it.  Then wire the thermocouple signals to the Time Averaging Express VI.

Hopefully this is helpful in getting up and running with your application.  Please let me know if you need any more information or have any additional questions.

Regards,

Neil S.
Multifunction DAQ PSE
National Instruments
Message 6 of 9
(5,252 Views)

Neil,

What Time Averaging VI settings would you recommend?

Message 7 of 9
(5,237 Views)

Hello Noidea,

You want to average all 1k points from each thermocouple signal produced from the DAQ Assistant.  You have two choices for weighting the data, linear and exponential.  Each method has its advantages and disadvantages. 

Linear averaging mode will give each sample equal weight.  Exponential averaging mode will give the most recent sample more weight then older samples.  This way more emphasis is given on the most recent samples.

New Average = New Spectra * 1/N + Old Average * (N-1)/N

Where N is the number of averages for linear averaging, or is computed from the time constant for exponential averaging.

Exponential Average provides a continuous weighted averaging while Linear averaging will average a selected number of measurements and stop the analysis process.

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
Message 8 of 9
(5,173 Views)
hai all,
 If this problem was observed on a machine with Windows XP, service pack 1 (SP1) installed. The problem turned out to be the version of the Windows file usbehci.sys. On the problem machine, the version of usbehci.sys was 5.1.2600.1106 while the version on the good machine was 5.1.2600.1243. You can verify your version by following the steps below. To update your file, go to the Windows update website and download the most recent service pack. For more information, refer to the Microsoft KB: 822603, linked below. If you do not have access to the internet, please call in for further support.

  1. Navigate to usbehci.sys (usually in C:\WINDOWS\SYSTEM32\DRIVERS)
  2. Right-click on the file
  3. Select "Properties"
  4. Click on the "Version" tab

check this link also for downloads

 

http://support.microsoft.com/?kbid=822603

0 Kudos
Message 9 of 9
(5,157 Views)