Rockwell-automation Logix5000 Controllers ASCII Strings Programming Ma Bedienungsanleitung Seite 24

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 32
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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
Seitenansicht 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Kommentare zu diesen Handbüchern

Keine Kommentare