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

Arithmetic block not working properly

arrvvii
2017-06-28
2017-06-29
  • arrvvii - 2017-06-28

    Hello guys,

    I'm new to codesys platform. I cannot use add block in LD, CFC and in ST. Output is enabled as you see in the pic, but the output coil is not energized and output value is not reflected. Please guide me.

    Thanks,
    Arrvvii

    IMG: add.JPG

     
  • r.evbatyrov - 2017-06-28

    Hello Arrvvii,

    most probably something in your code overwrites xEnHum to TRUE and then back to FALSE. The value of variables is obtained for monitoring and evaluation at different times. The ADD box is not executed, since at the moment of evaluation the xEnHum was FALSE. The output line just repeats the last known value of xEnHum.

    Make sure the HUM_PRG is called in every cycle (e.g. by setting a breakpoint during run).
    Try to deactivate other PRGs/Visualizations by excluding from build one after another to determine which one can produce that sideeffect.

    Regards
    Roman

     
  • josepmariarams - 2017-06-28

    Hi

    As Roman says it is possible that xEnHum be overwritted, but rOut could be overwited too.

    To test that insert an breakpoint on add block and see whats happens.

     
  • arrvvii - 2017-06-29

    Hi evbatyrov and Josep,

    I've not used any variables used in HUM_PRG anywhere else in the project. And I've tried this in a new project, with ADD block. Still I got the output. Then Checked task configuration. The type was chosen as 'External' automatically. I changed it to cyclic and interval as t#100ms. Checked the output. It worked fine.
    Check the Screenshot. Thank you very much.

    Thanks & Regards,
    Arrvvii

    IMG: add_2.JPG

    IMG: add_1.JPG

     

Log in to post a comment.