xPCI-1710 API
xPCI-1710 SSI (Synchronous Serial Interface) management functions

Functions

_INT_ i_PCI1710_InitSSI (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ProfileLength, BYTE_ b_PositionLength, BYTE_ b_TurnCptLength, BYTE_ b_PCIInputClock, DWORD_ dw_OutputClock, BYTE b_CountingMode)
 
_INT_ i_PCI1710_InitSSIRawData (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ProfileLength, BYTE_ b_PCIInputClock, DWORD_ dw_OutputClock)
 
_INT_ i_PCI1710_Read1SSIValue (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_SSINbr, PDWORD_ pdw_Position, PDWORD_ pdw_Turn)
 
_INT_ i_PCI1710_Read1SSIRawDataValue (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_SSINbr, PDWORD_ pdw_ValueArray, BYTE_ b_ArraySize)
 
_INT_ i_PCI1710_ReadAllSSIValue (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, DWORD_ pdw_Position[3], DWORD_ pdw_Turn[3])
 
_INT_ i_PCI1710_ReadAllSSIRawDataValue (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, PDWORD_ pdw_ValueArray, BYTE_ b_ArraySize)
 
_INT_ i_PCI1710_ReadSSI1DigitalInput (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_Channel, PBYTE_ pb_Status)
 
_INT_ i_PCI1710_ReadSSIAllDigitalInput (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, PBYTE_ pb_Status)
 
_INT_ i_PCI1710_SetSSIDigitalOutputOn (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr)
 
_INT_ i_PCI1710_SetSSIDigitalOutputOff (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr)
 
_INT_ i_PCI1710_StartSSIAcquisition (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr)
 
_INT_ i_PCI1710_GetSSIAcquisitionStatus (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, PBYTE_ pb_Status)
 
_INT_ i_PCI1710_GetSSIValue (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_SSINbr, PDWORD_ pdw_Position, PDWORD_ pdw_Turn)
 
_INT_ i_PCI1710_GetSSIRawDataValue (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_SSINbr, PDWORD_ pdw_ValueArray, BYTE_ b_ArraySize)
 

Detailed Description

Function Documentation

_INT_ i_PCI1710_InitSSI ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ProfileLength,
BYTE_  b_PositionLength,
BYTE_  b_TurnCptLength,
BYTE_  b_PCIInputClock,
DWORD_  dw_OutputClock,
BYTE  b_CountingMode 
)

Initialise the SSI on a given module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ProfileLengthLength in bits of the profile. The profile is the position length plus the turn counter length in bits (2 -> 32)
NOTE: when using a single turn encoder and binary representation, this value must be incremented by one.
[in]b_PositionLengthLength in bits of the position.
This value represents the current position in the current turn.
NOTE: when using a single turn encoder and binary representation, this value must be incremented by one.
[in]b_TurnCptLengthLength in bits of the turn counter (b_PositionLength + b_TurnCptLength must not be bigger than b_ProfileLength).
This arugment can be put to 0. In this case, the counter is in single turn mode, and b_positionLength must be equal to b_ProfileLength.
[in]b_PCIInputClockFrequency of the input clock (PCI1710_30MHZ -> 30 or PCI1710_33MHZ -> 33) (see your PC's PCI clock in its manual)
[in]dw_OutputClockOutput clock (229 -> 5 000 000 Hz for PCI1710_30MHZ or 252 -> 5 000 000 Hz for PCI1710_33MHZ)
[in]b_CountingModeSelection of the counting mode (0 -> No conversion is made (raw value is delivered), 1 -> A conversion is made from gray code to binary).
If "0" is selected: A gray code value is delivered, if a gray code sensor is used. A binary value is delivered, if a binary code sensor is used.
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Wrong profile length
-4 : Wrong position length
-5 : Wrong turn count length
-6 : Wrong PCI input clock
-7 : Wrong output clock
-8 : Wrong counting mode
-9 : Error while initializing SSI
_INT_ i_PCI1710_InitSSIRawData ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ProfileLength,
BYTE_  b_PCIInputClock,
DWORD_  dw_OutputClock 
)

Initialise the SSI on a given module. The difference with the other initialization lies in the fact that datas are not formated. So the read values will have their parity bit, turn count and position will not be automatically separated and so on.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ProfileLengthLength in bits of the profile (2 -> 48)
[in]b_PCIInputClockFrequency of the input clock (PCI1710_30MHZ -> 30 or PCI1710_33MHZ -> 33) (see your PC's PCI clock in its manual)
[in]dw_OutputClockOutput clock (229 -> 5 000 000 Hz for PCI1710_30MHZ or 252 -> 5 000 000 Hz for PCI1710_33MHZ)
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Wrong profile length
-4 : Wrong PCI input clock
-5 : Wrong output clock
-6 : Error while initializing SSI
_INT_ i_PCI1710_Read1SSIValue ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_SSINbr,
PDWORD_  pdw_Position,
PDWORD_  pdw_Turn 
)

Read one value of a given SSI counter

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_SSINbrNumber of the SSI counter (0 -> 2)
[out]pdw_PositionPossition in the current turn
[out]pdw_TurnCurrent turn number
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Wrong SSI counter number
-4 : Error while reading the value
_INT_ i_PCI1710_Read1SSIRawDataValue ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_SSINbr,
PDWORD_  pdw_ValueArray,
BYTE_  b_ArraySize 
)

Read the raw value of a given SSI counter

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_SSINbrNumber of the SSI counter (0 -> 2)
[out]pdw_ValueArrayArray of raw data
[in]b_ArraySizeSize of the array
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Wrong SSI counter number
-4 : Error while reading the value
_INT_ i_PCI1710_ReadAllSSIValue ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
DWORD_  pdw_Position[3],
DWORD_  pdw_Turn[3] 
)

Read the values of all SSI counters on a given nodule

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[out]pdw_PositionPossition in the current turn (at least 3 * sizeof(DWORD) must be allocated)
[out]pdw_TurnCurrent turn number (at least 3 * sizeof(DWORD) must be allocated)
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Error while reading the values
_INT_ i_PCI1710_ReadAllSSIRawDataValue ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
PDWORD_  pdw_ValueArray,
BYTE_  b_ArraySize 
)

Read the raw values of all SSI counters on a given nodule

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[out]pdw_ValueArrayArray of raw data
[in]b_ArraySizeSize of the array
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Error while reading the value
_INT_ i_PCI1710_ReadSSI1DigitalInput ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_Channel,
PBYTE_  pb_Status 
)

Read the selected digital input on a given module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ChannelChannel to be read (0 -> 2)
[in]pb_StatusStatus of the channel (0 -> not active, 1 -> active)
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Wrong channel
-4 : Error while reading the input
_INT_ i_PCI1710_ReadSSIAllDigitalInput ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
PBYTE_  pb_Status 
)

Read all the digital input of a given module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]pb_StatusMask of the channel status (0000 0XYZ -> bit Z: D0, Y -> D1, X -> D2)
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Error while reading the inputs
_INT_ i_PCI1710_SetSSIDigitalOutputOn ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr 
)

Switches on all the digital output of a given module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Error while writing outputs
_INT_ i_PCI1710_SetSSIDigitalOutputOff ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr 
)

Switches off all the digital output of a given module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Error while writing outputs
_INT_ i_PCI1710_StartSSIAcquisition ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr 
)

Start a SSI acquisition on a given module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Error while starting the acquisition
_INT_ i_PCI1710_GetSSIAcquisitionStatus ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
PBYTE_  pb_Status 
)

Get the status of the acquisition

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[out]pb_StatusStatus of the acquisition (0 -> finished, 1 -> running)
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Error while reading the status
_INT_ i_PCI1710_GetSSIValue ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_SSINbr,
PDWORD_  pdw_Position,
PDWORD_  pdw_Turn 
)

Get the value of a given counter

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_SSINbrNumber of the counter (0 to 2)
[out]pdw_PositionPossition in the current turn
[out]pdw_TurnCurrent turn number
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Wrong SSI counter number
-4 : Error while reading the value
_INT_ i_PCI1710_GetSSIRawDataValue ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_SSINbr,
PDWORD_  pdw_ValueArray,
BYTE_  b_ArraySize 
)

Get the raw value of a given SSI counter

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_SSINbrNumber of the counter (0 to 2)
[out]pdw_ValueArrayArray of raw data
[in]b_ArraySizeSize of the array
Returns
> 0 : Warning
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Wrong SSI counter number
-4 : Error while reading the value