LibTiePie  0.9.16
Library for interfacing TiePie engineering instruments
Pulse width

Description

Functions for controlling the pulse width of a generator.

The pulse width defines the width of the pulse when signal type is set to ST_PULSE, without affecting the signal frequency.

PulseDefinition.png

The pulse width is defined as the time between 50% of the leading edge of the pulse and 50% of the trailing edge of the pulse, in seconds. See also pulse edge times.

The pulse width of a generator can be set between a minimum and a maximum value. Use GenGetWidthMin() and GenGetWidthMax() to get the pulse width limits.

The pulse width can be affected by changing the signal frequency.

The pulse width is not available on all instruments and only available for signal type Pulse. Use GenHasWidth() to check whether pulse width is available for your instrument and the currently set signal type.

By default the pulse width is set to: 1 us.

Functions

bool8_t GenHasWidth (LibTiePieHandle_t hDevice)
 Check whether the current signal type of a specified generator supports controlling the signal pulse width. More...
 
double GenGetWidthMin (LibTiePieHandle_t hDevice)
 Get the minimum pulse width with the current signal frequency, of a specified generator. More...
 
double GenGetWidthMax (LibTiePieHandle_t hDevice)
 Get the maximum pulse width with the current signal frequency, of a specified generator. More...
 
double GenGetWidth (LibTiePieHandle_t hDevice)
 Get the current pulse width, of a specified generator. More...
 
double GenSetWidth (LibTiePieHandle_t hDevice, double dWidth)
 Set the pulse width, of a specified generator. More...
 

Function Documentation

bool8_t GenHasWidth ( LibTiePieHandle_t  hDevice)

Check whether the current signal type of a specified generator supports controlling the signal pulse width.

Parameters
[in]hDeviceA device handle identifying the generator.
Returns
BOOL8_TRUE if supported, BOOL8_FALSE if not.
Status values
INVALID_HANDLE The handle is not a valid generator handle.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
GenGetWidthMin
GenGetWidthMax
GenGetWidth
GenSetWidth
Since
0.6
double GenGetWidthMin ( LibTiePieHandle_t  hDevice)

Get the minimum pulse width with the current signal frequency, of a specified generator.

Parameters
[in]hDeviceA device handle identifying the generator.
Returns
The minimum pulse width in seconds.
Status values
NOT_SUPPORTED The generator does not support pulse width for the current signal type.
INVALID_HANDLE The handle is not a valid generator handle.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
GenGetWidthMax
GenGetWidth
GenSetWidth
Since
0.5
double GenGetWidthMax ( LibTiePieHandle_t  hDevice)

Get the maximum pulse width with the current signal frequency, of a specified generator.

Parameters
[in]hDeviceA device handle identifying the generator.
Returns
The maximum pulse width in seconds.
Status values
NOT_SUPPORTED The generator does not support pulse width for the current signal type.
INVALID_HANDLE The handle is not a valid generator handle.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
GenGetWidthMin
GenGetWidth
GenSetWidth
Since
0.5
double GenGetWidth ( LibTiePieHandle_t  hDevice)

Get the current pulse width, of a specified generator.

Parameters
[in]hDeviceA device handle identifying the generator.
Returns
The currently set pulse width in seconds.
Status values
NOT_SUPPORTED The generator does not support pulse width for the current signal type.
INVALID_HANDLE The handle is not a valid generator handle.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
GenGetWidthMin
GenGetWidthMax
GenSetWidth
Since
0.5
double GenSetWidth ( LibTiePieHandle_t  hDevice,
double  dWidth 
)

Set the pulse width, of a specified generator.

Parameters
[in]hDeviceA device handle identifying the generator.
[in]dWidthThe requested pulse width in seconds.
Returns
The actually set pulse width in seconds
Remarks
When the generator is active, changing the pulse width will shortly interrupt the output signal.
Changing the pulse width may affect the leading and trailing edge time value(s).
Status values
VALUE_CLIPPED The requested pulse width is outside the valid range and clipped to the closest limit.
VALUE_MODIFIED The requested pulse width is within the valid range but not available. The closest valid value is set.
NOT_SUPPORTED The generator does not support pulse width for the current signal type.
NOT_CONTROLLABLE The generator is currently not controllable, see GenIsControllable.
INVALID_HANDLE The handle is not a valid generator handle.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
GenGetWidthMin
GenGetWidthMax
GenGetWidth
Since
0.5