Supported data types (in ST)

You can use the following data types for your application:

User-defined data types

A →user-defined data type is a →data type that you declared yourself. See:

Elementary data types

logi.CAD 3 supports the following elementary data types:

Data type (= →keyword)

Description

I: default →initial value

L: lower limit

U: upper limit

BOOL

Boolean

I: 0 or FALSE

L: 0 (corresponding to keyword FALSE)

U: as default initial value (I)

SINT

short integer

I: 0

L: -128 (1)

U: 127 (1)

INT

→integer

I: 0

L: -32_768 (1) (2)

U: 32_767 (1)

DINT

double integer

I: 0

L: -2_147_483_648 (1) (2)

U: 2_147_483_647 (1)

LINT

long integer

I: 0

L: -9_223_372_036_854_775_808 (1) (2)

U: 9_223_372_036_854_775_807 (1)

USINT

unsigned short integer

I: 0

L: as default initial value (I) (1)

U: 255 (1)

UINT

→unsigned integer

I: 0

L: as default initial value (I) (1)

U: 65_535 (1) (2)

UDINT

unsigned double integer

I: 0

L: as default initial value (I) (1)

U: 4_294_967_295 (1) (2)

ULINT

unsigned long integer

I: 0

L: as default initial value (I) (1)

U: 18_446_744_073_709_551_615 (1) (2)

REAL

real numbers (3)

I: 0.0

L: -3.402_823_466e+38 (1) (2) (4)

U: 3.402_823_466e+38 (1) (4)

Values within the range from -1.4e-45 to +1.4e-45 can not be processed by logi.CAD 3 (exception: 0.0 is processed). Such values result in an →underflow.

LREAL

→long reals (3)




I: 0.0

L: -1.797_693_134_862_315_7e+308 (1) (2) (4)

U: 1.797_693_134_862_315_7e+308 (1) (4)

Values within the range from -4.9e-324 to +4.9e-324 can not be processed by logi.CAD 3 (exception: 0.0 is processed). Such values result in an →underflow.

TIME

duration

I: T#0s

L: T#-89_468_321d19h42m34s400ms (2) (corresponds to -7730063005354.4s)

U: T#89_468_321d19h42m34s400ms (6) (corresponds to 7730063005354.4s)

DATE

date (only)

I: DATE#1970-01-01 (7)

L: as default initial value (I)

U: DATE#246_925-12-11 (6) (7)

TIME_OF_DAY or TOD

time of day (only)

I: TOD#00:00:00 (5)

L: as default initial value (I)

U: TOD#23:59:59.999_000_000 (2) (5) (6)

DATE_AND_TIME or DT

date and time of day

I: DT#1970-01-01-00:00:00.000_000_000 (2) (5) (7)

L: as default initial value (I)

U: DT#246_925-12-11-19:42:34.400 (5) (6) (7)

STRING

variable-length single-byte →character string

I: '' (emtpy)

no lower limit and no upper limit, because any character string is possible

CHAR

single-byte character

I: '$00' (corresponding to decimal value 0 in the ANSI C character set) (8)

L: as default initial value (I)

U: '$FF' (corresponding to ÿ character resp. decimal value 255 in the ANSI C character set ) (8)

BYTE

→bit string of length 8

I: 16#00

L: as default initial value (I) (1)

U: 16#FF (1)

WORD

bit string of length 16

I: 16#0000

L: as default initial value (I) (1)

U: 16#FFFF (1)

DWORD

bit string of length 32


I: 16#0000_0000 (2)

L: as default initial value (I) (1)

U: 16#FFFF_FFFF (1)

LWORD

bit string of length 64

I: 16#0000_0000_0000_0000 (2)

L: as default initial value (I) (1)

U: 16#FFFF_FFFF_FFFF_FFFF (1)

Notes:


(1) For this data type it is possible to assign the lower limit (L) or the upper limit (U) by using the terms MIN or MAX – see FAQ-article: "How to assign the minimum or maximum value of a data type?"

