Tag_read_w – Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 258

Advertising
background image

API Library of Routines

Appendix B

TAG_READ_W

B-127

Reads data from a user’s TAG memory area after the TAG is written
by TAG_WRITE_W.

C Syntax

#include <copro.h>

unsigned TAG_READ_W (tag,offset,size,buffer,timeout)

unsigned tag;
or

unsigned char *tag;
unsigned offset;
unsigned size;
unsigned *buffer;
unsigned timeout;

Parameters

tag

Use to access the TAG table. This can be either the symbolic TAG or
the handle returned from a TAG_LINK or TAG_DEFINE call.

offset

A byte offset from the start of the tagged area from which data will
be read.

size

Specifies the number of bytes to read from the tagged area.

buffer

Specifies the buffer to copy the data read from the tagged area.

timeout

Timeout value in seconds (valid range 0-16383). The function will
timeout unless the TAG can be read before the timeout expires. The
TAG may not be able to be read if another process has the TAG locked
or if the corresponding TAG_WRITE_W from another process has not
been issued. A value of CC_FOREVER (defined in COPRO.H) will
cause this function to wait indefinitely until the TAG can be read.

Returns

Value

Symbolic Name

Meaning

0

CC_SUCCESS

Operation successful

120

CC_E_BADID

TAG define ID out of range

131

CC_E_TOOBIG

Data item is greater than maximum allowed

160

CC_E_INV_TO

Invalidtimeout value

171

CC_E_TIME_LOCKED

Didnot complete in time, TAG locked

173

CC_E_TIME_NOWRITE

Didnot complete in time, TAG not written

176

CC_E_NOTAG

TAG not found

TAG_READ_W

Advertising