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.
Keyword | Data type | Bit | Range |
BOOL | Boolean | See note | 0 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. |
SINT | Short integer | 8 | -128 to 127 |
USINT | Unsigned short integer | 8 | 0 to 255 |
INT | Integer | 16 | -32768 to 32767 |
UINT | Unsigned integer | 16 | 0 to 65535 |
DINT | Double integer | 32 | −2147483648to2147483647 |
UDINT | Unsigned Double integer | 32 | 0 to 4294967295 |
LINT | Long integer | 64 | −9223372036854775808to9223372036854775807 |
ULINT | Unsigned Long integer | 64 | 0to18446744073709551615 |
BYTE | Bit string of length 8 | 8 | — |
WORD | Bit string of length 16 | 16 | — |
DWORD | Bit string of length 32 | 32 | — |
LWORD | Bit stirng of length 64 | 64 | — |
REAL | Real number | 32 | -3.40E+38 to +3.40E+38 |
LREAL | Long Real Number | 64 | -1.7E+308 to +1.7E+308 |
STRING | String of characters encoded with UTF-8 | — | Characters are delimited by single quotes ( ‘abc’ ) |
WSTRING | String of characters encoded with UTF-16 | — | Characters are delimited by double quotes ( “abc” ) |
DATE | Date expressed in seconds, represented with format YYYY-MM-DD | 32 | 1970-01-01to2038-01-19 |
LDATE | Date expressed in nanoseconds,represented with format YYYY-MM-DD | 64 | 1970-01-01to2262-04-11 |
TIME | Time expressed in milliseconds represented with format dd_hh_mm_ ss_ms | 32 | 24d_20h_31m_23s_648msto24d_20h_31m_23s_647ms |
LTIME | Time expressed in nanoseconds represented with format dd_hh_mm_ ss_ms_us_ns | 64 | -106751d_23h_47m_16s_85 4ms_775us_808nsto 106751d_23h_47m_16s_854 ms_775us_807ns |
DATE_AND_TIME | Date expressed in seconds, represented with format YYYY-MM- DD-hh:mm:ss | 32 | 1970-01-01-00:00:00to2038-01-19-03:14:07 |
LDATE_AND_TIME | Date expressed in nanoseconds,represented with format YYYY-MM-DD-hh:mm:ss. us | 64 | 1970-01-01-00:00:00to2262-04-11-23:47:16.854 |
TIME_OF_DAY | Time of the day expressed in milliseconds, represented with format hh:mm:ss. ms | 32 | 00:00:00to23:59:59.999 |
LTIME_OF_DAY | Time of the day expressed in nanoseconds, represented with format hh:mm:ss.ns | 64 | 00:00:00to23:59:59.999999999 |
^ANY_TYPE | Referece to a variable of any type (IEC standard) | 32/64 | See 11.1.2.1 for further information |
@ANY_TYPE | Pointer to a variable of any type (NOT IEC standard) | 32/64 | See 11.7.2 for futher information |
PVOID | Pointer to a generic variable, without type specified (NOT IEC standard) | 32/64 | See 11.7.2 for further information |