How to record timestamp in a variable?

open
2023-02-14
2023-02-20
  • open - 2023-02-14

    Hello,

    I am new to codesys programming,
    How to record timestamp and saved the value in a variable?
    I need to record start time and end time of a process.

    Warmest regards.

     
  • fraccaroli - 2023-02-14

    Hi,
    what device are you using? There could be manufacturer's libs that do it.

    As general advice I will use the classical way of embedded system: create a variable and count cycles (assuming that your process is in ciclic task).

    Another way could be to use the Task configuration > Monitor tab.

    Hi,
    Francesco

     
  • open - 2023-02-20

    Hi Francesco,

    Thank you for your reply,

    I used SysTimeRTC library to get the PLC time.
    I wrote a if function a boolean variable true then freeze the start time in a date_time variable.

    Warmest regards,

     

Log in to post a comment.