Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 267

Advertising
background image

API Library of Routines

Appendix B

TAG_WRITE_W

B-136

Description

Use TAG_WRITE_W to write data to a tagged memory area. This
function writes the data, then it waits until a corresponding
TAG_READ_W is posted. This function guarantees that the write data
area is semaphored during the write operation.

C Example

unsigned my_fred;

unsigned status;

my_fred = 42;

.

.

.

status = TAG_WRITE_W (“Fred”,0,sizeof(my_fred),&my_fred,30);

BASIC Example

The BASIC function code is 67.

DIM status : INTEGER

DIM tag_id : INTEGER

DIM w_data : INTEGER

.

.

.

rem * TAG_WRITE_W - write 4 bytes to a tag, starting at offset 0 from

rem * w_data with a timeout of 30 seconds. This function

rem * will return only after the tag has been read by

rem * TAG_READ_W or a timeout.

RUN AB_BAS (67,status,tag_id,0,4,ADDR(w_data),30)

.

.

.

References

TAG_LINK(); TAG_DEFINE(); TAG_UNDEF();
TAG_GLOBAL_UNDEF(); TAG_READ(); TAG_LOCK();
TAG_UNLOCK(); TAG_READ_W(); TAG_WRITE();

Advertising