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

Dinamic array as FB input

hki75
2013-07-08
2013-07-09
  • hki75 - 2013-07-08

    Is there some way to create a length-dynamic array in a FB?
    I need to declare as in/out parameter of a s FB a not-fixed size array and specify its length as a parameter

    ex:
    The only way I found to set in stand of array[0..31] the expression array[0..Variable] is suing constant, like this

    VAR CONSTANT
    Lenght: INT;
    END_VAR
    VAR_OUTPUT
    STEPS: ARRAY[0..Length] OF BOOL; ( Array of bit steps )
    END_VAR

    Lenght:= xx;

    but when try to assign "Length" get always error.. (constant variable cannot be assigned..)

    how to do it?

     
  • shooter - 2013-07-09

    no not possible the array can not be dynamic. in version 2

     

Log in to post a comment.