beautypg.com

ProSoft Technology MVI56E-LDM User Manual

Page 117

background image

ControlLogix Platform ♦ "C" Programmable

CIP API Functions

Linux Application Development Module

Developer's Manual

ProSoft Technology, Inc.

Page 111 of 264

March 12, 2014

daType

Data type code (

OCX_CIP_DINT

, etc).

eleSize

Size of a single data element (DINT=4, BOOL=1, etc).

opType

OCX_CIP_TAG_READ_OP

or

OCX_CIP_TAG_WRITE_OP

.

numEle

Number of elements to read or write - must be 1 if not array

data

Pointer to read/write data buffer. Strings are expected to be
in

OCX_CIP_STRING82_TYPE

format. The size of the data is

assumed to be

numEle * eleSize

.

wrMask

Write data mask. Set to NULL to execute a non-masked
write. If a masked write is specified,

numEle

must be 1 and

the total amount of write data must be 8 bytes or less. Only
signed and unsigned integer types may be written with a
masked write. Only data bits with corresponding set

wrMask

bits will be written. If a

wrMask

is supplied, it is assumed to be

the same size as the write data (

eleSize * numEle)

.

result

Read/write operation result (output). Set to

OCX_SUCCESS

if

operation successful, else if failure. This value is not set if
the function return value is other than

OCX_SUCCESS

or

opType

is

OCX_CIP_TAG_NO_OP

.

Return Value

OCX_SUCCESS

operation was successful

else

An access error occurred. Individual access result parameters not
set.

Example

OCXHANDLE Handle;
OCXCIPTAGACCESS ta1;
OCXCIPTAGACCESS ta2;
OCXCIPTAGACCESS * pTa[2];
INT32 wrVal;
INT16 rdVal;
int rc;


ta1.tagName = "dintArr[2];
ta1.daType = OCX_CIP_DINT;
ta1.eleSize = 4;
ta1.opType = OCX_CIP_TAG_WRITE_OP;
ta1.numEle = 1;
ta1.data = (void*) &wrVal;
ta1.wrMask = NULL;
ta1.result = OCX_SUCCESS;
wrVal = 123456;
ta2.tagName = "intVal";
ta2.daType = OCX_CIP_INT;