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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 312
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 196

Appendix B

B-66
Description
Use the DTL_READ_W function to read data from a PLC-5
programmable controller that is directly connected to the
control coprocessor.
This function is synchronous. When this function is initiated, your
C application programs stops until the function completes or fails.
C Example
unsigned status;
unsigned machine1;
unsigned short parts1 [10];
unsigned iostat;
DTL_C_DEFINE (&machine1, “N20:36, 10, WORD, READ”);
status = DTL_READ_W (machine1, &parts1, &iostat)
if (status == DTL_SUCCESS)
{
printf (“parts = %d\n”, parts1 [0]);
}
else
{
(printf (“error %d, %d on read of parts data\n”,
status,
iostat);
}
BASIC Example
The BASIC function code is 5.
procedure COPRO
DIM status : INTEGER
DIM fred : INTEGER
DIM rcvbuff(10) : INTEGER
DIM iostat : INTEGER
.
.
.
rem * DTL_READ_W - Read from N10:2 10 words into rcvbuff
RUN AB_BAS (5, status, fred, ADDR(rcvbuff), ADDR(iostat))
.
.
.
References
DTL_C_DEFINE(); DTL_WRITE_W();
Vista de pagina 196
1 2 ... 192 193 194 195 196 197 198 199 200 201 202 ... 311 312

Comentarios a estos manuales

Sin comentarios