JP2000004243A - Data communication method for programmable controller and programmable controller - Google Patents

Data communication method for programmable controller and programmable controller

Info

Publication number
JP2000004243A
JP2000004243A JP10166924A JP16692498A JP2000004243A JP 2000004243 A JP2000004243 A JP 2000004243A JP 10166924 A JP10166924 A JP 10166924A JP 16692498 A JP16692498 A JP 16692498A JP 2000004243 A JP2000004243 A JP 2000004243A
Authority
JP
Japan
Prior art keywords
sequence
data
scan
data link
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP10166924A
Other languages
Japanese (ja)
Inventor
Akihiro Suzuki
章弘 鈴木
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 JP10166924A priority Critical patent/JP2000004243A/en
Publication of JP2000004243A publication Critical patent/JP2000004243A/en
Pending legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)
  • Small-Scale Networks (AREA)

Abstract

PROBLEM TO BE SOLVED: To shorten time for transmitting the data of an own station to an other station by shortening a data link scan time. SOLUTION: A 2-port RAM 20e is provided with an area for storing the number of times of last time sequence scan at present and the number of times of last time data link scan at present. For every time when the one sequence scan is finished, a sequence control part 30 increments the number of times of sequence scan at present and after the end of the one sequence scan, only on the condition of (number of times of data link scan at present) > (number of times of last time data link scan), link refresh is performed so that the number of times of last time data link scan is updated. For every time when one data link scan is finished, a data communication control part 20 increments the number of times of data link scan at present and after the end of the one data link scan, only on the condition of (number of times of sequence scan at present) > (number of times of last time sequence scan), the data of an own station are transmitted to an other station and updated the data to the number of times of last time sequence scan.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、プログラマブル
コントローラのデータ通信方法およびプログラマブルコ
ントローラに関し、特に、各種制御に用いられるプログ
ラマブルコントローラによるライン制御やプラント制御
といった分散制御を実現するためのプログラマブルコン
トローラのデータ通信方法およびプログラマブルコント
ローラに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data communication method for a programmable controller and a programmable controller, and more particularly, to a data communication of a programmable controller for realizing distributed control such as line control and plant control by a programmable controller used for various controls. A method and a programmable controller.

【0002】[0002]

【従来の技術】図6は、データ通信機能を持つプログラ
マブルコントローラ(以下、PCと略称することがあ
る)のハードウェア構成を示している。
2. Description of the Related Art FIG. 6 shows a hardware configuration of a programmable controller (hereinafter sometimes abbreviated as PC) having a data communication function.

【0003】PC1局〜PCn局は各PC間の通信を実
行するための通信ケーブル50によって接続されてい
る。各PC(PC1、PC2………PCn)100は、
データリンクを制御するデータ通信制御部110と、シ
ーケンスプログラムの実行および接続される制御機器へ
の入出力部(図示省略)を制御するシーケンス制御部1
20とを有している。
The PC1 to PCn stations are connected by a communication cable 50 for executing communication between the PCs. Each PC (PC1, PC2... PCn) 100
A data communication control unit 110 for controlling a data link; and a sequence control unit 1 for controlling execution of a sequence program and an input / output unit (not shown) to a connected control device.
20.

【0004】データ通信制御部110は、通信制御を行
うためのCPU110aと、通信を実行するためのバス
を制御するシリアルコントロールバス110bと、通信
制御用のシステムプログラム等のソフトウェアを格納す
るROM110cと、通信制御により回線から受信した
リンクデータや回線へ送信するリンクデータ等を格納す
るRAM110dと、シーケンス制御部120とのイン
タフェースのための2ポートRAM110eとから構成
される。
The data communication control unit 110 includes a CPU 110a for performing communication control, a serial control bus 110b for controlling a bus for executing communication, a ROM 110c for storing software such as a communication control system program, and the like. It is composed of a RAM 110d for storing link data received from the line under the communication control and link data to be transmitted to the line, and a two-port RAM 110e for interfacing with the sequence control unit 120.

【0005】シーケンス制御部120は、シーケンス制
御用のCPU120aと、シーケンス制御用のシステム
プログラム等のソフトウェアを格納するROM120b
と、シーケンスプログラムでの演算結果やその他の情報
を一時的に格納するRAM120cと、入出力のON/
OFF情報を交換するための入出力インターフェース1
20dと、シーケンスプログラムを格納するメモリ12
0eとから構成される。
[0005] The sequence control unit 120 includes a CPU 120a for sequence control and a ROM 120b for storing software such as a system program for sequence control.
A RAM 120c for temporarily storing the operation results and other information in the sequence program,
Input / output interface 1 for exchanging OFF information
20d and a memory 12 for storing a sequence program
0e.

【0006】図7は、図6に示されているように、PC
(PC1、PC2………PCn)を複数台接続すること
によってシステム構成され、トークンパッシング方式を
利用したローカルエリアネットワークにおいて、各ステ
ーション(各局のPC)のデータ通信制御部110が行
う送信処理フローを示している。
[0006] FIG. 7 shows a PC, as shown in FIG.
(PCn, PC2,..., PCn) are connected to each other, and the transmission processing flow performed by the data communication control unit 110 of each station (PC of each station) in the local area network using the token passing method. Is shown.

【0007】まず各ステーションは、シーケンスプログ
ラムのシーケンススキャンが終了したか否か判断する
(ステップS100)。シーケンススキャン処理が終了
している場合には(ステップS100肯定)、リフレッ
シュ要求により、2ポートRAM110e経由で各ステ
ーションから受信したデータの2ポートRAM110e
からの読み出しと、シーケンスプログラムに基づいた各
ステーションのデータと他ステーションに送信するデー
タをシーケンス制御部120から2ポートRAM110
eに書き込むというリンクリフレッシュ処理を行う(ス
テップS101)。なお、リフレッシュ要求とは、シー
ケンス制御部120のCPU120aがRAM120c
内のデータを他のステーションから受信したデータに書
き換えることを要求する命令のことである。
First, each station determines whether or not the sequence scan of the sequence program has been completed (step S100). If the sequence scan processing has been completed (Yes at Step S100), the two-port RAM 110e of the data received from each station via the two-port RAM 110e in response to the refresh request.
, And data of each station and data to be transmitted to other stations based on the sequence program are sent from the sequence control unit 120 to the two-port RAM 110.
Then, a link refresh process of writing to e is performed (step S101). Note that the refresh request means that the CPU 120a of the sequence control unit 120
Is a command for requesting that the data in the inside be rewritten with data received from another station.

【0008】リンクリフレッシュ処理が完了すると、つ
ぎに、自ステーションが他ステーションからトークンを
取得したか判断する(ステップS102)。なお、シー
ケンススキャン処理が終了していない場合には(ステッ
プS100否定)、リンクリフレッシュ処理を行わず、
直ちにトークン取得の判断(ステップS102)を行
う。
When the link refresh processing is completed, it is next determined whether or not the own station has obtained a token from another station (step S102). If the sequence scan processing has not been completed (No at Step S100), the link refresh processing is not performed.
Immediately, the token acquisition is determined (step S102).

【0009】トークンを取得していない場合には(ステ
ップS102否定)、ステップS100に戻り、リフレ
ッシュ要求があるかのチェックを行う処理をする。これ
に対し、トークンを取得している場合には(ステップS
102肯定)、他ステーションに送信するデータを2ポ
ートRAM110eから、シリアルコントロールバス1
10bの送信バッファに転送し(ステップS103)、
他ステーションにデータとトークンを送信する(ステッ
プS104)。送信が完了すれば、ステップS100に
戻り、上述の処理を繰り返す。
If the token has not been obtained (No at Step S102), the process returns to Step S100 to check whether there is a refresh request. On the other hand, if the token has been acquired (step S
102)), the data to be transmitted to the other station is transferred from the 2-port RAM 110e to the serial control bus 1
10b (step S103).
The data and the token are transmitted to another station (step S104). When the transmission is completed, the process returns to step S100, and the above processing is repeated.

