assign input and output array in ECC Algorithm [message #1802599] |
Tue, 12 February 2019 14:44 |
Stefanus Yudi Messages: 15 Registered: November 2018 |
Junior Member |
|
|
Good Afternoon All
I try to make my own function block using basic.fbt, i do it well for basic data type such as int, real, and basic operator. But, when i try to use array of some data type, i have a problem on assigning it at the algoritm in ECC.
I can solve it by assigning one by one value array like this
ArOut[0] := 1;
ArOut[1] := 2;
ArOut[2] := 3;
ArOut[3] := 4;
ArOut[4] := 5;
But is there any way to assign it more simple, cause when i try this syntax
ArOut[] := [1,2,3,4,5];
it's always pop up some error in algoritm box.
I also attach my FB Interface and Algoritm Error picture here.
Best Regards
Stefanus Yudi Irwan
-
Attachment: Array.PNG
(Size: 5.81KB, Downloaded 212 times) -
Attachment: Error in ST.PNG
(Size: 18.56KB, Downloaded 220 times)
|
|
|
Re: assign input and output array in ECC Algorithm [message #1802612 is a reply to message #1802599] |
Tue, 12 February 2019 19:27 |
|
Hi,
I just did a second check in the IEC 61131-3 standard. Unfortunately there is no syntax defined for setting all values of an array (i.e., ArOut := [1,2,3,4,5]. The only exception is the initialization of variables. That means when variables of type array are created you can specify an array literal as you would like to do it. In all other cases you have to set each entry separately.
Alois
|
|
|
Powered by
FUDForum. Page generated in 0.02849 seconds