Siemens 6AV6651-7KA01-3AA4 - S7-1200 + KTP400 Basic Starter Kit 6AV6651-7KA01-3AA4 用户手册

产品代码
6AV6651-7KA01-3AA4
下载
页码 364
 
PLC concepts made easy 
 
4.4 Memory areas, addressing and data types 
Easy Book 
Manual, 03/2014, A5E02486774-AF 
65
 
 
 
 
Note 
Valid data types that can be accessed by slice are 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, and Word. PLC Tags of type Real can be accessed by slice, but data block tags 
of type Real cannot. 
 
Examples 
In the PLC tag table, "DW" is a declared tag of type DWORD. The examples show bit, byte, 
and word slice access: 
 
 
LAD 
FBD 
SCL 
Bit access 
 
 
IF "DW".x11 THEN 
... 
END_IF; 
Byte access 
 
 
IF "DW".b2 = "DW".b3 
THEN 
... 
END_IF; 
Word access 
 
 
out:= "DW".w0 AND 
"DW".w1; 
4.4.4 
Accessing a tag with an AT overlay 
The AT tag overlay allows you to access an already-declared tag of a standard access block 
with an overlaid declaration of a different data type. You can, for example, address the 
individual bits of a tag of a Byte, Word, or DWord data type with an Array of Bool.