Processing Of Analog Values; Data Types - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

PLC concepts

4.3 Processing of analog values

4.3
Processing of analog values
Analog signal modules provide input signals or expect output values that represent either a
voltage range or a current range. These ranges are ±10 V, ±5 V, ±2.5 V, or 0 - 20 mA. The
values returned by the modules are integer values where 0 to 27648 represents the rated
range for current, and -27648 to 27648 for voltage. Anything outside the range represents
either an overflow or underflow. See the tables for analog input representation (Page 916)
and analog output representation (Page 917) for details.
In your control program, you probably need to use these values in engineering units, for
example to represent a volume, temperature, weight or other quantitative value. To do this
for an analog input, you must first normalize the analog value to a real (floating point) value
from 0.0 to 1.0. Then you must scale it to the minimum and maximum values of the
engineering units that it represents. For values that are in engineering units that you need to
convert to an analog output value, you first normalize the value in engineering units to a
value between 0.0 and 1.0, and then scale it between 0 and 27648 or -27648 to 27648,
depending on the range of the analog module. STEP 7 provides the NORM_X and SCALE_X
instructions (Page 251) for this purpose. You can also use the CALCULATE instruction
(Page 229) to scale the analog values (Page 39).
4.4

Data types

Data types are used to specify both the size of a data element as well as how the data are to
be interpreted. Each instruction parameter supports at least one data type, and some
parameters support multiple data types. Hold the cursor over the parameter field of an
instruction to see which data types are supported for a given parameter.
A formal parameter is the identifier on an instruction that marks the location of data to be
used by that instruction (example: the IN1 input of an ADD instruction). An actual parameter
is the memory location (preceded by a "%" character) or constant containing the data to be
used by the instruction (example %MD400 "Number_of_Widgets"). The data type of the
actual parameter specified by you must match one of the supported data types of the formal
parameter specified by the instruction.
When specifying an actual parameter, you must specify either a tag (symbol) or an absolute
(direct) memory address. Tags associate a symbolic name (tag name) with a data type,
memory area, memory offset, and comment, and can be created either in the PLC tags
editor or in the Interface editor for a block (OB, FC, FB and DB). If you enter an absolute
address that has no associated tag, you must use an appropriate size that matches a
supported data type, and a default tag will be created upon entry.
All data types except String, Struct, Array, and DTL are available in the PLC tags editor and
the block Interface editors. String, Struct, Array, and DTL are available only in the block
Interface editors. You can also enter a constant value for many of the input parameters.
● Bit and Bit sequences (Page 111): Bool (Boolean or bit value), Byte (8-bit byte value),
Word (16-bit value), DWord (32-bit double-word value)
● Integer (Page 112)
– USInt (unsigned 8-bit integer), SInt (signed 8-bit integer),
– UInt (unsigned 16-bit integer), Int (signed 16-bit integer)
– UDInt (unsigned 32-bit integer), DInt (signed 32-bit integer)
110
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG

Advertisement

Table of Contents
loading

Table of Contents