Different types of values in the same array

esse
2015-11-24
2015-11-24
  • esse - 2015-11-24

    Hello, I want to make a 10x2 array but in each column I want to have different type of data .In the first column string type in the second bytes, is it possible to make something like that?Any ideas?

    Thanks

     
  • TimvH

    TimvH - 2015-11-24

    Create an array of structures.
    First define the structure (type DUT) with a string and a byte.
    Then declare a variable as an array of this structure.

     
  • esse - 2015-11-24

    Thanks for your reply, can you explain it a little more please...

     
  • TimvH

    TimvH - 2015-11-24

    First create the structure:

    Then create an array of this structure:

    You can get access to the items in the array in e.g. structured text as:

    astMyStruct[0].byByte := 10;
    astMyStruct[0].sString := 'Hello';
    

    IMG: ScreenShot1.jpg

    IMG: ScreenShot2.jpg

    IMG: ScreenShot3.jpg

     
  • esse - 2015-11-24

    Thank you I aprreciate it so much..it's a big help for me

     

Log in to post a comment.