Chapter 3 Programming
3 – 21
3.6.5 Data types
HX-CODESYS supports below data types.
0 to 255 (16#00 to 16#FF)
0 to 65,535 (16#00 to 16#FFFF)
-2,147,483,648 to 2,147,483,647
0 to 4,294,967,295 (16#00 to 16#FFFFFFFF)
±1.175494351 E-38 to 3.402823466E+38
0 to 4,294,967,295 ms
Unit : ”d”: days, “h”: hours, “m”: minutes,
“s”: seconds, “ms”: milliseconds
Ex. T#100S12ms, t#0.1s
±1.7976931348623... E+308 to
2.2250738585072... E-308
Variable-length single-byte
character string
year-month-day
Ex. DATE#1996-05-06
d#1972-03-29
year-month-day-hour:minute:second
Ex. DATE_AND_TIME#1996-05-06-15:36:30
dt#1972-03-29-00:00:00
hour:minute:second
Ex. TIME_OF_DAY#15:36:30.123
tod#00:00:00
Unit :“us”: microseconds, “ns”: nanoseconds
Ex. LTIME#1000d15h23m12s34ms2us44ns
Variable-length double-byte
character string
Ex.
in variable declaration
test: ARRAY[0..100] OF WORD;
in user program
test[5]:=20;
If ARRAY type variables are used, several additional variables are used implicitly in the data memory.