JPH07212432A - Data repeater - Google Patents

Data repeater

Info

Publication number
JPH07212432A
JPH07212432A JP6006655A JP665594A JPH07212432A JP H07212432 A JPH07212432 A JP H07212432A JP 6006655 A JP6006655 A JP 6006655A JP 665594 A JP665594 A JP 665594A JP H07212432 A JPH07212432 A JP H07212432A
Authority
JP
Japan
Prior art keywords
data
transmission
computer
relay device
data relay
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
JP6006655A
Other languages
Japanese (ja)
Inventor
Nobutaka Yoshida
信隆 吉田
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.)
Fuji Electric Co Ltd
Fuji Facom Corp
Original Assignee
Fuji Electric Co Ltd
Fuji Facom 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 Fuji Electric Co Ltd, Fuji Facom Corp filed Critical Fuji Electric Co Ltd
Priority to JP6006655A priority Critical patent/JPH07212432A/en
Publication of JPH07212432A publication Critical patent/JPH07212432A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To restart data transmission when the power source of a data repeater for performing data transmission with a controller based on instructions from a computer is interrupted during the data transmission and is recovered. CONSTITUTION:At the time of activation, an initial state flag Fi is set at '1' and a response request 'ENQ' is transmitted from this data repeater 2 to the computer 1. Until a response to the response request 'ENQ' is received from the computer 1, the response request 'ENQ' is transmitted while changing a transmission speed BPS successively from the high speed to the low speed of a temporary transmission speed Bx set beforehand. When the response to the response request 'ENQ' is received from the computer 1, in the data repeater 2, the temporary transmission speed Bx at the time is set as the transmission speed BPS with the computer 1. In the computer 1, the initial state flag Fi added to the response request 'ENQ' is referred to it is recognized that the data repeater 2 is in an initial activation state and prescribed setting data are transmitted to the data repeater 2.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、例えば、マイクロコン
ピュータ等の計算機とシーケンサ等の制御装置とを接続
するデータ中継装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data relay device for connecting a computer such as a microcomputer and a control device such as a sequencer.

【0002】[0002]

【従来の技術】従来、マイクロコンピュータとシーケン
サとを専用回線を用いて接続する場合等のように、マイ
クロコンピュータと制御装置とを接続する場合にはRS
232Cインタフェースを用いてシリアル伝送でデータ
伝送を行っており、無手順方式、又は、簡易伝送手順方
式による伝送制御手順によってデータ伝送が行われてい
る。また、RS232Cインタフェースは、ノイズに弱
く、伝送距離を長くすることができないという欠点があ
るので、RS422インタフェース、或いは、RS48
5インタフェースによってデータ伝送を行う場合もあ
る。
2. Description of the Related Art Conventionally, RS is used when connecting a microcomputer and a control device, such as when connecting a microcomputer and a sequencer using a dedicated line.
Data transmission is performed by serial transmission using a 232C interface, and data transmission is performed by a non-procedure method or a transmission control procedure by a simple transmission procedure method. Further, the RS232C interface is vulnerable to noise and has a drawback that the transmission distance cannot be lengthened. Therefore, the RS422 interface or the RS48 interface is used.
In some cases, data transmission is performed by using the five interfaces.

【0003】一般に、マイクロコンピュータ等の計算機
とシーケンサ等の装置とを専用回線を用いてRS485
インタフェース等で接続し、全二重のシリアル伝送を行
う場合等には、両者間での伝送速度を同一に設定する必
要があり、計算機では伝送速度を、セットアップ時、又
は、シリアル伝送開始時にプログラムで設定し、また、
シーケンサでは、ハードウェアの設定スイッチによって
伝送速度を設定するようになされている。
Generally, a computer such as a microcomputer and a device such as a sequencer are RS485 by using a dedicated line.
When connecting with an interface etc. and performing full-duplex serial transmission, it is necessary to set the same transmission speed between them, and the computer sets the transmission speed at the time of setup or when starting serial transmission. And set
In the sequencer, the transmission speed is set by a hardware setting switch.

【0004】そして、計算機とシーケンサ間でのデータ
伝送制御は、シーケンサ側で行う場合と、計算機とシー
ケンサとの間に配設したデータ中継装置によって行う場
合とがあり、データ伝送制御をどの機器によって行うか
は用途によって使い分けするようになされている。この
データ中継装置は、起動時には、その伝送速度は予め設
定されたデフォルト値が設定されるようになされてお
り、データ中継装置によって計算機とシーケンサ間のデ
ータ伝送制御を行う場合に、デフォルト値以外の伝送速
度でデータ伝送を行う場合には、まず、計算機から伝送
速度設定情報をデータ中継装置に出力し、データ中継装
置では入力した伝送速度設定情報をもとに、伝送速度を
変更する。次いで、計算機において、所望の伝送速度に
変更し、計算機とデータ中継装置との伝送速度を同一に
変更した後、データ伝送を行うようになされている。
Data transmission control between the computer and the sequencer may be performed on the sequencer side or by a data relay device arranged between the computer and the sequencer. Which device controls the data transmission. It is designed to be used properly depending on the purpose. When the data relay device is started, the transmission rate is set to a preset default value. When the data relay device controls data transmission between the computer and the sequencer, a value other than the default value is set. When performing data transmission at the transmission rate, first, the computer outputs the transmission rate setting information to the data relay apparatus, and the data relay apparatus changes the transmission rate based on the input transmission rate setting information. Then, in the computer, the data transmission is performed after changing the transmission speed to a desired one and changing the transmission speeds of the computer and the data relay device to be the same.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、上記従
来のデータ中継装置においては、起動時には伝送速度の
デフォルト値が設定されるようになされているため、計
算機とデータ中継装置との間でデフォルト値とは異なる
伝送速度でデータ伝送を行っているときに、例えば、停
電等によってデータ中継装置の電源が電源断となり、そ
の後復帰した場合等には、データ中継装置の伝送速度
は、予め設定した伝送速度のデフォルト値に設定されて
しまい、このとき、計算機は電源断となる前の伝送速度
が設定されているために、計算機とデータ中継装置とで
伝送速度が異なってしまい、計算機とデータ中継装置と
の間でのデータ伝送を行うことができないという未解決
の課題がある。
However, in the above-mentioned conventional data relay apparatus, since the default value of the transmission rate is set at the time of startup, the default value is not set between the computer and the data relay apparatus. When data is transmitted at different transmission speeds, for example, if the power of the data relay device is cut off due to a power failure or the like and then resumes, the transmission speed of the data relay device is the preset transmission speed. Is set to the default value of, and at this time, the transmission speed before the power is cut off is set for the computer, so the transmission speed differs between the computer and the data relay device, and the computer and the data relay device There is an unsolved problem that data cannot be transmitted between the two.

