Stop sampling

<< Click to Display Table of Contents >>

Navigation:  NmxDLL Referenz > HowTo > Sampling >

Stop sampling

Stopping sampling is optional. It can be used to:

Stopp an endless sampling.

Stopp a time-limited sampling earlier than defined in the preparation step.
Example: Sampling has been prepared with a length of 10 seconds. After 6.5 seconds the measurement is finished. Sampling shall now be stopped.

 

Inside the NMX DLL / measurement system, the maximum number of samples is stored during the preparation phase (see NMX_Sampling_PrepareTime_1). This value can also be read-out via NMX_Sampling_GetStatus_1.

By stopping sampling, this value is adjusted to the new end of sampling.

Example: If sampling with 1000 samples/s has been prepared and started for a maximum duration of 10 seconds, the maximum number of samples is 10000. By calling the stop function after 6.5 seconds, this value is adjusted to 6500.

 

C / C++


// ###-> Stop sampling

if (NMX_Sampling_Stop_1(pHandle) == NST_SUCCESS) {

 // Successfully stopped

}

else {

 // Failed stopping sampling

 // Do some error handling.

}

 

Delphi


if cNmx.Sampling_Stop_1(pHandleNmx) = NST_SUCCESS then begin

 // Successfully stopped

end

else begin

 // Failed stopping sampling

 // Do some error handling.

end;

 

C# / .Net


if (cNmx.Sampling_Stop_1(pDevice) == NMX_MSTATUS.SUCCESS)

{

 // Successfully stopped

}

else

{

 // Failed stopping sampling

 // Do some error handling.

}