xPCI-3016 API
xPCI-3016 TTL inputs/outputs functions

Functions

_INT_ i_PCI3016_SetTTLPortConfiguration (HANDLE h_DeviceHandle, BYTE b_InOrOut)
 
_INT_ i_PCI3016_ReadTTLInputs (HANDLE h_DeviceHandle, BYTE b_Port, PWORD pw_Value)
 
_INT_ i_PCI3016_SetTTLOutputsOff (HANDLE h_DeviceHandle, BYTE b_Port, WORD w_Mask)
 
_INT_ i_PCI3016_SetTTLOutputsOn (HANDLE h_DeviceHandle, BYTE b_Port, WORD w_Mask)
 
_INT_ i_PCI3016_GetTTLOutputsStatus (HANDLE h_DeviceHandle, BYTE b_Port, PWORD pw_OutputsStatus)
 

Detailed Description

Function Documentation

_INT_ i_PCI3016_SetTTLPortConfiguration ( HANDLE  h_DeviceHandle,
BYTE  b_InOrOut 
)

Set the TTL programmable port to input or output

Parameters
[in]h_DeviceHandleHandle of the board
[out]b_InOrOutConfigure the programmable port as input (PCI3016_TTL_INPUT) or output (PCI3016_TTL_OUTPUT)
Return values
0: No Error
-1: The device handle parameter is wrong
-2: Invalid port mode
-3: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3016_ReadTTLInputs ( HANDLE  h_DeviceHandle,
BYTE  b_Port,
PWORD  pw_Value 
)

Read the TTL inputs
In order to read the programmable port (with parameter PCI3016_PORT_PROGRAMMABLE or PCI3016_PORT_BOTH), it has to be set as an input first.
If PCI3016_PORT_INPUT or PCI3016_PORT_PROGRAMMABLE is used, the 8 lowest bits represent the port inputs.
If PCI3016_PORT_BOTH is used, then the 8 low bits represent the input port, and the 8 high bits the programmable port.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_PortPort to read (PCI3016_PORT_INPUT, PCI3016_PORT_PROGRAMMABLE or PCI3016_PORT_BOTH)
[out]pw_ValueValue of the port.
Return values
0: No Error
-1: The device handle parameter is wrong
-2: Invalid port selection
-3: The programmable port is not configured as an input
-4: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3016_SetTTLOutputsOff ( HANDLE  h_DeviceHandle,
BYTE  b_Port,
WORD  w_Mask 
)

Set the TTL outputs to LOW
In order to set the programmable port (with parameter PCI3016_PORT_PROGRAMMABLE or PCI3016_PORT_BOTH), it has to be set as an output first.
If PCI3016_PORT_OUTPUT or PCI3016_PORT_PROGRAMMABLE is used, the 8 lowest bits represent the port outputs.
If PCI3016_PORT_BOTH is used, then the 8 low bits represent the output port, and the 8 high bits the programmable port.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_PortPort to reset (PCI3016_PORT_OUTPUT, PCI3016_PORT_PROGRAMMABLE or PCI3016_PORT_BOTH)
[in]w_MaskOutputs to reset (0x00 to 0xFF, or 0x0000 to 0xFFFF if both ports are used)
Return values
0: No Error
-1: The device handle parameter is wrong
-2: Invalid port selection
-3: The programmable port is not configured as an output
-4: Invalid mask
-5: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3016_SetTTLOutputsOn ( HANDLE  h_DeviceHandle,
BYTE  b_Port,
WORD  w_Mask 
)

Set the TTL outputs to HIGH
In order to set the programmable port (with parameter PCI3016_PORT_PROGRAMMABLE or PCI3016_PORT_BOTH), it has to be set as an output first.
If PCI3016_PORT_OUTPUT or PCI3016_PORT_PROGRAMMABLE is used, the 8 lowest bits represent the port outputs.
If PCI3016_PORT_BOTH is used, then the 8 low bits represent the output port, and the 8 high bits the programmable port.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_PortPort to reset (PCI3016_PORT_OUTPUT, PCI3016_PORT_PROGRAMMABLE or PCI3016_PORT_BOTH)
[in]w_MaskOutputs to reset (0x00 to 0xFF, or 0x0000 to 0xFFFF if both ports are used)
Return values
0: No Error
-1: The device handle parameter is wrong
-2: Invalid port selection
-3: The programmable port is not configured as an output
-4: Invalid mask
-5: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3016_GetTTLOutputsStatus ( HANDLE  h_DeviceHandle,
BYTE  b_Port,
PWORD  pw_OutputsStatus 
)

Get the TTL outputs status
In order to set the programmable port (with parameter PCI3016_PORT_PROGRAMMABLE or PCI3016_PORT_BOTH), it has to be set as an output first.
If PCI3016_PORT_OUTPUT or PCI3016_PORT_PROGRAMMABLE is used, the 8 lowest bits represent the port outputs.
If PCI3016_PORT_BOTH is used, then the 8 low bits represent the output port, and the 8 high bits the programmable port.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_PortPort to reset (PCI3016_PORT_OUTPUT, PCI3016_PORT_PROGRAMMABLE or PCI3016_PORT_BOTH)
[out]pw_OutputsStatusOutputs status (0x00 to 0xFF, or 0x0000 to 0xFFFF if both ports are used)
Return values
0: No Error
-1: The device handle parameter is wrong
-2: Invalid port selection
-3: The programmable port is not configured as an output
-4: Invalid mask
-5: Error while calling IOCTL function (wrong handle ?)