【0006】また、計算機側では、データ中継装置の伝
送速度が変更されてしまったことを認識することができ
ないため、設定した伝送速度が異なるだけであるのにも
かかわらず、伝送異常として認識し、伝送異常が継続し
て生じているものと判断してしまうという問題もある。
また、データ中継装置とシーケンサ間とのデータ伝送に
おいて、データ中継装置がマスタモードとして作動して
いる場合に、データ中継装置が電源断等によって停電
し、そして復帰した場合等には、データ中継装置の動作
モードがデフォルト値であるスレーブモードに設定され
てしまうために、以後シーケンサとのデータ伝送ができ
ず、シーケンサのデータの読み書きができなくなってし
まうという未解決の課題もある。
Further, since the computer cannot recognize that the transmission rate of the data relay device has been changed, it is recognized as a transmission error even though the set transmission rates are different. However, there is also a problem that it is determined that the transmission abnormality continues to occur.
In the data transmission between the data relay device and the sequencer, when the data relay device is operating in the master mode and the data relay device loses power due to power failure or the like and then recovers, the data relay device Since the operation mode of is set to the slave mode which is the default value, there is an unsolved problem that the data transmission with the sequencer cannot be performed thereafter and the data reading and writing of the sequencer cannot be performed.

【0007】そこで、この発明は、上記従来の未解決の
課題に着目してなされたものであり、計算機と制御装置
との間でデータ伝送中に電源断等によって停電になり、
その後復帰した場合でも、確実にデータ伝送を再開する
ことのできるデータ中継装置を提供することを目的とし
ている。
Therefore, the present invention has been made by paying attention to the above-mentioned unsolved problems of the related art, and a power failure or the like causes a power failure during data transmission between a computer and a control device.
It is an object of the present invention to provide a data relay device that can reliably restart data transmission even when it returns after that.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するため
に、請求項1に係わるデータ中継装置においては、図1
の基本構成図に示すように、上位計算機からの指令に基
づき制御装置とのデータ授受を行うデータ中継装置にお
いて、起動時に、前記上位計算機から応答が得られるま
で伝送速度を変更して応答要求キャラクタを送信する送
信手段と、前記上位計算機から前記応答要求キャラクタ
に対する応答を受信したとき、そのときの伝送速度を前
記上位計算機との間の伝送速度として設定する伝送速度
設定手段とを備えることを特徴としている。
In order to achieve the above object, the data relay apparatus according to claim 1 has the configuration shown in FIG.
As shown in the basic configuration diagram of the above, in a data relay device that exchanges data with a control device based on a command from a host computer, at start-up, by changing the transmission speed until a response is obtained from the host computer, a response request character And a transmission rate setting means for setting a transmission rate at that time as a transmission rate with the host computer when a response to the response request character is received from the host computer. I am trying.

【0009】また、請求項2に係わるデータ中継装置に
おいては、請求項1記載の応答要求キャラクタは、デー
タ中継装置の初期起動情報を格納する初期情報領域を備
えることを特徴としている。
Further, in the data relay apparatus according to the second aspect, the response request character according to the first aspect is provided with an initial information area for storing initial activation information of the data relay apparatus.

【0010】[0010]

【作用】例えば、上位計算機からの指令に基づき制御装
置とのデータ授受を行うデータ中継装置において、起動
時に、送信手段によって上位計算機に応答要求キャラク
タを送信し、送信した応答要求キャラクタに対する応答
を上位計算機から得られるまで、伝送速度を変更して送
信し、上位計算機からの応答が得られたとき、伝送速度
設定手段によってその時点での伝送速度を上位計算機と
のデータ伝送時の伝送速度として決定し、このとき、応
答要求キャラクタに設けた初期情報領域に、データ中継
装置が初期起動状態であるという初期起動情報を設定す
ることによって、計算機側は、データ中継装置が初期起
動状態であることを認識する。
For example, in a data relay device for exchanging data with a control device based on a command from a host computer, a response request character is transmitted to the host computer by the transmitting means at startup, and a response to the transmitted response request character is sent to the host computer. The transmission speed is changed until the data is obtained from the computer, and when the response from the host computer is obtained, the transmission speed setting means determines the transmission speed at that time as the data transmission rate with the host computer. However, at this time, by setting the initial activation information that the data relay device is in the initial activation state in the initial information area provided in the response request character, the computer side confirms that the data relay device is in the initial activation state. recognize.

【0011】[0011]

【実施例】以下に、本発明の実施例を図面に基づいて説
明する。図2は、本発明によるデータ中継装置を用いた
データ伝送システムの一実施例を示す概略構成図であ
る。データ中継装置2は、マイクロコンピュータ等の上
位計算機としての計算機1と専用回線L1で接続されR
S485インタフェースによって双方向のデータ伝送を
行い、また、シーケンサ3と専用回線L2によって接続
される。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 2 is a schematic configuration diagram showing an embodiment of a data transmission system using the data relay device according to the present invention. The data relay device 2 is connected to a computer 1 as a host computer such as a microcomputer by a dedicated line L1 and R
Bidirectional data transmission is performed by the S485 interface, and the sequencer 3 and the dedicated line L2 are connected.

【0012】シーケンサ3は、シーケンスコントローラ
31と、外部からの操作指令や制御対象の状態等を検出
する外部機器10に接続され、シーケンス制御に必要な
条件の取り込みを行う入力カプセル32と、制御対象の
外部機器10等に接続され、制御指令を出力する出力カ
プセル33と、例えば他のシーケンサと接続され、シー
ケンサ間のデータ伝送制御等を行うマイクロコントロー
ラ34とから構成され、シーケンスコントローラ31
と、入力カプセル32と、出力カプセル33と、マイク
ロコントローラ34とはツイストペアケーブル等の専用
回線L3によって接続され、入力カプセル32を介して
入力した外部機器10からの入力データをもとにシーケ
ンスコントローラ31において所定の演算処理を行い、
処理結果を出力カプセル33を介して外部機器10に出
力すると共に、マイクロコントローラ34を介して、他
のシーケンサ等とのデータ伝送を行う。
The sequencer 3 is connected to a sequence controller 31, an external device 10 for detecting an operation command from the outside and a state of a controlled object, an input capsule 32 for fetching conditions necessary for sequence control, and a controlled object. Of the external device 10 and the like, which outputs a control command, and, for example, a micro controller 34 which is connected to another sequencer and controls data transmission between the sequencers.
The input capsule 32, the output capsule 33, and the microcontroller 34 are connected by a dedicated line L3 such as a twisted pair cable, and the sequence controller 31 is based on the input data from the external device 10 input via the input capsule 32. Performs predetermined arithmetic processing in
The processing result is output to the external device 10 via the output capsule 33, and data is transmitted to another sequencer or the like via the microcontroller 34.

【0013】データ中継装置2は、計算機1と所定の通
信制御手順によって通信を行い、計算機1からのシーケ
ンサ3のデータの読み書きの指示等の伝送データを受信
し、受信した伝送データが、シーケンサ3へのデータ送
信指令である場合には、シーケンスコントローラ31に
計算機1からの伝送データを送信し、送信終了後、送信
結果を計算機1に送信する。また、計算機1からの伝送
データが、シーケンサ3のデータの読み込み指令である
場合には、指定されたデータをシーケンスコントローラ
31から読み込み、読み込み終了後、シーケンスコント
ローラ31との通信結果と読み込みデータとを計算機1
に送信する。
The data relay device 2 communicates with the computer 1 according to a predetermined communication control procedure, receives transmission data such as an instruction to read / write data of the sequencer 3 from the computer 1, and the received transmission data is the sequencer 3 If it is a data transmission command to the computer 1, the transmission data from the computer 1 is transmitted to the sequence controller 31, and after the transmission is completed, the transmission result is transmitted to the computer 1. If the transmission data from the computer 1 is a data read command for the sequencer 3, the designated data is read from the sequence controller 31, and after the reading is completed, the communication result with the sequence controller 31 and the read data are displayed. Calculator 1
Send to.

【0014】また、データ中継装置2は、起動時に、自
己の初期起動情報を付加した応答要求キャラクタとして
の応答要求“ENQ”を計算機1に送信し、応答要求
“ENQ”に対する応答を計算機1から受信するまで、
伝送速度を変更して応答要求“ENQ”を送信する。図
3は、計算機1とデータ中継装置2との間の伝送制御手
順を示したものである。
When the data relay apparatus 2 is started, the data relay apparatus 2 sends a response request "ENQ" as a response request character added with its own initial activation information to the computer 1, and a response to the response request "ENQ" is sent from the computer 1. Until you receive
The transmission rate is changed and the response request "ENQ" is transmitted. FIG. 3 shows a transmission control procedure between the computer 1 and the data relay apparatus 2.

【0015】計算機1からデータ中継装置2へデータ送
信を行う場合には、図3(a)に示すように、まず、計
算機1から、データ中継装置2に対し応答要求“EN
Q”を送信する。データ中継装置2では、応答要求“E
NQ”に対する応答として、計算機1からの伝送データ
を受信可能であれば、肯定応答“ACK”を送信し、受
信不可であれば、否定応答“NAK”を送信する。
When data is transmitted from the computer 1 to the data relay device 2, as shown in FIG. 3A, first, the computer 1 sends a response request "EN" to the data relay device 2.
Q ”is transmitted. In the data relay device 2, the response request“ E ”is sent.
As a response to NQ, if the transmission data from the computer 1 can be received, an affirmative response “ACK” is transmitted, and if it cannot be received, a negative response “NAK” is transmitted.

【0016】そして、計算機1は、データ中継装置2か
ら肯定応答“ACK”を受信したとき、伝送データの送
信を開始し、データ中継装置2に対し、テキスト開始キ
ャラクタ“STX”に続いて、所定の送信データを送信
し、送信データの送信終了後、テキスト終了キャラクタ
“ETX”を送信する。データ中継装置2では、テキス
ト終了キャラクタ“ETX”を受信したとき、入力した
送信データに伝送誤り等がないかチェックを行い、受信
した送信データに伝送誤りが生じた場合には、計算機1
に否定応答“NAK”を送信し、送信データに伝送誤り
が生じない場合には、通信が正常に行われたものとして
肯定応答“ACK”を送信する。
When the computer 1 receives the positive response "ACK" from the data relay apparatus 2, the computer 1 starts transmission of the transmission data, and the data relay apparatus 2 is followed by a predetermined text start character "STX" and then a predetermined number. The transmission end data is transmitted, and after the transmission of the transmission data is completed, the text end character "ETX" is transmitted. In the data relay device 2, when the end-of-text character "ETX" is received, the input transmission data is checked for a transmission error or the like. If a transmission error occurs in the received transmission data, the computer 1
If a negative response "NAK" is sent to the device and no transmission error occurs in the transmission data, the positive response "ACK" is sent assuming that the communication is normally performed.

