JP2000019275A - Time data preparation method - Google Patents

Time data preparation method

Info

Publication number
JP2000019275A
JP2000019275A JP18409398A JP18409398A JP2000019275A JP 2000019275 A JP2000019275 A JP 2000019275A JP 18409398 A JP18409398 A JP 18409398A JP 18409398 A JP18409398 A JP 18409398A JP 2000019275 A JP2000019275 A JP 2000019275A
Authority
JP
Japan
Prior art keywords
time
data
measurement
correction
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP18409398A
Other languages
Japanese (ja)
Other versions
JP3445742B2 (en
Inventor
Hideki Miyahara
秀規 宮原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Schneider Electric Japan Holdings Ltd
Original Assignee
Digital Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Digital Electronics Corp filed Critical Digital Electronics Corp
Priority to JP18409398A priority Critical patent/JP3445742B2/en
Publication of JP2000019275A publication Critical patent/JP2000019275A/en
Application granted granted Critical
Publication of JP3445742B2 publication Critical patent/JP3445742B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Electric Clocks (AREA)

Abstract

PROBLEM TO BE SOLVED: To make an error suppressible to the minimum regardless of increase in the lapse of time by providing data for correction that are increase-decrease time to unit time, and by correcting measurement time corresponding to the lapse of time by using the data. SOLUTION: For example, time data being applied to a program-type display being used for a target system are prepared by a calendar data processing circuit 16. In a calendar initial setting process, current accurate time is inputted, and correction data are calculated according to measurement time data where a measurement error after shipment from a factory is cumulated in a time measurement part 44 or the like for writing into a storage part 46. In a steady operation state, when the acquisition of current time data is requested, the lapse of time from setting time in the time measurement part 44 consisting of a crystal oscillator or the like is calculated based on the difference between the measurement time data and the setting time data, and the correction data in the storage part 46 are used for correction. A configuration for correction every time when the error of the unit time occurs is also passible.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は時刻データの作成
方法であって、特に、各種のコンピュータ関連装置に内
蔵することが多いリアルタイムクロック(以下、「RT
C」と略す。)で作成される現在時刻データの計測誤差
を補正するものに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for creating time data, and in particular, to a real-time clock (hereinafter referred to as "RT") often incorporated in various computer-related devices.
C ”. ) Which corrects the measurement error of the current time data created in step (1).

【0002】[0002]

【従来の技術】通常パソコン関連装置は安価に製造する
ことを目的に開発されることが多く、RTCに使用され
る水晶発振子も汎用品が適用される結果、計測される現
在時刻データの誤差も常温で月に数十秒あるいはそれ以
上に達することが一般的である。この傾向は、工場内の
様に温度条件が厳しい場合にあっては、更に激しくなる
ことが知られる。
2. Description of the Related Art In general, personal computer-related devices are often developed for the purpose of being manufactured at a low cost, and general-purpose quartz oscillators used for RTC are used. Even at room temperature, it generally reaches several tens of seconds or more per month. It is known that this tendency becomes more severe when temperature conditions are severe as in a factory.

【0003】かかる不都合に対し、手動でRTCによる
表示時刻を現在時刻へ強制的に合わせ、あるいはオンラ
インのデータベース上から正確な現在時刻データを定期
的に取り出して、RTCの計測時刻を自動的に絶対補正
することが行われている。
In response to such inconvenience, the display time by the RTC is manually forcibly adjusted to the current time, or accurate current time data is periodically taken out from an online database, and the measured time of the RTC is automatically set to the absolute value. Corrections have been made.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上記し
た様なRTCが積算表示している計測時刻を直接的に補
正する方法にあっては、その補正動作それ自体が面倒で
あるとともに、単位時間の誤差が大きい場合にあって
は、補正処理の間隔が長くなるほど誤差も増大するた
め、補正処理を頻繁に実行する必要があるなど、実用上
不都合が多い。
However, in the method of directly correcting the measurement time displayed by the RTC as described above, the correction operation itself is troublesome and the unit time is reduced. In the case where the error is large, the error increases as the interval between the correction processes increases, so that there are many practical inconveniences such as the need to execute the correction process frequently.

【0005】本発明者はかかる問題について考察を行っ
た結果、発振器の発振周波数で規定される例えば1秒の
単位時間分の誤差が生ずるのに要する時間を予め設定し
ておくと、前回補正した時刻からの経過時間を利用する
ことにより時刻データの利用時にまとめて、あるいは単
位時間分の誤差が発生する毎に計測時刻を補正すること
により、正確な時刻データが比較的簡単に得られること
を知見した。
As a result of studying the above problem, the inventor previously corrected the time required to generate an error corresponding to a unit time of, for example, one second defined by the oscillation frequency of the oscillator. By using the elapsed time from the time to collect the time data when using it, or by correcting the measurement time every time a unit time error occurs, accurate time data can be obtained relatively easily. I learned.

【0006】本発明はかかる知見に基づいてなされたも
のであって、前回設定した時刻からの経過時間に対して
補正を施すことにより、経過時間の増大に拘わらず絶え
ず適切に補正された現在時刻表示が可能となる時刻デー
タの形成方法を提供することを目的とする。
The present invention has been made on the basis of such knowledge, and by correcting the elapsed time from the previously set time, the present time constantly corrected appropriately regardless of the increase in the elapsed time. It is an object of the present invention to provide a method of forming time data that can be displayed.

【0007】本発明は更に、上記した関係を用いて、単
位時間分の誤差が発生する毎に計測時刻を補正すること
により、計測時刻を常に単位時間以内の誤差に抑制可能
とした時刻データの形成方法を提供することを目的とす
る。
The present invention further corrects the measurement time every time an error of a unit time occurs by using the above-described relationship, so that the measurement time can always be suppressed to an error within the unit time. It is an object to provide a forming method.

【0008】本発明は更にまた、現在時刻を設定するだ
けで必要な補正値が自動的に算出され、補正に要する操
作の簡略化が図られるとともに、工場の出荷時における
単位時間ひいては計時用のクロック信号の周波数調整を
不要とする時刻データ形成方法を提供することを目的と
する。
Further, according to the present invention, the necessary correction value is automatically calculated only by setting the current time, thereby simplifying the operation required for the correction, and furthermore, the unit time at the time of shipment from the factory, and furthermore, the timekeeping time. An object of the present invention is to provide a time data forming method that does not require frequency adjustment of a clock signal.

【0009】[0009]

【課題を解決するための手段】本発明にかかる時刻デー
タの作成方法は、図1にその構成を概略的に示すごと
く、発振器の発振周波数で規定される単位時間Δtを順
次に積算していくことにより、現在時刻に対応した計測
時刻を保持する一方、その計測時刻を補正するための補
正用データを備え、その補正用データで計測時刻を補正
しながら必要な時刻データを作成するものであって、更
に上記した補正データが、上記した発振周波数で規定さ
れる単位時間Δtに対する増減時間であることを特徴と
する。
As shown in FIG. 1, a time data generating method according to the present invention sequentially accumulates a unit time Δt defined by an oscillation frequency of an oscillator. Thus, while holding the measurement time corresponding to the current time, correction data for correcting the measurement time is provided, and necessary time data is created while correcting the measurement time with the correction data. Further, the correction data is an increase / decrease time with respect to a unit time Δt defined by the oscillation frequency.

【0010】上記した計測時刻を、図1(a)の様に、
現在時刻に対応させて予め記憶した設定時刻を基準と
し、単位時間Δtの時間間隔で設定時刻に単位時間Δt
を積算しながら更新することにより作成されるものと
し、補正後の時刻が、設定時刻から計測時刻までの経過
時間と補正用データとから算出される補正時間を、計測
時刻に増減処理することによって算出される様に構成で
きる。
[0010] As shown in FIG.
Based on a preset time stored in advance in association with the current time, the unit time Δt
The time after correction is obtained by updating the correction time calculated from the elapsed time from the set time to the measurement time and the correction data to the measurement time. It can be configured to be calculated.

【0011】上記した計測時刻データの作成を、図4お
よび図5に例示する如く、電池40によってバックアッ
プされて電源スイッチ42のオンオフに拘わらず計測動
作を連続的に持続するリアルタイムクロック45によっ
て行われるものとし、補正後の時刻データは、必要時に
リアルタイムクロック45から計測時刻データが読み出
されたのちに演算によって算出してもよい。
As shown in FIGS. 4 and 5, the above-described measurement time data is created by a real-time clock 45 which is backed up by a battery 40 and continuously maintains the measurement operation regardless of whether the power switch 42 is on or off. It should be noted that the corrected time data may be calculated by an operation after the measured time data is read from the real-time clock 45 when necessary.

【0012】また上記した補正用データを、現在の時刻
と上記した計測時刻との時間差から算出される補正を必
要とする時間と、計測時刻と設定時刻との時間差から算
出される経過時間とから、逆算して自動的に算出される
ものとし、補正用データの更新に伴って、現在時刻が設
定時刻として更新される様に構成することもできる。
Further, the correction data is obtained by calculating the time required for correction calculated from the time difference between the current time and the measured time, and the elapsed time calculated from the time difference between the measured time and the set time. It is also possible to employ a configuration in which the current time is updated as the set time in accordance with the update of the correction data.

【0013】一方、上記の様にまとめて補正処理するの
に代えてあるいは加えて、上記した計測時刻を、所定の
設定時間が経過する毎に絶対補正することもできる。こ
の場合、上記した設定時間は上記した単位時間分Δtの
誤差が発生するまでに必要とする時間であり、その設定
時間が経過する毎に計測時刻は単位時間Δtだけ増減さ
れる。
On the other hand, in place of or in addition to the above-described collective correction processing, the above-described measurement time can be absolutely corrected every time a predetermined set time elapses. In this case, the above-mentioned set time is a time required until an error of the above-mentioned unit time Δt occurs, and each time the set time elapses, the measurement time is increased or decreased by the unit time Δt.

