Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual
Page 259

API Library of Routines
Appendix B
TAG_READ_W
B-128
Description
Use the TAG_READ_W function to read data from a tagged memory area.
This function waits until a corresponding TAG_WRITE_W function is
posted. More than one TAG_READ_W can be pending on a single
TAG_WRITE_W. This function guarantees that the read data area is
semaphored during the read operation.
C Example
unsigned my_fred;
unsigned status;
.
.
.
status = TAG_READ_W (“Fred”,0,sizeof(my_fred),&my_fred,30);
BASIC Example
The BASIC function code is 65.
DIM status : INTEGER
DIM tag_id : INTEGER
DIM my_data : INTEGER
.
.
.
rem * TAG_READ_W - read 4 bytes from a tag, starting at offset 0 into
rem * my_data with a timeout of 30 seconds. The read will
rem * not proceed until the specified tag has been written
rem * to by TAG_WRITE_W.
RUN AB_BAS (65,status,tag_id,0,4,ADDR(my_data),30)
.
.
.
References
TAG_LINK(); TAG_DEFINE(); TAG_UNDEF();
TAG_GLOBAL_UNDEF(); TAG_WRITE(); TAG_LOCK();
TAG_UNLOCK(); TAG_READ(); TAG_WRITE_W();