JP6626315B2 - Monitoring device for programmable logic controller and programmable logic controller system - Google Patents

Monitoring device for programmable logic controller and programmable logic controller system Download PDF

Info

Publication number
JP6626315B2
JP6626315B2 JP2015207475A JP2015207475A JP6626315B2 JP 6626315 B2 JP6626315 B2 JP 6626315B2 JP 2015207475 A JP2015207475 A JP 2015207475A JP 2015207475 A JP2015207475 A JP 2015207475A JP 6626315 B2 JP6626315 B2 JP 6626315B2
Authority
JP
Japan
Prior art keywords
unit
value
time
buffer memory
cpu
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.)
Expired - Fee Related
Application number
JP2015207475A
Other languages
Japanese (ja)
Other versions
JP2017079009A (en
Inventor
正憲 北
正憲 北
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 JP2015207475A priority Critical patent/JP6626315B2/en
Publication of JP2017079009A publication Critical patent/JP2017079009A/en
Application granted granted Critical
Publication of JP6626315B2 publication Critical patent/JP6626315B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、プログラマブル・ロジック・コントローラのモニタ装置に関する。   The present invention relates to a monitor device for a programmable logic controller.

プログラマブル・ロジック・コントローラ(以下、PLCと称す)は、FA(Factory Automation)制御システムにおいて広く使用されているシーケンス制御装置であり、ラダープログラムと呼ばれる専用プログラムにしたがって動作する。操作者(オペレータ)は、リミットスイッチ、センサ、温度計などの入力機器や、電磁開閉器、ソレノイド、モータ、アクチュエータ、シリンダ、リレー、位置決めシステムなどの出力機器をPLCに接続し、ラダープログラムによってこれらの被制御機器を制御する。   A programmable logic controller (hereinafter, referred to as a PLC) is a sequence control device widely used in an FA (Factory Automation) control system, and operates according to a dedicated program called a ladder program. The 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. Of the controlled device.

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

PLCは一般に基本ユニット(CPUユニット)と拡張ユニットにより構成される。CPUユニットと拡張ユニットは予め割り付けられたデバイスを通じてスキャン周期ごとに実行されるリフレッシュによってデバイス値を相互に交換する。このようなデバイスはデータメモリと呼ばれることもある。データメモリとは別に拡張ユニットにはバッファメモリが設けられる。CPUユニットはラダープログラム中に記述された専用の命令語にしたがって、バス通信によってバッファメモリにアクセスし、バッファメモリを読み書きする。   The PLC is generally composed of a basic unit (CPU unit) and an extension unit. The CPU unit and the extension unit exchange device values with each other by refresh executed at each scan cycle through devices allocated in advance. Such a device is sometimes called a data memory. In addition to the data memory, the extension unit is provided with a buffer memory. The CPU unit accesses the buffer memory by bus communication according to a dedicated command described in the ladder program, and reads and writes the buffer memory.

プログラム作成支援装置で作成したラダープログラムをデバッグしたり、チューニングしたりするためには、実際にラダープログラムをCPUユニットで実行し、実行中におけるCPUユニットや拡張ユニットのデバイス値やバッファメモリが想定した値となっているかどうかを判断する必要がある。特許文献1によれば、CPUユニットや拡張ユニットからデバイス値やバッファメモリを読み出してバッファメモリ値を表示するPLC動作表示システムが表示されている。   In order to debug or tune the ladder program created by the program creation support device, the ladder program was actually executed by the CPU unit, and the device values and buffer memory of the CPU unit and extension unit during execution were assumed. It is necessary to determine whether it is a value. According to Patent Literature 1, a PLC operation display system that reads a device value or a buffer memory from a CPU unit or an extension unit and displays the buffer memory value is displayed.

特開2010−102475号公報JP 2010-102475 A

特許文献1は、CPUユニットや拡張ユニットから取得されたデバイス値やバッファメモリ値が表示されるため、デバッグやチューニングに有用であった。しかし、CPUユニットのクロック(タイマー)と拡張ユニットのクロックとが同期していない場合、CPUユニットから取得したデータと拡張ユニットから取得したデータに時間的な齟齬が生じ、問題の原因を見つけることを困難にしていた。そこで、本発明は、CPUユニットから取得したデータの時間軸と拡張ユニットから取得したデータの時間軸とを正確に揃えて表示することを目的とする。   Patent Literature 1 is useful for debugging and tuning because a device value and a buffer memory value obtained from a CPU unit and an extension unit are displayed. However, if the clock (timer) of the CPU unit and the clock of the extension unit are not synchronized, a time inconsistency occurs between the data acquired from the CPU unit and the data acquired from the extension unit, and it is necessary to find the cause of the problem. It was difficult. Accordingly, it is an object of the present invention to accurately align and display the time axis of data acquired from a CPU unit and the time axis of data acquired from an extension unit.

本発明は、たとえば、
CPUユニットと、前記CPUユニットと通信する拡張ユニットとを有するプログラマブル・ロジック・コントローラと接続され、当該プログラマブル・ロジック・コントローラの動作状態をモニタするモニタ装置であって、
前記プログラマブル・ロジック・コントローラは、
前記CPUユニットの時刻情報と拡張ユニットの時刻情報とが同期され、前記CPUユニットと前記拡張ユニットのそれぞれのデバイス値はスキャン周期とは異なるユニット間同期周期ごとにユニット間同期リフレッシュとして更新され、
前記CPUユニットおよび前記拡張ユニットは同期されたそれぞれの内部における前記ユニット間同期周期にしたがって各々のプログラムを実行し、
前記CPUユニットは、
前記プログラマブル・ロジック・コントローラの動作状態を示すデバイス値が格納される複数のデバイスからなるデバイスメモリと、
前記ユニット間同期周期を管理し、前記デバイス値が前記デバイスメモリに格納される時刻を管理するためのCPUユニットタイマーと、
前記ユニット間同期周期にしたがって、前記デバイス値を参照してユーザプログラムを実行するユーザプログラム実行部と、
前記ユニット間同期リフレッシュにしたがって、前記デバイスメモリの前記デバイス値と当該デバイス値の格納時刻に関する時刻情報を格納する第一リングバッファとを有し、
前記拡張ユニットは、
前記デバイスメモリの入力デバイスに関連付けられており、前記拡張ユニットから前記CPUユニットへ入力された前記デバイス値を保持する入力デバイスと、前記CPUユニットの出力デバイスに関連付けられており、前記CPUユニットから前記拡張ユニットへ出力される前記デバイス値を保持する出力デバイスとを有し、前記プログラマブル・ロジック・コントローラの動作状態を示すバッファメモリ値を格納するバッファメモリと、
前記ユニット間同期周期を管理し、前記CPUユニットタイマーと時刻同期されており、前記バッファメモリ値が前記バッファメモリに格納される時刻を管理するための拡張ユニットタイマーと、
前記ユニット間同期リフレッシュにしたがって、前記バッファメモリの前記バッファメモリ値と当該バッファメモリ値の格納時刻に関する時刻情報を格納する第二リングバッファと
を有し、
前記CPUユニットは、前記CPUユニットタイマーの時刻と前記拡張ユニットタイマーの時刻とを同期させる同期信号を前記拡張ユニットに送信し、前記拡張ユニットは前記同期信号に応じて前記拡張ユニットタイマーの時刻を前記CPUユニットタイマーの時刻に同期させ、
前記モニタ装置は、
前記CPUユニットの前記第一リングバッファから前記デバイスメモリの前記デバイス値と当該デバイス値の時刻情報とを取得し、かつ、前記拡張ユニットの前記第二リングバッファから前記バッファメモリの前記バッファメモリ値と当該バッファメモリ値の時刻情報とを取得する取得手段と、
前記デバイス値の時刻情報と前記バッファメモリ値の時刻情報とに基づき前記デバイス値と前記バッファメモリ値との時間軸を整合させて表示する表示手段と
を有することを特徴とするモニタ装置を提供する。
The present invention, for example,
A monitor device that is connected to a programmable logic controller having a CPU unit and an extension unit that communicates with the CPU unit, and monitors an operation state of the programmable logic controller,
The programmable logic controller comprises:
The time information of the CPU unit and the time information of the extension unit are synchronized, and the device values of the CPU unit and the extension unit are updated as an inter-unit synchronization refresh for each inter-unit synchronization cycle different from a scan cycle,
The CPU unit and the extension unit execute respective programs in accordance with the inter-unit synchronization cycle in each of the synchronized units,
The CPU unit includes:
A device memory including a plurality of devices in which device values indicating an operation state of the programmable logic controller are stored;
A CPU unit timer for managing the inter-unit synchronization cycle and managing the time at which the device value is stored in the device memory ;
According to the inter-unit synchronization cycle, a user program execution unit that executes a user program with reference to the device value,
According to the inter-unit synchronous refresh, the device memory of the device memory and a first ring buffer that stores time information about the storage time of the device value ,
The extension unit includes:
An input device that is associated with an input device of the device memory and that holds the device value input from the extension unit to the CPU unit, and an output device of the CPU unit, An output device that holds the device value output to the expansion unit, and a buffer memory that stores a buffer memory value indicating an operation state of the programmable logic controller;
An extended unit timer that manages the inter-unit synchronization cycle, is time-synchronized with the CPU unit timer, and manages the time at which the buffer memory value is stored in the buffer memory;
A second ring buffer that stores the buffer memory value of the buffer memory and time information about the storage time of the buffer memory value according to the inter-unit synchronous refresh ,
The CPU unit transmits a synchronization signal for synchronizing the time of the CPU unit timer and the time of the extension unit timer to the extension unit, and the extension unit sets the time of the extension unit timer according to the synchronization signal. Synchronize with the time of the CPU unit timer,
The monitor device,
The device value of the device memory and the time information of the device value are obtained from the first ring buffer of the CPU unit, and the buffer memory value of the buffer memory is obtained from the second ring buffer of the expansion unit. Acquiring means for acquiring time information of the buffer memory value ;
Providing a monitoring device and having a display means for display by matching the time axis of the buffer memory value and the device value based on the time information of the buffer memory value and the time information of the device value .

本発明によればCPUユニットから取得したデータの時間軸と拡張ユニットから取得したデータの時間軸とを正確に揃えて表示できるようになる。   According to the present invention, the time axis of the data acquired from the CPU unit and the time axis of the data acquired from the extension unit can be accurately aligned and displayed.

PLCシステムの一例を示す図Diagram showing an example of a PLC system ユーザプログラムの一例を示す図Diagram showing an example of a user program プログラム作成支援装置の一例を示す図Diagram showing an example of a program creation support device PLCの一例を示す図Diagram showing an example of PLC スキャンタイムを説明するための図Diagram for explaining scan time プログラム作成支援装置の機能を示す図Diagram showing the functions of the program creation support device ユーザインタフェースの一例を示す図Diagram showing an example of the user interface ユーザインタフェースの一例を示す図Diagram showing an example of the user interface ユーザインタフェースの一例を示す図Diagram showing an example of the user interface 基本ユニットの機能を示す図Diagram showing basic unit functions 拡張ユニットの機能を示す図Diagram showing the functions of the expansion unit プログラム作成支援装置が実行する処理を示すフローチャートFlowchart showing processing executed by the program creation support device 基本ユニットが実行する処理を示すフローチャートFlow chart showing processing executed by the basic unit 拡張ユニットが実行する処理を示すフローチャートFlow chart showing processing executed by the extension unit 一括リフレッシュと同期リフレッシュとの関係を示す図Diagram showing the relationship between batch refresh and synchronous refresh 同期リフレッシュの一例を示す図Diagram showing an example of synchronous refresh

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

はじめにプログラマブル・ロジック・コントローラ(PLC、単にプログラマブルコントローラと呼ばれてもよい)を当業者にとってよりよく理解できるようにするために、一般的なPLCの構成とその動作について説明する。   First, in order to allow those skilled in the art to better understand a programmable logic controller (PLC, which may be simply referred to as a programmable controller), a general configuration and operation of a PLC will be described.

図1は、本発明の実施の形態によるプログラマブル・ロジック・コントローラシステムの一構成例を示す概念図である。図1に示すように、このシステムは、ラダープログラムなどのユーザプログラムの編集を行うためのプログラム作成支援装置1と、工場等に設置される各種制御装置を統括的に制御するためのPLC(プログラマブル・ロジック・コントローラ)2とを備えている。ユーザプログラムは、ラダー言語やモーションフローなどのグラフィカルプログラミング言語を用いて作成されてもよいし、C言語などの高級プログラミング言語を用いて作成されてもよい。以下では、説明の便宜上、ユーザプログラムはラダープログラムとする。PLC2は、CPUが内蔵された基本ユニット3と1つないし複数の拡張ユニット4を備えている。基本ユニット3に対して1つないし複数の拡張ユニット4が着脱可能となっている。基本ユニット3はCPUユニットと呼ばれることもある。   FIG. 1 is a conceptual diagram showing a configuration example of a programmable logic controller system according to an embodiment of the present invention. As shown in FIG. 1, this system includes a program creation support device 1 for editing a user program such as a ladder program and a PLC (programmable device) for totally controlling various control devices installed in a factory or the like. A logic controller 2). The user program may be created using a graphical programming language such as a ladder language or a motion flow, or may be created using a high-level programming language such as the C language. Hereinafter, the user program is a ladder program for convenience of explanation. The PLC 2 includes a basic unit 3 having a built-in CPU and one or a plurality of extension units 4. One or a plurality of extension units 4 can be attached to and detached from the basic unit 3. The basic unit 3 is sometimes called a CPU unit.

基本ユニット3には、表示部5及び操作部6が備えられている。表示部5には、基本ユニット3に取り付けられている各拡張ユニット4の動作状況などを表示することができ、表示部5の表示内容は、操作部6を操作することにより切り替えることができる。表示部5には、通常、PLC2内のデバイスの現在値(デバイス値)やPLC2内で生じたエラー情報などが表示される。なお、デバイスとは、デバイス値を格納するために設けられたメモリ上の領域を指す名称であり、デバイスメモリと呼ばれてもよい。デバイス値とは、入力機器からの入力状態、出力機器への出力状態およびユーザプログラム上で設定される内部リレー(補助リレー)、タイマー、カウンタ、データメモリ等の状態を示す情報である。   The basic unit 3 includes a display unit 5 and an operation unit 6. The display unit 5 can display the operation status of each extension unit 4 attached to the basic unit 3 and the like, and the display content of the display unit 5 can be switched by operating the operation unit 6. The display unit 5 normally displays a current value (device value) of a device in the PLC 2, error information generated in the PLC 2, and the like. The device is a name indicating an area on a memory provided for storing a device value, and may be called a device memory. The device value is information indicating an input state from an input device, an output state to an output device, and a state of an internal relay (auxiliary relay), a timer, a counter, a data memory, and the like set on a user program.

