PLC2U.com

...The latest article and sample code for your automation and control

  • Increase font size
  • Default font size
  • Decrease font size
Home Article PLC S7-200 Tips : How to Read and Write to the Real-Time Clock

S7-200 Tips : How to Read and Write to the Real-Time Clock

This program example deals with two special operations for the real-time clock: reading and writing the date and time of day. For these operations, the program needs an 8-byte buffer with the following structure:

Byte 0: Year  (00 - 99)Byte 4: Minute (00 - 59)
Byte 1: Month (1 - 12)Byte 5: Second (00 - 59)
Byte 2:Day (1 - 31)Byte 6: Not assigned
Byte 3:Hour (00 - 23)Byte 7: Day of week (1-7 = Su-Sa)

The data is stored in binary-coded decimal (BCD) format (for reading or writing). When you operate the switch at input I0.0, the preset date is written to the real-time clock. The switch at input I0.0 displays the current second value, which is copied to output byte QB0.  Use the switch at input I0.1 to select BCD format (I0.1 = 1) or binary format (I0.1 = 0).

The time-of-day clock in the S7-200 uses only the least significant two digits for the year, so for the year 2000, the year will be represented as 00. The S7-200 does not use the year information in any way and will not be affected by the century rollover (year 2000).

Program Flowchart :

 
 

Download Project Example :

 


Related articles:

Powered By relatedArticle

Blog Catalog

My BlogCatalog BlogRank

Blog Directory

Blog Directory & Search engine

Blog Directory

Technology

Visitors Counter

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday113
mod_vvisit_counterYesterday154
mod_vvisit_counterThis week479
mod_vvisit_counterLast week811
mod_vvisit_counterThis month969
mod_vvisit_counterLast month3010
mod_vvisit_counterAll days22700