Sampling

<< Click to Display Table of Contents >>

Navigation:  NmxDLL Reference Guide > HowTo >

Sampling

Using sampling, data is acquired in realtime (see also chapter "Static vs. Sampling"). There are two types of sampling:

Time-limited sampling, and

Endless sampling.

Both of them use the same buffering technique. The sampled data is first stored in the internal buffer(s) of the measurement system in realtime. For the data transfer to the PC, there are no realtime requirements.

Sampling_Dataflow

 

Time-limited sampling provides more opportunities in regard of the measurement speed and the amount of sampled data. Full speed is supported using all measurement channels.

As its name says, it does not run all the time. Instead, it is started before each measurement cycle. It then runs until the measurement cycle is finished. The typical duration is a few seconds.

 

Endless sampling provides more flexibility. After starting, the sampled data is available endlessly, similar to an endless data stream.

The maximum data rate depends on the amount of sampled data (= amount of measurement channels used). However, for many applications, it is fast enough. Consult the users manual of the measurement system for more information about the maximum sampling rate. Typically "1000 Samples/s per measurement channel" or more are possible with many measurement channels.

 

Regarding the integration into the measurement software, both sampling types are similar. The same function calls are used.

 

Fundamentals are:

Sampling does not care about measurement boxes. It does not matter whether a single or multiple boxes are used. All measurement channels and digital in-/outputs across the whole measurement system can be used.
The boxes are synchronized. The Master-Box collects all data from the Slave-Boxes, sorts it and sends it to the NMX DLL. There it is stored in a table. See the chapter "Reading sampled data" for more details.

At each sampling point, the values of all sampling elements are buffered/stored together with a sample counter.

As the first step, the sampling elements have to be defined. A sampling element can be a measurement channel, a digital input byte or a digital output byte.
It is possible to add all of them or only a selection.

The next step is preparing the sampling.
Here the sample rate (-> sample period) is defined. Further it is defined, whether it is a time-limited or an endless sampling.

Then the sampling can be started.

The data transfer to the PC begins immediately.

These steps are also shown in the following diagram:

Sampling_Procedure

As visible in the diagram, the sampling elements only need to be defined once, if it is started repeatedly.