Communications: Data Types; Numeric Values; Split Values - Siemens SITRANS LR 300 Instruction Manual

Iq radar 300
Hide thumbs Also See for SITRANS LR 300:
Table of Contents

Advertisement

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
value
value
yy = value
It may simplify the calculation to note:
xx = (most significant byte of value) – 128
yy = (least significant byte of value) – 128
7ML19985CL02
= value / 256
1
= remainder of value
2
= value
x 256
3
2
– 128
3
SITRANS LR 300– INSTRUCTION MANUAL
1
Page 87

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents