Returns, Description, C example – Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 137

Advertising
background image

API Library of Routines

Appendix B

BPI_READ

B-6

Returns

Status

Symbolic Name

Meaning

0

CC_SUCCESS

Operation successful

118

CC_E_TIME

I/O operation did not complete in time

160

CC_E_INV_TO

Invalid timeout value

164

CC_E_INV_BPI_MASK

Invalid valuefor BPI trigger mask

190

CC_E_SIZE

Invalid sizefor operation

Description

The BPI_READ routine allows the programmable controller to perform a
block-transfer write over the I/O backplane to the control coprocessor.

It may accomplish a block-transfer write with the control coprocessor by
allowing both a timeout and a trigger mask to be specified. The function
will first do a single transfer with the programmable controller using the
caller’s trigger mask. The function will then return to the caller when
either the block transfer or the timeout occurs. The function will return a
success or fail status. In the case of a fail status, the caller can check the
returned status value to find out why the function failed (i.e., transfer_size
> 64).

The programmable-controller ladder program can monitor the input image
for the control coprocessor to receive the trigger mask. If one of the
user-specified bits goes true, then a block-transfer write to the control
coprocessor can be initiated.

C Example

unsigned char

size=6;

/* size of block transfer */

short

inbuff[32];

/* user location to copy data to */

unsigned int

timeout=2;

/* user timeout in two seconds */

unsigned short

trg_mask=0x400; /* trigger mask, bit 12 (octal) is set */

int

status;

/* status value of BPI_READ */

.

.

.

status = BPI_READ (size, inbuff, timeout, trg_mask);

.

.

.

Advertising