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 ADR()

2017-12-12
2017-12-12
  • nothinrandom - 2017-12-12

    Hi All,

    I know that I can declare a variable that points to a data type. For example:
    TEST1: POINTER TO WORD:= ADR(%IW123);

    However, I can't create an array of that
    TEST2: POINTER TO ARRAY[1..2] OF WORD:= [ADR(%IW123), ADR(%IW321)];

    Is this legal or is the syntax incorrect? Either way, compiler is not happy at all.

    Thanks,

     
  • josepmariarams - 2017-12-12

    What do you want is

    Array [1..2] of pointer to word.

     
  • nothinrandom - 2017-12-12

    Josep M. Rams hat geschrieben:
    What do you want is
    Array [1..2] of pointer to word.

    That works. Thanks!

     
  • josepmariarams - 2017-12-12

    It s not the same a pointer to an array that an arry of pointers.

     

Log in to post a comment.