JPH06214620A - Input/output data switching system - Google Patents
Input/output data switching systemInfo
- Publication number
- JPH06214620A JPH06214620A JP648193A JP648193A JPH06214620A JP H06214620 A JPH06214620 A JP H06214620A JP 648193 A JP648193 A JP 648193A JP 648193 A JP648193 A JP 648193A JP H06214620 A JPH06214620 A JP H06214620A
- Authority
- JP
- Japan
- Prior art keywords
- data
- input
- transmission
- output data
- buffer
- 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
Links
Landscapes
- Programmable Controllers (AREA)
Abstract
(57)【要約】 (修正有)
【目的】OSが資源を有効に活用でき且つ決められた伝
送最大データ数に制約されることなくデータの入出力が
できる入出力データ交換方式を実現する。
【構成】OS105は、出力データをI/Oメモリ10
2からI/Oイメージ領域103−Cへ転送する。フラ
グ106がオフなら送信バッファ103−Sの更新を行
わず、オンなら更新する。転送ポインタ107は今回読
み出す受信バッファアの先頭アドレス、書込ポインタ1
08は今回書き込む受信バッファの先頭アドレス、編集
ポインタ109は異常時にデータ編集する受信バッファ
の先頭アドレスをそれぞれ格納する。データ交換テーブ
ル110はI/O装置番号に対応するデータ用相対アド
レスを格納する。入出力データは、選択された先頭アド
レスに相対アドレスを加算したアドレスで入出力され
る。今回の伝送結果部が全て正常であれば、転送ポイン
タ107と書込ポインタ108の先頭アドレスを交換す
る。
(57) [Summary] (Correction) [Purpose] To realize an input / output data exchange method in which the OS can effectively use resources and can input / output data without being restricted by the maximum number of data to be transmitted. [Structure] The OS 105 outputs the output data to the I / O memory 10
2 to the I / O image area 103-C. If the flag 106 is off, the transmission buffer 103-S is not updated, and if it is on, it is updated. The transfer pointer 107 is the start address of the reception buffer to be read this time, the write pointer 1
Reference numeral 08 stores the start address of the receive buffer to be written this time, and edit pointer 109 stores the start address of the receive buffer for editing data in the event of an abnormality. The data exchange table 110 stores the relative address for data corresponding to the I / O device number. Input / output data is input / output at an address obtained by adding a relative address to the selected start address. If all the transmission result parts at this time are normal, the start addresses of the transfer pointer 107 and the write pointer 108 are exchanged.
Description
【発明の詳細な説明】Detailed Description of the Invention
【0001】[0001]
【産業上の利用分野】本発明は、中央制御部とI/O部
がシリアル伝送バスで接続されて構成されるプログラマ
ブルコントローラにおいて、シリアル伝送インタフェー
ス回路が一度に送出でき得る最大データ数を越える容量
を有するI/O装置と、中央制御部との入出力データ交
換方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a programmable controller constructed by connecting a central control unit and an I / O unit via a serial transmission bus, and has a capacity exceeding the maximum number of data that a serial transmission interface circuit can send at one time. And an input / output data exchange method between the central control unit and the I / O device having the above.
【0002】[0002]
【従来の技術】一般に、プログラマブルコントローラ
(以下、PCと称する)の構成は、図5に示すように、
演算および制御を行う中央制御部501と、その中央制
御部501の演算結果および制御に基づいて、複数の被
制御装置に対して入出力データを入出力するI/O部5
20とに分かれている。これらI/O部520と中央制
御部501とは、シリアル伝送バス510を介して接続
されている。2. Description of the Related Art Generally, a programmable controller (hereinafter referred to as a PC) has a configuration as shown in FIG.
A central control unit 501 that performs calculation and control, and an I / O unit 5 that inputs and outputs input / output data to and from a plurality of controlled devices based on the calculation result and control of the central control unit 501.
It is divided into 20. The I / O unit 520 and the central control unit 501 are connected via a serial transmission bus 510.
【0003】上記中央制御部501は、ユーザプログラ
ムにより動作する演算部504、その演算部504とI
/O部520間で入出力されるデータを記憶するI/O
メモリ502、そのI/Oメモリ502が入出力するデ
ータを一時的に蓄えるI/Oバッファ503、及びその
I/Oバッファ503をシリアル伝送バス510を介し
てI/O部520に接続するためのシリアル伝送インタ
フェース回路540からなっている。The central control unit 501 includes an arithmetic unit 504 operated by a user program, and the arithmetic unit 504 and I.
I / O for storing data input / output between the I / O units 520
A memory 502, an I / O buffer 503 that temporarily stores data input and output by the I / O memory 502, and a connection of the I / O buffer 503 to the I / O unit 520 via the serial transmission bus 510. It comprises a serial transmission interface circuit 540.
【0004】そして、I/O部520は、複数の被制御
装置に対して入出力データを入出力するI/O装置(イ
ンタフェース)520−1、520−2、・・・520
−nからなる。それらのI/O装置520−i(i=
1、2・・・n、以下同様)はそれぞれ局番設定器53
0−iを備え、これら局番設定器530−iには各I/
O装置に付与される装置番号が設定される。さらに、I
/O装置520−iは、それぞれシリアル伝送インタフ
ェース回路540−iを備えている。The I / O unit 520 inputs / outputs data to / from a plurality of controlled devices, I / O devices (interfaces) 520-1, 520-2, ... 520.
-N. Those I / O devices 520-i (i =
1, 2, ... N, and so on) are station number setting devices 53, respectively.
0-i, and these I / O numbers for the station number setting unit 530-i
The device number given to the O device is set. Furthermore, I
The I / O devices 520-i each include a serial transmission interface circuit 540-i.
【0005】上記中央制御部501のシリアル伝送バス
インタフェース540とI/O部520のシリアル伝送
バスインタフェース540−1、540−2・・・54
0−nとは、シリアル伝送バス510を介して接続され
ている。The serial transmission bus interface 540 of the central control unit 501 and the serial transmission bus interfaces 540-1, 540-2, ... 54 of the I / O unit 520
0-n are connected via a serial transmission bus 510.
【0006】上記中央制御部501は、シリアル伝送バ
ス510、およびシリアル伝送インタフェース回路54
0を介してI/O部520の各I/O装置520−iか
ら入力するデータを、I/Oバッファ503およびI/
Oメモリ502を介して演算部504に入力し、その入
力データを用いて演算をなし、その演算結果をI/Oメ
モリ502、I/Oバッファ503、シリアル伝送イン
タフェース回路540、およびシリアル伝送バス510
を介してI/O部520のI/O装置520−iに出力
することにより、それらのI/O装置520−iに接続
される被制御装置を制御するようになっている。The central control unit 501 includes a serial transmission bus 510 and a serial transmission interface circuit 54.
Data input from each I / O device 520-i of the I / O unit 520 via the I / O buffer 503 and the I / O buffer 503.
It is input to the arithmetic unit 504 via the O memory 502, arithmetic is performed using the input data, and the arithmetic result is calculated by the I / O memory 502, the I / O buffer 503, the serial transmission interface circuit 540, and the serial transmission bus 510.
By outputting to the I / O device 520-i of the I / O unit 520 via the I / O unit 520, the controlled device connected to the I / O device 520-i is controlled.
【0007】ところで、I/O装置520−iは、様々
な被制御装置に運用できるように多種用意されており、
またI/O装置520−iの入出力データ容量は、それ
ぞれあらかじめ決められている。そこで、中央制御部5
01はI/O装置520−iの持つ入出力データ容量を
知るため、I/O装置520−iに対して入出力データ
容量を問い合わせ、その後、I/O装置520−iの持
つ容量に合わせて固定長の入出力データ伝送を行うよう
になっている。By the way, various I / O devices 520-i are prepared so that they can be used for various controlled devices.
The input / output data capacity of the I / O device 520-i is determined in advance. Therefore, the central control unit 5
01 inquires the input / output data capacity of the I / O device 520-i to know the input / output data capacity of the I / O device 520-i. It is designed to perform fixed length input / output data transmission.
【0008】図6は、I/Oバッファ503の入出力デ
ータとシリアル伝送バス510上の伝送データの概念を
示す模式的図である。同図に示す例では、局番設定器5
30−1には装置番号“X”、局番設定器530−2に
は装置番号“Y”、局番設定器530−nには装置番号
“Z”が設定されている。FIG. 6 is a schematic diagram showing the concept of input / output data of the I / O buffer 503 and transmission data on the serial transmission bus 510. In the example shown in the figure, the station number setting device 5
The device number “X” is set in 30-1, the device number “Y” is set in the station number setting device 530-2, and the device number “Z” is set in the station number setting device 530-n.
【0009】また、I/Oバッファ503は、I/Oメ
モリ502と送信バッファ503−S及び受信バッファ
503−Rとを仲介するI/Oイメージ領域503−
C、出力データをI/O装置520−iへ送出するため
の送信バッファ503−S、及びI/O装置520−i
から送出される入力データが格納される受信バッファ5
03−Rの3つの部分で構成されている。Further, the I / O buffer 503 mediates between the I / O memory 502, the transmission buffer 503-S and the reception buffer 503-R, and an I / O image area 503-.
C, a transmission buffer 503-S for sending output data to the I / O device 520-i, and an I / O device 520-i
Receive buffer 5 that stores the input data sent from
It is composed of three parts 03-R.
【0010】上記の送信バッファ503−Sは、各I/
O装置520−iにそれぞれ対応する領域を有してお
り、これらの各領域は、コマンド部、送信データ数部、
装置番号部、出力データ部で構成される。各領域の装置
番号部には、I/O装置520−iに対応して、それぞ
れ装置番号「X」,「Y」・・・「Z」が格納されてい
る。The above-mentioned transmission buffer 503-S is provided for each I / O.
The O-device 520-i has areas corresponding to the respective areas, and each of these areas includes a command section, a transmission data number section,
It is composed of a device number part and an output data part. In the device number portion of each area, device numbers “X”, “Y” ... “Z” are stored corresponding to the I / O devices 520-i.
【0011】一方、受信バッファ503−Rも、各I/
O装置520−iにそれぞれ対応する領域を有してお
り、これらの各領域は、伝送結果部、受信データ数部、
装置番号部、入力データ部で構成される。これら各領域
の装置番号部の装置番号部にも、I/O装置520−i
に対応して、それぞれ装置番号「X」,「Y」・・・
「Z」が格納されている。On the other hand, the reception buffer 503-R also receives each I / O.
The O-device 520-i has areas corresponding to the respective areas, and each of these areas includes a transmission result portion, a received data number portion,
It is composed of a device number part and an input data part. The I / O device 520-i is also included in the device number part of the device number part of each of these areas.
Corresponding to the device numbers "X", "Y" ...
“Z” is stored.
【0012】中央制御部501のオペレーティングシス
テム(以下、OSと称する)505がシリアル伝送イン
タフェース回路540に伝送指令を行うと、シリアル伝
送インタフェース回路540は、送信バッファ503−
Sのコマンド部が「実行」であるとシリアル伝送を実行
し、送信バッファ503−Sのコマンド部が「停止」と
なるまで連続して伝送を行い、上記「停止」をフェッチ
することにより、OS505へ伝送の終了を通知するよ
うになっている。When the operating system (hereinafter referred to as OS) 505 of the central controller 501 issues a transmission command to the serial transmission interface circuit 540, the serial transmission interface circuit 540 causes the transmission buffer 503-.
When the command part of S is "execution", serial transmission is executed, transmission is continuously performed until the command part of the transmission buffer 503-S becomes "stop", and the above "stop" is fetched. Is notified to the end of transmission.
【0013】さらに説明すると、シリアル伝送インタフ
ェース回路540は、伝送バッファ503−Sの先頭ア
ドレスのコマンド部が「実行」であると、次のアドレス
に示される送信データ数部のデータ数分、その次のアド
レスから格納されている送信データ(装置番号と出力デ
ータ)を、シリアル伝送バス510上へ伝送データの集
合(以下、伝送フレームと称する)として送出する。To further explain, if the command portion of the head address of the transmission buffer 503-S is "execute", the serial transmission interface circuit 540 will generate the number of transmission data portions indicated by the next address, and The transmission data (device number and output data) stored from the address is sent to the serial transmission bus 510 as a set of transmission data (hereinafter referred to as a transmission frame).
【0014】即ち、先ず、送信バッファ503−Sの最
初の送出データ(装置番号「X」と出力データ)を、伝
送フレーム601−1としてI/O装置520−1に伝
送する。I/O装置520−1は、伝送フレーム601
−1を受信すると、直ちに中央制御部501への送出デ
ータ(装置番号「X」と入力データ)の伝送フレーム6
11−1を送出する。この伝送データ交換方式は、一般
にポーリング・セフティング方式として知られている。That is, first, the first transmission data (device number "X" and output data) of the transmission buffer 503-S is transmitted to the I / O device 520-1 as the transmission frame 601-1. The I / O device 520-1 has a transmission frame 601.
When -1 is received, the transmission frame 6 of the transmission data (device number "X" and input data) to the central control unit 501 is immediately transmitted.
11-1 is transmitted. This transmission data exchange system is generally known as a polling and safety system.
【0015】シリアル伝送インタフェース回路540
は、I/O装置520−1が送出した伝送フレーム61
1−1を受信すると、受信バッファ503−Rの対応す
る領域へ受信データを書き込むと共に、受信データ数と
伝送結果とを所定の場所へ格納する。Serial transmission interface circuit 540
Is the transmission frame 61 transmitted by the I / O device 520-1.
When 1-1 is received, the received data is written in the corresponding area of the receive buffer 503-R, and the number of received data and the transmission result are stored in a predetermined place.
【0016】次に、シリアル伝送インタフェース回路5
40は、送信バッファ503−Sの次のコマンド部をフ
ェッチし、これに基づいて、伝送フレーム601−2
(装置番号「Y」と出力データ)をI/O装置520−
2に伝送し、I/O装置520−2は、直ちに送出デー
タ(装置番号「Y」と入力データ)の伝送フレーム61
1−2を送出し、シリアル伝送インタフェース回路54
0は、伝送フレーム611−2を受信すると、受信バッ
ファ503−Rの対応する所定の領域へ受信データと受
信データ数と伝送結果とを格納する。Next, the serial transmission interface circuit 5
40 fetches the next command part of the transmission buffer 503-S, and based on this, the transmission frame 601-2
(Device number “Y” and output data) to I / O device 520-
2 and the I / O device 520-2 immediately transmits the transmission frame 61 of the transmission data (device number “Y” and input data).
1-2, and the serial transmission interface circuit 54
When receiving the transmission frame 611-2, 0 stores the reception data, the number of reception data, and the transmission result in the corresponding predetermined area of the reception buffer 503-R.
【0017】これらの処理は、順次I/O装置520−
nまで同様に実行される。こうして、コマンド部が「停
止」となるまで伝送を繰り返す。OS505は、シリア
ル伝送インタフェース回路540に伝送指令を行ってか
ら、伝送の終了が通知されるまで、シリアル伝送情報処
理装置に一切関与しない。また、シリアル伝送インタフ
ェース回路540および540−iは、一度に送出し得
る最大データ数があらかじめ決められている。These processes are sequentially performed by the I / O device 520-
It is similarly executed up to n. In this way, the transmission is repeated until the command section becomes "stop". The OS 505 does not participate in the serial transmission information processing device at all after the transmission command is given to the serial transmission interface circuit 540 until the end of the transmission is notified. Further, the maximum number of data that can be transmitted at one time is predetermined for the serial transmission interface circuits 540 and 540-i.
【0018】OS505が、シリアル伝送インタフェー
ス回路540に伝送指令を行うタイミングと、演算部5
04が演算を行うタイミングは、それぞれ非同期であ
る。したがって、演算部504が演算時に使用する入力
データの入力タイミング、及びその演算結果の出力デー
タをI/O装置520−iへ伝送する出力タイミングに
は、いずれもシリアル伝送インタフェース回路540と
同期をとることが要求される。The timing at which the OS 505 issues a transmission command to the serial transmission interface circuit 540 and the operation unit 5
The timing at which 04 performs the calculation is asynchronous. Therefore, the input timing of the input data used by the arithmetic unit 504 during the arithmetic operation and the output timing of transmitting the output data of the arithmetic result to the I / O device 520-i are both synchronized with the serial transmission interface circuit 540. Is required.
【0019】このため、OS505は、演算部504の
演算に同期して、シリアル伝送インタフェース回路54
0に出力データの伝送指令を行う直前に、その出力デー
タをI/Oイメージ領域503−Cから送信バッファ5
03−Sに転送し、また、伝送終了時には、受信バッフ
ァ503−Rの入力データをI/Oイメージ領域503
−Cへ転送している。Therefore, the OS 505 synchronizes with the arithmetic operation of the arithmetic unit 504 and the serial transmission interface circuit 54.
Immediately before sending the output data transmission command to 0, the output data is sent from the I / O image area 503-C to the transmission buffer 5
03-S, and at the end of transmission, the input data of the reception buffer 503-R is transferred to the I / O image area 503.
-Transfer to C.
【0020】また、上記I/Oイメージ領域503−C
の入出力データはI/Oメモリ502とで交換される。
OS505が、送信バッファ503−Sおよび受信バッ
ファ503−RのデータをI/Oイメージ領域503−
C間で転送しているときは、I/Oメモリ502とI/
Oイメージ領域503−Cのデータ交換は行わない。こ
のようにして、入出力データの同期を保証するようにし
ている。The I / O image area 503-C is also provided.
The input / output data of is exchanged with the I / O memory 502.
The OS 505 transfers the data in the transmission buffer 503-S and the reception buffer 503-R to the I / O image area 503-.
When transferring between C, I / O memory 502 and I / O memory 502
Data exchange of the O image area 503-C is not performed. In this way, the synchronization of the input / output data is guaranteed.
【0021】また、従来、このような、入出力データ交
換方式においては、シリアル伝送インタフェース回路5
40および540−iが一度に送出できる最大データ数
が予め決っていた。Further, conventionally, in such an input / output data exchange system, the serial transmission interface circuit 5 is used.
The maximum number of data that 40 and 540-i can send at one time was predetermined.
【0022】[0022]
【発明が解決しようとする課題】しかしながら、上述し
た従来の入出力データ交換方式では、演算部504のP
C内におけるユーザプログラムによる演算周期、すなわ
ちOS505がI/Oメモリ502とI/Oイメージ領
域503−C間で入出力データ交換を行う周期が、シリ
アル伝送の周期よりも大きくなった場合でも、OS50
5はシリアル伝送開始毎にI/Oイメージ領域503−
Cの出力データを送信バッファ503−Sへ転送し、伝
送終了毎に、受信バッファ503−Rから入力データを
I/Oイメージ領域503−Cへ転送するということを
行って、無駄なデータ転送処理が行われることになるた
めOS505のオーバヘッドとなる問題があった。However, in the above-mentioned conventional input / output data exchange system, P of the arithmetic unit 504 is used.
Even if the calculation cycle by the user program in C, that is, the cycle in which the OS 505 exchanges input / output data between the I / O memory 502 and the I / O image area 503-C is longer than the cycle of serial transmission, the OS 50
5 is an I / O image area 503-at each start of serial transmission.
The output data of C is transferred to the transmission buffer 503-S, and the input data is transferred from the reception buffer 503-R to the I / O image area 503-C each time the transmission is completed, which is a wasteful data transfer process. Therefore, there is a problem that it becomes an overhead of the OS 505.
【0023】また、シリアル伝送インタフェース回路5
40および540−iが一度に送出できる最大データ数
が決っているため、この最大データ数を越える入出力デ
ータ容量を持ったI/O装置を設計することができず、
設計システムの規模に制約をうけるという問題もあっ
た。Further, the serial transmission interface circuit 5
Since the maximum number of data that can be transmitted by 40 and 540-i at a time is determined, it is impossible to design an I / O device having an input / output data capacity exceeding this maximum number of data.
There was also a problem that the scale of the design system was restricted.
【0024】本発明の課題は、OSが資源を有効に活用
でき、且つ決められた伝送最大データ数に制約されるこ
となくデータの入出力ができる入出力データ交換方式を
実現することである。An object of the present invention is to realize an input / output data exchange system in which an OS can effectively use resources and can input / output data without being restricted by a predetermined maximum transmission data number.
【0025】[0025]
【課題を解決するための手段】本発明は、入出力データ
を演算する中央制御部とそれぞれ装置番号を有する複数
のI/O部とをシリアル伝送バスにより接続して構成さ
れるプログラマブルコントローラの入出力データ交換方
式を前提とする。SUMMARY OF THE INVENTION According to the present invention, there is provided a programmable controller including a central control unit for calculating input / output data and a plurality of I / O units each having a device number connected by a serial transmission bus. The output data exchange method is assumed.
【0026】本発明の入出力データ交換方式は、演算さ
れる入出力データを格納するI/Oメモリと、このI/
Oメモリと複数のI/O部間における入出力データの伝
送をシリアル伝送バスを介して仲介するシリアル伝送イ
ンタフェース回路と、このシリアル伝送インタフェース
回路とI/Oメモリ間に接続され、シリアル伝送インタ
フェース回路を介してI/Oメモリと複数のI/O部間
において行われる入出力データの伝送結果が全て正常で
あるか否かを示す総括伝送結果及び複数のI/O部から
の入力データを格納する3個の受信バッファと、複数の
I/O部からの入力データをI/Oメモリにより読み出
される受信バッファの先頭アドレスを示す第1のポイン
タと、複数のI/O部からの入力データをシリアル伝送
インタフェース回路により書き込まれる受信バッファの
先頭アドレスを示す第2のポインタと、総括伝送結果が
異常であったとき複数のI/O部の入力データを編集す
る受信バッファの先頭アドレスを示す第3のポインタ
と、複数のI/O部に対応する受信バッファの相対アド
レス及びI/Oメモリの相対アドレス並びに入出力デー
タ容量を記憶するI/Oデータ交換テーブルと、シリア
ル伝送インタフェース回路に接続され、I/Oメモリの
出力データをシリアル伝送インタフェース回路に出力す
る送信バッファと、送信バッファにより出力されるべき
出力データを一時的に格納する出力イメージ領域と、出
力イメージ領域に格納された出力データが送信バッファ
へ出力されたか否かを示すフラグ領域とを備える。The input / output data exchange system according to the present invention includes an I / O memory for storing input / output data to be operated, and this I / O memory.
A serial transmission interface circuit that mediates the transmission of input / output data between the O memory and the plurality of I / O units via a serial transmission bus, and a serial transmission interface circuit connected between the serial transmission interface circuit and the I / O memory. Stores the overall transmission result indicating whether the transmission / reception results of the input / output data between the I / O memory and the plurality of I / O units via the I / O unit are normal and the input data from the plurality of I / O units The input data from the plurality of I / O units and the first pointer that indicates the start address of the reception buffer in which the input data from the plurality of I / O units are read by the I / O memory. When the second pointer indicating the start address of the reception buffer written by the serial transmission interface circuit and the general transmission result are abnormal A third pointer indicating the start address of the receiving buffer for editing the input data of the number I / O units, the relative address of the receiving buffer corresponding to the plurality of I / O units, the relative address of the I / O memory, and the input / output. The I / O data exchange table for storing the data capacity, the transmission buffer connected to the serial transmission interface circuit and outputting the output data of the I / O memory to the serial transmission interface circuit, and the output data to be output by the transmission buffer are shown. An output image area for temporary storage and a flag area indicating whether or not the output data stored in the output image area is output to the transmission buffer are provided.
【0027】[0027]
【作用】本発明の入出力データ交換方式では、シリアル
伝送インタフェース回路は、演算される入出力データを
格納するI/Oメモリと複数のI/O部間における入出
力データの伝送をシリアル伝送バスを介して仲介する。
3個の受信バッファは、上記入出力データの伝送結果が
全て正常であるか否かを示す総括伝送結果及び複数のI
/O部からの入力データを格納する。According to the input / output data exchange method of the present invention, the serial transmission interface circuit transfers the input / output data between the I / O memory for storing the calculated input / output data and the plurality of I / O units by the serial transmission bus. Mediate through.
The three reception buffers include a general transmission result indicating whether or not the transmission results of the input / output data are all normal and a plurality of I's.
Stores input data from the / O section.
【0028】第1のポインタは、入力データを読み出さ
れる受信バッファの先頭アドレスを示し、第2のポイン
タは、入力データを書き込まれる受信バッファの先頭ア
ドレスを示し、第3のポインタは、上記の総括伝送結果
が異常であったとき複数のI/O部の入力データを編集
する受信バッファの先頭アドレスを示す。The first pointer indicates the start address of the reception buffer from which the input data is read, the second pointer indicates the start address of the reception buffer to which the input data is written, and the third pointer indicates the above summary. When the transmission result is abnormal, the head address of the reception buffer for editing the input data of the plurality of I / O units is shown.
【0029】I/Oデータ交換テーブルは、複数のI/
O部に対応する受信バッファの相対アドレス及びI/O
メモリの相対アドレス並びに入出力データ容量を記憶す
る。送信バッファは、I/Oメモリの出力データをシリ
アル伝送インタフェース回路に出力し、出力イメージ領
域は、送信バッファにより出力されるべき出力データを
一時的に格納し、フラグ領域は、出力イメージ領域に格
納された出力データが送信バッファへ出力されたか否か
を示す。The I / O data exchange table includes a plurality of I / O data.
Relative address and I / O of receive buffer corresponding to section O
It stores the relative address of the memory and the input / output data capacity. The transmission buffer outputs the output data of the I / O memory to the serial transmission interface circuit, the output image area temporarily stores the output data to be output by the transmission buffer, and the flag area stores it in the output image area. It indicates whether the output data that has been output is output to the transmission buffer.
【0030】また、上記の入出力データ交換方式は、例
えば、シリアル伝送インタフェース回路が一度に送出し
得る最大データ数を越える容量を有する複数のI/O部
の入出力データに対して、伝送データの伝送順序を示す
シーケンシャル番号及び伝送データの分割順序を示すペ
ージ番号のデータを付与し、且つそれらシーケンシャル
番号及びページ番号のデータを格納する3個の受信バッ
ファの相対アドレステーブルを備え、それらのページ順
に、上記シリアル伝送インタフェース回路により仲介さ
れる送信バッファからの出力データの伝送及び複数のI
/O部からの入力データの伝送を交互に行う。The above-mentioned input / output data exchange method is, for example, for transmission / reception data of input / output data of a plurality of I / O units having a capacity exceeding the maximum number of data that can be transmitted at one time by the serial transmission interface circuit. Is provided with a relative address table of three reception buffers that assigns a sequential number indicating the transmission order of the data and a page number indicating the division order of the transmission data, and stores the data of the sequential number and the page number. In turn, transmission of output data from the transmission buffer mediated by the serial transmission interface circuit and a plurality of I's.
The input data from the / O section is transmitted alternately.
【0031】[0031]
【実施例】以下、図面を参照しながら、本発明の実施例
について説明する。図1は、本発明の実施例に係わる中
央制御部の全体構成を示すブロック図である。同図にお
いて、中央制御部は、不図示のシリアル伝送インタフェ
ース回路140及びシリアル伝送バス110を介して、
これも不図示の複数の被制御装置に対して入出力データ
を入出力するI/O部120と接続している。Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the overall configuration of a central control unit according to an embodiment of the present invention. In the figure, the central control unit, via a serial transmission interface circuit 140 and a serial transmission bus 110 (not shown),
This is also connected to an I / O unit 120 that inputs / outputs input / output data to / from a plurality of controlled devices (not shown).
【0032】上記I/O部120は、従来のI/O部と
同様に(図5参照)、複数の被制御装置に対して入出力
データを入出力するI/O装置120−i(i=1、2
・・・n、以下同様)からなり、それらI/O装置12
0−iは局番設定器130−i及びシリアル伝送インタ
フェース回路140−iをそれぞれ備え、それらの局番
設定器130−iには、各I/O装置120−iに付与
される装置番号が設定される。The I / O unit 120, like the conventional I / O unit (see FIG. 5), inputs / outputs I / O data to / from a plurality of controlled devices. = 1, 2
... n, and so on), and these I / O devices 12
0-i includes a station number setter 130-i and a serial transmission interface circuit 140-i, respectively, and the station number setter 130-i is set with a device number assigned to each I / O device 120-i. It
【0033】図1に示す中央制御部は、先ず、ユーザプ
ログラムにより動作する演算部104、その演算部10
4とI/O部120間で入出力されるデータを記憶する
I/Oメモリ102、そのI/Oメモリ102が記憶す
る送信データを一時的に記憶するI/Oイメージ領域1
03−C、そのI/Oイメージ領域103−Cの送信デ
ータをシリアル伝送インタフェース回路140に出力す
る送信バッファ103−S、上記I/Oメモリ102と
I/Oイメージ領域103−C間の出力データの転送条
件を記憶するフラグ領域106を備える。In the central control unit shown in FIG. 1, first, an arithmetic unit 104 operated by a user program and its arithmetic unit 10 are operated.
4 and the I / O unit 120, the I / O memory 102 for storing the data input / output, and the I / O image area 1 for temporarily storing the transmission data stored in the I / O memory 102.
03-C, a transmission buffer 103-S for outputting the transmission data of the I / O image area 103-C to the serial transmission interface circuit 140, and output data between the I / O memory 102 and the I / O image area 103-C. The flag area 106 for storing the transfer condition of
【0034】次に、中央制御部は、上記シリアル伝送イ
ンタフェース回路140を介して複数のI/O装置12
0−iから入力する受信データを格納する3個の受信バ
ッファ103−R−X、103−R−Y及び103−R
−Z、I/O装置120−iから受信した入力データを
I/Oメモリ102へ転送する受信バッファ103−R
−X(103−R−X、103−R−Y又は103−R
−Z)の先頭アドレスを記憶する転送ポインタ領域10
7、I/O装置120−iから受信したデータが書き込
まれる受信バッファ103−Rの先頭アドレスを記憶す
る書込ポインタ領域108、並びに受信データ異常時の
入力データが編集される受信バッファ103−Rの先頭
アドレスを記憶する編集ポインタ領域109を備えてい
る。Next, the central control unit controls the plurality of I / O devices 12 via the serial transmission interface circuit 140.
Three receive buffers 103-R-X, 103-R-Y and 103-R for storing received data input from 0-i
-Z, receive buffer 103-R for transferring input data received from I / O device 120-i to I / O memory 102
-X (103-R-X, 103-R-Y or 103-R
-Z) transfer pointer area 10 for storing the start address
7, a write pointer area 108 for storing the start address of the reception buffer 103-R in which the data received from the I / O device 120-i is written, and a reception buffer 103-R for editing the input data when the reception data is abnormal An edit pointer area 109 for storing the start address of
【0035】また、さらに中央制御部は、I/O装置1
20−iの送受信データの伝送順位(装置番号)にそれ
ぞれ対応する受信バッファ103−R−X、103−R
−Y及び103−R−Zの相対アドレスとI/Oメモリ
102の相対アドレス及び各I/O装置120−iの入
出力データ容量を記憶するI/Oデータ交換テーブル1
10を備えている。Further, the central control unit further comprises an I / O device 1
The reception buffers 103-R-X and 103-R corresponding to the transmission order (device number) of the transmission / reception data of 20-i, respectively
I / O data exchange table 1 for storing the relative addresses of -Y and 103-R-Z, the relative address of I / O memory 102, and the input / output data capacity of each I / O device 120-i.
Equipped with 10.
【0036】そして、中央制御部の演算部104は、I
/Oメモリ102に入力される入力データを用いて演算
をなし、その演算結果を、I/Oメモリ102、I/O
イメージ領域103−C、送信バッファ103−S、シ
リアル伝送インタフェース回路140、およびシリアル
伝送バス110を介して、I/O部120のI/O装置
120−iに出力することにより、それらのI/O装置
120−iに接続される被制御装置を制御する。Then, the arithmetic unit 104 of the central control unit
A calculation is performed using the input data input to the I / O memory 102, and the calculation result is used as the I / O memory 102 and I / O memory.
By outputting to the I / O device 120-i of the I / O unit 120 via the image area 103-C, the transmission buffer 103-S, the serial transmission interface circuit 140, and the serial transmission bus 110, those I / O devices 120-i are output. The controlled device connected to the O device 120-i is controlled.
【0037】次に、図2に、上記送信バッファ103−
Sの出力データの構成及び受信バッファ103−Rの入
力データの構成を示す。同図に示すように、送信バッフ
ァ103−S及び受信バッファ103−Rには、装置番
号「j」、「k」、「m」の順に、I/O装置120−
iの入出力データが格納されている。Next, FIG. 2 shows the transmission buffer 103-
The structure of the output data of S and the structure of the input data of the receiving buffer 103-R are shown. As shown in the figure, the transmission buffer 103-S and the reception buffer 103-R have I / O devices 120- in order of device numbers "j", "k", and "m".
Input / output data of i is stored.
【0038】本例では、装置番号「k」のI/O装置1
20−iのデータ容量がシリアル伝送インタフェース回
路140の一度に送出し得る最大データ数を越えてい
る。なお、この例では、シリアル伝送インタフェース回
路140が一度に送出し得る最大データ数を255バイ
トとする。そして、装置番号「k」のI/O装置120
−iのデータ容量は、出力データ量が500バイト、入
力データ量が400バイトとする。また、この場合の出
力データ及び入力データの分割基準を220バイトとす
る。In this example, the I / O device 1 with the device number "k"
The data capacity of 20-i exceeds the maximum number of data that the serial transmission interface circuit 140 can send at one time. In this example, the maximum number of data that the serial transmission interface circuit 140 can send at one time is 255 bytes. Then, the I / O device 120 of the device number “k”
The data capacity of -i is such that the output data amount is 500 bytes and the input data amount is 400 bytes. Further, the division standard of the output data and the input data in this case is 220 bytes.
【0039】また、他の装置番号「j」及び「m」のI
/O装置120−i等のデータ容量は上記シリアル伝送
インタフェース回路140が一度に送出し得る最大デー
タ数の255バイトより少ないものとする。したがっ
て、これらのI/O装置120−iに対応する送受信バ
ッファ内における入出力データの構成は図6に示した通
常の送受信バッファにおける入出力データの構成と同様
である。Also, I of other device numbers "j" and "m"
The data capacity of the / O device 120-i and the like is smaller than the maximum data number of 255 bytes that the serial transmission interface circuit 140 can send at one time. Therefore, the structure of the input / output data in the transmission / reception buffer corresponding to these I / O devices 120-i is the same as the structure of the input / output data in the normal transmission / reception buffer shown in FIG.
【0040】以下、送信バッファ103−S及び受信バ
ッファ103−R内における装置番号「k」に対応する
入出力データの構成について説明する。図2に示すよう
に、OS105によって作成される送信バッファ103
−Sにおける装置番号「k」への出力データS1、S2
及びS3は、装置番号部と出力データ部間に、シーケン
シャル番号部とページ番号部が挿入されて構成される。
シーケンシャル番号部には、伝送順位を示す値、すなわ
ち、OS105によるシリアル伝送インタフェース回路
140への伝送司令毎に「1」インクリメントされた値
が書き込まれる。また、ページ番号部には、ページ番号
及び総ページ数が書き込まれる。The structure of input / output data corresponding to the device number "k" in the transmission buffer 103-S and the reception buffer 103-R will be described below. As shown in FIG. 2, the transmission buffer 103 created by the OS 105
Output data S1, S2 to device number "k" in -S
And S3 are configured by inserting a sequential number part and a page number part between the device number part and the output data part.
In the sequential number portion, a value indicating the transmission order, that is, a value incremented by "1" for each transmission command to the serial transmission interface circuit 140 by the OS 105 is written. The page number and the total number of pages are written in the page number section.
【0041】図3に、上記ページ番号部の構成を示す。
同図に示すように、ページ番号部30は、1バイト(8
ビット)から成り、上位桁4ビットがベージ番号、下位
桁4ビットが総ページ数を表す。FIG. 3 shows the structure of the page number section.
As shown in the figure, the page number part 30 has 1 byte (8
The upper digit 4 bits represent the page number, and the lower digit 4 bits represent the total number of pages.
【0042】総ページ数には、出力データと入力データ
のいずれか容量の大きい方のバイト数を220バイトで
割って得られる商、又は余りがある場合は商に「1」加
算した値が書き込まれる。本例においては、出力データ
(500バイト)の方が入力データ(400バイト)よ
りも大きいので、出力データバイト数÷220バイト、
すなわち500バイト÷220バイトの商「2」に、剰
余があるため「1」加算して得られる「3」が総ページ
数として書き込まれる。ページ番号には、端数を含む2
20バイト毎の区切り順位「1」、「2」、「3」が書
き込まれる。図2に示すページ番号部には、ページ番号
と総ページ数が「1/3」、「2/3」、「3/3」で
表されている。For the total number of pages, the quotient obtained by dividing the number of bytes of the output data or the input data, whichever has the larger capacity, by 220 bytes, or if there is a remainder, add "1" to the quotient and write it. Be done. In this example, since the output data (500 bytes) is larger than the input data (400 bytes), the number of output data bytes divided by 220 bytes,
That is, since there is a remainder in the quotient “2” of 500 bytes ÷ 220 bytes, “3” obtained by adding “1” is written as the total number of pages. Page numbers include fractions 2
Delimiter ranks "1", "2", and "3" for each 20 bytes are written. In the page number portion shown in FIG. 2, the page number and the total number of pages are represented by "1/3", "2/3", and "3/3".
【0043】そして、同図に示すように、受信バッファ
103−Rにおける装置番号「k」からの入力データR
1、R2及びR3も、同様に装置番号部と出力データ部
間に、シーケンシャル番号部とページ番号部が挿入され
て構成される。本例では、入力データは、400バイト
であるため、2ページ目で入力データが終了しており、
最終ページである「3/3」ページの入力データの構成
には入力データ部は存在しない。Then, as shown in the figure, the input data R from the device number "k" in the reception buffer 103-R.
Similarly, 1, R2 and R3 are also configured by inserting a sequential number part and a page number part between the device number part and the output data part. In this example, since the input data is 400 bytes, the input data ends at the second page,
There is no input data part in the structure of the input data of the last page “3/3” page.
【0044】次に、上記構成の中央制御部による制御の
動作を再び図1を用いて説明する。同図において、OS
105は、演算部104の演算周期に同期して、I/O
装置120−iへ送出する出力データをI/Oメモリ1
02からI/Oイメージ領域103−Cへ転送する。こ
のとき、OS105は、I/Oデータ交換テーブル11
0に格納されている出力データ用相対アドレスを読み出
し、その読み出した相対アドレスを、I/Oメモリ10
2の読み出し先頭アドレスに加算してI/Oメモリ10
2の出力データのアドレスを算出する。Next, the control operation by the central control unit having the above configuration will be described again with reference to FIG. In the figure, the OS
Reference numeral 105 denotes an I / O in synchronization with a calculation cycle of the calculation unit 104.
Output data to be sent to the device 120-i is I / O memory 1
02 to the I / O image area 103-C. At this time, the OS 105 uses the I / O data exchange table 11
The output data relative address stored in 0 is read, and the read relative address is read out from the I / O memory 10
I / O memory 10
The address of the output data of 2 is calculated.
【0045】また、OS105は、一定周期で、シリア
ル伝送インタフェース回路140へ伝送司令を行ってい
る。そして、この伝送司令を行う直前に、OS105
は、送信バッファ103−Sに出力する出力データの作
成準備を開始する。Further, the OS 105 sends a command to the serial transmission interface circuit 140 at regular intervals. Immediately before executing this transmission command, the OS 105
Starts preparation for creating output data to be output to the transmission buffer 103-S.
【0046】このとき、I/Oメモリ102からI/O
イメージ領域103−Cへ出力データを転送したことを
示すフラグ領域106がオフ(「0」)になっている場
合は、送信バッファ103−Sの更新を行わないまま、
シリアル伝送インタフェース回路140へ伝送司令を行
う。したがって、シリアル伝送インタフェース回路14
0は、前回の周期ですでに作成されている送信バッファ
103−Sの内容を、シリアル伝送バス110を介して
I/O部120のI/O装置120−iに送出する。At this time, I / O from the I / O memory 102 is changed.
When the flag area 106 indicating that the output data has been transferred to the image area 103-C is off (“0”), the transmission buffer 103-S is not updated,
It transmits a command to the serial transmission interface circuit 140. Therefore, the serial transmission interface circuit 14
0 sends the contents of the transmission buffer 103-S already created in the previous cycle to the I / O device 120-i of the I / O unit 120 via the serial transmission bus 110.
【0047】一方、上記フラグ領域106がオン
(「1」)になっている場合には、I/Oイメージ領域
103−Cのデータを送信バッファ103−Sの出力デ
ータ領域へ転送してから、シリアル伝送インタフェース
回路140へ伝送司令を行う。したがって、この場合
は、シリアル伝送インタフェース回路140は、送信バ
ッファ103−Sの更新された新規の出力データを送出
する。On the other hand, when the flag area 106 is on ("1"), the data of the I / O image area 103-C is transferred to the output data area of the transmission buffer 103-S, It transmits a command to the serial transmission interface circuit 140. Therefore, in this case, the serial transmission interface circuit 140 sends out the updated new output data of the transmission buffer 103-S.
【0048】上記OS105は、一方では、上述した出
力データの送出を行い、他方では、前回の処理周期(以
下、単に前回周期の称する)でI/O装置120−iか
ら伝送されてすでに受信バッファ103−R−Xに格納
されている入力データをI/Oメモリ102へ転送す
る。On the one hand, the OS 105 sends out the above-mentioned output data, and on the other hand, the OS 105 transmits the output data in the previous processing cycle (hereinafter, simply referred to as the previous cycle) and has already received the reception buffer. The input data stored in 103-R-X is transferred to the I / O memory 102.
【0049】このとき、OS105は、転送ポインタ領
域107に格納されている受信バッファの先頭アドレス
(例えば「X」)と、I/Oデータ交換テーブル110
に格納されている入力データ用相対アドレス(例えば
「i」)をそれぞれを読み出し、それら読み出した先頭
アドレス「X」に相対アドレス「i」を加算して、I/
Oメモリ102へ転送すべき入力データを格納している
受信バッファア103−R−Xのアドレス「X+i」を
算出する。At this time, the OS 105 stores the start address (eg, “X”) of the reception buffer stored in the transfer pointer area 107 and the I / O data exchange table 110.
Each of the input data relative addresses (for example, “i”) stored in is read, and the relative address “i” is added to the read start address “X” to obtain I /
The address "X + i" of the reception buffer 103-R-X storing the input data to be transferred to the O memory 102 is calculated.
【0050】また、OS105は、今回の周期でI/O
装置120−iから伝送されてくる入力データを、受信
バッファ103−R−Yに格納する。このとき、OS1
05は、書込ポインタ領域108に格納されている受信
バッファの先頭アドレス(例えば「Y」)と、I/Oデ
ータ交換テーブル110に格納されている入力データ用
相対アドレス「i」をそれぞれを読み出し、それら読み
出した先頭アドレス「Y」に相対アドレス「i」を加算
して、入力データを書き込むべき受信バッファア103
−R−Yのアドレス「Y+i」を算出する。The OS 105 also executes I / O at this cycle.
The input data transmitted from the device 120-i is stored in the reception buffer 103-RY. At this time, OS1
05 reads the start address (for example, “Y”) of the reception buffer stored in the write pointer area 108 and the input data relative address “i” stored in the I / O data exchange table 110. , The relative address “i” is added to the read head address “Y”, and the input buffer is to receive the input buffer 103.
The address "Y + i" of -RY is calculated.
【0051】このように、一方では、前回周期の入力デ
ータをI/Oメモリ102に格納し、他方では今回周期
の出力データを送出すると共に今回周期の入力データを
受信する。Thus, on the one hand, the input data of the previous cycle is stored in the I / O memory 102, and on the other hand, the output data of the current cycle is sent out and the input data of the current cycle is received.
【0052】そして、OS105は、シリアル伝送イン
タフェース回路140から伝送完了を通知されると、今
回周期の伝送状態をチェックする。そして、図2に示す
受信バッファ103−R内の統括伝送結果部が正常であ
れば、さらにデータ容量の大きな装置番号「k」の入力
データをチェックする。このチェック処理は、受信バッ
ファ103−R内の装置番号部の装置番号「k」に基づ
いて、I/Oデータ交換テーブル110内のシーケンシ
ャル番号部相対アドレスにより、装置番号「k」の出力
データと入力データを対応させ、受信バッファ103−
Rの入力データの各ページR1、R2及びR3のシーケ
ンシャル番号が送信時の出力データのページS1、S2
及びS3のシーケンシャル番号とそれぞれ同一であるか
否か、及び各ページS1、S2及びS3のページ番号部
がページ順に書き込まれているか否かを判別する処理で
ある。When the transmission completion is notified from the serial transmission interface circuit 140, the OS 105 checks the transmission state of this cycle. Then, if the integrated transmission result portion in the reception buffer 103-R shown in FIG. 2 is normal, the input data of the device number "k" having a larger data capacity is checked. This check processing is based on the device number “k” of the device number part in the reception buffer 103-R and the output data of the device number “k” by the relative address of the sequential number part in the I / O data exchange table 110. Corresponding input data, receiving buffer 103-
R input data pages R1, R2, and R3 sequential number output data pages S1 and S2 at the time of transmission
And S3 are the same as the sequential numbers, and whether the page number portion of each page S1, S2 and S3 is written in the page order.
【0053】そのチェック結果に異常が無ければ、上記
転送ポインタ領域107に格納されている内容と書込ポ
インタ領域108に格納されている内容とを交換する。
すなわち、この結果、転送ポインタ領域107には先頭
アドレス「Y」か格納され、書込ポインタ領域108に
は先頭アドレス「X」が格納される。If there is no abnormality in the check result, the contents stored in the transfer pointer area 107 and the contents stored in the write pointer area 108 are exchanged.
That is, as a result, the start address “Y” is stored in the transfer pointer area 107, and the start address “X” is stored in the write pointer area 108.
【0054】したがって、次回周期においては、転送ポ
インタ領域107の先頭アドレス「Y」によって指定さ
れることにより受信バッファ103−R−Yが転送用の
受信バッファとなり、その受信バッファ103−R−Y
に今回周期で書き込まれている最新の入力データがI/
Oメモリ102に転送される。これにより、I/Oメモ
リ102に最新入力データが得られる。Therefore, in the next cycle, the reception buffer 103-RY becomes the reception buffer for transfer by being designated by the start address "Y" of the transfer pointer area 107, and the reception buffer 103-RY
The latest input data written in this cycle is I /
It is transferred to the O memory 102. As a result, the latest input data can be obtained in the I / O memory 102.
【0055】一方、受信バッファ103−R−Xでは、
今回周期で入力データの転送を終了しており、その受信
バッファ103−R−Xが次回周期において書込ポイン
タ領域107の先頭アドレス「X」によって指定される
ことにより次回周期では書き込み用の受信バッファとな
り、I/O装置120−iから入力される新たな入力デ
ータが受信バッファ103−R−Xに書き込まれる。On the other hand, in the reception buffer 103-R-X,
The transfer of the input data is completed in the current cycle, and the reception buffer 103-R-X is designated by the start address “X” of the write pointer area 107 in the next cycle, so that the reception buffer for writing in the next cycle. Then, new input data input from the I / O device 120-i is written in the reception buffer 103-R-X.
【0056】このように、入力データについては、処理
周期毎に転送ポインタ領域107に格納されていた先頭
アドレスと書込ポインタ領域108に格納されていた先
頭アドレスとを交換するだけで、I/Oメモリ102
は、I/Oイメージ領域103−Cを介することなく、
受信バッファから直接入力データを読み出すことができ
る。As described above, with respect to the input data, the I / O can be performed by simply exchanging the start address stored in the transfer pointer area 107 and the start address stored in the write pointer area 108 for each processing cycle. Memory 102
Without passing through the I / O image area 103-C,
Input data can be read directly from the receive buffer.
【0057】上述した処理における受信バッファ103
−Rの入力データの構成は、送信バッファ103−Sか
らの送信に対して、各I/O装置120−iが正常に応
答した場合の構成例である。Reception buffer 103 in the above processing
The configuration of the input data of -R is a configuration example when each I / O device 120-i normally responds to the transmission from the transmission buffer 103-S.
【0058】次に、図4に、伝送結果が異常であった場
合の入力データの一例を示す。同図の例では、今回周期
で、受信バッファ103−R−Xに受信した装置番号
「j」の入力データが異常であり、また、装置番号
「k」の入力データのページ番号部が、本来「1/
3」、「2/3」及び「3/3」である入力データを受
信すべきところ、「1/3」、「1/3」及び「3/
3」と受信した場合を示している。Next, FIG. 4 shows an example of input data when the transmission result is abnormal. In the example of the figure, in the current cycle, the input data of the device number “j” received in the reception buffer 103-R-X is abnormal, and the page number part of the input data of the device number “k” is originally "1 /
Where input data that is "3", "2/3" and "3/3" should be received, "1/3", "1/3" and "3 /"
3 ”is received.
【0059】受信バッファ103−R−Xは、今回周期
では、書き込み用の受信バッファとなっていたものであ
り、書込ポインタ領域108には現在「X」が格納され
ている。したがって、転送ポインタ領域107には
「Y」が格納されている。つまり、受信バッファ103
−R−Yは、今回周期では、転送ポインタ領域107の
「Y」によって指定されていたものであり、転送用の受
信バッファになっている。すなわち、受信バッファ10
3−R−Yは、前回周期で書き込まれた入力データがチ
ェックによる判別で全て正常であったことから、ポイン
タの先頭アドレスの交換が行われて前回周期の書き込み
用受信バッファから今回周期の転送用受信バッファにな
っている。The reception buffer 103-R-X has been a reception buffer for writing in this cycle, and "X" is currently stored in the write pointer area 108. Therefore, “Y” is stored in the transfer pointer area 107. That is, the reception buffer 103
-RY is designated by "Y" in the transfer pointer area 107 in this cycle, and serves as a reception buffer for transfer. That is, the reception buffer 10
In 3-RY, since the input data written in the previous cycle was all normal as determined by the check, the start address of the pointer was exchanged and the write buffer in the previous cycle transferred this cycle. It is a receive buffer for
【0060】続いて、このように、入力データに異常が
あった場合の処理について説明する。まず、同図に示す
装置番号“j”と“k”の異常である入力データについ
ては、転送ポインタ領域107の先頭アドレス「Y」で
指定されている今回周期の転送用受信バッファ103−
R−Yの入力データ部のデータ、すなわち前回周期の正
常な入力データを、編集ポインタ領域109の先頭アド
レス(例えば「Z」)で指定される編集用の受信バッフ
ァ103−R(本例では103−R−Z)に、I/Oデ
ータ交換テーブル110内の相対アドレスに基づいてコ
ピーする。Next, the processing when there is an abnormality in the input data will be described. First, regarding the input data having the abnormal device numbers “j” and “k” shown in the figure, the reception buffer for transfer 103-of the current cycle designated by the start address “Y” of the transfer pointer area 107
The data of the input data portion of RY, that is, the normal input data of the previous cycle, is set to the edit receiving buffer 103-R (103 in this example) designated by the start address (for example, “Z”) of the edit pointer area 109. -R-Z) based on the relative address in the I / O data exchange table 110.
【0061】次に、正常に伝送が行われた装置番号
“m”の入力データについては、書込ポインタ領域10
7の先頭アドレス「X」で指定される今回周期の書込用
受信バッファ103−R−Xの入力データ部のデータ、
すなわち今回周期の正常な入力データを、これも編集ポ
インタ領域109の先頭アドレス「Z」で指定される編
集用の受信バッファ103−R−Zに、I/Oデータ交
換テーブル110内の相対アドレスに基づいてコピーす
る。Next, for the input data of the device number "m" which has been normally transmitted, the write pointer area 10
7, the data of the input data portion of the write reception buffer 103-R-X for the current cycle designated by the start address “X” of 7;
That is, the normal input data of the current cycle is transferred to the edit receive buffer 103-R-Z, which is also designated by the start address “Z” of the edit pointer area 109, and to the relative address in the I / O data exchange table 110. Copy based.
【0062】この結果、編集用の受信バッファ103−
R−Zには、伝送が異常であった装置番号“j”と
“k”の入力データについては、異常となる直前の最新
入力データが書き込まれ、伝送が正常であった装置番号
“m”の入力データについては、最新入力データが書き
込まれる。As a result, the edit receiving buffer 103-
Regarding the input data of the device numbers “j” and “k”, which have been transmitted abnormally, the latest input data immediately before the abnormality is written in the RZ, and the device number “m” which was transmitted normally. For the input data of, the latest input data is written.
【0063】この後、転送ポインタ領域107の先頭ア
ドレス「Y」と、編集ポインタ領域109の先頭アドレ
ス「Z」を交換して、転送ポインタ領域107に先頭ア
ドレス「Z」を設定することにより、上述した装置番号
“j”と“k”の入力データについては、異常となる直
前の最新入力データ、伝送が正常であった装置番号
“m”の入力データについては、最新入力データが、演
算部104に得られる。Thereafter, the start address "Y" of the transfer pointer area 107 and the start address "Z" of the edit pointer area 109 are exchanged, and the start address "Z" is set in the transfer pointer area 107. For the input data of the device numbers “j” and “k”, the latest input data immediately before the abnormality occurs, and for the input data of the device number “m” that was normally transmitted, the latest input data is the arithmetic unit 104. Can be obtained.
【0064】[0064]
【発明の効果】以上詳述したように、本発明によれば、
入出力容量がシリアル伝送インタフェース回路の一度に
送出し得る最大データ数の範囲を越えるI/O装置のデ
ータを分割して伝送でき、ページ番号とシーケンシャル
番号をチェックするのみで、分割された入力データと出
力データの同時性が確実に保証されるので、中央制御部
のI/Oメモリ容量の範囲内であれば、被制御装置に対
応する小容量から大容量までの各種I/O装置を、何ら
の制約を受けることなく容易に設計に取り入れることが
可能となり、したがって、PCの運用効率が向上する。As described in detail above, according to the present invention,
It is possible to divide and transmit the data of the I / O device whose input / output capacity exceeds the maximum data number range that can be sent at one time of the serial transmission interface circuit. Only by checking the page number and sequential number, the divided input data can be divided. Since the simultaneity of the output data and the output data is surely guaranteed, various I / O devices ranging from small capacity to large capacity corresponding to the controlled device can be used within the range of the I / O memory capacity of the central control unit. It can be easily incorporated into the design without any restrictions, and thus the operational efficiency of the PC is improved.
【0065】また、入力データを受信バッファからI/
Oイメージ領域へ転送する必要が無く、出力データのみ
I/Oイメージ領域へ一時的に転送すればよいので、中
央制御部のオーバヘッドを大幅に削減でき、したがっ
て、他のOS処理、例えば、中央制御部内のシーケンス
プログラムの読みだし等のマンマシンインタフェースが
高速に行なえるようになり、PCの運用効率がさらに向
上する。In addition, input data from the reception buffer is I / O
Since it is not necessary to transfer to the O image area and only the output data needs to be temporarily transferred to the I / O image area, the overhead of the central control unit can be greatly reduced, and therefore, other OS processing, for example, central control can be performed. The man-machine interface such as reading out the sequence program in the department can be performed at high speed, and the operation efficiency of the PC is further improved.
【図1】本発明の入出力データ交換方式を説明するブロ
ック図である。FIG. 1 is a block diagram illustrating an input / output data exchange system of the present invention.
【図2】本発明の入出力データ交換方式における入出力
データの構成を示す図である。FIG. 2 is a diagram showing a structure of input / output data in the input / output data exchange system of the present invention.
【図3】一度に伝送可能な最大データ数を越える伝送デ
ータに設けられるページ番号部の構成を示す図である。FIG. 3 is a diagram showing a configuration of a page number section provided for transmission data that exceeds the maximum number of data that can be transmitted at one time.
【図4】本発明における受信データ異常時の処理を説明
する図である。FIG. 4 is a diagram illustrating a process when the received data is abnormal according to the present invention.
【図5】従来のプログラマブルコントローラの構成を示
す図である。FIG. 5 is a diagram showing a configuration of a conventional programmable controller.
【図6】従来のプログラマブルコントローラの入出力デ
ータ交換方法を説明する図である。FIG. 6 is a diagram illustrating a conventional input / output data exchange method of a programmable controller.
104 演算部 102 I/Oメモリ 103−C I/Oイメージメモリ 103−S 送信バッファ 103−R−X、103−R−Y、103−R−Z 受
信バッファ 105 OS 106 フラグ領域 107 転送ポインタ領域 108 書込ポインタ領域 109 編集ポインタ領域 110 I/Oデータ変換テーブル 30 ページ番号部 S1,S2,S3 分割出力デー
タのページ R1,R2,R3 分割入力データのページ104 arithmetic unit 102 I / O memory 103-C I / O image memory 103-S transmission buffer 103-R-X, 103-RY, 103-RZ reception buffer 105 OS 106 flag area 107 transfer pointer area 108 Write pointer area 109 Edit pointer area 110 I / O data conversion table 30 Page number section S1, S2, S3 Page of divided output data R1, R2, R3 Page of divided input data
Claims (2)
れぞれ装置番号を有する複数のI/O部とをシリアル伝
送バスにより接続して構成されるプログラマブルコント
ローラの入出力データ交換方式において、 前記演算される入出力データを格納するI/Oメモリ
と、 該I/Oメモリと前記複数のI/O部間における入出力
データの伝送を前記シリアル伝送バスを介して仲介する
シリアル伝送インタフェース回路と、 該シリアル伝送インタフェース回路と前記I/Oメモリ
間に接続され、前記シリアル伝送インタフェース回路を
介して前記I/Oメモリと前記複数のI/O部間におい
て行われる入出力データの伝送結果が全て正常であるか
否かを示す総括伝送結果及び前記複数のI/O部からの
入力データを格納する3個の受信バッファと、 前記複数のI/O部からの入力データを前記I/Oメモ
リにより読み出される前記受信バッファの先頭アドレス
を示す第1のポインタと、 前記複数のI/O部からの入力データを前記シリアル伝
送インタフェース回路により書き込まれる前記受信バッ
ファの先頭アドレスを示す第2のポインタと、 前記総括伝送結果が異常であったとき前記複数のI/O
部の入力データを編集する前記受信バッファの先頭アド
レスを示す第3のポインタと、 前記複数のI/O部に対応する前記受信バッファの相対
アドレス及び前記I/Oメモリの相対アドレス並びに入
出力データ容量を記憶するI/Oデータ交換テーブル
と、 前記シリアル伝送インタフェース回路に接続され、前記
I/Oメモリの出力データを前記シリアル伝送インタフ
ェース回路に出力する送信バッファと、 該送信バッファにより出力されるべき出力データを一時
的に格納する出力イメージ領域と、 前記出力イメージ領域に格納された出力データが前記送
信バッファへ出力されたか否かを示すフラグ領域と、 を備えたことを特徴とする入出力データ交換方式。1. An input / output data exchange system of a programmable controller configured by connecting a central control unit for calculating input / output data and a plurality of I / O units each having a device number by a serial transmission bus. An I / O memory for storing the input / output data, and a serial transmission interface circuit that mediates the transmission of the input / output data between the I / O memory and the plurality of I / O units via the serial transmission bus, The result of transmission of input / output data connected between the serial transmission interface circuit and the I / O memory and between the I / O memory and the plurality of I / O units via the serial transmission interface circuit is all normal. And three reception buffers storing the overall transmission result indicating whether or not the input data from the plurality of I / O units, A first pointer indicating the start address of the reception buffer for reading the input data from the plurality of I / O units by the I / O memory, and the input data from the plurality of I / O units by the serial transmission interface. A second pointer indicating the start address of the reception buffer written by a circuit, and the plurality of I / Os when the general transmission result is abnormal.
A third pointer indicating the start address of the reception buffer for editing the input data of the copy, the relative address of the reception buffer and the relative address of the I / O memory, and the input / output data corresponding to the plurality of I / O parts An I / O data exchange table for storing the capacity, a transmission buffer connected to the serial transmission interface circuit and outputting the output data of the I / O memory to the serial transmission interface circuit, and the data should be output by the transmission buffer. Input / output data, comprising: an output image area for temporarily storing output data; and a flag area indicating whether or not the output data stored in the output image area is output to the transmission buffer. Exchange method.
一度に送出し得る最大データ数を越える容量を有する前
記複数のI/O部の入出力データに対して、伝送データ
の伝送順序を示すシーケンシャル番号及び伝送データの
分割順序を示すページ番号のデータを付与し、且つそれ
らシーケンシャル番号及びページ番号のデータを格納す
る前記3個の受信バッファの相対アドレステーブルを備
え、それらのページ順に、前記シリアル伝送インタフェ
ース回路により仲介される前記送信バッファからの出力
データの伝送及び前記複数のI/O部からの入力データ
の伝送を交互に行うことを特徴とする請求項1記載の入
出力データ交換方式。2. A sequential number indicating the transmission order of transmission data and transmission for input / output data of the plurality of I / O units having a capacity exceeding the maximum number of data that can be transmitted at one time by the serial transmission interface circuit. The relative address table of the three receiving buffers, which gives the data of the page number indicating the division order of the data and stores the data of the sequential number and the page number, is provided by the serial transmission interface circuit in the order of the pages. 2. The input / output data exchange system according to claim 1, wherein the transmission of output data from the transmission buffer and the transmission of input data from the plurality of I / O units are alternately performed via the mediation.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP00648193A JP3265026B2 (en) | 1993-01-19 | 1993-01-19 | Input/Output Data Exchange Method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP00648193A JP3265026B2 (en) | 1993-01-19 | 1993-01-19 | Input/Output Data Exchange Method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH06214620A true JPH06214620A (en) | 1994-08-05 |
| JP3265026B2 JP3265026B2 (en) | 2002-03-11 |
Family
ID=11639671
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP00648193A Expired - Fee Related JP3265026B2 (en) | 1993-01-19 | 1993-01-19 | Input/Output Data Exchange Method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3265026B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2011215821A (en) * | 2010-03-31 | 2011-10-27 | Keyence Corp | Programmable controller, data communication method and computer program |
-
1993
- 1993-01-19 JP JP00648193A patent/JP3265026B2/en not_active Expired - Fee Related
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2011215821A (en) * | 2010-03-31 | 2011-10-27 | Keyence Corp | Programmable controller, data communication method and computer program |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3265026B2 (en) | 2002-03-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3645281B2 (en) | Multiprocessor system having shared memory | |
| US5031091A (en) | Channel control system having device control block and corresponding device control word with channel command part and I/O command part | |
| CA1233264A (en) | Data processor having dynamic bus sizing | |
| EP0451516B1 (en) | Improved SCSI device in a small computer system | |
| JPH01502708A (en) | Information transmission methods and devices | |
| US5640602A (en) | Transferring digital data in units of 2 bytes to increase utilization of a 2-byte-wide bus | |
| US4417303A (en) | Multi-processor data communication bus structure | |
| EP0125044B1 (en) | Microcomputer with interprocess communication | |
| JPH0217818B2 (en) | ||
| US7035956B2 (en) | Transmission control circuit, reception control circuit, communications control circuit, and communications control unit | |
| US6108755A (en) | Asynchronous access system to a shared storage | |
| JP3265026B2 (en) | Input/Output Data Exchange Method | |
| JPH06274463A (en) | Data communication system | |
| JP3399776B2 (en) | Computer and method for transferring peripheral device control data in computer | |
| JP3293838B2 (en) | Data transfer method | |
| JP2000172307A (en) | Method of updating process data collection device | |
| JP2002341907A (en) | Data transmission and reception method in blast furnace equipment program logic controller | |
| JP2821053B2 (en) | Network system | |
| JPH09307574A (en) | Network system for redundant controller | |
| JP3077992B2 (en) | Data transmission equipment | |
| JPH11122275A (en) | Serial communication system | |
| RU1807495C (en) | Process-to-process interface | |
| JP3127939B2 (en) | Event information transmission device | |
| JPH10320345A (en) | Bus controller | |
| JPH1029477A (en) | Electronic control device and control method thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20011218 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20071228 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081228 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081228 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091228 Year of fee payment: 8 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313117 |
|
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091228 Year of fee payment: 8 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| LAPS | Cancellation because of no payment of annual fees |