【0017】計算機1では、肯定応答“ACK”を受信
したとき、正常にデータ伝送が行われたものと判定しデ
ータ伝送を終了する。ここで、計算機1は、送信データ
の送信が終了し、テキスト終了キャラクタ“ETX”を
送信した後、所定時間以内にデータ中継装置2からなん
らかの応答がない場合には、データ伝送が正常に行われ
なかったものとして、上記と同様にデータ伝送処理を行
い、再度データ中継装置2に応答要求“ENQ”を送信
し、肯定応答“ACK”を受信したとき、伝送データの
送信を開始するものとする。
When the computer 1 receives the affirmative response "ACK", it determines that the data transmission is normally performed, and terminates the data transmission. Here, if the computer 1 does not receive any response from the data relay device 2 within a predetermined time after transmitting the transmission data and transmitting the text end character “ETX”, the data transmission is normally performed. If not, the data transmission process is performed in the same manner as described above, the response request “ENQ” is transmitted to the data relay device 2 again, and when the positive response “ACK” is received, transmission of the transmission data is started. .

【0018】逆に、データ中継装置2から計算機1へデ
ータ送信を行う場合には、上記とは反対に、図3(b)
に示すように、データ中継装置2から、計算機1に対し
て応答要求“ENQ”を送信し、計算機1は応答要求
“ENQ”に対する応答として、伝送データを受信可能
であれば、肯定応答“ACK”を送信し、受信不可であ
る場合には、否定応答“NAK”を送信する。
On the contrary, when data is transmitted from the data relay device 2 to the computer 1, contrary to the above, as shown in FIG.
As shown in FIG. 3, the data relay device 2 transmits a response request “ENQ” to the computer 1, and the computer 1 responds to the response request “ENQ” if the transmission data can be received, an affirmative response “ACK”. Is transmitted, and if it cannot be received, a negative response “NAK” is transmitted.

【0019】データ中継装置2は、計算機1から肯定応
答“ACK”を受信したとき、伝送データの送信を開始
し、テキスト開始キャラクタ“STX”に続いて、所定
の送信データを送信し、所定の送信データの送信が終了
したとき、テキスト終了キャラクタ“ETX”を送信す
る。計算機1では、データ中継装置2からテキスト終了
キャラクタ“ETX”を受信すると、受信した送信デー
タに伝送誤り等がないかエラーチェック等を行い、伝送
エラーがない場合には肯定応答“ACK”を送信し、伝
送エラーがある場合には否定応答“NAK”をデータ中
継装置2に送信する。
When the data relay device 2 receives an affirmative response "ACK" from the computer 1, the data relay device 2 starts transmitting the transmission data, transmits the predetermined transmission data after the text start character "STX", and transmits the predetermined transmission data. When the transmission of the transmission data is completed, the text end character "ETX" is transmitted. When the computer 1 receives the end-of-text character "ETX" from the data relay device 2, it performs an error check or the like to check whether the received transmission data has a transmission error or the like, and if there is no transmission error, transmits an acknowledgment "ACK". However, if there is a transmission error, a negative response “NAK” is transmitted to the data relay device 2.

【0020】そして、データ中継装置2では、計算機1
から肯定応答“ACK”を受信したとき、正常にデータ
伝送が行われたものとしてデータ伝送処理を終了する。
一方、計算機1から否定応答“NAK”を受信した場合
には、データ中継装置2では、再度、計算機1に応答要
求“ENQ”を送信し、上記と同様にデータ伝送処理を
行って、伝送データの再送を行う。
In the data relay device 2, the computer 1
When the positive response “ACK” is received from the device, the data transmission process is terminated assuming that the data transmission is normally performed.
On the other hand, when the negative response “NAK” is received from the computer 1, the data relay device 2 transmits the response request “ENQ” to the computer 1 again, performs the data transmission process in the same manner as above, and transmits the transmission data. Resend.

【0021】ここで、上述の応答要求“ENQ”、肯定
応答“ACK”等の伝送制御キャラクタは、図4に示す
ような構成であり、応答要求“ENQ”は、図4(a)
に示すように、それぞれ1バイトで構成される、ENQ
コードCENQ と、送信元局のアドレスと初期起動情報と
してのイニシャル状態フラグFiとで構成されるSAコ
ードCSAと、伝送制御キャラクタの終結を表すLFコー
ドCLFとの3バイトから、この順に最下位バイトから形
成される。
Here, the transmission control characters such as the response request "ENQ" and the positive response "ACK" have the structure shown in FIG. 4, and the response request "ENQ" is shown in FIG. 4 (a).
As shown in, ENQ consists of 1 byte each, ENQ
The code C ENQ , the SA code C SA including the address of the transmission source station and the initial status flag Fi as the initial activation information, and the LF code C LF indicating the end of the transmission control character are selected in this order from 3 bytes. It is formed from the least significant byte.

【0022】そして、SAコードCSAは、図4(b)に
示すように、最下位ビットを0ビット、最上位ビットを
7ビットとすると、初期情報領域としての3ビット目に
イニシャル状態フラグFiが格納され、4〜7ビット目
に送信元局のアドレスが格納される。また、肯定応答
“ACK”は、図4(c)に示すように、それぞれ1バ
イトで構成される、透過モードのデータ伝送を実現する
ためのDLEコードCDLE と、ACKコードCACK と、
LFコードCLFとの3バイトから、この順に最下位バイ
トから形成され、同様に、否定応答“NAK”は、図4
(d)に示すように、それぞれ1バイトで構成される、
DLEコードCDLE と、NAKコードCNAK と、LFコ
ードCLFとの3バイトから、この順に最下位バイトから
形成される。
As shown in FIG. 4B, the SA code C SA has the least significant bit of 0 bit and the most significant bit of 7 bit, and the initial state flag Fi at the 3rd bit as the initial information area. Is stored, and the address of the transmission source station is stored in the 4th to 7th bits. In addition, as shown in FIG. 4C, the acknowledgment “ACK” includes a DLE code C DLE and an ACK code C ACK , each of which is composed of 1 byte, for realizing transparent mode data transmission.
It is formed from the least significant byte in this order from the 3 bytes of the LF code C LF, and similarly, the negative response “NAK” is shown in FIG.
As shown in (d), each consists of 1 byte,
The DLE code C DLE , the NAK code C NAK, and the LF code C LF are formed from 3 bytes, in this order from the least significant byte.

