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 codesys 2.39 > 3.5

camferti
2016-12-14
2016-12-27
  • camferti - 2016-12-14

    TYPE point :
    STRUCT
    x:INT;
    y:INT;
    END_STRUCT
    END_TYPE

    arrai:ARRAY[0..4] OF POINT:=((X:=0,Y:=0)),((X:=250,Y:=50)),(X:=500,Y:=150),(X:=750,Y:=400),(X:=1000,Y:=1000);

    This decalacion in codesys 2.3.9 works correctly and in codesys 3.5 sp9 pach 5 does not work
    you have any thoughts

                ------ Build started: Application: Device.Sim.Device.Application -------
                typify code ...
    

    [ERROR] charcurve: POU Device: L贸gica PLC: Application: C0006: Se esperaba ;' en lugar de ','
    [ERROR] charcurve: POU Device: L贸gica PLC: Application: C0006: Se esperaba )' en lugar de ','
    [ERROR] charcurve: POU Device: L贸gica PLC: Application: C0032: El tipo 'Tipo desconocido: 'X := 0'' no puede convertirse en el tipo 'ARRAY [0..4] OF POINT'
    [ERROR] charcurve: POU Device: L贸gica PLC: Application: C0046: Identificador 'X' sin definir
    [ERROR] charcurve: POU Device: L贸gica PLC: Application: C0018: 'X' no es un destino de asignaci贸n v谩lido
    [ERROR] charcurve: POU Device: L贸gica PLC: Application: C0201: El tipo 'ARRAY [0..4] OF POINT' no corresponde al tipo Typ 'ARRAY [0..10] OF POINT' de VAR_IN_OUT 'P'
    Compilaci贸n terminada -- 6 errores, 0 advertencias

     
  • wollvieh

    wollvieh - 2016-12-19

    Maybee wrong syntax ?
    it changed from codesys2.x to codesys3.x...
    (other brackets...)
    juhuuuu.

    Wollvieh.

    IMG: array.jpg

     
  • jessejamescox - 2016-12-19

    You have a syntax error. Need to use the [ ] and only a single set of () per intance.. like: arrai:ARRAY[0..4] OF POINT:=[(X:=0,Y:=0),(X:=250,Y:=50),(X:=500,Y:=150),(X:=750,Y:=400),(X:=1000,Y:=1000)];

     
  • camferti - 2016-12-27

    yes changed from codesys2.x to codesys3.x...

    in codesys2.x work properly

    wollvieh hat geschrieben:
    Maybee wrong syntax ?
    it changed from codesys2.x to codesys3.x...
    (other brackets...)
    juhuuuu.
    array.jpg
    Wollvieh.

     
  • camferti - 2016-12-27

    jessejamescox hat geschrieben:
    You have a syntax error. Need to use the [ ] and only a single set of () per intance.. like: arrai:ARRAY[0..4] OF POINT:=[(X:=0,Y:=0),(X:=250,Y:=50),(X:=500,Y:=150),(X:=750,Y:=400),(X:=1000,Y:=1000)];

    Thank you very much, that works

     

Log in to post a comment.