JP2014052671A - Programmable logic controller - Google Patents

Programmable logic controller Download PDF

Info

Publication number
JP2014052671A
JP2014052671A JP2012194555A JP2012194555A JP2014052671A JP 2014052671 A JP2014052671 A JP 2014052671A JP 2012194555 A JP2012194555 A JP 2012194555A JP 2012194555 A JP2012194555 A JP 2012194555A JP 2014052671 A JP2014052671 A JP 2014052671A
Authority
JP
Japan
Prior art keywords
unit
communication data
frame structure
creation support
program creation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012194555A
Other languages
Japanese (ja)
Other versions
JP5959374B2 (en
Inventor
Yusuke Soneta
祐介 曽根田
Masato Fujimura
真人 藤村
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 JP2012194555A priority Critical patent/JP5959374B2/en
Publication of JP2014052671A publication Critical patent/JP2014052671A/en
Application granted granted Critical
Publication of JP5959374B2 publication Critical patent/JP5959374B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To easily recognize communication content between PLCs without interrupting a protocol analyzer in a network for making a connection between the PLCs.SOLUTION: A program creation support device 100 is connected to a PLC 1a instead of connecting a protocol analyzer to a network for connecting the PLC 1a and a PLC 1b, and the program creation support device 100 is operated as the protocol analyzer or a debug device. The program creation support device 100 analyzes, by pattern matching, a frame structure of communication data transmitted and received between the PLC 1a and the PLC 1b, or between the PLC 1a and a device to be controlled, and displays the frame structure. As a result, communication content between the PLC and the PLC and between the PLC and the device to be controlled can easily be recognized without interrupting the protocol analyzer in the network for making a connection between the PLCs.

Description

本発明は、プログラマブルロジックコントローラが送信または受信する通信データのフレーム構造を表示する技術に関する。   The present invention relates to a technique for displaying a frame structure of communication data transmitted or received by a programmable logic controller.

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

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

ところで、PLCは、Modbusネットワークなどの通信回線を介して他の1つ以上のPLCや被制御機器と通信を行うことがある。特許文献1によれば、複数のPLCがネットワークを介して接続されており、そのうちの1つのPLCがプログラミング装置に接続されており、PLCの動作状態をモニタすることでシステムデバッグを行う発明が記載されている。   Incidentally, the PLC may communicate with one or more other PLCs or controlled devices via a communication line such as a Modbus network. Patent Document 1 describes an invention in which a plurality of PLCs are connected via a network, one of which is connected to a programming device, and system debugging is performed by monitoring the operation state of the PLC. Has been.

特開平5−241619号公報JP-A-5-241619

特許文献1の発明では、各PLCの動作状態をプログラミング装置から確認できるようになるが、ネットワークを介して複数のPLC間でどのような情報が送受信されているかまではわからない。たとえば、ネットワーク上で送信されたデータが誤っているためにPLCが誤動作しているケースなどは、従来の方法では原因の特定が困難である。   In the invention of Patent Document 1, the operation state of each PLC can be confirmed from a programming device, but it is not known what information is transmitted / received between a plurality of PLCs via a network. For example, in a case where the PLC malfunctions because the data transmitted on the network is incorrect, it is difficult to identify the cause by the conventional method.

そこで、あるPLCと別のPLCとを接続する通信線にプロトコルアナライザを挿入し、送受信されている生の情報をキャプチャすることが考えられる。しかし、通信線にプロトコルアナライザを挿入するには、プロトコルを中継器として配線する必要があり、ネットワーク構成の変更が必要となってしまう。また、通信線に挿入されたプロトコルアナライザ自体が新たなノイズ源となってしまい、本来のノイズ源を特定することが困難になってしまうこともある。また、PLC用として最も普及しているModbusなどのプロトコルでは、通信されている生の信号をそのまま表示したとしても、オペレータはそれを理解することが容易ではない。さらに、Modbusは、1970年代に開発された古典的なプロトコルであるため、フレームの開始位置を示すようなビットがなく、どこからどこまでがフレームであるのかをオペレータが理解することは極めて困難である。   Therefore, it is conceivable to insert a protocol analyzer into a communication line connecting a certain PLC and another PLC to capture raw information being transmitted and received. However, in order to insert the protocol analyzer into the communication line, it is necessary to wire the protocol as a repeater, and the network configuration must be changed. In addition, the protocol analyzer itself inserted into the communication line becomes a new noise source, and it may be difficult to specify the original noise source. Further, in the protocol such as Modbus that is most popular for PLC, even if the raw signal being communicated is displayed as it is, it is not easy for the operator to understand it. Furthermore, since Modbus is a classic protocol developed in the 1970s, there is no bit indicating the start position of a frame, and it is extremely difficult for an operator to understand from where to where the frame is.

そこで、本発明は、PLC間を接続するネットワークにプロトコルアナライザを割り込ませることなく、かつ、容易にPLC間の通信内容を把握できるようにすることを目的とする。   Therefore, an object of the present invention is to make it possible to easily grasp communication contents between PLCs without interrupting a protocol analyzer in a network connecting PLCs.

本発明は、プログラム作成支援装置であって、複数のプログラマブルロジックコントローラが接続されたネットワークにおいて当該複数のプログラマブルロジックコントローラのうち第1のプログラマブルロジックコントローラと接続されたプログラム作成支援装置であって、前記第1のプログラマブルロジックコントローラが第2のプログラマブルロジックコントローラまたは被制御機器との間で送信または受信した通信データをプログラム作成支援装置に転送するよう当該第1のプログラマブルロジックコントローラに要求するための要求信号を送信する通信データ要求部と、前記要求信号を受信した前記第1のプログラマブルロジックコントローラが送信する前記通信データを受信する通信データ受信部と、前記通信データを記憶する通信データ記憶部と、前記通信データ記憶部に記憶されている前記通信データのフレーム構造をパターンマッチングによって解析する解析部と、前記解析部によって得られた前記フレーム構造にしたがって前記通信データを表示する表示部とを備えることを特徴とする。   The present invention is a program creation support apparatus, which is a program creation support apparatus connected to a first programmable logic controller among the plurality of programmable logic controllers in a network in which a plurality of programmable logic controllers are connected, Request signal for requesting the first programmable logic controller to transfer the communication data transmitted or received by the first programmable logic controller to or from the second programmable logic controller or controlled device to the program creation support device A communication data requesting unit for transmitting the communication data, a communication data receiving unit for receiving the communication data transmitted by the first programmable logic controller that has received the request signal, and storing the communication data A communication data storage unit, an analysis unit for analyzing the frame structure of the communication data stored in the communication data storage unit by pattern matching, and displaying the communication data according to the frame structure obtained by the analysis unit And a display unit.

また、本発明は、ラダープログラムを作成するプログラム作成支援装置と通信する第1の通信部と、他のプログラマブルロジックコントローラまたは被制御機器と通信する第2の通信部と、前記他のプログラマブルロジックコントローラまたは被制御機器との間で送信または受信された通信データを一時的に記憶するバッファ部と、前記第1の通信部を介して前記プログラム作成支援装置から前記バッファ部に記憶されている前記通信データを要求する要求信号を受信すると、前記通信データをコピーして前記プログラム作成支援装置へ送信するよう前記第1の通信部を制御する制御部とを備えることを特徴とするプログラマブルロジックコントローラを提供する。   The present invention also provides a first communication unit that communicates with a program creation support device that creates a ladder program, a second communication unit that communicates with another programmable logic controller or a controlled device, and the other programmable logic controller. Alternatively, a buffer unit that temporarily stores communication data transmitted to or received from the controlled device, and the communication that is stored in the buffer unit from the program creation support device via the first communication unit A programmable logic controller comprising: a control unit that controls the first communication unit to copy and transmit the communication data to the program creation support device when receiving a request signal for requesting data To do.

本発明によれば、PLC間を接続するネットワークにプロトコルアナライザを接続する代わりに、プログラム作成支援装置を1つのプログラマブルロジックコントローラに接続し、プロトコルアナライザまたはデバック装置として動作させる。プログラム作成支援装置は、他のプログラマブルロジックコントローラや被制御機器と監視対象のプログラマブルロジックコントローラとの間で送受信された通信データのフレーム構造をパターンマッチングによって解析して表示する。そのため、PLC間を接続するネットワークにプロトコルアナライザを割り込ませることなく、かつ、容易にPLC間の通信内容を把握できるようになる。   According to the present invention, instead of connecting a protocol analyzer to a network connecting PLCs, a program creation support device is connected to one programmable logic controller and operated as a protocol analyzer or a debugging device. The program creation support device analyzes and displays the frame structure of communication data transmitted / received between another programmable logic controller or controlled device and the monitored programmable logic controller by pattern matching. Therefore, the communication contents between the PLCs can be easily grasped without interrupting the protocol analyzer in the network connecting the PLCs.

プログラマブルロジックコントローラ(PLC)とプログラム作成支援装置の外観を示す図である。It is a figure which shows the external appearance of a programmable logic controller (PLC) and a program creation assistance apparatus. PLCとプログラム作成支援装置についての機能ブロック図である。It is a functional block diagram about PLC and a program creation assistance apparatus. Modbusプロトコルで使用されるフレーム構造の一例を示した図である。It is the figure which showed an example of the frame structure used by the Modbus protocol. 明確な先頭識別子が規定されている通信プロトコルにおけるフレーム構造の先頭を検出する方法を説明する図である。It is a figure explaining the method to detect the head of the frame structure in the communication protocol in which a clear head identifier is prescribed | regulated. 解析部が実行する探索モードについての各ステップを示すフローチャートである。It is a flowchart which shows each step about search mode which an analysis part performs. 解析部が実行するコマンドモードについての各ステップを示すフローチャートである。It is a flowchart which shows each step about the command mode which an analysis part performs. 解析結果を表示するユーザインタフェースの一例を示す図である。It is a figure which shows an example of the user interface which displays an analysis result. 解析結果を表示するユーザインタフェースの一例を示す図である。It is a figure which shows an example of the user interface which displays an analysis result. 解析結果を表示するユーザインタフェースの一例を示す図である。It is a figure which shows an example of the user interface which displays an analysis result. 解析結果を表示するユーザインタフェースの一例を示す図である。It is a figure which shows an example of the user interface which displays an analysis result.

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

図1は、第1のプログラマブルロジックコントローラ(PLC1a)、第2のプログラマブルロジックコントローラ(PLC1b)およびプログラム作成支援装置100を示している。PLC1aとPLC1bはシリアル通信ケーブルなどの通信線2を介して接続され、PLCネットワーク3を構築している。ここでは一例として、PLC1aとPLC1bとがシリアル通信ケーブルで接続されているものと仮定するが、LANケーブルやUSBケーブルなどの通信線、無線LAN、ブルートゥース(登録商標)、IrDAなどの無線インタフェースを介してこれらが接続されていてもよい。通信ケーブルは金属線や光ファイバであってもよい。   FIG. 1 shows a first programmable logic controller (PLC1a), a second programmable logic controller (PLC1b), and a program creation support apparatus 100. The PLC 1 a and the PLC 1 b are connected via a communication line 2 such as a serial communication cable to construct a PLC network 3. Here, as an example, it is assumed that the PLC 1a and the PLC 1b are connected by a serial communication cable, but via a communication line such as a LAN cable or a USB cable, a wireless interface such as a wireless LAN, Bluetooth (registered trademark), or IrDA. These may be connected. The communication cable may be a metal wire or an optical fiber.

プログラム作成支援装置100は、PLC1aに接続してラダープログラムを転送したり、PLC1aの動作を監視して、デバックなどを実行したりする情報処理装置である。プログラム作成支援装置100は、プログラム作成支援機能を備えたプログラムをインストールされたパーソナルコンピュータ(PC)であってもよい。プログラム作成支援装置100とPLC1aも、上述したような有線または無線のいずれで接続されていてもよい。ただし、プログラム作成支援装置100は、PLCネットワーク3には参加していないため、PLCネットワーク3に対して直接的にノイズを与えることはない。PLC1aには、1つのPLC1bが接続されているが、2つ以上の他のPLCが接続されていてもよいし、被制御機器が接続されていてもよい。被制御機器としては、たとえば、リミットスイッチ、センサなどの入力機器や、電磁開閉器、ソレノイド、モータ、アクチュエータ、シリンダ、リレー、位置決めシステムなどの出力機器がある。   The program creation support device 100 is an information processing device that connects to the PLC 1a to transfer a ladder program, monitors the operation of the PLC 1a, and executes debugging. The program creation support apparatus 100 may be a personal computer (PC) in which a program having a program creation support function is installed. The program creation support device 100 and the PLC 1a may also be connected by either wired or wireless as described above. However, since the program creation support apparatus 100 does not participate in the PLC network 3, it does not directly give noise to the PLC network 3. One PLC 1b is connected to the PLC 1a, but two or more other PLCs may be connected, or a controlled device may be connected. Examples of controlled devices include input devices such as limit switches and sensors, and output devices such as electromagnetic switches, solenoids, motors, actuators, cylinders, relays, and positioning systems.

図2は、PLC1aとプログラム作成支援装置100についての機能ブロック図である。プログラム作成支援装置100には、液晶表示装置や自発光型表示装置などの表示部10と、オペレータが各種の指示を入力するための操作部11が設けられている。操作部11には、オペレータの操作を受け付けるためのキーボードやポインティングデバイスが含まれる。   FIG. 2 is a functional block diagram of the PLC 1a and the program creation support apparatus 100. The program creation support apparatus 100 is provided with a display unit 10 such as a liquid crystal display device or a self-luminous display device, and an operation unit 11 for an operator to input various instructions. The operation unit 11 includes a keyboard and a pointing device for receiving operator operations.

制御部5は、CPUやASIC、論理回路、プログラムによって実現されるコントローラである。制御部5は各種の制御機能を有している。命令作成部51は、PLC1aに対する命令を作成するユニットである。たとえば、命令作成部51は、PLC1aがPLC1bとの間で送信または受信した通信データをプログラム作成支援装置100に転送するようPLC1aに要求する通信データ要求部として機能する。このように、命令作成部51は、通信データの取得要求コマンド(リクエスト)を作成して、PLC1aに送信することができる。PC通信部7は、PLC1aのPC通信部21に接続されており、プログラム作成支援装置100とPLC1aとの間でデータやコマンドを送信したり受信したりするために使用される。たとえば、PC通信部7は、PLC1aとPLC1a1bとの間で送受信された通信データである送信バイト列24や受信バイト列25を取得するための取得要求信号をPLC1aに送信する。また、PC通信部7は、取得要求信号を受信したPLC1aが送信する通信データを受信し、受信した通信データを記憶部6に記憶させる通信データ受信部として機能する。記憶部6は、たとえば、RAM、SSD、HDDなどの記憶装置により構成されている。   The control unit 5 is a controller realized by a CPU, an ASIC, a logic circuit, and a program. The control unit 5 has various control functions. The instruction creating unit 51 is a unit that creates an instruction for the PLC 1a. For example, the command creation unit 51 functions as a communication data request unit that requests the PLC 1a to transfer communication data transmitted or received by the PLC 1a to or from the PLC 1b to the program creation support apparatus 100. In this way, the instruction creation unit 51 can create a communication data acquisition request command (request) and transmit it to the PLC 1a. The PC communication unit 7 is connected to the PC communication unit 21 of the PLC 1a, and is used for transmitting and receiving data and commands between the program creation support apparatus 100 and the PLC 1a. For example, the PC communication unit 7 transmits an acquisition request signal for acquiring the transmission byte sequence 24 and the reception byte sequence 25, which are communication data transmitted and received between the PLC 1a and the PLC 1a1b, to the PLC 1a. Further, the PC communication unit 7 functions as a communication data receiving unit that receives communication data transmitted by the PLC 1 a that has received the acquisition request signal and stores the received communication data in the storage unit 6. The storage unit 6 is configured by a storage device such as a RAM, an SSD, and an HDD, for example.

解析部52は、たとえば、記憶部6に記憶されている通信データのフレーム構造をパターンマッチングによって解析する。記憶部6は、パターンマッチングに使用するためのマッチングデータ61や、通信データに含まれているバイト列がどのような意味づけをもった情報なのかを示した解説情報62、解析結果の履歴であるログデータ63などを記憶してもよい。1970年代に策定されたModbusプロトコルは、古典的なプロトコルであるため、フレームの先頭を示す特別な先頭識別子が存在しないプロトコルである。そのため、生の通信データだけではどこからどこまでがフレームであるかを簡単には識別できない。ただし、フレームの先頭に入り得る情報は一定の限られた範囲内の情報である。つまり、論理的にとりうるすべての値のうち一部の値のみがフレームの先頭付近に搭載されている。そこで、フレームの先頭として実際に搭載されうる値をマッチングデータ61として記憶部6に記憶させておき、解析部52がマッチングデータ61と一致する部分を通信データの中に発見したときにフレームの先頭の可能性があると判定してもよい。このように、記憶部6の一部は、フレーム構造の先頭に配置される可能性があるマッチングデータ61を記憶したマッチングデータ記憶部として機能する。また、解析部52は、記憶部6に記憶されているマッチングデータ61と通信データとを比較して、フレーム構造の先頭を特定する先頭特定部として機能する。解説情報62は、フレーム構造を構成している情報要素についての名称や略称などのラベル(意味づけ情報)や、簡潔な説明文章などである。解説情報62は、解析結果をオペレータにとっても理解しやすくするために表示情報作成部53によって利用される。記憶部6の一部は、フレーム構造を構成している複数の情報要素のそれぞれの意味を示す解説情報62を記憶した解説情報記憶部として機能する。   For example, the analysis unit 52 analyzes the frame structure of communication data stored in the storage unit 6 by pattern matching. The storage unit 6 includes matching data 61 to be used for pattern matching, commentary information 62 indicating what meaning the byte sequence included in the communication data has, and a history of analysis results. Some log data 63 and the like may be stored. The Modbus protocol established in the 1970s is a classic protocol, and therefore does not have a special head identifier indicating the head of the frame. Therefore, it is not possible to easily identify from where to where the frame is based only on the raw communication data. However, the information that can enter the head of the frame is information within a certain limited range. That is, only some of the logically possible values are mounted near the beginning of the frame. Therefore, a value that can be actually mounted as the head of the frame is stored in the storage unit 6 as matching data 61, and when the analysis unit 52 finds a portion that matches the matching data 61 in the communication data, It may be determined that there is a possibility. Thus, a part of the storage unit 6 functions as a matching data storage unit that stores the matching data 61 that may be arranged at the head of the frame structure. The analysis unit 52 functions as a head specifying unit that compares the matching data 61 stored in the storage unit 6 with the communication data and specifies the head of the frame structure. The commentary information 62 is a label (meaning information) such as a name or abbreviation for an information element constituting the frame structure, or a brief explanation sentence. The explanation information 62 is used by the display information creation unit 53 to make it easy for the operator to understand the analysis result. A part of the storage unit 6 functions as a comment information storage unit that stores comment information 62 indicating the meaning of each of a plurality of information elements constituting the frame structure.

表示情報作成部53は、解析部52によって得られたフレーム構造にしたがって通信データを表示部10に表示するための表示情報を作成する。たとえば、表示情報作成部53は、解析部52によって取得されたフレーム構造にしたがって、通信データに含まれている情報要素と、記憶部6から読み出した当該情報要素の意味を示す解説情報62とを関連付けて表示するための表示情報を作成してもよい。表示部10は、表示情報作成部53が作成した表示情報にしたがって解析結果を表示する。なお、解析部52がパターンマッチングに失敗すると、表示部10は、通信データを生のデータのまま表示してもよい。また、解析部52が、通信データに含まれている情報要素のエラーを検出したときには、表示部10は、エラーを検出された情報要素を強調表示してもよい。なお、パターンマッチングに失敗するケースは、フレーム構造の先頭が見つからないケース、先頭らしい部分は見つかったもののそれ以降のバイト列が既知のフレーム構造のものとは異なるケースなどがある。フレーム構造を構成する情報要素の数、各情報要素のサイズ、および、各情報要素の中身としてとり得る値(16進数)は既知である。したがって、通信誤りがなく、PLCや被制御機器に誤動作がなければ、フレーム構造を構成する情報要素の中身は既定の範囲内となる。しかし、通信誤りや誤動作などが発生すると、ビットレベルで誤りが発生するため、フレーム構造自体が規定の構造でなくなったり、情報要素の中身が規定外の情報に化けてしまったりすることがある。よって、通信プロトコルによって規定された複数種類のフレーム構造の情報をマッチングデータ61として記憶部6に記憶しておけば、フレーム構造を特定できるだけでなく、どの情報要素に誤りが発生しているかも解析部52は発見できるようになる。   The display information creation unit 53 creates display information for displaying communication data on the display unit 10 according to the frame structure obtained by the analysis unit 52. For example, the display information creation unit 53 includes, in accordance with the frame structure acquired by the analysis unit 52, information elements included in the communication data and commentary information 62 indicating the meaning of the information elements read from the storage unit 6. Display information for displaying in association with each other may be created. The display unit 10 displays the analysis result according to the display information created by the display information creation unit 53. If the analysis unit 52 fails in pattern matching, the display unit 10 may display the communication data as raw data. When the analysis unit 52 detects an error of an information element included in the communication data, the display unit 10 may highlight the information element in which the error is detected. There are cases where the pattern matching fails, such as a case where the head of the frame structure is not found, a case where a portion that seems to be the head is found, but a subsequent byte sequence is different from that of the known frame structure. The number of information elements constituting the frame structure, the size of each information element, and the value (hexadecimal) that can be taken as the contents of each information element are known. Therefore, if there is no communication error and there is no malfunction in the PLC or the controlled device, the contents of the information elements constituting the frame structure are within a predetermined range. However, when a communication error or malfunction occurs, an error occurs at the bit level, so that the frame structure itself may not be a specified structure, or the contents of the information element may be distorted to non-standard information. Therefore, if information on a plurality of types of frame structures defined by the communication protocol is stored in the storage unit 6 as matching data 61, not only the frame structure can be specified but also which information element has an error can be analyzed. Part 52 becomes discoverable.

PLC1aは、プログラム作成支援装置100と接続する第1の通信部として機能するPC通信部21と、PLC1bや被制御機器と接続する第2の通信部として機能するPLC通信部22とを備えている。制御部20は、ラダープログラムを実行して被制御機器を制御したり、PLC1bや被制御機器との通信を制御したりする。PLC通信部22を通過する送信バイト列24や受信バイト列25はバッファ部23に記憶される。バイト列取得部26は、プログラム作成支援装置100から通信データを要求する取得要求信号を受信すると、バッファ部23に一時的に記憶されている送信バイト列24や受信バイト列25をコピーし、PC通信部21を介してプログラム作成支援装置100へ送信する。なお、バッファ部23は、数バイト程度の通信データを一時的に記憶可能な小さなメモリであり、PLC通信部22に内蔵されていてもよい。バッファ部23のサイズが小さいため、プログラム作成支援装置100は、比較的に頻繁に取得要求信号を送信することで、送信バイト列24や受信バイト列25をPLC1aから取得できるようになる。PLC1aから取得した送信バイト列24や受信バイト列25は、通信データ記憶部として機能する記憶部6に記憶され、解析部52によって解析される。   The PLC 1a includes a PC communication unit 21 that functions as a first communication unit connected to the program creation support apparatus 100, and a PLC communication unit 22 that functions as a second communication unit connected to the PLC 1b and the controlled device. . The control unit 20 executes a ladder program to control the controlled device, and controls communication with the PLC 1b and the controlled device. The transmission byte sequence 24 and the reception byte sequence 25 that pass through the PLC communication unit 22 are stored in the buffer unit 23. When receiving an acquisition request signal for requesting communication data from the program creation support apparatus 100, the byte string acquisition unit 26 copies the transmission byte string 24 and the reception byte string 25 temporarily stored in the buffer unit 23, and the PC It transmits to the program creation support apparatus 100 via the communication unit 21. The buffer unit 23 is a small memory that can temporarily store communication data of about several bytes, and may be built in the PLC communication unit 22. Since the size of the buffer unit 23 is small, the program creation support apparatus 100 can acquire the transmission byte sequence 24 and the reception byte sequence 25 from the PLC 1a by transmitting the acquisition request signal relatively frequently. The transmission byte sequence 24 and the reception byte sequence 25 acquired from the PLC 1a are stored in the storage unit 6 that functions as a communication data storage unit, and analyzed by the analysis unit 52.

<パターンマッチングによるフレーム構造の解析>
Modbusなど、一部の通信プロトコルではフレーム構造の先頭を定義する先頭識別子を規定していない。先頭識別子が規定されている通信プロトコルが使用されていれば、その先頭識別子を見つけることで、その先頭識別子からフレームが始まっていることを容易に認識できる。しかし、先頭識別子を規定していない通信プロトコルでは、フレーム構造の先頭を見つけることすら容易ではない。とりわけ、16進数表記の生の通信データを表示部10に表示したとしても通常の技術レベルにあるオペレータにとっては、フレームがどこから始まっているかだけでなく、その通信データが何を意味しているかもまったく理解できないであろう。
<Analysis of frame structure by pattern matching>
Some communication protocols, such as Modbus, do not define a head identifier that defines the head of the frame structure. If a communication protocol in which a head identifier is defined is used, it is possible to easily recognize that a frame starts from the head identifier by finding the head identifier. However, it is not easy to find the head of the frame structure with a communication protocol that does not specify a head identifier. In particular, even if raw communication data in hexadecimal notation is displayed on the display unit 10, not only where the frame starts but also what the communication data means for an operator who is at a normal technical level. You won't understand at all.

図3(A)ないし図3(C)は、Modbusプロトコルで使用されるフレーム構造の一例を示している。図3(A)は、コイルの状態を読み出すために使用されるリクエスト側のフレーム構造と、レスポンス側のフレーム構造を示している。局は、サーバーアドレスなど送信元を示す識別情報である。ファンクションコードは、そのフレーム構造に付与された機能(コマンド種別)を識別するための識別情報である。アドレスは、スターティングアドレスを示している。点数は、コイルの数を示している。CRCは、送信側で算出した誤り検査符号である。サイズは、データ部のサイズを示している。データは、コイルの状態を示す情報が格納されている。図3(B)は、エラー状態の読み出しに使用されるフレーム構造である。ファンクションコードには、エラー状態の読み出しを意味するコードが設定される。データには、エラー状態を示す情報が格納される。図3(C)は、通信路を調査するためのエコーバック用のフレーム構造である。エコーバックによって、通信路を検査するために、リクエストとレスポンスとは同一のフレーム構造をなしている。   3A to 3C show an example of a frame structure used in the Modbus protocol. FIG. 3A shows a frame structure on the request side and a frame structure on the response side used for reading the state of the coil. The station is identification information indicating a transmission source such as a server address. The function code is identification information for identifying a function (command type) given to the frame structure. The address indicates a starting address. The score indicates the number of coils. CRC is an error check code calculated on the transmission side. The size indicates the size of the data part. The data stores information indicating the state of the coil. FIG. 3B shows a frame structure used for reading out an error state. In the function code, a code indicating reading of an error state is set. Information indicating an error state is stored in the data. FIG. 3C shows an echo back frame structure for investigating the communication path. In order to inspect the communication path by echo back, the request and the response have the same frame structure.

図3(A)〜図3(C)を見てわかるように、どのフレーム構造も、局データとファンクションコードが先頭を占めている。もちろん、先頭識別子とは違って、局データとファンクションコードは常に変化するバイト列であるものの、一定の範囲内の値だけが搭載される性質を有している。たとえば、局データが2バイトのデータである場合に、局データは、10進数表記で0〜65535までの値をとり得る。しかし、局データは、実際にはこのすべての値をとることはなく、0〜数十までの範囲となることが多い。ファンクションコードも同様で、論理的にとり得る範囲(例:10進数表記で0〜65535まで)のうち一部の範囲だけをとり得る。よって、解析部52が先頭を見つけるための検索ターゲットを、先頭識別子のように1つには絞れないものの、フレーム構造の先頭としてとり得るいくつかの候補には絞れることになる。そこで、本発明では、フレーム構造の先頭としてとり得るいくつかの候補をマッチングデータ61として記憶部6に記憶しておき、マッチングデータ61との比較によってフレーム構造を特定できるようになる。   As can be seen from FIGS. 3A to 3C, the station data and the function code occupy the top of every frame structure. Of course, unlike the head identifier, although the station data and the function code are always changing byte strings, only the values within a certain range are mounted. For example, when the station data is 2-byte data, the station data can take a value from 0 to 65535 in decimal notation. However, the station data does not actually take all of these values, and often ranges from 0 to several tens. The function code is the same, and only a part of the logically possible range (for example, 0 to 65535 in decimal notation) can be taken. Therefore, the search target for the analysis unit 52 to find the head cannot be narrowed down to one like the head identifier, but can be narrowed down to several candidates that can be taken as the head of the frame structure. Therefore, in the present invention, some candidates that can be taken as the head of the frame structure are stored as matching data 61 in the storage unit 6, and the frame structure can be specified by comparison with the matching data 61.

図4は、明確な先頭識別子が規定されている通信プロトコルにおけるフレーム構造の先頭を検出する方法を説明する図である。この例で、局データ401は、0x01から0x2Aまでの値をとり、ファンクションコード402は0x00から0x6Eまでの値をとる。よって、フレーム構造の先頭となり得る範囲403は、0x01から0x2Aと、0x00から0x6Eとの組み合わせとなる。よって、マッチングデータ61には、この組み合わせのすべてが含まれていればよい。   FIG. 4 is a diagram for explaining a method of detecting the head of the frame structure in the communication protocol in which a clear head identifier is defined. In this example, the station data 401 takes values from 0x01 to 0x2A, and the function code 402 takes values from 0x00 to 0x6E. Therefore, the range 403 that can be the head of the frame structure is a combination of 0x01 to 0x2A and 0x00 to 0x6E. Therefore, the matching data 61 only needs to include all of these combinations.

<探索モード>
本実施形態では、解析部52は、フレーム構造の先頭付近に配置されることになっているコマンド種別に関する情報を探索する探索モードと、コマンドの内容を解析して表示するコマンドモードとを遷移しながら、通信データのフレーム構造を解析する。図4では、マッチングデータの一例として、局データとファンクションコードとの組み合わせについて説明したが、ここではより説明を簡潔化するために、コマンド種別の一例としてファンクションコードを使用する。
<Search mode>
In the present embodiment, the analysis unit 52 transitions between a search mode for searching for information on a command type that is to be arranged near the head of the frame structure, and a command mode for analyzing and displaying the contents of the command. While analyzing the frame structure of the communication data. In FIG. 4, the combination of the station data and the function code has been described as an example of the matching data. Here, in order to simplify the description, a function code is used as an example of the command type.

図5は、解析部52が実行する探索モードについての各ステップを示すフローチャートである。図6は、解析部52が実行するコマンドモードについての各ステップを示すフローチャートである。図7ないし図10は、ユーザインタフェースの一例を示す図である。たとえば、図7に示したユーザインタフェースにおいて操作部11の操作に連動して移動するポインタ701によって開始ボタン702が押し下げられると、解析部52は探索モードを開始する。なお、図7において終了ボタン703がポインタ701によって押し下げられると、解析部52は、解析処理を終了する。保存ボタン704が押されたときは解析結果をログデータとして記憶部6に保存する。印刷ボタン705が押されると、解析結果をプリンタ12によって印刷する。以下で、受信バイト列25を取得するケースについて説明する。   FIG. 5 is a flowchart showing the steps for the search mode executed by the analysis unit 52. FIG. 6 is a flowchart showing each step regarding the command mode executed by the analysis unit 52. 7 to 10 are diagrams illustrating an example of a user interface. For example, when the start button 702 is depressed by the pointer 701 that moves in conjunction with the operation of the operation unit 11 in the user interface shown in FIG. 7, the analysis unit 52 starts the search mode. In FIG. 7, when the end button 703 is pressed by the pointer 701, the analysis unit 52 ends the analysis processing. When the save button 704 is pressed, the analysis result is saved in the storage unit 6 as log data. When the print button 705 is pressed, the analysis result is printed by the printer 12. Hereinafter, a case where the received byte string 25 is acquired will be described.

図5のS501で、命令作成部51は、受信バイト列25をPLC1aから取得するための取得要求コマンドを作成し、PC通信部7を介してPLC1aから1aに送信する。PLC1aのバイト列取得部26は、バッファ部23に記憶されている受信バイト列25をコピーしてPC通信部21を介してプログラム作成支援装置100へ送信する。   In S501 of FIG. 5, the instruction creation unit 51 creates an acquisition request command for acquiring the received byte string 25 from the PLC 1a, and transmits the acquisition request command to the 1a from the PLC 1a via the PC communication unit 7. The byte string acquisition unit 26 of the PLC 1 a copies the received byte string 25 stored in the buffer unit 23 and transmits it to the program creation support apparatus 100 via the PC communication unit 21.

S502で、解析部52は、PC通信部7を介して受信バイト列25を受信し、記憶部6に記憶させる。なお、受信バイト列25だけでなく、送信バイト列24も取得するケースでは、それぞれを区別して記憶部6に記憶させることになる。   In S <b> 502, the analysis unit 52 receives the received byte string 25 via the PC communication unit 7 and stores it in the storage unit 6. In the case where not only the reception byte string 25 but also the transmission byte string 24 is acquired, each is distinguished and stored in the storage unit 6.

S503で、解析部52は、受信バイト列25にバイト終端が含まれているかどうかを判定する。バイト終端はフレーム構造の終わりを示す情報である。たとえば、Modbusプロトコルでは、フレーム構造の終端にはCRCが付与されることが規定されている。よって、解析部52は、CRCと思しきバイト列を見つけると、フレーム構造の終端を発見したと判定してもよい。たとえば、フレーム構造についてCRCを計算し、それがフレーム構造の終端に付与されていたCRCと一致するかどうかを判定することで、フレーム構造の終端を判定してもよい。あるいは、0が所定数以上にわたって連続したときにその部分はすでに有効な部分ではないと判定することで、フレーム構造の終端を判別してもよい。受信バイト列25にバイト終端が含まれていれば、解析部52は、探索モードを終了する。一方で、受信バイト列25にバイト終端が含まれていなければ、S504に進む。   In S503, the analysis unit 52 determines whether the received byte sequence 25 includes a byte end. The byte end is information indicating the end of the frame structure. For example, the Modbus protocol stipulates that CRC is added to the end of the frame structure. Therefore, when the analysis unit 52 finds a byte string that seems to be a CRC, the analysis unit 52 may determine that the end of the frame structure has been found. For example, the end of the frame structure may be determined by calculating a CRC for the frame structure and determining whether it matches the CRC that was attached to the end of the frame structure. Alternatively, the end of the frame structure may be determined by determining that the portion is not already a valid portion when 0 continues for a predetermined number or more. If the received byte sequence 25 includes a byte end, the analysis unit 52 ends the search mode. On the other hand, if the received byte sequence 25 does not include a byte end, the process proceeds to S504.

S504で、解析部52は、バイト列にコマンド種別を示す情報が含まれているかどうかを判定する。ここで、コマンド種別とは、コマンドがどのようなものかを示すものであり、図4を用いて説明したように、ファンクションコード402に相当する。ここでは、コマンド種別として、ファンクションコード402を検出することで、フレーム構造の先頭を検出するものとする。もちろん、局データ401とのファンクションコード402とを組み合わせてフレーム構造の先頭を特定してもよい。コマンド種別を検出したときはコマンドモードへ遷移し、コマンド種別を検出できないときはS505へ進む。   In step S504, the analysis unit 52 determines whether information indicating the command type is included in the byte string. Here, the command type indicates what the command is, and corresponds to the function code 402 as described with reference to FIG. Here, the head of the frame structure is detected by detecting the function code 402 as the command type. Of course, the head of the frame structure may be specified by combining the function data 402 with the station data 401. When the command type is detected, the mode transitions to the command mode, and when the command type cannot be detected, the process proceeds to S505.

S505で、解析部52は、コマンド種別を発見できなかったこと(つまり、解析に失敗したこと)を表示情報作成部53に通知し、表示情報作成部53は、生の通信データのままバイト列を表示部10に表示させるための表示情報を作成する。表示部10は、この表示情報にしたがって生の通信データのままバイト列を表示する。   In step S505, the analysis unit 52 notifies the display information creation unit 53 that the command type could not be found (that is, the analysis failed), and the display information creation unit 53 uses the raw communication data as a byte string. Is displayed on the display unit 10. The display unit 10 displays the byte string as raw communication data according to the display information.

<コマンドモード>
コマンドモードは、通信データを詳細に解析し、詳細なフレーム構造を視覚的にわかりやすく表示するモードである。なお、探索モードからコマンドモードに遷移してきたときは、解析部52は、S604のステップからコマンドモードを開始する。なお、S601ないしS603は、上述したS501ないしS503と同内容の処理であるため、説明を省略する。
<Command mode>
The command mode is a mode in which communication data is analyzed in detail and a detailed frame structure is displayed in a visually easy-to-understand manner. When the search mode is changed to the command mode, the analysis unit 52 starts the command mode from step S604. Note that S601 to S603 are the same processing as S501 to S503 described above, and thus description thereof is omitted.

S604で、解析部52は、通信データをフレーム構造の先頭から解析して、ファンクションコードによって特定されたコマンドのフレーム構造に合致しているかどうかを調査する。なお、Modbusプロトコルでは、40種類のコマンドが存在し、これらのフレーム構造は既知である。また、各コマンドのフレーム構造を構成する情報要素も、局データやファンクションコードと同様に実際にとり得る値は既知である。よって、ファンクションコードによって特定されたコマンドのフレーム構造に含まれる情報要素がとり得る値と、受信したバイト列から得られた値とが一致しなければ、ファンクションコードのビットに誤りがあるか、または、情報要素それ自体に誤りがあるといえる。また、解析部52は、受信したバイト列が、プロトコルによって規定された長さのバイト列に一致しているかどうかを判定してもよい。また、解析部52は、受信したバイト列がCRCなどの誤り検出符号を有しているかどうかを判定してもよい。また、受信したバイト列がプロトコルによって規定されたフォーマット(フレーム構造)を有しているかどうかを判定してもよい。ただし、コイルの状態を示すデータ部分など、フレーム構造を特定するうえで支障のないビットが誤っているときは、解析部52が解析に成功したと判定してもよい。ただし、エラーが発生していることを明示的にオペレータに示すために、誤りのあるバイトを強調表示するように、表示情報を表示情報作成部53に作成させてもよい。このように、解析部52は、通信データに含まれている情報要素のエラーを検出するエラー検出部として機能してもよい。   In step S604, the analysis unit 52 analyzes the communication data from the beginning of the frame structure, and checks whether or not it matches the frame structure of the command specified by the function code. In the Modbus protocol, there are 40 types of commands, and their frame structures are known. Also, the information elements that make up the frame structure of each command have known values that can actually be taken in the same way as station data and function codes. Therefore, if the value that can be taken by the information element included in the frame structure of the command specified by the function code and the value obtained from the received byte sequence do not match, there is an error in the bit of the function code, or It can be said that there is an error in the information element itself. The analysis unit 52 may determine whether the received byte sequence matches a byte sequence having a length defined by the protocol. The analysis unit 52 may determine whether the received byte sequence has an error detection code such as CRC. Further, it may be determined whether or not the received byte sequence has a format (frame structure) defined by the protocol. However, the analysis unit 52 may determine that the analysis has been successful when a bit that does not hinder the frame structure identification, such as a data portion indicating the state of the coil, is incorrect. However, in order to explicitly indicate to the operator that an error has occurred, the display information creation unit 53 may create display information so that the erroneous byte is highlighted. As described above, the analysis unit 52 may function as an error detection unit that detects an error of an information element included in communication data.

S605で、解析部52は通信データ(受信バイト列25)の解析に成功したかどうかを判定する。たとえば、解析部52は受信バイト列25から既知のフレーム構造を復元できたときは解析に成功したと判定し、既知のフレーム構造を復元できないときは解析に失敗したと判定する。解析に失敗したときは、S608に進み、表示部10は、受信バイト列25を生のデータのまま(16進数表記で)表示する。このときの表示情報も表示情報作成部53が作成する。一方で、コマンド解析に成功したときはS606に進む。   In step S605, the analysis unit 52 determines whether the communication data (received byte string 25) has been successfully analyzed. For example, the analysis unit 52 determines that the analysis is successful when the known frame structure can be restored from the received byte sequence 25, and determines that the analysis fails when the known frame structure cannot be restored. If the analysis fails, the process proceeds to S608, and the display unit 10 displays the received byte string 25 as raw data (in hexadecimal notation). The display information creation unit 53 also creates display information at this time. On the other hand, when the command analysis is successful, the process proceeds to S606.

S606で、解析部52は、受信バイト列25からコマンドの終端を検出したかどうかを判定する。コマンドの終端を検出したときは、フレーム構造の最後まで受信バイト列25の解析が終了したことを意味するため、S607に進む。一方で、コマンドの終端を検出していないときは、フレーム構造の最後まで受信バイト列25の解析が終了していないことを意味するため、S601に進み、命令作成部51が再び取得要求コマンドをPLC1aに送信する。このように、S601からS606を繰り返し実行することで、1つのフレーム構造について解析が達成される。   In step S <b> 606, the analysis unit 52 determines whether the end of the command is detected from the received byte sequence 25. When the end of the command is detected, it means that the analysis of the received byte string 25 has been completed up to the end of the frame structure, and thus the process proceeds to S607. On the other hand, when the end of the command has not been detected, it means that the analysis of the received byte string 25 has not been completed until the end of the frame structure, and thus the process proceeds to S601, where the instruction creation unit 51 again issues an acquisition request command. It transmits to PLC1a. As described above, the analysis of one frame structure is achieved by repeatedly executing S601 to S606.

S607で、解析部52は、解析が終了したことを表示情報作成部53に通知し、表示情報作成部53は解析が終了して判明したフレーム構造とその情報要素を表示するための表示情報を作成し、表示部10にフレーム構造を表示する。その後、探索モードに戻り、次のコマンドを探す。   In step S <b> 607, the analysis unit 52 notifies the display information creation unit 53 that the analysis has been completed, and the display information creation unit 53 displays display information for displaying the frame structure and the information elements that are found after the analysis is completed. The frame structure is created and displayed on the display unit 10. Then return to search mode to find the next command.

図7は、受信バイト列25から判明したFIFOキュー読み出しコマンドのレスポンスを表示した例を示している。ユーザインタフェース700には上述した各種の操作ボタンに加え、解析結果が含まれている。   FIG. 7 shows an example in which the response to the FIFO queue read command found from the received byte string 25 is displayed. The user interface 700 includes analysis results in addition to the various operation buttons described above.

ユーザインタフェース700には、何バイト目かを示すバイトスケール711と、受信バイト列から復元されたフレーム構造の階層が何を意味しているかを示す階層情報710と、解析によって得られたコマンドのフレーム構造712が表示されている。このように、フレーム構造を、コマンド名、情報要素(フォーマット)、バイト列の生のデータ(16進数表記)といったように、階層的に表示することで、オペレータは、通信データの意味内容と実際のデータを容易に把握できるようになる。なお、コマンド名や情報要素(フォーマット)は記憶部6にコマンドごとに記憶されている解説情報62から表示情報作成部53が読み出して、表示情報に含めている。   The user interface 700 includes a byte scale 711 indicating the number of bytes, layer information 710 indicating what the layer of the frame structure restored from the received byte sequence means, and a command frame obtained by analysis. A structure 712 is displayed. In this way, by displaying the frame structure in a hierarchical manner such as command names, information elements (format), and raw data of byte strings (hexadecimal notation), the operator can determine the meaning contents of the communication data and the actual contents. It becomes easy to grasp the data. It should be noted that the command information and information elements (format) are read by the display information creation unit 53 from the explanation information 62 stored for each command in the storage unit 6 and included in the display information.

図8は、エラーデータの強調表示801を示している。解析部52は、ファンクションコード(FC)からフレーム構造を特定することで、フレーム構造を構成している複数の情報要素が既知のとり得る範囲内の値になっているかどうかを判定する。なお、コマンドごとのフレーム構造を構成している複数の情報要素のそれぞれがとり得る範囲の値については、各コマンドごとに記憶部6に記憶されているものとする。たとえば、図8によれば、コマンドのデータ部の長さを示すサイズ情報にエラーが発生し、本来のとり得る範囲からは外れた値がサイズ情報として格納されている。よって、解析部52は、サイズ情報が誤っていることを表示情報作成部53に通知する。表示情報作成部53は、解析部52によってエラーが発生していることを指摘されたサイズ情報を強調表示するよう表示情報を作成する。強調表示の方法としては、エラーが発生していない他の情報要素の文字色とは異なる文字色でエラーが発生している情報要素を表示したり、点滅表示したり、背景色を変更したりするなど、種々の方法が考えられる。オペレータがエラーの発生を視覚的に認識できる方法であれば、どのような強調表示手法が採用されてもよい。   FIG. 8 shows an error data emphasis display 801. The analysis unit 52 identifies the frame structure from the function code (FC), thereby determining whether or not a plurality of information elements constituting the frame structure have values within a known possible range. It should be noted that the value of the range that each of the plurality of information elements constituting the frame structure for each command can take is stored in the storage unit 6 for each command. For example, according to FIG. 8, an error occurs in the size information indicating the length of the data portion of the command, and a value outside the range that can be originally taken is stored as the size information. Therefore, the analysis unit 52 notifies the display information creation unit 53 that the size information is incorrect. The display information creation unit 53 creates display information so as to highlight the size information pointed out by the analysis unit 52 that an error has occurred. The highlighting method can be used to display an information element that has an error in a different character color from that of other information elements that do not generate an error, blink, or change the background color. Various methods are conceivable. Any highlighting method may be employed as long as the operator can visually recognize the occurrence of an error.

図9は、解析結果の他の表示例を示している。フレーム構造の全体を一度に表示すると、各情報要素は、表示スペースの関係上、略称などで簡易表示されることもある。簡易表示だけではそれが何を意味するかを理解することは簡単ではない。そこで、表示情報作成部53は、ポインタ701の座標と、各情報要素の表示座標とが一致すると、その情報要素の詳細な解説情報62を記憶部6から読み出して、詳細な解説情報62を含む表示情報を作成してもよい。図9によれば、略称「データ」と表記されている情報要素について詳細な説明901が表示されることを示している。これにより、オペレータは、各情報要素が具体的に何であるかを容易に把握できるようになるだろう。   FIG. 9 shows another display example of the analysis result. When the entire frame structure is displayed at a time, each information element may be simply displayed with an abbreviation or the like because of the display space. It is not easy to understand what it means by simple display alone. Therefore, when the coordinates of the pointer 701 match the display coordinates of each information element, the display information creation unit 53 reads the detailed description information 62 of the information element from the storage unit 6 and includes the detailed description information 62. Display information may be created. FIG. 9 shows that a detailed description 901 is displayed for the information element represented by the abbreviation “data”. This will enable the operator to easily grasp what each information element is specifically.

図10は、オペレータにとって受信データと送信データを比較しやすくするために、送信データ1001と受信データ1002とを1つの画面内に同時に表示している。図10では、エコーバックコマンドについてのリクエストとレスポンスとを示しており、オペレータは両者を比較することで、PLC1aとPLC1bとの間の通信状態が良好なのかどうかを容易に判断できるようになる。   FIG. 10 shows the transmission data 1001 and the reception data 1002 simultaneously on one screen so that the operator can easily compare the reception data and the transmission data. FIG. 10 shows a request and a response regarding the echo back command, and the operator can easily determine whether or not the communication state between the PLC 1a and the PLC 1b is good by comparing the two.

ところで、解析部52は、解析結果をログデータ63として記憶部6に記憶してもよい。操作部11から検索の実行を指示されると、制御部5は操作部11から入力された検索キーワードにしたがって検索を実行し、ヒットしたコマンド(受信バイト列や送信バイト列から復元したフレーム構造)を表示部10に表示させてもよい。この際に、表示情報作成部53は、図7ないし図10に示したユーザインタフェース700を表示するように表示情報を作成してもよい。検索キーワードとしては、たとえば、情報要素の名称(例:サイズ、局、FCなど)だけであってもよいし、実際のデータ(例:00、06、2Aなど)も追加されてもよい。FCはファンクションコードの略称である。   Incidentally, the analysis unit 52 may store the analysis result in the storage unit 6 as the log data 63. When the execution of the search is instructed from the operation unit 11, the control unit 5 executes the search according to the search keyword input from the operation unit 11, and hits the command (frame structure restored from the received byte sequence or the transmitted byte sequence). May be displayed on the display unit 10. At this time, the display information creation unit 53 may create display information so as to display the user interface 700 shown in FIGS. As a search keyword, for example, only the name of an information element (eg, size, station, FC, etc.) may be used, or actual data (eg, 00, 06, 2A, etc.) may be added. FC is an abbreviation for function code.

また、操作部11を通じて印刷ボタン705が操作されると、制御部5は、ユーザインタフェース700に示したフレーム構造と同様の印刷形式にてプリンタ12に印刷を実行させてもよい。   When the print button 705 is operated through the operation unit 11, the control unit 5 may cause the printer 12 to execute printing in the same print format as the frame structure shown in the user interface 700.

以上説明したように、本実施形態によれば、PLC1aとPLC1bとを接続するネットワークにプロトコルアナライザを接続する代わりに、プログラム作成支援装置100をPLC1aに接続し、プロトコルアナライザまたはデバック装置として動作させる。プログラム作成支援装置100は、PLC1aとPLC1bとの間、または、PLC1aと被制御機器との間で送受信された通信データのフレーム構造をパターンマッチングによって解析して表示する。そのため、PLC間を接続するネットワークにプロトコルアナライザを割り込ませることなく、かつ、容易にPLC−PLC間やPLC−被制御機器間の通信内容を把握できるようになる。つまり、PLCネットワーク間にプログラム作成支援装置100を接続してしまうと、PLC間の通信にプログラム作成支援装置100がノイズ源として働く可能性がある。本実施形態であれば、プログラム作成支援装置100は、PLCネットワークから分離されて、PLC1aにだけ接続している。そのため、プログラム作成支援装置100がPLCネットワークに対するノイズ源になりにくくなっている。   As described above, according to the present embodiment, instead of connecting the protocol analyzer to the network connecting the PLC 1a and the PLC 1b, the program creation support device 100 is connected to the PLC 1a and operates as a protocol analyzer or a debugging device. The program creation support apparatus 100 analyzes and displays the frame structure of communication data transmitted / received between the PLC 1a and the PLC 1b or between the PLC 1a and the controlled device by pattern matching. Therefore, it becomes possible to easily grasp the communication contents between the PLC and the PLC and between the PLC and the controlled device without interrupting the protocol analyzer in the network connecting the PLCs. That is, if the program creation support apparatus 100 is connected between PLC networks, the program creation support apparatus 100 may function as a noise source for communication between PLCs. In the present embodiment, the program creation support device 100 is separated from the PLC network and connected only to the PLC 1a. Therefore, the program creation support device 100 is less likely to be a noise source for the PLC network.

本実施形態では、フレーム構造の先頭に配置される可能性があるマッチングデータ61を記憶部6に記憶させておき、解析部52は、マッチングデータ61と通信データとを比較して、フレーム構造の先頭を特定する。よって、フレーム構造の先頭を明示的に示す先頭識別子を規定していない通信プロトコルであっても、解析部52は、フレーム構造の先頭を容易に特定できるようになる。なお、先頭識別子を有する通信プロトコルでは、解析部52は、先頭識別子を検索することで、フレーム構造の先頭を通信データの中から特定できるようになる。   In the present embodiment, matching data 61 that may be placed at the beginning of the frame structure is stored in the storage unit 6, and the analysis unit 52 compares the matching data 61 with the communication data to determine the frame structure. Identify the beginning. Therefore, even if the communication protocol does not specify a head identifier that explicitly indicates the head of the frame structure, the analysis unit 52 can easily specify the head of the frame structure. In the communication protocol having the head identifier, the analysis unit 52 can identify the head of the frame structure from the communication data by searching for the head identifier.

表示部10は、フレーム構造を構成している複数の情報要素のそれぞれの意味を示す解説情報を、通信データに含まれている情報要素とともに表示するため、どの情報要素が何を意味しているのかをオペレータは容易に把握できるようになる。   Since the display unit 10 displays the explanatory information indicating the meaning of each of the plurality of information elements constituting the frame structure together with the information element included in the communication data, which information element means what The operator can easily grasp whether or not.

解析部52がパターンマッチングに失敗(すなわちフレーム構造の解析に失敗)すると、表示部10は、通信データを生のデータのまま表示する。これにより、オペレータは何らかのエラーが発生していることを把握できるようになる。また、習熟したオペレータであれば、生のデータからエラーの原因を理解できることもあるため、生のデータをそのまま表示してもよい。   If the analysis unit 52 fails in pattern matching (that is, failure in analysis of the frame structure), the display unit 10 displays the communication data as raw data. As a result, the operator can grasp that an error has occurred. In addition, since a skilled operator may understand the cause of the error from the raw data, the raw data may be displayed as it is.

また、表示部10は、通信データのうちエラーが検出された情報要素については強調表示801を実行するため、どの情報要素にエラーが発生したかをオペレータが把握しやすくなる。たとえば、被制御機器の動作状態を示す情報要素にエラーが発生しておらず、他の情報要素にエラーが発生したときは、被制御機器は故障しておらず、通信部分に何らかのエラーが発生していることをオペレータは理解できるであろう。   Further, since the display unit 10 executes the highlight display 801 for the information element in which the error is detected in the communication data, the operator can easily grasp which information element has the error. For example, if an error does not occur in the information element indicating the operating status of the controlled device and an error occurs in another information element, the controlled device is not broken and some error occurs in the communication part. The operator will understand what he is doing.

さらに、表示部10は、解析結果を階層構造として表示するため、オペレータは視覚的にコマンドの構成やフレーム構造を把握しやすくなろう。さらに、表示部10は、フレーム構造を構成している複数の情報要素のうちいずれかが操作部11によって指定されると、指定された情報要素の意味を示す説明901を表示してもよい。通常の階層構造にしたがってフレーム構造を表示すると、一部の情報要素を略称で表示するなど、オペレータにとっては情報要素の内容を一目では把握しにくくなることがある。そこで、ポインタ701によって指定された情報要素については、表示部10がその情報要素の詳細な説明901を表示してもよい。また、制御部5は、操作部11を通じてオペレータによって入力されたキーワードにしたがって解析結果を検索する検索部として機能してもよい。この場合、表示部10は、検索によってヒットして解析結果を表示してもよい。たとえば、オペレータは特定の情報要素について検索を実行することで、その情報要素について傾向を把握することが可能となろう。また、プリンタ12は、解析結果を印刷してもよい。これにより複数のオペレータによって解析結果を共有しやすくなり、エラーの原因を早期に発見できるようになろう。   Furthermore, since the display unit 10 displays the analysis result as a hierarchical structure, the operator can easily grasp the command configuration and the frame structure visually. Further, when any one of the plurality of information elements constituting the frame structure is designated by the operation unit 11, the display unit 10 may display an explanation 901 indicating the meaning of the designated information element. When the frame structure is displayed according to the normal hierarchical structure, it may be difficult for the operator to grasp the contents of the information elements at a glance, such as displaying some information elements with abbreviations. Therefore, for the information element designated by the pointer 701, the display unit 10 may display a detailed description 901 of the information element. Further, the control unit 5 may function as a search unit that searches for an analysis result according to a keyword input by the operator through the operation unit 11. In this case, the display unit 10 may display an analysis result by hitting the search. For example, an operator may be able to grasp a tendency for an information element by executing a search for a specific information element. The printer 12 may print the analysis result. This makes it easy to share analysis results among a plurality of operators, so that the cause of the error can be discovered early.

Claims (10)

複数のプログラマブルロジックコントローラが接続されたネットワークにおいて当該複数のプログラマブルロジックコントローラのうち第1のプログラマブルロジックコントローラと接続されたプログラム作成支援装置であって、
前記第1のプログラマブルロジックコントローラが第2のプログラマブルロジックコントローラまたは被制御機器との間で送信または受信した通信データをプログラム作成支援装置に転送するよう当該第1のプログラマブルロジックコントローラに要求するための要求信号を送信する通信データ要求部と、
前記要求信号を受信した前記第1のプログラマブルロジックコントローラが送信する前記通信データを受信する通信データ受信部と、
前記通信データを記憶する通信データ記憶部と、
前記通信データ記憶部に記憶されている前記通信データのフレーム構造をパターンマッチングによって解析する解析部と、
前記解析部によって得られた前記フレーム構造にしたがって前記通信データを表示する表示部と
を備えることを特徴とするプログラム作成支援装置。
A program creation support device connected to a first programmable logic controller among the plurality of programmable logic controllers in a network to which a plurality of programmable logic controllers are connected,
Request for requesting the first programmable logic controller to transfer the communication data transmitted or received by the first programmable logic controller to or from the second programmable logic controller or controlled device to the program creation support device A communication data request unit for transmitting a signal;
A communication data receiving unit that receives the communication data transmitted by the first programmable logic controller that has received the request signal;
A communication data storage unit for storing the communication data;
An analysis unit for analyzing the frame structure of the communication data stored in the communication data storage unit by pattern matching;
A program creation support apparatus comprising: a display unit configured to display the communication data in accordance with the frame structure obtained by the analysis unit.
前記フレーム構造の先頭に配置される可能性があるマッチングデータを記憶したマッチングデータ記憶部をさらに備え、
前記解析部は、前記マッチングデータ記憶部に記憶されているマッチングデータと前記通信データとを比較して、前記フレーム構造の先頭を特定することを特徴とする請求項1に記載のプログラム作成支援装置。
A matching data storage unit that stores matching data that may be arranged at the top of the frame structure;
2. The program creation support apparatus according to claim 1, wherein the analysis unit compares the matching data stored in the matching data storage unit with the communication data to identify a head of the frame structure. 3. .
前記フレーム構造を構成している複数の情報要素のそれぞれの意味を示す解説情報を記憶した解説情報記憶部と、
前記解析部によって取得された前記フレーム構造にしたがって、前記通信データに含まれている情報要素と、前記解説情報記憶部から読み出した当該情報要素の意味を示す解説情報とを関連付けて表示するための表示情報を作成する表示情報作成部と
をさらに備えることを特徴とする請求項1または2に記載のプログラム作成支援装置。
Commentary information storage unit that stores commentary information indicating the meaning of each of a plurality of information elements constituting the frame structure;
In accordance with the frame structure acquired by the analysis unit, the information element included in the communication data and the comment information indicating the meaning of the information element read from the comment information storage unit are displayed in association with each other. The program creation support apparatus according to claim 1, further comprising a display information creation unit that creates display information.
前記解析部が前記パターンマッチングに失敗すると、前記表示部は、前記通信データを生のデータのまま表示することを特徴とする請求項1ないし3のいずれか1項に記載のプログラム作成支援装置。   4. The program creation support apparatus according to claim 1, wherein when the analysis unit fails in the pattern matching, the display unit displays the communication data as raw data. 5. 前記解析部は、前記通信データに含まれている情報要素のエラーを検出するエラー検出部を備え、
前記表示部は、前記エラーを検出された情報要素を強調表示することを特徴とする請求項1ないし4のいずれか1項に記載のプログラム作成支援装置。
The analysis unit includes an error detection unit that detects an error of an information element included in the communication data,
The program creation support apparatus according to claim 1, wherein the display unit highlights an information element in which the error is detected.
前記表示部は、前記通信データの解析結果を階層構造として表示することを特徴とする請求項1ないし5のいずれか1項に記載のプログラム作成支援装置。   6. The program creation support apparatus according to claim 1, wherein the display unit displays the analysis result of the communication data as a hierarchical structure. オペレータの操作を受け付ける操作部をさらに備え、
前記表示部は、前記フレーム構造を構成している複数の情報要素のうちいずれかが前記操作部によって指定されると、指定された情報要素の意味を示す説明を表示することを特徴とする請求項1ないし6のいずれか1項に記載のプログラム作成支援装置。
It further includes an operation unit that receives the operation of the operator
The display unit, when any one of a plurality of information elements constituting the frame structure is designated by the operation unit, displays a description indicating the meaning of the designated information element. Item 7. The program creation support device according to any one of Items 1 to 6.
オペレータによって入力されたキーワードにしたがって解析結果を検索する検索部をさらに備え、
前記表示部は、前記検索部によってヒットして解析結果を表示することを特徴とする請求項1ないし7のいずれか1項に記載のプログラム作成支援装置。
A search unit for searching the analysis result according to the keyword input by the operator;
8. The program creation support apparatus according to claim 1, wherein the display unit is hit by the search unit and displays an analysis result.
前記通信データの解析結果を印刷するプリンタをさらに備えることを特徴とする請求項1ないし8のいずれか1項に記載のプログラム作成支援装置。   9. The program creation support apparatus according to claim 1, further comprising a printer that prints the analysis result of the communication data. ラダープログラムを作成するプログラム作成支援装置と通信する第1の通信部と、
他のプログラマブルロジックコントローラまたは被制御機器と通信する第2の通信部と、
前記他のプログラマブルロジックコントローラまたは被制御機器との間で送信または受信された通信データを一時的に記憶するバッファ部と、
前記第1の通信部を介して前記プログラム作成支援装置から前記バッファ部に記憶されている前記通信データを要求する要求信号を受信すると、前記通信データをコピーして前記プログラム作成支援装置へ送信するよう前記第1の通信部を制御する制御部と
を備えることを特徴とするプログラマブルロジックコントローラ。
A first communication unit that communicates with a program creation support device that creates a ladder program;
A second communication unit that communicates with other programmable logic controllers or controlled devices;
A buffer unit for temporarily storing communication data transmitted or received between the other programmable logic controller or the controlled device;
When a request signal for requesting the communication data stored in the buffer unit is received from the program creation support device via the first communication unit, the communication data is copied and transmitted to the program creation support device. A programmable logic controller comprising: a control unit that controls the first communication unit.
JP2012194555A 2012-09-04 2012-09-04 Program creation support device Expired - Fee Related JP5959374B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012194555A JP5959374B2 (en) 2012-09-04 2012-09-04 Program creation support device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012194555A JP5959374B2 (en) 2012-09-04 2012-09-04 Program creation support device

Publications (2)

Publication Number Publication Date
JP2014052671A true JP2014052671A (en) 2014-03-20
JP5959374B2 JP5959374B2 (en) 2016-08-02

Family

ID=50611144

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012194555A Expired - Fee Related JP5959374B2 (en) 2012-09-04 2012-09-04 Program creation support device

Country Status (1)

Country Link
JP (1) JP5959374B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101662299B1 (en) * 2016-06-17 2016-10-05 주식회사 그린인프라테크 Repeater for power control of PLC
JP2022009933A (en) * 2019-02-28 2022-01-14 株式会社安川電機 Communication system, communication method and program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0697990A (en) * 1992-09-10 1994-04-08 Yokogawa Electric Corp Communication line monitoring device
JPH09319411A (en) * 1996-05-27 1997-12-12 Omron Corp Method and equipment for communication
JPH1139008A (en) * 1997-07-15 1999-02-12 Matsushita Electric Works Ltd Program preparing device for programmable controller
JP2000057109A (en) * 1998-08-11 2000-02-25 Hitachi Ltd Distributed system and its operation managing method
JP2002300226A (en) * 2001-03-30 2002-10-11 Digital Electronics Corp Device and program for preparing communication program and computer readable recording medium with the same recorded thereon

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0697990A (en) * 1992-09-10 1994-04-08 Yokogawa Electric Corp Communication line monitoring device
JPH09319411A (en) * 1996-05-27 1997-12-12 Omron Corp Method and equipment for communication
JPH1139008A (en) * 1997-07-15 1999-02-12 Matsushita Electric Works Ltd Program preparing device for programmable controller
JP2000057109A (en) * 1998-08-11 2000-02-25 Hitachi Ltd Distributed system and its operation managing method
JP2002300226A (en) * 2001-03-30 2002-10-11 Digital Electronics Corp Device and program for preparing communication program and computer readable recording medium with the same recorded thereon

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101662299B1 (en) * 2016-06-17 2016-10-05 주식회사 그린인프라테크 Repeater for power control of PLC
JP2022009933A (en) * 2019-02-28 2022-01-14 株式会社安川電機 Communication system, communication method and program

Also Published As

Publication number Publication date
JP5959374B2 (en) 2016-08-02

Similar Documents

Publication Publication Date Title
US11595468B2 (en) Data capture on a serial device
JP7192243B2 (en) Analysis support device and analysis support method
JP5959374B2 (en) Program creation support device
CN109581965A (en) Running management device
US11314219B2 (en) Information device, terminal device and recording medium
CN110515842B (en) Program debugging method and device, electronic equipment and storage medium
CN111065979A (en) Plant monitoring device and distributed control system
EP3321752A1 (en) Controller, control method for controller, and information processing program
KR101447845B1 (en) Communication device
JP4866377B2 (en) Image processing apparatus and image processing system
US20030233154A1 (en) Method for presenting status to a host in a point-of-sale (POS) printer
JP7409887B2 (en) Data relay equipment and display equipment
US11177828B2 (en) Data collection apparatus, method, and program
CN112987658A (en) Production system, repair system, production method, and information storage medium
JP6493119B2 (en) Image forming system and operation device
US11803376B2 (en) Programming support apparatus for developing a user program to be executed by a programmable logic controller
JP6089837B2 (en) Updating method of control computer in control computer system
JP7224570B1 (en) LOG DATA ANALYSIS SUPPORT SYSTEM, LOG DATA ANALYSIS SUPPORT METHOD, PROGRAM AND SUPPORT DEVICE
JP7267519B1 (en) LOGGING DEVICE, LOG DATA ANALYSIS SUPPORT SYSTEM, INFORMATION PROVIDING METHOD AND PROGRAM
JP7224571B1 (en) Trigger relay unit of programmable controller, trigger transmission system, trigger transmission method and program
JP2011082644A (en) Remote control system, remote control device, and pairing method
JP6901574B2 (en) Electronic manual display device, electronic manual display system, electronic manual display method and electronic manual display program
JP2009176191A (en) Image formation system, image forming apparatus, terminal device, and method and program for specifying image forming apparatus
EP3214540B1 (en) Print output control device and control method therefor
JP2014211736A (en) Operation support system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150311

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20150319

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160316

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160318

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160428

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: 20160603

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160621

R150 Certificate of patent or registration of utility model

Ref document number: 5959374

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees