Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling rate of pyrometer too low with NI-9207

Dear all,

I am a very new LabVIEW user and currently try to use NI-9207 in a cRIO-9054 to capture a signal coming out of a pyrometer with a current analog input. The pyrometer is supposed to deliver 2000 Samples/s at a maximum.

The VI is attached below (Figure 1). 

 

I found the sampling rate is not high enough for our purpose as 250S/s (4ms each) sampling is needed for us (Figure 2).

The card was set into high speed mode as shown below in figure 3.

 

Any help is appreciated.

 

Thank you.

0 Kudos
Message 1 of 11
(2,905 Views)

There are a couple things that you can check.

 

Firstly, on the timed loop, it looks like you're running it with a dt of 5 ms, this will give you 200 S/s, instead of the 250 S/s that you want.

 

Second, check what rate you're running your scan engine at. If it is longer than 4 ms, you won't get new data when you read the I/O variables.

 

Here is a screenshot of the configuration of the Scan Engine. You can get here by right clicking your controller and selecting Properties. Change the 10 ms to something like 3 or 4 ms. One note is that this will increase your CPU usage on the RIO, but if this is all you're doing, it shouldn't be a huge deal.

scanengine.png

C. Weeks
Product Support Engineer
NI
0 Kudos
Message 2 of 11
(2,826 Views)

Hi,

The first question I would ask myself is if I really need to read a pyrometer at 2kHz - even if the sensor is capable of outputting data at that speed.

Thermal processes are typically slow, but of course you may have an unusual very fast responding process or have a need for such high frequency data depending what the data will be used for. If not then you may be just be measuring noise.

Note the scan engine Connor refers to can't go any faster than 1msec anyway, so 2kHz isn't possible without some more  advanced LabVIEW.

Hope this helps,

Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 3 of 11
(2,816 Views)

Hi Connor,

thanks a lot for your reply.

The scan engine was already set to 1ms but the desired sampling rate of 250S/s still cannot be reached (see attached image).

 

temp-reading.png


I have the following questions:

1. Does it in your opinion make sense using the NI-9207 to read a pyrometer or are there other NI options available?

2. Do you think it is possible to achive a higher sampling rate just by code optimisation?

3. Does programming the FPGA directly may help?

0 Kudos
Message 4 of 11
(2,795 Views)

The NI 9207 is a card with built in filtering so your sample rate will be lower than you would get with an unfiltered module like the NI 9203 or NI 9205. If you have a filter that effectively eliminates all frequencies above, say, 500 Hz, then it makes no sense sample at a rate higher than that.  So if you want really high sample rates into the kHz consider another card. Also take into account whether the module is multiplexed or not. A multiplexed card like the NI 9205 has to split its total sampling rate between the number of channels you want to read. So a 200 kSamples/s AGGREGATE sampling module can read 10 channels at 20 kSamples/s  or 2 channel at 100 kSamples/s each for example. Therefore you might consider a simultaneously sampled module if this is important.

 

The seconds thing you have to contend with is the fact that you are using the SCAN ENGINE API to read data. You are going to be limited to 1 kHZ sample rate in this case -- that's about the fastest the scan engine can run.

 

If you want higher sampling rate from your card, you have to program on the cRIO's FPGA directly, with requires the LabVIEW FPGA module, the compile tools, etc.

 

You might consider a cDAQ chassis or even a simple USB DAQ. Why do you need to go so far as using a cRIO-9054 in the first place?  Are building a full fledged headless control system for something?  If not there are probably easier ways to go

 

 

 

0 Kudos
Message 5 of 11
(2,775 Views)

Let me guess, you're sampling two channels? The spec says the 9207 has a max sample rate of 500S/sec. So if you sample two channels that would give you 4ms to sample both.

http://www.ni.com/pdf/manuals/375206b_02.pdf

0 Kudos
Message 6 of 11
(2,770 Views)

Thanks a lot for further suggestions.

We will be satisfied if the sampling rate could been boosted to up to 500Sample/s, while 250S/s would still be suffucient. We don't need kHz input rates but curently the sampling rate is only roughly 40Samples/s.

If this issue is related to the pyrometer working with a too fast sampling rate, we could try and decrease the sampling on the pyrometer to 500Samples/s. Is there a way to adjust the input filtering of this particular card? I couldn't find anything related to this in the NI guides.

 

Yes, we have other sensors and switches but they are handled by other NI cards. In our case, the NI-9207 will only take care of one sensor (the pyrometer). So we think we are okay with a cRIO system in this case.

We fully noticed that the 500Samples/s is the maximum sampling rate for the NI 9207 and that it will be divided by the total analog inputs. 

0 Kudos
Message 7 of 11
(2,754 Views)

You could tinker around with the scan engine to squeeze out the last factor of 2. You'll want to try and shrink down the sample time as cweek12 suggested and synchronize the timed structure to the NI Scan Engine

 

You are correct though that if you wanted the maximum performance, you'll want to acquire directly to the FPGA and send the data over using a FIFO. Check out the example here:C:\Program Files (x86)\National Instruments\LabVIEW 20xx\examples\CompactRIO\Module Specific\NI 9207\NI 9207 Getting Started

0 Kudos
Message 8 of 11
(2,738 Views)

In our lab we are using the NI 9207 module with a CompactDAQ. We are using the 8 voltage channels, and the sampling rate is turning out to be 2.5 Samples/seconds per channel when I ask the DAQ Assistant to sample at 1kHz. Together, the sampling rate is around 20 samples/second. This is way below the expected 500 Samples/second. Is this problem caused by my asking the DAQ Assistant to sample at a higher rate? 

 

I'm posting this here because of the problem that the pyrometer measurement is only showing a sampling rate of 40 Samples/second, which is closer to my situation then people here who are saying that I should be getting 125 Samples/second. 

0 Kudos
Message 9 of 11
(2,551 Views)

First off, the pyrometer specifications are largely irrelevant.  That 2000 S/s is the rate at which the ADC / DAC in the pyrometer updates the value of its analog output current.  In this case, it is good that this is not the bottleneck, but any update rate of this current signal which is faster than your data acquisition sample rate is simply wasted.

 

Per the NI 9207 datasheet, this module supports an aggregate acquisition rate of 500 S/s, or 31.25 S/s per channel, since it is a sixteen channel module and all channels are multiplexed on the data bus (This is what aggregate means, as opposed to a simultaneous sampling rate specification which would apply to all channels at once).  The conversion time per channel in high-resolution mode is 52 ms, and in high speed mode is 2 ms.  Given that this is a 16 channel module, that corresponds to a scan period of 832 ms (1.202 Hz) in high resolution mode, or 32 ms (31.25 Hz) in high speed mode.  If you run the scan engine at a higher rate than this, the measurements from the NI 9207 will not update with new values on each iteration.

 

If you need 250 S/s per channel, you're going to need different hardware.

0 Kudos
Message 10 of 11
(2,474 Views)