Instructions

Table Of Contents
PLC-Grundlagen
5.4 Datentypen
S7-1200 Automatisierungssystem
Systemhandbuch, V4.2.3, 08/2018, A5E02486681-AL
143
Hinweis
Auf folgende Datentypen kann über Slices zugegriffen werden: Byte, Char, Conn_Any, Date,
DInt, DWord, Event_Any, Event_Att, Hw_Any, Hw_Device, HW_Interface, Hw_Io, Hw_Pwm,
Hw_SubModule, Int, OB_Any, OB_Att, OB_Cyclic, OB_Delay, OB_WHINT, OB_PCYCLE,
OB_STARTUP, OB_TIMEERROR, OB_Tod, Port, Rtm, SInt,
Time, Time_Of_Day, UDInt,
UInt, USInt und Word. Auf PLC
-Variablen vom Datentyp Real kann über Slices zugegriffen
werden, auf Datenbausteinvariablen vom Typ Real jedoch nicht.
Beispiele
In der PLC-Variablentabelle ist "DW" eine deklarierte Variable vom Typ DWORD. Die
Beispiele zeigen den Zugriff in Form von Bit-, Byte- und Wort-Slices:
KOP
FUP
SCL
Bitzugriff
IF "DW".x11 THEN
...
END_IF;
Bytezugriff
IF "DW".b2 = "DW".b3
THEN
...
END_IF;
Wortzugriff
out:= "DW".w0 AND
"DW".w1;