Rockwell Automation 1785-Vx0B, D17856.5.9 PLC-5 VME VMEbus Programmable Controllers User Manual User Manual

Page 192

Advertising
background image

Sample API Modules

Appendix B

B-34

/***************************************************************************/
/*************************** PRIVATE FUNCTIONS *****************************/
/***************************************************************************/
static void plc540v_handle_interrupts(

PLC540V_HINTS_COMMAND hintCmd,
PLC540V_HINTS_MODE hintMode,
ULONG vmeCmdBlkAddr,
UWORD baseAddress,
VME_INTERRUPT_LEVEL_TYPE cmdIntLevel,
UBYTE cmdStatusId,
VME_INTERRUPT_LEVEL_TYPE operationIntLevel,
UBYTE operationStatusId,
PLC540V_STATUS_TYPE *status);

/*****************************************************************************
*
* PURPOSE: This function configures the PLC-5/40V to recognize the
* specified VME interrupts.
*
* INPUT: ULONG vmeCmdBlkAddr contains the VME address where the
* command block will be copied to so the PLC-5/40V can
* access its information.
*
* UWORD baseAddress contains the base address of the
* PLC-5/40V.
*
* VME_INTERRUPT_LEVEL_TYPE cmdIntLevel contains the VME bus
* interrupt to be generated by the PLC-5/40V AFTER storing
* its response in the response word of the command block AFTER
* COMMAND completion. If kVME_NO_INT_LEVEL is specified, then
* no VME bus interrupts will be generated.
*
* UBYTE cmdStatusId contains a unique value which will be used
* by the interrupted host processor to run a specific
* interrupt service routine. This variable must be set to
* zero if you are NOT using any command interrupts.
*
* VME_INTERRUPT_LEVEL_TYPE operationIntLevel contains the VME
* bus interrupt to be generated by the PLC-5/40V AFTER each
* copy OPERATION. If kVME_NO_INT_LEVEL is specified, then
* an error is generated.
*
* UBYTE operationStatusId contains a unique value which will
* be used by the interrupted host processor to run a specific
* interrupt service routine. This variable must be set to
* zero if you are NOT using any operation interrupts.
*
* OUTPUT: PLC540V_STATUS_TYPE *status will contain the final status
* of requesting this function. This status could be and EPC
* or PLC-5/40V value.
*
* RETURNS: Nothing.
*
* EXAMPLE:
* ULONG vmeCmdBlkAddr = 0x90000;
* UWORD baseAddress = 0xFC00;
* VME_INTERRUPT_LEVEL_TYPE cmdIntLevel = kVME_NO_INT_LEVEL;
* UBYTE cmdStatusId = 0;
* VME_INTERRUPT_LEVEL_TYPE operationIntLevel=kVME_INT_LEVEL_3;
* UBYTE operationStatusId = 234;
* PLC540V_STATUS_TYPE status;

Advertising