Working with pointers and problem with process image

Anonymous
2019-05-02
2019-05-10
  • Anonymous - 2019-05-02

    Originally created by: mh020519

    Hello,

    when I read inputs and write outputs only with pointers the CODESYS V3 compiler don't recognize that my program uses inputs/outputs.
    Then the PLC doesn't copy the process image to the outputs.

    In consequence, my program doesn't work.

    My solution:

    IF alwaysFalse THEN //never ever "true"
    %QB0:=%IB0; //this code is never executed
    %QB1:=%IB1;//this code is never executed
    %QB2:=%IB2;//this code is never executed
    %QB3:=%IB3;//this code is never executed
    END_IF

    My question: is there a possibility to tell the compiler what input/output I really use? Is there a setting?
    The best solution: the plc should sync the process image with the existing input/output modules.

    Best regards,

     
  • dFx

    dFx - 2019-05-03

    Just set your I/O as Always refreshed in a choosen bus task. By default, codesys uses the task where it's in use, but as you don't explicitly use them, it doesn't refresh them at all.

    see this post : https://forum.codesys.com/viewtopic.php?p=23811#p23811

     
  • Anonymous - 2019-05-10

    Originally created by: mh020519

    Thank you for the solution.

     

Log in to post a comment.