xPCI-1710 API
xPCI-1710 PWM functions

Functions

_INT_ i_PCI1710_InitPWM (HANDLE h_DeviceHandle, BYTE b_ModulNbr, BYTE b_PWM, BYTE b_TimingUnit, ULONG ul_LowTiming, ULONG ul_HighTiming, PULONG pul_RealLowTiming, PULONG pul_RealHighTiming)
 
_INT_ i_PCI1710_SetNewPWMTiming (HANDLE h_DeviceHandle, BYTE b_ModulNbr, BYTE b_PWM, BYTE b_TimingUnit, ULONG ul_LowTiming, ULONG ul_HighTiming)
 
_INT_ i_PCI1710_EnablePWM (HANDLE h_DeviceHandle, BYTE b_ModulNbr, BYTE b_PWM, BYTE b_StartLevel, BYTE b_StopMode, BYTE b_StopLevel, BYTE b_ExternGate, BYTE b_InterruptEnable)
 
_INT_ i_PCI1710_DisablePWM (HANDLE h_DeviceHandle, BYTE b_ModulNbr, BYTE b_PWM)
 
_INT_ i_PCI1710_GetPWMInitialisation (HANDLE h_DeviceHandle, BYTE b_ModulNbr, BYTE b_PWM, PBYTE pb_TimingUnit, PULONG pul_LowTiming, PULONG pul_HighTiming, PBYTE pb_StartLevel, PBYTE pb_StopMode, PBYTE pb_StopLevel, PBYTE pb_ExternGate, PBYTE pb_InterruptEnable, PBYTE pb_Enable)
 
_INT_ i_PCI1710_GetPWMStatus (HANDLE h_DeviceHandle, BYTE b_ModulNbr, BYTE b_PWM, PBYTE pb_PWMOutputStatus, PBYTE pb_ExternGateStatus)
 
_INT_ i_PCI1710_ReadPWM1DigitalInput (HANDLE h_DeviceHandle, BYTE b_ModulNbr, BYTE b_InputChannel, PBYTE pb_ChannelStatus)
 
_INT_ i_PCI1710_ReadPWMAllDigitalInputs (HANDLE h_DeviceHandle, BYTE b_ModulNbr, PBYTE pb_InputStatus)
 
_INT_ i_PCI1710_EnableDisablePWMDigitalOutputManualSetting (HANDLE h_DeviceHandle, BYTE b_ModulNbr, BYTE b_Flag)
 
_INT_ i_PCI1710_SetPWMDigitalOutputOn (HANDLE h_DeviceHandle, BYTE b_ModulNbr)
 
_INT_ i_PCI1710_SetPWMDigitalOutputOff (HANDLE h_DeviceHandle, BYTE b_ModulNbr)
 

Detailed Description

Function Documentation

_INT_ i_PCI1710_InitPWM ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr,
BYTE  b_PWM,
BYTE  b_TimingUnit,
ULONG  ul_LowTiming,
ULONG  ul_HighTiming,
PULONG  pul_RealLowTiming,
PULONG  pul_RealHighTiming 
)

Initializes the PWM.
This function configures the selected PWM from the selected module. The ul_LowTiming, ul_HighTiming and b_TimingUnit determine the low/high base timing for the persiod. The pul_RealLowTiming and pul_RealHighTiming return the real timing value. You must call this function before calling any other PWM function.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrIndex of the module to configure (0 to 3)
[in]b_PWMIndex of the selected PWM (0 or 1)
[in]b_TimingUnitTiming unit (0: ns, 1: us, 2: ms, 3: sec or 4: min)
[in]ul_LowTimingLow base timing value
[in]ul_HighTimingHigh base timing value
[out]pul_RealLowTimingReal low base timing value
[out]pul_RealHighTimingReal high base timing value
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3The PWM selection is wrong
-4The base timing value is wrong
-5The low base timing selection is wrong
-6The high base timing selection is wrong
-7Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - Invalid PWM index
-103Driver - Invalid timing unit
-104Driver - Invalid low timing
-105Driver - Invalid high timing
-106Driver - The module selected is not a PWM module
_INT_ i_PCI1710_SetNewPWMTiming ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr,
BYTE  b_PWM,
BYTE  b_TimingUnit,
ULONG  ul_LowTiming,
ULONG  ul_HighTiming 
)

