Codesys ST CASE statement

damian177
2022-07-19
2022-07-19
  • damian177 - 2022-07-19

    Hi,

    Below I paste one of step CASE statement

        21:   (*check number phone sender'a*)  (*check if sms is not too old*)
            timestamp_hist_hi := time_sys.udiLocal_DateAndTime + timestamp_hist;
            timestamp_hist_lo := time_sys.udiLocal_DateAndTime - timestamp_hist;
    
            IF  (smsrec.sNumber = 'XXXXXXXXXXX' OR smsrec.sNumber = 'XXXXXXXXXXX')  AND
                (DT_TO_UDINT(smsrec.dtSend) > timestamp_hist_lo)                    AND
                (DT_TO_UDINT(smsrec.dtSend) < timestamp_hist_hi)                    THEN
                    iState:= 23;
            ELSE
                    iState:= 100;
            END_IF;
    

    Teh variable timestamp_hist equal 300sec.

    How it is possible that time to time the variables timestamp_hist_hi and timestamp_hist_lo are the same ?

     
  • TimvH

    TimvH - 2022-07-19

    When timestamp_hist = 0

     

Log in to post a comment.