Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Two dimensional arrays for Function Block data or internal vars
Two dimensional arrays for Function Block data or internal vars [message #1760857] Wed, 03 May 2017 16:33 Go to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 65
Registered: April 2017
Member
Hello.

I am attempting to create a two-dimensional array as an internal variable of a basic function block.
The column, "Array Size" lets me input a number. However, this seems to only let me create one-dimensional arrays. In ST, a 2D array with the dimensions 10x10 would be defined with the syntax

ARRAY[1..10,1..10]


I have tried inserting the [1..N,1..M] syntax and others into the "Array Size" cell, but I have not been able to get it to accept my input.
Is there a special syntax for 4diac or am I missing something else? Or is it currently not possible to declare arrays in the GUI?

Thanks in advance for any help!
Re: Two dimensional arrays for Function Block data or internal vars [message #1760933 is a reply to message #1760857] Thu, 04 May 2017 12:32 Go to previous messageGo to next message
Monika Wenger is currently offline Monika WengerFriend
Messages: 17
Registered: September 2015
Junior Member
currently Arrays are all started from 0. since all Basic function blocks Need to be exported to forte, the exporter has to Support this, which is currently only the case for a one dimensional Array. also the ST Editor currently does not provide Support for the use of Multi dimensional Arrays.
Re: Two dimensional arrays for Function Block data or internal vars [message #1760967 is a reply to message #1760933] Thu, 04 May 2017 16:35 Go to previous messageGo to next message
Marc Jakobi is currently offline Marc JakobiFriend
Messages: 65
Registered: April 2017
Member
Ah, thanks for the information. I guess I will have to work with extra long 1D-arrays then Smile
Re: Two dimensional arrays for Function Block data or internal vars [message #1760979 is a reply to message #1760967] Thu, 04 May 2017 20:33 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 454
Registered: January 2014
Senior Member
This will currently definitely be the quickest way. There would be some work around how to create two dimensional arrays. You have to create your own array datatype and use this data type in your internal variable and then specify the array size. The only problem is that you have to manually write the C++ code for the array datatype. Which I've never done so far Sad. But it should be similar to implementing structs.

[Updated on: Thu, 04 May 2017 20:34]

Report message to a moderator

Previous Topic:mqtt on raspberry pi
Next Topic:Problem:NULL error during deploying
Goto Forum:
  


Current Time: Fri Feb 23 02:28:09 GMT 2018

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

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