libtiepie-hw
1.1.6
|
Functions for controlling the measure mode. More...
Functions | |
TIEPIE_HW_API uint32_t | tiepie_hw_oscilloscope_get_measure_modes (tiepie_hw_handle handle) |
Get the supported measure modes for a specified oscilloscope. More... | |
TIEPIE_HW_API uint32_t | tiepie_hw_oscilloscope_get_measure_mode (tiepie_hw_handle handle) |
Get the current measure mode. More... | |
TIEPIE_HW_API uint32_t | tiepie_hw_oscilloscope_set_measure_mode (tiepie_hw_handle handle, uint32_t value) |
Set the measure mode. More... | |
Functions for controlling the measure mode.
Oscilloscopes measure in block mode or in streaming mode. This is determined by the measure mode.
When measuring in block mode (TIEPIE_HW_MM_BLOCK), the oscilloscope uses its internal memory to store the measured data. Once the pre defined number of samples is measured, measuring stops and the computer is notified that the measurement is ready. The computer can collect the data and can then start a new measurement. There will be gaps between consecutive measurements.
Advantage of block mode: Fast measurements using a high sample rate are possible. Disadvantage of block mode: Record length is limited by the instrument's memory size.
When measuring in streaming mode (TIEPIE_HW_MM_STREAM), the measured data is transferred continuously to the computer and collected in a buffer, while the instrument remains measuring. When a pre defined number of samples has been collected in the buffer, libtiepie-hw will notify the calling application that a new chunk of data is available to be collected. The calling application can then get that chunk of data and add it to previously collected data. This makes it possible to perform long continuous measurements without gaps.
Advantage of streaming mode: very long measurements are posible. Disadvantage of streaming mode: the maximum sample rate is limited by number of enabled channels, the selected resolution, the data transfer rate to computer and the computer speed.
The size of the chunks is set using tiepie_hw_oscilloscope_set_record_length(). The combination of chunk size and sample rate determines the duration of a chunk and also the rate at wich chunks are measured and need to be transferred. When the computer can not keep up with the chunk rate and chunks are measured faster than the computer can process them, the running measurement will be stopped and tiepie_hw_oscilloscope_is_data_overflow() will return TIEPIE_HW_BOOL_TRUE and event callback will be triggered.
By default the measure mode is set to: Block mode (TIEPIE_HW_MM_BLOCK).
TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_get_measure_modes | ( | tiepie_hw_handle | handle | ) |
Get the supported measure modes for a specified oscilloscope.
[in] | handle | A device handle identifying the oscilloscope. |
TIEPIE_HW_STATUS_INVALID_HANDLE | The handle is not a valid oscilloscope handle. |
TIEPIE_HW_STATUS_OBJECT_GONE | |
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED | |
TIEPIE_HW_STATUS_SUCCESS |
TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_get_measure_mode | ( | tiepie_hw_handle | handle | ) |
Get the current measure mode.
[in] | handle | A device handle identifying the oscilloscope. |
TIEPIE_HW_STATUS_INVALID_HANDLE | The handle is not a valid oscilloscope handle. |
TIEPIE_HW_STATUS_OBJECT_GONE | |
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED | |
TIEPIE_HW_STATUS_SUCCESS |
TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_set_measure_mode | ( | tiepie_hw_handle | handle, |
uint32_t | value | ||
) |
Set the measure mode.
[in] | handle | A device handle identifying the oscilloscope. |
[in] | value | The required measure mode, a TIEPIE_HW_MM_* value. |
TIEPIE_HW_STATUS_INVALID_VALUE | The requested measure mode is invalid. |
TIEPIE_HW_STATUS_INVALID_HANDLE | The handle is not a valid oscilloscope handle. |
TIEPIE_HW_STATUS_OBJECT_GONE | |
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED | |
TIEPIE_HW_STATUS_SUCCESS |