JP4455393B2 - Programmable logic controller - Google Patents

Programmable logic controller Download PDF

Info

Publication number
JP4455393B2
JP4455393B2 JP2005119868A JP2005119868A JP4455393B2 JP 4455393 B2 JP4455393 B2 JP 4455393B2 JP 2005119868 A JP2005119868 A JP 2005119868A JP 2005119868 A JP2005119868 A JP 2005119868A JP 4455393 B2 JP4455393 B2 JP 4455393B2
Authority
JP
Japan
Prior art keywords
unit
error
identification number
transmission data
transmission
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
JP2005119868A
Other languages
Japanese (ja)
Other versions
JP2006301784A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2005119868A priority Critical patent/JP4455393B2/en
Publication of JP2006301784A publication Critical patent/JP2006301784A/en
Application granted granted Critical
Publication of JP4455393B2 publication Critical patent/JP4455393B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Description

本発明は、シリアルバスで発生したエラーを検出するプログラマブルロジックコントローラに関するものである。   The present invention relates to a programmable logic controller that detects an error occurring in a serial bus.

近年、ホスト側の装置と端末装置をシリアルバスなどで接続し、ホスト側の装置によって遠隔から端末装置を管理するシステムが普及している。このようなシステムにおいては、ホスト側の装置が端末装置の異常やシリアルバスの異常を検出することが望まれる。   In recent years, a system in which a host-side device and a terminal device are connected by a serial bus or the like, and the terminal device is remotely managed by the host-side device has been widely used. In such a system, it is desired that a host-side device detects a terminal device abnormality or a serial bus abnormality.

従来の端末制御方式は、主通信パスに接続されるメイン回路と、メイン回路のメインデータバスに接続され当該端末装置の異常情報を表示する操作パネルと、メイン回路とは独立して動作する監視回路とを有し、監視回路は、メイン回路のメインデータバスに接続され操作パネルに表示される異常情報を取り込んで格納するための異常情報監視レジスタと、異常情報監視レジスタに格納された異常情報を補助通信バスによってホストに伝送するためのシリアルパラレル変換部と、異常情報監視レジスタ及びシリアルパラレル変換部を制御するプロセッサとを有して構成している。(例えば、特許文献1参照)   The conventional terminal control method includes a main circuit connected to the main communication path, an operation panel connected to the main data bus of the main circuit and displaying abnormality information of the terminal device, and a monitoring that operates independently of the main circuit. The monitoring circuit is connected to the main data bus of the main circuit and is connected to the main data bus for detecting and storing abnormality information displayed on the operation panel, and abnormality information stored in the abnormality information monitoring register. Is connected to the host via the auxiliary communication bus, and the processor for controlling the abnormality information monitoring register and the serial / parallel converter is configured. (For example, see Patent Document 1)

特開平4−344962号公報Japanese Patent Laid-Open No. 4-344962

上記従来の技術によれば、端末装置のメイン回路に異常が発生した場合に、ホスト側において端末装置の異常を検出することはできる。しかしながら、主通信バスそのものの異常を検出することはできるが、バス内で発生する伝送エラー検出やエラー解析のための仕組みがなく、バス内で発生するエラー解析に対応できないという問題があった。   According to the above conventional technique, when an abnormality occurs in the main circuit of the terminal device, the abnormality of the terminal device can be detected on the host side. However, although an abnormality of the main communication bus itself can be detected, there is no mechanism for detecting transmission errors and analyzing errors occurring in the bus, and there is a problem that it cannot cope with error analysis occurring in the bus.

また、CPUユニットとインテリジェント機能ユニット間をシリアルバスで接続する場合、シリアルバスで発生する伝送エラーを解析するためには、シリアルバスにデジタルオシロスコープやプロトコルアナライザーのプローブなどを物理的に接続し、伝送エラーの解析作業を行なう必要があった。しかしながら、シリアルバスの転送レートが数Gbpsを越える場合、計測機のプローブなどを接続したことによる容量増加やインピーダンスの不整合によって波形に大きな影響を与える。このため、プローブなどを接続することによってエラーの検出がしにくくなったり、実機で発生しているエラーとは異なるエラーが発生する場合があり、伝送エラーの解析作業が困難で不確実になるという問題があった。   When connecting the CPU module and intelligent function module via a serial bus, in order to analyze transmission errors that occur on the serial bus, a digital oscilloscope or a protocol analyzer probe is physically connected to the serial bus for transmission. It was necessary to perform error analysis work. However, when the transfer rate of the serial bus exceeds several Gbps, the waveform is greatly affected by an increase in capacity and impedance mismatch caused by connecting a probe of a measuring instrument. For this reason, it may be difficult to detect an error by connecting a probe or the like, or an error different from the error occurring in the actual machine may occur, which makes transmission error analysis work difficult and uncertain. There was a problem.

また、プローブなどを接続したことによる容量増加やインピーダンスの不整合によって波形に大きな影響を与えるため、実機において実際に発生しているビット化け(送信データと受信データの相違)の内容やエラーの発生頻度を正確に把握することが困難になるという問題があった。   In addition, since the waveform is greatly affected by the increase in capacity and impedance mismatch caused by connecting a probe, etc., the contents of bit corruption (difference between transmitted data and received data) actually generated in the actual machine and the occurrence of errors There was a problem that it was difficult to accurately grasp the frequency.

本発明は、上記に鑑みてなされたものであって、実機で発生しているシリアルバス上の伝送エラーの内容を、簡易な構成で正確に検出して記録することが可能なプログラマブルロジックコントローラを得ることを目的とする。   The present invention has been made in view of the above, and is a programmable logic controller capable of accurately detecting and recording the content of a transmission error on a serial bus occurring in an actual machine with a simple configuration. The purpose is to obtain.

上述した課題を解決し、目的を達成するために、本発明は、第1のユニットと、前記第1のユニットにシリアルバスおよびパラレルバスで接続された第2のユニットと、を備え、前記第1のユニットと第2のユニットとの間のシリアルバス上のエラーを検出するプログラマブルロジックコントローラにおいて、前記第1のユニットは、前記第2のユニットに送信する第1の送信データを記憶しておく第1の送信データ記憶部と、前記第1の送信データ毎のCRCコードを送信側CRCコードとして生成する第1の送信側CRCコード生成部と、前記第2のユニットに送信する第1の送信データを識別する識別番号を送信側識別番号として生成し当該第1の送信データに付加する第1の識別番号付加部と、前記識別番号付加部が付加した送信側識別番号を前記第1の送信データと対応付けて記憶する第1の送信側識別番号記憶部と、を備え、前記第2のユニットは、前記第1のユニットから受信した第1の送信データのCRCコードを受信側CRCコードとして生成する第1の受信側CRCコード生成部と、前記受信側CRCコードと前記送信側CRCコードを比較して前記第1のユニットと第2のユニットとの間のシリアルバス上のエラーを検出する第1のCRC比較部と、前記第1のCRC比較部によってシリアルバス上のエラーが検出された送信側CRCコードに対応する第1の送信データを格納する第1のエラーデータ格納部と、前記第1のCRC比較部がシリアルバス上のエラーを検出した際に、前記第1のユニットにエラー通知を行う第1のエラー通知部と、前記第1のCRC比較部によってシリアルバス上のエラーが検出された送信側CRCコードに対応する第1の送信データを識別する識別番号をエラー識別番号として格納する第1のエラー識別番号記憶部と、を備え、前記第1のユニットは前記第1の送信データおよび前記送信側CRCコードを前記シリアルバスを介して前記第2のユニットに送信するとともに、前記第2のユニットは前記エラー通知を前記パラレルバスを介して前記第1のユニットに送信し、前記第1のユニットは、前記第2のユニットから前記エラー通知を受けると前記パラレルバスを介して前記第1のエラーデータ格納部が格納する第1の送信データとともに前記第1のエラー識別番号記憶部が格納するエラー識別番号を読み出し、該読み出したエラー識別番号および前記第1の送信側識別番号記憶部が記憶する送信側識別番号に基づいて、前記読み出した第1の送信データと前記読み出した第1の送信データに対応する前記第1の送信データ記憶部内の第1の送信データとを対応付けて記憶することを特徴とする。 In order to solve the above-described problems and achieve the object, the present invention includes a first unit, and a second unit connected to the first unit by a serial bus and a parallel bus . In a programmable logic controller that detects an error on a serial bus between one unit and a second unit, the first unit stores first transmission data to be transmitted to the second unit. A first transmission data storage unit; a first transmission side CRC code generation unit that generates a CRC code for each of the first transmission data as a transmission side CRC code; and a first transmission that is transmitted to the second unit. A first identification number adding unit that generates an identification number for identifying data as a transmission side identification number and adds the identification number to the first transmission data, and a transmission side added by the identification number adding unit And a first transmission-side identification number storage unit that stores in association with different numbers and the first transmission data, the second unit, the first transmission data received from the first unit A first reception side CRC code generation unit that generates a CRC code as a reception side CRC code; and a comparison between the reception side CRC code and the transmission side CRC code between the first unit and the second unit. A first CRC comparison unit that detects an error on the serial bus, and a first transmission data that stores first transmission data corresponding to the transmission-side CRC code in which the error on the serial bus is detected by the first CRC comparison unit an error data storing unit, when the first CRC comparison unit detects an error on a serial bus, a first error notification section for issuing an error notification to the first unit, the first And a first error identification number storing unit for storing the error identification number the identification number identifying the first transmission data corresponding to the sender CRC code error is detected on the serial bus by the RC comparing unit, The first unit transmits the first transmission data and the transmission side CRC code to the second unit via the serial bus, and the second unit sends the error notification via the parallel bus. To the first unit, and when the first unit receives the error notification from the second unit, the first transmission is stored in the first error data storage unit via the parallel bus. The error identification number stored in the first error identification number storage unit together with the data is read, and the read error identification number and the first transmission The first transmission data in the first transmission data storage unit corresponding to the read first transmission data and the read first transmission data based on the transmission side identification number stored in the transmission side identification number storage unit The data is stored in association with each other.

