Data Structure Data Type; Plc Data Type - Siemens SIMATIC S7-1200 System Manual

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

Advertisement

5.4.7

Data structure data type

You can use the data type "Struct" to define a structure of data consisting of other data
types. The struct data type can be used to handle a group of related process data as a single
data unit. A Struct data type is named and the internal data structure declared in the data
block editor or a block interface editor.
Arrays and structures can also be assembled into a larger structure. A structure can be
nested up to eight levels deep. For example, you can create a structure of structures that
contain arrays.
5.4.8

PLC data type

The PLC data type editor lets you define data structures that you can use multiple times in
your program. You create a PLC data type by opening the "PLC data types" branch of the
project tree and double-clicking the "Add new data type" item. On the newly created PLC
data type item, use two single-clicks to rename the default name and double-click to open
the PLC data type editor.
You create a custom PLC data type structure using the same editing methods that are used
in the data block editor. Add new rows for any data types that are necessary to create the
data structure that you want.
If a new PLC data type is created, then the new PLC type name will appear in the data type
selector drop-down lists in the DB editor and code block interface editor.
You can potentially use PLC data types in the following ways:
● As a data type in a code block interface or in data blocks
● As a template for the creation of multiple global data blocks that use the same data
structure
● As a data type for PLC tag declarations the I and Q memory areas of the CPU
For example, a PLC data type could be a recipe for mixing colors. You can then assign this
PLC data type to multiple data blocks. You can adjust the variables within each data block to
create a specific color.
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
PLC concepts
5.4 Data types
133

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SIMATIC S7-1200 and is the answer not in the manual?

Table of Contents

Save PDF