KR20170093356A - Method for adjusting time information of real time clock device in programmable logic controller and the programmable logic controller - Google Patents
Method for adjusting time information of real time clock device in programmable logic controller and the programmable logic controller Download PDFInfo
- Publication number
- KR20170093356A KR20170093356A KR1020160014636A KR20160014636A KR20170093356A KR 20170093356 A KR20170093356 A KR 20170093356A KR 1020160014636 A KR1020160014636 A KR 1020160014636A KR 20160014636 A KR20160014636 A KR 20160014636A KR 20170093356 A KR20170093356 A KR 20170093356A
- Authority
- KR
- South Korea
- Prior art keywords
- error
- rtc
- clock
- time
- time information
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/10—Plc systems
- G05B2219/15—Plc structure of the system
- G05B2219/15063—Real time clock
Abstract
Description
The present invention relates to a time correction method of an RTC apparatus built in a PLC and a PLC thereof. More particularly, the present invention relates to a time correction method for an RTC apparatus built in a PLC, and more particularly to an RTC apparatus for counting a system clock, receiving an output timing signal, counting an RTC clock, A time correction method of the RTC device built in the PLC which receives the signal and calculates the error of the RTC clock by comparing the timing signal and the interrupt signal and corrects the time information in the RTC device based on the calculated error of the RTC clock, PLC.
PLC (Programmable Logic Controller) incorporates an RTC device that generates time information to control the current time or leave a work history. An RTC (Real-Time Clock) device is a device necessary for an electronic device using time information.
The RTC apparatus counts the RTC clock generated by the RTC clock oscillation element, and calculates and outputs time information on the counted RTC clock.
FIG. 1 is a view for explaining oscillation characteristics of a crystal used as an RTC oscillation element for each temperature. FIG.
Referring to FIG. 1, a crystal having an error range of 20 ppm at a frequency of 32,768 Hz and a room temperature (about 25 ° C) is used for an RTC oscillation element.
Accordingly, the RTC apparatus calculates the time information by converting 32,768 clocks into 1 second. Here, the time information may be composed of year, month, day, hour, minute, and second.
The temperature characteristic of the crystal is the smallest about 20ppm of the clock error at room temperature (about 25 ° C), and the clock error becomes larger as the temperature becomes lower and higher.
Crystals can cause product-specific errors in the PCB pattern design process in the manufacturing process. In addition, the crystal may experience additional errors depending on the capacitor and frequency matching designed on both ends. In this way, the oscillation frequency of the crystal used in the RTC device may vary from part to part due to various situations of the manufacturing process. However, the RTC apparatus is designed in consideration of outputting a clock of 32,768 Hz in a crystal used as an RTC oscillation element.
Therefore, if any crystal used as an RTC oscillator does not output a clock of 32,768 Hz and is a crystal outputting a clock of, for example, 32,766 Hz, the RTC is delayed as time elapses, do. Accordingly, the accuracy of the time information used in the PLC may be inferior.
SUMMARY OF THE INVENTION A problem to be solved by the present invention is to provide a time correction method of an RTC device incorporated in a PLC which can ensure stability of time information by appropriately responding to changes in the RTC clock output from a crystal used as an RTC oscillation element And its PLC.
The problems to be solved by the present invention are not limited to the above-mentioned problems, and other problems not mentioned can be clearly understood by those skilled in the art from the following description will be.
According to an aspect of the present invention, there is provided a method of controlling an RTC apparatus, the method comprising: receiving a timing signal output by counting a system clock; inputting an interrupt signal from an RTC apparatus for generating time information by counting an RTC clock; And correcting the time information in the RTC device based on the calculated error of the RTC clock is provided to the RTC device of the PLC .
The step of calculating the error of the RTC clock may include calculating an error time by comparing the timing signal and the interrupt signal, and calculating an error clock number based on the error time.
The step of correcting the time information in the RTC device may include storing the calculated error clock number in a clock error register for compensating for an error of the RTC clock, And correcting the time information.
The system clock is input from an oscillator, and the RTC clock can be input from a crystal.
According to another aspect of the present invention, there is provided an RTC apparatus including an RTC unit for counting an RTC clock to generate time information and outputting an interrupt signal, and an RTC unit for counting a system clock and comparing the output timing signal with the timing signal and the interrupt signal, There is provided a PLC equipped with a time correction function of an RTC device including an MPU for calculating an error of a clock and correcting the time information in the RTC device based on the calculated error of the RTC clock.
Wherein the MPU comprises: a system counter for counting the system clock and outputting a timing signal; a comparator for comparing the timing signal with the interrupt signal to calculate an error time of the RTC clock; And a clock error register for storing the number of error clocks so that the RTC device can correct the time information based on the calculated number of error clocks.
The RTC unit may correct the time information based on the stored number of error clocks.
The RTC apparatus may include a clock error register for storing the number of error clocks for correcting the time information. The MPU includes a system counter for counting the system clock and outputting a timing signal, And an error calculator for calculating the error clock count based on the error time and transmitting the calculated error clock count to the clock error register of the RTC apparatus.
According to the present invention, an interrupt signal is received from an RTC device that counts a system clock, receives an output timing signal, counts an RTC clock to generate time information, compares a timing signal with an interrupt signal, And corrects the time information in the RTC device based on the calculated error of the RTC clock. Thus, it is possible to cope with the change of the RTC clock output from the crystal used as the RTC oscillation device, thereby ensuring the stability of the time information .
FIG. 1 is a view for explaining oscillation characteristics of a crystal used as an RTC oscillation element for each temperature. FIG.
2 is a view for explaining a PLC having a time correction function of the RTC apparatus according to an embodiment of the present invention.
3 is a view for explaining a time correction method of an RTC apparatus built in a PLC according to an embodiment of the present invention.
4 is a view for explaining a PLC having a time correction function of the RTC apparatus according to another embodiment of the present invention.
5 is a view for explaining a time correction method of an RTC apparatus built in a PLC according to another embodiment of the present invention.
While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the invention is not intended to be limited to the particular embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.
Hereinafter, a preferred embodiment of the present invention will be described in detail with reference to the accompanying drawings.
2 is a view for explaining a PLC having a time correction function of the RTC apparatus according to an embodiment of the present invention.
2, the
The
On the other hand, the
The
The
The
The MPU 140 receives a system clock from the
That is, the MPU 140 receives an interrupt signal output from the
The MPU 140 may include a
The
The
The
For example, if an arbitrary error time occurs due to the fact that the frequency of the RTC clock output by the
The clock error register 144 stores the number of error clocks so that the
The
The
3 is a view for explaining a time correction method of an RTC apparatus built in a PLC according to an embodiment of the present invention.
Referring to FIG. 3, a system clock is generated by the oscillator 110 (S1). The system clock is input to the
On the other hand, an RTC clock is output from the crystal 120 (S4). The RTC clock is input to the
The timing signal and the interrupt signal are compared in the comparator 142 (S6). At this time, the timing signal input to the
The calculated error time is input to the
4 is a view for explaining a PLC having a time correction function of the RTC apparatus according to another embodiment of the present invention.
4, a
The
On the other hand, the
The
The
The
Meanwhile, the
The
That is, the
The
The system counter 241 counts a system clock input from the
The comparing
The
For example, if an arbitrary error time occurs due to the fact that the frequency of the RTC clock output by any
The number of error clocks calculated by the
The
5 is a view for explaining a time correction method of an RTC apparatus built in a PLC according to another embodiment of the present invention.
Referring to FIG. 5, a system clock is generated by the oscillator 210 (S21). The system clock is input to the
On the other hand, an RTC clock is output from the crystal 220 (S24). The RTC clock is input to the
The timing signal and the interrupt signal are compared in the comparator 242 (S26). At this time, the timing signal input to the
The calculated error time is input to the
While the invention has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined by the appended claims. Accordingly, the true scope of the present invention should be determined by the following claims.
Claims (8)
Receiving an interrupt signal from an RTC device that generates time information by counting an RTC clock;
Comparing the timing signal and the interrupt signal to calculate an error of the RTC clock; And
And correcting the time information in the RTC device based on the calculated error of the RTC clock.
Comparing the timing signal and the interrupt signal to calculate an error time; And
And calculating the number of error clocks based on the error time.
Storing the calculated number of error clocks in a clock error register for compensating an error of the RTC clock; And
And correcting the time information in the RTC device based on the stored number of error clocks.
A timer for counting a system clock to calculate an error of the RTC clock by comparing the output timing signal with the interrupt signal, and an MPU for correcting the time information in the RTC device based on the calculated error of the RTC clock, And a time correction function of the RTC device.
A system counter for counting the system clock and outputting a timing signal;
A comparing unit comparing the timing signal with the interrupt signal to calculate an error time of the RTC clock;
An error calculator for calculating the number of error clocks based on the error time; And
And a clock error register for storing the number of error clocks so that the RTC device can correct the time information based on the calculated number of error clocks.
Wherein the RTC device is provided with a time correction function of an RTC device for correcting time information based on the stored error clock number.
Wherein the RTC apparatus includes a clock error register for storing an error clock number for correcting time information,
The MPU includes:
A system counter for counting the system clock and outputting a timing signal;
A comparing unit comparing the timing signal with the interrupt signal to calculate an error time of the RTC clock;
And an error calculator for calculating the error clock number based on the error time and transmitting the calculated error clock number to the clock error register of the RTC device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020160014636A KR20170093356A (en) | 2016-02-05 | 2016-02-05 | Method for adjusting time information of real time clock device in programmable logic controller and the programmable logic controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020160014636A KR20170093356A (en) | 2016-02-05 | 2016-02-05 | Method for adjusting time information of real time clock device in programmable logic controller and the programmable logic controller |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20170093356A true KR20170093356A (en) | 2017-08-16 |
Family
ID=59752369
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020160014636A KR20170093356A (en) | 2016-02-05 | 2016-02-05 | Method for adjusting time information of real time clock device in programmable logic controller and the programmable logic controller |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20170093356A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20190050249A (en) * | 2017-11-02 | 2019-05-10 | 현대오트론 주식회사 | Real Time Clock Device and Method Thereof |
CN113346881A (en) * | 2021-05-27 | 2021-09-03 | 珠海东之尼电子科技有限公司 | Digital clock calibration method, wireless remote controller and storage medium |
-
2016
- 2016-02-05 KR KR1020160014636A patent/KR20170093356A/en unknown
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20190050249A (en) * | 2017-11-02 | 2019-05-10 | 현대오트론 주식회사 | Real Time Clock Device and Method Thereof |
CN113346881A (en) * | 2021-05-27 | 2021-09-03 | 珠海东之尼电子科技有限公司 | Digital clock calibration method, wireless remote controller and storage medium |
CN113346881B (en) * | 2021-05-27 | 2023-08-18 | 珠海东之尼电子科技有限公司 | Digital clock calibration method, wireless remote controller and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100687230B1 (en) | Real time clock apparatus and the real time compensating method thereof | |
JP2007078405A (en) | Timing program of software timepiece | |
US11874633B2 (en) | Method for adjusting the operating frequency of an electronic watch | |
CN110413042B (en) | Clock server, and time keeping frequency compensation method and device | |
KR20170093356A (en) | Method for adjusting time information of real time clock device in programmable logic controller and the programmable logic controller | |
EP3503690B1 (en) | Electronic device capable of adjusting light emitting frequency, computer system having the same and method for adjusting light emitting frequency of electronic device | |
US5719827A (en) | Highly stable frequency generator | |
JP5931152B2 (en) | Timing signal generator with temperature compensation function | |
JP2012047705A (en) | Time correction device and control method | |
JP5931151B2 (en) | Timing signal generator with temperature compensation function | |
CA2856377C (en) | Metrology timekeeping systems and methods | |
JP2017020852A (en) | Embedded device | |
JP2003270369A (en) | Time correction method and time correction device for real time clock | |
KR100819735B1 (en) | Computer system and control method thereof | |
US4730286A (en) | Circuit and method for correcting the rate of an electronic timepiece | |
JP2006329759A (en) | Monitoring control system | |
JP2010190585A (en) | Electronic clock device, electronic equipment including the same, and control system | |
JP2006047101A (en) | Timepiece precision correction device | |
JPWO2009040945A1 (en) | Monitoring device and program | |
JP7333705B2 (en) | circuit system | |
CN111694399B (en) | Method and device for adjusting display clock | |
JP2005140595A (en) | Radio controlled timepiece and time correcting method therefor | |
JP2011182099A (en) | Reference signal generation device and method | |
JP2017181055A (en) | Electronic timepiece of apparatus built-in type | |
JP2008151556A (en) | Method for correcting time in remote monitoring/controlling system |