Rockwell-automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User M Uživatelský manuál Strana 180

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 312
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 179
  &#"!
Appendix B

B-49
Gets a word from a byte array.
C Syntax
#include <copro.h>
short DTL_GET_WORD (in_buf)
unsigned char *in_buf;
Parameters
in_buf
Use to specify an array of two bytes containing programmable-
controller data.
Returns
Variable Value
% $
! "
% $ ! " $#  " &  " "% &"! "  %  "
&"!   !!# " $   " " "   #! "  #
Description
Use the DTL_GET_WORD function to extract two bytes from a byte array
in programmable-controller format (raw) and returns a word (short) value
in control-coprocessor format.
C Example
short word_val;
unsigned char untyped_data[50];
unsigned machine;
unsigned iostat;
.
.
.
DTL_C_DEFINE (&machine, “N7:0,25,RAW,READ”);
if (DTL_READ_W (machine, untyped_data, &iostat)==DTL_SUCCESS)
{
word_val = DTL_GET_WORD (&untyped_data[11]);
}
DTL_GET_WORD
Zobrazit stránku 179
1 2 ... 175 176 177 178 179 180 181 182 183 184 185 ... 311 312

Komentáře k této Příručce

Žádné komentáře