(2) The single underscore character _ is inserted as separator for values to make the values more readable, _ is not significant for the values. Values with _ are correctly interpreted by logi.CAD 3.

(3) Inaccuracies for floating-point numbers (affects the data types REAL and LREAL):

Due to the internal representation of floating-point numbers there might be inaccuracies when processing REAL and LREAL values. Such inaccuracies might cause unexpected results of operations when processing such values. This is also true for system blocks processing REAL and/or LREAL values.

(4) REAL-values are internally handled as "float values", LREAL-values as "double values".

The IEEE-float-format defines the representation as follows:

REAL

24-bit-mantissa
6 digits of the value are significant because of the 24-bit-mantissa for REAL-values. As the 7th digit usually effects the rounding value – but not always, 6 digits are of significance in any case.

LREAL

53-bit-mantissa
15 digits are significant because of the 53-bit-mantissa for LREAL-values.

In case of a →Controllino or an →Arduino Nano as PLC, avoid the usage of blocks/variables processing/returning LREAL. Details: see "Properties and restrictions specific to the target system".(5) Values for TIME_OF_DAY and DATE_AND_TIME are UTC times (UTC = coordinated universal time) – regardless of the target system that you are using. A list representing the time zones by countries (= deviation from UTC) can be found e.g. under http://en.wikipedia.org/wiki/List_of_time_zones_by_country (version of 29th July 2012). This list does not include the daylight saving time. Example: UTC+1 = local time Berlin (Germany, Paris (France), Rome (Italy) or Vienna (Austria). Hence, a UTC time of 13:52 corresponds to the local time 14:52 (standard time) for e.g. Berlin, Paris, Rome or Wien.

(6) The range of values and the precision of representation for TIME, DATE, TIME_OF_DAY und DATE_AND_TIME depends on the used →PLC. Hence, the named value for the upper limit is an approximate value. The actual upper limit for your application might differ from this value. See "Properties and restrictions specific to the target system".

(7) The lower limit for DATE or DATE_AND_TIME is valid for literals. Due to calculations or conversions, logi.CAD 3 is able to process and displays values down to DATE#0001-01-01 and DT#0001-01-01-00:00:00.000_000_000 respectively. Values < DATE#0001-01-01 and DT#0001-01-01-00:00:00.000_000_000 respectively are displayed in seconds in the format OVF(number), relative to DATE#1970-01-01 and DT#1970-01-01-00:00:00.000_000_000 respectively.

(8)Three-character combination of the dollar sign ($) followed by two hexadecimal digits are interpreted in logi.CAD 3 as the corresponding character of the ANSI C character set.

This enables you to enter special characters, such as umlauts, for single-byte character string. Currently, such special characters are displayed in logi.CAD 3 (e.g. in the der Values of Variable view) as they have been entered.
Here a selection of special characters (a list of special characters and the corresponding hexadecimal digits is listed under https://www.ascii-code.com/):

Decimal value

Hexadecimal digit

To enter

Special character

128

80

$80

163

A3

$A3

£

169

A9

$A9

©

174

AE

$AE

®

177

B1

$B1

±

178

B2

$B2

² (superscript "2")

179

B3

$B3

³ (superscript "3")

188

BC

$BC

¼

189

BD

$BD

½

190

BE

$BE

¾

196

C4

$C4

Ä

214

D6

$D6

Ö

220

DC

$DC

Ü

223

DF

$DF

ß

228

E4

$E4

ä

246

F6

$F6

ö

252

FC

$FC

ü

If the character combination '$00' is assigned to a single character of a STRING variable, the character string of the STRING variable is terminated at this position. Such character strings are terminated in case of $00 in the Values of Variables view as well.
However, the complete character string is copied in assignments. This makes it possible to have the Values of Variables view display single characters behind $00, if you access the assigned characters behind $00.

System data types

See "System data types for the application".