# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## what is difference between finite samples and continues samples

In the case of finite samples, I tried to select one sample per channel, but an error message mentioned that the minimum number of samples per channel required is 2. However, when selecting continuous samples, it allows me to choose just one sample per channel. Is there any difference between these two cases, and will it affect the output data? I only need one sample per channel with finite samples.

I am using LabView 2022 and device NI-6255 Mass termination (multichannel analog input with retrigger)

Kind regards

Hasham

Message 1 of 3
(1,403 Views)
Solution
Accepted by Hasham622x

## Re: what is difference between finite samples and continues samples

When you acquire data using digital devices (and, in fact, most analog devices as well), you take a series of "snapshots" at regularly-timed intervals.  Consider watching a movie -- this consists of still photographs projected at, say, 30 Frames per Second, and relies on our "slow vision" to appear smooth and continuous.

Acquiring data via a computer works the same way.  You take a single "sample" of an analog or digital signal (or, for images, you get a 2D "sample" of brightness and color at various "pixels" arranged as a 2D array), and do this at a given "sampling rate".

Suppose you set your sampling rate at 1 kHz, 1000 samples/second.  If you take 1 sample, you'll have the value about 0.001 s (1 millisecond) later.  If you take 1000 samples, you won't have anything until all 1000 samples have been acquired (which takes about 1 second), then you'll have 1000 of them "all at once".

DAQmx devices can be set for "finite" or "continuous" sampling.  Consider the example in the preceding paragraph.  If I set "Finite Samples" and do a DAQmx Read, I'll get (one second later) 1000 points.  If I want more data, I have to "ask again" for another "sample" of 1000 points, which takes a bit of time, so the second 1000 points will have a probable "gap" in time from the first set.

This is where Continuous Sampling comes in.  The DAQ hardware has internal buffers.  If you set Continuous Sampling and start the acquisition, the subsequent DAQmx Read will read 1000 points, give them to you, and (without skipping any time) start on the next 1000 point acquisition, which will finish 1 second later.  During this one second, you can do a lot of things, such as displaying the points on a Chart, writing them to disk, etc.

When you do Finite Sampling, the sequence is as follows:  Set up DAQmx, Start DAQmx, Read (finite) DAQmx, Stop DAQmx, process data.  If you want more data, you have to repeat the whole thing all over again (and there will be "gaps").

With Continuous Sample, you Set up DAQmx, Start DAQmx, enter a While Loop, Read (continuous) DAQmx, do something with the Data that is quicker than the DAQmx Read time, and stay in the Loop until you write a "True" to the While Stop indicator, and when the Loop exits, Stop DAQmx.

I almost always want to do Continuous sampling, and suspect you should be using it, too.  The exception is "Is this switch Open or Closed?", which is a "one-time" question, "What is it now?".

Bob Schor

Message 2 of 3
(1,362 Views)

## Re: what is difference between finite samples and continues samples

Why is finite samples we have a minimum number of 2 samples per channel, although in continuous samples, we could select one sample per channel.

Message 3 of 3
(750 Views)