【0014】上記した計測時刻データの作成を、電源ス
イッチ42のオンオフ時期に拘わらず連続的に行なう一
方、電源スイッチ42のオン期間中にのみ、上記した計
測時刻の補正動作を行い、電源スイッチ42のオフ期間
中はオフ時点における時刻データを図1(a)に示す設
定時刻として保持し、電源スイッチ42がオンされるの
と連動して、上記した設定時刻から計測時刻までの経過
時間と補正用データとから算出される電源スイッチがオ
フ期間中の補正時間を、計測時刻に加減算処理すること
も可能である。
The above-described measurement time data is continuously generated irrespective of the ON / OFF timing of the power switch 42, and the above-described correction operation of the measurement time is performed only during the ON period of the power switch 42. During the OFF period, the time data at the OFF point is held as the set time shown in FIG. 1A, and the elapsed time from the above set time to the measurement time is corrected in conjunction with the turning on of the power switch 42. It is also possible to add / subtract the correction time during the OFF period of the power switch calculated from the application data to the measurement time.

【0015】[0015]

【発明の実施の形態】以下本発明にかかる時刻データ作
成方法を、図2〜図5に例示するPLC10を使用した
ターゲットシステム12のシーケンス制御時の表示用に
特化して構成したプログラム式の表示装置14に備えた
カレンダデータ処理回路16に実施した一例を示すがこ
れに限らず、パソコン装置あるいは各種のパソコン応用
機器におけるカレンダ表示機能に対しても略同様に実施
できることは勿論である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, a time display data creation method according to the present invention will be described in detail with reference to a program-type display which is specially configured for display during sequence control of a target system 12 using a PLC 10 shown in FIGS. An example in which the present invention is applied to the calendar data processing circuit 16 provided in the apparatus 14 is shown. However, the present invention is not limited to this, and it goes without saying that the present invention can be applied to a calendar display function in a personal computer device or various personal computer-applied devices.

【0016】プログラム式表示装置14は、図2に示す
ごとく表示制御回路18を備えるとともに、図3の様
に、ディスプレイ20における表示画面22の前面を透
明なタッチパネル24により密着状態で覆い、タッチパ
ネル24に対する押圧操作による指示は、タッチパネル
コントローラ26を介して取り込まれて座標が解析さ
れ、システム全体としての運転開始前における初期設定
時あるいは運転中における指先による各種手動操作を可
能とする。
The programmable display device 14 includes a display control circuit 18 as shown in FIG. 2 and, as shown in FIG. 3, covers the front surface of a display screen 22 of the display 20 with a transparent touch panel 24 in close contact therewith. The instruction by the pressing operation is input via the touch panel controller 26 and the coordinates are analyzed, so that various manual operations can be performed by a fingertip at the time of initial setting before starting operation of the entire system or during operation.

【0017】更に電源スイッチ42のオン操作と連動し
て商用交流電源27が電源回路29に接続され、高圧の
交流電圧は低圧の直流電圧に変換されて表示制御回路1
8に印加される。
Further, the commercial AC power supply 27 is connected to the power supply circuit 29 in conjunction with the ON operation of the power switch 42, and the high-voltage AC voltage is converted into a low-voltage DC voltage, and the display control circuit 1
8 is applied.

【0018】表示制御回路18の基本的な構成は一般的
なパソコン装置と略同一であって、バスライン28を介
してCPU30、ROM32、RAM34をはじめとす
る各種メモリ、カレンダデータ処理回路16あるいはグ
ラフィックコントローラ36が接続され、ROM32内
に格納されたシステムプログラムに従ってCPU30が
所定の演算動作を行う一方、RAM34に適宜格納され
る各種の演算結果は、グラフィックコントローラ36に
よりビデオRAM38上へビットイメージとして展開さ
れ、ビデオRAM38内への書き込み内容に対応した表
示をディスプレイ20上で行う。
The basic configuration of the display control circuit 18 is substantially the same as that of a general personal computer, and various memories including a CPU 30, a ROM 32, a RAM 34, a calendar data processing circuit 16 and a graphic A controller 36 is connected, and the CPU 30 performs a predetermined arithmetic operation according to a system program stored in the ROM 32, while various arithmetic results appropriately stored in the RAM 34 are developed as bit images on a video RAM 38 by the graphic controller 36. The display corresponding to the contents written in the video RAM 38 is performed on the display 20.

【0019】カレンダデータ処理回路16は、図4に例
示するごとく、電池40によってバックアップされて電
源スイッチ42のオンオフに拘わらず常時に動作する時
間計測部44と、各種のデータを保存する記憶部46
と、時間計測部44に対してデータの読み書きを可能と
する時刻データ入出力部48と、データの各種演算動作
を行うデータ処理部50と、ディスプレイ20の表示画
面22上への必要なデータ表示を可能とするデータ表示
部52と、表示画面22を介した操作者によるデータ入
力を可能とするデータ入力部54とから構成され、シス
テムのエラー処理時などにその時点の日付を含む時刻デ
ータが取り出され、各種データと一体となってデータ処
理を可能とする。
As shown in FIG. 4, the calendar data processing circuit 16 includes a time measuring unit 44 which is backed up by a battery 40 and always operates regardless of whether the power switch 42 is turned on or off, and a storage unit 46 which stores various data.
A time data input / output unit 48 that enables reading and writing of data with respect to the time measuring unit 44; a data processing unit 50 that performs various arithmetic operations on data; and a necessary data display on the display screen 22 of the display 20. And a data input unit 54 that allows the operator to input data via the display screen 22. Time data including the date at that time is used for error handling of the system. It is taken out and integrated with various data to enable data processing.

