xPCI-1710 API
xPCI-1710 Digital Inputs/Outputs functions

Functions

_INT_ i_PCI1710_ReadDigitalInputs (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, PBYTE_ pb_DigitalInputs)
 
_INT_ i_PCI1710_SetDigitalOutputsOn (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_DigitalOutputs)
 
_INT_ i_PCI1710_SetDigitalOutputsOff (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_DigitalOutputs)
 
_INT_ i_PCI1710_SetPortConfiguration (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_PortAMode, BYTE_ b_PortBMode)
 
_INT_ i_PCI1710_SetDigitalOutputMemory (HANDLE h_DeviceHandle, BYTE_ b_DOMOnOff)
 

Detailed Description

Function Documentation

_INT_ i_PCI1710_ReadDigitalInputs ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
PBYTE_  pb_DigitalInputs 
)

Get the value of the digital inputs
There can be 5 to 7 inputs (A to G, with A and B configurable as inputs or outputs)
The output value pb_DigitalInputs is a 7-bits value, which represent the following inputs :

  • Bit 0: Input C
  • Bit 1: Input D
  • Bit 2: Input E (Inverted)
  • Bit 3: Input F (Inverted)
  • Bit 4: Input G (Inverted)
  • Bit 5: Input A (0 if A is set as Output)
  • Bit 6: Input B (0 if B is set as Output)

For further information regarding pin assignement and input types, please refer to the manual

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[out]pb_DigitalInputsValue of the inputs (0x0 to 0x7F)
Returns
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : The digital port has not been configured
-4 : Error while reading the value
_INT_ i_PCI1710_SetDigitalOutputsOn ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_DigitalOutputs 
)

Set the value of the digital outputs
If digital output memory is OFF, the outputs which are not covered by the mask b_DigitalOutputs are reset. Else, they can only be reset by calling i_PCI1710_SetDigitalOutputsOff.
There can be 1 to 3 outputs (A, B and H, with A and B configurable as inputs or outputs)
The value b_DigitalOutputs is a 3-bits value, which represent the following outputs :

  • Bit 0: Output H
  • Bit 1: Output A (not used if A is set as Input)
  • Bit 2: Output B (not used if B is set as Input)

For further information regarding pin assignement and input types, please refer to the manual

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[out]b_DigitalOutputsValue of the outputs (0x0 to 0x7)
Returns
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : The digital port has not been configured
-4 : Error while reading the value
_INT_ i_PCI1710_SetDigitalOutputsOff ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_DigitalOutputs 
)

Reset the digital outputs
This function only works if the digital output memory is ON. Otherwise, it returns an error.
There can be 1 to 3 outputs (A, B and H, with A and B configurable as inputs or outputs)
The value b_DigitalOutputs is a 3-bits value, which represent the following outputs :

  • Bit 0: Output H
  • Bit 1: Output A (not used if A is set as Input)
  • Bit 2: Output B (not used if B is set as Input)

For further information regarding pin assignement and input types, please refer to the manual

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[out]b_DigitalOutputsValue of the outputs (0x0 to 0x7)
Returns
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : The digital port has not been configured
-4 : The digital output memory is off
-4 : Error while setting the value
_INT_ i_PCI1710_SetPortConfiguration ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_PortAMode,
BYTE_  b_PortBMode 
)

Set the mode of the digital inputs/outputs A and B
This function must be called before any other digital function
For further information regarding pin assignement and input types, please refer to the manual

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_PortAModeMode of pin A (PCI1710_PORT_INPUT or PCI1710_PORT_OUTPUT)
[in]b_PortBModeMode of pin B (PCI1710_PORT_INPUT or PCI1710_PORT_OUTPUT)
Returns
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong module number
-3 : Port A mode is invalid
-4 : Port B mode is invalid
-5 : Error while setting the mode
_INT_ i_PCI1710_SetDigitalOutputMemory ( HANDLE  h_DeviceHandle,
BYTE_  b_DOMOnOff 
)

Set the digital output memory ON or OFF according to b_DOMOnOff :

  • PCI1710_ENABLE: When setting the outputs, all outputs not covered by the mask stay set. They have to be reset by a call to i_PCI1710_SetDigitalOutputsOff.
  • PCI1710_DISABLE: When setting the outputs, all outputs not covered by the mask are reset. Calls to i_PCI1710_SetDigitalOutputsOff will return an error.
Parameters
[in]h_DeviceHandleHandle of the board
[in]b_DOMOnOffDigital output memory mode (PCI1710_ENABLE or PCI1710_DISABLE)
Returns
0 : No Error
-1 : The device handle parameter is wrong
-2 : Wrong DOM mode parameter