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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 312
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 106


6-26
unsigned char pccc_rpl[275];
void main( int argc, char** argv ){
unsigned long iostat; /* function completion value */
unsigned long rpl_siz; /* size of pccc reply */
DTSA_BKPLN addr; /* structured address */
DTL_INIT( 1 ); /* Initialize the Data Table Library */
DTL_C_CONNECT( NI_ID, HOSTNAME, 0); /* Connect */
addr.atype = DTSA_TYP_BKPLN;
addr.ni_id = NI_ID;
rpl_siz = sizeof (pccc_rpl); /* size of response buffer */
DTL_PCCC_DIRECT_W ((DTSA_TYPE *) &addr, pccc_read, sizeof (pccc_read),
pccc_rpl, &rpl_siz, 0, 0, &iostat, 60000); /* do typed read */
display_tag(); /* show the result of the read */
rpl_siz = sizeof (pccc_rpl); /* size of response buffer */
DTL_PCCC_DIRECT_W ((DTSA_TYPE *) &addr, pccc_color, sizeof (pccc_color),
pccc_rpl, &rpl_siz, 0, 0, &iostat, 60000); /* typed write to color 0x99 */
rpl_siz = sizeof (pccc_rpl); /* size of response buffer */
DTL_PCCC_DIRECT_W ((DTSA_TYPE *) &addr, pccc_read, sizeof (pccc_read),
pccc_rpl, &rpl_siz, 0, 0, &iostat, 60000); /* do typed read */
display_tag(); /* show the result of the read - note color = 0x99*/
rpl_siz = sizeof (pccc_rpl); /* size of response buffer */
DTL_PCCC_DIRECT_W ((DTSA_TYPE *) &addr, pccc_col_year, sizeof (pccc_col_year),
pccc_rpl, &rpl_siz, 0, 0, &iostat, 60000); /* write to color and year */
rpl_siz = sizeof (pccc_rpl); /* size of response buffer */
DTL_PCCC_DIRECT_W ((DTSA_TYPE *) &addr, pccc_read, sizeof (pccc_read),
pccc_rpl, &rpl_siz, 0, 0, &iostat, 60000); /* do typed read */
display_tag(); /* show the result of the read - note color = 0x99 */}
display_tag (){
/* since the pccc ”byte stream” from the coprocessor might put unsigned
variables on uneven address boundries we move them to a temporary union
variable before storing them */
Vista de página 106
1 2 ... 102 103 104 105 106 107 108 109 110 111 112 ... 311 312

Comentários a estes Manuais

Sem comentários