Rockwell-automation Logix5000 Controllers ASCII Strings Programming Ma Manuale Utente Pagina 24

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 32
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 23
Chapter 2 Processing ASCII characters
Example: When bag_flt_and_dest is equal to gate[1], xfer[1] turns on. This routes the bag to the required gate.
You can convert the ASCII representation of a value to an DINT or REAL value
that you can use in your application.
The
STOD and STOR instructions skip any initial control or non-numeric
characters (except the minus sign in front of a number).
I
f the string contains multiple groups of numbers that are separated by
del
imiters (for example, / ), the STOD and STOR instructions convert only
the first group of numbers.
The following rung converts ASCII characters to a floating-point value:
Example:
After reading the weight from the scale (weight_read.EM is on), the STOR instruction converts the
numeric characters in weight_ascii to a REAL value and stores the result in weight.
The following rung converts ASCII characters to an integer value:
Example:
When MV_read.EM is on, the STOD instruction converts the first set of numeric characters in MV_msg to
an integer value. The instruction skips the initial control character ($06) and stops at the delimiter ( \ ).
Convert a value
24 Rockwell Automation Publication 1756-PM013D-EN-P - October 2014
Vedere la pagina 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Commenti su questo manuale

Nessun commento