Functions to collect the measured data.
More...
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_data (tiepie_hw_handle handle, float **buffers, uint16_t channel_count, uint64_t start_index, uint64_t sample_count) |
| Get the measurement data for specified channels. More...
|
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_data_1ch (tiepie_hw_handle handle, float *buffer_ch1, uint64_t start_index, uint64_t sample_count) |
| Get the measurement data for the first channel. More...
|
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_data_2ch (tiepie_hw_handle handle, float *buffer_ch1, float *buffer_ch2, uint64_t start_index, uint64_t sample_count) |
| Get the measurement data for the first two channels. More...
|
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_data_3ch (tiepie_hw_handle handle, float *buffer_ch1, float *buffer_ch2, float *buffer_ch3, uint64_t start_index, uint64_t sample_count) |
| Get the measurement data for the first three channels. More...
|
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_data_4ch (tiepie_hw_handle handle, float *buffer_ch1, float *buffer_ch2, float *buffer_ch3, float *buffer_ch4, uint64_t start_index, uint64_t sample_count) |
| Get the measurement data for the first four channels. More...
|
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_data_5ch (tiepie_hw_handle handle, float *buffer_ch1, float *buffer_ch2, float *buffer_ch3, float *buffer_ch4, float *buffer_ch5, uint64_t start_index, uint64_t sample_count) |
| Get the measurement data for the first five channels. More...
|
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_data_6ch (tiepie_hw_handle handle, float *buffer_ch1, float *buffer_ch2, float *buffer_ch3, float *buffer_ch4, float *buffer_ch5, float *buffer_ch6, uint64_t start_index, uint64_t sample_count) |
| Get the measurement data for the first six channels. More...
|
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_data_7ch (tiepie_hw_handle handle, float *buffer_ch1, float *buffer_ch2, float *buffer_ch3, float *buffer_ch4, float *buffer_ch5, float *buffer_ch6, float *buffer_ch7, uint64_t start_index, uint64_t sample_count) |
| Get the measurement data for the first seven channels. More...
|
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_data_8ch (tiepie_hw_handle handle, float *buffer_ch1, float *buffer_ch2, float *buffer_ch3, float *buffer_ch4, float *buffer_ch5, float *buffer_ch6, float *buffer_ch7, float *buffer_ch8, uint64_t start_index, uint64_t sample_count) |
| Get the measurement data for the first eight channels. More...
|
|
TIEPIE_HW_API uint64_t | tiepie_hw_oscilloscope_get_valid_pre_sample_count (tiepie_hw_handle handle) |
| Get the number of valid pre samples in the measurement. More...
|
|
TIEPIE_HW_API void | tiepie_hw_oscilloscope_channel_get_data_value_range (tiepie_hw_handle handle, uint16_t ch, double *min, double *max) |
| Get the minimum and maximum values of the input range the current data was measured with. More...
|
|
TIEPIE_HW_API double | tiepie_hw_oscilloscope_channel_get_data_value_min (tiepie_hw_handle handle, uint16_t ch) |
| Get the minimum value of the input range the current data was measured with. More...
|
|
TIEPIE_HW_API double | tiepie_hw_oscilloscope_channel_get_data_value_max (tiepie_hw_handle handle, uint16_t ch) |
| Get the maximum value of the input range the current data was measured with. More...
|
|
Functions to collect the measured data.
When a measurement is performed, the data is stored inside the instrument. When no pre samples are selected (pre sample ratio = 0), the trigger point is located at the start of the record and all samples are measured post samples.
When pre samples are selected (pre sample ratio > 0), the trigger point is located at position (pre sample ratio * record length), dividing the record in pre samples and post samples.
When after starting the measurement a trigger occurs before all pre samples are measured, not all pre samples will be valid. Invalid pre samples are set to zero. Use tiepie_hw_oscilloscope_get_valid_pre_sample_count to determine the amount of valid pre samples. See Presamples valid to force all pre samples to be measured.
When retrieving the measured data, the full record can be get, including the invalid presamples. The start index needs to be set to 0
then. It is also possible to get only the valid samples. In that case, the start index needs to be set to (record length - (number of post samples + number of valid pre samples)
.
Example:
uint64_t Samples_read = tiepie_hw_oscilloscope_get_data1Ch(h_scp, Data_ch1, Start, Valid_samples);
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_valid_pre_sample_count(tiepie_hw_handle handle)
Get the number of valid pre samples in the measurement.
TIEPIE_HW_API double tiepie_hw_oscilloscope_get_pre_sample_ratio(tiepie_hw_handle handle)
Get the current pre sample ratio of a specified oscilloscope.
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_record_length(tiepie_hw_handle handle)
Get the currently selected record length of a specified oscilloscope.
The data retrieval functions use buffers to store the measured data in. The caller must assure that enough memory is allocated for the buffer, to contain all data.
Several routines are available to get the measured data, one universal applicable routine and a number of dedicated routines, to collect data from specific channels.
The data is returned directly in Volt, Ampere or Ohm, depending on the input coupling.
Additionally, routines are available to retrieve range information of the measured data. Once a measurement is ready, the input range of a channel can be changed, e.g. by the auto ranging function or by the user. The input range will then no longer match with the range of the measured data. Use these routines to determine the actual range of the measured data.
◆ tiepie_hw_oscilloscope_get_data()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data |
( |
tiepie_hw_handle |
handle, |
|
|
float ** |
buffers, |
|
|
uint16_t |
channel_count, |
|
|
uint64_t |
start_index, |
|
|
uint64_t |
sample_count |
|
) |
| |
Get the measurement data for specified channels.
This routine is used to retrieve measured data from specific channels. It uses an array of pointers to data buffers to indicate from which channels the data must be retrieved. NULL
pointers can be used to indicate that no data needs to be retrieved for a specific channel.
To retrieve data from channels 1 and 2 of the oscilloscope, create a pointer array with two pointers: { Data_ch1, Data_ch2 }
and set Channel_count to 2
.
To retrieve data from channels 2 and 4 of the oscilloscope, create a pointer array with four pointers: { NULL, Data_ch2, NULL, Data_ch4 }
and set Channel_count to 4
.
The buffers contain data directly in Volt, Ampere or Ohm, depending on the input coupling.
- Parameters
-
[in] | handle | A device handle identifying the oscilloscope. |
[out] | buffers | A pointer to a buffer with pointers to buffers for channel data, the pointer buffer may contain NULL pointers. |
[in] | channel_count | The number of pointers in the pointer buffer. |
[in] | start_index | The position in the record to start reading. |
[in] | sample_count | The number of samples to read. |
- Returns
- The number of samples actually read.
- Status values
-
- See also
- Pointer array for programming languages that don't support pointers to pointers, e.g. Matlab or Python.
-
tiepie_hw_oscilloscope_get_data1Ch, tiepie_hw_oscilloscope_get_data2Ch, tiepie_hw_oscilloscope_get_data3Ch, tiepie_hw_oscilloscope_get_data4Ch
- Example
float** pp_channel_data = malloc(sizeof(float*) * Channel_count);
for(w_ch = 0 ; Ch < Channel_count ; Ch++)
if(Scp_chGet_enabled(h_scp, Ch))
pp_channel_data[ Ch ] = malloc(sizeof(float) * Valid_samples);
else
pp_channel_data[ Ch ] = NULL;
for(w_ch = 0 ; Ch < Channel_count ; Ch++)
free(pp_channel_data[ Ch ]);
free(pp_channel_data);
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data(tiepie_hw_handle handle, float **buffers, uint16_t channel_count, uint64_t start_index, uint64_t sample_count)
Get the measurement data for specified channels.
- Since
- 1.0
◆ tiepie_hw_oscilloscope_get_data_1ch()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data_1ch |
( |
tiepie_hw_handle |
handle, |
|
|
float * |
buffer_ch1, |
|
|
uint64_t |
start_index, |
|
|
uint64_t |
sample_count |
|
) |
| |
◆ tiepie_hw_oscilloscope_get_data_2ch()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data_2ch |
( |
tiepie_hw_handle |
handle, |
|
|
float * |
buffer_ch1, |
|
|
float * |
buffer_ch2, |
|
|
uint64_t |
start_index, |
|
|
uint64_t |
sample_count |
|
) |
| |
◆ tiepie_hw_oscilloscope_get_data_3ch()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data_3ch |
( |
tiepie_hw_handle |
handle, |
|
|
float * |
buffer_ch1, |
|
|
float * |
buffer_ch2, |
|
|
float * |
buffer_ch3, |
|
|
uint64_t |
start_index, |
|
|
uint64_t |
sample_count |
|
) |
| |
◆ tiepie_hw_oscilloscope_get_data_4ch()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data_4ch |
( |
tiepie_hw_handle |
handle, |
|
|
float * |
buffer_ch1, |
|
|
float * |
buffer_ch2, |
|
|
float * |
buffer_ch3, |
|
|
float * |
buffer_ch4, |
|
|
uint64_t |
start_index, |
|
|
uint64_t |
sample_count |
|
) |
| |
◆ tiepie_hw_oscilloscope_get_data_5ch()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data_5ch |
( |
tiepie_hw_handle |
handle, |
|
|
float * |
buffer_ch1, |
|
|
float * |
buffer_ch2, |
|
|
float * |
buffer_ch3, |
|
|
float * |
buffer_ch4, |
|
|
float * |
buffer_ch5, |
|
|
uint64_t |
start_index, |
|
|
uint64_t |
sample_count |
|
) |
| |
◆ tiepie_hw_oscilloscope_get_data_6ch()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data_6ch |
( |
tiepie_hw_handle |
handle, |
|
|
float * |
buffer_ch1, |
|
|
float * |
buffer_ch2, |
|
|
float * |
buffer_ch3, |
|
|
float * |
buffer_ch4, |
|
|
float * |
buffer_ch5, |
|
|
float * |
buffer_ch6, |
|
|
uint64_t |
start_index, |
|
|
uint64_t |
sample_count |
|
) |
| |
◆ tiepie_hw_oscilloscope_get_data_7ch()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data_7ch |
( |
tiepie_hw_handle |
handle, |
|
|
float * |
buffer_ch1, |
|
|
float * |
buffer_ch2, |
|
|
float * |
buffer_ch3, |
|
|
float * |
buffer_ch4, |
|
|
float * |
buffer_ch5, |
|
|
float * |
buffer_ch6, |
|
|
float * |
buffer_ch7, |
|
|
uint64_t |
start_index, |
|
|
uint64_t |
sample_count |
|
) |
| |
◆ tiepie_hw_oscilloscope_get_data_8ch()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_data_8ch |
( |
tiepie_hw_handle |
handle, |
|
|
float * |
buffer_ch1, |
|
|
float * |
buffer_ch2, |
|
|
float * |
buffer_ch3, |
|
|
float * |
buffer_ch4, |
|
|
float * |
buffer_ch5, |
|
|
float * |
buffer_ch6, |
|
|
float * |
buffer_ch7, |
|
|
float * |
buffer_ch8, |
|
|
uint64_t |
start_index, |
|
|
uint64_t |
sample_count |
|
) |
| |
◆ tiepie_hw_oscilloscope_get_valid_pre_sample_count()
TIEPIE_HW_API uint64_t tiepie_hw_oscilloscope_get_valid_pre_sample_count |
( |
tiepie_hw_handle |
handle | ) |
|
Get the number of valid pre samples in the measurement.
When pre samples are selected (pre sample ratio > 0), the trigger point is located at position (pre sample ratio * record length), dividing the record in pre samples and post samples.
When after starting the measurement a trigger occurs before all presamples are measured, not all pre samples will be valid.
- Parameters
-
- Returns
- The number of valid pre samples.
- Status values
-
- Since
- 1.0
◆ tiepie_hw_oscilloscope_channel_get_data_value_range()
TIEPIE_HW_API void tiepie_hw_oscilloscope_channel_get_data_value_range |
( |
tiepie_hw_handle |
handle, |
|
|
uint16_t |
ch, |
|
|
double * |
min, |
|
|
double * |
max |
|
) |
| |
◆ tiepie_hw_oscilloscope_channel_get_data_value_min()
TIEPIE_HW_API double tiepie_hw_oscilloscope_channel_get_data_value_min |
( |
tiepie_hw_handle |
handle, |
|
|
uint16_t |
ch |
|
) |
| |
◆ tiepie_hw_oscilloscope_channel_get_data_value_max()
TIEPIE_HW_API double tiepie_hw_oscilloscope_channel_get_data_value_max |
( |
tiepie_hw_handle |
handle, |
|
|
uint16_t |
ch |
|
) |
| |