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

Page 195

Advertising
background image

Sample API Modules

Appendix B

B-37

* 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
* ALL VME interrupts will be disabled.
*
* 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:
* PLC540V_HINTS_COMMAND hintCmd=kPLC540V_HANDLE_INTERRUPTS;
* PLC540V_HINTS_MODE hintMode=kPLC540V_HINTS_ENABLE;
* 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 = 432;
* PLC540V_STATUS_TYPE status;
* plc540v_handle_interrupts(hintCmd,
* hintMode,
* vmeCmdBlkAddr,
* baseAddress,
* cmdIntLevel,
* cmdStatusId,
* operationIntLevel,
* operationStatusId,
* &status);
*
* Copyright Allen-Bradley Company, Inc. 1993
*
****************************************************************************/
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)

{
/* The handle interrupts command block. */
static PLC540V_HINT_CMD_TYPE hintCmdBlk;

/* Let’s initialize the handle interrupts command block to be empty. */
memset((char *) &hintCmdBlk, 0x0, sizeof(PLC540V_HINT_CMD_TYPE));

Advertising