About the programme cycle time

Snow.Ma
2009-04-12
2009-04-13
  • Snow.Ma - 2009-04-12

    [b]

    I have write a very long programme, and the programme cycle time is be setted 10 ms. If in one cycle time how do I know if the programme has been dealed with, and if in one cycle time the plc can't computer all the instructions, what is result will be?
    
     
  • Rolf-Geisler - 2009-04-13

    Hi,

    in CoDeSys there is a very simple method to measure execution durations.

    FUNCTION TIME() returns the CPU time stamp. You can store it in a variable of TIME type, or as a DINT (TIME_TO_DINT converts to milliseconds). Later, after a second TIME() call, you can subtract the previous CPU time stamp.

    This way you could find the execution duration of your program. Then set task cycle to an appropriate value.

    Regards

     

Log in to post a comment.