LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does Labview measure dt when combining waveforms? Possible mistake in the NI examples

Solved!
Go to solution

In the example project NI 9227 Getting Started.lvproj, the example shows how to read a buffer of single point values from all 4 channels. For the host VI, the dt is calculated from parsing the string enumerator and multiplying by 1000 to get the samples per second. The text "2.00 kS/s (NI 9227)" should parse then to 2000 which gives us a dt of 1/2000 or 0.0005.

 

However the documentation shows that the enumerator is per channel, not all 4.

This leaves me with 2 questions:

  1. I want to know if the true maximum sample rate with all 4 channels active, would it be 2.5 kS/s? And the correct dt would be 0.0020 instead?
  2. In terms of absolute time, would each the 4 decimated arrays have to be shifted to be properly centered? See:
    1. 0.0005*(0.5)
    2. 0.0005*1 + 0.0005*0.5
    3. 0.0005*2 + 0.0005*0.5
    4. 0.0005*3 + 0.0005*0.5

 

The NI Example project can be found under "Hardware Input and Output \ CompactRIO \ Module Specific IO \ Analog Input \NI 9227 Getting Started.lvproj "

0 Kudos
Message 1 of 7
(484 Views)

The shipping example is correct.

 

When reading back from the FIFO, the host is always returning data in a multiple of 4.

ZYOng_0-1724114933728.png

 

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 7
(456 Views)

But that is exactly my point!

 

1. The FPGA reads the 4 channels, and then writes them to the FIFO Block in loop.

Screenshot 2024-08-20 141741.png

 

2. For the waveform, every dt value for AI0 should be 1/(2000*4) since it has to read the other 3 channels before can it get back to AI0!

 

 

0 Kudos
Message 3 of 7
(413 Views)
Solution
Accepted by topic author eli.barber

@eli.barber wrote:

But that is exactly my point!

 

2. For the waveform, every dt value for AI0 should be 1/(2000*4) since it has to read the other 3 channels before can it get back to AI0!


The channels are read simultaneously; each channel has its own ADC. Not sure I understand your question.

0 Kudos
Message 4 of 7
(404 Views)

Thank you,

 

What threw me off was that I also have and RTD card (NI-9217) and an AI card (NI-9209). All three cards use the same language in the documentation of giving the conversion time/sample rate Per channel. And both of these cards are sequential in timing (At least that is what I have tested them to be).

 

But like you said, the current card simultaneously. This does seem to be the case when running it.

0 Kudos
Message 5 of 7
(360 Views)

You can use LabVIEW to access most, if not all, of your device's properties if you are unsure in the future and don't want to hunt for a manual. See the snippet below for your case.

 

snip.png

0 Kudos
Message 6 of 7
(347 Views)

Hi eli,

 


@eli.barber wrote:

What threw me off was that I also have and RTD card (NI-9217) and an AI card (NI-9209). All three cards use the same language in the documentation of giving the conversion time/sample rate Per channel. And both of these cards are sequential in timing (At least that is what I have tested them to be).


  • The datasheet for NI9217 clearly lists conversion times for a single channel and for all channels, and so describing a MUXed ADC. The website lists "400S/s"…
  • The datasheet for NI9209 gives "conversion time per channel", describing a MUXed ADC. The website mentions "500S/s"…
  • The datasheet for NI9227 describes "four simultaneously sampled … channels". The website mentions "50kS/s per channel"…

So the documents provided by NI clearly describe the behaviour of your hardware!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(312 Views)