この発明によれば、実機で発生しているシリアルバス上の伝送エラーの内容を簡易な構成で正確に検出して記録することが可能になるという効果を奏する。   According to the present invention, it is possible to accurately detect and record the content of a transmission error on a serial bus occurring in an actual machine with a simple configuration.

以下に、本発明にかかるプログラマブルロジックコントローラの実施の形態を図面に基づいて詳細に説明する。なお、この実施の形態によりこの発明が限定されるものではない。また、本実施の形態では、データの送信側をCPU(Central Processing Unit)ユニット、データの受信側をインテリジェント機能ユニットとして説明するが、データの送信側がインテリジェント機能ユニットで、データの受信側がCPUユニットの場合であっても同様の処理を行なうことが可能である。   Embodiments of a programmable logic controller according to the present invention will be described below in detail with reference to the drawings. Note that the present invention is not limited to the embodiments. In this embodiment, the data transmission side is described as a CPU (Central Processing Unit) unit, and the data reception side is described as an intelligent function unit. However, the data transmission side is an intelligent function unit, and the data reception side is a CPU unit. Even in this case, the same processing can be performed.

実施の形態
図1は、本発明にかかるプログラマブルロジックコントローラのCPUユニットとインテリジェント機能ユニット間のシステム構成を示す図である。図1において、CPUユニット1とインテリジェント機能ユニット100は、シリアルバス200とパラレルバス300を介して相互にデータ通信を行なう。
Embodiment FIG. 1 is a diagram showing a system configuration between a CPU unit and an intelligent function unit of a programmable logic controller according to the present invention. In FIG. 1, the CPU unit 1 and the intelligent function unit 100 perform data communication with each other via a serial bus 200 and a parallel bus 300.

CPUユニット1は、マイクロプロセッサ(以下、MPU10という)、シリアルバス回路60、パラレルバス回路80、シリアルバス用のコネクタ50、パラレルバス用のコネクタ81、エラーフレーム格納メモリ90、デュアルポートメモリ82を備えている。   The CPU unit 1 includes a microprocessor (hereinafter referred to as MPU 10), a serial bus circuit 60, a parallel bus circuit 80, a serial bus connector 50, a parallel bus connector 81, an error frame storage memory 90, and a dual port memory 82. ing.

コネクタ50は、インテリジェント機能ユニット100とシリアルバス200によって接続し、インテリジェント機能ユニット100とデータの通信を行う。コネクタ81は、インテリジェント機能ユニット100とパラレルバス300によって接続し、インテリジェント機能ユニット100とデータの通信を行う。コネクタ81へは、インテリジェント機能ユニット100から出力されたCRCコードエラー割り込みなどが入力される。   The connector 50 is connected to the intelligent function unit 100 via the serial bus 200, and performs data communication with the intelligent function unit 100. The connector 81 is connected to the intelligent function unit 100 via the parallel bus 300, and performs data communication with the intelligent function unit 100. A CRC code error interrupt or the like output from the intelligent function unit 100 is input to the connector 81.

パラレルバス回路80は、シリアルバス200においてエラーが発生した場合に、インテリジェント機能ユニット100に対しエラー割り込み(CRCコードエラー割り込み)を発生させる。   The parallel bus circuit 80 causes the intelligent function unit 100 to generate an error interrupt (CRC code error interrupt) when an error occurs in the serial bus 200.

デュアルポートメモリ82は、MPU10とパラレルバス300の両方から読み出しと書き込みが可能なメモリである。デュアルポートメモリ82は、エラー発生時の基本フレームと、エラー発生直前のフレーム番号を格納する。   The dual port memory 82 is a memory that can be read and written from both the MPU 10 and the parallel bus 300. The dual port memory 82 stores the basic frame at the time of error occurrence and the frame number immediately before the error occurrence.

エラーフレーム格納メモリ90は、MPU10から読み出しと書き込みが可能なメモリである。エラーフレーム格納メモリ90は、エラー発生時の基本フレーム(CPUユニット1が送信した基本フレームとインテリジェント機能ユニット100が受信した基本フレーム)と、エラー発生直前のフレーム番号を格納する。   The error frame storage memory 90 is a memory that can be read and written from the MPU 10. The error frame storage memory 90 stores the basic frame at the time of error occurrence (the basic frame transmitted by the CPU unit 1 and the basic frame received by the intelligent function unit 100) and the frame number immediately before the error occurs.

シリアルバス回路60は、実行ユニット20、送信バッファ30、パラレルシリアル変換回路31,41、符号化回路32、差動送信バッファ(差動ドライバ)33、CRCコード生成回路35,45、受信バッファ40、復号化回路42、差動受信バッファ(差動受信レシーバ)43を備えている。   The serial bus circuit 60 includes an execution unit 20, a transmission buffer 30, parallel-serial conversion circuits 31 and 41, an encoding circuit 32, a differential transmission buffer (differential driver) 33, CRC code generation circuits 35 and 45, a reception buffer 40, A decoding circuit 42 and a differential reception buffer (differential reception receiver) 43 are provided.

実行ユニット20は、CRC(Cyclic Redundancy Check character)コードによってエラー検出を行なうユニットであり、受信バッファ40に格納されたコマンドをデコードするデコード回路21、CRCコード生成回路45が生成したCRCコードと受信バッファ40に格納されたCRCコードを比較するCRC比較回路22、CRCコードの比較対象となっているフレームを格納するフレームレジスタ23、及び、CRCコード比較によって正常な受信が確認されたフレーム番号を格納するフレーム番号レジスタ24を備えている。   The execution unit 20 is a unit that performs error detection using a CRC (Cyclic Redundancy Check character) code. The decoding circuit 21 that decodes the command stored in the reception buffer 40 and the CRC code generated by the CRC code generation circuit 45 and the reception buffer. A CRC comparison circuit 22 that compares the CRC code stored in 40, a frame register 23 that stores a frame to be compared with the CRC code, and a frame number that has been confirmed to be received normally by the CRC code comparison are stored. A frame number register 24 is provided.

送信バッファ30へは、インテリジェント機能ユニット100への基本フレームが実行ユニット20によって書き込まれる。送信バッファ30は、シリアルバス200に送信するデータを蓄積する。送信バッファ30は、FIFO(Fast In Fast Out)機能を有しており、実行ユニット20によって書き込まれた基本フレーム201を、書込みが古い順にパラレルデータとして出力する。   The basic frame for the intelligent function unit 100 is written into the transmission buffer 30 by the execution unit 20. The transmission buffer 30 stores data to be transmitted to the serial bus 200. The transmission buffer 30 has a FIFO (Fast In Fast Out) function, and outputs the basic frame 201 written by the execution unit 20 as parallel data in the order of writing.

パラレルシリアル変換回路31は、送信バッファ30から出力されるパラレルデータをシリアルデータに変換する。CRCコード生成回路35は、パラレルシリアル変換回路31がパラレルデータをシリアルデータに変換する際に、送信側のCRCコード(送信側CRCコード)を生成し基本フレームに付加する。   The parallel / serial conversion circuit 31 converts parallel data output from the transmission buffer 30 into serial data. The CRC code generation circuit 35 generates a transmission-side CRC code (transmission-side CRC code) and adds it to a basic frame when the parallel-serial conversion circuit 31 converts parallel data into serial data.

符号化回路32は、CRCコード生成回路35によってCRCコードが付加されたシリアルデータを符号化(エンコーディング)する。差動送信バッファ33は、符号化回路32によって符号化されたデータを差動式の電気信号に変換する。   The encoding circuit 32 encodes (encodes) the serial data to which the CRC code is added by the CRC code generation circuit 35. The differential transmission buffer 33 converts the data encoded by the encoding circuit 32 into a differential electrical signal.

