P40vspcc.c, B-40 – Rockwell Automation 1785-Vx0B, D17856.5.9 PLC-5 VME VMEbus Programmable Controllers User Manual User Manual
Page 198

Sample API Modules
Appendix B
B-40
#include
#include
#include
#include ”epc_obm.h”
#include ”epc_err.h”
#include ”busmgr.h”
#include ”p40vspcc.h”
/***************************************************************************/
/************************* PRIVATE DEFINITIONS ****************************/
/***************************************************************************/
/***************************************************************************/
/************************* PRIVATE TYPE DEFINITIONS ************************/
/***************************************************************************/
typedef enum
{
kPLC540V_SEND_PCCC=0xFFFF,
} PLC540V_SPCCC_COMMAND;
/***************************************************************************/
/*************************** PRIVATE FUNCTIONS *****************************/
/***************************************************************************/
/*****************************************************************************
*
* PURPOSE: This function sends a PCCC command to the PLC-5/40V for
* processing.
*
* INPUT: ULONG vmeCmdBlkAddr contains the VME address where the
* command block will be copied to so the PLC-5/40V can
* access its information.
*
* PLC540V_PCCC_PACKET_TYPE pcccCommandPacket contains a pointer
* to the PCCC command packet which will be sent to the processor.
*
* UWORD pcccCommandPacketSize contains the size of the PCCC
* command packet in bytes.
*
* PLC540V_PCCC_REPLY_TYPE pcccReplyPacket contains a pointer to
* the PCCC reply packet which will be returned from the
* processor.
*
* UWORD pcccReplyPacketSize contains the size of the PCCC reply
* packet in bytes.
*
* 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_DATA_WIDTH_TYPE width contains the data width that
* should be used for the copy operations. It can be D16
* or D08.
P40VSPCC.C