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

Oscat Basic - Array sort function

sivan
2021-06-11
2021-06-25
  • sivan - 2021-06-11

    I have installed the Oscat basic lib version 3.3.4.0. can anyone guide me to sort the array element in ascending order?

    I called the _ARRAY_SORT function in my ST program but i dont' know how to get the sorted value in my program.

    The ST code is :

    PROGRAM SORT
    VAR
    Rawdata: ARRAY[0..3] OF REAL;
    END_VAR

    OSCAT_BASIC._ARRAY_SORT(PT:= ADR(Rawdata) , SIZE:= UINT#4 );

     
  • nothinrandom - 2021-06-25

    @sivan, If I remember correctly... it operates directly on your array, so it should be sorted already.

     

Log in to post a comment.