差動受信バッファ43は、差動式の電気信号をシングルエンドのデータに戻す。復号化回路42は、符号化されたシリアルデータを復号化する。パラレルシリアル変換回路41は、復号化回路42から出力されるシリアルデータをパラレルデータに変換する。CRCコード生成回路45は、パラレルシリアル変換回路41がシリアルデータをパラレルデータに変換する際に、受信側のCRCコード(受信側CRCコード)を生成し基本フレームに付加する。   The differential reception buffer 43 returns the differential electrical signal to single-ended data. The decoding circuit 42 decodes the encoded serial data. The parallel / serial conversion circuit 41 converts the serial data output from the decoding circuit 42 into parallel data. The CRC code generation circuit 45 generates a reception-side CRC code (reception-side CRC code) and adds it to a basic frame when the parallel-serial conversion circuit 41 converts serial data into parallel data.

受信バッファ40は、インテリジェント機能ユニット100から受信したフレーム(後述するCRC付き基本フレーム202)と、CRCコード生成回路45で生成する受信側CRCコードを格納する。受信バッファ40は、FIFO機能を有しており、格納したデータを書込まれた順番が古い順に出力する。リトライバッファ36は、シリアルバス200に再送信するためのデータを蓄積する。   The reception buffer 40 stores a frame received from the intelligent function unit 100 (a CRC-added basic frame 202 described later) and a reception-side CRC code generated by the CRC code generation circuit 45. The reception buffer 40 has a FIFO function, and outputs the stored data in the order in which the data was written. The retry buffer 36 stores data to be retransmitted to the serial bus 200.

MPU10は、CPUユニット1を制御する。MPU10は、シリアルバスとパラレルバスの両方にアクセス可能であり、フレームレジスタ23、フレーム番号レジスタ24、送信バッファ30、リトライバッファ36、受信バッファ40に対し読み出しと書き込みを行なう。ローカルバス15は、MPU10、シリアルバス回路60、パラレルバス回路80、エラーフレーム格納メモリ90を接続する。   The MPU 10 controls the CPU unit 1. The MPU 10 can access both the serial bus and the parallel bus, and performs reading and writing to the frame register 23, the frame number register 24, the transmission buffer 30, the retry buffer 36, and the reception buffer 40. The local bus 15 connects the MPU 10, the serial bus circuit 60, the parallel bus circuit 80, and the error frame storage memory 90.

インテリジェント機能ユニット100は、CPUユニット1と同様の機能を有している。すなわち、インテリジェント機能ユニット100のMPU100がMPU10に対応し、コネクタ150がコネクタ50に対応し、コネクタ181がコネクタ81に対応し、パラレルバス回路180がパラレルバス回路80に対応し、デュアルポートメモリ182がデュアルポートメモリ82に対応し、シリアルバス回路160がシリアルバス回路60に対応し、エラーフレーム格納メモリ190がエラーフレーム格納メモリ90に対応する。   The intelligent function unit 100 has the same function as the CPU unit 1. That is, the MPU 100 of the intelligent function unit 100 corresponds to the MPU 10, the connector 150 corresponds to the connector 50, the connector 181 corresponds to the connector 81, the parallel bus circuit 180 corresponds to the parallel bus circuit 80, and the dual port memory 182 Corresponding to the dual port memory 82, the serial bus circuit 160 corresponds to the serial bus circuit 60, and the error frame storage memory 190 corresponds to the error frame storage memory 90.

また、実行ユニット120が実行ユニット20に対応し、送信バッファ130が送信バッファ30に対応し、パラレルシリアル変換回路131,141がパラレルシリアル変換回路31,41に対応し、符号化回路132が符号化回路32に対応し、差動送信バッファ133が差動送信バッファ33に対応し、CRCコード生成回路135,145がCRCコード生成回路35,45に対応し、受信バッファ140が受信バッファ40に対応し、復号化回路42が復号化回路42に対応し、差動受信バッファ143が差動受信バッファ43に対応する。   The execution unit 120 corresponds to the execution unit 20, the transmission buffer 130 corresponds to the transmission buffer 30, the parallel-serial conversion circuits 131 and 141 correspond to the parallel-serial conversion circuits 31 and 41, and the encoding circuit 132 performs encoding. Corresponding to the circuit 32, the differential transmission buffer 133 corresponds to the differential transmission buffer 33, the CRC code generation circuits 135 and 145 correspond to the CRC code generation circuits 35 and 45, and the reception buffer 140 corresponds to the reception buffer 40. The decoding circuit 42 corresponds to the decoding circuit 42, and the differential reception buffer 143 corresponds to the differential reception buffer 43.

また、デコード回路121がデコード回路21に対応し、CRC比較回路122がCRC比較回路22に対応し、フレームレジスタ123がフレームレジスタ23に対応し、フレーム番号レジスタ124がフレーム番号レジスタ24に対応する。なお、CPUユニット1とインテリジェント機能ユニット100は、シリアルバス200とパラレルバス300の何れを使用してもデータ通信が可能な構成となっている。   The decode circuit 121 corresponds to the decode circuit 21, the CRC comparison circuit 122 corresponds to the CRC comparison circuit 22, the frame register 123 corresponds to the frame register 23, and the frame number register 124 corresponds to the frame number register 24. Note that the CPU unit 1 and the intelligent function unit 100 are configured to allow data communication using either the serial bus 200 or the parallel bus 300.

なお、ここでのCPUユニット1、インテリジェント機能ユニット100が、特許請求の範囲に記載の第1のユニットまたは第2のユニットのいずれか一方に対応する。すなわち、CPUユニット1が第1のユニットに対応する場合はインテリジェント機能ユニット100が第2のユニットに対応し、CPUユニット1が第2のユニットに対応する場合はインテリジェント機能ユニット100が第1のユニットに対応する。   Here, the CPU unit 1 and the intelligent function unit 100 correspond to either the first unit or the second unit described in the claims. That is, when the CPU unit 1 corresponds to the first unit, the intelligent function unit 100 corresponds to the second unit, and when the CPU unit 1 corresponds to the second unit, the intelligent function unit 100 corresponds to the first unit. Corresponding to

CPUユニット1が第1のユニットに対応しインテリジェント機能ユニット100が第2のユニットに対応する場合、リトライバッファ36,136がそれぞれ第1の送信データ記憶部,第2の送信データ記憶部に対応し、CRCコード生成回路35,135がそれぞれ第1の送信側CRCコード生成部、第2の送信側CRCコード生成部に対応する。そして、CRCコード生成回路145,45がそれぞれ第1の受信側CRCコード生成部、第2の受信側CRCコード生成部に対応し、CRC比較回路122,22がそれぞれ第1のCRC比較部,第2のCRC比較部に対応し、デュアルポートメモリ182,82がそれぞれ第1のエラーデータ格納部および第1のエラー識別番号記憶部、第2のエラーデータ格納部および第2のエラー識別番号記憶部に対応し、パラレルバス回路180,80がそれぞれ第1のエラー通知部、第2のエラー通知部に対応する。さらに、フレーム番号レジスタ24,124が第1の識別番号付加部および第1の送信側識別番号記憶部、第2の識別番号付加部および第2の送信側識別番号記憶部に対応する。 When the CPU unit 1 corresponds to the first unit and the intelligent function unit 100 corresponds to the second unit, the retry buffers 36 and 136 correspond to the first transmission data storage unit and the second transmission data storage unit, respectively. , CRC code generation circuits 35 and 135 correspond to a first transmission side CRC code generation unit and a second transmission side CRC code generation unit, respectively. The CRC code generation circuits 145 and 45 correspond to the first reception side CRC code generation unit and the second reception side CRC code generation unit, respectively, and the CRC comparison circuits 122 and 22 respectively correspond to the first CRC comparison unit and the first CRC comparison unit. Corresponding to two CRC comparison units, the dual port memories 182 and 82 have a first error data storage unit, a first error identification number storage unit, a second error data storage unit, and a second error identification number storage unit, respectively. The parallel bus circuits 180 and 80 correspond to the first error notification unit and the second error notification unit, respectively. Further, the frame number registers 24 and 124 correspond to a first identification number adding unit and a first transmission side identification number storage unit, a second identification number addition unit and a second transmission side identification number storage unit.

