Addressing the I/O in the CPU and I/O modules
3.3
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 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
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, or 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.
You can also enter a constant value for many of the input parameters. The following table
describes the supported elementary data types including examples of constant entry. All
except String are available in the PLC tags editor and the block Interface editors. String is
available only in the block Interface editors. The following table defines the elementary data
types.
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02
When you add a CPU and I/O modules to your
configuration screen, I and Q addresses are
automatically assigned.
You can change the default addressing by
selecting the address field in the configuration
screen and typing new numbers. Digital inputs
and outputs are assigned in complete 8 bit bytes,
whether the module uses all the points or not.
Analog inputs and outputs are assigned in groups
of 2 points (4 bytes). In this example, you could
change the address of the DI16 to 2..3 instead of
8..9. The tool will assist you by changing address
ranges that are the wrong size or conflict with
other addresses.
The figure shows an example of a CPU 1214C
with two SMs.
PLC concepts
3.3 Data types
57