Vai al contenuto

Elementary Data Types

A number of elementary (i.e. pre-defined) data types are made available by GF_ProjectVX code, all compliant with IEC 61131-3 standard.Elementary data types, keyword for each data type, number of bits per data element, and range of values for each elementary data type are described in the following table.
KeywordData typeBitRange
BOOLBooleanSee note0 to 1 size of the BOOLdata type depends on the target device processor.e.g. it is 1 bit long for devices that have a bit-addressable area.
SINTShort integer8-128 to 127
USINTUnsigned short integer80 to 255
INTInteger16-32768 to 32767
UINTUnsigned integer160 to 65535
DINTDouble integer32−2147483648to2147483647
UDINTUnsigned Double integer320 to 4294967295
LINTLong integer64−9223372036854775808to9223372036854775807
ULINTUnsigned Long integer640to18446744073709551615
BYTEBit string of length 88
WORDBit string of length 1616
DWORDBit string of length 3232
LWORDBit stirng of length 6464
REALReal number32-3.40E+38 to +3.40E+38
LREALLong Real Number64-1.7E+308 to +1.7E+308
STRINGString of characters encoded with UTF-8Characters are delimited by single quotes ( ‘abc’ )
WSTRINGString of characters encoded with UTF-16Characters are delimited by double quotes ( “abc” )
DATEDate expressed in seconds, represented with format YYYY-MM-DD321970-01-01to2038-01-19
LDATEDate expressed in nanoseconds,represented with format YYYY-MM-DD641970-01-01to2262-04-11
TIMETime expressed in milliseconds represented with format dd_hh_mm_ ss_ms3224d_20h_31m_23s_648msto24d_20h_31m_23s_647ms
LTIMETime expressed in nanoseconds represented with format dd_hh_mm_ ss_ms_us_ns64-106751d_23h_47m_16s_85 4ms_775us_808nsto 106751d_23h_47m_16s_854 ms_775us_807ns
DATE_AND_TIMEDate expressed in seconds, represented with format YYYY-MM- DD-hh:mm:ss321970-01-01-00:00:00to2038-01-19-03:14:07
LDATE_AND_TIMEDate expressed in nanoseconds,represented with format YYYY-MM-DD-hh:mm:ss. us641970-01-01-00:00:00to2262-04-11-23:47:16.854
TIME_OF_DAYTime of the day expressed in milliseconds, represented with format hh:mm:ss. ms3200:00:00to23:59:59.999
LTIME_OF_DAYTime of the day expressed in nanoseconds, represented with format hh:mm:ss.ns6400:00:00to23:59:59.999999999
^ANY_TYPEReferece to a variable of any type (IEC standard)32/64See 11.1.2.1 for further information
@ANY_TYPEPointer to a variable of any type (NOT IEC standard)32/64See 11.7.2 for futher information
PVOIDPointer to a generic variable, without type specified (NOT IEC standard)32/64See 11.7.2 for further information