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

Page 227

Advertising
background image

Sample API Modules

Appendix B

B-69

#ifndef P40VRBP_H
#define P40VRBP_H 1

///////////////////////////////////////////////////////////////////////////////
// Definitions for the PCCC READ BYTES PHYSICAL COMMAND AND REPLY PACKETS //
///////////////////////////////////////////////////////////////////////////////

#include ”p40vspcc.h”

#pragma pack(1)
/***************************************************************************/
/************************ INTEL VERSION OF DEFINITIONS *********************/
/***************************************************************************/

/* The PCCC Read Bytes Physical command packet structure. */
typedef struct
{
UBYTE reserved[4];
UBYTE cmd;
UBYTE sts;
UWORD tns;
UBYTE fnc;
ULONG addr;
UBYTE size;
} PLC540V_PCCC_RBP_CMD_TYPE;
#define kPLC540V_PCCC_RBP_CMD_SIZE (sizeof(PLC540V_PCCC_RBP_CMD_TYPE))

// The maximum number of bytes which can be read in one operation. This
// maximum value is really 244, but I will set it to match the maximum
// value for Write Bytes Physical so we can use the same bucket sizes...
#define kPLC540V_PCCC_MAX_RBP_DATA 238

/* The PCCC Read Bytes Physical reply packet structure. */
typedef struct
{
UBYTE lnhHi;
UBYTE lnhLo;
UBYTE reserved[4];
UBYTE cmd;
UBYTE sts;
UWORD tns;
UBYTE data[kPLC540V_PCCC_MAX_RBP_DATA];
} PLC540V_PCCC_RBP_RPY_TYPE;
#define kPLC540V_PCCC_RBP_RPY_SIZE (sizeof(PLC540V_PCCC_RBP_RPY_TYPE))
#pragma pack()

void plc540v_pccc_read_bytes_physical(
ULONG vmeCmdBlkAddr,
UWORD baseAddress,
VME_DATA_WIDTH_TYPE width,
VME_ADDRESS_MODIFIER_TYPE addrMod,

ULONG plcAddress,
UBYTE readSize,

PLC540V_PCCC_RBP_RPY_TYPE *reply,
PLC540V_STATUS_TYPE *status);
#endif

P40VRBP.H

Advertising