Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » assign input and output array in ECC Algorithm
assign input and output array in ECC Algorithm [message #1802599] Tue, 12 February 2019 14:44 Go to next message
Stefanus Yudi is currently offline Stefanus YudiFriend
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.

index.php/fa/34870/0/
index.php/fa/34871/0/

Best Regards

Stefanus Yudi Irwan
  • Attachment: Array.PNG
    (Size: 5.81KB, Downloaded 65 times)
  • Attachment: Error in ST.PNG
    (Size: 18.56KB, Downloaded 62 times)
Re: assign input and output array in ECC Algorithm [message #1802612 is a reply to message #1802599] Tue, 12 February 2019 19:27 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 907
Registered: January 2014
Senior Member
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
Previous Topic:Suuggestion for Human Machine Interface Software companion with 4DIAC
Next Topic:Building and Running 4diac IDE from Source
Goto Forum:
  


Current Time: Mon Nov 18 06:26:28 GMT 2019

Powered by FUDForum. Page generated in 0.01638 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top