xPCI-1500 API
xPCI-1500 event logic functions

Functions

_INT_ i_PCI1500_InitEventLogic (HANDLE h_DeviceHandle, BYTE b_PortNbr, BYTE b_EventLogic, PCHAR pc_EventMask)
 
_INT_ i_PCI1500_StartEventLogic (HANDLE h_DeviceHandle, BYTE b_PortNbr)
 
_INT_ i_PCI1500_StopEventLogic (HANDLE h_DeviceHandle, BYTE b_PortNbr)
 

Detailed Description

Function Documentation

_INT_ i_PCI1500_InitEventLogic ( HANDLE  h_DeviceHandle,
BYTE  b_PortNbr,
BYTE  b_EventLogic,
PCHAR  pc_EventMask 
)

Permits to initialize the event logic of the board xPCI-1500
The event logic enables you to receive interrupt when a certain state is reached by the board.
You can also use this function to receive interruption when a short-circuit occurs, or when there is no more supply voltage.
To detect short-circuit and lost of supply voltage, use the event of port 1. If you do not want to listen to the input of port 1, just give the event mask "xxxxxx".

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_PortNbrPort number to initialize ( PCI1500_PORT_0 : channels 0-7 or PCI1500_PORT_1 : channels 8-13)
[in]b_EventLogicEvent logic mode. Values are PCI1500_LOGIC_AND or PCI1500_LOGIC_OR. Port 1 only supports OR logic.
[in]pc_EventMaskAn 8-character string for port 0, or 6-character string for port 1, to set the mask of the event.
Each character gives the state of the input channels and can have one of the following values :
  • "X" or "x" : This input is not used for event
  • "0" : This input must be low
  • "1" : This input must be high
  • "2" : This input reacts to a falling edge
  • "3" : This input reacts to a rising edge
  • "4" : This input reacts to both edges
    Port 0 : from the left to the right, the first digit of the character string is input 7 and the last digit is input 0.
    Port 1 : from the left to the right, the first digit of the character string is input 13 and the last digit is input 8.
    IMPORTANT : If you use the AND logic, only one input can use the edge event.
Returns
0 : No Error
-1 : wrong device handle
-2 : The port number parameter is wrong
-3 : The event logic parameter is wrong
-4 : AND logic is not available on port 1
-5 : Event logic is NULL
-6 : The length of the string is invalid
-7 : Unrecognized character in the string
-8 : It is not possible to have more than one edge with AND logic
-9 : The interrupt routine is not installed
-10 : Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI1500_StartEventLogic ( HANDLE  h_DeviceHandle,
BYTE  b_PortNbr 
)

Starts the event logic of the board xPCI-1500
You must call the function i_PCI1500_InitEventLogic before calling this function

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_PortNbrPort number ( PCI1500_PORT_0 : channels 0-7 or PCI1500_PORT_1 : channels 8-13)
Returns
0 : No Error
-1 : wrong device handle
-2 : The port number parameter is wrong
-3 : The interrupt routine is not installed
-4 : Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI1500_StopEventLogic ( HANDLE  h_DeviceHandle,
BYTE  b_PortNbr 
)

Stops the event logic of the board xPCI-1500

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_PortNbrPort number ( PCI1500_PORT_0 : channels 0-7 or PCI1500_PORT_1 : channels 8-13)
Returns
0 : No Error
-1 : wrong device handle
-2 : The port number parameter is wrong
-3 : Error while calling IOCTL function (wrong handle ?)