Nested Data Types definition

RollingPin
2009-08-23
2009-08-23
  • RollingPin - 2009-08-23

    I was looking at the possibility of creating nested data types in CoDeSys 2.3 (as in Simatic). Is this possible? Something like the below:

    TYPE Test :

    STRUCT

    Real1: REAL;
    
    Real2: REAL;
    
    RealSet: STRUCT
    
        Real3; REAL;
    
        Real4: REAL;
    
    END_STRUCT;
    

    END_STRUCT

    END_TYPE

     
  • Rolf-Geisler - 2009-08-23

    Hi,

    you can do this, but first you have to declare the "inner" type separately.

    TYPE TRealSet: STRUCT
    Real3; REAL;
    Real4: REAL;
    END_STRUCT
    END_TYPE
    

    This you can use now as follows:

    TYPE Test :
    STRUCT
    Real1: REAL;
    Real2: REAL;
    RealSet: TRealSet;
    END_STRUCT
    END_TYPE
    
     

Log in to post a comment.