4 - using the api structures, Introduction, Api structures – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 53: Chapter 4, Using the api structures, Introduction -1 api structures -1, Chapter

Advertising
background image

1

Publication 1747-UM002A-US-P - June 2000

Chapter

4

Using the API Structures

Introduction

This chapter describes the structures the API uses. These structures are
declared in

ocapi.h

.

API Structures

The table below list 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;

Advertising
This manual is related to the following products: