Read RTC on S7-200 SMART PLC – This article, 365EVN shows you the steps to read and set the Real-Time Clock RTC from an S7-200 SMART PLC. You can use these values to control your application or show it on HMI.
Read RTC S7 200 Smart PLC Instruction
To get the value of Real-Time Clock RTC on S7-200 SMART PLC, we use the instruction “READ_RTC”. The instruction reads the current time and date from the S7 200 SMART CPU and loads it in an 8 bytes Time buffer starting at byte address T. And all date and time values in BCD format. Format of 8 bytes time buffer, beginning at byte address T as below:
To read RTC S7 200 Smart PLC and show the RTC values from S7 200 SMART CPU we follow the steps:
Read RTC from S7-200 Smart PLC using the instruction READ_RTC
Move the values in the byte to word (BCD format)
Convert the values from BCD format to Integer format.
Read RTC from S7-200 Smart PLC use READ_RTC
- Create the symbol with the PLC address to save the RTC values, the data type is byte at the symbol table. Example: year value: VB100, month value: VB101 … Day of week value: VB107
- On the project tree click “Instruction” -> “Clock” -> drag and drop the “READ_RTC” instruction to the program. At the “T” position we put the year value address created above (VB100).
Move the S7 200 Smart RTC values in byte to word (BCD format)
Create the symbol with PLC address to save the RTC values, data type is the word at the variable table.
On the project tree click “Instruction” -> “Convert” -> drag and drop “B_I” instruction to the program (or you can press F9 and then select the instruction). Put the value in byte to “IN” and the value in word to “OUT”.
Convert the RTC values from BCD format to Integer format.
- Create the symbol with the PLC address to save the RTC values, data type is INT at the symbol table. Example: year value: VW110, month value: VW112 … Day of week value: VW122
- On the project tree click “Instruction” -> “Convert” -> drag and drop the “BCD_I” instruction to the program (or you can press F9 and then select the instruction). Put the value in the word (above step) to “IN” and the value in INT to “OUT”.
- Now, you can use these values to control your application or shows it on the HMI.
Guide video to READ RTC S7 200 Smart PLC
If you can not watch the video above, please check another link in my Video Area (V0078) or give feedback to me via WhatsApp, Email, or Message. Thank you!
Guide video to SET RTC S7 200 Smart PLC
If you can not watch the video above, please check another link in my Video Area (V0079) or give feedback to me via WhatsApp, Email, or Message. Thank you!
Link Download Step7 MicroWIN SMART
- Step 7 MicroWIN SMART Software newest: Link
- All guide videos about PLC HMI, VFD and Servo programming by 365evn (Video area): Link
Summary
Above we guided the steps to get and show Real-Time Clock PLC – RTC values from an S7-200 SMART PLC by using READ RTC S7 200 Smart Instruction on Step 7 MicroWIN Smart software. In the next article, we will guide you to SET RTC S7-200 SMART PLC (You can watch the guide here).
-365evn, refer Siemens–
If you find this content valuable, please rate it (click the button above), share it with your friends or invite me for a coffee by clicking the button below.