拡張ユニット4は、PLC2の機能を拡張するために用意されており、基本ユニット3に対して側方から取り付けられる。1つ目の拡張ユニット4は、基本ユニット3に対して側方から直接的に取り付けられる。2つ目以降の拡張ユニット4は、既に取り付けられている拡張ユニット4に対して、側方から直列的に取り付けられる。たとえば、基本ユニット3の右側面と拡張ユニット4の左側面とが連結面になっている。同様に、1つ目の拡張ユニット4の右側面の形状等は基本ユニット3の右側面とほぼ同じであるため、1つ目の拡張ユニット4の右側面に2つ目の拡張ユニット4の左側面が連結される。このような連結方式は、数珠つなぎ方式とかデイジーチェーン方式と呼ばれてもよい。各連結面にはコネクタが設けられており、通信や電力供給を行うためのバスもコネクタを介して連結される。このようにして、基本ユニット3と複数の拡張ユニット4が直列的に取り付けられると、各拡張ユニット4内に備えられた配線(例:バス)を介して、各拡張ユニット4が基本ユニット3に対して通信可能に接続される。各拡張ユニット4には、その拡張ユニット4の機能に対応する被制御装置16(図4)が接続され、これにより、各被制御装置16が拡張ユニット4を介して基本ユニット3に接続される。被制御装置16には、センサなどの入力装置や、アクチュエータなどの出力装置が含まれる。   The extension unit 4 is provided to extend the function of the PLC 2 and is attached to the basic unit 3 from the side. The first extension unit 4 is directly attached to the basic unit 3 from the side. The second and subsequent extension units 4 are attached in series to the already attached extension unit 4 from the side. For example, the right side surface of the basic unit 3 and the left side surface of the extension unit 4 are connection surfaces. Similarly, the shape and the like of the right side of the first extension unit 4 are substantially the same as the right side of the basic unit 3, so that the right side of the first extension unit 4 and the left side of the second extension unit 4 The faces are connected. Such a connection method may be called a daisy chain method or a daisy chain method. Each connection surface is provided with a connector, and a bus for communication and power supply is also connected via the connector. In this way, when the basic unit 3 and the plurality of extension units 4 are attached in series, each extension unit 4 is connected to the basic unit 3 via a wiring (eg, a bus) provided in each extension unit 4. Are communicably connected to each other. Each controlled unit 16 (FIG. 4) corresponding to the function of the extended unit 4 is connected to each extension unit 4, whereby each controlled device 16 is connected to the basic unit 3 via the extension unit 4. . The controlled device 16 includes an input device such as a sensor and an output device such as an actuator.

プログラム作成支援装置1は、たとえば、携帯可能ないわゆるノートタイプやタブレットタイプのパーソナルコンピュータであって、表示部7及び操作部8を備えている。PLC2を制御するためのユーザプログラムの一例であるラダープログラムは、プログラム作成支援装置1を用いて作成され、その作成されたラダープログラムは、プログラム作成支援装置1内でニモニックコードに変換される。そして、プログラム作成支援装置1を、USB(Universal Serial Bus)などの通信ケーブル9を介してPLC2の基本ユニット3に接続し、ニモニックコードに変換されたラダープログラムをプログラム作成支援装置1から基本ユニット3に送ると、そのラダープログラムが基本ユニット3内でマシンコードに変換され、基本ユニット3に備えられたメモリ内に記憶される。なお、ここではニモニックコードを基本ユニット3に送信するようにしているが、本発明はこれに限られず、例えばニモニックコードを更に中間コードに変換し、中間コードを基本ユニット3に送信するようにしてもよい。   The program creation support device 1 is, for example, a portable so-called notebook-type or tablet-type personal computer, and includes a display unit 7 and an operation unit 8. A ladder program, which is an example of a user program for controlling the PLC 2, is created using the program creation support device 1, and the created ladder program is converted into a mnemonic code in the program creation support device 1. Then, the program creation support device 1 is connected to the basic unit 3 of the PLC 2 via a communication cable 9 such as a USB (Universal Serial Bus), and the ladder program converted into the mnemonic code is transmitted from the program creation support device 1 to the basic unit 3. , The ladder program is converted into a machine code in the basic unit 3 and stored in a memory provided in the basic unit 3. Here, the mnemonic code is transmitted to the basic unit 3, but the present invention is not limited to this. For example, the mnemonic code is further converted to an intermediate code, and the intermediate code is transmitted to the basic unit 3. Is also good.

なお、図1では示していないが、プログラム作成支援装置1の操作部8には、プログラム作成支援装置1に接続されたマウスなどのポインティングデバイスが含まれていてもよい。また、プログラム作成支援装置1は、USB以外の他の通信ケーブル9を介して、PLC2の基本ユニット3に対して着脱可能に接続されるような構成であってもよい。   Although not shown in FIG. 1, the operation unit 8 of the program creation support device 1 may include a pointing device such as a mouse connected to the program creation support device 1. The program creation support device 1 may be configured to be detachably connected to the basic unit 3 of the PLC 2 via a communication cable 9 other than USB.

図2は、ラダープログラムの作成時にプログラム作成支援装置1の表示部7に表示されるラダー図Ldの一例を示す図である。図2に示すように、PLC2を制御するためのラダープログラムは、プログラム作成支援装置1の表示部7にマトリックス状に表示される複数のセル18内に仮想デバイスのシンボル19を適宜配置して、視覚的なリレー回路を表すラダー図Ldを構築することにより作成される。   FIG. 2 is a diagram illustrating an example of a ladder diagram Ld displayed on the display unit 7 of the program creation support device 1 when a ladder program is created. As shown in FIG. 2, a ladder program for controlling the PLC 2 is configured by appropriately arranging symbols 19 of a virtual device in a plurality of cells 18 displayed in a matrix on the display unit 7 of the program creation support device 1. It is created by constructing a ladder diagram Ld representing a visual relay circuit.

ラダー図Ldには、たとえば、10列×N行(Nは任意の自然数)のセル18が配置されている。そして、各行のセル18内に、図2に示す左側から右側に向かって、時系列的に仮想デバイスのシンボル19を適宜配置することにより、視覚的なリレー回路を作成することができる。作成されるリレー回路は、1行で表される直列的なリレー回路であってもよいし、複数行に並列的に表されたリレー回路を互いに結合することにより作成された、並列的なリレー回路であってもよい。   In the ladder diagram Ld, for example, cells 18 of 10 columns × N rows (N is an arbitrary natural number) are arranged. Then, a visual relay circuit can be created by appropriately arranging the symbols 19 of the virtual device in time series from the left side to the right side shown in FIG. 2 in the cells 18 of each row. The relay circuit to be created may be a serial relay circuit represented in one row, or a parallel relay created by connecting relay circuits represented in parallel in a plurality of rows to each other. It may be a circuit.

図2に示すリレー回路は、入力装置からの入力信号に基づいてオン/オフされる3つの仮想デバイス(以下、「入力デバイス」と呼ぶ。)のシンボル19a,19b,19cと、出力装置の動作を制御するためにオン/オフされる仮想デバイス(以下、「出力デバイス」と呼ぶ。)のシンボル19dとが適宜結合されることにより構成されている。   The relay circuit shown in FIG. 2 operates as symbols 19a, 19b, and 19c of three virtual devices (hereinafter, referred to as "input devices") that are turned on / off based on an input signal from the input device, and the operation of the output device. And a symbol 19d of a virtual device (hereinafter, referred to as an “output device”) that is turned on / off to control the device.

各入力デバイスのシンボル19a,19b,19cの上方に表示されている文字(「R0001」、「R0002」及び「R0003」)は、その入力デバイスのデバイス名(アドレス名)21を表している。各入力デバイスのシンボル19a,19b,19cの下方に表示されている文字(「フラグ1」、「フラグ2」及び「フラグ3」)は、その入力デバイスに対応付けられたデバイスコメント22を表している。出力デバイスのシンボル19dの上方に表示されている文字(「原点復帰」)は、その出力デバイスの機能を表す文字列からなるラベル23である。   The characters ("R0001", "R0002", and "R0003") displayed above the symbols 19a, 19b, and 19c of each input device represent the device name (address name) 21 of the input device. The characters (“flag 1”, “flag 2”, and “flag 3”) displayed below the symbols 19a, 19b, and 19c of each input device represent the device comment 22 associated with the input device. I have. The character displayed above the symbol 19d of the output device ("return to origin") is a label 23 composed of a character string representing the function of the output device.

図2に示す例では、デバイス名「R0001」及び「R0002」にそれぞれ対応する2つの入力デバイスのシンボル19a,19bが直列的に結合されることにより、AND回路が構成されている。また、これらの2つの入力デバイスのシンボル19a,19bからなるAND回路に対して、デバイス名「R0003」に対応する入力デバイスのシンボル19cが並列的に結合されることにより、OR回路が構成されている。すなわち、このリレー回路では、2つのシンボル19a,19bに対応する入力デバイスがいずれもオンした場合、又は、シンボル19cに対応する入力デバイスがオンした場合にのみ、シンボル19dに対応する出力デバイスがオンされるようになっている。   In the example shown in FIG. 2, an AND circuit is formed by serially combining the symbols 19a and 19b of the two input devices corresponding to the device names "R0001" and "R0002". Also, an OR circuit is configured by connecting an AND circuit composed of these two input device symbols 19a and 19b in parallel with an input device symbol 19c corresponding to the device name "R0003". I have. That is, in this relay circuit, the output device corresponding to the symbol 19d is turned on only when both the input devices corresponding to the two symbols 19a and 19b are turned on or when the input device corresponding to the symbol 19c is turned on. It is supposed to be.

図3は、図1のプログラム作成支援装置1の電気的構成について説明するためのブロック図である。図3に示すように、プログラム作成支援装置1には、CPU24、表示部7、操作部8、記憶装置25及び通信部26が備えられている。表示部7、操作部8、記憶装置25及び通信部26は、それぞれCPU24に対して電気的に接続されている。記憶装置25は、少なくともRAMを含む構成であり、プログラム記憶部27と、編集ソフト記憶部28とを備えている。   FIG. 3 is a block diagram for describing an electrical configuration of the program creation support device 1 of FIG. As shown in FIG. 3, the program creation support device 1 includes a CPU 24, a display unit 7, an operation unit 8, a storage device 25, and a communication unit 26. The display unit 7, the operation unit 8, the storage device 25, and the communication unit 26 are each electrically connected to the CPU 24. The storage device 25 includes at least a RAM, and includes a program storage unit 27 and an editing software storage unit 28.

ユーザは、編集ソフト記憶部28に記憶されている編集ソフトをCPU24に実行させて、操作部8を通じてラダープログラムを編集する。ここで、ラダープログラムの編集には、ラダープログラムの作成及び変更が含まれる。編集ソフトを用いて作成されたラダープログラムは、プログラム記憶部27に記憶される。また、ユーザは、必要に応じてプログラム記憶部27に記憶されているラダープログラムを読み出し、そのラダープログラムを、編集ソフトを用いて変更することができる。通信部26は、通信ケーブル9を介してプログラム作成支援装置1を基本ユニット3に通信可能に接続するためのものである。   The user causes the CPU 24 to execute the editing software stored in the editing software storage unit 28 and edits the ladder program through the operation unit 8. Here, the editing of the ladder program includes creation and change of the ladder program. The ladder program created using the editing software is stored in the program storage unit 27. Further, the user can read out the ladder program stored in the program storage unit 27 as needed, and change the ladder program using editing software. The communication unit 26 is for communicatively connecting the program creation support device 1 to the basic unit 3 via the communication cable 9.

図4は、PLC2の電気的構成について説明するためのブロック図である。図4に示すように、基本ユニット3には、CPU10、表示部5、操作部6、記憶装置12及び通信部14が備えられている。表示部5、操作部6、記憶装置12、及び通信部14は、それぞれCPU10に電気的に接続されている。記憶装置12は、RAMやROM、メモリカードなどを含んでもよく、ラダープログラムなどを記憶する。記憶装置12には、プログラム作成支援装置1から入力されたラダープログラムやユーザデータが上書きして記憶される。また、記憶装置12には基本ユニット用の制御プログラムも格納されている。図4が示すように基本ユニット3と拡張ユニット4とは拡張バスの一種であるユニット外部バス90を介して接続されている。なお、ユニット外部バス90に関する通信機能は通信部14の一部として実装されてもよい。   FIG. 4 is a block diagram for describing an electrical configuration of PLC 2. As shown in FIG. 4, the basic unit 3 includes a CPU 10, a display unit 5, an operation unit 6, a storage device 12, and a communication unit 14. The display unit 5, the operation unit 6, the storage device 12, and the communication unit 14 are each electrically connected to the CPU 10. The storage device 12 may include a RAM, a ROM, a memory card, and the like, and stores a ladder program and the like. The storage device 12 overwrites and stores the ladder program and user data input from the program creation support device 1. The storage device 12 also stores a control program for the basic unit. As shown in FIG. 4, the basic unit 3 and the extension unit 4 are connected via a unit external bus 90 which is a kind of extension bus. The communication function related to the unit external bus 90 may be implemented as a part of the communication unit 14.

図5は、本発明の実施の形態に係るプログラマブルコントローラの基本ユニット3でのスキャンタイムの構成を示す模式図である。図5が示すように1つのスキャンタイムTは、入出力のリフレッシュを行うためのユニット間通信201、プログラム実行202、END処理204により構成されている。ユニット間通信201で、基本ユニット3は、ラダープログラムを実行して得られた出力データを基本ユニット3内の記憶装置12から外部機器などに送信するとともに、受信データを含めた入力データを基本ユニット3内の記憶装置12に取り込む。たとえば、基本ユニット3のデバイスに記憶されているデバイス値はリフレッシュによって拡張ユニット4のデバイスに反映される。同様に、拡張ユニット4のデバイスに記憶されているデバイス値はリフレッシュによって基本ユニット3のデバイスに反映される。なお、リフレッシュ以外のタイミングでデバイス値をユニット間で更新する仕組みが採用されてもよい。ただし、基本ユニット3のデバイスは基本ユニット3が随時書き換えており、同様に、拡張ユニット4のデバイスは拡張ユニット4が随時書き換えている。つまり、基本ユニット3のデバイスは基本ユニット3の内部の装置によって随時アクセス可能であり、同様に、拡張ユニット4のデバイスは拡張ユニット4の内部の装置によって随時アクセス可能になっている。基本ユニット3と拡張ユニット4との間では基本的にリフレッシュのタイミングにおいて相互にデバイス値を更新して同期する。プログラム実行202で、基本ユニット3は、更新された入力データを用いてプログラムを実行(演算)する。基本ユニット3はプログラムの実行によりデータを演算処理する。なお、END処理とは、プログラム作成支援装置1や基本ユニット3に接続された表示器(図示せず)等の外部機器とのデータ通信、システムのエラーチェック等の周辺サービスに関する処理全般を意味する。   FIG. 5 is a schematic diagram showing a configuration of a scan time in the basic unit 3 of the programmable controller according to the embodiment of the present invention. As shown in FIG. 5, one scan time T is configured by inter-unit communication 201 for performing input / output refresh, program execution 202, and END processing 204. In the inter-unit communication 201, the basic unit 3 transmits output data obtained by executing the ladder program from the storage device 12 in the basic unit 3 to an external device or the like, and transmits input data including received data to the basic unit. 3 to the storage device 12. For example, the device value stored in the device of the basic unit 3 is reflected on the device of the extension unit 4 by refresh. Similarly, the device value stored in the device of the extension unit 4 is reflected on the device of the basic unit 3 by refresh. A mechanism for updating the device value between units at a timing other than the refresh may be adopted. However, the device of the basic unit 3 is constantly rewritten by the basic unit 3, and similarly, the device of the extended unit 4 is constantly rewritten by the extended unit 4. That is, the devices of the basic unit 3 can be accessed at any time by the devices inside the basic unit 3, and similarly, the devices of the expansion unit 4 can be accessed at any time by the devices inside the expansion unit 4. The basic unit 3 and the extension unit 4 basically update and synchronize device values with each other at a refresh timing. In the program execution 202, the basic unit 3 executes (calculates) the program using the updated input data. The basic unit 3 performs data processing by executing a program. Note that the END processing means overall processing related to peripheral services such as data communication with an external device such as a display (not shown) connected to the program creation support apparatus 1 and the basic unit 3 and system error checking. .

このように、プログラム作成支援装置1はユーザの操作に応じたラダープログラムを作成し、作成したラダープログラムをPLC2に転送する。PLC2は、入出力リフレッシュ、ラダープログラムの実行およびEND処理を1サイクル(1スキャン)として、このサイクルを周期的、すなわちサイクリックに繰り返し実行する。これにより、各種入力機器(センサ等)からのタイミング信号に基づいて、各種出力機器(モータ等)を制御する。よって、PLC2は汎用のパーソナルコンピュータ(PC)とは全く異なる動きをする。   As described above, the program creation support device 1 creates a ladder program according to the user's operation, and transfers the created ladder program to the PLC 2. The PLC 2 sets the cycle of the input / output refresh, the execution of the ladder program, and the END process as one cycle (one scan), and repeatedly executes this cycle, that is, cyclically. Thereby, various output devices (motors and the like) are controlled based on timing signals from various input devices (sensors and the like). Therefore, the PLC 2 behaves completely different from a general-purpose personal computer (PC).

<モニタ装置の機能>
図6はモニタ装置として動作するプログラム作成支援装置1の機能を示す図である。CPU24は記憶装置25のROM(EEPROM,HDD,SSDなど)に記憶されている編集ソフトウエア36を実行することで編集部31として機能する。編集部31は、表示部7にラダープログラム35を編集するためのUI(ユーザインタフェース)を表示させ、操作部8を通じて入力された指示に従ってラダープログラム35を作成し、記憶装置25に格納する。CPU24は記憶装置25のROM(EEPROM,HDD,SSDなど)に記憶されているモニタソフトウエア37を実行することで、設定部32、リングバッファ管理部33および描画部34として機能する。なお、モニタソフトウエア37は編集ソフトウエア36に統合されてもよい。設定部32は、基本ユニット3や拡張ユニット4からデバイス値やバッファメモリを取得するために必要となる設定データ(トレース設定)を作成する。なお、トレースとは、基本ユニット3と拡張ユニット4からデバイス値(バッファメモリ)を取得して表示する処理であり、モニタリングと同様の意味である。なお、狭義のトレースは、デバイス値(バッファメモリ)の取得ないしは収集を意味する。
<Functions of monitor device>
FIG. 6 is a diagram showing functions of the program creation support device 1 operating as a monitor device. The CPU 24 functions as the editing unit 31 by executing the editing software 36 stored in the ROM (EEPROM, HDD, SSD, etc.) of the storage device 25. The editing unit 31 displays a UI (user interface) for editing the ladder program 35 on the display unit 7, creates the ladder program 35 in accordance with an instruction input through the operation unit 8, and stores the ladder program 35 in the storage device 25. The CPU 24 functions as the setting unit 32, the ring buffer management unit 33, and the drawing unit 34 by executing the monitor software 37 stored in the ROM (EEPROM, HDD, SSD, or the like) of the storage device 25. Note that the monitor software 37 may be integrated with the editing software 36. The setting unit 32 creates setting data (trace setting) necessary to acquire a device value and a buffer memory from the basic unit 3 and the extension unit 4. Note that the trace is a process of acquiring and displaying a device value (buffer memory) from the basic unit 3 and the extension unit 4, and has the same meaning as monitoring. Note that the trace in a narrow sense means acquisition or collection of a device value (buffer memory).

図7は設定部32が表示部7に表示するユーザインタフェースの一例である。デバイス選択UI61は、基本ユニット3や拡張ユニット4から取得される取得対象を選択ないしは指定するためのユーザインタフェースである。この例では、取得対象となるデバイス名称の表示欄と、その名称の左側にチェックボックスが設けられている。ユーザは操作部8を通じてチェックボックスにチェックを付与することで、チェックを付与されたデバイスを取得対象として選択できる。設定部32は、デバイス選択UI61においていずれかのデバイスが指定されると、そのデバイスについてのトレース設定を作成すべく、トリガ位置設定UI62、サンプリング周期設定UI64およびトリガ条件設定UI65を表示部7に表示する。トリガ位置設定UI62は、デバイス値のサンプル数(サンプル時間)を設定するためのユーザインタフェースである。スライダーバー63はデフォルトで中央に設定されている。これは、トリガ条件が満たされたタイミングの前と後で同数のデバイス値をサンプルすることを示している。スライダーバー63が中央よりも左に移動されると、トリガ条件が満たされたタイミングの前のサンプル数が減少し、トリガ条件が満たされたタイミングの後のサンプル数が増加する。反対に、スライダーバー63が中央よりも右に移動されると、トリガ条件が満たされたタイミングよりも前のサンプル数が増加し、トリガ条件が満たされたタイミングよりも後のサンプル数が減少する。サンプリング周期設定UI64は、デバイス値やバッファメモリ値のサンプリング周期を設定するためのUIである。デバイス値についてのサンプリング周期は、たとえば、デバイスメモリに格納されているデバイス値をリングバッファに格納する周期である。バッファメモリ値についてのサンプリング周期は、たとえば、バッファメモリに格納されているバッファメモリ値をリングバッファに格納する周期である。トリガ条件設定UI65はトリガ条件を設定するためのユーザインタフェースである。トリガ条件とは、デバイス値やバッファメモリ値を基本ユニット3や拡張ユニット4から取得して表示部7に表示させるといったトレース処理を開始させる条件である。図7によれば、R000という名称のビットデバイス(リレーデバイス)のデバイス値が“1”(ON)になり、かつ(AND)、DM001という名称のワードデバイスのデバイス値が“0”以下になったことをトリガ条件として設定されている。このように、トリガ条件設定UI65ではトレース開始の条件が設定可能となっているが、トレース停止の条件も設定可能とされてもよい。なお、本実施例では、トレース停止条件はトリガ位置設定UI62により設定された数のサンプル値(デバイス値やバッファメモリ)の取得が完了したことであるものと仮定する。設定部32がこれらのUIを通じて作成したトレース設定は通信部26を通じて基本ユニット3と拡張ユニット4とに転送される。   FIG. 7 is an example of a user interface displayed on the display unit 7 by the setting unit 32. The device selection UI 61 is a user interface for selecting or specifying an acquisition target acquired from the basic unit 3 or the extension unit 4. In this example, a display column of a device name to be acquired and a check box are provided on the left side of the name. By giving a check to the check box through the operation unit 8, the user can select the checked device as an acquisition target. When any device is designated in the device selection UI 61, the setting unit 32 displays a trigger position setting UI 62, a sampling cycle setting UI 64, and a trigger condition setting UI 65 on the display unit 7 to create a trace setting for the device. I do. The trigger position setting UI 62 is a user interface for setting the number of samples (sample time) of the device value. The slider bar 63 is set at the center by default. This indicates that the same number of device values are sampled before and after the timing at which the trigger condition is satisfied. When the slider bar 63 is moved to the left from the center, the number of samples before the timing at which the trigger condition is satisfied decreases, and the number of samples after the timing at which the trigger condition is satisfied increases. Conversely, when the slider bar 63 is moved to the right of the center, the number of samples before the timing at which the trigger condition is satisfied increases, and the number of samples after the timing at which the trigger condition is satisfied decreases. . The sampling cycle setting UI 64 is a UI for setting a sampling cycle of a device value or a buffer memory value. The sampling period for the device value is, for example, a period for storing the device value stored in the device memory in the ring buffer. The sampling cycle for the buffer memory value is, for example, a cycle for storing the buffer memory value stored in the buffer memory in the ring buffer. The trigger condition setting UI 65 is a user interface for setting a trigger condition. The trigger condition is a condition for starting a trace process of acquiring a device value or a buffer memory value from the basic unit 3 or the extension unit 4 and displaying the acquired value on the display unit 7. According to FIG. 7, the device value of the bit device (relay device) named R000 becomes “1” (ON), and (AND), the device value of the word device named DM001 becomes “0” or less. Is set as a trigger condition. Thus, the trigger start condition can be set in the trigger condition setting UI 65, but the trace stop condition may also be set. In this embodiment, it is assumed that the trace stop condition is that the acquisition of the number of sample values (device values and buffer memory) set by the trigger position setting UI 62 is completed. The trace settings created by the setting unit 32 through these UIs are transferred to the basic unit 3 and the extension unit 4 through the communication unit 26.

図6に示したリングバッファ管理部33は、基本ユニット3のデバイスメモリに記憶されているデバイス値を取得したり、拡張ユニット4のデバイスメモリ(バッファメモリ)に記憶されているデバイス値(バッファメモリ)を取得したりする機能である。リングバッファ管理部33は、設定部32により設定された条件(トレース設定)にしたがってデバイス値やバッファメモリをリングバッファ38に格納する。リングバッファ38は記憶装置25のRAMに確保される。なお、基本ユニット3や拡張ユニット4におけるデバイス値の取得時刻やバッファメモリの取得時刻もこれらと関連付けてリングバッファ38に格納されてもよい。描画部34は、リングバッファ38に格納されたデバイス値やバッファメモリをそれぞれ取得時刻に基づき時間軸を整合させて表示部7に表示する機能である。   The ring buffer management unit 33 shown in FIG. 6 obtains a device value stored in the device memory of the basic unit 3 or a device value (buffer memory) stored in the device memory (buffer memory) of the extension unit 4. ). The ring buffer management unit 33 stores the device values and the buffer memory in the ring buffer 38 according to the conditions (trace setting) set by the setting unit 32. The ring buffer 38 is secured in the RAM of the storage device 25. The acquisition time of the device value and the acquisition time of the buffer memory in the basic unit 3 and the extension unit 4 may be stored in the ring buffer 38 in association with these. The drawing unit 34 has a function of displaying the device values and the buffer memory stored in the ring buffer 38 on the display unit 7 with their time axes aligned based on the acquisition time.

図8は表示例を示す図である。この例では、基本ユニット3のデバイスメモリDM000とデバイスメモリDM001から取得されたデバイス値と、拡張ユニット4から取得されたバッファメモリEM000とバッファメモリEM001とから取得されたバッファメモリとが時間軸を揃えられて表示されている。   FIG. 8 is a diagram showing a display example. In this example, the device axes obtained from the device memories DM000 and DM001 of the basic unit 3 and the buffer memories EM000 and EM001 obtained from the extension unit 4 have the same time axis. Is displayed.

図9は他の表示例を示す図である。この例では、基本ユニット3のデバイスメモリDM000とデバイスメモリDM001から取得されたデバイス値とが第一の表示領域に表示されている。拡張ユニット4から取得されたバッファメモリUG000とバッファメモリUG001とから取得されたバッファメモリとが第2の表示領域に表示されている。第一の表示領域と第二の表示領域は横に並べられているものの、時間軸は揃えられている。このように、各ユニットから取得されたデバイス値(バッファメモリ)は必ずしも一つの表示領域にまとめて表示されなくてもよい。   FIG. 9 is a diagram showing another display example. In this example, the device memory DM000 of the basic unit 3 and the device values obtained from the device memory DM001 are displayed in the first display area. The buffer memory UG000 obtained from the extension unit 4 and the buffer memory obtained from the buffer memory UG001 are displayed in the second display area. Although the first display area and the second display area are arranged side by side, the time axes are aligned. As described above, the device values (buffer memories) acquired from the respective units do not necessarily need to be collectively displayed in one display area.