【0010】この種の伝送方式に関しては、図7に示さ
れているように、シーケンス制御部120がシーケンス
スキャン毎に、2ポートRAM110eとRAM120
cのデータの授受を行い、データリンクスキャン毎に自
ステーションの2ポートRAM110eの格納データを
他ステーションに対して送信する方式以外に、特開平5
−14365号公報に示されているようなものがある。
この公報に示されているスキャン伝送方法では、格納デ
ータをブロックに区切り、ブロック毎に特定ビットを設
け、特定ビットが格納データの書き換えなどによって変
化が生じた場合にのみ格納データを他ステーションに対
して送信するものである。
As for this type of transmission system, as shown in FIG. 7, the sequence controller 120 controls the two-port RAM 110e and the RAM 120e for each sequence scan.
c, transmitting and receiving the data stored in the 2-port RAM 110e of the own station to another station every data link scan.
No. 14,365, as disclosed.
In the scan transmission method disclosed in this publication, the stored data is divided into blocks, specific bits are provided for each block, and the stored data is transmitted to other stations only when the specific bits change due to rewriting of the stored data or the like. Is transmitted.

【0011】[0011]

【発明が解決しようとする課題】図7に示されているデ
ータ通信方法では、シーケンススキャン終了後のエンド
処理時にデータリンクリフレッシュを行い、シーケンス
スキャン中にトークンを受信して、自ステーションの格
納データを他ステーションに対して送信しているため、
データに変化がなかった場合でも定期的にデータをリフ
レッシュしてデータを送信することになり、CPUの負
担、回線の負荷が増え、効率のよいデータ通信を行うこ
とができない。
In the data communication method shown in FIG. 7, the data link refresh is performed at the end processing after the end of the sequence scan, the token is received during the sequence scan, and the data stored in the own station is stored. Is sent to other stations,
Even when there is no change in the data, the data is periodically refreshed and transmitted, so that the load on the CPU and the load on the line increase, and efficient data communication cannot be performed.

【0012】特開平5−14365号公報に示されてい
るスキャン伝送方法では、自ステーションの格納データ
の各ブロック毎に設けられた特定ビットがデータの変化
を示した場合にのみ、すなわち自ステーション情報に変
化が生じた場合にのみ、自ステーション情報を他ステー
ションに対して送信しているが、シーケンス制御部はデ
ータ通信制御部が他ステーション情報を更新したか否か
を判別することなく、他ステーション情報をシーケンス
スキャン終了毎にリフレッシュしている。すなわち、シ
ーケンス制御部とデータ通信制御部との間のリフレッシ
ュはデータの変化が無くても定期的にリフレッシュを行
うことになり、その分CPUに負荷がかかるという問題
点がある。
In the scan transmission method disclosed in Japanese Patent Application Laid-Open No. 5-14365, only when a specific bit provided for each block of data stored in the own station indicates a change in data, that is, the local station information Only when the change has occurred, the own station information is transmitted to the other station, but the sequence controller does not determine whether the data communication controller has updated the other station information. The information is refreshed every time the sequence scan is completed. That is, refreshing between the sequence control unit and the data communication control unit is performed periodically even if there is no change in data, and there is a problem that a load is applied to the CPU accordingly.

【0013】この発明は、上述の如き問題点を解消する
ためになされたもので、データ伝送のためのCPU負荷
を軽減すると共に通信時間を短縮し、効率的なデータ伝
送を可能にするプログラマブルコントローラのデータ通
信方法およびプログラマブルコントローラを得ることを
目的としている。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problems. A programmable controller which reduces the load on a CPU for data transmission, shortens communication time, and enables efficient data transmission. It is an object of the present invention to obtain a data communication method and a programmable controller.

【0014】[0014]

【課題を解決するための手段】上述の目的を達成するた
めに、この発明によるプログラマブルコントローラのデ
ータ通信方法は、複数のステーションから構成され、ト
ークンパッシング方式を利用したローカルエリアネット
ワークにおけるプログラマブルコントローラのデータ通
信方法において、現在シーケンススキャン回数と前回シ
ーケンススキャン回数、および現在データリンクスキャ
ン回数と前回データリンクスキャン回数を格納するエリ
アを各データ通信制御部とシーケンス制御部とが共有す
る2ポートRAMに設ける。シーケンス制御部は、1シ
ーケンススキャン終了毎に、現在シーケンススキャン回
数をインクリメントし、1シーケンススキャン終了後に
現在データリンクスキャン回数と前回データリンクスキ
ャン回数を比較し、(現在データリンクスキャン回数)
>(前回データリンクスキャン回数)の場合のみ、シー
ケンス制御部は2ポートRAM経由で各ステーションか
ら受信したデータの読み出しと他ステーションに送信す
るデータを書き込むリンクリフレッシュ処理を行って現
在データリンクスキャン回数を前回データリンクスキャ
ン回数に格納する。データ通信制御部は、トークンを取
得し、1データリンクスキャン終了毎に、現在データリ
ンクスキャン回数をインクリメントし、1データリンク
スキャン終了後に現在シーケンススキャン回数と前回シ
ーケンススキャン回数を比較し、(現在シーケンススキ
ャン回数)>(前回シーケンススキャン回数)の場合の
み、他ステーションに対して自ステーションのデータを
送信し、現在シーケンススキャン回数を前回シーケンス
スキャン回数に格納するものである。
In order to achieve the above object, a data communication method for a programmable controller according to the present invention comprises a plurality of stations, and uses a token passing method to transmit data of the programmable controller in a local area network. In the communication method, an area for storing the number of current sequence scans and the number of previous sequence scans, and the area for storing the number of current data link scans and the number of previous data link scans are provided in a two-port RAM shared by each data communication control unit and the sequence control unit. The sequence control unit increments the current number of sequence scans each time one sequence scan ends, compares the current number of data link scans with the previous number of data link scans after the end of one sequence scan, and (current data link scan number)
Only in the case of> (previous data link scan times), the sequence control unit performs link refresh processing for reading data received from each station via the 2-port RAM and writing data to be transmitted to other stations to determine the current data link scan times. Stored in the previous data link scan count. The data communication control unit acquires the token, increments the current data link scan count each time one data link scan ends, compares the current sequence scan count with the previous sequence scan count after one data link scan ends, Only when “scan count”> (previous sequence scan count), the data of the own station is transmitted to another station, and the current sequence scan count is stored in the previous sequence scan count.

【0015】つぎの発明に係るプログラマブルコントロ
ーラは、複数のステーションから構成され、トークンパ
ッシング方式を利用したローカルエリアネットワークに
おけるプログラマブルコントローラにおいて、データ通
信制御部と、シーケンス制御部とを有し、前記データ通
信制御部と前記シーケンス制御部とが共有する2ポート
RAMを設け、当該2ポートRAMに現在シーケンスス
キャン回数と前回シーケンススキャン回数、および現在
データリンクスキャン回数と前回データリンクスキャン
回数を格納するエリアを画定し、前記シーケンス制御部
は、1シーケンススキャン終了毎に、現在シーケンスス
キャン回数をインクリメントし、1シーケンススキャン
終了後に現在データリンクスキャン回数と前回データリ
ンクスキャン回数を比較し、(現在データリンクスキャ
ン回数)>(前回データリンクスキャン回数)の場合の
み、シーケンス制御部は2ポートRAM経由で各ステー
ションから受信したデータの読み出しと他ステーション
に送信するデータを書き込むリンクリフレッシュ処理を
行って現在データリンクスキャン回数を前回データリン
クスキャン回数に格納し、前記データ通信制御部は、ト
ークンを取得し、1データリンクスキャン終了毎に、現
在データリンクスキャン回数をインクリメントし、1デ
ータリンクスキャン終了後に現在シーケンススキャン回
数と前回シーケンススキャン回数を比較し、(現在シー
ケンススキャン回数)>(前回シーケンススキャン回
数)の場合のみ、他ステーションに対して自ステーショ
ンのデータを送信し、現在シーケンススキャン回数を前
回シーケンススキャン回数に格納するものである。
According to another aspect of the present invention, there is provided a programmable controller in a local area network using a token passing system, comprising a plurality of stations, the data controller having a data communication control unit and a sequence control unit. A 2-port RAM shared by the control unit and the sequence control unit is provided, and an area for storing the current sequence scan count and the previous sequence scan count, and the current data link scan count and the previous data link scan count is defined in the 2-port RAM. The sequence control unit increments the current number of sequence scans each time one sequence scan is completed, and after the completion of one sequence scan, the current data link scan count and the previous data link scan count. In comparison, only when (current data link scan count)> (previous data link scan count), the sequence control unit reads data received from each station via the 2-port RAM and writes data to be transmitted to another station by link refresh. The processing is performed to store the current data link scan count in the previous data link scan count, and the data communication control unit acquires a token, increments the current data link scan count each time one data link scan is completed, and After the link scan is completed, the current sequence scan count is compared with the previous sequence scan count, and only when (current sequence scan count)> (previous sequence scan count), the own station data is transmitted to another station, and the current sequence scan count is determined. The can count is for storing the previous sequence number of scans.

【0016】[0016]

【発明の実施の形態】以下に添付の図を参照して、この
発明に係るプログラマブルコントローラのデータ通信方
法およびプログラマブルコントローラの実施の形態を詳
細に説明する。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram of a programmable controller according to an embodiment of the present invention;

【0017】図1は、この発明によるデータ通信方法を
実施するデータ通信機能を持つPCのハードウェア構成
を示している。PC1局〜PCn局は、従来のものと同
様に、通信ケーブル50によって接続され、各PC間で
トークンパッシング方式を利用したローカルエリアネッ
トワークの通信を行う。PC10は、データ通信制御部
20と、シーケンス制御部30とを有している。
FIG. 1 shows a hardware configuration of a PC having a data communication function for implementing a data communication method according to the present invention. The PC1 station to the PCn station are connected by a communication cable 50, and communicate with each other on a local area network using a token passing method between the PCs, similarly to the conventional one. The PC 10 has a data communication control unit 20 and a sequence control unit 30.

【0018】データ通信制御部20は、データ通信制御
部20の各部を制御するCPU20aと、通信を実行す
るためのバスを制御するシリアルコントロールバス20
bと、通信制御用のシステムプログラム等のソフトウェ
アを格納するROM20cと、回線から受信したリンク
データや回線へ送信するリンクデータ等を格納するRA
M20dと、シーケンス制御部30とのインタフェース
のための2ポートRAM20eとから構成されている。
The data communication control unit 20 includes a CPU 20a for controlling each unit of the data communication control unit 20, and a serial control bus 20 for controlling a bus for executing communication.
b, a ROM 20c for storing software such as a communication control system program, and an RA for storing link data received from the line, link data transmitted to the line, and the like.
M20d and a two-port RAM 20e for interfacing with the sequence control unit 30.

【0019】シーケンス制御部30は、シーケンスプロ
グラムを実行し、PC10の入出力部(図示省略)を制
御するシーケンス制御部であり、シーケンス制御部30
の各部を制御するCPU30aと、シーケンス制御用の
システムプログラム等のソフトウェアを格納するROM
30bと、シーケンスプログラムでの演算結果やその他
の情報を一時的に格納するRAM30cと、入出力のO
N/OFF情報を交換するための入出力インターフェー
ス30dと、シーケンスプログラムを格納するメモリ3
0eとから構成されている。
The sequence control unit 30 executes a sequence program and controls an input / output unit (not shown) of the PC 10.
And a ROM for storing software such as a sequence control system program.
30b, a RAM 30c for temporarily storing the operation result of the sequence program and other information,
An input / output interface 30d for exchanging N / OFF information, and a memory 3 for storing a sequence program
0e.

【0020】また、2ポートRAM20eは、データ通
信制御部20とシーケンス制御部30とが共有してお
り、現在シーケンススキャン回数と、前回シーケンスス
キャン回数と、現在データリンクスキャン回数と、前回
データリンクスキャン回数とを格納する4メモリエリア
によるスキャン回数格納エリア20fを画定している。
The two-port RAM 20e is shared by the data communication control unit 20 and the sequence control unit 30, and includes a current sequence scan count, a previous sequence scan count, a current data link scan count, and a previous data link scan count. The number of scans storage area 20f is defined by four memory areas for storing the number of times.

【0021】データ通信制御部20は、1データリンク
スキャン終了毎に、スキャン回数格納エリア20fの現
在データリンクスキャン回数をインクリメントする。シ
ーケンス制御部30は、1シーケンススキャン終了毎
に、スキャン回数格納エリア20fの現在シーケンスス
キャン回数をインクリメントする。
The data communication control unit 20 increments the current data link scan count in the scan count storage area 20f every time one data link scan is completed. The sequence control unit 30 increments the current number of sequence scans in the scan number storage area 20f every time one sequence scan ends.

【0022】データ通信制御部20は、トークンを取得
して1データリンクスキャン終了後に2ポートRAM2
0eのスキャン回数格納エリア20fに格納されている
現在データリンクスキャン回数をインクリメントした後
に、現在シーケンススキャン回数と前回シーケンススキ
ャン回数を比較し、 (現在シーケンススキャン回数)>(前回シーケンスス
キャン回数) のときにのみ、自ステーションのデータを他ステーショ
ンへ送信し、現在シーケンススキャン回数を前回シーケ
ンススキャン回数のメモリエリアに格納する。これによ
り、前回シーケンススキャン回数が更新される。
The data communication control unit 20 obtains the token and, after completing one data link scan,
After incrementing the current data link scan count stored in the scan count storage area 20f of 0e, the current sequence scan count is compared with the previous sequence scan count, and when (current sequence scan count)> (previous sequence scan count) Only in this case, the data of the own station is transmitted to another station, and the current sequence scan number is stored in the memory area of the previous sequence scan number. As a result, the previous sequence scan count is updated.

【0023】シーケンス制御部30は、1シーケンスス
キャン終了後にデータ通信制御部20の2ポートRAM
20eのスキャン回数格納エリア20fに格納されてい
る現在シーケンススキャン回数をインクリメントした後
に、現在データリンクスキャン回数と前回データリンク
スキャン回数を比較し、 (現在データリンクスキャン回数)>(前回データリン
クスキャン回数) のときにのみ、2ポートRAM20e経由で、各ステー
ションから受信したデータの読み出しと、他ステーショ
ンに送信するデータを書き込むというリンクリフレッシ
ュを行い、現在データリンクスキャン回数を前回データ
リンクスキャン回数のメモリエリアに格納する。これに
より、前回データリンクスキャン回数が更新される。
The sequence control unit 30 has a two-port RAM of the data communication control unit 20 after one sequence scan is completed.
After incrementing the current sequence scan count stored in the scan count storage area 20f of 20e, the current data link scan count and the previous data link scan count are compared, and (current data link scan count)> (previous data link scan count) Only in the case of (2), link refresh is performed by reading data received from each station and writing data to be transmitted to other stations via the 2-port RAM 20e, and the current data link scan count is set to the memory area of the previous data link scan count. To be stored. As a result, the previous data link scan count is updated.

【0024】上述の一連の処理により、データ通信制御
部20は、シーケンス制御部30にて1シーケンススキ
ャンが終了して自ステーションのデータが更新されたと
きにのみ他ステーションに対して自ステーションのデー
タを送信し、シーケンス制御部30は、データ通信制御
部20にて1データリンクスキャンが終了して他ステー
ションのデータが更新されたときにのみ、他ステーショ
ンからのデータを取り込むことになる。このことによ
り、データ通信時間が短縮され、効率的なデータ伝送が
可能になる。
By the above-described series of processing, the data communication control unit 20 transmits the data of the own station to the other station only when one sequence scan is completed by the sequence control unit 30 and the data of the own station is updated. Is transmitted, and the sequence control unit 30 takes in data from another station only when one data link scan is completed in the data communication control unit 20 and data in another station is updated. As a result, the data communication time is reduced, and efficient data transmission becomes possible.