【0020】時間計測部44は、年月日と時分秒を24
時間制でデータ処理することにより、任意の時点を一意
的に特定可能とする時刻データ、あるいは必要に応じて
10分の1秒や100分の1秒の様な時間データがリア
ルタイムに形成できる従来と略同様な回路構成の1チッ
プ化されたRTC45が利用され、それが組み込まれた
電子機器がその動作を停止中にあっても電池40でその
動作をバックアップすることにより、図5に示すチップ
内部のデータ保持部56上に最新の計測時刻データを常
に維持できる様に構成している。
The time measuring unit 44 calculates the date, hour, minute, and second by 24
Conventionally, time data that can uniquely specify an arbitrary time point or time data such as 1/10 second or 1/100 second can be formed in real time as needed by processing data on a time basis. A single-chip RTC 45 having substantially the same circuit configuration as that of FIG. 5 is used, and even when an electronic device in which the RTC 45 is incorporated stops its operation, the operation is backed up by the battery 40, so that the chip shown in FIG. It is configured so that the latest measurement time data can always be maintained on the internal data holding unit 56.

【0021】すなわちRTC45は外部に水晶発振子5
8が接続され、内部に備えた発振回路によって例えば1
秒間隔に発生するパルス信号からなる単位時間Δtを形
成するとともに、データ保持部56に格納された設定時
刻を計測開始時刻とし、その開始時刻から図1(a)の
様に単位時間Δt毎に時刻データをカウントアップして
いくことにより、現在時刻に対応した値の計測時刻デー
タがデータ保持部56上に保持される。
That is, the RTC 45 is externally connected to the crystal oscillator 5.
8 is connected, for example, 1
A unit time Δt composed of pulse signals generated at intervals of seconds is formed, and a set time stored in the data holding unit 56 is set as a measurement start time. From the start time, as shown in FIG. By counting up the time data, the measured time data having a value corresponding to the current time is held on the data holding unit 56.

【0022】データ保持部56はデータの入出力端を備
えたシフトレジスタであって、時刻データ入出力部60
から出力される例えば100kHz程度の転送クロック
信号62と同期して、時刻データ入出力部60に備えた
ワークエリアとデータ保持部56との間で、必要なデー
タがシリアル状に入出力される様に構成している。
The data holding unit 56 is a shift register having a data input / output terminal, and a time data input / output unit 60
In synchronization with a transfer clock signal 62 of, for example, about 100 kHz output from the controller, necessary data is serially input / output between the work area provided in the time data input / output unit 60 and the data holding unit 56. It is composed.

【0023】データ処理部50は、CPU30を利用し
てメモリ上に備えたプログラムによって構成されるもの
であって、データ入力部54を介して入力された時刻デ
ータを記憶部46に格納し、あるいはデータ保持部56
から読み出した計測時刻データに対して後記する手順に
よってデータ補正をすることにより現在時刻を取得し、
データ表示部52に必要なカレンダ表示あるいは時刻デ
ータを利用したデータ処理を可能とする。
The data processing section 50 is constituted by a program provided on a memory using the CPU 30, and stores time data input via the data input section 54 in the storage section 46, or Data holding unit 56
The current time is obtained by performing data correction on the measurement time data read from
The data display unit 52 can perform necessary calendar display or data processing using time data.

【0024】記憶部46は、EEPROMあるいは電池
40でバックアップされたSRAM64の様に、データ
の読み書きを可能とするとともに、電源スイッチ42の
オフ時においてもデータを保持可能とする記憶素子で構
成され、各種の設定データを記憶できる様にしている。
The storage section 46 is constituted by a storage element which enables reading and writing of data and can hold data even when the power switch 42 is turned off, like an EEPROM 64 or an SRAM 64 backed up by a battery 40. Various setting data can be stored.

【0025】本発明は上記した構成にあって、RTC4
5のデータ保持部56から読み出した時刻データをデー
タ処理部50において図6に示す手順に従って補正する
ことにより、実時刻に対応した時刻データを形成する方
法に特徴を有する。
The present invention has the above-described configuration, and has the RTC4
The method is characterized in that the time data read from the data holding unit 56 of the No. 5 is corrected in the data processing unit 50 according to the procedure shown in FIG.

【0026】図6のステップ1でプログラム式表示装置
14を立ち上げてプログラムをスタートすると、ステッ
プ2からのカレンダ初期設定工程に入る。ここで表示装
置14の工場における最終調整時において、その時点に
おける正確な現在時間が開始時刻データとして記憶部4
6上に記憶されると同時に、RTC45内のデータ保持
部56にも転送され、その時点を基準としてRTC45
は時刻の計測を開始する様に予め設定されている。
When the program type display device 14 is started in step 1 of FIG. 6 to start the program, the process proceeds to a calendar initial setting process from step 2. At the time of final adjustment of the display device 14 at the factory, the accurate current time at that time is stored as start time data in the storage unit 4.
6 and transferred to the data holding unit 56 in the RTC 45 at the same time.
Is set in advance so as to start time measurement.

