Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 224

Advertising
background image

API Library of Routines

Appendix B

MSG_READ_HANDLER

B-93

BASIC Example

The BASIC function code is 41.

DIM status : INTEGER

DIM iostat : INTEGER

DIM msgrbuf(5) : INTEGER

.

.

.

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

rem * read of msgrbuf. This function will return to the

rem * user before 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, number of items to

rem * 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 (41,status,ADDR(msgrbuf(1)),20,0,5,6,5,3,ADDR(iostat))

.

.

.

References

MSG_WRITE_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