一方、CPUユニット1が第2のユニットに対応しインテリジェント機能ユニット100が第1のユニットに対応する場合、リトライバッファ36,136がそれぞれ第2の送信データ記憶部,第1の送信データ記憶部に対応し、CRCコード生成回路35,135がそれぞれ第2の送信側CRCコード生成部、第1の送信側CRCコード生成部に対応する。そして、CRCコード生成回路145,45がそれぞれ第2の受信側CRCコード生成部、第1の受信側CRCコード生成部に対応し、CRC比較回路122,22がそれぞれ第2のCRC比較部,第1のCRC比較部に対応し、デュアルポートメモリ182,82がそれぞれ第2のエラーデータ格納部および第2のエラー識別番号記憶部、第1のエラーデータ格納部および第1のエラー識別番号記憶部に対応し、パラレルバス回路180,80がそれぞれ第2のエラー通知部、第1のエラー通知部に対応する。さらに、フレーム番号レジスタ24,124が第2の識別番号付加部および第2の送信側識別番号記憶部、第1の識別番号付加部および第1の送信側識別番号記憶部に対応する。 On the other hand, when the CPU unit 1 corresponds to the second unit and the intelligent function unit 100 corresponds to the first unit, the retry buffers 36 and 136 are respectively stored in the second transmission data storage unit and the first transmission data storage unit. Correspondingly, the CRC code generation circuits 35 and 135 correspond to a second transmission side CRC code generation unit and a first transmission side CRC code generation unit, respectively. The CRC code generation circuits 145 and 45 correspond to the second reception side CRC code generation unit and the first reception side CRC code generation unit, respectively, and the CRC comparison circuits 122 and 22 respectively correspond to the second CRC comparison unit and the first CRC comparison unit. The dual port memories 182 and 82 correspond to one CRC comparison unit, and the second error data storage unit, the second error identification number storage unit, the first error data storage unit, and the first error identification number storage unit, respectively. The parallel bus circuits 180 and 80 correspond to the second error notification unit and the first error notification unit, respectively. Further, the frame number registers 24 and 124 correspond to a second identification number adding unit and a second transmission side identification number storage unit, a first identification number addition unit and a first transmission side identification number storage unit.

ここで、CPUユニット1とインテリジェント機能ユニット100の接続について説明する。図1においては、CPUユニット1とインテリジェント機能ユニット100をシリアルバス200、パラレルバス300によって接続する場合について説明したが、CPUユニット1とインテリジェント機能ユニット100の接続はこの接続に限られるものではない。   Here, the connection between the CPU unit 1 and the intelligent function unit 100 will be described. Although the case where the CPU unit 1 and the intelligent function unit 100 are connected by the serial bus 200 and the parallel bus 300 has been described in FIG. 1, the connection between the CPU unit 1 and the intelligent function unit 100 is not limited to this connection.

図2は、ベース上にシリアルバスとパラレルバスを敷設した場合のシステム構成を示す図であり、図3は、ベース上にパラレルバスを敷設し、CPUユニットとインテリジェント機能ユニットをケーブルで接続した場合のシステム構成を示す図である。   2 is a diagram showing a system configuration when a serial bus and a parallel bus are laid on the base, and FIG. 3 is a case where the parallel bus is laid on the base and the CPU unit and the intelligent function unit are connected with a cable. FIG.

図2および図3に示すように、ベース501,502は、電源ユニット510、CPUユニット1、インテリジェント機能ユニット100、IOユニット520を含んで構成されている。また、ベース501はパラレルバス300とシリアルバス200を備え、ベース502はパラレルバス300とケーブル201(シリアルバス)を備えている。   As shown in FIGS. 2 and 3, the bases 501 and 502 include a power supply unit 510, a CPU unit 1, an intelligent function unit 100, and an IO unit 520. The base 501 includes a parallel bus 300 and a serial bus 200, and the base 502 includes a parallel bus 300 and a cable 201 (serial bus).

図2に示すように、CPUユニット1とインテリジェント機能ユニット100をベース501上のパラレルバス300とシリアルバス200を介して接続してもよいし、図3に示すように、CPUユニット1とインテリジェント機能ユニット100をベース502上のパラレルバス300とケーブル(シリアルバス)201を介して接続してもよい。   As shown in FIG. 2, the CPU unit 1 and the intelligent function unit 100 may be connected via a parallel bus 300 and a serial bus 200 on the base 501. As shown in FIG. The unit 100 may be connected to the parallel bus 300 on the base 502 via a cable (serial bus) 201.

なお、プログラマブルロジックコントローラが1つのCPUユニット1と1つのインテリジェント機能ユニット100を備える場合に限られず、図2,3に示すようにプログラマブルロジックコントローラが複数のCPUユニット1を備える構成としてもよい。   The programmable logic controller is not limited to the case where the programmable logic controller includes one CPU unit 1 and one intelligent function unit 100, and the programmable logic controller may include a plurality of CPU units 1 as illustrated in FIGS.

次に、CPUユニット1とインテリジェント機能ユニット100の動作処理手順について説明する。まず、通常動作時(エラー不発生時)の動作について説明する。CPUユニット1内のMPU10は、シリアルバス200に接続されたインテリジェント機能ユニット100の内部のリソースにアクセスし、インテリジェント機能ユニット100が備えるメモリマップ上のシリアルバス領域のエリアを読み書きする。   Next, an operation processing procedure of the CPU unit 1 and the intelligent function unit 100 will be described. First, the operation during normal operation (when no error occurs) will be described. The MPU 10 in the CPU unit 1 accesses the internal resources of the intelligent function unit 100 connected to the serial bus 200 and reads / writes the area of the serial bus area on the memory map provided in the intelligent function unit 100.

図4は、メモリマップの構成の一例を示す図である。同図に示すように、メモリマップ400において、所定の領域にシリアルバス領域401が配置されている。MPU10は、このシリアルバス領域401内のデータを読み書き(リード/ライト)する。例えば、MPU10がシリアルバス領域401をリードする場合の動作について説明する。   FIG. 4 is a diagram illustrating an example of the configuration of the memory map. As shown in the figure, a serial bus area 401 is arranged in a predetermined area in the memory map 400. The MPU 10 reads and writes (reads / writes) data in the serial bus area 401. For example, an operation when the MPU 10 reads the serial bus area 401 will be described.

実行ユニット20は、MPU10がローカルバス15にストローブしたコマンド(リードコマンド)、アドレスの情報(インテリジェント機能ユニット100内のメモリなどのアドレス)に、実行ユニット20で生成したフレーム番号を付加し、所定のデータとともに送信バッファ30とリトライバッファ36に書き込みを行う。ここでの実行ユニット20は、フレーム番号レジスタ24に基づいてフレーム番号を生成する。すなわち、実行ユニット20が生成するフレーム番号は、その前(直前)にフレーム番号レジスタ24が生成したフレーム番号に1を加えた番号をフレーム番号として生成し書き込みを行なう。このフレーム番号、コマンド、アドレス、データからなるデータが基本フレーム(後述する基本フレーム201)となる。   The execution unit 20 adds the frame number generated by the execution unit 20 to the command (read command) and address information (address of memory in the intelligent function unit 100) strobeted by the MPU 10 to the local bus 15, The data is written to the transmission buffer 30 and the retry buffer 36 together with the data. The execution unit 20 here generates a frame number based on the frame number register 24. That is, the frame number generated by the execution unit 20 is generated by writing a frame number obtained by adding 1 to the frame number generated by the frame number register 24 before (immediately before). Data including the frame number, command, address, and data is a basic frame (a basic frame 201 described later).

送信バッファ30は、実行ユニット20によって書き込まれた基本フレーム201を、書込みが古い順にパラレルデータとして出力する。送信バッファ30から出力されたパラレルデータは、パラレルシリアル変換回路31によってシリアルデータに変換される。その際、CRCコード生成回路135が基本フレーム201から送信側CRCコードを生成し、基本フレーム201の例えば一番後ろに付加する。この、基本フレーム201に送信側CRCコードを付加したフレームがCRC付き基本フレーム202となる。   The transmission buffer 30 outputs the basic frame 201 written by the execution unit 20 as parallel data in the order of writing. The parallel data output from the transmission buffer 30 is converted into serial data by the parallel-serial conversion circuit 31. At that time, the CRC code generation circuit 135 generates a transmission-side CRC code from the basic frame 201 and adds it to the rear of the basic frame 201, for example. The frame obtained by adding the transmission side CRC code to the basic frame 201 becomes the basic frame 202 with CRC.

ここで、基本フレーム201、CRC付き基本フレーム202のデータ構成を説明する。図5は、基本フレームおよびCRC付き基本フレーム202の構成を示す図である。基本フレーム201は、フレーム番号レジスタ24に基づいて生成されたフレーム番号、MPU10がローカルバス15にストローブしたコマンド、インテリジェント機能ユニット100内のアドレス、インテリジェント機能ユニット100に送るデータを含んで構成されている。また、CRC付き基本フレーム202は、基本フレーム201と送信側CRCコードを含んで構成されている。   Here, the data structure of the basic frame 201 and the basic frame 202 with CRC will be described. FIG. 5 is a diagram showing the configuration of the basic frame and the basic frame 202 with CRC. The basic frame 201 includes a frame number generated based on the frame number register 24, a command that the MPU 10 strobes to the local bus 15, an address in the intelligent function unit 100, and data to be sent to the intelligent function unit 100. . The CRC-added basic frame 202 includes the basic frame 201 and a transmission side CRC code.