【0027】したがって、図3に示すカレンダ初期設定
画面には、設定時刻データとして工場における上記した
調整時のデータが、計測時刻データとして前記工場出荷
時からの計測誤差が累積した補正前のデータが保持され
ている。
Therefore, on the calendar initial setting screen shown in FIG. 3, the data at the time of the above-mentioned adjustment at the factory are set as the set time data, and the data before correction, in which the measurement errors from the factory shipment are accumulated, are set as the measured time data. Is held.

【0028】そこでステップ2において、現在の正確な
時刻を入力すると、ステップ3において工場出荷時から
現在までの経過時間と誤差時間とが各々算出され、表示
画面22上に表示される。
Then, in step 2, when the current accurate time is input, in step 3, the elapsed time from the factory shipment to the present and the error time are calculated and displayed on the display screen 22.

【0029】ここで経過時間が7日間で誤差時間が60
秒の遅れであったと仮定すると、7日×24時間×60
分=10080分となる。したがって、単位時間Δtに
対応する誤差1秒当たりの時間は168分となり、16
8分経過する毎に1秒間ずつ計測時刻を進めれば、正確
な時刻補正が行えることが判る。
Here, the elapsed time is 7 days and the error time is 60
Assuming a delay of seconds, 7 days x 24 hours x 60
Minute = 1008 minutes. Therefore, the time per 1 second of the error corresponding to the unit time Δt is 168 minutes, and 16
It can be seen that if the measurement time is advanced by one second every eight minutes, accurate time correction can be performed.

【0030】ステップ4において、上記のようにして算
出された補正データが表示され、更にステップ5でその
確認が求められるので、補正動作を行わないか、補正値
を変更するか、あるいは表示された補正データをそのま
ま使用するかを指示する。
In step 4, the correction data calculated as described above is displayed, and further in step 5, confirmation is required. Therefore, the correction operation is not performed, the correction value is changed, or displayed. Indicates whether to use the correction data as it is.

【0031】そこで、上記した補正データの適用を求め
る場合は、ステップ6において記憶部46内の設定時刻
データとデータ保持部56内の計測時刻データとが現在
時刻データにより更新されると同時に、補正データとし
て前記補正値が記憶部46内に書き込まれるとともに、
データ保持部56内では現在時刻を基準として計測時刻
データの連続的な更新が行われる定常運転状態に戻る。
Therefore, when the application of the above-described correction data is required, the set time data in the storage unit 46 and the measured time data in the data holding unit 56 are updated with the current time data at the same time as step 6. The correction value is written in the storage unit 46 as data,
In the data holding unit 56, the operation returns to the normal operation state in which the measurement time data is continuously updated based on the current time.

【0032】上記した定常運転状態において、ステップ
10でアプリケーションプログラムから現在時刻データ
の取得が要求された場合にあっては、ステップ11でデ
ータ保持部56から計測時刻データが読み出されたあ
と、ステップ12からの補正処理工程に入る。
If the current time data is requested by the application program in step 10 in the above-mentioned steady operation state, after the measured time data is read from the data holding unit 56 in step 11, The process enters the correction processing step starting from step 12.

【0033】補正処理工程は、ステップ12で計測時刻
データと設定時刻データとの差時間が計算され、設定時
刻からのRTC45を使用した経過時間が算出される。
この経過時間をステップ13において上記した補正値で
割ることにより補正時間が計算されるので、この補正時
間をステップ14で計測時刻に加算することによって時
刻補正を完了し、この時刻データがステップ15で現在
時刻データとしてアプリケーション側に引き渡されるの
である。
In the correction processing step, the difference time between the measured time data and the set time data is calculated in step 12, and the elapsed time from the set time using the RTC 45 is calculated.
The correction time is calculated by dividing the elapsed time by the above-described correction value in step 13, and the time correction is completed by adding the correction time to the measurement time in step 14, and the time data is obtained in step 15. It is passed to the application as current time data.

【0034】上記した実施例にあっては、RTC45に
おける計測時刻を通常は補正せず、時刻データの読み出
し要求に対応して演算により時刻を相対補正する例を示
したがこれに限らず、現在時刻データを常に保持すると
ともに、例えば1秒のような単位の時間誤差が発生する
毎に、現在時刻データに加えて計測時刻データをも絶対
補正することも可能である。
In the above-described embodiment, an example has been shown in which the measured time in the RTC 45 is not normally corrected and the time is relatively corrected by calculation in response to a time data read request. It is possible to always hold the time data and to absolutely correct the measured time data in addition to the current time data every time a time error such as 1 second occurs.

【0035】図7はこのような実施例を示すものであっ
て、図5に示すSRAM64上には、上記したような1
秒の誤差が発生するのに要する時間を示す補正値および
その誤差が進み方向か遅れ方向かを示す補正符号に加え
て、補正カウントデータおよび現在時刻データの保持領
域を設けている。
FIG. 7 shows such an embodiment. In the SRAM 64 shown in FIG.
In addition to a correction value indicating a time required for an error of seconds to occur and a correction code indicating whether the error is in a leading direction or a lagging direction, a holding area for correction count data and current time data is provided.