<基本ユニットの機能>
図10は基本ユニット3の機能を示す図である。CPU10は記憶装置12のROM(EEPROM,HDD,SSDなど)に記憶されている制御プログラム45を実行することで、ラダー実行部40、デバイス管理部41、バッファ管理部42、CPUユニットタイマー43および同期部44として機能する。ラダー実行部40は、プログラム作成支援装置1により作成されて転送されてきたラダープログラム35を実行するエンジンである。ラダー実行部40はCPU10とは異なるASICなどにより実現されてもよい。デバイス管理部41は、それぞれデバイス値を格納する複数のデバイスからなるデバイスメモリ48を管理する機能である。デバイスメモリ48は第一デバイスメモリと呼ばれてもよい。デバイスとしては、上述したスキャン周期ごとにリフレッシュされるデバイスと、スキャン周期よりも短いユニット間同期周期ごとにリフレッシュ(ユニット間同期リフレッシュ)されるデバイスとがある。また、デバイスには、拡張ユニット4から受信したデバイス値が格納される入力デバイスと、基本ユニット3から拡張ユニット4に送信される出力デバイスとが存在する。たとえば、ラダー実行部40は、入力デバイスに格納された拡張ユニット4(モーションユニットなど)の現在座標や現在速度に対してラダープログラム35により定義された所定の演算を実行して目標座標と目標速度を決定し、出力デバイスにこれらを格納する。次のリフレッシュのタイミングでは、出力デバイスに格納された目標座標と目標速度が拡張ユニット4によって読み出され、被制御装置16(パラレルリンクなど)の制御に反映される。バッファ管理部42は、デバイスメモリ48に格納されているデバイス値をトレース設定47にしたがってリングバッファ49に格納する機能である。トレース設定47は上述したようにプログラム作成支援装置1によって作成されたものである。リングバッファ49は記憶装置12のRAMに確保される。また、バッファ管理部42は、プログラム作成支援装置1からトレースの開始指示を受信すると、トレース設定47にしたがってリングバッファ49に格納しておいたデバイス値とその格納時刻を示す時刻情報を、通信部14を介してプログラム作成支援装置に送信する。CPUユニットタイマー43は、基本ユニット3における各種の動作の制御タイミングを決定するために利用されるクロックやカウンタである。CPUユニットタイマー43は必ずしも時刻を計時する必要はなく、時刻に相当するカウント値をカウントしてもよい。このようなカウント値も時刻情報の一種である。図8、図9に示した横軸は時間軸であるが、時間軸に付与されている75000や76000は時刻情報としてのカウント値である。同期部44は、CPUユニットタイマー43の時刻情報と拡張ユニット4が備える拡張ユニットタイマー53の時刻情報とを同期させる機能である。同期部44は、通信部14を介したバス通信によって同期信号を拡張ユニット4に送信することで、CPUユニットタイマー43の時刻情報と拡張ユニット4が備える拡張ユニットタイマー53の時刻情報とを同期させる。
<Functions of basic unit>
FIG. 10 is a diagram showing functions of the basic unit 3. The CPU 10 executes a control program 45 stored in a ROM (EEPROM, HDD, SSD, etc.) of the storage device 12 to execute a ladder execution unit 40, a device management unit 41, a buffer management unit 42, a CPU unit timer 43, and a synchronization unit. It functions as the unit 44. The ladder execution unit 40 is an engine that executes the ladder program 35 created and transferred by the program creation support device 1. The ladder execution unit 40 may be realized by an ASIC or the like different from the CPU 10. The device management unit 41 has a function of managing a device memory 48 including a plurality of devices each storing a device value. The device memory 48 may be called a first device memory. The device includes a device that is refreshed every scan cycle described above and a device that is refreshed every unit synchronization cycle shorter than the scan cycle (inter-unit synchronization refresh). The devices include an input device that stores a device value received from the extension unit 4 and an output device that is transmitted from the basic unit 3 to the extension unit 4. For example, the ladder execution unit 40 executes a predetermined operation defined by the ladder program 35 on the current coordinates and the current speed of the extension unit 4 (such as a motion unit) stored in the input device to execute the target coordinates and the target speed. And store them on the output device. At the next refresh timing, the target coordinates and the target speed stored in the output device are read out by the extension unit 4 and reflected in the control of the controlled device 16 (such as a parallel link). The buffer management unit 42 has a function of storing the device values stored in the device memory 48 in the ring buffer 49 according to the trace setting 47. The trace setting 47 is created by the program creation support device 1 as described above. The ring buffer 49 is secured in the RAM of the storage device 12. Further, upon receiving the trace start instruction from the program creation support device 1, the buffer management unit 42 transmits the device value stored in the ring buffer 49 according to the trace setting 47 and time information indicating the storage time to the communication unit. 14 to the program creation support device. The CPU unit timer 43 is a clock or a counter used to determine the control timing of various operations in the basic unit 3. The CPU unit timer 43 does not always need to measure the time, and may count a count value corresponding to the time. Such a count value is also a type of time information. The horizontal axis shown in FIGS. 8 and 9 is the time axis, and 75000 and 76000 added to the time axis are count values as time information. The synchronization unit 44 has a function of synchronizing the time information of the CPU unit timer 43 and the time information of the extension unit timer 53 provided in the extension unit 4. The synchronization unit 44 synchronizes the time information of the CPU unit timer 43 with the time information of the extension unit timer 53 included in the extension unit 4 by transmitting a synchronization signal to the extension unit 4 by bus communication via the communication unit 14. .

<拡張ユニットの機能>
図11は拡張ユニット4の機能を示す図である。CPU110は記憶装置112のROM(EEPROM,HDD,SSDなど)に記憶されている制御プログラム55を実行することで、機能制御部50、デバイス管理部51、バッファ管理部52、拡張ユニットタイマー53および同期部54として機能する。機能制御部50は、バッファメモリを含むデバイスメモリ58に格納されたデバイス値(バッファメモリ)に基づき被制御装置16を制御する。なお、被制御装置16は単なるセンサなどの入力装置であってもよい。デバイスメモリ58は第二デバイスメモリと呼ばれてもよい。デバイス管理部51は、それぞれデバイス値(バッファメモリ)を格納する複数のデバイス(バッファメモリ)からなるデバイスメモリ58を管理する機能である。デバイスとしては、上述したスキャン周期ごとにリフレッシュされるデバイスと、スキャン周期よりも短いユニット間同期周期ごとにリフレッシュ(ユニット間同期リフレッシュ)されるデバイスとがある。さらに、他のデバイスとしては、基本ユニット3から命令語により読み書きされるバッファメモリがある。なお、拡張ユニット4に関するデバイスは総称としてバッファメモリとして呼ばれてもよい。もちろん、デバイスメモリ58は、デバイスメモリとしての領域とバッファメモリとしての領域とを有していてもよい。この場合、デバイスメモリに記憶されているデバイス値と、バッファメモリに記憶されているバッファメモリとがモニタリングの対象となり得る。また、デバイスには、拡張ユニット4から送信されるデバイス値が格納される入力デバイスと、基本ユニット3から拡張ユニット4に送信される出力デバイスとが存在する。たとえば、機能制御部50は、被制御装置16の現在座標や現在速度を入力デバイス(バッファメモリ)に格納してもよい。機能制御部50は、次のリフレッシュのタイミングで基本ユニット3により出力デバイスに格納された目標座標と目標速度を被制御装置16(パラレルリンクなど)に反映させる。バッファ管理部52は、デバイスメモリ58に格納されているデバイス値をトレース設定57にしたがってリングバッファ59に格納する機能である。トレース設定57は上述したようにプログラム作成支援装置1によって作成されたものである。リングバッファ59は記憶装置112のRAMに確保される。また、バッファ管理部52は、通信部114を介してプログラム作成支援装置1からトレースの開始指示を受信すると、トレース設定57にしたがってリングバッファ59に格納しておいたデバイス値(バッファメモリ)とその格納時刻を示す時刻情報を、通信部114を介してプログラム作成支援装置1に送信する。なお、拡張ユニット4の通信部114は、通信ハブとしても機能する基本ユニット3の通信部14を介してプログラム作成支援装置1の通信部26と通信する。拡張ユニットタイマー53は、拡張ユニット4における各種の動作の制御タイミングを決定するために利用されるクロックやカウンタである。拡張ユニットタイマー53は必ずしも時刻を計時する必要はなく、時刻に相当するカウント値をカウントしてもよい。このようなカウント値も時刻情報の一種である。同期部54は、拡張ユニットタイマー53の時刻情報をCPUユニットタイマー43の時刻情報に同期させる機能である。同期部54は、通信部114を介したバス通信によって同期信号を基本ユニット3から受信することで、CPUユニットタイマー43の時刻情報と拡張ユニットタイマー53の時刻情報とを同期させる。
<Functions of expansion unit>
FIG. 11 is a diagram illustrating the function of the extension unit 4. The CPU 110 executes the control program 55 stored in the ROM (EEPROM, HDD, SSD, or the like) of the storage device 112 to execute the function control unit 50, the device management unit 51, the buffer management unit 52, the extension unit timer 53, and the synchronization unit. It functions as the unit 54. The function control unit 50 controls the controlled device 16 based on a device value (buffer memory) stored in a device memory 58 including a buffer memory. The controlled device 16 may be an input device such as a simple sensor. The device memory 58 may be called a second device memory. The device management unit 51 has a function of managing a device memory 58 including a plurality of devices (buffer memories) each storing a device value (buffer memory). The device includes a device that is refreshed every scan cycle described above and a device that is refreshed every unit synchronization cycle shorter than the scan cycle (inter-unit synchronization refresh). Further, as another device, there is a buffer memory which is read / written by a command word from the basic unit 3. Note that devices relating to the extension unit 4 may be collectively referred to as a buffer memory. Of course, the device memory 58 may have an area as a device memory and an area as a buffer memory. In this case, the device value stored in the device memory and the buffer memory stored in the buffer memory can be monitored. The devices include an input device that stores a device value transmitted from the extension unit 4 and an output device that is transmitted from the basic unit 3 to the extension unit 4. For example, the function control unit 50 may store the current coordinates and the current speed of the controlled device 16 in an input device (buffer memory). The function control unit 50 reflects the target coordinates and the target speed stored in the output device by the basic unit 3 at the next refresh timing on the controlled device 16 (such as a parallel link). The buffer management unit 52 has a function of storing the device values stored in the device memory 58 in the ring buffer 59 in accordance with the trace setting 57. The trace setting 57 is created by the program creation support device 1 as described above. The ring buffer 59 is secured in the RAM of the storage device 112. Further, when the buffer management unit 52 receives a trace start instruction from the program creation support device 1 via the communication unit 114, the device value (buffer memory) stored in the ring buffer 59 according to the trace setting 57 and its Time information indicating the storage time is transmitted to the program creation support device 1 via the communication unit 114. The communication unit 114 of the extension unit 4 communicates with the communication unit 26 of the program creation support device 1 via the communication unit 14 of the basic unit 3 which also functions as a communication hub. The extension unit timer 53 is a clock or a counter used to determine the control timing of various operations in the extension unit 4. The extension unit timer 53 does not always need to measure the time, and may count a count value corresponding to the time. Such a count value is also a type of time information. The synchronization unit 54 has a function of synchronizing the time information of the extension unit timer 53 with the time information of the CPU unit timer 43. The synchronization unit 54 synchronizes the time information of the CPU unit timer 43 with the time information of the extension unit timer 53 by receiving a synchronization signal from the basic unit 3 by bus communication via the communication unit 114.

<プログラム作成支援装置が実行する処理>
図12はプログラム作成支援装置1のCPU24が実行する処理を示すフローチャートである。S11でCPU24(編集部31)は編集ソフトウエア36にしたがってラダープログラム35を編集し、通信部26を介して基本ユニット3に接続して転送する。S12でCPU24(設定部32)はモニタソフトウエア37にしたがってトレース設定を編集し、通信部26を介して基本ユニット3に接続して転送する。トレース設定は基本ユニット3と拡張ユニット4のそれぞれについて作成される。トレース設定には、デバイスの識別情報、トリガ位置、サンプリング周期、トリガ条件などが含まれる。
<Process Performed by Program Creation Support Device>
FIG. 12 is a flowchart showing the processing executed by the CPU 24 of the program creation support device 1. In S11, the CPU 24 (editing unit 31) edits the ladder program 35 according to the editing software 36, and connects the ladder program 35 to the basic unit 3 via the communication unit 26 to transfer the ladder program 35. In S12, the CPU 24 (setting unit 32) edits the trace settings according to the monitor software 37, and connects to the basic unit 3 via the communication unit 26 and transfers the same. Trace settings are created for each of the basic unit 3 and the extension unit 4. The trace setting includes device identification information, a trigger position, a sampling period, a trigger condition, and the like.

S13でCPU24(描画部34)は操作部8を通じてトレースの開始を指示されると、基本ユニット3や拡張ユニット4のそれぞれに通信部26を介して接続し、トレース開始を指示する。S14でCPU24(リングバッファ管理部33)は基本ユニット3に通信部26を介して接続し、リングバッファ49に格納されているデバイス値とその時刻情報を取得する。また、CPU24(リングバッファ管理部33)は拡張ユニット4に通信部26を介して接続し、リングバッファ59に格納されているデバイス値(バッファメモリ)とその時刻情報を取得し、リングバッファ38に格納する。S15でCPU24(描画部34)はリングバッファ38から各デバイス値(バッファメモリ)とその時刻情報を読み出して、各デバイス値(バッファメモリ)の時刻情報にしたがって各デバイス値(バッファメモリ)時間軸を揃えてチャートにレンダリングし、表示部7に表示する。   In S13, when the CPU 24 (drawing unit 34) is instructed to start tracing through the operation unit 8, it connects to the basic unit 3 and the extension unit 4 via the communication unit 26, and instructs to start tracing. In S14, the CPU 24 (ring buffer management unit 33) connects to the basic unit 3 via the communication unit 26, and acquires the device value stored in the ring buffer 49 and the time information thereof. The CPU 24 (ring buffer management unit 33) connects to the extension unit 4 via the communication unit 26, acquires the device value (buffer memory) stored in the ring buffer 59 and its time information, and stores it in the ring buffer 38. Store. In S15, the CPU 24 (drawing unit 34) reads each device value (buffer memory) and its time information from the ring buffer 38, and sets each device value (buffer memory) time axis according to the time information of each device value (buffer memory). Aligned and rendered on a chart, and displayed on the display unit 7.

