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_DeviceHandle | Handle of the board |
[in] | b_PortNbr | Port number to initialize ( PCI1500_PORT_0 : channels 0-7 or PCI1500_PORT_1 : channels 8-13) |
[in] | b_EventLogic | Event logic mode. Values are PCI1500_LOGIC_AND or PCI1500_LOGIC_OR. Port 1 only supports OR logic. |
[in] | pc_EventMask | An 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 ?)