【0036】ここで、図7のステップ20で電源スイッ
チがオンされて装置が動作していることが判定されてい
る間は、SRAM64上の現在時刻データは図7のステ
ップ21でRTC45が1秒を計測する毎に、ステップ
22で単位時間の1秒が加算されることによって、計測
時刻と同一の時刻を保持する。
Here, while it is determined in step 20 in FIG. 7 that the power switch is turned on and the apparatus is operating, the current time data on the SRAM 64 is stored in the RTC 45 for one second in step 21 in FIG. Each time is measured, the same time as the measurement time is held by adding 1 second of the unit time in step 22.

【0037】一方補正カウントデータは、ステップ25
または34において、初期値として上記した補正値を秒
数で表示したものがセットされ、計測時刻が1秒経過し
て現在時刻が1秒加算される毎に、ステップ23におい
てその値は1秒ずつ減算処理される。更に、ステップ2
4においてその値が「0」になったことが判定される
と、ステップ25において前記した初期値がセットされ
る動作を繰り返す。
On the other hand, the correction count data is stored in step 25
In step 34, a value obtained by displaying the above-described correction value in seconds as an initial value is set, and every time the measurement time has elapsed 1 second and the current time has been increased by 1 second, the value is incremented by 1 second in step 23. Subtraction processing is performed. Step 2
If it is determined in step 4 that the value has become "0", the operation of setting the initial value in step 25 is repeated.

【0038】本実施例にあっては上記した構成にあって
更に、補正カウンタが設定値をカウントし終える毎に、
現在時刻と計測時刻をリアルタイムに絶対補正すること
を特徴とする。
In this embodiment, in addition to the above configuration, each time the correction counter finishes counting the set value,
It is characterized in that the current time and the measured time are absolutely corrected in real time.

【0039】すなわち、ステップ24で補正カウンタが
その初期設定値である補正値をカウントし終えたことが
判定されると、計測時刻および現在時刻には1秒の誤差
が発生しているものと推測されるので、補正符号にした
がって両時刻を1秒加算または減算することにより、補
正が完了するのである(ステップ26および27)。
That is, if it is determined in step 24 that the correction counter has finished counting the correction value that is the initial set value, it is estimated that an error of one second has occurred between the measurement time and the current time. Therefore, the correction is completed by adding or subtracting one second to or from the two times according to the correction code (steps 26 and 27).

【0040】ところで、上記した補正動作を継続してい
る途中のステップ20で電源スイッチ42がオフされる
と、現在時刻データは電源オフ時における時刻を維持し
たままその値がステップ28の電源オン時にまで保存さ
れるが、計測時刻は電源がオフ中もステップ29でその
まま計測を継続する。
When the power switch 42 is turned off in step 20 while the above-described correction operation is being continued, the value of the current time data is maintained when the power is turned on in step 28 while maintaining the time when the power was turned off. The measurement is continued at step 29 even when the power is off.

【0041】したがって、ステップ28ににおける電源
を再度オンした時点にあっては、現在時刻データの値が
図1(a)における設定時刻とみなされるので、ステッ
プ30において現在時刻データと計測時刻データの差時
間である経過時間が算出され、更にステップ31におい
て補正用データとから必要な補正時間が算出される。そ
こでステップ32および33で計測時刻データと現在時
刻データとを補正後の時刻で置き換える補正処理を行う
ことにより、電源オン時の初期補正が完了するのであ
る。
Therefore, when the power is turned on again in step 28, the value of the current time data is regarded as the set time in FIG. 1 (a). The elapsed time, which is the difference time, is calculated, and the necessary correction time is calculated in step 31 from the correction data. Therefore, in steps 32 and 33, a correction process for replacing the measured time data and the current time data with the corrected time is performed, thereby completing the initial correction at power-on.

【0042】なお、上記した電源オン時に、図3と同一
または類似のカレンダ初期設定画面を開き、正確な現在
時刻を利用した補正処理が上記した場合と略同様に実施
できることは勿論である。
When the power is turned on, the same or similar calendar initial setting screen as that shown in FIG. 3 is opened, and the correction process using the accurate current time can be performed in substantially the same manner as in the case described above.

【0043】また上記した実施例にあっては、時刻の計
測動作をハードウェアによって構成する一方、また時刻
の補正処理動作をプログラムにより構成したがこれに限
らず、カレンダデータ処理回路16の全体をハードウェ
アあるいはソフトウェアによって構成することもでき
る。
In the above embodiment, the time measuring operation is constituted by hardware, and the time correcting operation is constituted by a program. However, the present invention is not limited to this. It can also be configured by hardware or software.

【0044】[0044]

【発明の効果】本発明は上記のごとく、前回設定した時
刻からの経過時間に対して必要な補正を施すことによ
り、経過時間の増大に拘わらず絶えず誤差を最小限に抑
制して適切に補正された時刻データが形成される。
As described above, according to the present invention, by making necessary corrections to the elapsed time from the previously set time, the error is constantly suppressed to a minimum irrespective of the increase in the elapsed time, and the correction is appropriately made. The generated time data is formed.

