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,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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,
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
Originally created by: mh020519
Thank you for the solution.