【0025】図2は、ローカルエリアネットワークにお
いてのデータ通信制御処理フローを示している。最初
に、前回、現在のシーケンススキャン回数、データリン
クスキャン回数を0に初期化する(ステップS11)。
つぎに、トークンを取得したかチェックする(ステップ
S12)。トークンを取得していなければ(ステップS
12否定)、ステップS22へジャンプする。
FIG. 2 shows a data communication control processing flow in the local area network. First, the current number of sequence scans and the number of data link scans are initialized to 0 (step S11).
Next, it is checked whether a token has been obtained (step S12). If the token has not been acquired (step S
(12 No), the process jumps to step S22.

【0026】トークンを取得していれば(ステップS1
2肯定)、1データリンクスキャンが終了したかをチェ
ックする(ステップS13)。1データリンクスキャン
が終了していなければ(ステップS13否定)、これは
他ステーションのデータをすべて受信していないことを
意味し、この場合には、現在データリンクスキャン回数
をインクリメントすることなくステップS21へジャン
プする。ステップS21では、他のステーションに対し
てトークンのみを送信する。
If the token has been acquired (step S1)
(2 Yes) It is checked whether one data link scan has been completed (step S13). If one data link scan has not been completed (No at Step S13), this means that all the data of the other stations have not been received. In this case, Step S21 is performed without incrementing the current data link scan count. Jump to In step S21, only the token is transmitted to another station.

【0027】1データリンクスキャンが終了していれば
(ステップS13肯定)、他ステーションのデータをす
べて受信したとして現在データリンクスキャン回数をイ
ンクリメントし(ステップS14)、そのデータを2ポ
ートRAM20eのスキャン回数格納エリア20fに格
納する(ステップS15)。
If one data link scan has been completed (Yes at step S13), it is determined that all data of the other stations have been received, and the current data link scan count is incremented (step S14). It is stored in the storage area 20f (step S15).

【0028】続いて、データ通信制御部20の2ポート
RAM20eのスキャン回数格納エリア20fに格納さ
れている現在シーケンススキャン回数と前回シーケンス
スキャン回数とを比較する(ステップS16)。ここ
で、(現在シーケンススキャン回数)>(前回シーケン
ススキャン回数)でない場合は(ステップS16否
定)、シーケンススキャンを完了しておらず、送信する
データは古いものであることを意味し、この場合には、
ステップS21へジャンプして他のステーションに対し
てトークンのみを送信(ステップS21)する。
Subsequently, the current sequence scan count stored in the scan count storage area 20f of the two-port RAM 20e of the data communication control unit 20 is compared with the previous sequence scan count (step S16). Here, if (current sequence scan count)> (previous sequence scan count) is not satisfied (No at step S16), it means that the sequence scan has not been completed and the data to be transmitted is old. Is
The process jumps to step S21 to transmit only the token to another station (step S21).

【0029】これに対し、(現在シーケンススキャン回
数)>(前回シーケンススキャン回数)の場合(ステッ
プS16肯定)は、シーケンススキャンを完了してい
る、すなわち送信するデータが最新であることを意味
し、この場合には、続いて、他ステーションに送信する
データを2ポートRAM20eからシリアルコントロー
ルバス20bに転送し(ステップS17)、シリアルコ
ントロールバス20bから、他ステーションに対して自
ステーションのデータを送信する(ステップS18)。
On the other hand, if (current sequence scan frequency)> (previous sequence scan frequency) (Yes at step S16), it means that the sequence scan has been completed, that is, the data to be transmitted is the latest. In this case, subsequently, the data to be transmitted to the other station is transferred from the two-port RAM 20e to the serial control bus 20b (step S17), and the data of the own station is transmitted to the other station from the serial control bus 20b (step S17). Step S18).

【0030】データ送信完了後に、前回シーケンススキ
ャン回数を現在シーケンススキャン回数に更新し(ステ
ップS19)、更新した前回シーケンススキャン回数を
2ポートRAM20eのスキャン回数格納エリア20f
に格納する(ステップS20)。
After the data transmission is completed, the previous sequence scan count is updated to the current sequence scan count (step S19), and the updated last sequence scan count is updated to the scan count storage area 20f of the 2-port RAM 20e.
(Step S20).

【0031】なお、ステップS22では、データ通信制
御部20にリセットがあったかをチェックしており、リ
セットされた場合にはステップS11に戻り、これに対
しリセットがない場合にはステップS12に戻る。
In step S22, it is checked whether the data communication control unit 20 has been reset. If the data communication control unit 20 has been reset, the process returns to step S11. If not, the process returns to step S12.

【0032】図3は、ローカルエリアネットワークにお
いてのシーケンス制御処理フローを示している。最初
に、前回、現在のシーケンススキャン回数、データリン
クスキャン回数を0に初期化する(ステップS31)。
FIG. 3 shows a sequence control processing flow in the local area network. First, the current number of sequence scans and the number of data link scans are initialized to 0 last time (step S31).

【0033】つぎに、1シーケンススキャンが終了した
かをチェックする(ステップS32)。終了していなけ
れば(ステップS32否定)、これは自ステーションの
データは古いということを意味し、現在シーケンススキ
ャン回数をインクリメントすることなくステップS39
へジャンプする。
Next, it is checked whether one sequence scan has been completed (step S32). If it has not been completed (No at Step S32), this means that the data of the own station is old, and Step S39 is performed without incrementing the current number of sequence scans.
Jump to

【0034】これに対し、1シーケンススキャンが終了
していれば(ステップS32肯定)、これは自ステーシ
ョンのデータは最新ということを意味し、この場合には
現在シーケンススキャン回数をインクリメントし(ステ
ップS33)、そのデータを2ポートRAM20eのス
キャン回数格納エリア20fに格納する(ステップS3
4)。
On the other hand, if one sequence scan has been completed (Yes at step S32), this means that the data of the own station is the latest. In this case, the current number of sequence scans is incremented (step S33). ), And stores the data in the scan count storage area 20f of the two-port RAM 20e (step S3).
4).

【0035】続いて、データ通信制御部20の2ポート
RAM20eのスキャン回数格納エリア20fに格納さ
れている現在データリンクスキャン回数と前回データリ
ンクスキャン回数とを比較する(ステップS35)。こ
こで、(現在データリンクスキャン回数)>(前回デー
タリンクスキャン回数)でない場合は(ステップS27
否定)、データリンクスキャンが完了しておらず、デー
タをすべて受信していないことを意味し、この場合に
は、ステップS39にジャンプする。
Subsequently, the current data link scan count stored in the scan count storage area 20f of the two-port RAM 20e of the data communication control unit 20 is compared with the previous data link scan count (step S35). Here, if (current data link scan count)> (previous data link scan count) is not satisfied (step S27)
No), meaning that the data link scan has not been completed and all data has not been received. In this case, the process jumps to step S39.

【0036】これに対し、(現在データリンクスキャン
回数)>(前回データリンクスキャン回数)の場合は
(ステップS35肯定)、データリンクスキャンが完了
してデータをすべて受信したことを意味し、この場合に
は、2ポートRAM20e経由で、RAM30cに対し
てリンクリフレッシュ処理を行う(ステップS36)。
On the other hand, if (current data link scan count)> (previous data link scan count) (Yes at step S35), it means that the data link scan has been completed and all data has been received. In step S36, a link refresh process is performed on the RAM 30c via the two-port RAM 20e.

【0037】リンクリフレッシュ処理完了後に、前回デ
ータリンクスキャン回数を現在データリンクスキャン回
数に更新し(ステップS37)、更新した前回データリ
ンクスキャン回数を2ポートRAM20eのスキャン回
数格納エリア20fに格納する(ステップS38)。
After the link refresh processing is completed, the previous data link scan count is updated to the current data link scan count (step S37), and the updated last data link scan count is stored in the scan count storage area 20f of the two-port RAM 20e (step S37). S38).

【0038】なお、ステップS39では、シーケンス制
御部30にリセットがあったかをチェックしており、リ
セットされた場合にはステップS23に戻り、これに対
しリセットがない場合にはステップS24に戻る。
In step S39, it is checked whether or not the sequence control unit 30 has been reset. If the reset has been performed, the process returns to step S23. If not, the process returns to step S24.

【0039】図4(a)、(b)は、2台のステーショ
ンによって構成されたデータリンクシステムのステーシ
ョンNo.1とNo.2のシーケンススキャンとデータ
リンクスキャンを横軸にとったタイムチャートである。
尚、この例でのタイムチャートにおける条件は、シーケ
ンススキャン(PC1)<データリンクスキャン1<シ
ーケンススキャン(PC2)である。なお、(a)はこ
の発明による場合を、(b)は従来例を示している。
FIGS. 4A and 4B show station Nos. Of the data link system constituted by two stations. 1 and No. 2 is a time chart in which a horizontal axis represents a sequence scan and a data link scan.
The condition in the time chart in this example is: sequence scan (PC1) <data link scan 1 <sequence scan (PC2). (A) shows a case according to the present invention, and (b) shows a conventional example.

【0040】図4(a)、(b)において、“4A”は
PC1とPC2のトークンとデータを含んだ送受信の時
間、“4B”はPC1とPC2のトークンのみの送受信
の時間、“4C”はPC1のトークンとデータの送信時
間とPC2のトークンとデータの受信時間とPC2のト
ークンの送信時間とPC1のトークンの受信時間、“4
D”はPC1のトークンの送信時間とPC2のトークン
の受信時間とPC2のトークンとデータの送信時間とP
C1のトークンとデータの受信時間をそれぞれ示してい
る。また“4N”〜“4U”は、PC1がリフレッシュ
してから、どのようなタイミングでPC2にデータを送
信するかの流れを図示したものである。
4 (a) and 4 (b), "4A" is a transmission / reception time including tokens and data of PC1 and PC2, "4B" is a transmission / reception time of only tokens of PC1 and PC2, and "4C". Are the token and data transmission time of PC1, the token and data reception time of PC2, the token transmission time of PC2 and the token reception time of PC1, "4
D ″ is the transmission time of the token of PC1, the reception time of the token of PC2, the transmission time of the token and data of PC2, and P
The C1 token and the data reception time are shown. “4N” to “4U” illustrate the flow of transmitting data to the PC 2 at a timing after the PC 1 is refreshed.

【0041】従来のトークンパッシング方式の場合、ス
テーションNo.1、No.2はトークンを取得すると
必ず2ポートRAMに格納されているデータをすべて送
信するので、“4A”以外のパターンの送受信は行われ
ない。
In the case of the conventional token passing method, the station No. 1, No. 2 always transmits all the data stored in the 2-port RAM when the token is acquired, so that transmission / reception of patterns other than “4A” is not performed.

【0042】“4E”〜“4M”はシーケンス制御部か
らリンクリフレッシュを行うタイミングであり、従来の
PC1、PC2は“4E”から“4M”のタイミングで
リフレッシュされたデータを各ステーションへ送信す
る。
"4E" to "4M" are timings for performing link refresh from the sequence control unit. Conventional PCs 1 and 2 transmit refreshed data to each station at timings "4E" to "4M".

【0043】PC1側を例に説明すると、“4F”でリ
フレッシュされたデータは“4A”#3のデータリンク
スキャンでPC2へデータが送信され、“4L”のリフ
レッシュでPC2にデータが反映される(“4O”がタ
イミングを図示した線である)。なお、“4E”でリフ
レッシュされたデータは“4A”#2のデータリンクス
キャンでPC2へ送信されるが、“4F”のタイミング
でリフレッシュされたデータで上書きされるのでPC2
には反映されることはない(“4N”がタイミングを図
示した線である)。
Taking the PC1 side as an example, data refreshed at "4F" is transmitted to PC2 by data link scan of "4A"# 3, and data is reflected on PC2 by "4L" refresh. ("4O" is a line showing the timing). The data refreshed at “4E” is transmitted to the PC 2 by the data link scan of “4A” # 2, but is overwritten with the refreshed data at the timing of “4F”.
(“4N” is a line showing the timing).

【0044】同様に、“4H”でリフレッシュされたデ
ータは“4A”#5のデータリンクスキャンでPC2へ
データが送信され、“4M”のリフレッシュでPC2に
データが反映される(“4Q”がタイミングを図示した
線である)。なお、“4G”でリフレッシュされたデー
タは“4A”#4のデータリンクスキャンでPC2へ送
信されるが、“4H”のタイミングでリフレッシュされ
たデータで上書きされるのでPC2には反映されること
はない(“4P”がタイミングを図示した線である)。
Similarly, the data refreshed by “4H” is transmitted to PC2 by the data link scan of “4A” # 5, and the data is reflected on PC2 by “4M” refresh (“4Q” is changed to “4H”). This is a line showing the timing). The data refreshed by “4G” is transmitted to the PC 2 by the data link scan of “4A” # 4, but is overwritten by the refreshed data at the timing of “4H”, so that the data is reflected on the PC 2. (“4P” is a line showing the timing).

【0045】これに対し、この発明によるデータリンク
スキャンにおいては、データ通信制御部20はトークン
を取得した時点でステーションNo.1、No.2のデ
ータの送信条件である1データリンクスキャン終了し
て、かつ(現在シーケンススキャン回数)>(前回シー
ケンススキャン回数)の条件を満たしていないと、デー
タの送信処理を行わない。
On the other hand, in the data link scan according to the present invention, when the data communication control unit 20 acquires the token, the station No. 1, No. If one data link scan, which is the transmission condition of the second data, is completed and the condition of (current sequence scan frequency)> (previous sequence scan frequency) is not satisfied, data transmission processing is not performed.

【0046】この時の条件を満たすデータリンクスキャ
ンは、“4B”、“4C”#1、“4C”#2、“4
C”#3、“4C”#4、“4D”である。“4B“は
PC1、PC2共にデータを送信せず、“4C”#1〜
“4C”#4はPC2がデータを送信せず、“4D”は
PC1がデータを送信しない場合である。PC1側を例
に説明すると、“4E”でリフレッシュされたデータは
“4C”#1のデータリンクスキャンでPC2へデータ
が送信され、“4K”のリフレッシュでPC2にデータ
が反映される(“4R”がタイミングを図示した線であ
る)。
The data link scans satisfying the conditions at this time are "4B", "4C"# 1, "4C"# 2, "4C".
C "# 3," 4C "# 4," 4D "," 4B "does not transmit data to both PC1 and PC2, and" 4C "# 1 to # 4C.
"4C"# 4 is when PC2 does not transmit data, and "4D" is when PC1 does not transmit data. Taking the PC1 side as an example, the data refreshed in “4E” is transmitted to PC2 by the “4C” # 1 data link scan, and the data is reflected in PC2 by “4K” refresh (“4R”). Is a line showing the timing).

【0047】同様に、“4F”でリフレッシュされたデ
ータは“4C”#2のデータリンクスキャンでPC2へ
データが送信され、“4L”のリフレッシュでPC2に
データが反映される(“4S”がタイミングを図示した
線である)。なお、“4G”でリフレッシュされたデー
タは“4C”#3のデータリンクスキャンでPC2へ送
信されるが、“4H”のタイミングでリフレッシュされ
たデータで上書きされるのでPC2には反映されること
はない(“4T”、“4U”がタイミングを図示した線
である)。
Similarly, the data refreshed by “4F” is transmitted to PC2 by the “4C” # 2 data link scan, and the data is reflected on PC2 by “4L” refresh (“4S” is changed to “4S”). This is a line showing the timing). The data refreshed by “4G” is transmitted to the PC 2 by the data link scan of “4C” # 3, but is overwritten by the refreshed data at the timing of “4H”, so that the data is reflected on the PC 2. (“4T” and “4U” are lines illustrating timing).

【0048】図5(a)、(b)は、2台のステーショ
ンによって構成されたデータリンクシステムのステーシ
ョンNo.1とNo.2のシーケンススキャンとデータ
リンクスキャンを横軸にとったタイムチャートである。
尚、この例での、タイムチャートにおける条件は、シー
ケンススキャン(PC1)>データリンクスキャン1<
シーケンススキャン(PC2)である。なお、図5で
も、(a)はこの発明による場合を、(b)は従来例を
示している。
FIGS. 5A and 5B show station Nos. Of a data link system constituted by two stations. 1 and No. 2 is a time chart in which a horizontal axis represents a sequence scan and a data link scan.
In this example, the condition in the time chart is as follows: sequence scan (PC1)> data link scan 1 <
This is a sequence scan (PC2). 5A shows a case according to the present invention, and FIG. 5B shows a conventional example.

【0049】図5(a)、(b)においても、“4A”
はPC1とPC2のトークンとデータを含んだ送受信の
時間、“4B”はPC1とPC2のトークンのみの送受
信の時間、“4C”はPC1のトークンとデータの送信
時間とPC2のトークンとデータの受信時間とPC2の
トークンの送信時間とPC1のトークンの受信時間、
“4D”はPC1のトークンの送信時間とPC2のトー
クンの受信時間とPC2のトークンとデータの送信時間
とPC1のトークンとデータの受信時間をそれぞれ示し
ている。また、“4N”から“4V”はPC1がリフレ
ッシュしてからどのようなタイミングでPC2にデータ
を送信するかの流れを図示したものである。
Also in FIGS. 5A and 5B, "4A"
Is the transmission and reception time including the tokens and data of PC1 and PC2, "4B" is the transmission and reception time of only the tokens of PC1 and PC2, and "4C" is the transmission time of the token and data of PC1 and the reception of the token and data of PC2. Time, PC2 token transmission time, PC1 token reception time,
“4D” indicates the transmission time of the token of PC1, the reception time of the token of PC2, the transmission time of the token and data of PC2, and the reception time of the token and data of PC1. Also, “4N” to “4V” illustrate the flow of transmitting data to PC2 at what timing after PC1 refreshes.

【0050】従来のトークンパッシング方式の場合、ス
テーションNo.1、No.2はトークンを取得すると
必ず2ポートRAMに格納されているデータをすべて送
信するので、“4A”以外のパターンの送受信は行われ
ない。
In the case of the conventional token passing method, the station No. 1, No. 2 always transmits all the data stored in the 2-port RAM when the token is acquired, so that transmission / reception of patterns other than “4A” is not performed.

【0051】“4E”から“4M”はシーケンス制御部
からリンクリフレッシュを行うタイミングである。
"4E" to "4M" are timings for performing a link refresh from the sequence control unit.

【0052】従来のPC1、PC2は、“4E”〜“4
M”のタイミングでリフレッシュされたデータを各ステ
ーションへ送信する。PC1側を例に説明すると、“4
K”でリフレッシュされるデータは“4A”#3のデー
タリンクスキャンでPC2へデータが送信された“4
E”のリフレッシュのデータが反映されている(4Nが
タイミングを図示した線である)。
The conventional PCs 1 and 2 are “4E” to “4E”.
The refreshed data is transmitted to each station at the timing of "M".
The data to be refreshed with “K” is “4A”.
The refresh data of E "is reflected (4N is a line showing the timing).

【0053】“4L”でリフレッシュされるデータは
“4A”#6のデータリンクスキャンでPC2へデータ
が送信された“4F”のリフレッシュのデータが反映さ
れている(4Qがタイミングを図示した線である)。な
お、“4E”でリフレッシュされたデータは“4A”#
4のデータリンクスキャンでPC2へ送信されるが、
“4F”のタイミングでリフレッシュされたデータで上
書きされるので、PC2には反映されることはない(4
Oがタイミングを図示した線である)。
The data refreshed by "4L" reflects the refresh data of "4F" transmitted to the PC 2 by the data link scan of "4A"# 6 (4Q is a line showing the timing). is there). The data refreshed in “4E” is “4A” #
4 is sent to PC2 in the data link scan,
Since the data is overwritten with the refreshed data at the timing of “4F”, it is not reflected on the PC 2 (4
O is a line showing the timing).

【0054】“4E”が“4P”のタイミングで送信し
たデータは“4Q”のタイミングで送信したデータと同
じであり、無駄な送信を行っている。“4G”でリフレ
ッシュされたデータは“4A”#7のデータリンクスキ
ャンでPC2へデータが送信され“4M”のリフレッシ
ュでPC2にデータが反映される(“4R”がタイミン
グを図示した線である)。
The data transmitted at the timing of "4E" at "4P" is the same as the data transmitted at the timing of "4Q", and wasteful transmission is performed. The data refreshed by "4G" is transmitted to the PC2 by the data link scan of "4A"# 7, and the data is reflected on the PC2 by the refresh of "4M"("4R" is a line showing the timing). ).

【0055】この発明によるデータリンクスキャンにお
いては、データ通信制御部20はトークンを取得した時
点でステーションNo.1、No.2のデータの送信条
件である1データリンクスキャン終了して、かつ(現在
シーケンススキャン回数)>(前回シーケンススキャン
回数)の条件を満たしていないと、データの送信処理を
行わない。
In the data link scan according to the present invention, when the data communication control unit 20 acquires the token, the station No. 1, No. If one data link scan, which is the transmission condition of the second data, is completed and the condition of (current sequence scan frequency)> (previous sequence scan frequency) is not satisfied, data transmission processing is not performed.

【0056】この時の条件を満たすデータリンクスキャ
ンは、“4B”、“4C”#1、“4C”#2、“4
C”#3、“4C”#4、“4D”である。“4B”は
PC1、PC2共にデータを送信せず、“4C”#1か
ら“4C”#4はPC2がデータを送信せず、“4D”
はPC1がデータを送信しない場合である。
The data link scans satisfying the conditions at this time are “4B”, “4C” # 1, “4C” # 2, “4C”.
C "# 3," 4C "# 4," 4D "," 4B "does not transmit data to both PC1 and PC2, and" 4C "# 1 to" 4C "# 4 does not transmit data to PC2. , “4D”
Is a case where the PC 1 does not transmit data.

【0057】PC1側を例に説明すると、“4E”でリ
フレッシュされたデータは、“4C”#1のデータリン
クスキャンでPC2へデータが送信され、“4K”のリ
フレッシュでPC2にデータが反映される(“4S”が
タイミングを図示した線である)。
To describe the PC1 side as an example, data refreshed at "4E" is transmitted to PC2 by data link scan of "4C"# 1, and data is reflected on PC2 by "4K" refresh. ("4S" is a line showing the timing).

【0058】同様に、“4F”でリフレッシュされたデ
ータは、“4C”#2のデータリンクスキャンでPC2
へデータが送信され、“4L”のリフレッシュでPC2
にデータが反映される(“4T”がタイミングを図示し
た線である)。なお、“4G”でリフレッシュされたデ
ータは、“4C”#3のデータリンクスキャンでPC2
へ送信されるが、“4H”のタイミングでリフレッシュ
されたデータで上書きされるのでPC2には反映される
ことはない(“4S”、“4T”がタイミングを図示し
た線である)。
Similarly, the data refreshed by “4F” is transmitted to PC2 by the data link scan of “4C” # 2.
Is transmitted to PC2 by refreshing “4L”.
(“4T” is a line showing the timing). Note that the data refreshed by “4G” is transmitted to the PC2 by the data link scan of “4C” # 3.
However, since it is overwritten with the refreshed data at the timing of “4H”, it is not reflected on the PC 2 (“4S” and “4T” are lines showing the timing).

【0059】このことにより、1データリンクスキャン
当たりの時間を短縮することができ、シーケンス制御部
30からリンクリフレッシュ要求があってから、自ステ
ーションのデータを各ステーションに送信するまでの時
間も短縮することができ、データ処理効率を向上させる
ことができる。
As a result, the time per one data link scan can be reduced, and the time from when a link refresh request is issued by the sequence control unit 30 to when the data of the own station is transmitted to each station is also reduced. Data processing efficiency can be improved.

【0060】[0060]

【発明の効果】以上の説明から理解される如く、この発
明によるプログラマブルコントローラのデータ通信方法
によれば、シーケンス制御部は、1シーケンススキャン
終了毎に、現在シーケンススキャン回数をインクリメン
トし、(現在データリンクスキャン回数)>(前回デー
タリンクスキャン回数)のときにのみ、リンクリフレッ
シュを行い、現在データリンクスキャン回数を前回デー
タリンクスキャン回数のメモリエリアに格納し、データ
通信制御部は、トークンを取得し1データリンクスキャ
ン終了毎に、現在データリンクスキャン回数をインクリ
メントし、(現在シーケンススキャン回数)>(前回シ
ーケンススキャン回数)のときにのみ、他ステーション
に対して自ステーションのデータを送信し、現在シーケ
ンススキャン回数を前回シーケンススキャン回数のメモ
リエリアに格納するから、シーケンススキャンタイムお
よびデータリンクスキャンタイムを短縮することがで
き、他ステーションに対して自ステーションのデータを
伝える時間を短縮することができるという効果が得られ
る。
As can be understood from the above description, according to the data communication method of the programmable controller according to the present invention, the sequence control section increments the current number of sequence scans every time one sequence scan is completed, and Only when [link scan count]> (previous data link scan count), link refresh is performed, the current data link scan count is stored in the memory area of the previous data link scan count, and the data communication control unit acquires a token. Each time one data link scan is completed, the current data link scan count is incremented, and only when (current sequence scan count)> (previous sequence scan count), the own station data is transmitted to the other station, and the current sequence scan count is set. Number of scans Since the data is stored in the memory area of the number of previous sequence scans, the sequence scan time and the data link scan time can be reduced, and the effect of transmitting the data of the own station to other stations can be reduced. .

【0061】つぎの発明によるプログラマブルコントロ
ーラによれば、データ通信制御部とシーケンス制御部と
が共有する2ポートRAMを設け、当該2ポートRAM
に現在シーケンススキャン回数と前回シーケンススキャ
ン回数、現在データリンクスキャン回数と前回データリ
ンクスキャン回数を格納するエリアを画定し、シーケン
ス制御部は、1シーケンススキャン終了毎に、現在シー
ケンススキャン回数をインクリメントし、(現在データ
リンクスキャン回数)>(前回データリンクスキャン回
数)のときにのみ、リンクリフレッシュを行い、現在デ
ータリンクスキャン回数を前回データリンクスキャン回
数のメモリエリアに格納し、データ通信制御部は、トー
クンを取得し、1データリンクスキャン終了毎に、現在
データリンクスキャン回数をインクリメントし、(現在
シーケンススキャン回数)>(前回シーケンススキャン
回数)のときにのみ、他ステーションに対して自ステー
ションのデータを送信し、現在シーケンススキャン回数
を前回シーケンススキャン回数のメモリエリアに格納す
るから、シーケンススキャンタイムおよびデータリンク
スキャンタイムを短縮することができ、他ステーション
に対して自ステーションのデータを伝える時間を短縮す
ることができるという効果が得られる。
According to the programmable controller of the next invention, the two-port RAM shared by the data communication control unit and the sequence control unit is provided.
Defines an area for storing the current sequence scan count and the previous sequence scan count, the current data link scan count and the previous data link scan count, and the sequence control unit increments the current sequence scan count each time one sequence scan ends. Link refresh is performed only when (current data link scan count)> (previous data link scan count), and the current data link scan count is stored in the memory area of the previous data link scan count. Is acquired, and the number of current data link scans is incremented every time one data link scan is completed. Only when (current sequence scan frequency)> (previous sequence scan frequency), the data of the own station is transmitted to another station. Since the current sequence scan count is stored in the memory area of the previous sequence scan count, the sequence scan time and the data link scan time can be reduced, and the time for transmitting the data of the own station to other stations can be shortened. The effect that it can be obtained is obtained.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 この発明によるデータ通信方法を実施するデ
ータ通信機能を持つPCのハードウェア構成を示すブロ
ック線図である。
FIG. 1 is a block diagram showing a hardware configuration of a PC having a data communication function for implementing a data communication method according to the present invention.

【図2】 この発明によるデータ通信方法におけるデー
タ通信制御処理を示すフローチャートである。
FIG. 2 is a flowchart showing a data communication control process in the data communication method according to the present invention.

【図3】 この発明によるデータ通信方法におけるシー
ケンス制御処理を示すフローチャートである。
FIG. 3 is a flowchart showing a sequence control process in the data communication method according to the present invention.

【図4】 シーケンススキャンとデータリンクスキャン
のタイミングを示すタイムチャートである。(タイムチ
ャートにおける条件はシーケンススキャン(PC1)<
データリンクスキャン1<シーケンススキャン(PC
2))
FIG. 4 is a time chart showing timings of a sequence scan and a data link scan. (The condition in the time chart is sequence scan (PC1) <
Data Link Scan 1 <Sequence Scan (PC
2))

【図5】 シーケンススキャンとデータリンクスキャン
のタイミングを示すタイムチャートである。(タイムチ
ャートにおける条件はシーケンススキャン(PC1)>
データリンクスキャン1<シーケンススキャン(PC
2))
FIG. 5 is a time chart showing timings of a sequence scan and a data link scan. (The condition in the time chart is sequence scan (PC1)>
Data Link Scan 1 <Sequence Scan (PC
2))

【図6】 従来におけるPCのハードウェア構成を示す
ブロック線図である。
FIG. 6 is a block diagram showing a hardware configuration of a conventional PC.

【図7】 従来におけるPCにおけるデータ通信制御処
理を示すフローチャートである。
FIG. 7 is a flowchart showing a data communication control process in a conventional PC.

【符号の説明】[Explanation of symbols]

10 PC、20 データ通信制御部、20a CP
U、20b シリアルコントロールバス、20c RO
M、20d RAM、20e 2ポートRAM、20f
スキャン回数格納エリア、30 シーケンス制御部、
30a CPU、30b ROM、30c RAM、3
0d 入出力インターフェース 30eメモリ。
10 PC, 20 data communication control unit, 20a CP
U, 20b Serial control bus, 20c RO
M, 20d RAM, 20e 2-port RAM, 20f
Scan count storage area, 30 sequence control unit,
30a CPU, 30b ROM, 30c RAM, 3
0d I / O interface 30e memory.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 複数のステーションから構成され、トー
クンパッシング方式を利用したローカルエリアネットワ
ークにおけるプログラマブルコントローラのデータ通信
方法において、 現在シーケンススキャン回数と前回シーケンススキャン
回数、および現在データリンクスキャン回数と前回デー
タリンクスキャン回数を格納するエリアをデータ通信制
御部とシーケンス制御部とが共有する2ポートRAMに
設け、 シーケンス制御部は、1シーケンススキャン終了毎に、
現在シーケンススキャン回数をインクリメントし、1シ
ーケンススキャン終了後に現在データリンクスキャン回
数と前回データリンクスキャン回数を比較し、 (現在データリンクスキャン回数)>(前回データリン
クスキャン回数) の場合のみ、シーケンス制御部は前記2ポートRAM経
由で各ステーションから受信したデータの読み出しと他
ステーションに送信するデータを書き込むリンクリフレ
ッシュ処理を行って現在データリンクスキャン回数を前
回データリンクスキャン回数に格納し、 データ通信制御部は、トークンを取得し、1データリン
クスキャン終了毎に、現在データリンクスキャン回数を
インクリメントし、1データリンクスキャン終了後に現
在シーケンススキャン回数と前回シーケンススキャン回
数を比較し、 (現在シーケンススキャン回数)>(前回シーケンスス
キャン回数) の場合のみ、他ステーションに対して自ステーションの
データを送信し、現在シーケンススキャン回数を前回シ
ーケンススキャン回数に格納することを特徴とするプロ
グラマブルコントローラのデータ通信方法。
1. A data communication method for a programmable controller in a local area network comprising a plurality of stations and using a token passing method, comprising: a current sequence scan count and a previous sequence scan count; and a current data link scan count and a previous data link count. An area for storing the number of scans is provided in a two-port RAM shared by the data communication control unit and the sequence control unit.
The current sequence scan count is incremented, and after the completion of one sequence scan, the current data link scan count is compared with the previous data link scan count. Only when (current data link scan count)> (previous data link scan count), the sequence control unit is executed. Performs a link refresh process of reading data received from each station via the 2-port RAM and writing data to be transmitted to another station, and stores the current data link scan count in the previous data link scan count. Token is acquired, the number of current data link scans is incremented each time one data link scan is completed, and the number of current sequence scans is compared with the number of previous sequence scans after one data link scan is completed. The data communication method of the programmable controller, wherein the data of the own station is transmitted to the other station and the current number of sequence scans is stored in the number of previous sequence scans only when (number of sequence scans)> (number of previous sequence scans). .
【請求項2】 複数のステーションから構成され、トー
クンパッシング方式を利用したローカルエリアネットワ
ークにおけるプログラマブルコントローラにおいて、 データ通信制御部と、シーケンス制御部とを有し、 前記データ通信制御部と前記シーケンス制御部とが共有
する2ポートRAMを設け、当該2ポートRAMに現在
シーケンススキャン回数と前回シーケンススキャン回
数、および現在データリンクスキャン回数と前回データ
リンクスキャン回数を格納するエリアを画定し、 前記シーケンス制御部は、1シーケンススキャン終了毎
に、現在シーケンススキャン回数をインクリメントし、
1シーケンススキャン終了後に現在データリンクスキャ
ン回数と前回データリンクスキャン回数を比較し、 (現在データリンクスキャン回数)>(前回データリン
クスキャン回数) の場合のみ、シーケンス制御部は前記2ポートRAM経
由で各ステーションから受信したデータの読み出しと他
ステーションに送信するデータを書き込むリンクリフレ
ッシュ処理を行って現在データリンクスキャン回数を前
回データリンクスキャン回数に格納し、 前記データ通信制御部は、トークンを取得し、1データ
リンクスキャン終了毎に、現在データリンクスキャン回
数をインクリメントし、1データリンクスキャン終了後
に現在シーケンススキャン回数と前回シーケンススキャ
ン回数を比較し、 (現在シーケンススキャン回数)>(前回シーケンスス
キャン回数) の場合のみ、他ステーションに対して自ステーションの
データを送信し、現在シーケンススキャン回数を前回シ
ーケンススキャン回数に格納する、ことを特徴とするプ
ログラマブルコントローラ。
2. A programmable controller in a local area network comprising a plurality of stations and using a token passing method, comprising: a data communication control unit; and a sequence control unit, wherein the data communication control unit and the sequence control unit A two-port RAM that is shared between the two-port RAM and defines an area for storing the current sequence scan count and the previous sequence scan count, and the current data link scan count and the previous data link scan count in the two-port RAM; Increments the current number of sequence scans every time one sequence scan is completed,
After the completion of one sequence scan, the current data link scan count is compared with the previous data link scan count. Only when (current data link scan count)> (previous data link scan count), the sequence control unit receives each data link via the 2-port RAM. A link refresh process for reading data received from a station and writing data to be transmitted to another station is performed, and the current data link scan count is stored in the previous data link scan count. Each time a data link scan is completed, the current data link scan count is incremented, and after one data link scan is completed, the current sequence scan count is compared with the previous sequence scan count, and (current sequence scan count)> (previous sequence scan count) A programmable controller which transmits the data of its own station to another station only when the number of times of scanning is the same, and stores the current sequence scanning number in the previous sequence scanning number.
JP10166924A 1998-06-15 1998-06-15 Data communication method for programmable controller and programmable controller Pending JP2000004243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10166924A JP2000004243A (en) 1998-06-15 1998-06-15 Data communication method for programmable controller and programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10166924A JP2000004243A (en) 1998-06-15 1998-06-15 Data communication method for programmable controller and programmable controller

Publications (1)

Publication Number Publication Date
JP2000004243A true JP2000004243A (en) 2000-01-07

Family

ID=15840191

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10166924A Pending JP2000004243A (en) 1998-06-15 1998-06-15 Data communication method for programmable controller and programmable controller

Country Status (1)

Country Link
JP (1) JP2000004243A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002251207A (en) * 2001-02-21 2002-09-06 Mitsubishi Electric Corp Programmable controller, peripheral equipment, and debug method
JP2008299581A (en) * 2007-05-31 2008-12-11 Mitsubishi Electric Corp Data transfer control device
JP2010061458A (en) * 2008-09-04 2010-03-18 Yaskawa Electric Corp Machine controller system and method for synchronizing machine controllers
JP2018092207A (en) * 2016-11-30 2018-06-14 三菱電機株式会社 Driving equipment and driving equipment system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002251207A (en) * 2001-02-21 2002-09-06 Mitsubishi Electric Corp Programmable controller, peripheral equipment, and debug method
JP4569011B2 (en) * 2001-02-21 2010-10-27 三菱電機株式会社 Programmable controller and peripheral device thereof
JP2008299581A (en) * 2007-05-31 2008-12-11 Mitsubishi Electric Corp Data transfer control device
JP2010061458A (en) * 2008-09-04 2010-03-18 Yaskawa Electric Corp Machine controller system and method for synchronizing machine controllers
JP2018092207A (en) * 2016-11-30 2018-06-14 三菱電機株式会社 Driving equipment and driving equipment system

Similar Documents

Publication Publication Date Title
US5754547A (en) Routing method and system using an internet protocol
US20140016528A1 (en) Wireless communication system and wireless communication control method, wireless communication device and wireless communication method, and computer program
CA1131364A (en) Method and system for controlling input/output in process control
US20010041943A1 (en) Simultaneous wired and wireless remote in-system programming of multiple remote systems
US20040174831A1 (en) Hybrid-type data transmission apparatus and method suitable for high-performance wireless LAN
JPH05160841A (en) State information reply method
US20010005862A1 (en) Method for down-loading data
JP2000004243A (en) Data communication method for programmable controller and programmable controller
JP2021056804A (en) Relay device and external device
CN112235204B (en) Data reporting method, system, electronic equipment and storage medium
JP3751536B2 (en) Data transmission equipment
JPH086614A (en) Programmable controller
CN112492683B (en) Data receiving method, device, computer equipment and storage medium
JPH06274463A (en) Data communication system
JP3029326B2 (en) Data transmission device
WO2021214966A1 (en) Communication device, communication system, communication method, and program
US7529268B1 (en) Multi-point electronic control system protocol
JP3388246B2 (en) Remote I / O system for programmable controller
JP3113121B2 (en) Link device expansion method and transfer method thereof
JP2001282312A (en) Display system for plc and data communication method between display and data
JP2724572B2 (en) Token passing LAN device
JPH0448306B2 (en)
JP3465798B2 (en) Distributed control system
JPH02137046A (en) Batch data transfer system
JP4854598B2 (en) Data transfer control device