IF not work

alverman
2017-10-06
2017-10-07
  • alverman - 2017-10-06

    Good morning,
    do you think this code does not produce a result in the vaiabile TapCucStat?

    This code is in ST and the TOF is in LD

    IF PLC_PRG.TOF_Open_Cucina.Q = TRUE AND PLC_PRG.TOF_Open_Cucina.ET = T#35S THEN
    Β  Β TapCucStat := 35;
    ELSE
    Β  Β TapCucStat := TIME_TO_INT(PLC_PRG.TOF_Open_Cucina.ET)/1000;
    END_IF
    

    I see the ET value of the TOF incremented but not assigned to the variable.
    Where am I wrong?

    Thank you, Alberto

     
  • teichhei - 2017-10-07

    I would say because your timer is counting in the background and you may be hitting the fb at a .ET value of 35.012s or 34.985s which both doesn't equal 35s. Or are you saying that it is never assigning any value? Is the ST in a function block or in another program?

    Sent from my SM-G935F using Tapatalk

     
  • josepmariarams - 2017-10-07

    May be possible that you aren t calling from anywhere tour st code?

     

Log in to post a comment.