CRC付き基本フレーム202は、「1」や「0」が決められた所定の回数以上に連続しないよう、符号化回路32によってエンコーディングされ、差動送信バッファ33から出力される。差動送信バッファ33から出力されたCRC付き基本フレーム202は、コネクタ50、シリアルバス200を介してインテリジェント機能ユニット100に送られる。   The CRC-added basic frame 202 is encoded by the encoding circuit 32 and output from the differential transmission buffer 33 so that “1” and “0” do not continue for a predetermined number of times or more. The CRC-added basic frame 202 output from the differential transmission buffer 33 is sent to the intelligent function unit 100 via the connector 50 and the serial bus 200.

CPUユニット1からのCRC付き基本フレーム202は、インテリジェント機能ユニット100のコネクタ150を介して差動受信バッファ143に入力される。このCRC付き基本フレーム202は、復号化回路142とシリアルパラレル変換回路141によってパラレルデータに戻される。その際に、CRCコード生成回路145が改めて基本フレーム201からCRCコード(受信側CRCコード)を生成する。   The basic frame 202 with CRC from the CPU unit 1 is input to the differential reception buffer 143 via the connector 150 of the intelligent function unit 100. The CRC-added basic frame 202 is returned to parallel data by the decoding circuit 142 and the serial / parallel conversion circuit 141. At that time, the CRC code generation circuit 145 newly generates a CRC code (reception side CRC code) from the basic frame 201.

受信バッファ140には、CRC付き基本フレーム202と受信側CRCコードが格納される。受信バッファ140はFIFOメモリになっているので、格納したデータ(CRC付き基本フレーム202と受信側CRCコード)を古い順にパラレルデータとして出力する。   The reception buffer 140 stores the CRC-added basic frame 202 and the reception side CRC code. Since the reception buffer 140 is a FIFO memory, the stored data (the CRC-added basic frame 202 and the reception side CRC code) is output as parallel data in the oldest order.

受信バッファ140から出力されたCRC付き基本フレーム202内の送信側CRCコードと、CRCコード生成回路145が生成した受信側CRCコードは、実行ユニット120のCRC比較回路122で比較される。   The transmission side CRC code in the CRC-added basic frame 202 output from the reception buffer 140 and the reception side CRC code generated by the CRC code generation circuit 145 are compared by the CRC comparison circuit 122 of the execution unit 120.

CRC比較回路122において、送信側CRCコードと受信側CRCコードが同一である(相違なし)と判断されると、CPUユニット1からのデータを正常に受信できたものと判断し、基本フレーム201内のフレーム番号をフレーム番号レジスタ124に書き込む。   When the CRC comparison circuit 122 determines that the transmission side CRC code and the reception side CRC code are the same (no difference), it is determined that the data from the CPU unit 1 has been normally received, and the basic frame 201 Are written into the frame number register 124.

さらに、CRC付き基本フレーム202がデコード回路121でデコードされ、CRC付き基本フレーム202内のコマンドに従った処理が実行される。例えば、コマンドがメモリリードコマンドであれば、CRC付き基本フレーム202内のアドレス(シリアルバス領域401のアドレス)のメモリ(図示せず)をリードし、読み出したデータを送信バッファ130に書き込む。送信バッファ130に書き込む際のフレーム番号は、CPUユニット1から要求のあったフレーム(基本フレーム201内のフレーム番号)と同じフレーム番号を使用する。   Further, the CRC-added basic frame 202 is decoded by the decoding circuit 121, and processing according to the command in the CRC-added basic frame 202 is executed. For example, if the command is a memory read command, the memory (not shown) at the address (address of the serial bus area 401) in the basic frame 202 with CRC is read, and the read data is written in the transmission buffer 130. As the frame number for writing to the transmission buffer 130, the same frame number as the frame requested by the CPU unit 1 (the frame number in the basic frame 201) is used.

実行ユニット120は、メモリから読み出したデータ、CPUユニット1内のアドレスなどに、フレーム番号を付加し、送信バッファ130に書き込み(インテリジェント機能ユニット100側の基本フレーム201の書込み)を行う。   The execution unit 120 adds a frame number to the data read from the memory, the address in the CPU unit 1 and the like, and writes it in the transmission buffer 130 (writing of the basic frame 201 on the intelligent function unit 100 side).

送信バッファ130は、インテリジェント機能ユニット100側の基本フレーム201を書込みが古い順にパラレルデータとして出力する。送信バッファ130から出力されたパラレルデータは、パラレルシリアル変換回路131によってシリアルデータに変換される。その際、CRCコード生成回路135がインテリジェント機能ユニット100側の基本フレーム201から送信側CRCコードを生成し、インテリジェント機能ユニット100側の基本フレーム201の例えば一番後ろに付加する。送信側CRCコードが付加されたインテリジェント機能ユニット100側の基本フレーム201が応答用のCRC付き基本フレーム202となる。   The transmission buffer 130 outputs the basic frame 201 on the intelligent function unit 100 side as parallel data in the order of writing. The parallel data output from the transmission buffer 130 is converted into serial data by the parallel-serial conversion circuit 131. At this time, the CRC code generation circuit 135 generates a transmission-side CRC code from the basic frame 201 on the intelligent functional unit 100 side, and adds it to, for example, the back of the basic frame 201 on the intelligent functional unit 100 side. The basic frame 201 on the intelligent functional unit 100 side to which the transmission-side CRC code is added becomes a basic frame 202 with a CRC for response.

応答用のCRC付き基本フレーム202は、符号化回路132によってエンコーディングされ、差動送信バッファ133から出力される。差動送信バッファ133から出力された応答用のCRC付き基本フレーム202は、CPUユニット1の差動受信バッファ43に入力される。この応答用のCRC付き基本フレーム202は、要求用のCRC付き基本フレーム(CPUユニット1からインテリジェント機能ユニット100へのCRC付き基本フレーム202)と同様に、復号化回路42とシリアルパラレル変換回路41によってパラレルデータに戻される。その際に、CRCコード生成回路45が改めてインテリジェント機能ユニット100側の基本フレーム201からCRCコード(受信側CRCコード)を生成する。   The basic frame 202 with CRC for response is encoded by the encoding circuit 132 and output from the differential transmission buffer 133. The basic frame 202 with CRC for response output from the differential transmission buffer 133 is input to the differential reception buffer 43 of the CPU unit 1. Similar to the basic frame with CRC for request (the basic frame with CRC 202 from the CPU unit 1 to the intelligent function unit 100), the basic frame 202 with CRC for response is sent by the decoding circuit 42 and the serial / parallel conversion circuit 41. Return to parallel data. At that time, the CRC code generation circuit 45 newly generates a CRC code (reception side CRC code) from the basic frame 201 on the intelligent functional unit 100 side.

受信バッファ40には、インテリジェント機能ユニット100側のCRC付き基本フレーム202と受信側CRCコードが格納される。受信バッファ40はFIFOメモリになっているので、格納したデータ(インテリジェント機能ユニット100側のCRC付き基本フレーム202と受信側CRCコード)を古い順にパラレルデータとして出力する。   The reception buffer 40 stores the CRC-added basic frame 202 and the reception-side CRC code on the intelligent function unit 100 side. Since the reception buffer 40 is a FIFO memory, the stored data (the CRC-added basic frame 202 and the reception side CRC code on the intelligent function unit 100 side) are output as parallel data in the oldest order.

実行ユニット20は、受信バッファ40から出力される応答用のCRC付き基本フレーム202内の送信側CRCコードと、受信側CRCコードを比較回路22で比較する。CRC比較回路22において、送信側CRCコードと受信側CRCコードが同一であると判断されると、インテリジェント機能ユニット100からのデータを正常に受信できたものと判断する。実行ユニット20は、リトライバッファ36に格納されている同一フレーム番号(正常に受信できたフレーム番号と同一のフレーム番号)の基本フレームデータを削除(無効化)するとともに、応答用のCRC付き基本フレーム202内のデータをMPU10に通知する。そして、MPU10が応答用のCRC付き基本フレーム202内のデータに基づいた処理を行なう。   The execution unit 20 compares the transmission side CRC code in the basic frame 202 with a response CRC output from the reception buffer 40 with the reception side CRC code by the comparison circuit 22. When the CRC comparison circuit 22 determines that the transmission side CRC code and the reception side CRC code are the same, it is determined that the data from the intelligent function unit 100 has been normally received. The execution unit 20 deletes (invalidates) the basic frame data of the same frame number (the same frame number as the frame number that has been successfully received) stored in the retry buffer 36, and responds with a basic frame with a CRC. The MPU 10 is notified of the data in 202. Then, the MPU 10 performs processing based on the data in the CRC-attached basic frame 202 for response.