S16でCPU24(描画部34)は操作部8を通じてモニタリング(トレース)の停止が指示されたかどうかを判定する。なお、基本ユニット3や拡張ユニット4のうちいずれかのユニットで停止トリガが発生したことを、通信部26を介したメッセージ通信により認識したときも、CPU24(描画部34)は停止指示が入力されたものとして取り扱う。停止が指示されていなければ、CPU24(描画部34)はS14に戻り、S14とS15を繰り返す。停止が指示されると、CPU24(描画部34)は、S17に進む。S17でCPU24は通信部26を介した通信により基本ユニット3や拡張ユニット4にトレースの停止を指示する。   In S16, the CPU 24 (drawing unit 34) determines whether or not an instruction to stop monitoring (tracing) has been given through the operation unit 8. The CPU 24 (drawing unit 34) also receives a stop instruction when it recognizes that a stop trigger has occurred in any of the basic unit 3 and the extension unit 4 by message communication via the communication unit 26. Treat as If the stop has not been instructed, the CPU 24 (the drawing unit 34) returns to S14 and repeats S14 and S15. When the stop is instructed, the CPU 24 (the drawing unit 34) proceeds to S17. In S17, the CPU 24 instructs the basic unit 3 and the extension unit 4 to stop tracing by communication via the communication unit 26.

<基本ユニットが実行する処理>
図13は基本ユニット3のCPU10が実行する処理を示すフローチャートである。S21でCPU10はプログラム作成支援装置1からラダープログラム35を受信し、記憶装置12に記憶する。S22でCPU10はプログラム作成支援装置1から基本ユニット3用のトレース設定47を受信し、記憶装置12に記憶する。S23でCPU10は操作部6を通じてプログラミングモードからランモードに設定されたかどうかを判定する。操作部6には、電源オフ、プログラミングモード、ランモードを切り替えるメインスイッチが設けられていてもよい。ランモードが設定されると、CPU10はS24に進む。S24でCPU10はラダープログラム35をラダー実行部40に実行させる。ラダー実行部40はスキャンタイム(スキャン周期)にしたがってラダープログラム35を繰り返し実行する。また、デバイス管理部41は、リフレッシュによって各デバイスのデバイス値を更新する。
<Process performed by basic unit>
FIG. 13 is a flowchart showing the processing executed by the CPU 10 of the basic unit 3. In S21, the CPU 10 receives the ladder program 35 from the program creation support device 1 and stores it in the storage device 12. In S22, the CPU 10 receives the trace setting 47 for the basic unit 3 from the program creation support device 1 and stores it in the storage device 12. In S23, the CPU 10 determines whether or not the programming mode has been set to the run mode via the operation unit 6. The operation unit 6 may be provided with a main switch for switching between power-off, programming mode, and run mode. When the run mode is set, the CPU 10 proceeds to S24. In S24, the CPU 10 causes the ladder execution unit 40 to execute the ladder program 35. The ladder execution unit 40 repeatedly executes the ladder program 35 according to the scan time (scan cycle). The device management unit 41 updates the device value of each device by refreshing.

S25でCPU10(バッファ管理部42)はプログラム作成支援装置1からトレースの開始を指示されたかどうかを判定する。トレースの開始を指示されると、CPU10はS26に進む。   In S25, the CPU 10 (buffer management unit 42) determines whether or not the start of tracing has been instructed from the program creation support device 1. When the start of the trace is instructed, the CPU 10 proceeds to S26.

S26でCPU10(バッファ管理部42)はトレース設定47にしたがってデバイスメモリ48からデバイス値を読み出してリングバッファ49に格納する。格納の際に、バッファ管理部42はCPUユニットタイマー43によってカウントされているカウント値(時刻情報)を取得して、デバイス値とともにリングバッファ49に格納してもよい。あるいは、デバイス管理部41が、各デバイスのデバイス値を更新したときのCPUユニットタイマー43によってカウントされているカウント値(時刻情報)を取得して、各デバイスの時刻情報としてデバイスメモリ48に記憶させてもよい。つまり、時刻情報を格納するデバイスがデバイスメモリ48に設けられてもよい。この場合、バッファ管理部42は、デバイスメモリ48からデバイス値と時刻情報とを読み出してリングバッファ49に格納する。リングバッファ49に格納したデバイス値と時刻情報はプログラム作成支援装置1によって読み出される。換言すれば、バッファ管理部42は、リングバッファ49に格納したデバイス値と時刻情報を、通信部14を介して接続したプログラム作成支援装置1に出力ないしは送信する。   In S26, the CPU 10 (buffer management unit 42) reads out the device value from the device memory 48 according to the trace setting 47 and stores it in the ring buffer 49. At the time of storage, the buffer management unit 42 may acquire the count value (time information) counted by the CPU unit timer 43 and store it in the ring buffer 49 together with the device value. Alternatively, the device management unit 41 acquires the count value (time information) counted by the CPU unit timer 43 when the device value of each device is updated, and stores the count value in the device memory 48 as the time information of each device. You may. That is, a device for storing time information may be provided in the device memory 48. In this case, the buffer management unit 42 reads the device value and the time information from the device memory 48 and stores them in the ring buffer 49. The device value and the time information stored in the ring buffer 49 are read by the program creation support device 1. In other words, the buffer management unit 42 outputs or transmits the device value and the time information stored in the ring buffer 49 to the program creation support device 1 connected via the communication unit 14.

S27でCPU10(バッファ管理部42)はトレースを停止する条件が満たされたかどうかを判定する。たとえば、バッファ管理部42は、プログラム作成支援装置1からトレース停止の指示を受信したかどうかを判定する。あるいは、CPU10(バッファ管理部42)はトレース設定47により定義された停止トリガ(停止イベント)が発生したかどうかを判定してもよい。トレースを停止する条件が満たされていなければ、バッファ管理部42はS26に戻り、S26とS27を繰り返す。トレースを停止する条件が満たされると、バッファ管理部42はトレースを終了する。   In S27, the CPU 10 (buffer management unit 42) determines whether a condition for stopping the trace is satisfied. For example, the buffer management unit 42 determines whether an instruction to stop tracing has been received from the program creation support device 1. Alternatively, the CPU 10 (buffer management unit 42) may determine whether a stop trigger (stop event) defined by the trace setting 47 has occurred. If the condition for stopping the trace is not satisfied, the buffer management unit 42 returns to S26 and repeats S26 and S27. When the condition for stopping the trace is satisfied, the buffer management unit 42 ends the trace.

<拡張ユニットが実行する処理>
図14は拡張ユニット4のCPU110が実行する処理を示すフローチャートである。なお、デバイス管理部51は、ラダープログラム35が開始されたことを通信によって通知されると、リフレッシュのタイミングごとに各デバイス値(バッファメモリ)を更新する。
<Process executed by extension unit>
FIG. 14 is a flowchart illustrating a process executed by the CPU 110 of the extension unit 4. When notified that the ladder program 35 has started by communication, the device management unit 51 updates each device value (buffer memory) at each refresh timing.

S31でCPU110はプログラム作成支援装置1から拡張ユニット4用のトレース設定57を受信し、記憶装置112に記憶する。S32でCPU110(バッファ管理部52)はプログラム作成支援装置1からトレースの開始を指示されたかどうかを判定する。トレースの開始を指示されると、CPU110はS33に進む。   In S31, the CPU 110 receives the trace setting 57 for the extension unit 4 from the program creation support device 1 and stores it in the storage device 112. In S32, the CPU 110 (buffer management unit 52) determines whether or not the start of tracing has been instructed by the program creation support device 1. When the start of the trace is instructed, the CPU 110 proceeds to S33.

S33でCPU110(バッファ管理部52)はトレース設定57にしたがってデバイスメモリ58からデバイス値を読み出してリングバッファ59に格納する。格納の際に、バッファ管理部52は拡張ユニットタイマー53によってカウントされているカウント値(時刻情報)を取得して、デバイス値とともにリングバッファ59に格納してもよい。あるいは、デバイス管理部51が、各デバイスのデバイス値(バッファメモリ)を更新したときに拡張ユニットタイマー53によってカウントされていたカウント値(時刻情報)を取得して、各デバイス(バッファメモリ)の時刻情報としてデバイスメモリ58に記憶させてもよい。つまり、時刻情報を格納するデバイス(バッファメモリ)がデバイスメモリ58に設けられてもよい。この場合、バッファ管理部52は、デバイスメモリ58からデバイス値(バッファメモリ値)と時刻情報とを読み出してリングバッファ59に格納する。リングバッファ59に格納したデバイス値と時刻情報はプログラム作成支援装置1によって読み出される。換言すれば、バッファ管理部52は、リングバッファ59に格納したデバイス値と時刻情報を、通信部114および基本ユニット3の通信部14を介して接続したプログラム作成支援装置1に出力ないしは送信する。   In S33, the CPU 110 (buffer management unit 52) reads the device value from the device memory 58 according to the trace setting 57 and stores it in the ring buffer 59. At the time of storage, the buffer management unit 52 may acquire the count value (time information) counted by the extension unit timer 53 and store it in the ring buffer 59 together with the device value. Alternatively, the device management unit 51 acquires the count value (time information) counted by the extension unit timer 53 when the device value (buffer memory) of each device is updated, and acquires the time of each device (buffer memory). The information may be stored in the device memory 58. That is, a device (buffer memory) for storing time information may be provided in the device memory 58. In this case, the buffer management unit 52 reads the device value (buffer memory value) and the time information from the device memory 58 and stores them in the ring buffer 59. The device value and the time information stored in the ring buffer 59 are read by the program creation support device 1. In other words, the buffer management unit 52 outputs or transmits the device value and the time information stored in the ring buffer 59 to the program creation support device 1 connected via the communication unit 114 and the communication unit 14 of the basic unit 3.

S34でCPU110(バッファ管理部52)はトレースを停止する条件が満たされたかどうかを判定する。たとえば、バッファ管理部52は、プログラム作成支援装置1からトレース停止の指示を受信したかどうかを判定する。あるいは、CPU110(バッファ管理部52)はトレース設定57により定義された停止トリガ(停止イベント)が発生したかどうかを判定してもよい。トレースを停止する条件が満たされていなければ、バッファ管理部52はS33に戻り、S33とS34を繰り返す。トレースを停止する条件が満たされると、バッファ管理部52はトレースを終了する。   In S34, the CPU 110 (buffer management unit 52) determines whether a condition for stopping the trace is satisfied. For example, the buffer management unit 52 determines whether an instruction to stop tracing has been received from the program creation support device 1. Alternatively, the CPU 110 (the buffer management unit 52) may determine whether or not a stop trigger (stop event) defined by the trace setting 57 has occurred. If the condition for stopping the trace is not satisfied, the buffer management unit 52 returns to S33 and repeats S33 and S34. When the condition for stopping the trace is satisfied, the buffer management unit 52 ends the trace.

<ユニット間同期>
スキャンタイムは一般に数ミリ秒であるが、位置決めユニットなどの拡張ユニット4ではより短い周期で被制御装置16の位置を制御したいという要請がある。しかし、1つのスキャンタイムで入出力デバイスのリフレッシュ(一括リフレッシュ)は1回だけである。そこで、本実施例では上述した同期リフレッシュも採用している。
<Synchronization between units>
The scan time is generally several milliseconds, but there is a demand for controlling the position of the controlled device 16 with a shorter cycle in the extension unit 4 such as a positioning unit. However, the refresh of the input / output device (batch refresh) is performed only once in one scan time. Therefore, the present embodiment also employs the above-described synchronous refresh.

図15は一括リフレッシュと同期リフレッシュとの関係を示す図である。図15が示すように、一括リフレッシュにより基本ユニット3と拡張ユニット4との間で入出力デバイスのデバイス値が更新される。たとえば、カウンタユニットである拡張ユニット4の現在座標は1つのスキャンタイムで一回だけ更新され、位置決めユニットである他の拡張ユニット4への目標座標も1つのスキャンタイムで一回だけ更新される。しかし、これではより高速な追従制御を実現することができない。そこで、基本ユニット3の内部制御周期と拡張ユニット4の内部制御周期とを同期させ、この制御周期ごとにデバイスやバッファなどをリフレッシュする同期リフレッシュについても本実施例では採用している。なお、ラダープログラムのうち、この制御周期に同期して実行されるプログラムはユニット間同期プログラムと呼ばれる。図15において同期リフレッシュは、ラダープログラムの実行期間だけでなく、一括リフレッシュの実行期間やエンド処理の実行期間においても実行される。   FIG. 15 is a diagram showing the relationship between batch refresh and synchronous refresh. As shown in FIG. 15, the device value of the input / output device is updated between the basic unit 3 and the extension unit 4 by the batch refresh. For example, the current coordinates of the extension unit 4 as a counter unit are updated only once in one scan time, and the target coordinates for another extension unit 4 as a positioning unit are updated only once in one scan time. However, this does not make it possible to realize higher-speed tracking control. Therefore, the present embodiment also employs a synchronous refresh in which the internal control cycle of the basic unit 3 and the internal control cycle of the extension unit 4 are synchronized, and the devices and buffers are refreshed every control cycle. Note that among the ladder programs, a program executed in synchronization with the control cycle is called an inter-unit synchronization program. In FIG. 15, the synchronous refresh is executed not only during the execution period of the ladder program, but also during the execution period of the batch refresh and the execution period of the end processing.

図16は同期リフレッシュの一例を示す図である。基本ユニット3のデバイス管理部41は、制御周期ごとに同期リフレッシュを実行する。図16によれば、制御周期内でまず同期リフレッシュの対象として予め指定されているデバイスである現在座標Xnがリフレッシュされる。次に、デバイス管理部41は、現在座標Xnから算出した目標座用Yn+1のデバイスに格納し、これを位置決めユニットである拡張ユニット4のデバイスにコピーする。位置決めユニットである拡張ユニット4は、デバイスが保持しているデバイス値を今回の指令値(目標座標)として内部処理(パラレルリンクやボールねじなどの追従制御)を実行する。以下、同様に制御周期ごとに同期リフレッシュが実行される。   FIG. 16 is a diagram illustrating an example of the synchronous refresh. The device management unit 41 of the basic unit 3 executes a synchronous refresh for each control cycle. According to FIG. 16, the current coordinate Xn, which is a device previously specified as a target of synchronous refresh, is refreshed in the control cycle. Next, the device management unit 41 stores the data in the device of the target seat Yn + 1 calculated from the current coordinates Xn, and copies this to the device of the extension unit 4 that is the positioning unit. The extension unit 4 as a positioning unit executes internal processing (following control of a parallel link, a ball screw, or the like) using the device value held by the device as a current command value (target coordinate). Hereinafter, the synchronous refresh is similarly performed for each control cycle.

