libtiepie-hw  1.2.0

Functions to control the input range of an oscilloscope channel. More...

Collaboration diagram for Range:

Functions

TIEPIE_HW_API tiepie_hw_bool tiepie_hw_oscilloscope_channel_get_auto_ranging (tiepie_hw_handle handle, uint16_t ch)
 Check whether auto ranging is enabled for a specified channel. More...
 
TIEPIE_HW_API tiepie_hw_bool tiepie_hw_oscilloscope_channel_set_auto_ranging (tiepie_hw_handle handle, uint16_t ch, tiepie_hw_bool value)
 Set auto ranging for a specified channel. More...
 
TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_channel_get_ranges (tiepie_hw_handle handle, uint16_t ch, double *list, uint32_t length)
 Get the supported input ranges for a specified channel, with the currently selected coupling. More...
 
TIEPIE_HW_API double tiepie_hw_oscilloscope_channel_get_range (tiepie_hw_handle handle, uint16_t ch)
 Get the currently selected input range for a specified channel. More...
 
TIEPIE_HW_API double tiepie_hw_oscilloscope_channel_set_range (tiepie_hw_handle handle, uint16_t ch, double range)
 Set the input range for a specified channel. More...
 

Detailed Description

Functions to control the input range of an oscilloscope channel.

An oscilloscope channel will have one or more different input ranges. The number of input ranges and which ranges are available depends on the selected input coupling. Use tiepie_hw_oscilloscope_channel_get_ranges() to determine how many and which ranges are available. Changing the input couping may change the selected input range.

An input channel supports auto ranging, where a suitable input range is selected based on the measured data of the last performed measurement with the channel. Manually setting a range will disable auto ranging.

When auto ranging of a channel is enabled and trigger level mode is set to TIEPIE_HW_TLM_ABSOLUTE, the input range will not auto range to a range that is smaller than the selected trigger level.

By default the highest available range is selected and auto ranging is enabled.

Function Documentation

◆ tiepie_hw_oscilloscope_channel_get_auto_ranging()

TIEPIE_HW_API tiepie_hw_bool tiepie_hw_oscilloscope_channel_get_auto_ranging ( tiepie_hw_handle  handle,
uint16_t  ch 
)

Check whether auto ranging is enabled for a specified channel.

Parameters
[in]handleA device handle identifying the oscilloscope.
[in]chThe channel number identifying the channel, 0 to tiepie_hw_oscilloscope_get_channel_count() - 1.
Returns
TIEPIE_HW_BOOL_TRUE if enabled, TIEPIE_HW_BOOL_FALSE if disabled.
Status values
TIEPIE_HW_STATUS_INVALID_CHANNEL
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
See also
tiepie_hw_oscilloscope_channel_set_auto_ranging
Since
1.0

◆ tiepie_hw_oscilloscope_channel_set_auto_ranging()

TIEPIE_HW_API tiepie_hw_bool tiepie_hw_oscilloscope_channel_set_auto_ranging ( tiepie_hw_handle  handle,
uint16_t  ch,
tiepie_hw_bool  value 
)

Set auto ranging for a specified channel.

Parameters
[in]handleA device handle identifying the oscilloscope.
[in]chThe channel number identifying the channel, 0 to tiepie_hw_oscilloscope_get_channel_count() - 1.
[in]valueTIEPIE_HW_BOOL_TRUE to enable or TIEPIE_HW_BOOL_FALSE to disable.
Returns
TIEPIE_HW_BOOL_TRUE if enabled, TIEPIE_HW_BOOL_FALSE if disabled.
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED With the current settings, auto ranging is not available.
TIEPIE_HW_STATUS_INVALID_CHANNEL
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
See also
tiepie_hw_oscilloscope_channel_get_auto_ranging
Since
1.0

◆ tiepie_hw_oscilloscope_channel_get_ranges()

TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_channel_get_ranges ( tiepie_hw_handle  handle,
uint16_t  ch,
double *  list,
uint32_t  length 
)

Get the supported input ranges for a specified channel, with the currently selected coupling.

Parameters
[in]handleA device handle identifying the oscilloscope.
[in]chThe channel number identifying the channel, 0 to tiepie_hw_oscilloscope_get_channel_count() - 1.
[out]listA pointer to an array for the input ranges.
[in]lengthThe number of elements in the array.
Returns
The total number of ranges.
Status values
TIEPIE_HW_STATUS_UNSUCCESSFUL
TIEPIE_HW_STATUS_INVALID_CHANNEL
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
Example
uint32_t Range_count = tiepie_hw_oscilloscope_channel_get_ranges(h_device, Ch, NULL, 0);
double* Ranges = malloc(sizeof(double) * Range_count);
Range_count = tiepie_hw_oscilloscope_channel_get_ranges(h_device, Ch, Ranges, Range_count);
printf("Scp_chGet_ranges (Ch%u):\n", Ch + 1);
for(i = 0 ; i < Range_count ; i++)
printf("- %f\n", Ranges[ i ]);
free(p_ranges);
TIEPIE_HW_API uint32_t tiepie_hw_oscilloscope_channel_get_ranges(tiepie_hw_handle handle, uint16_t ch, double *list, uint32_t length)
Get the supported input ranges for a specified channel, with the currently selected coupling.
See also
tiepie_hw_oscilloscope_channel_get_range
tiepie_hw_oscilloscope_channel_set_range
Since
1.0

◆ tiepie_hw_oscilloscope_channel_get_range()

TIEPIE_HW_API double tiepie_hw_oscilloscope_channel_get_range ( tiepie_hw_handle  handle,
uint16_t  ch 
)

Get the currently selected input range for a specified channel.

Parameters
[in]handleA device handle identifying the oscilloscope.
[in]chThe channel number identifying the channel, 0 to tiepie_hw_oscilloscope_get_channel_count() - 1.
Returns
The currently selected input range.
Status values
TIEPIE_HW_STATUS_INVALID_CHANNEL
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
See also
tiepie_hw_oscilloscope_channel_get_ranges
tiepie_hw_oscilloscope_channel_set_range
Since
1.0

◆ tiepie_hw_oscilloscope_channel_set_range()

TIEPIE_HW_API double tiepie_hw_oscilloscope_channel_set_range ( tiepie_hw_handle  handle,
uint16_t  ch,
double  range 
)

Set the input range for a specified channel.

When a non existing input range value is tried to be set, the closest available larger input range is selected.

Parameters
[in]handleA device handle identifying the oscilloscope.
[in]chThe channel number identifying the channel, 0 to tiepie_hw_oscilloscope_get_channel_count() - 1.
[in]rangeThe requested input range, or maximum absolute value that must fit within the range.
Returns
The actually selected input range.
Status values
TIEPIE_HW_STATUS_VALUE_CLIPPED The requested input range is larger than the largest available range and clipped to that range.
TIEPIE_HW_STATUS_VALUE_MODIFIED The requested input range is within the valid range but not available. The closest larger valid value is set.
TIEPIE_HW_STATUS_INVALID_VALUE The requested input range is invalid.
TIEPIE_HW_STATUS_INVALID_CHANNEL
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
Remarks
Setting the range will disable auto ranging if enabled.
Changing the input range may affect the trigger level(s) if the trigger level mode is TIEPIE_HW_TLM_ABSOLUTE.
Example
double Range = 10;
Range = tiepie_hw_oscilloscope_channel_set_range(h_device, Ch, Range);
printf("Scp_chSet_range = %f", Range);
TIEPIE_HW_API double tiepie_hw_oscilloscope_channel_set_range(tiepie_hw_handle handle, uint16_t ch, double range)
Set the input range for a specified channel.
See also
tiepie_hw_oscilloscope_channel_get_ranges
tiepie_hw_oscilloscope_channel_get_range
Since
1.0