【0023】そして、送信データは、図4(e)に示す
ように、それぞれ、1バイトで構成されるDLEコード
DLE と、送信データの開始を表すSTXコードCSTX
と、送信データとして送信するテキストデータのデータ
長に4バイトを加算した送信データバイト数を表すLE
NコードCLEN と、テキストデータ長に応じたバイト数
のテキストデータコードCDAT と、さらに、1バイトで
構成される、DELコードCDEL と、テキストデータの
終結を表すETXコードCETX と、伝送誤り検出のため
のBCCコードCBCC と、LFコードCLFとから、この
順に最下位バイトから形成される。
As shown in FIG. 4 (e), the transmission data includes a DLE code C DLE each consisting of 1 byte and an STX code C STX indicating the start of the transmission data.
And LE representing the number of transmission data bytes obtained by adding 4 bytes to the data length of the text data to be transmitted as transmission data.
N code C LEN , text data code C DAT with the number of bytes according to the text data length, DEL code C DEL composed of 1 byte, ETX code C ETX indicating the end of text data, and transmission The least significant byte is formed in this order from the BCC code C BCC for error detection and the LF code C LF .

【0024】次に、上記実施例の動作を、図5に示す、
起動時のデータ中継装置2の処理手順を示すフローチャ
ートに基づき説明する。データ中継装置2は、起動時に
は、まず、ステップS1において、応答要求“ENQ”
のイニシャル状態フラグFiを“1”にセットし、ステ
ップS2に移行する。
Next, the operation of the above embodiment is shown in FIG.
An explanation will be given based on a flowchart showing a processing procedure of the data relay device 2 at the time of startup. When the data relay device 2 is activated, first, in step S1, a response request “ENQ” is sent.
The initial state flag Fi is set to "1", and the process proceeds to step S2.

【0025】そして、ステップS2では、仮伝送速度B
xの設定値として、例えば、B1<B2<……<Bnを
満たすn種類の伝送速度が設定した場合には、カウント
値Xの初期値として伝送速度の設定数“n”を設定し、
ステップS3に移行する。ステップS3では、予め設定
した仮伝送速度Bx を伝送速度BPSとして仮設定し、
ステップS4に移行において、ステップS3で仮設定し
た伝送速度BPS、すなわち、仮伝送速度Bxで、応答
要求“ENQ”を計算機1に送信する。
Then, in step S2, the temporary transmission rate B
For example, when n kinds of transmission rates satisfying B1 <B2 <... <Bn are set as the set value of x, the set number “n” of transmission rates is set as the initial value of the count value X,
Control goes to step S3. In step S3, the preset provisional transmission rate Bx is provisionally set as the transmission rate BPS,
In step S4, the response request “ENQ” is transmitted to the computer 1 at the transmission rate BPS provisionally set in step S3, that is, the provisional transmission rate Bx.

【0026】次いで、ステップS5では、ステップS4
で送信した応答要求“ENQ”に対する計算機1からの
応答を予め設定した所定時間内に受信したか否かを判定
し、応答要求“ENQ”に対する応答を受信した場合に
は、ステップS6に移行する。そして、ステップS6で
は、現時点での伝送速度BPS、すなわち、仮伝送速度
Bxを計算機1との伝送速度BPSとして決定し、応答
要求“ENQ”のイニシャル状態フラグFiを“0”に
設定し、起動時の処理を終了する。
Then, in step S5, step S4
It is determined whether or not the response from the computer 1 to the response request "ENQ" transmitted in step S6 has been received within a preset time, and if a response to the response request "ENQ" is received, the process proceeds to step S6. . Then, in step S6, the current transmission rate BPS, that is, the provisional transmission rate Bx is determined as the transmission rate BPS with the computer 1, the initial state flag Fi of the response request "ENQ" is set to "0", and the activation is started. The time processing ends.

【0027】一方、ステップS5で、計算機1からの応
答要求“ENQ”に対する応答を、予め設定した所定時
間内に受信しない場合には、ステップS7に移行し、X
=X−1とした後、ステップS8に移行し、X=0であ
るか否かを判定し、X=0でない場合にはステップS3
に戻り、X=0である場合にはステップS9に移行し
て、計算機1との伝送異常が発生したものと判定し処理
を終了する。
On the other hand, in step S5, when the response to the response request "ENQ" from the computer 1 is not received within the preset predetermined time, the process proceeds to step S7 and X
= X−1, the process proceeds to step S8, and it is determined whether or not X = 0. If X = 0, step S3
Returning to step S10, when X = 0, the process proceeds to step S9, it is determined that the transmission abnormality with the computer 1 has occurred, and the process is ended.

【0028】ここで、ステップS1〜S5及びステップ
S7〜S9が送信手段に対応し、ステップS6が伝送速
度設定手段に対応している。したがって、例えば、今、
各機器が正常に作動しており、シーケンサ3では、入力
カプセル32を介して外部機器10からの入力データを
もとに所定の演算処理を行い、その演算結果を出力カプ
セル33を介して外部機器10に出力すると共に、マイ
クロコントローラ34を介して他のシーケンサ等に演算
結果を出力しているものとする。
Here, steps S1 to S5 and steps S7 to S9 correspond to transmitting means, and step S6 corresponds to transmission rate setting means. So, for example, now
Each device is operating normally, and the sequencer 3 performs a predetermined calculation process based on the input data from the external device 10 via the input capsule 32, and outputs the calculation result via the output capsule 33 to the external device. It is assumed that the operation result is output to 10 and the operation result is output to another sequencer or the like via the microcontroller 34.

【0029】また、仮伝送速度として、B1<B2<B
3を満たす伝送速度が設定されているものとする。この
とき、計算機1とデータ中継装置2との間では、デフォ
ルト値とは異なる伝送速度BPS、例えば、B2bps
でデータ通信が行われ、データ中継装置2はマスタモー
ドでシーケンサ3とデータ通信を行い、計算機1からの
指令に基づいて、例えば、シーケンサ3の演算処理結果
等を読み込み、読み込んだ演算処理結果を読み込みデー
タとして、計算機1に送信しているものとする。
Further, as the provisional transmission rate, B1 <B2 <B
It is assumed that the transmission rate satisfying 3 is set. At this time, between the computer 1 and the data relay device 2, a transmission rate BPS different from the default value, for example, B2bps.
The data relay device 2 performs data communication with the sequencer 3 in the master mode, reads the operation processing result of the sequencer 3 based on a command from the computer 1, and displays the read operation processing result. It is assumed that the read data is transmitted to the computer 1.

【0030】この状態で、例えば、データ中継装置2が
停電等によって電源断となったものとする。これによっ
て、データ中継装置2は、電源断となったことにより、
各種設定値が、全てデフォルト値に設定されてしまい、
伝送速度BPSはデフォルト値としてB1bpsが設定
され、また、動作モードがスレーブモードに設定された
とする。
In this state, for example, it is assumed that the data relay device 2 is cut off due to a power failure or the like. As a result, the power of the data relay device 2 is cut off,
All setting values are set to default values,
It is assumed that the transmission rate BPS is set to B1bps as a default value and the operation mode is set to the slave mode.

【0031】この状態で、データ中継装置2が再起動し
た場合には、データ中継装置2では、まず、応答要求
“ENQ”のイニシャル状態フラグFiを“1”に設定
し、この場合、仮伝送速度として3種類の伝送速度が設
定されているので、伝送速度BPSとして、最大伝送速
度である仮伝送速度B3bpsを仮設定し、伝送速度B
3 bpsで、応答要求“ENQ”を計算機1に送信す
る。
When the data relay device 2 is restarted in this state, the data relay device 2 first sets the initial state flag Fi of the response request "ENQ" to "1", and in this case, the temporary transmission is performed. Since three types of transmission rates are set, the provisional transmission rate B3bps, which is the maximum transmission rate, is provisionally set as the transmission rate BPS.
The response request “ENQ” is transmitted to the computer 1 at 3 bps.

【0032】このとき、計算機1の伝送速度BPSは、
デフォルト値に戻ることなくB2bpsのままであり、
データ中継装置2からは伝送速度BPS=B3bpsで
送信されるので、計算機1側は、データ中継装置2から
の応答要求“ENQ”を受信することができない。よっ
て、データ中継装置2では、予め設定した所定時間内
に、計算機1からの応答要求“ENQ”に対する応答を
受信することができないので、計算機1と伝送速度BP
Sが異なるものと判定し、次に、伝送速度BPSとし
て、次に伝送速度の大きい仮伝送速度B2を設定し、伝
送速度B2bpsで、応答要求“ENQ”を計算機1に
送信する。
At this time, the transmission rate BPS of the computer 1 is
B2bps remains, without returning to the default value,
Since the data relay device 2 transmits at the transmission rate BPS = B3 bps, the computer 1 side cannot receive the response request “ENQ” from the data relay device 2. Therefore, the data relay apparatus 2 cannot receive the response to the response request “ENQ” from the computer 1 within the preset predetermined time, and therefore the computer 1 and the transmission rate BP
It is determined that S is different, then the provisional transmission rate B2 having the next largest transmission rate is set as the transmission rate BPS, and the response request “ENQ” is transmitted to the computer 1 at the transmission rate B2 bps.

【0033】このとき、計算機1とデータ中継装置2と
の伝送速度BPSは共に、B2bpsであるので、計算
機1は、データ中継装置2からの応答要求“ENQ”を
受信することができ、応答要求“ENQ”のアドレス情
報を参照してデータ中継装置2からの応答要求“EN
Q”であることを認識し、応答要求“ENQ”に対する
応答として肯定応答“ACK”をデータ中継装置2に送
信する。
At this time, since the transmission rates BPS of the computer 1 and the data relay device 2 are both B2bps, the computer 1 can receive the response request "ENQ" from the data relay device 2 and the response request. A response request “EN” from the data relay device 2 is made by referring to the address information of “ENQ”.
It recognizes that it is "Q", and transmits an affirmative response "ACK" to the data relay device 2 as a response to the response request "ENQ".

【0034】また、計算機1では、受信した応答要求
“ENQ”のイニシャル状態フラグFiを参照し、イニ
シャル状態フラグFiが“1”であるので、データ中継
装置2が初期起動状態であることを認識し、例えば、デ
ータ中継装置2の動作モードはマスタモードであること
等、電源断となる前にデータ中継装置2に対して設定し
た各種設定データを再度データ中継装置2に送信する。
Further, the computer 1 refers to the initial state flag Fi of the received response request "ENQ", and since the initial state flag Fi is "1", it recognizes that the data relay device 2 is in the initial starting state. However, for example, the operation mode of the data relay device 2 is the master mode, and various setting data set for the data relay device 2 before the power is turned off is transmitted again to the data relay device 2.