次に、エラー発生時の動作について説明する。なお、通常動作時と同様の処理を行なう動作については説明を省略する。ここでは、インテリジェント機能ユニット100がエラーを検出した場合について説明するが、CPUユニット1がエラーを検出した場合も同様の動作を行なう。   Next, the operation when an error occurs will be described. The description of the operation for performing the same processing as that in the normal operation is omitted. Although the case where the intelligent function unit 100 detects an error will be described here, the same operation is performed when the CPU unit 1 detects an error.

CPUユニット1の差動送信バッファ33から出力されたCRC付き基本フレーム内の送信側CRCコードと受信側CRCコードは、通常動作時と同様に、インテリジェント機能ユニット100の実行ユニット120のCRC比較回路122で比較される。   The transmission side CRC code and the reception side CRC code in the basic frame with CRC output from the differential transmission buffer 33 of the CPU unit 1 are the CRC comparison circuit 122 of the execution unit 120 of the intelligent function unit 100 as in the normal operation. Compared.

CRC比較回路122において、送信側CRCコードと受信側CRCコードが同一でない(相違あり)と判断されると、CPUユニット1からのデータを正常に受信できなかったもの(エラー)と判断し、実行ユニット120はMPU110に対してCRCコードエラー割り込みによってエラーを通知する。   If the CRC comparison circuit 122 determines that the transmission side CRC code and the reception side CRC code are not the same (there is a difference), it is determined that the data from the CPU unit 1 could not be received normally (error) and executed. The unit 120 notifies the MPU 110 of an error by a CRC code error interrupt.

エラーの検出されたフレーム(CRC付き基本フレーム202)は、フレームレジスタ123に格納される。また、フレーム番号レジスタ124には、エラー検出前の正常に受信したフレームのフレーム番号(以下、直前正常フレーム番号という)が格納されている。   The frame in which the error is detected (the CRC-added basic frame 202) is stored in the frame register 123. Further, the frame number register 124 stores the frame number of a normally received frame before error detection (hereinafter referred to as a previous normal frame number).

インテリジェント機能ユニット100のMPU110は、実行ユニット120からの割り込みによってCRCコードエラーの通知を受けると、フレームレジスタ123に格納されているエラー発生時の基本フレーム201と、フレーム番号レジスタ124に格納されている直前正常フレーム番号を、デュアルポートメモリ182に格納させる。   When the MPU 110 of the intelligent function unit 100 is notified of the CRC code error by an interrupt from the execution unit 120, the MPU 110 stored in the frame register 123 is stored in the basic frame 201 and the frame number register 124 stored in the frame register 123. The previous normal frame number is stored in the dual port memory 182.

更に、デュアルポートメモリ182へ基本フレーム201、直前正常フレーム番号を格納した後に、パラレルバス回路180を使用して、CPUユニット1に対しCRCコードエラー割り込みを発生させる。このCRCコードエラー割り込みは、コネクタ181を介して出力される。出力されたCRCコードエラー割り込みは、パラレルバス300を介してCPUユニット1に送られコネクタ81から入力される。   Further, after storing the basic frame 201 and the immediately preceding normal frame number in the dual port memory 182, a CRC code error interrupt is generated for the CPU unit 1 using the parallel bus circuit 180. This CRC code error interrupt is output via the connector 181. The output CRC code error interrupt is sent to the CPU unit 1 via the parallel bus 300 and input from the connector 81.

インテリジェント機能ユニット100からCRCコードエラー割り込みの通知を受けたCPUユニット1のMPU10は、パラレルバス回路80を使用して、エラー発生時の基本フレーム201と直前正常フレーム番号を、デュアルポートメモリ182から読み出し、エラーフレーム格納メモリ90に書き込む。   Receiving the CRC code error interrupt notification from the intelligent function unit 100, the MPU 10 of the CPU unit 1 uses the parallel bus circuit 80 to read out the basic frame 201 and the previous normal frame number at the time of error from the dual port memory 182. The error frame storage memory 90 is written.

また、リトライバッファ36から、エラー発生時の一つ前に受け付けたフレーム番号(直前正常フレーム)に1を足したフレーム番号(エラー発生時のフレーム番号)に対応する基本フレーム201(インテリジェント機能ユニット100においてエラーと判断された基本フレーム201)を読み出し、エラーフレーム格納メモリ90に格納する。これにより、元々送信した基本フレーム201(CPUユニット1が送信した基本フレーム201)とCRCエラーとなった基本フレーム201(インテリジェント機能ユニット100が受信した基本フレーム201)がそれぞれ対応付けされてエラーフレーム格納メモリ90に格納される。   Further, the basic frame 201 (intelligent function unit 100) corresponding to the frame number (frame number at the time of error occurrence) obtained by adding 1 to the frame number (the previous normal frame) received immediately before the error occurrence from the retry buffer 36. The basic frame 201) determined to be an error is read out and stored in the error frame storage memory 90. As a result, the basic frame 201 originally transmitted (the basic frame 201 transmitted by the CPU unit 1) and the basic frame 201 having the CRC error (the basic frame 201 received by the intelligent function unit 100) are associated with each other and stored in the error frame. Stored in the memory 90.

このような、送信した基本フレーム201とCRCエラーとなった基本フレーム201をそれぞれエラーフレーム格納メモリ90に格納する処理を繰り返し実施することによって、エラーフレーム格納メモリ90には、CRCエラーが発生した基本フレーム201が複数格納される。   By repeatedly performing the process of storing the transmitted basic frame 201 and the basic frame 201 in which a CRC error has occurred in the error frame storage memory 90, the error frame storage memory 90 has the basic in which the CRC error has occurred. A plurality of frames 201 are stored.

図6は、エラーフレーム格納メモリの構成を示す図である。図6に示すように、エラーフレーム格納メモリ90には、送信時基本フレームと受信時基本フレームが対応付けられて格納されている。ここでの送信時基本フレームがCPUユニット1から送信した基本フレーム201を示し、受信時基本フレームがインテリジェント機能ユニット100がCPUユニット1から受信した基本フレーム201に対応する。   FIG. 6 is a diagram showing the configuration of the error frame storage memory. As shown in FIG. 6, the error frame storage memory 90 stores a transmission basic frame and a reception basic frame in association with each other. Here, the basic frame at transmission indicates the basic frame 201 transmitted from the CPU unit 1, and the basic frame at reception corresponds to the basic frame 201 received by the intelligent function unit 100 from the CPU unit 1.

このエラーフレーム格納メモリ90内のデータ(送信時基本フレーム、受信時基本フレーム)を解析することによって、CRCコードだけでは判別できない情報(どのビットがどのようにビット化けしているかに関する情報など)を正確に取得することが可能となる。   By analyzing the data (basic frame at the time of transmission, basic frame at the time of reception) in the error frame storage memory 90, information (such as information about which bits are garbled and how) that cannot be determined only by the CRC code. It becomes possible to acquire accurately.

また、エラー発生時のフレーム番号を調査することによって、どの程度の頻度でエラーが発生しているかを正確に知ることが可能となる。これにより、実機(CPUユニット1、インテリジェント機能ユニット100)において、どういったシリアルデータのビット列を送信した場合に、何れのビットがビット化けをするかなどのビットエラーが発生する傾向を把握することが可能となる。   Further, by examining the frame number at the time of error occurrence, it is possible to accurately know how often the error has occurred. As a result, in a real machine (CPU unit 1, intelligent function unit 100), when a bit string of serial data is transmitted, the tendency of bit errors such as which bits are garbled is grasped. Is possible.

また、シリアルバス200による伝送レートを上げることによって、伝送レートとエラーレートの関係が分かるため、伝送レートの限界を把握することが可能となる。同様に、シリアルバス200の伝送距離を長くすることによって、伝送距離とエラーレートの関係が分かるため、伝送距離の限界を把握することが可能となる。   Further, since the relationship between the transmission rate and the error rate can be understood by increasing the transmission rate using the serial bus 200, the limit of the transmission rate can be grasped. Similarly, by increasing the transmission distance of the serial bus 200, the relationship between the transmission distance and the error rate can be understood, so that the limit of the transmission distance can be grasped.

なお、本実施の形態においては、インテリジェント機能ユニット100のMPU110が、実行ユニット120からの割り込みによってCRCコードエラーの通知を受けた際に、フレーム番号レジスタ124に格納されている直前正常フレーム番号をデュアルポートメモリ182に格納させることとしたが、エラーの発生したCRC付き基本フレーム202を識別することが可能な情報であればデュアルポートメモリ182に格納させる情報は直前正常フレーム番号に限られない。   In the present embodiment, when the MPU 110 of the intelligent function unit 100 receives a CRC code error notification from the execution unit 120, the previous normal frame number stored in the frame number register 124 is set to dual. Although the information is stored in the port memory 182, the information stored in the dual port memory 182 is not limited to the immediately preceding normal frame number as long as the information can identify the CRC-added basic frame 202 with the error.

