Rockwell-automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User M Manual de usuario Pagina 218

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 312
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 217

Appendix B
B-87
Invalid Definition Example
DTL_C_DEFINE (&idl, “N34:3”) /* not specified to element 0 */
DTL_C_DEFINE (&idl, “N34:0,3,long”) /* number of items not 1 */
C Example
unsigned machine;
unsigned short parts[10];
unsigned iostat;
DTL_C_DEFINE (&machine, “N20:0, 1, WORD, MODIFY”);
DTL_WRITE_W_IDX (machine, &parts[3], &iostat, 3) /* read element N20:3 */
DTL_WRITE_W_IDX (machine, &parts[8], &iostat, 8) /* read element N20:8 */
BASIC Example
The BASIC function code is 21.
procedure COPRO
DIM status : INTEGER
DIM id : INTEGER
DIM iostat : INTEGER
DIM val3 : INTEGER
DIM val8 : INTEGER
.
.
.
rem * Define the data file
RUN AB_BAS (2, status, ADDR(id), “N10:0, 1, LONG, MODIFY”)
rem * Write val3 to N10:3
RUN AB_BAS (21, status, id, ADDR(val3), ADDR(iostat), 3)
rem * Write val8 to N10:8
RUN AB_BAS (21, status, id, ADDR(val8), ADDR(iostat), 8)
.
.
.
References
DTL_C_DEFINE(); DTL_READ_W_IDX(); DTL_RMW_W_IDX();
Vista de pagina 217
1 2 ... 213 214 215 216 217 218 219 220 221 222 223 ... 311 312

Comentarios a estos manuales

Sin comentarios