Rockwell-automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User M Manual do Utilizador Página 255

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 312
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 254

Appendix B

B-124
C Example
unsigned name_id;
register int x; /* loop counter */
unsigned status; /* status return */
int Fred_ptr [12] /* pointer to Fred data area */
int buffer [12]; /* transfer buffer */
.
.
.
status - TAG_DEFINE (&name_id, Fred_ptr, “Fred”, 12 * sizeof (int),TG_MODIFY);
.
.
.
status = TAG_LOCK (“Fred”,30); /* lock TAG Fred */
if (status = CC_SUCCESS) exit (status); /* exit if wrong TAG */
for (x=0; x<12; ++x) *Fred_ptr = buffer [x]; /* transfer data to Fred*/
status = TAG_UNLOCK (“Fred”) ; /* unlock Fred */
.
.
.
/* the above example from TAG_LOCK to TAG_UNLOCK would be functionally
equivalent to the following */
status = TAG_WRITE (“Fred”, 0, 12 * sizeof (int), &buffer,30);
BASIC Example
The BASIC function code is 69.
DIM status : INTEGER
DIM tag_id : INTEGER
.
.
.
rem * TAG_LOCK - lock the tag specified by tag_id from concurrent access
rem * the timeout is 30 seconds.
RUN AB_BAS (69,status,tag_id,30)
.
.
.
References
TAG_LINK(); TAG_DEFINE(); TAG_UNDEF();
TAG_READ(); TAG_WRITE(); TAG_UNLOCK();
Vista de página 254
1 2 ... 250 251 252 253 254 255 256 257 258 259 260 ... 311 312

Comentários a estes Manuais

Sem comentários