また、本実施の形態においては、CPUユニット1とインテリジェント機能ユニット100が同様の構成を有する場合について説明したが、一方のユニットがシリアルバス200を介してCRC付き基本フレーム202を送信し、他方のユニットがCRC付き基本フレーム202のエラーを検出し、前記一方のユニットがエラーの検出された基本フレーム201を記憶しておく構成としてもよい。   In this embodiment, the case where the CPU unit 1 and the intelligent function unit 100 have the same configuration has been described. However, one unit transmits the basic frame 202 with CRC via the serial bus 200, and the other unit The unit may detect an error in the CRC-added basic frame 202, and the one unit may store the basic frame 201 in which the error is detected.

このように実施の形態によれば、実機におけるエラーレートを正確かつ定量的に把握できるため、基板(ベース501,502)のパターン配線の調整、ケーブルやコネクタなどの通信経路を含めた回路の調整を、容易かつ的確に実施することが可能となる。   As described above, according to the embodiment, the error rate in an actual machine can be accurately and quantitatively determined. Therefore, adjustment of the pattern wiring of the board (bases 501 and 502) and adjustment of a circuit including a communication path such as a cable and a connector are possible. Can be carried out easily and accurately.

また、シリアルバス200の伝送レートや伝送距離などの通信の安定度の評価を、短時間で実現することができるため、シリアルバス200の開発が容易になり、CPUユニット1、インテリジェント機能ユニット100を含んで構成されるプログラマブルロジックコントローラの早期市場投入が可能になる。また、市場で発生したエラー発生頻度が分かるため、市場(実使用)でのシリアルバス200のノイズの影響など、ユーザ使用環境がシステムに与える影響度を把握することができ、市場での生産設備の早期立ち上げやトラブル時の早期復旧が可能となる。   In addition, since it is possible to evaluate the stability of communication such as the transmission rate and transmission distance of the serial bus 200 in a short time, the development of the serial bus 200 is facilitated, and the CPU unit 1 and the intelligent function unit 100 are installed. The programmable logic controller configured to be included can be put on the market at an early stage. In addition, since the frequency of errors occurring in the market can be known, it is possible to ascertain the degree of influence that the user usage environment has on the system, such as the effects of serial bus 200 noise in the market (actual use). It is possible to start up the system early and to recover quickly in case of trouble.

以上のように、本発明にかかるプログラマブルロジックコントローラは、シリアルバス上の伝送エラーの検出や記録に適している。   As described above, the programmable logic controller according to the present invention is suitable for detection and recording of transmission errors on the serial bus.

本発明にかかるプログラマブルロジックコントローラのCPUユニットとインテリジェント機能ユニット間のシステム構成を示す図である。It is a figure which shows the system configuration | structure between the CPU unit and intelligent function unit of the programmable logic controller concerning this invention. ベース上にシリアルバスとパラレルバスを敷設した場合のシステム構成を示す図である。It is a figure which shows the system configuration | structure at the time of laying a serial bus and a parallel bus on a base. ベース上にパラレルバスを敷設しCPUユニットとインテリジェント機能ユニットをケーブルで接続した場合のシステム構成を示す図である。It is a figure which shows the system configuration | structure at the time of laying a parallel bus on a base and connecting a CPU unit and an intelligent function unit with a cable. メモリマップの構成の一例を示す図である。It is a figure which shows an example of a structure of a memory map. 基本フレームおよびCRC付き基本フレームの構成を示す図である。It is a figure which shows the structure of a basic frame and a basic frame with CRC. エラーフレーム格納メモリの構成を示す図である。It is a figure which shows the structure of an error frame storage memory.

符号の説明Explanation of symbols

1 CPUユニット
10,110 MPU
15,115 ローカルバス
20,120 実行ユニット
21,121 デコード回路
22,122 比較回路
23,123 フレームレジスタ
24,124 フレーム番号レジスタ
30,130 送信バッファ
31,41,131,141 パラレルシリアル変換回路
32,132 符号化回路
33,133 差動送信バッファ
35,45,135,145 CRCコード生成回路
36,136 リトライバッファ
40,140 受信バッファ
42,142 復号化回路
43,143 差動受信バッファ
50,81,150,181 コネクタ
60,160 シリアルバス回路
80,180 パラレルバス回路
82,182 デュアルポートメモリ
90,190 エラーフレーム格納メモリ
100 インテリジェント機能ユニット
201 基本フレーム
202 CRC付き基本フレーム
400 メモリマップ
401 シリアルバス領域
501,502 ベース
510 電源ユニット
520 I/Oユニット

1 CPU unit 10,110 MPU
15, 115 Local bus 20, 120 Execution unit 21, 121 Decoding circuit 22, 122 Comparison circuit 23, 123 Frame register 24, 124 Frame number register 30, 130 Transmission buffer 31, 41, 131, 141 Parallel serial conversion circuit 32, 132 Encoding circuit 33, 133 Differential transmission buffer 35, 45, 135, 145 CRC code generation circuit 36, 136 Retry buffer 40, 140 Reception buffer 42, 142 Decoding circuit 43, 143 Differential reception buffer 50, 81, 150, 181 Connector 60, 160 Serial bus circuit 80, 180 Parallel bus circuit 82, 182 Dual port memory 90, 190 Error frame storage memory 100 Intelligent function unit 201 Basic frame 2 2 CRC with basic frame 400 memory map 401 serial bus region 501 base 510 power supply unit 520 I / O unit

Claims (3)

第1のユニットと、前記第1のユニットにシリアルバスおよびパラレルバスで接続された第2のユニットと、を備え、前記第1のユニットと第2のユニットとの間のシリアルバス上のエラーを検出するプログラマブルロジックコントローラにおいて、
前記第1のユニットは、
前記第2のユニットに送信する第1の送信データを記憶しておく第1の送信データ記憶部と、
前記第1の送信データ毎のCRCコードを送信側CRCコードとして生成する第1の送信側CRCコード生成部と、
前記第2のユニットに送信する第1の送信データを識別する識別番号を送信側識別番号として生成し当該第1の送信データに付加する第1の識別番号付加部と、
前記識別番号付加部が付加した送信側識別番号を前記第1の送信データと対応付けて記憶する第1の送信側識別番号記憶部と、
を備え、
前記第2のユニットは、
前記第1のユニットから受信した第1の送信データのCRCコードを受信側CRCコードとして生成する第1の受信側CRCコード生成部と、
前記受信側CRCコードと前記送信側CRCコードを比較して前記第1のユニットと第2のユニットとの間のシリアルバス上のエラーを検出する第1のCRC比較部と、
前記第1のCRC比較部によってシリアルバス上のエラーが検出された送信側CRCコードに対応する第1の送信データを格納する第1のエラーデータ格納部と、
前記第1のCRC比較部がシリアルバス上のエラーを検出した際に、前記第1のユニットにエラー通知を行う第1のエラー通知部と、
前記第1のCRC比較部によってシリアルバス上のエラーが検出された送信側CRCコードに対応する第1の送信データを識別する識別番号をエラー識別番号として格納する第1のエラー識別番号記憶部と、
を備え、
前記第1のユニットは前記第1の送信データおよび前記送信側CRCコードを前記シリアルバスを介して前記第2のユニットに送信するとともに、前記第2のユニットは前記エラー通知を前記パラレルバスを介して前記第1のユニットに送信し、
前記第1のユニットは、前記第2のユニットから前記エラー通知を受けると前記パラレルバスを介して前記第1のエラーデータ格納部が格納する第1の送信データとともに前記第1のエラー識別番号記憶部が格納するエラー識別番号を読み出し、該読み出したエラー識別番号および前記第1の送信側識別番号記憶部が記憶する送信側識別番号に基づいて、前記読み出した第1の送信データと前記読み出した第1の送信データに対応する前記第1の送信データ記憶部内の第1の送信データとを対応付けて記憶することを特徴とするプログラマブルロジックコントローラ。
A first unit; and a second unit connected to the first unit by a serial bus and a parallel bus, wherein errors on the serial bus between the first unit and the second unit are detected. In the programmable logic controller to detect,
The first unit is:
A first transmission data storage unit for storing first transmission data to be transmitted to the second unit;
A first transmission side CRC code generation unit that generates a CRC code for each of the first transmission data as a transmission side CRC code;
A first identification number adding unit that generates an identification number for identifying first transmission data to be transmitted to the second unit as a transmission side identification number and adds the identification number to the first transmission data;
A first transmission side identification number storage unit that stores the transmission side identification number added by the identification number addition unit in association with the first transmission data;
With
The second unit is
A first reception side CRC code generation unit for generating a CRC code of the first transmission data received from the first unit as a reception side CRC code;
A first CRC comparator for comparing the receiving CRC code and the transmitting CRC code to detect an error on the serial bus between the first unit and the second unit;
A first error data storage unit for storing first transmission data corresponding to a transmission side CRC code in which an error on the serial bus is detected by the first CRC comparison unit;
A first error notification unit that notifies the first unit of an error when the first CRC comparison unit detects an error on the serial bus;
A first error identification number storage unit for storing, as an error identification number, an identification number for identifying first transmission data corresponding to the transmission side CRC code in which an error on the serial bus is detected by the first CRC comparison unit; ,
With
The first unit transmits the first transmission data and the transmission side CRC code to the second unit via the serial bus, and the second unit sends the error notification via the parallel bus. To the first unit,
When the first unit receives the error notification from the second unit, the first unit stores the first error identification number together with the first transmission data stored in the first error data storage unit via the parallel bus. The error identification number stored in the storage unit is read, and based on the read error identification number and the transmission side identification number stored in the first transmission side identification number storage unit, the read first transmission data and the read A programmable logic controller, wherein the first transmission data in the first transmission data storage unit corresponding to the first transmission data is stored in association with each other.
前記第2のユニットは、
前記第1のユニットに送信する第2の送信データを記憶する第2の送信データ記憶部と、
前記第2の送信データ毎のCRCコードを送信側CRCコードとして生成する第2の送信側CRCコード生成部と、
をさらに備え、
前記第1のユニットは、
前記第2のユニットから受信した第2の送信データのCRCコードを受信側CRCコードとして生成する第2の受信側CRCコード生成部と、
前記受信側CRCコードと前記送信側CRCコードを比較して前記第2のユニットと第1のユニットとの間のシリアルバス上のエラーを検出する第2のCRC比較部と、
前記第2のCRC比較部によってシリアルバス上のエラーが検出された送信側CRCコードに対応する第2の送信データを格納する第2のエラーデータ格納部と、
前記第2のCRC比較部がシリアルバス上のエラーを検出した際に、前記第2のユニットにエラー通知を行う第2のエラー通知部と、
をさらに備え、
前記第2のユニットは前記第2の送信データおよび前記送信側CRCコードを前記シリアルバスを介して前記第1のユニットに送信するとともに、前記第1のユニットは前記エラー通知を前記パラレルバスを介して前記第2のユニットに送信し、
前記第2のユニットは、前記第1のユニットから前記エラー通知を受けると前記パラレルバスを介して前記第2のエラーデータ格納部が格納する第2の送信データを読み出して、該読み出した第2の送信データと前記読み出した第2の送信データに対応する前記第2の送信データ記憶部内の第2の送信データとを対応付けて記憶することを特徴とする請求項1に記載のプログラマブルロジックコントローラ。
The second unit is
A second transmission data storage unit for storing second transmission data to be transmitted to the first unit;
A second transmission side CRC code generation unit that generates a CRC code for each of the second transmission data as a transmission side CRC code;
Further comprising
The first unit is:
A second reception side CRC code generation unit that generates a CRC code of the second transmission data received from the second unit as a reception side CRC code;
A second CRC comparator for comparing the receiving CRC code and the transmitting CRC code to detect an error on the serial bus between the second unit and the first unit;
A second error data storage unit that stores second transmission data corresponding to a transmission side CRC code in which an error on the serial bus is detected by the second CRC comparison unit;
A second error notification unit for notifying the second unit of an error when the second CRC comparison unit detects an error on the serial bus;
Further comprising
The second unit transmits the second transmission data and the transmission side CRC code to the first unit via the serial bus, and the first unit sends the error notification via the parallel bus. To the second unit,
When the second unit receives the error notification from the first unit, the second unit reads the second transmission data stored in the second error data storage unit via the parallel bus, and reads the read second data. 2. The programmable logic controller according to claim 1, wherein the transmission data and the second transmission data in the second transmission data storage unit corresponding to the read second transmission data are stored in association with each other. .
前記第2のユニットは、
前記第1のユニットに送信する第2の送信データを識別する識別番号を送信側識別番号として生成し当該第2の送信データに付加する第2の識別番号付加部と、
前記識別番号付加部が付加した送信側識別番号を前記第2の送信データと対応付けて記憶する第2の送信側識別番号記憶部と、
をさらに備え、
前記第1のユニットは、
前記第2のCRC比較部によってシリアルバス上のエラーが検出された送信側CRCコードに対応する第2の送信データを識別する識別番号をエラー識別番号として格納する第2のエラー識別番号記憶部をさらに備え、
前記第2のユニットは、前記第2のエラーデータ格納部が格納する第2の送信データとともに前記第2のエラー識別番号記憶部が格納するエラー識別番号を読み出し、該読み出したエラー識別番号および前記第2の送信側識別番号記憶部が記憶する送信側識別番号に基づいて、前記読み出した第2の送信データと前記第2の送信データ記憶部が記憶する第2の送信データとを対応付けし記憶することを特徴とする請求項2に記載のプログラマブルロジックコントローラ。
The second unit is
A second identification number adding unit that generates an identification number for identifying the second transmission data to be transmitted to the first unit as a transmission side identification number and adds the identification number to the second transmission data;
A second transmission side identification number storage unit for storing the transmission side identification number added by the identification number addition unit in association with the second transmission data;
Further comprising
The first unit is:
A second error identification number storage unit for storing, as an error identification number, an identification number for identifying second transmission data corresponding to a transmission side CRC code in which an error on the serial bus is detected by the second CRC comparison unit; In addition,
The second unit reads the error identification number stored in the second error identification number storage unit together with the second transmission data stored in the second error data storage unit, and the read error identification number and the Based on the transmission side identification number stored in the second transmission side identification number storage unit, the read second transmission data is associated with the second transmission data stored in the second transmission data storage unit. The programmable logic controller according to claim 2, wherein the programmable logic controller is stored.
JP2005119868A 2005-04-18 2005-04-18 Programmable logic controller Expired - Fee Related JP4455393B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005119868A JP4455393B2 (en) 2005-04-18 2005-04-18 Programmable logic controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005119868A JP4455393B2 (en) 2005-04-18 2005-04-18 Programmable logic controller

Publications (2)

Publication Number Publication Date
JP2006301784A JP2006301784A (en) 2006-11-02
JP4455393B2 true JP4455393B2 (en) 2010-04-21

Family

ID=37470027

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005119868A Expired - Fee Related JP4455393B2 (en) 2005-04-18 2005-04-18 Programmable logic controller

Country Status (1)

Country Link
JP (1) JP4455393B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010267003A (en) * 2009-05-13 2010-11-25 Mitsubishi Electric Corp Programmable controller
US9399955B2 (en) * 2012-02-29 2016-07-26 General Electric Company Method and apparatus for local loop closure
JP6559619B2 (en) * 2016-07-06 2019-08-14 日本電信電話株式会社 COMMUNICATION SYSTEM, COMMUNICATION DEVICE, COMMUNICATION METHOD, AND PROGRAM
IT201800005506A1 (en) * 2018-05-18 2019-11-18 PROCESSING SYSTEM, RELATED INTEGRATED CIRCUIT AND PROCEDURE

Also Published As

Publication number Publication date
JP2006301784A (en) 2006-11-02

Similar Documents

Publication Publication Date Title
US7049839B1 (en) Method and related apparatus for chip testing
JP3996928B2 (en) How to handle corrupted data
US7210065B2 (en) Methods and structure for testing responses from SAS device controllers or expanders
JP4455393B2 (en) Programmable logic controller
US7461321B2 (en) Error detection
US7721159B2 (en) Passing debug information
CN1794186A (en) Addressing error and address detection systems and methods
US7701846B2 (en) Bad data packet capture device
US7436777B2 (en) Failed link training
CN110646723B (en) Bus interface test circuit and method
US7363402B2 (en) Data communications architecture employing parallel SERDES channels
JP2009290497A (en) Error specifying method, data processing device and semiconductor device
US7606253B2 (en) Successful transactions
US7000170B2 (en) Method and apparatus for generating CRC/parity error in network environment
KR101086599B1 (en) Uncertain data arrival time
US7310762B2 (en) Detection of errors
US7613958B2 (en) Error detection in a system having coupled channels
TWI383294B (en) System to identify components of a data communications architecture
US9230290B2 (en) Power meter consumption system and method to verify data stored in a register by comparing an address of the register with request for data of the register
US7624213B2 (en) Passing identification information
KR100292059B1 (en) Data retransmission system at the exchange
JP4649304B2 (en) COMMUNICATION CONTROL DEVICE AND ITS CONTROL METHOD
JP4449332B2 (en) IC card connection device
JP2003271466A (en) Usb bridge circuit
JP2004021316A (en) Communication method, electronic equipment and communication program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071206

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090917

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090929

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091120

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100203

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

Free format text: PAYMENT UNTIL: 20130212

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130212

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140212

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees