JP2014052189A - Programmable logic controller, time correction system for the same, and external apparatus for the programmable logic controller - Google Patents

Programmable logic controller, time correction system for the same, and external apparatus for the programmable logic controller Download PDF

Info

Publication number
JP2014052189A
JP2014052189A JP2012194554A JP2012194554A JP2014052189A JP 2014052189 A JP2014052189 A JP 2014052189A JP 2012194554 A JP2012194554 A JP 2012194554A JP 2012194554 A JP2012194554 A JP 2012194554A JP 2014052189 A JP2014052189 A JP 2014052189A
Authority
JP
Japan
Prior art keywords
unit
time
current time
main body
flag
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.)
Pending
Application number
JP2012194554A
Other languages
Japanese (ja)
Inventor
Yusaku Akatsuka
優作 赤塚
Masanori Kita
正憲 北
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.)
Keyence Corp
Original Assignee
Keyence 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 Keyence Corp filed Critical Keyence Corp
Priority to JP2012194554A priority Critical patent/JP2014052189A/en
Publication of JP2014052189A publication Critical patent/JP2014052189A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Electric Clocks (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a programmable logic controller capable of correcting current time by a simpler and surer method as compared with a conventional method.SOLUTION: When an output voltage of an RTC power supply 40 for supplying electric power to an RTC 37 installed in a body 2 of a PLC is lowered, current time of the RTC 37 is corrected by time data supplied from an RTC of an operation module 3 connected to the body 2. Since the RTC of the operation module 3 can clock the current time without receiving a radio wave indicating time, the current time of the PLC can be corrected even in a site such as a plant where a radio wave does not reach. Further, the current time of the RTC 37 can be corrected by time data supplied from the RTC of the operation module 3 without connecting a terminal device to a GPS receiver via a network. Accordingly, time information of a PLC 1 can be corrected by the simpler and surer method as compared with the conventional method.

Description

本発明は、プラグラマブルロジックコントローラの時刻を補正する技術に関する。   The present invention relates to a technique for correcting the time of a pluggable logic controller.

プログラマブルロジックコントローラ(以下、PLCと称す)は、FA(Factory
Automation)制御システムにおいて広く使用されているシーケンス制御装置であり、ラダープログラムと呼ばれる専用プログラムにしたがって動作する。操作者(オペレータ)は、リミットスイッチ、センサ、温度計などの入力機器や、電磁開閉器、ソレノイド、モータ、アクチュエータ、シリンダ、リレー、位置決めシステムなどの出力機器をPLCに接続し、ラダープログラムによってこれらの被制御機器を制御する。
Programmable logic controller (hereinafter referred to as PLC) is FA (Factory
Automation) is a sequence controller widely used in control systems, and operates according to a dedicated program called a ladder program. The operator (operator) connects input devices such as limit switches, sensors, and thermometers, and output devices such as electromagnetic switches, solenoids, motors, actuators, cylinders, relays, and positioning systems to the PLC. Control the controlled device.

オペレータは、パーソナルコンピュータ(以下、PCと称す)などのプログラム作成支援装置上でラダープログラムを作成し、PCとPLCを接続し、ラダープログラムをPLCの記憶部に記憶させる。PLCの記憶部にはデバイス情報等の各種データも記憶される。デバイス情報とは、入力機器からの入力状態、出力機器への出力状態およびラダープログラム上で設定される内部リレー(補助リレー)、タイマー、カウンタ、データメモリ等の状態を示す情報である。デバイスとは、デバイス情報を格納するために設けられたメモリ上の領域を指す名称である。PLCにプログラム作成支援装置を接続することで、PLCが保持しているデバイス情報(デバイスの値)をプログラム作成支援装置に表示させ、視認することもできる。   An operator creates a ladder program on a program creation support device such as a personal computer (hereinafter referred to as a PC), connects the PC and the PLC, and stores the ladder program in the storage unit of the PLC. Various data such as device information is also stored in the storage unit of the PLC. The device information is information indicating an input state from the input device, an output state to the output device, and states of an internal relay (auxiliary relay), a timer, a counter, a data memory, and the like set on the ladder program. A device is a name indicating an area on a memory provided for storing device information. By connecting the program creation support apparatus to the PLC, the device information (device value) held by the PLC can be displayed on the program creation support apparatus for visual recognition.

ところで、PLCは、リアルタイムクロック(RTC)を備え、時刻情報をRTCから取得して、各種の制御をすることがある。RTCは、PLCの本体からは直接的には電力を供給されずに、電池やキャパシタなどの電源によって電力を供給されて動作している。よって、PLCの電源OFF中に、RTCの動作に起因して電池の残量が少なくなってくると、電池の出力電圧がRTCの動作限界電圧未満となり、RTCが正しい時刻情報を提供できなくなる。時刻情報が被制御機器の制御にとって重要な情報である場合、PLCの制御も誤ってしまうこともある。たとえば、異常が起きたときの時刻を把握したい場合や、1日のうちの所定時刻に処理を実行させたい場合等である。よって、PLCの時刻情報を正確に維持することは重要である。特許文献1によれば、ネットワークを介して複数の端末装置をGPS受信機に接続し、GPS受信機により受信した時刻データによって複数の端末装置の時刻を同期させることが提案されている。特許文献2によれば、GPS衛星やAM・FM・短波などのラジオの電波により搬送される標準時刻信号を受信して、PLCの時刻を同期させる時刻同期装置が提案されている。   By the way, the PLC includes a real-time clock (RTC), acquires time information from the RTC, and performs various controls. The RTC is not supplied with power directly from the main body of the PLC, but is operated with power supplied from a power source such as a battery or a capacitor. Therefore, if the remaining battery level is reduced due to the operation of the RTC while the power of the PLC is turned off, the output voltage of the battery becomes less than the operation limit voltage of the RTC, and the RTC cannot provide correct time information. When the time information is important information for controlling the controlled device, the PLC control may be erroneous. For example, there is a case where it is desired to grasp the time when an abnormality has occurred, or a case where processing is to be executed at a predetermined time of the day. Therefore, it is important to accurately maintain PLC time information. According to Patent Document 1, it is proposed to connect a plurality of terminal devices to a GPS receiver via a network and synchronize the times of the plurality of terminal devices with time data received by the GPS receiver. Patent Document 2 proposes a time synchronization device that receives a standard time signal carried by radio waves such as GPS satellites, AM, FM, and short waves and synchronizes the time of the PLC.

特開2001−324584号公報JP 2001-324484 A 特開2007−101306号公報JP 2007-101306 A

特許文献1の発明では、GPS衛星からの電波を受信できること、および、ネットワークを介して端末装置をGPS受信機に接続することが必要であり、屋内で使用されることが想定されているPLCに適用することは簡単ではない。また、特許文献2の発明も、電波を受信できることが前提となっており、屋内で使用されることが想定されているPLCに適用することは簡単ではない。また、エラーがでたことをオペレータが認識したときに、時刻同期装置を準備してPLCに接続することは、オペレータにとって面倒かもしれない。また、時刻同期装置のような専用の装置を工場などの現場に設置されたPLCに接続することは困難なこともある。PLCは誤操作を防止するために、普通では手の届かないような場所に設置されるためである。一方で、ラダープログラムを作成してPLCに転送するプログラム作成支援装置であれば、PLCの時刻情報を修正できるであろう。しかし、プログラム作成支援装置を現場においてPLCに接続することはやはり簡単なことではない。プログラム作成支援装置は、デスクトップPCなどのパーソナルコンピュータだからである。   In the invention of Patent Document 1, it is necessary to connect a terminal device to a GPS receiver via a network so that radio waves from a GPS satellite can be received, and to a PLC that is assumed to be used indoors. It is not easy to apply. Further, the invention of Patent Document 2 is also based on the premise that radio waves can be received, and is not easy to apply to a PLC that is supposed to be used indoors. Also, when the operator recognizes that an error has occurred, it may be troublesome for the operator to prepare the time synchronization device and connect it to the PLC. In addition, it may be difficult to connect a dedicated device such as a time synchronization device to a PLC installed at a site such as a factory. This is because the PLC is installed in a place that is normally out of reach in order to prevent erroneous operation. On the other hand, if it is a program creation support device that creates a ladder program and transfers it to the PLC, the time information of the PLC will be corrected. However, it is still not easy to connect the program creation support apparatus to the PLC in the field. This is because the program creation support apparatus is a personal computer such as a desktop PC.

そこで、本発明は、従来よりも簡易かつ確実な方法でPLCの時刻情報を補正できるようにすることを目的とする。   Therefore, an object of the present invention is to make it possible to correct PLC time information by a simpler and more reliable method than in the past.

本発明は、プログラマブルロジックコントローラの本体と、前記本体に対して接続された外部機器と、を備えるプログラマブルロジックコントローラの時刻補正システムであって、前記プログラマブルロジックコントローラは、現在時刻を計時する第1の計時部と、前記本体に電力が供給されているか否かとは無関係に、前記第1の計時部に電力を供給する電源と、前記電源の出力電圧を監視する電圧監視部と、前記電源の出力電圧が閾値未満に低下すると、前記第1の計時部が計時する現在時刻の信頼性が低下している可能性があることを示すようにフラグを制御して記憶部に記憶させるフラグ制御部と、前記第1の計時部の現在時刻を補正する時刻補正部とを備え、前記外部機器は、現在時刻を計時する第2の計時部と、前記本体の記憶部に保持されている前記フラグを読み出し、前記第1の計時部が計時する現在時刻の信頼性が低下している可能性があることを当該フラグが示しているかどうかを判定する判定部と、前記本体の記憶部から読み出した前記フラグが前記第1の計時部が計時する現在時刻の信頼性が低下している可能性があることを示していると前記判定部が判定すると、前記第2の計時部が計時した現在時刻を示す時刻データを取得して、前記第1の計時部の現在時刻を補正するための補正命令を作成して、該時刻データとともに前記本体に送信する補正命令作成部と、を備え、前記時刻補正部は、前記本体が前記補正命令を受信したときに、前記補正命令とともに受信した時刻データで前記第1の計時部の現在時刻を補正することを特徴とするプログラマブルロジックコントローラの時刻補正システムを提供する。   The present invention is a programmable logic controller time correction system comprising a main body of a programmable logic controller and an external device connected to the main body, wherein the programmable logic controller measures a current time. Regardless of whether or not power is supplied to the main body, a time measuring unit, a power source that supplies power to the first time measuring unit, a voltage monitoring unit that monitors an output voltage of the power source, and an output of the power source A flag control unit that controls a flag to store in a storage unit to indicate that the reliability of the current time measured by the first clock unit may be reduced when the voltage drops below a threshold; A time correction unit that corrects the current time of the first time measuring unit, and the external device stores a second time measuring unit that measures the current time, and a memory of the main body A determination unit that reads out the flag held in the first determination unit and determines whether or not the flag indicates that the reliability of the current time measured by the first time measurement unit may be reduced; When the determination unit determines that the flag read from the storage unit of the main body indicates that there is a possibility that the reliability of the current time measured by the first time measurement unit is reduced, the second A correction command generating unit that acquires time data indicating the current time measured by the time measuring unit, generates a correction command for correcting the current time of the first time measuring unit, and transmits the correction command to the main body together with the time data The time correction unit corrects the current time of the first time measuring unit with the time data received together with the correction command when the main body receives the correction command. The Providing logic controller time correction system.

また、本発明は、本体に外部機器が接続可能なプログラマブルロジックコントローラであって、現在時刻を計時する第1の計時部と、前記本体に電力が供給されているか否かとは無関係に、前記第1の計時部に電力を供給する電源と、前記電源の出力電圧を監視する電圧監視部と、前記電源の出力電圧が閾値未満に低下すると、前記第1の計時部が計時する現在時刻の信頼性が低下している可能性があることを示すようにフラグを制御して記憶部に記憶させるフラグ制御部と、前記フラグ制御部の制御に起因して前記外部機器から受信した時刻データで前記第1の計時部の現在時刻を補正する時刻補正部とを備えることを特徴とするプログラマブルロジックコントローラを提供する。   In addition, the present invention is a programmable logic controller in which an external device can be connected to the main body, and the first timekeeping section that measures the current time and whether or not power is supplied to the main body. A power source that supplies power to one timepiece, a voltage monitoring unit that monitors the output voltage of the power supply, and the reliability of the current time that the first timepiece counts when the output voltage of the power supply falls below a threshold value A flag control unit that controls the flag so as to indicate that there is a possibility that the performance is reduced and stores the flag in the storage unit, and the time data received from the external device due to the control of the flag control unit Provided is a programmable logic controller comprising a time correction unit that corrects the current time of a first time measuring unit.

さらに本発明は、現在時刻を計時する第1の計時部を備えたプログラマブルロジックコントローラ用の外部機器であって、現在時刻を計時する第2の計時部と、前記プログラマブルロジックコントローラの本体の記憶部に保持されているフラグを読み出し、当該フラグが前記第1の計時部の計時する現在時刻の信頼性が低下している可能性があることを示しているかどうかを判定する判定部と、前記本体の記憶部から読み出した前記フラグが前記第1の計時部の計時する現在時刻の信頼性が低下している可能性があることを示していると前記判定部が判定すると、前記第2の計時部が計時する現在時刻を示す時刻データを取得して補正命令を作成して前記本体に送信する補正命令作成部とを備えることを特徴とする外部機器を提供する。   Furthermore, the present invention is an external device for a programmable logic controller provided with a first timekeeping unit that measures the current time, a second timekeeping unit that measures the current time, and a storage unit of the main body of the programmable logic controller A determination unit that reads the flag held in the first time unit and determines whether the flag indicates that the reliability of the current time measured by the first time measuring unit may be reduced; When the determination unit determines that the flag read from the storage unit indicates that the reliability of the current time measured by the first time measurement unit may be reduced, the second time measurement An external device is provided, comprising: a correction command generation unit that acquires time data indicating a current time measured by the unit, generates a correction command, and transmits the correction command to the main body.

本発明によれば、PLCの電源OFF中に、PLCの本体に設けられた第1の計時部に電力を供給する電源の出力電圧が低下した場合、PLCの電源ON後に、本体に接続された外部機器の第2の計時部から供給された時刻データで第1の計時部の現在時刻が補正される。外部機器の第2の計時部は、現在時刻を計時でき、この第2の計時部における現在時刻がPLCに送られるため、電波の届かない工場等の現場でもPLCの現在時刻を補正できる。また、ネットワークを介して端末装置をGPS受信機に接続せずに、外部機器の第2の計時部から供給された時刻データで第1の計時部の現在時刻を補正できる。よって、従来よりも簡易かつ確実な方法でPLCの時刻情報を補正できるようになる。   According to the present invention, when the output voltage of the power source that supplies power to the first time measuring unit provided in the main body of the PLC is lowered while the power source of the PLC is turned off, the power source of the PLC is connected to the main body after the power source is turned on. The current time of the first timekeeping unit is corrected with the time data supplied from the second timekeeping unit of the external device. The second time measuring unit of the external device can measure the current time, and the current time in the second time measuring unit is sent to the PLC, so that the current time of the PLC can be corrected even at a site such as a factory where radio waves do not reach. In addition, the current time of the first timekeeping unit can be corrected with the time data supplied from the second timekeeping unit of the external device without connecting the terminal device to the GPS receiver via the network. Therefore, the time information of the PLC can be corrected by a simpler and more reliable method than before.

プログラマブルロジックコントローラ(PLC)の外観を示す斜視図である。It is a perspective view which shows the external appearance of a programmable logic controller (PLC). プログラマブル表示器の前面側を示した図である。It is the figure which showed the front side of the programmable display. PLCの本体のブロック図である。It is a block diagram of the main body of PLC. プログラマブル表示器のブロック図である。It is a block diagram of a programmable display. RTCに電力を供給する電源の出力電圧を監視する電圧監視処理を示すフローチャートである。It is a flowchart which shows the voltage monitoring process which monitors the output voltage of the power supply which supplies electric power to RTC. プログラマブル表示器が実行するフラグ監視および時刻補正コマンドの作成処理を示すフローチャートである。It is a flowchart which shows the flag monitoring and the preparation process of a time correction command which a programmable display performs. フラグを読み出すかどうかを判定する処理を示すフローチャートである。It is a flowchart which shows the process which determines whether a flag is read. PLCが実行する時刻補正処理を示すフローチャートである。It is a flowchart which shows the time correction process which PLC performs. 時刻補正機能の有効と無効とを切り替えるユーザインタフェースの一例を示した図である。It is the figure which showed an example of the user interface which switches validity and invalidity of a time correction function.

以下に本発明の一実施形態を示す。以下で説明される個別の実施形態は、本発明の上位概念、中位概念および下位概念など種々の概念を理解するために役立つであろう。また、本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されるわけではない。   An embodiment of the present invention is shown below. The individual embodiments described below will help to understand various concepts, such as the superordinate concept, intermediate concept and subordinate concept of the present invention. Further, the technical scope of the present invention is determined by the scope of the claims, and is not limited by the following individual embodiments.

図1(A)は、プログラマブルロジックコントローラ(PLC)の外観を示す斜視図である。PLCはたんにプログラマブルコントローラと呼ばれることもある。図1において、PLC1は本体2とオペレーションモジュール3とに分離されている。本体2には、リミットスイッチ、センサなどの入力機器と接続するための入力端子群4と、電磁開閉器、ソレノイド、モータ、アクチュエータ、シリンダ、リレー、位置決めシステムなどの出力機器と接続するための出力端子群5とを備えている。また、本体2の外側にはモジュールカセット形態のオペレーションモジュール3を収容する収容部6を備えている。つまり、オペレーションモジュール3は、本体2の収容部6に対して取り付けたり、取り外したりすることが可能である。収容部6には、オペレーションモジュール3を位置決めするためのボス8と、オペレーションモジュール3の内部の制御部や記憶部と通信するためのコネクタ7が設けられている。オペレーションモジュール3の背面には、ボス8が嵌合する不図示の穴部が設けられている。また、オペレーションモジュール3の背面には、コネクタ7の接点と接触する端子が設けられている。   FIG. 1A is a perspective view showing an appearance of a programmable logic controller (PLC). The PLC is sometimes referred to simply as a programmable controller. In FIG. 1, the PLC 1 is separated into a main body 2 and an operation module 3. The main body 2 has an input terminal group 4 for connection with input devices such as limit switches and sensors, and an output for connection with output devices such as electromagnetic switches, solenoids, motors, actuators, cylinders, relays, and positioning systems. And a terminal group 5. In addition, a housing 6 for housing the operation module 3 in the form of a module cassette is provided outside the main body 2. That is, the operation module 3 can be attached to or detached from the accommodating portion 6 of the main body 2. The housing 6 is provided with a boss 8 for positioning the operation module 3 and a connector 7 for communicating with a control unit and a storage unit inside the operation module 3. A hole (not shown) into which the boss 8 is fitted is provided on the back surface of the operation module 3. Further, a terminal that contacts the contact of the connector 7 is provided on the back surface of the operation module 3.

なお、本実施形態では、本体2とオペレーションモジュール3とが分離されるタイプのPLCを想定しているが、これらが分離されないタイプ、オペレーションモジュール3が存在しないタイプなど、本発明は、様々なタイプのPLCに適用可能である。   In the present embodiment, a PLC of a type in which the main body 2 and the operation module 3 are separated is assumed. However, the present invention has various types such as a type in which these are not separated and a type in which the operation module 3 does not exist. It is applicable to other PLCs.

オペレーションモジュール3の前面には、液晶表示装置や自発光型表示装置などの表示部10が設けられている。表示部10は、オペレーションモジュール3が収容部6に取り付けられているときに、本体2に関する情報などを表示する。オペレーションモジュール3の前面には、オペレータが各種の指示を入力するための操作部11が設けられている。操作部11には、オペレータの操作を受け付けるための複数のボタン(キー)が設けられている。   A display unit 10 such as a liquid crystal display device or a self-luminous display device is provided on the front surface of the operation module 3. The display unit 10 displays information about the main body 2 when the operation module 3 is attached to the housing unit 6. On the front surface of the operation module 3, an operation unit 11 for an operator to input various instructions is provided. The operation unit 11 is provided with a plurality of buttons (keys) for receiving operator operations.

図1(B)は、PLC1の本体2の収容部6にオペレーションモジュール3が取り付けられた様子を示している。図1(B)が示すように、オペレーションモジュール3の前面に表示部10が設けられており、この表示部10が本体2の前面に来るように本体2に対して取り付けられる。このように、オペレーションモジュール3はコネクタを介して本体2と接続されるため、通信ケーブルは不要である。つまり、オペレータは、通信ケーブルを用意して接続する作業が不要となる。また、通信ケーブルが断線すると新しい通信ケーブルを用意するまで、オペレーションモジュールを使用できなくなってしまうが、オペレーションモジュール3であればそのような問題も解決できる。特に、同種の複数のPLC1に対して時刻を設定する際には、本発明のオペレーションモジュール3は作業性の点で有利であろう。   FIG. 1B shows a state in which the operation module 3 is attached to the housing portion 6 of the main body 2 of the PLC 1. As shown in FIG. 1B, a display unit 10 is provided on the front surface of the operation module 3, and the display unit 10 is attached to the main body 2 so as to come to the front surface of the main body 2. Thus, since the operation module 3 is connected to the main body 2 via the connector, a communication cable is unnecessary. That is, the operator does not need to prepare and connect a communication cable. If the communication cable is disconnected, the operation module cannot be used until a new communication cable is prepared. However, the operation module 3 can solve such a problem. In particular, when setting the time for a plurality of PLCs 1 of the same type, the operation module 3 of the present invention will be advantageous in terms of workability.

図2は、PLC1に有線接続されるプログラマブル表示器3’を示した図である。図1に示したオペレーションモジュール3は、収容部6に収容される内蔵タイプであったが、プログラマブル表示器3’は、シリアル通信ケーブル、LANケーブル、USBケーブルなどのケーブル12を介してPLC1に接続されている。なお、プログラマブル表示器3’とPLC1は、有線接続されてもよいし、無線LAN、ブルートゥース、IrDAなどで無線接続されてもよい。プログラマブル表示器3’は、オペレーションモジュール3と同様に、表示部10と操作部11を備えている。プログラマブル表示器3’の操作部11は、静電容量式または感圧式のタッチパネル入力デバイスである。図2が示すように、表示部10は、PLC1から読み出したデバイス情報(例:製品番号、温度、速度など)を表示することができる。表示部10は、定期的または非定期的にデバイス情報を読み出してデバイス情報を表示する。どのデバイス情報を読み出すかやデバイス情報の読み出しタイミングは、基本的に、プログラマブル表示器3’内のプログラムによって規定される。ただし、たとえば、PLC1が実行するラダープログラムによって定義されてもよい。なお、表示部10は、たとえば、液晶表示装置や自発光型表示装置などである。操作部11は、操作者(オペレータ)が各種の指示を入力するための複数のボタン(キー)が設けられてもよい。   FIG. 2 is a diagram showing a programmable display 3 ′ connected to the PLC 1 by wire. The operation module 3 shown in FIG. 1 is a built-in type that is accommodated in the accommodating portion 6, but the programmable display 3 ′ is connected to the PLC 1 via a cable 12 such as a serial communication cable, a LAN cable, or a USB cable. Has been. Note that the programmable display 3 'and the PLC 1 may be connected by wire, or may be connected wirelessly by a wireless LAN, Bluetooth, IrDA, or the like. Similar to the operation module 3, the programmable display 3 ′ includes a display unit 10 and an operation unit 11. The operation unit 11 of the programmable display 3 ′ is a capacitive or pressure sensitive touch panel input device. As shown in FIG. 2, the display unit 10 can display device information (eg, product number, temperature, speed, etc.) read from the PLC 1. The display unit 10 reads device information periodically or irregularly and displays the device information. The device information to be read and the device information read timing are basically defined by the program in the programmable display 3 '. However, for example, it may be defined by a ladder program executed by the PLC 1. The display unit 10 is, for example, a liquid crystal display device or a self-luminous display device. The operation unit 11 may be provided with a plurality of buttons (keys) for an operator (operator) to input various instructions.

プログラマブル表示器3’について更に詳述する。プログラマブル表示器3’は、PLC1に接続された入出力機器やPLC1の動作状態(状態データ)を監視するための機器である。プログラマブル表示器3’の画面上には、画面構成要素として、ランプ、メータ、及びグラフなどの各種部品画像が表示される。プログラマブル表示器3’の画面上に表示される各種部品画像のレイアウトなどは、ユーザが作画エディタなどの画面表示データ作成ソフトウェアを用いて自由に編集することができる。作成された画面表示データが転送されたプログラマブル表示器3’では、PLC1から、たとえばPLC1に接続された入出力機器の状態データが読み出され、その状態データに応じて部品画像(図示せず)が変化する(たとえば、ランプが点灯したり消灯したり、メータの針が左右に振れたりする)。これにより、ユーザは、PLC1に接続された入出力機器の動作状態を監視することが可能になる。   The programmable display 3 'will be described in further detail. The programmable display 3 ′ is an input / output device connected to the PLC 1 or a device for monitoring the operation state (state data) of the PLC 1. On the screen of the programmable display 3 ′, various component images such as lamps, meters, and graphs are displayed as screen components. The layout of various component images displayed on the screen of the programmable display 3 'can be freely edited by a user using screen display data creation software such as a drawing editor. In the programmable display 3 ′ to which the created screen display data has been transferred, the status data of the input / output device connected to the PLC 1, for example, is read from the PLC 1, and a component image (not shown) according to the status data. Changes (for example, the lamp turns on or off, or the meter's needle swings from side to side). Thereby, the user can monitor the operation state of the input / output device connected to the PLC 1.

このように、プログラマブル表示器3’は、PLC1を監視するための独自プログラムを有しており、自己の判断で定期的又は非定期的に、PLC1からデバイス情報を読み出して、表示部10に表示する機能を有している。   As described above, the programmable display 3 ′ has a unique program for monitoring the PLC 1, reads device information from the PLC 1 periodically or irregularly based on its own judgment, and displays it on the display unit 10. It has a function to do.

なお、デバイスとは、上述したように、デバイス情報を格納するために設けられたメモリ上の領域を指す名称であるが、別の言い方をすれば、PLC1に接続される入出力機器の監視や制御のために制御プログラムで用いられる要素ということもでき、命令で使用するデータを与えたり、命令の実行結果を格納したりするために用いられる。たとえば、リレー、タイマー、カウンタ、データメモリ等が挙げられる。   The device is a name indicating an area on a memory provided for storing device information as described above. In other words, the device is used to monitor input / output devices connected to the PLC 1. It can also be referred to as an element used in a control program for control, and is used to give data used in an instruction and store an execution result of the instruction. For example, a relay, a timer, a counter, a data memory, etc. are mentioned.

デバイスには、入力機器からの入力信号に基づいてオン/オフされるビットデバイス(入力ビットデバイス)や、出力機器の動作を制御するためにオン/オフされるビットデバイス(出力ビットデバイス)、オン/オフではなく数値データが格納されるワードデバイスなどがある。   The device includes a bit device (input bit device) that is turned on / off based on an input signal from the input device, a bit device that is turned on / off to control the operation of the output device (output bit device), and on. There are word devices that store numerical data instead of / off.

プログラマブル表示器3’の通常動作について説明すると、(1)プログラマブル表示器3’は、画面上でモニタするデバイスについて、デバイスの値を読み出すためのデバイス読み出しコマンドをPLC1に対して発行する。次に、(2)PLC1は、受信したコマンドに指示されたデバイスの値を取得し、プログラマブル表示器3’へのレスポンスを作成して、これを送信する。その後、(3)プログラマブル表示器3’は、受け取ったレスポンスからデバイスの値を読み出し、画面上の表示を更新する。このようにして、プログラマブル表示器3’はPLC1の動作状態を監視することができる。   The normal operation of the programmable display 3 ′ will be described. (1) The programmable display 3 ′ issues a device read command for reading the device value to the PLC 1 for the device to be monitored on the screen. Next, (2) the PLC 1 acquires the value of the device designated by the received command, creates a response to the programmable display 3 ', and transmits it. Thereafter, (3) the programmable display 3 ′ reads the device value from the received response and updates the display on the screen. In this way, the programmable display 3 'can monitor the operating state of the PLC 1.

このようにプログラマブルロジックコントローラ用の外部機器は、PLC1に接続可能であれば十分である。よって、内蔵タイプのオペレーションモジュール3であってもよいし、外付けタイプのプログラマブル表示器3’であってもよい。そのため、以下では、プログラマブル表示器3’について説明することにする。また、外部機器は、必ずしも、操作部11や表示部10を必須とせず、オペレーションに関係しない他の外部機器(例:通信インタフェースモジュール、外部記憶装置モジュール、拡張ユニットなど)であってもよい。すなわち、外部機器は、後述するように、PLC1の本体2と通信する通信部61と、制御部60と、電波を受信せずに計時可能な計時ユニット(RTC62、電源63など)を最低限で備えていれば十分である。   Thus, it is sufficient that the external device for the programmable logic controller can be connected to the PLC 1. Therefore, it may be a built-in type operation module 3 or an external type programmable display 3 '. Therefore, hereinafter, the programmable display 3 'will be described. Further, the external device does not necessarily require the operation unit 11 and the display unit 10, and may be another external device (eg, a communication interface module, an external storage device module, an expansion unit, etc.) not related to the operation. That is, as will be described later, the external device has a communication unit 61 that communicates with the main body 2 of the PLC 1, a control unit 60, and a timing unit (RTC 62, power source 63, etc.) capable of timing without receiving radio waves. It is enough to have it.

図3は、PLC1の本体2のブロック図である。本体2の内部に設けられたコントローラは、CPUやASICなどの論理回路、メモリなどの記憶装置を備えている。   FIG. 3 is a block diagram of the main body 2 of the PLC 1. A controller provided in the main body 2 includes a logic circuit such as a CPU and an ASIC, and a storage device such as a memory.

リアルタイムクロック(RTC)37は、現在時刻を計時する第1の計時部の一例である。RTC電源40は、RTC37に電力を供給する電源である。RTC37は、RTC電源40の出力電圧を監視する電圧監視部38と、現在時刻を示す時刻データと、RTC37が正常に動作しているかどうかを示す制御情報を格納した格納部39を備えている。電圧監視部38は、たとえばPLC1の電源OFF時に、RTC電源40の出力電圧と閾値とを比較し、出力電圧が閾値未満になっているかどうかを示す制御情報を格納部39に格納する。なお、RTC37は、一次電池、二次電池またはキャパシタであるため、本体2に外部電源(商用交流電源など)から電力が供給されているか否かとは無関係に、電力をRTC37に供給する。   The real-time clock (RTC) 37 is an example of a first timer unit that measures the current time. The RTC power supply 40 is a power supply that supplies power to the RTC 37. The RTC 37 includes a voltage monitoring unit 38 that monitors the output voltage of the RTC power supply 40, time data indicating the current time, and a storage unit 39 that stores control information indicating whether the RTC 37 is operating normally. For example, when the power of the PLC 1 is turned off, the voltage monitoring unit 38 compares the output voltage of the RTC power supply 40 with a threshold value, and stores control information indicating whether the output voltage is less than the threshold value in the storage unit 39. Since the RTC 37 is a primary battery, a secondary battery, or a capacitor, power is supplied to the RTC 37 regardless of whether or not power is supplied to the main body 2 from an external power source (commercial AC power source or the like).

制御部20は、記憶部用ドライバ36を介して記憶部30にアクセスする。つまり、制御部20からのライトコマンドやリードコマンドにしたがって、記憶部用ドライバ36は、記憶部30へ情報を書き出す書き出し部、および、記憶部30から情報を読み出す読み出し部として機能する。記憶部30は、プログラム作成支援装置50から通信部35を介して受信したラダープログラム31やデバイス情報34などの設定情報を保持する保持部として機能する。デバイス情報34は、記憶部30に確保された記憶領域であるデバイス33に記憶される。ログデータ32は、制御部20がラダープログラム31を実行した結果を示すデータである。ログデータ32は、エラー等のイベントが発生した時刻データが含まれてもよい。よって、時刻データが誤っていると、ログデータ32の有用性が低下して好ましくない。   The control unit 20 accesses the storage unit 30 via the storage unit driver 36. That is, the storage unit driver 36 functions as a writing unit for writing information to the storage unit 30 and a reading unit for reading information from the storage unit 30 in accordance with a write command or a read command from the control unit 20. The storage unit 30 functions as a holding unit that holds setting information such as the ladder program 31 and device information 34 received from the program creation support device 50 via the communication unit 35. The device information 34 is stored in the device 33 that is a storage area secured in the storage unit 30. The log data 32 is data indicating the result of execution of the ladder program 31 by the control unit 20. The log data 32 may include time data when an event such as an error occurs. Therefore, if the time data is incorrect, the usefulness of the log data 32 decreases, which is not preferable.

制御部20は、本体2に接続されている被制御機器を、記憶部30に保持されている設定情報にしたがって制御する被制御機器制御部として機能する。制御部20は、被制御機器を制御する機能に加えて、本実施形態に特有の機能を実現する各種の制御部を備えている。時刻データ判定部21は、リアルタイムクロック(RTC)37が計時する現在時刻が正しいかどうかを判定する。RTC電源40は、一次電池、二次電池またはキャパシタであるため、たとえばPLC1の電源OFF時に電池の残量が少なくなる、すなわち、長い時間にわたって外部から電力が供給されなくなったりすると、RTC37に対して十分な電圧を供給できなくなってしまう。そこで、電圧監視部38がRTC電源40の出力電圧と閾値とを比較し、電池電圧の異常を検知できるようにしている。そして、出力電圧が閾値未満になっている場合には、RTC37が計時する時刻データの信頼性が低下していると判定する。   The control unit 20 functions as a controlled device control unit that controls the controlled device connected to the main body 2 according to setting information held in the storage unit 30. The control unit 20 includes various control units that realize functions specific to the present embodiment in addition to the function of controlling the controlled device. The time data determination unit 21 determines whether or not the current time measured by the real time clock (RTC) 37 is correct. Since the RTC power source 40 is a primary battery, a secondary battery or a capacitor, for example, when the power of the PLC 1 is turned off, the remaining amount of the battery is reduced, that is, when power is not supplied from the outside for a long time, the RTC 37 Sufficient voltage cannot be supplied. Therefore, the voltage monitoring unit 38 compares the output voltage of the RTC power supply 40 with a threshold value so that an abnormality in the battery voltage can be detected. If the output voltage is less than the threshold value, it is determined that the reliability of the time data counted by the RTC 37 has decreased.

なお、実際の現在時刻が誤っているかどうかとは無関係に、出力電圧が低下したか否かに応じて、時刻補正を実行してもよい。そのため、時刻データ判定部21は、オプションの制御部であり、省略されてもよい。逆に、出力電圧が低下したか否かとは無関係に、実際の現在時刻が誤っているかどうかに応じて、時刻補正を実行してもよい。この場合は、後述するフラグは、現在時刻が誤っているかどうかに応じて変更されるフラグとなる。   Note that time correction may be executed depending on whether or not the output voltage has dropped regardless of whether or not the actual current time is incorrect. Therefore, the time data determination unit 21 is an optional control unit and may be omitted. Conversely, time correction may be executed depending on whether the actual current time is incorrect, regardless of whether the output voltage has dropped. In this case, a flag to be described later is a flag that is changed according to whether the current time is incorrect.

フラグ制御部22は、RTC37の格納部39から制御情報を読み出し、RTC電源40の出力電圧が閾値未満に低下していることを制御情報が示しているかどうかを判定する。フラグ制御部22は、RTC電源40の出力電圧が閾値未満に低下していることを制御情報が示している場合、レジスタ41の電圧エラーフラグをオンにする(すなわち、電圧エラーフラグに1を設定する)。ここでは、電圧エラーフラグは、RTC電源40の出力電圧が閾値未満か閾値以上かに応じて変化するビットとして実装されることを想定している。このように、電圧エラーフラグが1になっている場合、電圧エラーフラグは、RTC37が計時する現在時刻の信頼性が低下している可能性があることを示している。RTC37が計時する現在時刻の信頼性が低下している可能性があることは、RTC電源40の出力電圧が閾値未満に低下していること、RTC37が計時する現在時刻を補正する必要があること、RTC37が計時する現在時刻が誤っていること等と実質的に同義であろう。   The flag control unit 22 reads the control information from the storage unit 39 of the RTC 37, and determines whether or not the control information indicates that the output voltage of the RTC power supply 40 has dropped below the threshold value. When the control information indicates that the output voltage of the RTC power supply 40 has dropped below the threshold value, the flag control unit 22 turns on the voltage error flag of the register 41 (that is, sets the voltage error flag to 1). To do). Here, it is assumed that the voltage error flag is implemented as a bit that changes depending on whether the output voltage of the RTC power supply 40 is less than or greater than the threshold. As described above, when the voltage error flag is 1, the voltage error flag indicates that the reliability of the current time measured by the RTC 37 may be lowered. There is a possibility that the reliability of the current time measured by the RTC 37 has decreased, that the output voltage of the RTC power supply 40 has decreased below the threshold, and that the current time measured by the RTC 37 needs to be corrected. This is substantially synonymous with the fact that the current time measured by the RTC 37 is incorrect.

一方で、電圧エラーフラグがオフ(すなわち、0)になっている場合、電圧エラーフラグは、RTC37が計時する現在時刻の信頼性が低下していないことを示している。RTC37が計時する現在時刻の信頼性が低下していないことは、RTC電源40の出力電圧が閾値以上であること、RTC37が計時する現在時刻を補正する必要がないこと、RTC37が計時する現在時刻が正しいことと実質的に同義であろう。なお、電圧エラーフラグは、デバイス33に1ビットのデバイス情報34として記憶されていてもよい。つまり、上述したビットデバイスに記憶されていてもよい。勿論、ワードデバイスに記憶されていてもよい。デバイス情報34は、PLC1の外部に公開することを目的とした情報であるため、プログラマブル表示器3’やオペレーションモジュール3などの外部機器やプログラム作成支援装置50は容易に電圧エラーフラグをデバイス情報34として取得できる。以下では、デバイス情報34を電圧エラーフラグとして説明する。 On the other hand, when the voltage error flag is off (that is, 0), the voltage error flag indicates that the reliability of the current time measured by the RTC 37 is not lowered. The fact that the reliability of the current time measured by the RTC 37 has not decreased is that the output voltage of the RTC power supply 40 is equal to or higher than the threshold, the current time measured by the RTC 37 need not be corrected, and the current time measured by the RTC 37. Is essentially synonymous with being correct. The voltage error flag may be stored in the device 33 as 1-bit device information 34. That is, it may be stored in the bit device described above. Of course, it may be stored in a word device. Since the device information 34 is information intended to be disclosed outside the PLC 1, an external device such as the programmable display 3 ′ and the operation module 3 and the program creation support device 50 can easily set the voltage error flag to the device information 34. Can be obtained as Hereinafter, the device information 34 will be described as a voltage error flag.

時刻補正部23は、電圧エラーフラグがプログラマブル表示器3’によって読み出された後にプログラマブル表示器3’からRTC37の現在時刻を補正するよう補正命令を受信すると、プログラマブル表示器3’から受信した時刻データでRTC37の現在時刻を補正する。   When the time correction unit 23 receives a correction command to correct the current time of the RTC 37 from the programmable display 3 ′ after the voltage error flag is read by the programmable display 3 ′, the time received from the programmable display 3 ′ The current time of the RTC 37 is corrected with the data.

通信部42は、プログラマブル表示器3’やオペレーションモジュール3などの外部機器と通信するためのユニットである。解釈部43は、通信部42により受信されたデータやコマンドなどを解釈し、解釈結果を制御部20に渡す。   The communication unit 42 is a unit for communicating with external devices such as the programmable display 3 ′ and the operation module 3. The interpretation unit 43 interprets data and commands received by the communication unit 42 and passes the interpretation result to the control unit 20.

図4は、プログラマブル表示器3’のブロック図である。制御部60は、表示部10への表示制御と、操作部11から入力される指示の受け付け制御と、通信部61によるPLC1の本体2との通信制御とを担当している。   FIG. 4 is a block diagram of the programmable display 3 '. The control unit 60 is in charge of display control on the display unit 10, reception control of instructions input from the operation unit 11, and communication control with the main body 2 of the PLC 1 by the communication unit 61.

プログラマブル表示器3’に搭載されたもう1つのリアルタイムクロック(RTC)62は、時刻を示す電波を受信せずに現在時刻を計時する第2の計時部の一例である。つまり、RTC62は、GPS衛星やAM・FM・短波などのラジオの電波により搬送される標準時刻信号を受信して現在時刻を取得する受信機ではない。つまり、RTC62は、PLC1に設けられたRTC37と同様に簡素な時計である。電源63は、RTC62に電力を供給する一次電池、二次電池またはキャパシタなどの電源である。   Another real-time clock (RTC) 62 mounted on the programmable display 3 ′ is an example of a second clock unit that clocks the current time without receiving a radio wave indicating the time. That is, the RTC 62 is not a receiver that receives a standard time signal carried by radio waves such as GPS satellites, AM / FM / short waves, and acquires the current time. That is, the RTC 62 is a simple timepiece similar to the RTC 37 provided in the PLC 1. The power source 63 is a power source such as a primary battery, a secondary battery, or a capacitor that supplies power to the RTC 62.

制御部60は、判定部64、補正命令作成部65および有効・無効制御部24を備えている。判定部64は、本体2の記憶部30またはレジスタ41に保持されている電圧エラーフラグを読み出し、PLC1のRTC37が計時する現在時刻の信頼性が低下している可能性があることを電圧エラーフラグが示しているかどうかを判定する。補正命令作成部65は、本体2から読み出した電圧エラーフラグがPLC1のRTC37が計時する現在時刻の信頼性が低下している可能性があることを示していることを判定部64から通知されると、プログラマブル表示器3’のRTC62が計時した現在時刻を示す時刻データを取得して補正命令(例:時刻補正コマンド)を作成して本体2に送信する。   The control unit 60 includes a determination unit 64, a correction command creation unit 65, and a valid / invalid control unit 24. The determination unit 64 reads the voltage error flag held in the storage unit 30 or the register 41 of the main body 2 and determines that the reliability of the current time measured by the RTC 37 of the PLC 1 may be lowered. Determine whether or not. The correction command generation unit 65 is notified from the determination unit 64 that the voltage error flag read from the main body 2 indicates that the reliability of the current time measured by the RTC 37 of the PLC 1 may be reduced. Then, time data indicating the current time measured by the RTC 62 of the programmable display 3 ′ is acquired, a correction command (eg, time correction command) is created and transmitted to the main body 2.

有効・無効制御部24は、PLC1の時刻補正部23が備える現在時刻の補正機能を有効にするか無効にするかを切り替える切り替え部として機能する。有効・無効制御部24は、プログラマブル表示器3’に接続された画面表示データ作成支援装置51(上述した画面表示データ作成ソフトウェアがインストールされたPC、図示せず)からの切り替え指示に基づいて、補正機能の有効/無効を切り替える。有効・無効制御部24は、本体2またはプログラマブル表示器3’に設けられたディップスイッチのオン/オフを監視することで、補正機能を有効にするか無効にするかを切り替えてもよい(オン⇒有効、オフ⇒無効)。オペレータは、RTC37の現在時刻をプログラマブル表示器3’の現在時刻で補正したくないときには、時刻補正機能をオフに設定してもよい。なお、ここでいう画面表示データ作成支援装置51は、PLC1に接続されるプログラム作成支援装置50と同じ装置であっても異なる装置であってもよい。   The valid / invalid control unit 24 functions as a switching unit that switches between enabling and disabling the current time correction function of the time correction unit 23 of the PLC 1. The valid / invalid control unit 24 is based on a switching instruction from a screen display data creation support device 51 (PC on which the above-described screen display data creation software is installed, not shown) connected to the programmable display 3 ′. Enable / disable the correction function. The valid / invalid control unit 24 may switch whether the correction function is valid or invalid by monitoring on / off of a dip switch provided in the main body 2 or the programmable display 3 ′ (on ⇒ Enabled, Off ⇒ Disabled). When the operator does not want to correct the current time of the RTC 37 with the current time of the programmable display 3 ', the operator may set the time correction function to OFF. The screen display data creation support device 51 referred to here may be the same device as the program creation support device 50 connected to the PLC 1 or a different device.

<フラグ制御処理>
図5は、本体2のフラグ制御部22が実行するフラグ制御処理を示すフローチャートである。
<Flag control process>
FIG. 5 is a flowchart showing a flag control process executed by the flag control unit 22 of the main body 2.

S501で、フラグ制御部22は、RTC37の格納部39から、電圧監視部38が出力した電圧監視情報を含む制御情報を読み出す。   In S <b> 501, the flag control unit 22 reads control information including the voltage monitoring information output from the voltage monitoring unit 38 from the storage unit 39 of the RTC 37.

S502で、フラグ制御部22は、RTC電源40の出力電圧が低下したかどうかを判定する。たとえば、フラグ制御部22は、RTC電源40の出力電圧が閾値未満に低下したことを制御情報から抽出した電圧監視情報が示しているかどうかを判定する。RTC電源40の出力電圧が閾値未満に低下していなければ、時刻を補正する必要はないため、本処理を終了する。あるいは、RTC電源40の出力電圧が閾値未満に低下していなければ、S505に進んで、フラグ制御部22は、電圧エラーフラグをオフにしたままである。一方で、RTC電源40の出力電圧が閾値未満に低下していれば、S503に進む。   In S502, the flag control unit 22 determines whether the output voltage of the RTC power supply 40 has decreased. For example, the flag control unit 22 determines whether or not the voltage monitoring information extracted from the control information indicates that the output voltage of the RTC power supply 40 has decreased below the threshold value. If the output voltage of the RTC power supply 40 has not decreased below the threshold value, it is not necessary to correct the time, and thus this process ends. Alternatively, if the output voltage of the RTC power supply 40 has not decreased below the threshold value, the process proceeds to S505, and the flag control unit 22 keeps the voltage error flag off. On the other hand, if the output voltage of the RTC power supply 40 has decreased below the threshold, the process proceeds to S503.

S503で、フラグ制御部22は、RTC37が計時する現在時刻の信頼性が低下している可能性があることを示すように電圧エラーフラグをオンに設定する。つまり、フラグ制御部22は、デバイス情報34のうち電圧エラーフラグに相当するデバイス情報を1に書き換える。   In step S503, the flag control unit 22 sets the voltage error flag to ON to indicate that the reliability of the current time measured by the RTC 37 may be reduced. That is, the flag control unit 22 rewrites the device information corresponding to the voltage error flag in the device information 34 to 1.

S504で、フラグ制御部22は、RTC37の現在時刻が補正されたかどうかを判定する。時刻補正部23がRTC37の現在時刻を補正したことを時刻補正部23から通知されると、フラグ制御部22は、RTC37の現在時刻が補正されたと判定し、S505に進む。RTC37の現在時刻が補正されていなければ、フラグ制御部22は、RTC37の現在時刻の補正が完了するのを待つ。   In S504, the flag control unit 22 determines whether or not the current time of the RTC 37 has been corrected. When notified from the time correction unit 23 that the time correction unit 23 has corrected the current time of the RTC 37, the flag control unit 22 determines that the current time of the RTC 37 has been corrected, and proceeds to S505. If the current time of the RTC 37 is not corrected, the flag control unit 22 waits for the correction of the current time of the RTC 37 to be completed.

S505で、フラグ制御部22は、RTC37が計時する現在時刻の信頼性が低下していないことを示すように電圧エラーフラグをオフに設定する。つまり、フラグ制御部22は、デバイス情報34のうち電圧エラーフラグに相当するデバイス情報を0に書き換える。   In S505, the flag control unit 22 sets the voltage error flag to OFF so as to indicate that the reliability of the current time measured by the RTC 37 has not deteriorated. That is, the flag control unit 22 rewrites the device information corresponding to the voltage error flag in the device information 34 to 0.

<時刻補正コマンドの作成処理>
図6は、プログラマブル表示器3’の制御部60が実行する時刻補正コマンドの作成処理を示したフローチャートである。
<Time correction command creation process>
FIG. 6 is a flowchart showing a time correction command creation process executed by the control unit 60 of the programmable display 3 ′.

S601で、判定部64は、電圧エラーフラグの読み出し条件が満たされているかどうかを判定する。電圧エラーフラグの読み出し条件の判定処理の詳細は図7を用いて説明する。なお、前提として、PLC1の電源は投入されているものとする。   In step S601, the determination unit 64 determines whether the voltage error flag read condition is satisfied. Details of the voltage error flag reading condition determination processing will be described with reference to FIG. As a premise, it is assumed that the power of the PLC 1 is turned on.

S701で、判定部64は、プログラマブル表示器3’が外部電源から電力を供給されて起動した直後かどうかを判定する。プログラマブル表示器3’が外部電源から電力を供給されて起動した直後であれば、時刻補正を実行するために、S702へ進む。   In S <b> 701, the determination unit 64 determines whether or not the programmable display 3 ′ has just started after being supplied with power from an external power source. If the programmable display 3 ′ has just been started after being supplied with power from an external power supply, the process proceeds to S <b> 702 to execute time correction.

プログラマブル表示器3’が本体2または外部電源から電力を供給されて起動した直後でなければ、S701に戻る。 If the programmable display 3 ′ is not immediately after being activated with power supplied from the main body 2 or an external power supply, the process returns to S <b> 701.

S702で、判定部64は、プログラマブル表示器3’が本体2に対して接続されているかどうかを判定する。プログラマブル表示器3’が本体2に接続されていれば、このタイミングで時刻を補正する。   In S <b> 702, the determination unit 64 determines whether the programmable display 3 ′ is connected to the main body 2. If the programmable display 3 'is connected to the main body 2, the time is corrected at this timing.

具体的には、たとえば、プログラマブル表示器3’とPLC1との間で通信コマンドが正常にやり取りできるようになったか否かが判定される。たとえば、プログラマブル表示器3’がPLC1に対して通信確立コマンドに対して、PLC1から適切な応答コマンド(ACK等)が帰ってきたか否かが判定される。   Specifically, for example, it is determined whether or not a communication command can be normally exchanged between the programmable display 3 ′ and the PLC 1. For example, the programmable display 3 ′ determines whether or not an appropriate response command (ACK or the like) has returned from the PLC 1 in response to the communication establishment command to the PLC 1.

ようするに、PLC1内に記憶されたデバイス情報を読み出せる状態になったか否かが判定される。プログラマブル表示器3’が本体2に対して接続されていることで、PLC1内に記憶されたデバイス情報を読み出せる状態になっていれば、S602に進む。そうでなければ、このような状態になるまで待機することになる。   Thus, it is determined whether or not the device information stored in the PLC 1 can be read. If the programmable display 3 ′ is connected to the main body 2 and the device information stored in the PLC 1 can be read, the process proceeds to S <b> 602. Otherwise, it will wait until it becomes such a state.

図6の説明に戻る。S602で、判定部64は、電圧エラーフラグに相当するデバイス情報34を読み出す。デバイス情報34は外部に公開されているため、プログラマブル表示器3’はこれを簡単に読み出すことができる。プログラマブルロジックコントローラにおいては、内部のRTCの制御情報を直接的に外部には公開していない。そこで、PLC1の外部からRTC37の動作状態を取得できるようにするために、外部に公開された記憶領域であるデバイス33に、電圧エラーフラグに相当するデバイス情報34を格納している。   Returning to the description of FIG. In S602, the determination unit 64 reads the device information 34 corresponding to the voltage error flag. Since the device information 34 is disclosed to the outside, the programmable display 3 'can easily read it. In the programmable logic controller, control information of the internal RTC is not directly disclosed to the outside. Therefore, in order to be able to acquire the operating state of the RTC 37 from outside the PLC 1, device information 34 corresponding to a voltage error flag is stored in the device 33 which is a storage area disclosed to the outside.

S603で、判定部64は、電圧エラーフラグがオンになっているかどうかを判定する。つまり、判定部64は、本体2に保持されている電圧エラーフラグがRTC37の計時する現在時刻の信頼性が低下している可能性があることを示しているかどうかを判定する。電圧エラーフラグがオンになっていなければ、本処理を終了する。一方で、電圧エラーフラグがオンになっていれば、S604に進む。つまり、判定部64は、本体2に保持されている電圧エラーフラグがRTC37の計時する現在時刻の信頼性が低下している可能性があることを補正命令作成部65に通知する。   In S603, the determination unit 64 determines whether the voltage error flag is turned on. That is, the determination unit 64 determines whether or not the voltage error flag held in the main body 2 indicates that the reliability of the current time measured by the RTC 37 may be reduced. If the voltage error flag is not turned on, this process ends. On the other hand, if the voltage error flag is on, the process proceeds to S604. In other words, the determination unit 64 notifies the correction command generation unit 65 that the voltage error flag held in the main body 2 may have reduced reliability of the current time measured by the RTC 37.

S604で、補正命令作成部65は、RTC62から現在時刻を示す時刻データを読み出す。   In step S <b> 604, the correction command generation unit 65 reads time data indicating the current time from the RTC 62.

S605で、補正命令作成部65は、RTC62から取得した時刻データを含む時刻補正コマンドを作成し、通信部61を介して本体2に送信する。   In step S <b> 605, the correction command generation unit 65 generates a time correction command including the time data acquired from the RTC 62 and transmits the time correction command to the main body 2 via the communication unit 61.

<時刻補正処理>
図8は、PLC1の時刻補正部23が実行する時刻補正処理を示すフローチャートである。
<Time correction processing>
FIG. 8 is a flowchart showing time correction processing executed by the time correction unit 23 of the PLC 1.

S801で、時刻補正部23は、プログラマブル表示器3’から時刻補正コマンドを受信したかどうかを判定する。解釈部43は、通信部42が受信したコマンドを解釈し、時刻補正コマンドを見つけると、時刻補正部23に時刻データとともに時刻補正命令を出力する。解釈部43から時刻補正命令を受信すると、時刻補正部23は、プログラマブル表示器3’から時刻補正コマンドを受信したと判定し、S802に進む。   In S801, the time correction unit 23 determines whether a time correction command is received from the programmable display 3 '. When the interpreter 43 interprets the command received by the communication unit 42 and finds the time correction command, the interpreter 43 outputs a time correction command to the time correction unit 23 together with the time data. When receiving the time correction command from the interpretation unit 43, the time correction unit 23 determines that the time correction command has been received from the programmable display 3 ', and proceeds to S802.

S802で、時刻補正部23は、受信した時刻データをRTC37に設定することで、RTC37の計時する現在時刻を補正する。   In step S <b> 802, the time correction unit 23 sets the received time data in the RTC 37 to correct the current time counted by the RTC 37.

S803で、時刻補正部23は電圧エラーフラグをオフにする。つまり、時刻補正部23は時刻の補正が終了したことをフラグ制御部22に通知する。フラグ制御部22は、この通知にしたがって電圧エラーフラグをオフにする。   In step S803, the time correction unit 23 turns off the voltage error flag. That is, the time correction unit 23 notifies the flag control unit 22 that the time correction has been completed. The flag control unit 22 turns off the voltage error flag according to this notification.

<時刻補正機能の有効と無効との切り替え>
プログラマブル表示器3’のRTC62の現在時刻よりも、PLC1が取得可能な他の現在時刻が信頼できるときがある。たとえば、PLC1がネットワーク上で動作する時刻サーバ(NTPサーバなど)から現在時刻の時刻データを取得できることがある。また、操作部11を通じて手動で現在時刻をオペレータが設定したいと希望することもあるだろう。このような場合には、上述した時刻補正部23によるプログラマブル表示器3’を利用した時刻補正機能を無効化できると便利である。
<Switching the time correction function between enabled and disabled>
There are times when other current times that can be acquired by the PLC 1 are more reliable than the current time of the RTC 62 of the programmable display 3 ′. For example, the time data of the current time may be acquired from a time server (such as an NTP server) on which the PLC 1 operates on the network. The operator may wish to manually set the current time through the operation unit 11. In such a case, it is convenient if the time correction function using the programmable display 3 ′ by the time correction unit 23 described above can be invalidated.

図9は、プログラマブル表示器3’に接続される画面表示データ作成支援装置51の表示装置に表示されるユーザインタフェースの一例である。ユーザインタフェース90は、PLC1のRTC37が計時する現在時刻を、画面表示データ作成支援装置51が有するカレンダタイマに合わせるかどうかを決定するチェックボックス91が含まれている。また、PLC1のRTC電源40の出力電圧が低下したときにRTC37の現在時刻を修正するか否か、つまり、時刻補正部23の時刻補正機能を有効にするか無効にするかを選択するチェックボックス92が設けられている。画面表示データ作成支援装置51は、チェックボックス92にチェックがつけられたことを検知すると、有効・無効制御部24に時刻補正部23の時刻補正機能を有効にするよう命令する。一方で、画面表示データ作成支援装置51は、チェックボックス92からチェックが外されたことを検知すると、有効・無効制御部24に時刻補正部23の時刻補正機能を無効にするよう命令する。このときに、チェックボックス91にチェックがつけられていること検知すると、画面表示データ作成支援装置51は、カレンダタイマから時刻データを取得し、これを含む時刻補正命令を作成して制御部20へ送信する。制御部20は、時刻補正命令にしたがってRTC37の現在時刻をカレンダタイマに合わせる。カレンダタイマは一例にすぎず、制御部20は、直接的にNTPサーバにアクセスして時刻同期を実行してもよい。   FIG. 9 is an example of a user interface displayed on the display device of the screen display data creation support device 51 connected to the programmable display 3 ′. The user interface 90 includes a check box 91 for determining whether or not to match the current time measured by the RTC 37 of the PLC 1 with the calendar timer included in the screen display data creation support device 51. Also, a check box for selecting whether to correct the current time of the RTC 37 when the output voltage of the RTC power supply 40 of the PLC 1 is lowered, that is, whether to enable or disable the time correction function of the time correction unit 23. 92 is provided. When the screen display data creation support device 51 detects that the check box 92 is checked, it instructs the valid / invalid control unit 24 to validate the time correction function of the time correction unit 23. On the other hand, when the screen display data creation support device 51 detects that the check box 92 is unchecked, it instructs the valid / invalid control unit 24 to invalidate the time correction function of the time correction unit 23. At this time, if it is detected that the check box 91 is checked, the screen display data creation support device 51 acquires time data from the calendar timer, creates a time correction command including this, and sends it to the control unit 20. Send. The control unit 20 adjusts the current time of the RTC 37 to the calendar timer according to the time correction command. The calendar timer is merely an example, and the control unit 20 may directly access the NTP server and execute time synchronization.

なお、ここではチェックボックスをつける/外すという動作に連動して時刻補正命令が制御部20に送られるようにしたが、別の方法も可能である。具体的には、画面表示データ作成支援装置51の表示画面で、ユーザが有効・無効を選択し、これが設定情報として保存される。そして、この設定情報がプログラマブル表示器3’に転送されたとき、この設定情報はプログラマブル表示器3’内のメモリに格納される。そして、有効・無効制御部24によって時刻補正機能の有効・無効が切り替わる。   Here, the time correction command is sent to the control unit 20 in conjunction with the operation of adding / deselecting the check box, but another method is also possible. Specifically, the user selects valid / invalid on the display screen of the screen display data creation support apparatus 51, and this is stored as setting information. When the setting information is transferred to the programmable display 3 ', the setting information is stored in a memory in the programmable display 3'. Then, the validity / invalidity control unit 24 switches the validity / invalidity of the time correction function.

以上説明したように、本発明によれば、PLC1の本体2に設けられたRTC37に電力を供給するRTC電源40の出力電圧が低下してくると、本体2に接続されたプログラマブル表示器3’のRTC62から供給された時刻データでRTC37の現在時刻が補正される。プログラマブル表示器3’のRTC62は、時刻を示す電波を受信せずに現在時刻を計時できるため、電波の届かない工場等の現場でもPLC1の現在時刻を補正できる。また、ネットワークを介して端末装置をGPS受信機に接続せずに、プログラマブル表示器3’のRTC62から供給された時刻データでRTC37の現在時刻を補正できる。よって、従来よりも簡易かつ確実な方法でPLC1の時刻情報を補正できるようになる。   As described above, according to the present invention, when the output voltage of the RTC power supply 40 that supplies power to the RTC 37 provided in the main body 2 of the PLC 1 decreases, the programmable display 3 ′ connected to the main body 2. The current time of the RTC 37 is corrected with the time data supplied from the RTC 62. Since the RTC 62 of the programmable display 3 'can measure the current time without receiving a radio wave indicating the time, the current time of the PLC 1 can be corrected even at a site such as a factory where the radio wave does not reach. Further, the current time of the RTC 37 can be corrected with the time data supplied from the RTC 62 of the programmable display 3 'without connecting the terminal device to the GPS receiver via the network. Therefore, the time information of the PLC 1 can be corrected by a simpler and more reliable method than before.

PLC1とプログラマブル表示器3’の時刻補正システムのシステム動作について纏めると、以下のようになる。まず、(1)PLC1とプログラマブル表示器3’の電源を投入する。(2)PLC1は、PLC1内部のRTCから時刻データおよび制御情報を読み出し、時刻データの信頼性を確認できなかった場合には、デバイスの「RTC電圧低下エラー」フラグをONする。(3)PLC1はラダープログラムの実行を開始する。(4)プログラマブル表示器3’は、内部の不揮発性メモリに保持していた設定データに応じてPLC1との通信を開始する。(5)プログラマブル表示器3’は、PLCに対して「RTC電圧低下エラー」フラグを読み出す通信コマンドを発行する。(6)PLC1は、受信したコマンドに従って、「RTC電圧低下エラー」フラグの値を取得し、レスポンスを返す。(7)プログラマブル表示器3’は、受け取ったレスポンスを確認し、「RTC電圧低下エラー」フラグがONしていたら、PLC1の時刻データを補正するために、プログラマブル表示器3’内部のRTCから時刻データを取得する。(8)プログラマブル表示器3’は、(7)で取得した時刻データをもとに、PLC1への時刻設定コマンドを発行する。(9)PLC1は受け取ったコマンドから時刻データを取得し、PLC1内部のRTCに対して時刻を設定する。同時に、デバイスの「RTC電圧低下エラー」フラグをOFFする。これらのうち、(3)と(4)〜(9)は非同期に実行される。   The system operation of the time correction system of the PLC 1 and the programmable display 3 ′ is summarized as follows. First, (1) the power of the PLC 1 and the programmable display 3 'is turned on. (2) The PLC 1 reads the time data and control information from the RTC inside the PLC 1, and turns on the “RTC voltage drop error” flag of the device when the reliability of the time data cannot be confirmed. (3) The PLC 1 starts executing the ladder program. (4) The programmable display 3 ′ starts communication with the PLC 1 according to the setting data held in the internal nonvolatile memory. (5) The programmable display 3 'issues a communication command for reading the "RTC voltage drop error" flag to the PLC. (6) The PLC 1 acquires the value of the “RTC voltage drop error” flag according to the received command, and returns a response. (7) The programmable display 3 ′ confirms the received response, and if the “RTC voltage drop error” flag is ON, the time from the RTC inside the programmable display 3 ′ is corrected to correct the time data of the PLC1. Get the data. (8) The programmable display 3 'issues a time setting command to the PLC 1 based on the time data acquired in (7). (9) The PLC 1 acquires time data from the received command and sets the time for the RTC in the PLC 1. At the same time, the “RTC voltage drop error” flag of the device is turned OFF. Of these, (3) and (4) to (9) are executed asynchronously.

このように動作する時刻補正システムによれば、従来よりも簡易かつ確実な方法でPLC1の時刻情報を補正できるようになる。   According to the time correction system that operates in this way, the time information of the PLC 1 can be corrected by a simpler and more reliable method than in the past.

また、本発明によれば、PLC1の外部に公開されたデバイス33に電圧エラーフラグをデバイス情報34として記憶させるため、PLC1の外部から容易に電圧エラーフラグを読み出せるようになる。   In addition, according to the present invention, the voltage error flag is stored as the device information 34 in the device 33 disclosed outside the PLC 1, so that the voltage error flag can be easily read from the outside of the PLC 1.

また、本発明によれば、PLC1が起動したときやプログラマブル表示器3’が起動したときなどに、電圧エラーフラグを解析して時刻補正を実行するため、誤った現在時刻がPLC1の制御に及ぼす影響を低減できる。   In addition, according to the present invention, when the PLC 1 is activated or when the programmable display 3 ′ is activated, the voltage error flag is analyzed and time correction is performed, so that an incorrect current time affects the control of the PLC 1. The impact can be reduced.

また、本発明によれば、プログラマブル表示器3’やオペレーションモジュール3、シリアル通信モジュールなど、PLC1に頻繁に接続される外部機器と連携して現在時刻を補正するため、オペレータが特に意識することなく、現在時刻を自動で補正できるようになる。   In addition, according to the present invention, the current time is corrected in cooperation with external devices that are frequently connected to the PLC 1, such as the programmable display 3 ', the operation module 3, and the serial communication module, so that the operator is not particularly conscious. The current time can be automatically corrected.

また、本発明によれば、外部機器を利用した時刻補正機能を無効に切り替えることができる。そのため、オペレータが手動で時刻を補正したり、より高精度な時刻サーバから時刻を入手して補正したりしたい場合には、時刻補正機能を無効化は便利であろう。   According to the present invention, the time correction function using an external device can be switched to invalid. Therefore, if the operator manually corrects the time or obtains and corrects the time from a more accurate time server, it is convenient to disable the time correction function.

また、外部機器に備えられた計時部もRTCとすることで、本発明の適用範囲が広がる。一般にRTCは多くのモジュールに搭載されている。そのため、既存の外部機器のファームウエアをアップデートすることで、本発明を実現することも可能となる。PLC1については、ファームウエアのアップデートまたはラダープログラムによって本発明を実装できる。   Moreover, the scope of application of the present invention can be expanded by using an RTC for the timekeeping unit provided in the external device. Generally, the RTC is mounted on many modules. Therefore, the present invention can be realized by updating the firmware of an existing external device. For the PLC 1, the present invention can be implemented by firmware update or a ladder program.

Claims (9)

プログラマブルロジックコントローラの本体と、前記本体に対して接続された外部機器と、を備えるプログラマブルロジックコントローラの時刻補正システムであって、
前記プログラマブルロジックコントローラは、
現在時刻を計時する第1の計時部と、
前記本体に電力が供給されているか否かとは無関係に、前記第1の計時部に電力を供給する電源と、
前記電源の出力電圧を監視する電圧監視部と、
前記電源の出力電圧が閾値未満に低下すると、前記第1の計時部が計時する現在時刻の信頼性が低下している可能性があることを示すようにフラグを制御して記憶部に記憶させるフラグ制御部と、
前記第1の計時部の現在時刻を補正する時刻補正部と
を備え、
前記外部機器は、
現在時刻を計時する第2の計時部と、
前記本体の記憶部に保持されている前記フラグを読み出し、前記第1の計時部が計時する現在時刻の信頼性が低下している可能性があることを当該フラグが示しているかどうかを判定する判定部と、
前記本体の記憶部から読み出した前記フラグが前記第1の計時部が計時する現在時刻の信頼性が低下している可能性があることを示していると前記判定部が判定すると、前記第2の計時部が計時した現在時刻を示す時刻データを取得して、前記第1の計時部の現在時刻を補正するための補正命令を作成して、該時刻データとともに前記本体に送信する補正命令作成部と、
を備え、
前記時刻補正部は、前記本体が前記補正命令を受信したときに、前記補正命令とともに受信した時刻データで前記第1の計時部の現在時刻を補正することを特徴とするプログラマブルロジックコントローラの時刻補正システム。
A programmable logic controller time correction system comprising a programmable logic controller body and an external device connected to the body,
The programmable logic controller is
A first timekeeping section that measures the current time;
Regardless of whether power is supplied to the main body, a power supply that supplies power to the first timekeeping unit;
A voltage monitoring unit for monitoring the output voltage of the power supply;
When the output voltage of the power source falls below a threshold value, the flag is controlled and stored in the storage unit so as to indicate that the reliability of the current time measured by the first timer unit may be reduced. A flag controller;
A time correction unit for correcting the current time of the first time measuring unit,
The external device is
A second timekeeping section for measuring the current time;
The flag held in the storage unit of the main body is read, and it is determined whether or not the flag indicates that the reliability of the current time measured by the first timing unit may be lowered A determination unit;
When the determination unit determines that the flag read from the storage unit of the main body indicates that there is a possibility that the reliability of the current time measured by the first time measuring unit is lowered, the second A correction command for acquiring the time data indicating the current time measured by the timer unit, creating a correction command for correcting the current time of the first time measuring unit, and transmitting the correction command to the main body together with the time data And
With
When the main body receives the correction command, the time correction unit corrects the current time of the first timekeeping unit with the time data received together with the correction command. system.
前記フラグ制御部は、前記記憶部に確保され、前記本体の外部に公開された記憶領域であるデバイスにデバイス情報として前記フラグを記憶させることを特徴とする請求項1に記載のプログラマブルロジックコントローラの時刻補正システム。   2. The programmable logic controller according to claim 1, wherein the flag control unit stores the flag as device information in a device that is a storage area that is secured in the storage unit and is open to the outside of the main body. Time correction system. 前記外部機器の前記判定部は、
前記外部機器が電力を供給されて前記外部機器が起動したとき、
前記外部機器が前記本体に対して有線接続または無線接続されたとき、
前記外部機器の表示部に表示する前記フラグとは異なるデバイス情報を定期的または非定期的に読み出すとき、
前記外部機器が前記本体に結合された状態で前記本体に電力が供給されて前記本体および前記外部機器が起動したとき、
の少なくとも1つのタイミングで前記フラグを前記本体から読み出すことを特徴とする請求項1または2に記載のプログラマブルロジックコントローラの時刻補正システム。
The determination unit of the external device is
When the external device is activated when power is supplied to the external device,
When the external device is wired or wirelessly connected to the main body,
When reading the device information different from the flag displayed on the display unit of the external device periodically or irregularly,
When the main body and the external device are activated by supplying power to the main body in a state where the external device is coupled to the main body,
The time correction system for a programmable logic controller according to claim 1, wherein the flag is read from the main body at least at one timing.
前記外部機器は、前記本体のデバイスから読み出したデバイス情報を表示する表示部と、前記本体に対して情報を入力するための操作を受け付ける操作部とを備えたオペレーションモジュールであることを特徴とする請求項1ないし3のいずれか1項に記載のプログラマブルロジックコントローラの時刻補正システム。   The external device is an operation module including a display unit that displays device information read from a device of the main body, and an operation unit that receives an operation for inputting information to the main body. The time correction system of the programmable logic controller according to any one of claims 1 to 3. 前記時刻補正部が備える前記第1の計時部の現在時刻の補正機能を有効にするか無効にするかを切り替える切り替え部をさらに備えることを特徴とする請求項1ないし4のいずれか1項に記載のプログラマブルロジックコントローラの時刻補正システム。   5. The switching unit according to claim 1, further comprising a switching unit that switches between enabling and disabling a current time correction function of the first time measuring unit included in the time correction unit. Programmable logic controller time correction system of description. 前記第1の計時部および前記第2の計時部のうち少なくとも一方はリアルタイムクロックであることを特徴とする請求項1ないし5のいずれか1項に記載のプログラマブルロジックコントローラの時刻補正システム。   6. The time correction system for a programmable logic controller according to claim 1, wherein at least one of the first timer unit and the second timer unit is a real-time clock. 本体に外部機器が接続可能なプログラマブルロジックコントローラであって、
現在時刻を計時する第1の計時部と、
前記本体に電力が供給されているか否かとは無関係に、前記第1の計時部に電力を供給する電源と、
前記電源の出力電圧を監視する電圧監視部と、
前記電源の出力電圧が閾値未満に低下すると、前記第1の計時部が計時する現在時刻の信頼性が低下している可能性があることを示すようにフラグを制御して記憶部に記憶させるフラグ制御部と、
前記フラグ制御部の制御に起因して前記外部機器から受信した時刻データで前記第1の計時部の現在時刻を補正する時刻補正部と
を備えることを特徴とするプログラマブルロジックコントローラ。
A programmable logic controller that can be connected to an external device.
A first timekeeping section that measures the current time;
Regardless of whether power is supplied to the main body, a power supply that supplies power to the first timekeeping unit;
A voltage monitoring unit for monitoring the output voltage of the power supply;
When the output voltage of the power source falls below a threshold value, the flag is controlled and stored in the storage unit so as to indicate that the reliability of the current time measured by the first timer unit may be reduced. A flag controller;
A programmable logic controller comprising: a time correction unit that corrects the current time of the first timekeeping unit with time data received from the external device due to control of the flag control unit.
現在時刻を計時する第1の計時部を備えたプログラマブルロジックコントローラ用の外部機器であって、
現在時刻を計時する第2の計時部と、
前記プログラマブルロジックコントローラの本体の記憶部に保持されているフラグを読み出し、当該フラグが前記第1の計時部の計時する現在時刻の信頼性が低下している可能性があることを示しているかどうかを判定する判定部と、
前記本体の記憶部から読み出した前記フラグが前記第1の計時部の計時する現在時刻の信頼性が低下している可能性があることを示していると前記判定部が判定すると、前記第2の計時部が計時する現在時刻を示す時刻データを取得して補正命令を作成して前記本体に送信する補正命令作成部と
を備えることを特徴とする外部機器。
An external device for a programmable logic controller having a first timekeeping unit that measures the current time,
A second timekeeping section for measuring the current time;
Whether the flag held in the storage unit of the main body of the programmable logic controller is read, and whether the flag indicates that the reliability of the current time measured by the first timing unit may be reduced A determination unit for determining
If the determination unit determines that the flag read from the storage unit of the main body indicates that there is a possibility that the reliability of the current time measured by the first time measurement unit is reduced, the second An external device comprising: a correction command generation unit that acquires time data indicating a current time measured by the time measurement unit, generates a correction command, and transmits the correction command to the main body.
プログラマブルロジックコントローラの時刻補正システムであって、
本体と、
前記本体に対して有線接続または無線接続された外部機器と
を備え、
前記本体は、
現在時刻を計時する第1の計時部と、
前記本体に電力が供給されているか否かとは無関係に、前記第1の計時部に電力を供給する電源と、
前記電源の出力電圧を監視する電圧監視部と、
前記電源の出力電圧が閾値未満か閾値以上かに応じて変化するビットを記憶した記憶部と、
前記ビットが前記外部機器から読み出された後に前記外部機器から前記第1の計時部の現在時刻を補正するよう補正命令を受信すると、前記外部機器から前記補正命令とともに受信した時刻データで前記第1の計時部の現在時刻を補正する時刻補正部と
を備え、
前記外部機器は、
現在時刻を計時する第2の計時部と、
前記本体の記憶部に保持されている前記ビットを読み出し、前記電源の出力電圧が閾値未満に低下したことを当該ビットが示している場合、前記第2の計時部が計時した現在時刻を示す時刻データを取得して前記補正命令を作成して前記本体に送信する補正命令作成部と
を備えることを特徴とするプログラマブルロジックコントローラの時刻補正システム。
A time correction system for a programmable logic controller,
The body,
An external device wired or wirelessly connected to the main body,
The body is
A first timekeeping section that measures the current time;
Regardless of whether power is supplied to the main body, a power supply that supplies power to the first timekeeping unit;
A voltage monitoring unit for monitoring the output voltage of the power supply;
A storage unit storing bits that change depending on whether the output voltage of the power source is less than a threshold value or more than a threshold value;
When a correction command is received from the external device to correct the current time of the first timekeeping unit after the bit is read from the external device, the time data received together with the correction command from the external device A time correction unit that corrects the current time of the timekeeping unit of 1,
The external device is
A second timekeeping section for measuring the current time;
When the bit stored in the storage unit of the main body is read and the bit indicates that the output voltage of the power source has dropped below a threshold, the time indicating the current time measured by the second clock unit A time correction system for a programmable logic controller, comprising: a correction command generation unit that acquires data, generates the correction command, and transmits the correction command to the main body.
JP2012194554A 2012-09-04 2012-09-04 Programmable logic controller, time correction system for the same, and external apparatus for the programmable logic controller Pending JP2014052189A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012194554A JP2014052189A (en) 2012-09-04 2012-09-04 Programmable logic controller, time correction system for the same, and external apparatus for the programmable logic controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012194554A JP2014052189A (en) 2012-09-04 2012-09-04 Programmable logic controller, time correction system for the same, and external apparatus for the programmable logic controller

Publications (1)

Publication Number Publication Date
JP2014052189A true JP2014052189A (en) 2014-03-20

Family

ID=50610799

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012194554A Pending JP2014052189A (en) 2012-09-04 2012-09-04 Programmable logic controller, time correction system for the same, and external apparatus for the programmable logic controller

Country Status (1)

Country Link
JP (1) JP2014052189A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108226756A (en) * 2018-01-29 2018-06-29 深圳市兴威帆电子技术有限公司 The test system and its test method of a kind of clock chip
KR101977959B1 (en) * 2017-12-04 2019-05-13 현대오트론 주식회사 An Apparatus and a Method For Providing Real Time Clock For Vehicles
JP6664547B1 (en) * 2018-10-29 2020-03-13 三菱電機株式会社 Programmable logic controller system and data analysis method
JP2020159853A (en) * 2019-03-26 2020-10-01 パナソニックIpマネジメント株式会社 Time switch

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101977959B1 (en) * 2017-12-04 2019-05-13 현대오트론 주식회사 An Apparatus and a Method For Providing Real Time Clock For Vehicles
CN108226756A (en) * 2018-01-29 2018-06-29 深圳市兴威帆电子技术有限公司 The test system and its test method of a kind of clock chip
CN108226756B (en) * 2018-01-29 2020-06-02 深圳市兴威帆电子技术有限公司 Test system and test method of clock chip
JP6664547B1 (en) * 2018-10-29 2020-03-13 三菱電機株式会社 Programmable logic controller system and data analysis method
CN112997123A (en) * 2018-10-29 2021-06-18 三菱电机株式会社 Programmable logic controller, programmable logic controller system, and data analysis method
CN112997123B (en) * 2018-10-29 2021-12-03 三菱电机株式会社 Programmable logic controller system and data analysis method
JP2020159853A (en) * 2019-03-26 2020-10-01 パナソニックIpマネジメント株式会社 Time switch

Similar Documents

Publication Publication Date Title
JP6626315B2 (en) Monitoring device for programmable logic controller and programmable logic controller system
JP5760661B2 (en) Sensor device and sensor system
CN104423367A (en) Method for providing data for a mobile device from a field device, computer program and arrangement for executing same
JP2014052189A (en) Programmable logic controller, time correction system for the same, and external apparatus for the programmable logic controller
KR20190011617A (en) sensor mounted wafer, and apparatus for storaging thereof
CN105393551B (en) Wireless device and interface module
CN102135426A (en) Laser swinger based on bidirectional remote control mode and remote control method thereof
JP5260613B2 (en) Air conditioner
US10282013B2 (en) Programmable display device
JP2015162893A (en) wireless communication device
KR20160034732A (en) Internet of things system and method for changing battery of sensor node in the same
US11987384B2 (en) Timing apparatus
JP5663678B2 (en) Frame generation device, reception device, data transmission / reception system, frame generation method and reception method
KR101452692B1 (en) Iot-based termination apparatus of assembly type
JP5452754B2 (en) Air conditioner
JP6199202B2 (en) Wireless communication device
JP5186421B2 (en) Method for changing operation mode of wireless measurement system and wireless communication device
KR100961614B1 (en) Wireless strain measurement device having power saving functions and system using thereof
JP5427286B2 (en) Air conditioner
JP2010108417A (en) Radio meter reading system and handy terminal for radio meter reading
JP5427311B2 (en) Air conditioner
JP2021005274A (en) Wireless communication equipment for measuring instrument, measuring instrument, measuring system, and program for measuring system
JP2013210186A (en) Air conditioner
JP2003272075A (en) Radio transmission system
JP6468730B2 (en) Wireless communication system