このように同期リフレッシュを採用すると、位置決めユニットが内部処理を開始する時点では必ず最新の指令値を基本ユニット3から取得できるようになる。これにより、高速かつきめ細やかな追従制御が実現可能となる。   When the synchronous refresh is employed in this manner, the latest command value can always be obtained from the basic unit 3 when the positioning unit starts internal processing. As a result, high-speed and fine tracking control can be realized.

また、各デバイス値は時刻情報(10、11などのカウント値)とともにリングバッファに格納されて保持されている。よって、同一の時刻情報に関連付けられている複数のデバイス値(現在座標や目標座標)の時間軸を揃えて表示させることが可能となる。   Each device value is stored and held in a ring buffer together with time information (count values such as 10 and 11). Therefore, it is possible to display a plurality of device values (current coordinates and target coordinates) associated with the same time information while aligning the time axes.

<まとめ>
図1などを用いて説明したように、CPUユニットとして機能する基本ユニット3と、基本ユニット3と通信する拡張ユニット4とを有するプログラマブル・ロジック・コントローラ(PLC2)が提供される。また、プログラム作成支援装置1はPLC2の動作状態をモニタするモニタ装置として機能する。図10を用いて説明したように、基本ユニット3はPLC2の動作状態を示すデバイス値が格納される複数のデバイスからなるデバイスメモリ48と、デバイス値がデバイスに格納される時刻を管理するためのCPUユニットタイマー43とを有している。図11を用いて説明したように拡張ユニット4はPLC2の動作状態を示すバッファメモリを格納するバッファメモリとして機能するデバイスメモリ58を有している。さらに、拡張ユニット4はCPUユニットタイマー43と時刻同期されており、バッファメモリがバッファメモリに格納される時刻を管理するための拡張ユニットタイマー53を有している。図6を用いて説明したように、プログラム作成支援装置1は基本ユニット3のデバイスメモリ48に記憶されているデバイス値を取得するとともに、拡張ユニット4のバッファメモリ(デバイスメモリ58)に記憶されているバッファメモリ(デバイス値)を取得する取得手段として機能するリングバッファ管理部33を有している。描画部34や表示部7は、デバイス値の格納時刻とバッファメモリの格納時刻とに基づきデバイス値とバッファメモリとの時間軸を整合させて表示する表示手段として機能する。このように、CPUユニットタイマー43と拡張ユニットタイマー53が時刻同期しているため、デバイス値やバッファメモリ値の取得ないしは格納のタイミングも正確となろう。つまり、デバイス値やバッファメモリの時間軸が正確に揃うことになる。よって、基本ユニット3から取得したデータの時間軸と拡張ユニット4から取得したデータの時間軸とを正確に揃えて表示することが可能となる。
<Summary>
As described with reference to FIG. 1 and the like, a programmable logic controller (PLC2) having a basic unit 3 functioning as a CPU unit and an extension unit 4 communicating with the basic unit 3 is provided. Further, the program creation support device 1 functions as a monitor device that monitors the operation state of the PLC 2. As described with reference to FIG. 10, the basic unit 3 manages the device memory 48 including a plurality of devices in which device values indicating the operation state of the PLC 2 are stored, and the time at which the device values are stored in the devices. A CPU unit timer 43; As described with reference to FIG. 11, the extension unit 4 includes the device memory 58 that functions as a buffer memory that stores a buffer memory that indicates the operation state of the PLC 2. Further, the extension unit 4 is time-synchronized with the CPU unit timer 43, and has an extension unit timer 53 for managing the time at which the buffer memory is stored in the buffer memory. As described with reference to FIG. 6, the program creation support device 1 acquires the device value stored in the device memory 48 of the basic unit 3 and stores the device value in the buffer memory (device memory 58) of the extension unit 4. It has a ring buffer management unit 33 that functions as an acquisition unit that acquires a buffer memory (device value). The drawing unit 34 and the display unit 7 function as display means for matching and displaying the time axis of the device value and the buffer memory based on the storage time of the device value and the storage time of the buffer memory. As described above, since the CPU unit timer 43 and the extension unit timer 53 are time-synchronized, the acquisition or storage timing of the device value or the buffer memory value will be accurate. That is, the device value and the time axis of the buffer memory are accurately aligned. Therefore, the time axis of the data acquired from the basic unit 3 and the time axis of the data acquired from the extension unit 4 can be accurately aligned and displayed.

基本ユニット3のリングバッファ49は、予め設定された周期でデバイスメモリ48のデバイス値と当該デバイス値の格納時刻に関する時刻情報を格納する第一リングバッファの一例である。プログラム作成支援装置1のリングバッファ管理部33は、基本ユニット3のリングバッファ49からデバイスメモリ48のデバイス値と当該デバイス値の時刻情報とを取得する。一般に、リングバッファは、時系列のデータを格納して読み出すのに向いたバッファである。したがって、デバイス値を時間軸に揃えて管理することに向いている。リングバッファ以外の記憶構造がリングバッファに代えて採用されてもよい。   The ring buffer 49 of the basic unit 3 is an example of a first ring buffer that stores the device value of the device memory 48 and time information on the storage time of the device value at a preset cycle. The ring buffer management unit 33 of the program creation support device 1 acquires the device value of the device memory 48 and the time information of the device value from the ring buffer 49 of the basic unit 3. Generally, a ring buffer is a buffer suitable for storing and reading out time-series data. Therefore, it is suitable for managing device values in a time axis. A storage structure other than the ring buffer may be employed instead of the ring buffer.

拡張ユニット4のリングバッファ59は、予め設定された周期でバッファメモリのバッファメモリと当該バッファメモリ値の格納時刻に関する時刻情報を格納する第二リングバッファの一例である。プログラム作成支援装置1のリングバッファ管理部33は、拡張ユニット4のリングバッファ59からバッファメモリのバッファメモリと当該バッファメモリの時刻情報とを取得してもよい。このようにリングバッファを採用することでデバイス値やバッファメモリを時間軸に揃えて管理しやすくなろう。   The ring buffer 59 of the extension unit 4 is an example of a second ring buffer that stores time information about the buffer memory of the buffer memory and the storage time of the buffer memory value at a preset cycle. The ring buffer management unit 33 of the program creation support device 1 may acquire the buffer memory of the buffer memory and the time information of the buffer memory from the ring buffer 59 of the extension unit 4. By adopting the ring buffer in this manner, it will be easier to manage the device values and the buffer memory along the time axis.

基本ユニット3の同期部44はCPUユニットタイマー43の時刻と拡張ユニットタイマー53の時刻とを同期させる同期信号を拡張ユニット4に送信してもよい。拡張ユニット4の同期部54は同期信号に応じて拡張ユニットタイマー53の時刻をCPUユニットタイマー43の時刻に同期させる。このように同期信号によって拡張ユニットタイマー53の時刻をCPUユニットタイマー43の時刻に同期させてもよい。これにより、ある時刻に取得された基本ユニット3のデバイス値と、その時刻に拡張ユニット4から取得されたデバイス値(バッファメモリ)とを時間軸でより正確に揃えやすくなろう。   The synchronization unit 44 of the basic unit 3 may transmit a synchronization signal for synchronizing the time of the CPU unit timer 43 and the time of the extension unit timer 53 to the extension unit 4. The synchronization unit 54 of the extension unit 4 synchronizes the time of the extension unit timer 53 with the time of the CPU unit timer 43 according to the synchronization signal. Thus, the time of the extension unit timer 53 may be synchronized with the time of the CPU unit timer 43 by the synchronization signal. As a result, the device value of the basic unit 3 obtained at a certain time and the device value (buffer memory) obtained from the extension unit 4 at that time can be more easily aligned on the time axis.

基本ユニット3のデバイスメモリ48に格納される複数のデバイス値のうち少なくとも一部のデバイス値は、基本ユニット3がユーザプログラムを繰り返し実行するスキャンタイムにしたがって拡張ユニット4と通信することで更新される。また、複数のデバイス値のうち少なくとも一部のデバイス値は、スキャンタイムよりも短い一定の制御周期で拡張ユニット4と通信することで更新されてもよい。つまり、後者のデバイス値はユニット間同期リフレッシュによって更新されてもよい。これにより、スキャンタイムよりも短い周期でデバイス値がどのように変化しているかをモニタリングすることが可能となる。   At least some of the plurality of device values stored in the device memory 48 of the basic unit 3 are updated by communicating with the extension unit 4 according to a scan time at which the basic unit 3 repeatedly executes the user program. . In addition, at least some of the device values of the plurality of device values may be updated by communicating with the extension unit 4 at a fixed control cycle shorter than the scan time. That is, the latter device value may be updated by the inter-unit synchronous refresh. This makes it possible to monitor how the device value changes in a cycle shorter than the scan time.

図15や図16を用いて説明したように、基本ユニット3の内部における制御周期と拡張ユニット4の内部における制御周期とがCPUユニットタイマー43と拡張ユニットタイマー53とを通じて同期していてもよい。このようなユニット間同期を採用することで、基本ユニット3内の制御周期と拡張ユニット4内の制御周期とが整合するようになる。その結果、モーションユニットなど、スキャンタイムよりも短い周期で制御される拡張ユニット4のデバイス値(バッファメモリ)についても基本ユニット3のデバイス値に対して精度よく時間軸を整合させてモニタリングすることが可能となろう。   As described with reference to FIGS. 15 and 16, the control cycle inside the basic unit 3 and the control cycle inside the extension unit 4 may be synchronized through the CPU unit timer 43 and the extension unit timer 53. By employing such inter-unit synchronization, the control cycle in the basic unit 3 and the control cycle in the extension unit 4 match. As a result, a device value (buffer memory) of the extension unit 4 such as a motion unit, which is controlled in a cycle shorter than the scan time, can be monitored while accurately aligning the time axis with the device value of the basic unit 3. Will be possible.

プログラム作成支援装置1のリングバッファ管理部33は、制御周期の整数倍の取得周期でデバイス値とバッファメモリを取得してもよい。表示部7は、この取得周期で取得されたデバイス値とバッファメモリを表示する。ユニット間同期に関連した制御周期は、スキャンタイムによりかなり短い周期に設定されることもある。この場合、短時間で非常に多くのデバイス値とバッファメモリが取得されてしまう。しかし、短時間ではそれほどデバイス値とバッファメモリが変化しないアプリケーションでは同じ値のデバイス値とバッファメモリが連続してしまい、通信の負荷が大きくなるわりには無駄なデータが増えてしまう。したがって、制御周期の整数倍の取得周期でデバイス値とバッファメモリを取得することで、PLC2とプログラム作成支援装置1との間の通信の負荷を軽減できるようになろう。   The ring buffer management unit 33 of the program creation support device 1 may acquire the device value and the buffer memory at an acquisition cycle that is an integral multiple of the control cycle. The display unit 7 displays the device value and the buffer memory acquired in the acquisition cycle. The control cycle related to inter-unit synchronization may be set to a considerably short cycle depending on the scan time. In this case, a very large number of device values and buffer memories are obtained in a short time. However, in an application in which the device value and the buffer memory do not change so much in a short time, the device value and the buffer memory having the same value are continuous, and useless data increases in spite of increasing the communication load. Therefore, by acquiring the device value and the buffer memory at an acquisition cycle that is an integral multiple of the control cycle, the communication load between the PLC 2 and the program creation support device 1 will be reduced.

上述した説明では、プログラム作成支援装置1が主体的にデバイス値等を基本ユニット3や拡張ユニット4から取得するものとして説明したが、基本ユニット3や拡張ユニット4の側から取得処理を理解してもよい。たとえば、基本ユニット3は各デバイス値と当該各デバイス値の格納時刻を示す時刻情報とをプログラム作成支援装置1に送信する。また、拡張ユニット4は各バッファメモリと当該各バッファメモリの格納時刻を示す時刻情報とをプログラム作成支援装置1に送信する。描画部34は各デバイス値の格納時刻を示す時刻情報と、各バッファメモリの格納時刻を示す時刻情報とに基づきデバイス値とバッファメモリとの時間軸を整合させて表示部7に表示する。   In the above description, it has been described that the program creation support apparatus 1 mainly acquires device values and the like from the basic unit 3 and the extension unit 4. However, the acquisition process is understood from the basic unit 3 and the extension unit 4 side. Is also good. For example, the basic unit 3 transmits to the program creation support device 1 each device value and time information indicating the storage time of each device value. Further, the extension unit 4 transmits each buffer memory and time information indicating the storage time of each buffer memory to the program creation support device 1. The drawing unit 34 displays the device values on the display unit 7 by matching the time axes of the device values and the buffer memory based on the time information indicating the storage time of each device value and the time information indicating the storage time of each buffer memory.

上述した説明では、プログラム作成支援装置1が基本ユニット3と拡張ユニット4とから並列にデータを収集するものとして説明したが、収集機能は基本ユニット3に設けられてもよい。より具体的には、基本ユニット3のバッファ管理部42は各バッファメモリと当該各バッファメモリ値の格納時刻を示す時刻情報とを拡張ユニット4から受信し、各デバイス値の格納時刻を示す時刻情報と、各バッファメモリ値の格納時刻を示す時刻情報とに基づき、各デバイス値と各バッファメモリとの時間軸を整合させてプログラム作成支援装置1に送信してもよい。この場合、時刻情報はプログラム作成支援装置1に送信されなくてもよい。基本ユニット3のから収集したデバイス値と拡張ユニット4から収集したデバイス値(バッファメモリ)とは、それぞれの時刻情報に基づき時間軸を整合されてリングバッファ49に格納されるからである。つまり、リングバッファ49に格納される段階で、基本ユニット3のから収集したデバイス値と拡張ユニット4から収集したデバイス値(バッファメモリ)とは時間軸上で整合されていてもよい。   In the above description, the program creation support device 1 collects data from the basic unit 3 and the extension unit 4 in parallel. However, the collection function may be provided in the basic unit 3. More specifically, the buffer management unit 42 of the basic unit 3 receives from the extension unit 4 each buffer memory and time information indicating the storage time of each buffer memory value, and the time information indicating the storage time of each device value. Based on the time information indicating the storage time of each buffer memory value, the time axis of each device value and each buffer memory may be matched and transmitted to the program creation support device 1. In this case, the time information need not be transmitted to the program creation support device 1. This is because the device value collected from the basic unit 3 and the device value (buffer memory) collected from the extension unit 4 are stored in the ring buffer 49 with their time axes aligned based on the respective time information. That is, at the stage of storing in the ring buffer 49, the device value collected from the basic unit 3 and the device value (buffer memory) collected from the extension unit 4 may be matched on the time axis.

プログラム作成支援装置1は、基本ユニット3を介して拡張ユニット4のデバイスメモリ58からデバイス値(バッファメモリ)を取得してもよい。プログラム作成支援装置1から基本ユニット3と拡張ユニット4にそれぞれ通信ケーブルを接続することも考えられるが、複数の通信ケーブルは邪魔になりやすい。そこで、プログラム作成支援装置1から基本ユニット3に一本の通信ケーブルを接続し、基本ユニット3と拡張ユニット4をバスで接続する。つまり、プログラム作成支援装置1と拡張ユニット4は、通信ケーブル、基本ユニット3およびバスを介して接続されてもよい。これにより、通信ケーブルの本数を削減可能となろう。   The program creation support device 1 may acquire a device value (buffer memory) from the device memory 58 of the extension unit 4 via the basic unit 3. It is conceivable to connect a communication cable from the program creation support device 1 to each of the basic unit 3 and the extension unit 4, but a plurality of communication cables are likely to be an obstacle. Therefore, one communication cable is connected from the program creation support device 1 to the basic unit 3, and the basic unit 3 and the extension unit 4 are connected by a bus. That is, the program creation support device 1 and the extension unit 4 may be connected via the communication cable, the basic unit 3, and the bus. Thus, the number of communication cables can be reduced.

プログラム作成支援装置1のリングバッファ38は、リングバッファ管理部33により取得されたデバイス値とバッファメモリとを記憶する第三リングバッファとして機能する。描画部34は、リングバッファ38からデバイス値とバッファメモリ値とを読み出してデバイス値とバッファメモリとの時間軸を整合させて表示してもよい。このように、プログラム作成支援装置1にもリングバッファ38を設けてデバイス値とバッファメモリを保持することで、これらの時間軸を容易に揃えやすくなろう。   The ring buffer 38 of the program creation support device 1 functions as a third ring buffer that stores the device values acquired by the ring buffer management unit 33 and a buffer memory. The drawing unit 34 may read the device value and the buffer memory value from the ring buffer 38 and display the device value and the buffer memory in a manner that the time axes of the device value and the buffer memory are matched. As described above, by providing the ring buffer 38 in the program creation support device 1 and holding the device values and the buffer memory, the time axes can be easily aligned.

Claims (10)

CPUユニットと、前記CPUユニットと通信する拡張ユニットとを有するプログラマブル・ロジック・コントローラと接続され、当該プログラマブル・ロジック・コントローラの動作状態をモニタするモニタ装置であって、
前記プログラマブル・ロジック・コントローラは、
前記CPUユニットの時刻情報と拡張ユニットの時刻情報とが同期され、前記CPUユニットと前記拡張ユニットのそれぞれのデバイス値はスキャン周期とは異なるユニット間同期周期ごとにユニット間同期リフレッシュとして更新され、
前記CPUユニットおよび前記拡張ユニットは同期されたそれぞれの内部における前記ユニット間同期周期にしたがって各々のプログラムを実行し、
前記CPUユニットは、
前記プログラマブル・ロジック・コントローラの動作状態を示すデバイス値が格納される複数のデバイスからなるデバイスメモリと、
前記ユニット間同期周期を管理し、前記デバイス値が前記デバイスメモリに格納される時刻を管理するためのCPUユニットタイマーと、
前記ユニット間同期周期にしたがって、前記デバイス値を参照してユーザプログラムを実行するユーザプログラム実行部と、
前記ユニット間同期リフレッシュにしたがって、前記デバイスメモリの前記デバイス値と当該デバイス値の格納時刻に関する時刻情報を格納する第一リングバッファとを有し、
前記拡張ユニットは、
前記デバイスメモリの入力デバイスに関連付けられており、前記拡張ユニットから前記CPUユニットへ入力された前記デバイス値を保持する入力デバイスと、前記CPUユニットの出力デバイスに関連付けられており、前記CPUユニットから前記拡張ユニットへ出力される前記デバイス値を保持する出力デバイスとを有し、前記プログラマブル・ロジック・コントローラの動作状態を示すバッファメモリ値を格納するバッファメモリと、
前記ユニット間同期周期を管理し、前記CPUユニットタイマーと時刻同期されており、前記バッファメモリ値が前記バッファメモリに格納される時刻を管理するための拡張ユニットタイマーと、
前記ユニット間同期リフレッシュにしたがって、前記バッファメモリの前記バッファメモリ値と当該バッファメモリ値の格納時刻に関する時刻情報を格納する第二リングバッファと
を有し、
前記CPUユニットは、前記CPUユニットタイマーの時刻と前記拡張ユニットタイマーの時刻とを同期させる同期信号を前記拡張ユニットに送信し、前記拡張ユニットは前記同期信号に応じて前記拡張ユニットタイマーの時刻を前記CPUユニットタイマーの時刻に同期させ、
前記モニタ装置は、
前記CPUユニットの前記第一リングバッファから前記デバイスメモリの前記デバイス値と当該デバイス値の時刻情報とを取得し、かつ、前記拡張ユニットの前記第二リングバッファから前記バッファメモリの前記バッファメモリ値と当該バッファメモリ値の時刻情報とを取得する取得手段と、
前記デバイス値の時刻情報と前記バッファメモリ値の時刻情報とに基づき前記デバイス値と前記バッファメモリ値との時間軸を整合させて表示する表示手段と
を有することを特徴とするモニタ装置。
A monitor device that is connected to a programmable logic controller having a CPU unit and an extension unit that communicates with the CPU unit, and monitors an operation state of the programmable logic controller,
The programmable logic controller comprises:
The time information of the CPU unit and the time information of the extension unit are synchronized, and the device values of the CPU unit and the extension unit are updated as an inter-unit synchronization refresh for each inter-unit synchronization cycle different from a scan cycle,
The CPU unit and the extension unit execute respective programs in accordance with the inter-unit synchronization cycle in each of the synchronized units,
The CPU unit includes:
A device memory including a plurality of devices in which device values indicating an operation state of the programmable logic controller are stored;
A CPU unit timer for managing the inter-unit synchronization cycle and managing the time at which the device value is stored in the device memory ;
According to the inter-unit synchronization cycle, a user program execution unit that executes a user program with reference to the device value,
According to the inter-unit synchronous refresh, the device memory of the device memory and a first ring buffer that stores time information about the storage time of the device value ,
The extension unit includes:
An input device that is associated with an input device of the device memory and that holds the device value input from the extension unit to the CPU unit, and an output device of the CPU unit, An output device that holds the device value output to the expansion unit, and a buffer memory that stores a buffer memory value indicating an operation state of the programmable logic controller;
An extended unit timer that manages the inter-unit synchronization cycle, is time-synchronized with the CPU unit timer, and manages the time at which the buffer memory value is stored in the buffer memory;
A second ring buffer that stores the buffer memory value of the buffer memory and time information about the storage time of the buffer memory value according to the inter-unit synchronous refresh ,
The CPU unit transmits a synchronization signal for synchronizing the time of the CPU unit timer and the time of the extension unit timer to the extension unit, and the extension unit sets the time of the extension unit timer according to the synchronization signal. Synchronize with the time of the CPU unit timer,
The monitor device,
The device value of the device memory and the time information of the device value are obtained from the first ring buffer of the CPU unit, and the buffer memory value of the buffer memory is obtained from the second ring buffer of the expansion unit. Acquiring means for acquiring time information of the buffer memory value ;
Monitoring device and having a display means for display by matching the time axis of the buffer memory value and the device value based on the time information of the time information and the buffer memory value of the device value.
前記CPUユニットのデバイスメモリに格納される複数のデバイス値のうち少なくとも一部のデバイス値は、前記CPUユニットがユーザプログラムを繰り返し実行するスキャンタイムにしたがって前記拡張ユニットと通信することで更新され、前記複数のデバイス値のうち少なくとも一部のデバイス値は、前記スキャンタイムよりも短い一定の制御周期で前記拡張ユニットと通信することで更新されることを特徴とする請求項1に記載のモニタ装置。   At least some of the plurality of device values stored in the device memory of the CPU unit are updated by communicating with the extension unit according to a scan time at which the CPU unit repeatedly executes a user program, The monitor device according to claim 1, wherein at least some of the device values of the plurality of device values are updated by communicating with the extension unit at a fixed control cycle shorter than the scan time. 前記CPUユニットの内部における制御周期と前記拡張ユニットの内部における制御周期とが前記CPUユニットタイマーと前記拡張ユニットタイマーとを通じて同期している
ことを特徴とする請求項1または2に記載のモニタ装置。
3. The monitor device according to claim 1, wherein a control cycle inside the CPU unit and a control cycle inside the extension unit are synchronized through the CPU unit timer and the extension unit timer. 4.
前記取得手段は、前記制御周期の整数倍の取得周期で前記デバイス値と前記バッファメモリ値を取得し、
前記表示手段は、前記取得周期で取得された前記デバイス値と前記バッファメモリ値を表示することを特徴とする請求項に記載のモニタ装置。
The acquisition unit acquires the device value and the buffer memory value at an acquisition cycle that is an integral multiple of the control cycle,
The monitor device according to claim 3 , wherein the display unit displays the device value and the buffer memory value acquired in the acquisition cycle.
前記CPUユニットは各デバイス値と当該各デバイス値の格納時刻を示す時刻情報とを前記取得手段に送信し、
前記拡張ユニットは各バッファメモリ値と当該各バッファメモリ値の格納時刻を示す時刻情報とを前記取得手段に送信し、
前記表示手段は、前記各デバイス値の格納時刻を示す時刻情報と、前記各バッファメモリ値の格納時刻を示す時刻情報とに基づき前記デバイス値と前記バッファメモリ値との時間軸を整合させて表示することを特徴とする請求項1に記載のモニタ装置。
The CPU unit transmits each device value and time information indicating a storage time of each device value to the acquisition unit,
The extension unit transmits each buffer memory value and time information indicating a storage time of each buffer memory value to the acquisition unit,
The display unit displays the device value and the buffer memory value in a time axis aligned with each other based on time information indicating the storage time of each device value and time information indicating the storage time of each buffer memory value. The monitor device according to claim 1, wherein:
前記CPUユニットは各バッファメモリ値と当該各バッファメモリ値の格納時刻を示す時刻情報とを前記拡張ユニットから受信し、各デバイス値の格納時刻を示す時刻情報と、前記各バッファメモリ値の格納時刻を示す時刻情報とに基づき、前記各デバイス値と前記各バッファメモリ値との時間軸を整合させて前記取得手段に送信し、
前記表示手段は、前記各デバイス値の格納時刻を示す時刻情報と、前記各バッファメモリ値の格納時刻を示す時刻情報とに基づき前記デバイス値と前記バッファメモリ値との時間軸を整合させて表示することを特徴とする請求項1に記載のモニタ装置。
The CPU unit receives each buffer memory value and time information indicating a storage time of each buffer memory value from the extension unit, and stores time information indicating a storage time of each device value and a storage time of each buffer memory value. Based on the time information indicating, the time axis of each device value and each buffer memory value is matched and transmitted to the acquisition unit,
The display unit displays the device value and the buffer memory value in a time axis aligned with each other based on time information indicating the storage time of each device value and time information indicating the storage time of each buffer memory value. The monitor device according to claim 1, wherein:
前記取得手段は、前記CPUユニットを介して前記拡張ユニットの前記バッファメモリから前記バッファメモリ値を取得することを特徴とする請求項1ないしのいずれか一項に記載のモニタ装置。 The monitor device according to any one of claims 1 to 6 , wherein the obtaining unit obtains the buffer memory value from the buffer memory of the extension unit via the CPU unit. 前記取得手段により取得された前記デバイス値と前記バッファメモリ値とを記憶する第三リングバッファをさらに有し、
前記表示手段は、前記第三リングバッファから前記デバイス値と前記バッファメモリ値とを読み出して前記デバイス値と前記バッファメモリ値との時間軸を整合させて表示することを特徴とする請求項1ないしのいずれか一項に記載のモニタ装置。
A third ring buffer that stores the device value and the buffer memory value obtained by the obtaining unit,
The display unit reads the device value and the buffer memory value from the third ring buffer, and displays the device value and the buffer memory value while aligning the time axes of the device value and the buffer memory value. monitoring device according to any one of 7.
CPUユニットと、前記CPUユニットと通信する拡張ユニットとを有するプログラマブル・ロジック・コントローラと前記プログラマブル・ロジック・コントローラと接続され、当該プログラマブル・ロジック・コントローラの動作状態をモニタするモニタ装置とを有するプログラマブル・ロジック・コントローラ・システムであって、
前記プログラマブル・ロジック・コントローラは、
前記CPUユニットの時刻情報と拡張ユニットの時刻情報とが同期され、前記CPUユニットと前記拡張ユニットのそれぞれのデバイス値はスキャン周期とは異なるユニット間同期周期ごとにユニット間同期リフレッシュとして更新され、
前記CPUユニットおよび前記拡張ユニットは同期されたそれぞれの内部におけるユニット間同期周期にしたがって各々のプログラムを実行し、
前記CPUユニットは、
前記プログラマブル・ロジック・コントローラの動作状態を示すデバイス値が格納される複数のデバイスからなるデバイスメモリと、
前記ユニット間同期周期を管理し、前記デバイス値が前記デバイスメモリに格納される時刻を管理するためのCPUユニットタイマーと、
前記ユニット間同期周期にしたがって、前記デバイス値を参照してユーザプログラムを実行するユーザプログラム実行部と、
前記ユニット間同期リフレッシュにしたがって、前記デバイスメモリの前記デバイス値と当該デバイス値の格納時刻に関する時刻情報を格納する第一リングバッファと
を有し、
前記拡張ユニットは、
前記デバイスメモリの入力デバイスに関連付けられており、前記拡張ユニットから前記CPUユニットへ入力された前記デバイス値を保持する入力デバイスと、前記CPUユニットの出力デバイスに関連付けられており、前記CPUユニットから前記拡張ユニットへ出力される前記デバイス値を保持する出力デバイスとを有し、前記プログラマブル・ロジック・コントローラの動作状態を示すバッファメモリ値を格納するバッファメモリと、
前記ユニット間同期周期を管理し、前記CPUユニットタイマーと時刻同期されており、前記バッファメモリ値が前記バッファメモリに格納される時刻を管理するための拡張ユニットタイマーと、
前記ユニット間同期リフレッシュにしたがって、前記バッファメモリの前記バッファメモリ値と当該バッファメモリ値の格納時刻に関する時刻情報を格納する第二リングバッファと
を有し、
前記CPUユニットは前記CPUユニットタイマーの時刻と前記拡張ユニットタイマーの時刻とを同期させる同期信号を前記拡張ユニットに送信し、前記拡張ユニットは前記同期信号に応じて前記拡張ユニットタイマーの時刻を前記CPUユニットタイマーの時刻に同期させ、
前記モニタ装置は、
前記CPUユニットの前記第一リングバッファから前記デバイスメモリの前記デバイス値と当該デバイス値の時刻情報とを取得し、かつ、前記拡張ユニットの前記第二リングバッファから前記バッファメモリの前記バッファメモリ値と当該バッファメモリ値の時刻情報とを取得する取得手段と、
前記デバイス値の時刻情報と前記バッファメモリ値の時刻情報とに基づき前記デバイス値と前記バッファメモリ値との時間軸を整合させて表示する表示手段と
を有することを特徴とするプログラマブル・ロジック・コントローラ・システム。
A programmable logic controller having a CPU unit, an extension unit communicating with the CPU unit, and a monitor connected to the programmable logic controller and monitoring an operation state of the programmable logic controller; A logic controller system,
The programmable logic controller comprises:
The time information of the CPU unit and the time information of the extension unit are synchronized, and the device values of the CPU unit and the extension unit are updated as an inter-unit synchronization refresh for each inter-unit synchronization cycle different from a scan cycle,
The CPU unit and the extension unit execute respective programs in accordance with the inter-unit synchronization cycle in each of the synchronized units;
The CPU unit includes:
A device memory including a plurality of devices in which device values indicating an operation state of the programmable logic controller are stored;
A CPU unit timer for managing the inter-unit synchronization cycle and managing the time at which the device value is stored in the device memory ;
According to the inter-unit synchronization cycle, a user program execution unit that executes a user program with reference to the device value,
A first ring buffer that stores the device value of the device memory and time information about a storage time of the device value according to the inter-unit synchronous refresh ,
The extension unit includes:
An input device that is associated with an input device of the device memory and that holds the device value input from the extension unit to the CPU unit, and an output device of the CPU unit, An output device that holds the device value output to the expansion unit, and a buffer memory that stores a buffer memory value indicating an operation state of the programmable logic controller;
An extended unit timer that manages the inter-unit synchronization cycle, is time-synchronized with the CPU unit timer, and manages the time at which the buffer memory value is stored in the buffer memory;
A second ring buffer that stores the buffer memory value of the buffer memory and time information about the storage time of the buffer memory value according to the inter-unit synchronous refresh ,
The CPU unit transmits a synchronization signal for synchronizing the time of the CPU unit timer and the time of the extension unit timer to the extension unit, and the extension unit sets the time of the extension unit timer according to the synchronization signal to the CPU. Synchronize with the unit timer time,
The monitor device,
The device value of the device memory and the time information of the device value are obtained from the first ring buffer of the CPU unit, and the buffer memory value of the buffer memory is obtained from the second ring buffer of the expansion unit. Acquiring means for acquiring time information of the buffer memory value ;
Programmable logic controller, characterized in that it comprises a display means for display by matching the time axis of the buffer memory value and the device value based on the time information of the buffer memory value and the time information of the device value ·system.
CPUユニットと、前記CPUユニットと通信する拡張ユニットとを有するプログラマブル・ロジック・コントローラと接続され、当該プログラマブル・ロジック・コントローラの動作状態をモニタするモニタ装置であって、
前記プログラマブル・ロジック・コントローラは、
前記CPUユニットの時刻情報と拡張ユニットの時刻情報とが同期され、前記CPUユニットと前記拡張ユニットのそれぞれのデバイス値はスキャン周期とは異なるユニット間同期周期ごとにユニット間同期リフレッシュとして更新され、
前記CPUユニットおよび前記拡張ユニットは同期されたそれぞれの内部における前記ユニット間同期周期にしたがって各々のプログラムを実行し、
前記CPUユニットは、
前記プログラマブル・ロジック・コントローラの動作状態を示すデバイス値が格納される複数のデバイスからなる第一デバイスメモリと、
前記ユニット間同期周期を管理し、前記デバイス値が前記第一デバイスメモリに格納される時刻を管理するためのCPUユニットタイマーと、
前記ユニット間同期周期にしたがって、前記デバイス値を参照してユーザプログラムを実行するユーザプログラム実行部と、
前記ユニット間同期リフレッシュにしたがって、前記第一デバイスメモリの前記デバイス値と当該デバイス値の格納時刻に関する時刻情報を格納する第一リングバッファと
を有し、
前記拡張ユニットは、
前記第一デバイスメモリの入力デバイスに関連付けられており、前記拡張ユニットから前記CPUユニットへ入力された前記デバイス値を保持する入力デバイスと、前記CPUユニットの出力デバイスに関連付けられており、前記CPUユニットから前記拡張ユニットへ出力される前記デバイス値を保持する出力デバイスとを有し、前記プログラマブル・ロジック・コントローラの動作状態を示すデバイス値を格納する第二デバイスメモリと、
前記ユニット間同期周期を管理し、前記CPUユニットタイマーと時刻同期されており、前記デバイス値が前記第二デバイスメモリに格納される時刻を管理するための拡張ユニットタイマーと、
前記ユニット間同期リフレッシュにしたがって、前記第二デバイスメモリの前記デバイス値と当該デバイス値の格納時刻に関する時刻情報を格納する第二リングバッファと
を有し、
前記CPUユニットは前記CPUユニットタイマーの時刻と前記拡張ユニットタイマーの時刻とを同期させる同期信号を前記拡張ユニットに送信し、前記拡張ユニットは前記同期信号に応じて前記拡張ユニットタイマーの時刻を前記CPUユニットタイマーの時刻に同期させ、
前記モニタ装置は、
前記CPUユニットの前記第一リングバッファから前記第一デバイスメモリの前記デバイス値と当該デバイス値の時刻情報とを取得し、かつ、前記拡張ユニットの前記第二リングバッファから前記第二デバイスメモリの前記デバイス値と当該デバイス値の時刻情報とを取得する取得手段と、
前記第一デバイスメモリのデバイス値の情報と前記第二デバイスメモリのデバイス値の情報とに基づき前記第一デバイスメモリのデバイス値と前記第二デバイスメモリのデバイス値との時間軸を整合させて表示する表示手段と
を有することを特徴とするモニタ装置。
A monitor device that is connected to a programmable logic controller having a CPU unit and an extension unit that communicates with the CPU unit, and monitors an operation state of the programmable logic controller,
The programmable logic controller comprises:
The time information of the CPU unit and the time information of the extension unit are synchronized, and the device values of the CPU unit and the extension unit are updated as an inter-unit synchronization refresh for each inter-unit synchronization cycle different from a scan cycle,
The CPU unit and the extension unit execute respective programs in accordance with the inter-unit synchronization cycle in each of the synchronized units,
The CPU unit includes:
A first device memory including a plurality of devices in which device values indicating an operation state of the programmable logic controller are stored,
A CPU unit timer for managing the inter-unit synchronization cycle and managing the time at which the device value is stored in the first device memory ;
According to the inter-unit synchronization cycle, a user program execution unit that executes a user program with reference to the device value,
A first ring buffer that stores the device value of the first device memory and time information about the storage time of the device value according to the inter-unit synchronous refresh ,
The extension unit includes:
An input device associated with an input device of the first device memory, the input device holding the device value input from the extension unit to the CPU unit, and an output device of the CPU unit; An output device that holds the device value output to the expansion unit from, and a second device memory that stores a device value indicating an operation state of the programmable logic controller,
An extended unit timer that manages the inter-unit synchronization cycle, is time-synchronized with the CPU unit timer, and manages the time at which the device value is stored in the second device memory;
A second ring buffer that stores the device value of the second device memory and time information about the storage time of the device value in accordance with the inter-unit synchronous refresh ,
The CPU unit transmits a synchronization signal for synchronizing the time of the CPU unit timer and the time of the extension unit timer to the extension unit, and the extension unit sets the time of the extension unit timer according to the synchronization signal to the CPU. Synchronize with the unit timer time,
The monitor device,
The device value of the first device memory and the time information of the device value are obtained from the first ring buffer of the CPU unit, and the second device buffer of the second device memory is obtained from the second ring buffer of the extension unit. Acquiring means for acquiring a device value and time information of the device value ;
The time axis of the device value of the second device memory and device value of the first device memory based on the time information when the device values of the the time information the second device memory when the device value of the first device memory A monitor device comprising: display means for displaying images in a matched manner.
JP2015207475A 2015-10-21 2015-10-21 Monitoring device for programmable logic controller and programmable logic controller system Expired - Fee Related JP6626315B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015207475A JP6626315B2 (en) 2015-10-21 2015-10-21 Monitoring device for programmable logic controller and programmable logic controller system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015207475A JP6626315B2 (en) 2015-10-21 2015-10-21 Monitoring device for programmable logic controller and programmable logic controller system

Publications (2)

Publication Number Publication Date
JP2017079009A JP2017079009A (en) 2017-04-27
JP6626315B2 true JP6626315B2 (en) 2019-12-25

Family

ID=58665421

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015207475A Expired - Fee Related JP6626315B2 (en) 2015-10-21 2015-10-21 Monitoring device for programmable logic controller and programmable logic controller system

Country Status (1)

Country Link
JP (1) JP6626315B2 (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10769049B2 (en) 2016-10-17 2020-09-08 Mitsubishi Electric Corporation Debugging support apparatus and debugging support method
JP6773732B2 (en) * 2018-08-03 2020-10-21 ファナック株式会社 Trace device
JP7046320B2 (en) 2018-08-31 2022-04-04 株式会社安川電機 Industrial equipment control device and industrial equipment data collection system
JP7024678B2 (en) * 2018-09-28 2022-02-24 オムロン株式会社 Control system, support device, support program
JP7024677B2 (en) * 2018-09-28 2022-02-24 オムロン株式会社 Control system, support device, support program
CN112840278B (en) * 2018-10-15 2022-05-10 三菱电机株式会社 Programmable logic controller, external device, method, and program
JP6757385B2 (en) * 2018-10-23 2020-09-16 株式会社キーエンス Programmable logic controller and main unit
JP7412076B2 (en) * 2018-10-23 2024-01-12 株式会社キーエンス Engineering tools for programmable logic controllers
JP6986125B2 (en) * 2018-10-23 2021-12-22 株式会社キーエンス Programmable logic controller and main unit
JP6973427B2 (en) 2019-02-15 2021-11-24 株式会社安川電機 Communication systems, communication methods, and programs
JP6948450B2 (en) * 2020-08-07 2021-10-13 株式会社キーエンス Programmable logic controller and main unit
JP6806946B2 (en) * 2020-08-07 2021-01-06 株式会社キーエンス External setting devices and programs
WO2022168475A1 (en) * 2021-02-04 2022-08-11 オムロン株式会社 Control device
JP7399349B1 (en) * 2022-09-21 2023-12-15 三菱電機株式会社 Setting support device, control system, setting support method and program

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4864566A (en) * 1986-09-26 1989-09-05 Cycomm Corporation Precise multiplexed transmission and reception of analog and digital data through a narrow-band channel
JPH0675001U (en) * 1993-03-26 1994-10-21 株式会社キーエンス Data collection device and production control system
JP4969315B2 (en) * 2007-05-18 2012-07-04 株式会社キーエンス Programmable controller
JP2010198600A (en) * 2009-02-02 2010-09-09 Omron Corp Industrial controller
JP5794449B2 (en) * 2010-03-15 2015-10-14 オムロン株式会社 Programmable controller
EP3101497B1 (en) * 2014-03-14 2020-02-26 Omron Corporation Control system

Also Published As

Publication number Publication date
JP2017079009A (en) 2017-04-27

Similar Documents

Publication Publication Date Title
JP6626315B2 (en) Monitoring device for programmable logic controller and programmable logic controller system
US10591886B2 (en) Control system, control program, and control method for device switching responsive to abnormality detection
US10496079B2 (en) Control device and control method
US9778630B2 (en) Control device and system program for maintaining global variable and reference data consistency during parallel processing of multiple tasks
US20190018385A1 (en) Programmable logic controller, data collector, and programming support apparatus
JP6535459B2 (en) Programmable logic controller, basic unit, control method and program
JP6470955B2 (en) Programmable controller and programmable controller expansion unit
JP2012194680A (en) Control device, control system, tool device, and collection instruction program
US10180674B2 (en) Controller and control system
JP6626313B2 (en) Programmable logic controller, expansion unit, control method, program creation support device, program creation support method, and program
JP7320953B2 (en) Programmable logic controller and its log data storage method
JP2018133037A (en) Control device
JP2017027211A (en) Plant control system
JP2016110460A (en) Programmable controller, method for controlling programmable controller and program
JP2010250435A (en) Plant monitoring control system
JP2014052189A (en) Programmable logic controller, time correction system for the same, and external apparatus for the programmable logic controller
JP6626314B2 (en) Programmable logic controller
US11215974B2 (en) Factory automation (FA) system, controller, and control method
EP3767407A1 (en) Control device, control method, and control program
CN111586087A (en) Communication system, communication method, and program
JP6213400B2 (en) Monitoring device
US11151016B2 (en) Control-program-development supporting apparatus, control-program-development supporting system, control-program-development supporting method, and non-transitory computer-readable storage medium
JP7044086B2 (en) Control systems, control methods, and control programs
JP2009223586A (en) Building block type plc
CN104570826A (en) Method for reproducing the sequence of a program in an automation device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180831

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190628

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190705

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190829

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20191111

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20191129

R150 Certificate of patent or registration of utility model

Ref document number: 6626315

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees