Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 239

Advertising
background image

API Library of Routines

Appendix B

MSG_WRITE_HANDLER

B-108

BASIC Example

The BASIC function code is 43.

DIM status : INTEGER

DIM iostat : INTEGER

DIM msgwbuf(5) : INTEGER

.

.

.

rem * MSG_WRITE_W_HANDLER - Set up handler to allow for an asynchronous message

rem * write of msgwbuf. This function will return to the

rem * user befor completion of the I/O. MSG_WAIT must be

rem * called to complete the I/O process. Size of buffer

rem * is 20 bytes, message number is 0, umber of items

rem * to read is 5, the timeout value is 6 seconds, the

rem * coprocessor data type is integer, the plc data type

rem * is short and iostat gets the I/O completion code.

RUN AB_BAS (43,status,ADDR(msgwbuf(1)),20,1,5,6,5,3,ADDR(iostat))

.

.

.

References

MSG_READ_HANDLER(); MSG_WAIT(); MSG_CLR_MASK();
MSG_SET_MASK(); MSG_TST_MASK(); MSG_ZERO_MASK();

Also see synchronous functions:
MSG_WRITE_W_HANDLER(); MSG_READ_W_HANDLER();

Advertising