【0035】データ中継装置2では、計算機1から肯定
応答“ACK”を受信したことによって、計算機1との
伝送速度BPSをB2bpsとして決定し、応答要求
“ENQ”のイニシャル状態フラグFiを“0”に変更
し、続いて、計算機1からの動作モードはマスタモード
であるという設定データに基づきモード設定を行い、ま
た、計算機1からの各種設定データに基づき所定の設定
を行う。
The data relay device 2 receives the positive response "ACK" from the computer 1, and thus determines the transmission rate BPS with the computer 1 as B2bps, and sets the initial state flag Fi of the response request "ENQ" to "0". Then, the mode setting is performed based on the setting data that the operation mode from the computer 1 is the master mode, and the predetermined setting is performed based on various setting data from the computer 1.

【0036】これによって、データ中継装置2は、電源
断となる前と同一の各種設定データが設定されることに
なり、よって、計算機1との間のデータ通信を行うこと
が可能となり、また、データ中継装置2では動作モード
をマスタモードとして設定することによって、シーケン
サ3に対してデータの読み書きを行うことが可能とな
り、データ中継装置2が電源断となる以前の機器状態を
再現することができ、計算機1とシーケンサ3とのデー
タ伝送を再開することができる。
As a result, the data relay device 2 is set with the same various setting data as before the power was turned off. Therefore, it becomes possible to perform data communication with the computer 1, and By setting the operation mode as the master mode in the data relay device 2, it becomes possible to read / write data from / to the sequencer 3, and it is possible to reproduce the device state before the power of the data relay device 2 was cut off. The data transmission between the computer 1 and the sequencer 3 can be restarted.

【0037】一方、データ中継装置2において、伝送速
度BPSとして仮伝送速度B1,B2,B3を設定して
送信しても、応答要求“ENQ”に対する応答が得られ
ない場合には、計算機1との通信異常であるものと判定
し処理を終了する。したがって、上記実施例において
は、起動時に、データ中継装置2が、イニシャル状態フ
ラグを“1”とし、伝送速度BPSを予め設定した仮伝
送速度Bxの最大値に仮設定して応答要求“ENQ”を
計算機1に送信し、計算機1から応答があるまで、伝送
速度BPSを順次仮伝送速度Bxの小さい値に変更して
応答要求“ENQ”を送信し、計算機1から応答があっ
たときの仮伝送速度Bxを計算機1との伝送速度BPS
として決定することによって、計算機1とデータ中継装
置2とでデータ伝送中にデータ中継装置2が電源断とな
り再起動した場合でも、データ中継装置2において計算
機1の伝送速度BPSを検索して、検索した伝送速度B
PSを伝送速度として設定することによって、オペレー
タが介入することなくデータ伝送を再開することがで
き、計算機側ではデータ中継装置2に電源断が生じたこ
とを何ら気にすることなくデータ伝送を継続して行うこ
とができる。
On the other hand, in the data relay apparatus 2, if the response to the response request "ENQ" is not obtained even if the temporary transmission rates B1, B2 and B3 are set as the transmission rate BPS and transmitted, the computer 1 and The communication is determined to be abnormal, and the process ends. Therefore, in the above embodiment, at the time of start-up, the data relay device 2 sets the initial state flag to "1" and temporarily sets the transmission rate BPS to the maximum value of the provisional transmission rate Bx set in advance, and the response request "ENQ". To the computer 1, the transmission speed BPS is sequentially changed to a smaller value of the temporary transmission speed Bx until a response is sent from the computer 1, and a response request “ENQ” is transmitted. Transmission speed Bx is the transmission speed BPS with computer 1.
Therefore, even when the data relay device 2 is powered off and restarted during data transmission between the computer 1 and the data relay device 2, the data relay device 2 searches for the transmission speed BPS of the computer 1 and searches. Transmission speed B
By setting PS as the transmission speed, the data transmission can be restarted without intervention of the operator, and the data transmission is continued on the computer side without worrying about the power failure of the data relay device 2. You can do it.

【0038】また、データ中継装置2は、起動時に、計
算機1に、応答要求“ENQ”のイニシャル状態フラグ
Fiを“1”として送信することによって、計算機1で
は、イニシャル状態フラグFiが“1”か“0”である
かを判定することによってデータ中継装置2が初期状態
であるか否かを容易に認識することができ、データ伝送
中に停電等によって電源断となった場合でも、データ中
継装置2との伝送異常であると認識することなく、デー
タ中継装置2が新たに起動したことを確実に認識するこ
とができる。
Further, the data relay device 2 transmits the initial state flag Fi of the response request "ENQ" as "1" to the computer 1 at the time of starting, so that the initial state flag Fi in the computer 1 is "1". It is possible to easily recognize whether or not the data relay device 2 is in the initial state by determining whether the data relay device 2 is in the initial state or not. It is possible to surely recognize that the data relay device 2 is newly activated without recognizing that there is an abnormal transmission with the device 2.

【0039】なお、上記実施例においては、伝送速度B
PSとして仮伝送速度Bxの大きいものから設定するよ
うになされているが、伝送速度の小さいものから設定す
るようにすることも可能である。また、上記実施例にお
いては、データ中継装置と上位計算機間とでのRS48
5インタフェースによって全二重のシリアル伝送を行う
場合について説明したが、これに限らず、装置間でのデ
ータ伝送を行う場合に、両者間での伝送速度を同一に設
定してデータ伝送を行う場合であれば適用することが可
能である。
In the above embodiment, the transmission speed B
The PS is set from the one having the higher provisional transmission rate Bx, but it may be set from the one having the lower transmission rate. In the above embodiment, the RS48 between the data relay device and the host computer is used.
The case has been described where full-duplex serial transmission is performed using 5 interfaces, but the present invention is not limited to this, and when data transmission is performed between devices, the same transmission rate is set between both devices and data transmission is performed. If so, it can be applied.

【0040】さらに、上記実施例においては、上位計算
機とデータ中継装置との間で透過モードでデータ伝送を
行う場合について説明したが、透過モードでデータ伝送
を行わない場合でも適用することができる。
Further, in the above embodiment, the case where the data transmission is performed between the host computer and the data relay device in the transparent mode has been described, but the present invention can be applied even when the data transmission is not performed in the transparent mode.

