== TIA Datatypes == {{ :simatic:digi.png?100|TIA Portal datatypes}} {{anchor:tia_types}} List of data types used by Simatic S7. The page contains the more modern TIA variable types as well as the earlier S7-classic types.\\ \\ There are four data types in: Boolean, Text, Numeric, and Date/Time. Each data type defines the format of information that can be entered into a data field and stored in your database. \\ \\ |< 100% >| ^Datatyp^Width (bits)^Range of values^Examples^S7-300/400^S7-1200^S7-1500| ^**Binaries**||||||| |{{anchor:boolT}}BOOL (x) \\ [[#bool|→details]] |1 \\ (S7-1500 optimized \\ 1 Byte)|FALSE or TRUE \\ BOOL#0 or BOOL#1 \\ BOOL#FALSE oder BOOL#TRUE|TRUE \\ BOOL#1 \\ BOOL#TRUE|X|X|X| |{{anchor:byteT}}BYTE (b) \\ [[#byte|→details]] |8|B#16#00 .. B#16#FF \\ 0 .. 255 \\ 2#0 .. 2#11111111|15, \\ BYTE#15, \\ B#15|X|X|X| |{{anchor:wordT}}WORD (w) \\ [[#word|→details]]|16|W#16#0000 .. W#16#FFFF \\ 0 .. 65.535 \\ B#(0, 0) .. B#(255, 255) |55555,\\ WORD#55555,\\ W#555555|X|X|X| |{{anchor:dwordT}}DWORD (dw) \\ [[#dword|→details]]|32|DW#16#0000 0000 .. DW#16#FFFF FFFF \\ 0 .. 4,294,967,295|DW#16#DEAD BEEF \\ B#(111, 222, 255, 200)|X|X|X| |{{anchor:lwordT}}LWORD (lw) \\ [[#lword|→details]]|64|LW#16#0000 0000 0000 0000 .. \\ LW#16#FFFF FFFF FFFF FFFF \\ 0 .. 18.446.744.073.709.551.615|LW#16#DEAD BEEF DEAD BEEF \\ B#(111, 222, 255, 200, 111, 222, 255, 200)|-|-|X| ^Datatyp^Width (bits)^Range of values^Examples^S7-300/400^S7-1200^S7-1500| ^**Integers**||||||| |{{anchor:sintT}}SINT (si) \\ [[#sint|→details]]|8|-128 .. 127 \\ (hex only positive) 16#0 .. 16#7F|+42, SINT#+42 \\ 16#1A, SINT#16#2A|-|X|X| |{{anchor:intT}}INT (i) \\ [[#int|→details]]|16|-32.768 .. 32.767 \\ (hex only positive) 16#0 .. 16#7FFF |+1234, INT#+3221 \\ 16#1ABC|X|X|X| |{{anchor:dintT}}DINT (di) \\ [[#dint|→details]]|32|-2.147.483.648 .. +2.147.483.647 \\ (hex only positive) \\ 16#00000000 .. 16#7FFFFFFF|123456, DINT#123.456, \\ 16#1ABC BEEF|X|X|X| |{{anchor:usintT}}USINT (usi) \\ [[#usint|→details]]|8|0 .. 255 \\ 16#00 .. 16#FF|42, USINT#42 \\ 16#FF|-|X|X| |{{anchor:uintT}}UINT (ui) \\ [[#uint|→details]]|16|0 .. 65.535 \\ 16#0000 .. 16#FFFF|12.345, UINT#12345 \\ 16#BEEF|-|X|X| |{{anchor:udintT}}UDINT (udi) \\ [[#udint|→details]]|32|0 .. 4.294.967.295 \\ 16#00000000 .. 16#FFFF FFFF|1.234.567.890, UDINT#1234567890 |-|X|X| |{{anchor:lintT}}LINT (li) \\ [[#lint|→details]]|64|-9.223.372.036.854.775.808 .. +9.223.372.036.854.775.807|+1.234.567.890.123.456.789, LINT#+1.234.567.890.123.456.789|-|-|X| |{{anchor:ulintT}}ULINT (uli) \\ [[#ulint|→details]]|64|0 .. 18.446.744.073.709.551.615|123.456.789.012.345, ULINT#123.456.789.012.345|-|-|X| ^Datatyp^Width (bits)^Range of values^Examples^S7-300/400^S7-1200^S7-1500| ^**floating point numbers**||||||| |{{anchor:realT}} REAL (r) \\ [[#real|→details]]|32|-3.402823e+38 .. -1.175 495e-38 \\ .. \\ +1.175 495e-38 .. +3.402823e+38|0.0, REAL#0.0 \\ 1.0e-13, REAL#1.0e-13|X|X|X| |{{anchor:lrealT}} LREAL (lr) \\ [[#lreal|→details]]|64|-1.7976931348623158e+308 .. -2.2250738585072014e-308 \\ .. \\ +2.2250738585072014e-308 .. +1.7976931348623158e+308|0.0, LREAL#0.0|-|X|X| ^Datatyp^Width (bits)^Range of values^Examples^S7-300/400^S7-1200^S7-1500| ^**Times**||||||| |{{anchor:s5timeT}}S5TIME (s5t) \\ [[#s5time|→details]]|16|S5T#0H_0M_0S_0MS .. S5T#2H_46M_30S_0MS|S5T#10s, S5TIME#10s|X|-|X| |{{anchor:timeT}}TIME (t) \\ [[#time|→details]]|32|T#-24d20h31m23s648ms .. T#+24d20h31m23s647ms|T#13d14h15m16s630ms, TIME#1d2h3m4s5ms|X|X|X| |{{anchor:ltimeT}}LTIME (lt) \\ [[#ltime|→details]]|64|LT#-106751d23h47m16s854ms775us808ns .. LT#+106751d23h47m16s854ms775us807ns|LT#1000d10h15m24s130ms152us15ns, LTIME#200d2h2m1s8ms652us315ns|-|-|X| |**Timer operations:** **[[#iec_timer|IEC timers]]**, **[[#ton|TON]]** (Generate on-delay), **[[#tof|TOF]]** (Generate off-delay), **[[#tp|TP]]** (Generate pulse), **[[#tonr|TONR]]** (Time accumulator) ||||||| ^Datatyp^Width (bits)^Range of values^Examples^S7-300/400^S7-1200^S7-1500| ^**Counters**||||||| |{{anchor:charT}} CHAR \\ [[#char|→details]]|8|ASCII character set|'A', CHAR#'A'|X|X|X| |{{anchor:wcharT}}WCHAR (wc) \\ [[#wchar|→details]]|16|Unicode character set|WCHAR#'A'|-|X|X| |{{anchor:stringT}}STRING (s) \\ [[#string|→details]]|n+2 (Byte)|0 .. 254 characters (n)|'Name', STRING#'lamaPLC'|X|X|X| |{{anchor:wstringT}}WSTRING (ws) \\ [[#wstring|→details]]|n+2 (Word)|0 .. 16382 characters (n)|WSTRING#'lamaPLC'|-|X|X| |**Counter operations:** **[[simatic:scl_commands_timer_counter#ctu|CTU]]** (count up), **[[simatic:scl_commands_timer_counter#ctd|CTD]]** (count down), **[[simatic:scl_commands_timer_counter#ctud|CTUD]]** (count up and down) ||||||| ^Datatyp^Width (bits)^Range of values^Examples^S7-300/400^S7-1200^S7-1500| ^**Date & time**||||||| |{{anchor:dateT}}DATE (d) \\ [[#date|→details]]|16|D#1990-01-01 .. D#2168-12-31|D#2020-08-14, DATE#2020-08-14|X|X|X| |{{anchor:todT}}TOD (tod) \\ (TIME_OF_DAY) \\ [[#tod|→details]]|32|TOD#00:00:00.000 .. TOD#23:59:59.999|TOD#11:22:33.444, \\ TIME_OF_DAY#11:22:33.444|X|X|X| |{{anchor:ltodT}}LTOD (ltod) \\ (LTIME_OF_DAY) \\ [[#ltod|→details]]|64|LTOD#00:00:00.000000000 .. \\ LTOD#23:59:59.999999999|LTOD#11:22:33.444_555_111, \\ LTIME_OF_DAY#11:22:33.444_555_111|-|-|X| |{{anchor:dtT}}DT (dt) \\ (DATE_AND_TIME) \\ [[#dt|→details]]|64|Min.: DT#1990-01-01-0:0:0 \\ Max.: DT#2089-12-31-23:59:59.999|DT#2020-08-14-2:44:33.111, \\ {{anchor:date_and_time}}DATE_AND_TIME#2020-08-14-11:22:33.444|X|-|X| |{{anchor:ldtT}}LDT (ldt) \\ (L_DATE_AND_TIME) \\ [[#ldt|→details]]|64|Min.: LDT#1970-01-01-0:0:0.000000000, 16#0 \\ Max.: LDT#2262-04-11-23:47:16.854775807, \\ 16#7FFF_FFFF_FFFF_FFFF|LDT#2020-08-14-1:2:3.4|-|-|X| |{{anchor:dtlT}}DTL (dtl) \\ [[#dtl|→details]]|96|Min.: DTL#1970-01-01-00:00:00.0 \\ Max.: DTL#2554-12-31-23:59:59.999999999|DTL#2020-08-14-10:12:13.23|-|X|X| ^Datatyp^Width (bits)^Range of values^Examples^S7-300/400^S7-1200^S7-1500| ^**Pointers**||||||| |{{anchor:pointerT}}POINTER (p) \\ [[#pointer|→details]]|48||Symbolic: "DB"."Tag" \\ Absolute: \\ P#10.0 \\ P#DB4.DBX3.2|X|-|X| |{{anchor:anyT}}ANY (any) \\ [[#any|→details]]|80||Symbolic: \\ "DB".StructVariable.firstComponent \\ Absolut: P#DB11.DBX12.0 INT 3 \\ P#M20.0 BYTE 10|X|-|X| |{{anchor:variantT}}VARIANT (var) \\ [[#var|→details]]|0||Symbolic:\\ "Data_TIA_Portal".\\ StructVariable.firstComponent \\ Absolute: %MW10 \\ P#DB10.DBX10.0 INT 12|-|X|X| |{{anchor:block_fb}}BLOCK_FB|0||-|X|-|X| |{{anchor:block_fc}}BLOCK_FC|0||-|X|-|X| |{{anchor:block_db}}BLOCK_DB|0||-|X|-|-| |{{anchor:block_7sdb}}BLOCK_SDB|0||-|X|-|-| |{{anchor:void}}VOID|0||-|X|X|X| |{{anchor:plc_data_type}}PLC_DATA_TYPE|0||-|X|X|X|