Showing results 1 to 3 of 3

Thread: RDA Variables to Configure as REAL Datatype

  1. #1
    Join Date
    14.09.2017
    Posts
    20

    Default RDA Variables to Configure as REAL Datatype

    Hello,

    In one of project of ours we configured array as a DINT. Configured Timestamp in "Array[5]" as shown in attached image.

    But If we consider datatype of array as a REAL, how can we configure timestamp?
    Will you please suggest example of it.

    Regards,
    Rahul.
    Attached Thumbnails Attached Thumbnails DINT.png  

  2. #
    Join Date
    14.09.2017
    Posts
    20
    Best Answer

    Rotes Gesicht Re: AW: RDA Variables to Configure as REAL Datatype

    Quote Originally Posted by stefan_m View Post
    Hello,



    you can do something like this for RDA type 4



    Create a new Variable TempVar : ARRAY [0 .. 3] OF USINT ;



    Code:
    //RDA implementation with REAL// initialize Helper Array for 'SERIALIZEIN'
    TempVar[0] := 0;
    TempVar[1] := 0;
    TempVar[2] := 0;
    TempVar[3] := 0;
    
    
    // insert Header informations
    TempVar[0] := 15; // Number of Values
    SERIALIZEIN( TempVar, RDA_REAL[1], 0, 0 );
    TempVar[0] := 10; // Step for Timestamp
    SERIALIZEIN( TempVar, RDA_REAL[2], 0, 0 );
    TempVar[0] := 4; // RDA Typ
    SERIALIZEIN( TempVar, RDA_REAL[3], 0, 0 );
    
    
    TempVar[0] := 15; // Last value
    SERIALIZEIN( TempVar, RDA_REAL[4], 0, 0 );
    
    
    // Date Time
    TempVar[0] := Temp_RDA_TimeYear;
    TempVar[1] := Temp_RDA_TimeMonth;
    TempVar[2] := Temp_RDA_TimeDay;
    TempVar[3] := Temp_RDA_TimeHour;
    SERIALIZEIN( TempVar, RDA_REAL[5], 0, 0 );
    
    
    TempVar[0] := Temp_RDA_TimeMinute;
    TempVar[1] := Temp_RDA_TimeSec;
    TempVar[2] := Temp_RDA_TimeMiliSec;
    TempVar[3] := 0;
    SERIALIZEIN( TempVar, RDA_REAL[6], 0, 0 );
    
    
    RDA_REAL[7] := ANY_TO_REAL(Temp_RDA_Value01); // First Value
    RDA_REAL[8] := ANY_TO_REAL(Temp_RDA_Value02); // Value
    RDA_REAL[9] := ANY_TO_REAL(Temp_RDA_Value03); // Value
    RDA_REAL[10] := ANY_TO_REAL(Temp_RDA_Value04); // Value
    RDA_REAL[11] := ANY_TO_REAL(Temp_RDA_Value05); // Value
    RDA_REAL[12] := ANY_TO_REAL(Temp_RDA_Value06); // Value
    RDA_REAL[13] := ANY_TO_REAL(Temp_RDA_Value07); // Value
    RDA_REAL[14] := ANY_TO_REAL(Temp_RDA_Value08); // Value
    RDA_REAL[15] := ANY_TO_REAL(Temp_RDA_Value09); // Value
    RDA_REAL[16] := ANY_TO_REAL(Temp_RDA_Value10); // Value
    RDA_REAL[17] := ANY_TO_REAL(Temp_RDA_Value11); // Value
    RDA_REAL[18] := ANY_TO_REAL(Temp_RDA_Value12); // Value
    RDA_REAL[19] := ANY_TO_REAL(Temp_RDA_Value13); // Value
    RDA_REAL[20] := ANY_TO_REAL(Temp_RDA_Value14); // Value
    RDA_REAL[21] := ANY_TO_REAL(Temp_RDA_Value15); // Value
    RDA_REAL[22] := ANY_TO_REAL(Temp_RDA_Value16); // Value
    RDA_REAL[23] := ANY_TO_REAL(Temp_RDA_Value17); // Value


    Regards

    Thanks a lot it worked as per requirement.



  3. #2

    Default AW: RDA Variables to Configure as REAL Datatype

    Hello,

    you can do something like this for RDA type 4

    Create a new Variable TempVar : ARRAY [0 .. 3] OF USINT ;

    Code:
    //RDA implementation with REAL// initialize Helper Array for 'SERIALIZEIN'
    TempVar[0] := 0;
    TempVar[1] := 0;
    TempVar[2] := 0;
    TempVar[3] := 0;
    
    
    // insert Header informations
    TempVar[0] := 15; // Number of Values
    SERIALIZEIN( TempVar, RDA_REAL[1], 0, 0 );
    TempVar[0] := 10; // Step for Timestamp
    SERIALIZEIN( TempVar, RDA_REAL[2], 0, 0 );
    TempVar[0] := 4; // RDA Typ
    SERIALIZEIN( TempVar, RDA_REAL[3], 0, 0 );
    
    
    TempVar[0] := 15; // Last value
    SERIALIZEIN( TempVar, RDA_REAL[4], 0, 0 );
    
    
    // Date Time
    TempVar[0] := Temp_RDA_TimeYear;
    TempVar[1] := Temp_RDA_TimeMonth;
    TempVar[2] := Temp_RDA_TimeDay;
    TempVar[3] := Temp_RDA_TimeHour;
    SERIALIZEIN( TempVar, RDA_REAL[5], 0, 0 );
    
    
    TempVar[0] := Temp_RDA_TimeMinute;
    TempVar[1] := Temp_RDA_TimeSec;
    TempVar[2] := Temp_RDA_TimeMiliSec;
    TempVar[3] := 0;
    SERIALIZEIN( TempVar, RDA_REAL[6], 0, 0 );
    
    
    RDA_REAL[7] := ANY_TO_REAL(Temp_RDA_Value01); // First Value
    RDA_REAL[8] := ANY_TO_REAL(Temp_RDA_Value02); // Value
    RDA_REAL[9] := ANY_TO_REAL(Temp_RDA_Value03); // Value
    RDA_REAL[10] := ANY_TO_REAL(Temp_RDA_Value04); // Value
    RDA_REAL[11] := ANY_TO_REAL(Temp_RDA_Value05); // Value
    RDA_REAL[12] := ANY_TO_REAL(Temp_RDA_Value06); // Value
    RDA_REAL[13] := ANY_TO_REAL(Temp_RDA_Value07); // Value
    RDA_REAL[14] := ANY_TO_REAL(Temp_RDA_Value08); // Value
    RDA_REAL[15] := ANY_TO_REAL(Temp_RDA_Value09); // Value
    RDA_REAL[16] := ANY_TO_REAL(Temp_RDA_Value10); // Value
    RDA_REAL[17] := ANY_TO_REAL(Temp_RDA_Value11); // Value
    RDA_REAL[18] := ANY_TO_REAL(Temp_RDA_Value12); // Value
    RDA_REAL[19] := ANY_TO_REAL(Temp_RDA_Value13); // Value
    RDA_REAL[20] := ANY_TO_REAL(Temp_RDA_Value14); // Value
    RDA_REAL[21] := ANY_TO_REAL(Temp_RDA_Value15); // Value
    RDA_REAL[22] := ANY_TO_REAL(Temp_RDA_Value16); // Value
    RDA_REAL[23] := ANY_TO_REAL(Temp_RDA_Value17); // Value
    Regards
    Last edited by stefan_m : 17th August 2020 at 07:16

  4. #3
    Join Date
    14.09.2017
    Posts
    20
    Best Answer

    Rotes Gesicht Re: AW: RDA Variables to Configure as REAL Datatype

    Quote Originally Posted by stefan_m View Post
    Hello,



    you can do something like this for RDA type 4



    Create a new Variable TempVar : ARRAY [0 .. 3] OF USINT ;



    Code:
    //RDA implementation with REAL// initialize Helper Array for 'SERIALIZEIN'
    TempVar[0] := 0;
    TempVar[1] := 0;
    TempVar[2] := 0;
    TempVar[3] := 0;
    
    
    // insert Header informations
    TempVar[0] := 15; // Number of Values
    SERIALIZEIN( TempVar, RDA_REAL[1], 0, 0 );
    TempVar[0] := 10; // Step for Timestamp
    SERIALIZEIN( TempVar, RDA_REAL[2], 0, 0 );
    TempVar[0] := 4; // RDA Typ
    SERIALIZEIN( TempVar, RDA_REAL[3], 0, 0 );
    
    
    TempVar[0] := 15; // Last value
    SERIALIZEIN( TempVar, RDA_REAL[4], 0, 0 );
    
    
    // Date Time
    TempVar[0] := Temp_RDA_TimeYear;
    TempVar[1] := Temp_RDA_TimeMonth;
    TempVar[2] := Temp_RDA_TimeDay;
    TempVar[3] := Temp_RDA_TimeHour;
    SERIALIZEIN( TempVar, RDA_REAL[5], 0, 0 );
    
    
    TempVar[0] := Temp_RDA_TimeMinute;
    TempVar[1] := Temp_RDA_TimeSec;
    TempVar[2] := Temp_RDA_TimeMiliSec;
    TempVar[3] := 0;
    SERIALIZEIN( TempVar, RDA_REAL[6], 0, 0 );
    
    
    RDA_REAL[7] := ANY_TO_REAL(Temp_RDA_Value01); // First Value
    RDA_REAL[8] := ANY_TO_REAL(Temp_RDA_Value02); // Value
    RDA_REAL[9] := ANY_TO_REAL(Temp_RDA_Value03); // Value
    RDA_REAL[10] := ANY_TO_REAL(Temp_RDA_Value04); // Value
    RDA_REAL[11] := ANY_TO_REAL(Temp_RDA_Value05); // Value
    RDA_REAL[12] := ANY_TO_REAL(Temp_RDA_Value06); // Value
    RDA_REAL[13] := ANY_TO_REAL(Temp_RDA_Value07); // Value
    RDA_REAL[14] := ANY_TO_REAL(Temp_RDA_Value08); // Value
    RDA_REAL[15] := ANY_TO_REAL(Temp_RDA_Value09); // Value
    RDA_REAL[16] := ANY_TO_REAL(Temp_RDA_Value10); // Value
    RDA_REAL[17] := ANY_TO_REAL(Temp_RDA_Value11); // Value
    RDA_REAL[18] := ANY_TO_REAL(Temp_RDA_Value12); // Value
    RDA_REAL[19] := ANY_TO_REAL(Temp_RDA_Value13); // Value
    RDA_REAL[20] := ANY_TO_REAL(Temp_RDA_Value14); // Value
    RDA_REAL[21] := ANY_TO_REAL(Temp_RDA_Value15); // Value
    RDA_REAL[22] := ANY_TO_REAL(Temp_RDA_Value16); // Value
    RDA_REAL[23] := ANY_TO_REAL(Temp_RDA_Value17); // Value


    Regards

    Thanks a lot it worked as per requirement.



Similar Threads

  1. Full steps to configure HTML5
    By tridangminh in forum HTML5 Configuration
    Replies: 1
    Last Post: 20th October 2020, 07:15
  2. Configure 1756-ENBT with Zenon Logic
    By afz2004 in forum zenon Energy Edition
    Replies: 0
    Last Post: 24th February 2020, 10:27
  3. Configure 1756-ENBT with Zenon Logic
    By afz2004 in forum straton / zenon Logic
    Replies: 0
    Last Post: 24th February 2020, 10:27
  4. Program access to structure datatype variables
    By stolyarov_as in forum VBA
    Replies: 2
    Last Post: 8th August 2011, 14:21
  5. Read Real variables in VBA
    By joulz in forum VBA
    Replies: 4
    Last Post: 5th February 2009, 13:29

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •