Siemens SITRANS LR 300 Instruction Manual Page 89

  • Download
  • Add to my manuals
  • Print
  • Page
    / 140
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 88
7ML19985CL02 SITRANS LR 300– INSTRUCTION MANUAL Page 87
mmmmm
Communications
Communications: Data Types
The SITRANS LR 300 parameters do not always use integers to hold values. For the
convenience of the programmer, those values are converted to and from a 16-bit integer
number. This section describes the conversion process.
Numeric Values
Numeric parameter values are the most common. For example, parameter P920
(Reading) returns a number that represents the current reading (either level or volume,
depending on the IQ-300 configuration).
Numeric values are requested or set in units or percent of span, and may be specified
using a number of decimal places.
Numeric values must be in the range –20,000 to +20,000 to be valid. If a parameter is
requested and its value is more than +20,000, the number 32,767 is returned; if it is less
than –20,000, the number –32,768 is returned. If this overflow happens, decrease the
number of decimal places.
If a parameter cannot be expressed in terms of percent of span, or has no meaningful
value, the number 22,222 is returned. Try requesting the parameter in units, or refer to the
Parameter Description section on page 55 for an explanation of the format and use of the
requested parameter.
Split Values
Certain parameters are actually a pair of numbers separated by a colon, using this
format: xx:yy.
One example is P712 (Echo Lock Sampling) where:
xx = the number of above echoes
yy = the number of below echoes
The number which corresponds to xx:yy, for either reading or setting a parameter, is
determined by the following formula:
For storing to the device:
value = (xx + 128) x 256 + (yy + 128)
For reading from the device:
xx = (value / 256) – 128
yy = (value % 256) – 128
where % is the modulus operator.
The modulus can be computed by following these steps:
value
1
= value / 256
value
2
= remainder of value
1
value
3
= value
2
x 256
yy = value
3
– 128
It may simplify the calculation to note:
xx = (most significant byte of value) – 128
yy = (least significant byte of value) – 128
SITRANS LR 300.book Page 87 Monday, June 10, 2002 7:18 PM
Page view 88
1 2 ... 84 85 86 87 88 89 90 91 92 93 94 ... 139 140

Comments to this Manuals

No comments