【0041】[0041]

【発明の効果】以上説明したように、本発明に係わるデ
ータ中継装置によれば、上位計算機からの指令に基づき
制御装置とのデータ授受を行うデータ中継装置におい
て、起動時に、送信手段によって応答要求キャラクタを
上位計算機に送信し、上位計算機から応答が得られるま
で伝送速度を順次変更して送信し、応答要求キャラクタ
を送信する際に、応答要求キャラクタに設けた起動情報
領域にデータ中継装置の初期起動情報を付加して送信す
ることにより、データ伝送中にデータ中継装置が電源断
となりその後再起動した場合でも、確実に計算機と制御
装置との間でのデータ伝送を再開することができ、ま
た、計算機に対してデータ中継装置の初期起動状態を容
易に認識させることができる。
As described above, according to the data relay apparatus of the present invention, in the data relay apparatus for exchanging data with the control unit based on the command from the host computer, the response request is made by the transmitting means at the time of starting. The character is sent to the host computer, the transmission speed is sequentially changed until a response is received from the host computer, and when the response request character is sent, the initial of the data relay device is set in the activation information area provided in the response request character. By adding start information and transmitting it, even if the data relay device is powered off during data transmission and restarted after that, data transmission between the computer and the control device can be reliably restarted, and , The computer can easily recognize the initial activation state of the data relay device.

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

【図1】本発明の基本構成を示す概略構成図である。FIG. 1 is a schematic configuration diagram showing a basic configuration of the present invention.

【図2】本発明の一実施例を示す概略構成図である。FIG. 2 is a schematic configuration diagram showing an embodiment of the present invention.

【図3】計算機及びデータ中継装置間の通信制御手順を
示した説明図である。
FIG. 3 is an explanatory diagram showing a communication control procedure between a computer and a data relay device.

【図4】伝送制御キャラクタの構成を示す説明図であ
る。
FIG. 4 is an explanatory diagram showing a structure of a transmission control character.

【図5】データ中継装置の起動時の処理手順を示すフロ
ーチャートである。
FIG. 5 is a flowchart showing a processing procedure when the data relay device is activated.

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

1 計算機 2 データ中継装置 3 シーケンサ 31 シーケンスコントローラ 32 入力カプセル 33 出力カプセル Fi イニシャル状態フラグ 1 Computer 2 Data Relay Device 3 Sequencer 31 Sequence Controller 32 Input Capsule 33 Output Capsule Fi Initial State Flag

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 上位計算機からの指令に基づき制御装置
とのデータ授受を行うデータ中継装置において、起動時
に、前記上位計算機から応答が得られるまで伝送速度を
変更して応答要求キャラクタを送信する送信手段と、前
記上位計算機から前記応答要求キャラクタに対する応答
を受信したとき、そのときの伝送速度を前記上位計算機
との間の伝送速度として設定する伝送速度設定手段とを
備えることを特徴とするデータ中継装置。
1. A data relay device for transmitting and receiving data to and from a control device based on a command from a host computer, at the time of startup, transmitting a response request character by changing a transmission rate until a response is obtained from the host computer. And a transmission rate setting means for setting a transmission rate at that time as a transmission rate with the host computer when a response to the response request character is received from the host computer. apparatus.
【請求項2】 前記応答要求キャラクタは、データ中継
装置の初期起動情報を格納する初期情報領域を備えるこ
とを特徴とする請求項1記載のデータ中継装置。
2. The data relay device according to claim 1, wherein the response request character includes an initial information area for storing initial activation information of the data relay device.
JP6006655A 1994-01-25 1994-01-25 Data repeater Pending JPH07212432A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6006655A JPH07212432A (en) 1994-01-25 1994-01-25 Data repeater

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6006655A JPH07212432A (en) 1994-01-25 1994-01-25 Data repeater

Publications (1)

Publication Number Publication Date
JPH07212432A true JPH07212432A (en) 1995-08-11

Family

ID=11644398

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6006655A Pending JPH07212432A (en) 1994-01-25 1994-01-25 Data repeater

Country Status (1)

Country Link
JP (1) JPH07212432A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014041548A (en) * 2012-08-23 2014-03-06 Canon Inc Electronic system and communication control method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014041548A (en) * 2012-08-23 2014-03-06 Canon Inc Electronic system and communication control method
US9075628B2 (en) 2012-08-23 2015-07-07 Canon Kabushiki Kaisha Electronic system and communication control method for transmitting and receiving data by serial communication

Similar Documents

Publication Publication Date Title
JPH03175560A (en) Method of communication between plural programmable logic controllers
JPH01105645A (en) Operation of system with data set and data terminal
US4675864A (en) Serial bus system
JPS604624B2 (en) System for retransmitting incorrect information frames
JPH0252281B2 (en)
US5392425A (en) Channel-initiated retry and unit check for peripheral devices
JPH07212432A (en) Data repeater
CN113556210B (en) Upper computer and method for establishing communication connection
JPH0438618Y2 (en)
JP3606593B2 (en) Multiple data batch transfer control method
JP2002358177A (en) Image forming apparatus, serial communication method for the apparatus, program for allowing computer to perform the method and recording medium with the program recorded thereon
JP3460502B2 (en) Serial transmission system
KR0141718B1 (en) PD communication device
JP3483738B2 (en) Data communication device
JPH07273835A (en) Numerical controller with serial communication state display function
JPS59200362A (en) Control system of terminal device
JPH0444456B2 (en)
JP2863127B2 (en) Communication device
JP3261830B2 (en) Self-diagnosis method of interface of customer display having RS232 interface
JPH05216793A (en) Device and method for communication control
JPS5983431A (en) Method for controlling data transmission
JP2980550B2 (en) Communication device
JPH0234518B2 (en)
JPS5948584B2 (en) Data frame transmission/reception control method
JPS58154030A (en) Dma controlling system