Chapter 3 Programming
3
– 21
3.6.5 Data types
HX-CODESYS supports below data types.
No.
Data types
Name
Size
Range
1
BOOL
Boolean
1
0 or 1
2
SINT
Short integer
8
-128 to 127
3
USINT
Unsigned short integer
8
0 to 255
4
BYTE
Bit string of length 8
8
0 to 255 (16#00 to 16#FF)
5
INT
Integer
16
-32,768 to 32,767
6
UINT
Unsigned integer
16
0 to 65,535
7
WORD
Bit string of length 16
16
0 to 65,535 (16#00 to 16#FFFF)
8
DINT
Double integer
32
-2,147,483,648 to 2,147,483,647
9
UDINT
Unsigned double integer
32
0 to 4,294,967,295
10
DWORD
Bit string of length 32
32
0 to 4,294,967,295 (16#00 to 16#FFFFFFFF)
11
REAL
Real numbers
32
±
1.175494351 E-38 to 3.40238
12
TIME
Duration
32
0 to 4,294,967,295 ms
Unit : ”d”: days, “h”: hours, “m”: minutes,
“s”: seconds, “ms”: milliseconds
Ex.
T#100S12ms, t#0.1s
13
LREAL
Long reals
64
±
1.7976931348623... E+308 to
2.2250738585072... E-308
14
STRING
Variable-length single-byte
character string
8
n
1 to 255 char.
15
LINT
Long integer
64
-2
63
~
2
63
-1
16
ULINT
Unsigned long integer
64
0 to 2
64
-1
17
LWORD
Bit string of length 64
64
0 to 2
64
-1
18
DATE
Date
32
year-month-day
Ex.
DATE#1996-05-06
d#1972-03-29
19
DATE_AND_TIME
Date and time of Day
32
year-month-day-hour:minute:second
Ex.
DATE_AND_TIME#1996-05-06-15:36:30
dt#1972-03-29-00:00:00
20
TIME_OF_DAY
Time of day
32
hour:minute:second
Ex.
TIME_OF_DAY#15:36:30.123
tod#00:00:00
21
LTIME
Long duration
64
Unit :“us”: microseconds, “ns”: nanoseconds
Ex.
LTIME#1000d15h23m12s34ms2us44ns
22
WSTRING
Variable-length double-byte
character string
16
n
23
ARRAY
Array
-
Ex.
in variable declaration
test: ARRAY[0..100] OF WORD;
in user program
test[5]:=20;
N o t e
If ARRAY type variables are used, several additional variables are used implicitly in the data memory.
Summary of Contents for EH-A14EDR
Page 6: ...MEMO ...
Page 10: ...MEMO ...
Page 141: ...Chapter 3 Programming 3 81 Program ...
Page 166: ...Chapter 5 Maintenance 5 4 MEMO ...
Page 170: ...Appendix A1 4 MEMO ...