【0045】また、正確な現在時刻が判れば、その値を
入力するだけで必要な補正値が自動的に算出され、補正
に要する操作の簡略化が図られるとともに、工場の出荷
時における発振回路の微調整による単位時間の調整動作
を不要とする。
When an accurate current time is known, a necessary correction value is automatically calculated just by inputting the value, thereby simplifying the operation required for the correction and oscillating the circuit at the time of shipment from the factory. The adjustment operation of the unit time by the fine adjustment of is not required.

【0046】更に、単位時間Δt分の誤差が発生する毎
に計測時刻を補正することにより、計測時刻を常に単位
時間以内の誤差に抑制可能とし、時刻データの取得時に
演算動作を必要としない。
Further, by correcting the measurement time every time an error of the unit time Δt occurs, the measurement time can always be suppressed to an error within the unit time, and no arithmetic operation is required when acquiring the time data.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明で処理すべき各種時刻データ間の関係を
示す説明図である。
FIG. 1 is an explanatory diagram showing a relationship between various time data to be processed in the present invention.

【図2】本発明をプログラム式表示装置に実施した一例
を示す制御回路のブロック図である。
FIG. 2 is a block diagram of a control circuit showing an example in which the present invention is applied to a programmable display device.

【図3】プログラム式表示装置の外観形状の一例を示す
正面図である。
FIG. 3 is a front view showing an example of the external shape of the programmable display device.

【図4】カレンダデータ処理回路の構成を概略的に示す
ブロック図である。
FIG. 4 is a block diagram schematically showing a configuration of a calendar data processing circuit.

【図5】カレンダデータ処理回路の詳細な構成を示すブ
ロック図である。
FIG. 5 is a block diagram showing a detailed configuration of a calendar data processing circuit.

【図6】時刻データの作成手順を示す流れ図である。FIG. 6 is a flowchart showing a procedure for creating time data.

【図7】他の実施例を示す流れ図である。FIG. 7 is a flowchart showing another embodiment.

【符号の説明】[Explanation of symbols]

10 PLC 12 ターゲットシステム 14 プログラム式表示装置 16 カレンダデータ処理回路 18 表示制御回路 20 ディスプレイ 22 表示画面 24 タッチパネル 26 タッチパネルコントローラ 27 商用交流電源 28 バスライン 29 電源回路 30 CPU 32 ROM 34 RAM 36 グラフィックコントローラ 38 ビデオRAM 40 電池 42 電源スイッチ 44 時間計測部 45 RTC 46 記憶部 48 時刻データ入出力部 50 データ処理部 52 データ表示部 54 データ入力部 56 データ保持部 58 水晶発振子 60 データ入出力部 62 転送クロック信号 64 SRAM Reference Signs List 10 PLC 12 target system 14 programmable display device 16 calendar data processing circuit 18 display control circuit 20 display 22 display screen 24 touch panel 26 touch panel controller 27 commercial AC power supply 28 bus line 29 power supply circuit 30 CPU 32 ROM 34 RAM 36 graphic controller 38 video RAM 40 Battery 42 Power switch 44 Time measurement unit 45 RTC 46 Storage unit 48 Time data input / output unit 50 Data processing unit 52 Data display unit 54 Data input unit 56 Data holding unit 58 Crystal oscillator 60 Data input / output unit 62 Transfer clock signal 64 SRAM

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 発振器の発振周波数で規定される単位時
間を積算していくことにより、現在時刻に対応した計測
時刻を保持する一方、 その計測時刻を補正するための補正用データを備え、 その補正用データで計測時刻を補正しながら必要な時刻
データを作成する方法にあって、 上記した補正データが、上記した発振周波数で規定され
る単位時間に対する増減時間であることを特徴とする時
刻データ作成方法。
1. A method for accumulating a unit time defined by an oscillation frequency of an oscillator to maintain a measurement time corresponding to a current time, and to include correction data for correcting the measurement time. A method for creating necessary time data while correcting measurement time with correction data, wherein the correction data is an increase / decrease time with respect to a unit time defined by the oscillation frequency. How to make.
【請求項2】 上記した計測時刻は、現在時刻に対応さ
せて予め記憶した設定時刻を基準とし、単位時間間隔で
設定時刻に単位時間を積算しながら更新することにより
作成されるものであり、 補正後の時刻が、設定時刻から計測時刻までの経過時間
と補正用データとから算出される補正時間を、計測時刻
に加減算処理することによって算出される請求項1記載
の時刻データ作成方法。
2. The measurement time is created by updating a set time at a unit time interval while adding a unit time to a set time, based on a set time stored in advance corresponding to the current time, 2. The time data generating method according to claim 1, wherein the corrected time is calculated by adding / subtracting a correction time calculated from an elapsed time from the set time to the measurement time and the correction data to the measurement time.
【請求項3】 上記した計測時刻データの作成は、電池
によってバックアップされて電源スイッチのオンオフに
拘わらず計測動作を連続的に持続するリアルタイムクロ
ックによって行われるものであり、 補正後の時刻データは、必要時にリアルタイムクロック
から計測時刻データが読み出されたのちに演算によって
算出される請求項2記載の時刻データ作成方法。
3. The measurement time data described above is created by a real-time clock that is backed up by a battery and continuously maintains a measurement operation regardless of whether a power switch is turned on or off. 3. The time data generating method according to claim 2, wherein the time data is calculated by an operation after reading the measured time data from the real-time clock when necessary.
【請求項4】 上記した補正用データは、 現在の時刻と上記した計測時刻との時間差から算出され
る補正を必要とする時間と、計測時刻と設定時刻との時
間差から算出される経過時間とから、逆算して自動的に
算出されるものであり、 補正用データの更新に伴って、現在時刻が設定時刻とし
て更新される請求項3記載の時刻データ作成方法。
4. The correction data includes a time required for correction calculated from a time difference between a current time and the measurement time, and an elapsed time calculated from a time difference between the measurement time and a set time. 4. The time data generating method according to claim 3, wherein the current time is updated as the set time in accordance with the update of the correction data.
【請求項5】 上記した計測時刻は、所定の設定時間が
経過する毎に絶対補正されるものであって、 上記した設定時間は、上記した単位時間分の誤差が発生
するまでに必要とする時間であり、その設定時間が経過
する毎に計測時刻は単位時間だけ増減される請求項1記
載の時刻データ作成方法。
5. The above measurement time is absolutely corrected every time a predetermined set time elapses, and the above set time is required until an error of the above unit time occurs. The time data generating method according to claim 1, wherein the time is a time, and the measurement time is increased or decreased by a unit time every time the set time elapses.
【請求項6】 上記した計測時刻データの作成を、電源
スイッチのオンオフ時期に拘わらず連続的に行なう一
方、 電源スイッチのオン期間中にのみ、上記した計測時刻の
補正動作を行い、 電源スイッチのオフ期間中はオフ時点における時刻デー
タを設定時刻として保持し、 電源スイッチがオンされるのと連動して、上記した設定
時刻から計測時刻までの経過時間と補正用データとから
算出される電源スイッチがオフ期間中の補正時間を、計
測時刻に対して加減算処理する請求項5記載の時刻デー
タ作成方法。
6. The above-described measurement time data is continuously created regardless of the on / off timing of the power switch, and the above-described correction operation of the measurement time is performed only during the ON period of the power switch. During the off period, the time data at the off point is held as the set time, and the power switch is calculated from the elapsed time from the set time to the measurement time and the correction data in conjunction with the turning on of the power switch. 6. The time data generating method according to claim 5, wherein the step of adding or subtracting the correction time during the off period from the measured time.
JP18409398A 1998-06-30 1998-06-30 Time data creation method Expired - Fee Related JP3445742B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18409398A JP3445742B2 (en) 1998-06-30 1998-06-30 Time data creation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18409398A JP3445742B2 (en) 1998-06-30 1998-06-30 Time data creation method

Publications (2)

Publication Number Publication Date
JP2000019275A true JP2000019275A (en) 2000-01-21
JP3445742B2 JP3445742B2 (en) 2003-09-08

Family

ID=16147281

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18409398A Expired - Fee Related JP3445742B2 (en) 1998-06-30 1998-06-30 Time data creation method

Country Status (1)

Country Link
JP (1) JP3445742B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014003573A (en) * 2012-06-21 2014-01-09 Alnic Inc Multipoint measurement system and time synchronization method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014003573A (en) * 2012-06-21 2014-01-09 Alnic Inc Multipoint measurement system and time synchronization method

Also Published As

Publication number Publication date
JP3445742B2 (en) 2003-09-08

Similar Documents

Publication Publication Date Title
CA1279996C (en) Time of day clock
US11809225B2 (en) Electronic display device and display control method
EP1371208B1 (en) Method of correcting a real-time clock of an electronic apparatus
US7854544B2 (en) Correction apparatus and clock device using the same
JP3445742B2 (en) Time data creation method
JPH06342088A (en) Timing method, semiconductor device and timer
JP2002311173A (en) Electronic clock, method and program for correcting time error of the same
JPH1114775A (en) Method for automatically correcting display time of electronic clock
JP2896004B2 (en) Calendar iC correction method
JP2900154B1 (en) Electronic clock with auto calendar
JPH09264755A (en) Apparatus and method for measuring
JPS61785A (en) Time control method
JP2003270369A (en) Time correction method and time correction device for real time clock
JP2000266876A (en) Clock device
JP2017181055A (en) Electronic timepiece of apparatus built-in type
JP2002341063A (en) Electronic timepiece
JPS6360872B2 (en)
JPH04335185A (en) Timepiece
JPH01216293A (en) Time error correcting method
JPH055515Y2 (en)
JPS622557Y2 (en)
JP2006053008A (en) Timepiece and timepiece error adjustment method
JPH0134149Y2 (en)
JPS5856421B2 (en) temperature measuring device
JPH08211172A (en) Time correction apparatus

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080627

Year of fee payment: 5

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090627

Year of fee payment: 6

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100627

Year of fee payment: 7

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100627

Year of fee payment: 7

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110627

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees