Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

ARRAY [*] OF in PLCopenXML

Flarup
2018-10-22
2018-10-26
  • Flarup - 2018-10-22

    I'm trying to generate a lot of methods to a function block. To do so, I exported a method as XML, and used that as a template to generate new methods.
    This works fine until I reached this type.

    METHOD DIntArray : INT
    VAR_INPUT
    Β name: STRING;
    END_VAR
    VAR_IN_OUT
    Β variable: ARRAY [*] OF DINT;
    END_VAR
    

    Importing the exported file unchanged gives me this.

    METHOD DIntArray : INT
    VAR_INPUT
    Β name: STRING;
    Β {attribute 'variable_length_array'}
    Β {attribute 'Dimensions' := '1'}
    Β variable: POINTER TO DINT;
    END_VAR
    

    As it can be seen, it is not possible to transfer and ARRAY [*] OF via the XML.
    Is this a limitation to PLCopenXML

    Will it be possible to use the "native" Export/Import to generate such methods. It is also some kind of ML language.

    Regards Kjeld Flarup

     
  • Stefan2 - 2018-10-26

    Hi Kjeld,

    you can use Pointer to * for an pointer to a array.

    Β  Β test:dint;
    variable: POINTER TO DINT;
    
    test := variable[5];
    

    I think it is yust beeing convertet.

    BR Stefan

     

    Related

    Talk.ru: 5


Log in to post a comment.