NMX_Sampling_PrepareTime_1

<< Click to Display Table of Contents >>

Navigation:  NmxDLL Referenz > API (programming interface) > Sampling LowLevel (Time-Triggered Realtime Measurement) >

NMX_Sampling_PrepareTime_1

This function is used to prepare a time-based sampling. Before starting the sampling, it must be prepared.

See also the HowTo-Guide.

 

Definition


NMX_STATUS NMX_Sampling_PrepareTime_1(

 NMX_PHANDLE pHandle,

 unsigned long ulSamplePeriod,

 unsigned long ulDLLArrayLength,

 unsigned long long udMaxSamples);

 

Parameter


pHandle

Connection Handle.

ulSamplePeriod

Time period between two samples in µs, e.g. 1000 for 1ms.
See the chapter "Sampling Speed with Irinos" for more information.

ulDLLArrayLength

Data received from the device is internally buffered in the DLL. This parameter specifies the internal buffer length in samples.
Example: The sampling speed is 1ms -> 1000Samples/s and the buffer shall contain a maximum of 10 seconds. Then ulDLLArrayLength = 10000;

udMaxSamples

Maximum number of samples, which shall be recorded.
Use 0 for endless sampling.
Example: The sampling speed is 1ms -> 1000Samples/s. Data shall be recorded for a maximum of 15 seconds. Then udMaxSamples = 15000;

 

Typical function call (C example)


Time-limited: NMX_Sampling_PrepareTime_1(pHandle, 1000, 10000, 10000);

Endless: NMX_Sampling_PrepareTime_1(pHandle, 1000, 10000, 0);

 

.Net DLL specific implementation


NMX_MSTATUS Sampling_PrepareTime_1(

                 System::IntPtr pHandle,

                 System::UInt32 ulSamplePeriod,

                 System::UInt32 ulDLLArrayLength,

                 System::UInt64 udMaxSamples);

 

Comments


For short measurements of a few seconds, it is common practice using the same value for ulDLLArrayLength and for udMaxSamples.

The internal buffer is allocated in the heap memory of your application.

The larger the DLL-internal buffer is, the larger the memory consumption.
For typical time-limited sampling, this is not a problem and the memory size will be between a few kBytes up to a few MBytes. This applies even to larger systems.
However, if you would use for example 256 measurement channels of 32 Bit size, and ulDLLArrayLength would be 100000, then 100 MBytes would be required. This may be too large for your heap memory.