Chapter 4 - using the api structures, Introduction, Api structures – Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual
Page 47: Using the api structures, Introduction -1 api structures -1, Chapter
Publication 1747-6.5.3 June 1998
Chapter
4
Using the API Structures
Introduction
This chapter describes the structures the API uses. These structures are declared in
ocapi.h
.
API Structures
Structure Name:
Syntax:
DII_CFG
Passed to OC_ConfigureDII.
Configures a discrete input
interrupt for a module.
typedef struct tagDII_CFG
BYTE
SlotNum;
/* slot number */
BYTE
IOIncludeMask; /* declare which Discrete Inputs can cause interrupts */
BYTE
IOEdgeType;
/* select required transition of each discrete input */
WORD
PresetCount;
/* set the number of transitions required to cause interrupt */
} DII_CFG;
FORCEDATA
Passed to OC_SetForces.
Configures input and output
forces.
typedef struct tagFORCEDATA
{
BYTE
SlotNum;
/* slot number */
WORD
WordOffset;
/* offset to word to force */
BYTE
IOType;
/* selects force inputs or outputs */
WORD
ForceMask;
/* bits set to 1 are forced, 0 removes forces */
WORD
ForceVal;
/* selects force state of bits set to 1 in ForceMask */
} FORCEDATA;
MSGBUF
Returned by OC_PollScanner.
MsgID identifies the message
type. Type-specific data is
contained in
MsgData[ ]
.
#define OCMSGDATASIZE4
/* number of bytes of message data */
typedef struct tagMSGBUF
{
BYTE
MsgID;
/* Message type */
BYTE
MsgData[OCMSGDATASIZE];
/* Type-specific data */
} MSGBUF;
OCEXTERR
Returned by
OC_GetExtendedError. I/O error
report from scanner.
#define OCERRDATASIZE3
/* number of bytes of error data */
typedef struct tagOCEXTERR
{
BYTE
ErrorCode;
/* Extended error code */
BYTE
SlotNum;
/* Associated slot number */
BYTE
ErrorData[OCERRDATASIZE];/* Error code data */
} OCEXTERR;
OCINIT
Passed to OC_InitScanner
function to specify dual port
RAM partition sizes for output
image, input image, and host
retentive data.
typedef struct tagOCINIT
{
WORD
OutputImageSize;
/* size in bytes */
WORD
InputImageSize;
/* size in bytes */
WORD
HostRetentiveDataSize;/* size in bytes */
} OCINIT;
OCIOCFG
Used by
OC_CreateIOConfiguration,
OC_GetIOConfiguration, and
OC_DownloadIOConfiguration.
Configuration information for a
system. 1, 2, or 3 racks may be
configured for up to 30 I/O
modules. (Slot 0 is reserved for
the 1746 I/O PCI Interface.)
typedef struct tagOCIOCFG
{
BYTE
Rack1Size;
/* number of slots in Rack 1 */
BYTE
Rack2Size;
/* number of slots in Rack 2 */
BYTE
Rack3Size;
/* number of slots in Rack 3 */
OCSLOTCFGSlotCfg[OCMAXSLOT];/* configuration for each slot */
} OCIOCFG;