Creating Array of Reals
Hi Guys,
I want to create an Array of Reals as a global variable with fixed values. Let's say:
SampleArray : ARRAY[0..5] OF REAL :=[0.0,0.1,0.2,0.3,0.4,0.5];
but I am always getting an Error below:
What am I doing wrong ?
Regards,
Rafal
I want to create an Array of Reals as a global variable with fixed values. Let's say:
SampleArray : ARRAY[0..5] OF REAL :=[0.0,0.1,0.2,0.3,0.4,0.5];
but I am always getting an Error below:
What am I doing wrong ?
Regards,
Rafal
Voted best answer
Hi,
The right sintax of ARRAY with real initial values is the following:
VAR_GLOBAL
arr_real: ARRAY [0..5] OF REAL := 0.1,0.4,0.5,0.3,0.4,0.9;
END_VAR
You can also use declaration windows to define the array


The right sintax of ARRAY with real initial values is the following:
VAR_GLOBAL
arr_real: ARRAY [0..5] OF REAL := 0.1,0.4,0.5,0.3,0.4,0.9;
END_VAR
You can also use declaration windows to define the array
Add new comment