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:
-
"Declaration of a data type in ST" how to declare a data type.
-
"Integrating C-code and/or C++-code into the application (deprecated)" how to create data types in →C or →CPP and to use them in ST.
Elementary data types
Neuron Power Engineer supports the following elementary data types:
Data type (= →keyword) |
Description |
I: default →initial value L: lower limit U: upper limit |
---|---|---|
|
I: L: as default initial value (I) U: |
|
|
short integer |
I: L: U: |
|
I: U: |
|
|
double integer |
I: U: |
|
long integer |
I: L: U: |
|
unsigned short integer |
I: L: as default initial value (I) (1) U: |
|
I: L: as default initial value (I) (1) |
|
|
unsigned double integer |
I: L: as default initial value (I) (1) |
|
unsigned long integer |
I: L: as default initial value (I) (1) |
|
real numbers (3) real numbers (3)
|
I: L: Values within the range from |
|
→long reals (3)
|
I: L: U: Values within the range from |
|
duration |
I: L: U: |
|
date (only) |
I: L: as default initial value (I) |
|
time of day (only) |
I: L: as default initial value (I) |
|
date and time of day |
I: L: as default initial value (I) |
|
variable-length single-byte →character string |
I: no lower limit and no upper limit, because any character string is possible |
|
single-byte character |
I: L: as default initial value (I) U: |
|
→bit string of length 8 |
I: L: as default initial value (I) (1) U: |
|
bit string of length 16 |
I: L: as default initial value (I) (1) U: |
|
bit string of length 32 |
I: L: as default initial value (I) (1) U: |
|
bit string of length 64 |
I: L: as default initial value (I) (1) U: |
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 Neuron Power Engineer.
(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 |
(4) REAL
-values are internally handled as "float values", LREAL
-values as "double values".
The IEEE-float-format defines the representation as follows:
|
24-bit-mantissa |
|
53-bit-mantissa |
In case of a →Controllino or an →Arduino Nano as PLC, avoid the usage of blocks/variables processing/returning LREAL
.
(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.
(7) The lower limit for DATE
or DATE_AND_TIME
is valid for literals. Due to calculations or conversions, Neuron Power Engineer 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 Neuron Power Engineer 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 Neuron Power Engineer (e.g. in the 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 . |