Real time clock in Siemens PLC
Many times we have to enable the instructions at a particular time. For that, we have to read the real time clock value in PLC. The siemens plc have inbuilt instructions or blocks which can read the real time clock value from the PLC hardware.
There is a system function block in S7 300/400 series CPU, which can read the real time clock value from the PLC hardware.
This block has two output values, one in which returns the error value while executing if there will be an error with the instructions and the other will be the real time clock value in Date_And_Time format.
We have prepared a shared DB to store all the values of the current date, current day, and current time as shown in the below figure.
⇒ The value of the current date will be saved in the DATE format.
⇒ The value of the current day will be saved in the INT format.
⇒ The value of the current time will be saved in the TIME_OF_DAY format.
We need to extract all these values of the real time clock such as current date, current weekday, and current time from the RTC which is in the DATE_AND_TIME format.
The S7300/400 series CPU has some inbuilt instructions which can extract the date, day, and time value from the RTC value.
These instructions are as shown below figure.
After executing all these instructions we are getting the output as shown below figure.
Summary
I hope you like this blog about how to read rtc clock values in the siemens plc. You must like the below-mentioned PLC programming-related articles.
⇒ Basics of bit logic instructions.
⇒ Most popular PLC programming languages.
⇒ Arithmetic instructions in PLC programming.
⇒ Basics of PLC Timer instructions.
⇒ Basics of PLC Counter instructions.
⇒ Siemens PLC programming blocks.
⇒ Most used PLC communication protocols.
⇒ Most important PLC interview questions.
You can read more articles about Electrical and you can also find books that boost your knowledge in the field of Instrumentation ⇒
Thanks for Reading!