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

API Library of Routines
Appendix B
BPI_WRITE
B-9
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
Use the BPI_WRITE routine to allow the programmable controller
to perform a block-transfer read over the I/O backplane to the
control coprocessor.
It may accomplish a block-transfer read 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 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 read
to the control coprocessor is initiated. The function will then return to the
caller when either the block transfer or the timeout has occurred. This
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.
C Example
unsigned char
size=6;
/* size of block transfer */
short
outbuff[32];
/* location of copy data from */
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_WRITE*/
.
.
.
status = BPI_WRITE (size, outbuff, timeout, trg_mask);
.
.
.