Sets a new timing.
The ul_LowTiming, ul_HighTiming and b_TimingUnit determine the low/high base timing for the persiod.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
[in]b_PWMSelected PWM (0 or 1)
[in]b_TimingUnitTiming unit (0: ns, 1: us, 2: ms, 3: sec or 4: min)
[in]ul_LowTimingLow base timing value
[in]ul_HighTimingHigh base timing value
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3The PWM selection is wrong
-4The base timing value is wrong
-5The low base timing selection is wrong
-6The high base timing selection is wrong
-7Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - Invalid PWM index
-103Driver - Invalid timing unit
-104Driver - Invalid low timing
-105Driver - Invalid high timing
-106Driver - The module selected is not a PWM module
-107Driver - The PWM has not been initialized
_INT_ i_PCI1710_EnablePWM ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr,
BYTE  b_PWM,
BYTE  b_StartLevel,
BYTE  b_StopMode,
BYTE  b_StopLevel,
BYTE  b_ExternGate,
BYTE  b_InterruptEnable 
)

Enables the selected PWM of the selected module.
The i_PCI1710_InitPWM function must be called before calling this function.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
[in]b_PWMSelected PWM (0 or 1)
[in]b_StartLevelStart period level selection (0: the period will start with a low level, 1: the period will start with a high level)
[in]b_StopModeStop mode selection (0: the PWM will be stopped directly after the call of the i_PCI1710_DisablePWM function, 1: the PWM will be stopped after the end of the last period after the call of the disable function)
[in]b_StopLevelStop PWM level selection (0: the output signal will keep its level after the call of the i_PCI1710_DisablePWM function, 1: the output signal will be set to low after the call of the disable function, 2: the output signal will be set to high after the call of the disable function)
[in]b_ExternGateExtern gate action selection (0: extern gate signal not used, 1: extern gate signal used)
[in]b_InterruptEnableEnable or disable the interrupt (0: disable the PWM interrupt, 1: an interrupt will occur after each end of state)
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3The PWM selection is wrong
-4The PWM start level selection is wrong
-5The PWM stop mode selection is wrong
-6The PWM stop level selection is wrong
-7The extern gate signal selection is wrong
-8The interrupt parameter is wrong
-9Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - Invalid PWM index
-103Driver - Invalid start level selection
-104Driver - Invalid stop mode selection
-105Driver - Invalid stop level selection
-106Driver - Invalid extern gate selection
-107Driver - Invalid interrupt flag selection
-108Driver - The module selected is not PWM module
-109Driver - The PWM has not been initialized
_INT_ i_PCI1710_DisablePWM ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr,
BYTE  b_PWM 
)

Disables the selected PWM of the selected module.
The output signal level depends of the configuration of the PWM parameter (see the b_StartLevel, b_StopMode and b_StopLevel parameters of the i_PCI1710_EnablePWM function).

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
[in]b_PWMSelected PWM (0 or 1)
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3The PWM selection is wrong
-4Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - Invalid PWM index
-103Driver - The module selected is not a PWM module
-104Driver - The PWM has not been initialized
-105Driver - The PWM has not been enabled
_INT_ i_PCI1710_GetPWMInitialisation ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr,
BYTE  b_PWM,
PBYTE  pb_TimingUnit,
PULONG  pul_LowTiming,
PULONG  pul_HighTiming,
PBYTE  pb_StartLevel,
PBYTE  pb_StopMode,
PBYTE  pb_StopLevel,
PBYTE  pb_ExternGate,
PBYTE  pb_InterruptEnable,
PBYTE  pb_Enable 
)

Returns the selected PWM initialization of the selected module.
The i_PCI1710_InitPWM function must be called before calling this function.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
[in]b_PWMSelected PWM (0 or 1)
[out]pb_TimingUnitReturns the base timing unit (0: ns, 1: us, 2: ms, 3: sec or 4: min)
[out]pul_LowTimingReturns the low base timing value
[out]pul_HighTimingReturns the high base timing value
[out]pb_StartLevelReturns the start period level selection (0: the period will start with a low level, 1: the period will start with a high level)
[out]pb_StopModeReturns the stop mode selection(0: the PWM will be stopped directly after the call of the i_PCI1710_DisablePWM function and will break the last period, 1: the PWM will end its last period before being stopped after the call of the disable function)
[out]pb_StopLevelReturns the stop level selection (0: the output signal will keep the level after the call of the i_PCI1710_DisablePWM function, 1: the output signal will be stopped at low after the call of the disable function, 2: the output signal will be set to high after the call of the disable function)
[out]pb_ExternGateIndicates if the extern gate action is used (0: not used, 1: used)
[out]pb_InterruptEnableIndicates if the interrupt are enabled or not (0: disabled, 1: enabled)
[out]pb_EnableIndicates if the PWM is enabled or not (0: disabled, 1: enabled)
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3The PWM selection is wrong
-4Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - Invalid PWM index
-103Driver - The module selected is not a PWM module
-104Driver - The PWM has not been initialized
-105Driver - The PWM has not been enabled
_INT_ i_PCI1710_GetPWMStatus ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr,
BYTE  b_PWM,
PBYTE  pb_PWMOutputStatus,
PBYTE  pb_ExternGateStatus 
)

Returns the selected PWM status of the selected module.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
[in]b_PWMSelected PWM (0 or 1)
[out]pb_PWMOutputStatusReturns the PWM output level status (0: low or 1: high)
[out]pb_ExternGateStatusReturns the extern gate level status (0: low or 1: high)
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3The PWM selection is wrong
-4Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - Invalid PWM index
-103Driver - The module selected is not a PWM module
-104Driver - The PWM has not been initialized
-105Driver - The PWM has not been enabled
_INT_ i_PCI1710_ReadPWM1DigitalInput ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr,
BYTE  b_InputChannel,
PBYTE  pb_ChannelStatus 
)

Reads the status of the selected PWM digital input of the selected module.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
[in]b_InputChannelSelected digital input (0 to 2)
[out]pb_ChannelStatusReturns the digital inptut channel status (0: reset or 1: set)
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3The selected digital input is wrong
-4Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - The module selected is not a PWM module
_INT_ i_PCI1710_ReadPWMAllDigitalInputs ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr,
PBYTE  pb_InputStatus 
)

Reads the status of all the PWM digital inputs of the selected module.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
[out]pb_InputStatusDigital inputs channel status
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - The module selected is not a PWM
_INT_ i_PCI1710_EnableDisablePWMDigitalOutputManualSetting ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr,
BYTE  b_Flag 
)

Enables or disables to set manually the digital output H of the selected module.
When the PWM 0 will be enabled for the first time, the digital output manual setting will be considered as disabled, which means that it would the PWM 0 which will control the digital output of the selected module.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
[in]b_FlagEnable/disable flag (0: disable the manual setting, the output H is controlled parallely to the PWM0, or 1: enable the manual setting, the output H will be set via the i_PCI1710_SetPWMDigitalOutputOn function or reset via the i_PCI1710_SetPWMDigitalOutputOff function)
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3The flag parameter is wrong
-4Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - The module selected is not a PWM
_INT_ i_PCI1710_SetPWMDigitalOutputOn ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr 
)

Sets on the digital output H of the selected PWM of the selected module.
The i_PCI1710_EnableDisablePWMDigitalOutputSetting function must be called before calling this function

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - The module selected is not a PWM
-103Driver - The manual setting option is not active
_INT_ i_PCI1710_SetPWMDigitalOutputOff ( HANDLE  h_DeviceHandle,
BYTE  b_ModulNbr 
)

Sets off the digital output H of the selected PWM of the selected module.
The i_PCI1710_EnableDisablePWMDigitalOutputSetting function must be called before calling this function

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModulNbrNumber of the module to configure (0 to 3)
Return values
0No Error
-1The device handle parameter is wrong
-2The module selection is wrong
-3Error while calling IOCTL function
-101Driver - Invalid module index
-102Driver - The module selected is not a PWM
-103Driver - The manual setting option is not active