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

Page 264

Advertising
background image

API Library of Routines

Appendix B

TAG_WRITE

B-133

Writes data to a user’s TAG memory area.

C Syntax

#include <copro.h>

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

unsigned tag;
or
char *tag
unsigned offset;
unsigned size;
unsigned char *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 where data will
be written.

size

Specifies the number of bytes to write to the tagged area.

buffer

Specifies the buffer to copy the write data write to the tagged area.

timeout

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

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 size greater than the maximum allowed

160

CC_E_INV_TO

Invalid timeout value

171

CC_E_TIME_LOCKED

Did not complete in time, TAG locked

174

CC_E_TAGPEND

TAG write is already pending on this TAG

176

CC_E_NOTAG

TAG not found

178

CC_E_NOTLOCKER

Caller is not the locker of this TAG

189

CC_E_NOACCESS

TAG is READ only

TAG_WRITE

Advertising