JP2001016297A - Serial communication equipment, serial communication method and storage medium - Google Patents

Serial communication equipment, serial communication method and storage medium

Info

Publication number
JP2001016297A
JP2001016297A JP11184987A JP18498799A JP2001016297A JP 2001016297 A JP2001016297 A JP 2001016297A JP 11184987 A JP11184987 A JP 11184987A JP 18498799 A JP18498799 A JP 18498799A JP 2001016297 A JP2001016297 A JP 2001016297A
Authority
JP
Japan
Prior art keywords
serial communication
diagnosis
self
communication
master station
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.)
Withdrawn
Application number
JP11184987A
Other languages
Japanese (ja)
Inventor
Yukihide Ushio
行秀 牛尾
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP11184987A priority Critical patent/JP2001016297A/en
Publication of JP2001016297A publication Critical patent/JP2001016297A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To self-diagnose that a communication request signal from a slave station is normally in operation while maintaining the reliability of serial communication between a master station and the slave station. SOLUTION: In the serial communication method, when communication frequency between a master station and each slave station is less, e.g. in a standby state for an operating state of an electronic photographing device adopting this serial communication system, fault discrimination processing of a communication request signal from a slave station in steps S5-S12 is conducted in addition to the substantial serial communication and when the operating state has many communication frequencies between the master station and each slave station e.g. during a print state, this fault discrimination processing is skipped and only the substantial serial communication is exclusively conducted.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、電子機器内に設け
られた中央処理ユニットおよび複数の電気ユニット間の
情報通信をシリアルで行うシリアル通信装置、シリアル
通信方法および記憶媒体に関する。
The present invention relates to a serial communication device, a serial communication method, and a storage medium for serially communicating information between a central processing unit and a plurality of electric units provided in an electronic device.

【0002】[0002]

【従来の技術】電子機器内に設けられた中央処理ユニッ
トおよび複数の電気ユニット間の情報通信をシリアルで
行うシリアル通信装置は、従来より知られている。
2. Description of the Related Art A serial communication device for serially communicating information between a central processing unit and a plurality of electric units provided in an electronic device has been known.

【0003】かかるシリアル通信装置は、当該電子機器
内の中央処理ユニットが有する主局と称されるシリアル
通信のためのメイン装置と、当該電子機器内に点在する
複数の電気ユニットが有する従局と称されるシリアル通
信のためのサブ装置によって構成され、このメイン装置
とサブ装置との間で情報交換を実行するもので、電子機
器の組み立て易さと製造コストを抑制することを目的と
して多くの電子機器で利用されている。
[0003] Such a serial communication device includes a main device for serial communication called a master station of a central processing unit in the electronic device, and a slave station of a plurality of electric units scattered in the electronic device. The main device and the sub-device exchange information between the main device and the sub-device. Many electronic devices are used for the purpose of suppressing the ease of assembling electronic devices and manufacturing costs. Used in equipment.

【0004】シリアル通信装置による情報交換は、基本
的には、中央処理ユニットであるCPUに付随する主局
が発生する情報交換要求に応じて実行されるシリアル通
信によりなされていた。したがって、従局が情報交換を
行いたい場合には、通信要求信号を主局に送信し、この
信号を主局が受信すると、これに応じて主局はシリアル
通信を実行することで、従局からの情報更新を実施し
て、双方の情報交換が行われていた。この情報交換は、
あくまでも主局と従局とが1対1で実施されるため、主
局から発生される転送情報は特定の従局に対して転送さ
れたものであり、且つ、従局から返送される転送情報は
主局によって特定される従局からのものであるというこ
とを、主局と従局双方が認識していなければならなかっ
た。
Information exchange by a serial communication device has been basically performed by serial communication executed in response to an information exchange request generated by a main station attached to a CPU serving as a central processing unit. Therefore, when the slave station wants to exchange information, it transmits a communication request signal to the master station, and when the master station receives this signal, the master station executes serial communication in response to the signal, thereby receiving a signal from the slave station. Information was updated and both parties exchanged information. This exchange of information
Since the master station and the slave station are implemented on a one-to-one basis, the transfer information generated from the master station is transferred to a specific slave station, and the transfer information returned from the slave station is the master station. Both the master and slave stations had to be aware that they came from the slave station identified by

【0005】このため、従来のシリアル通信装置の多く
は、転送情報に従局を指定する識別子情報を添付して転
送していた。したがって、この転送方法では、伝送路に
接続可能なすべての従局を識別子情報で区別する必要が
あるため、従局の最大数を限定した上で成り立ってい
た。つまり、従局へ転送されるデータ(転送情報+識別
子情報)のデータ長(ビット数)は、伝送路に存在可能
な最大従局数に応じて決定されるため、最大従局数を限
定しないと、その通信プロトコルやデータ処理装置を設
計することができないという意味である。
For this reason, many conventional serial communication devices have attached transfer information with identifier information designating a slave station. Therefore, in this transfer method, it is necessary to distinguish all the slave stations connectable to the transmission line by the identifier information, so that the method is established after limiting the maximum number of slave stations. In other words, the data length (number of bits) of the data (transfer information + identifier information) transferred to the slave station is determined according to the maximum number of slave stations that can exist on the transmission path. This means that communication protocols and data processing devices cannot be designed.

【0006】このように、従来のシリアル通信装置で
は、予め接続可能な従局数を定める必要があるために、
従局数を現実に必要な数より多めに取って、その通信プ
ロトコルやデータ処理装置を設計しなければならず、シ
リアル通信装置を製造するためのコストが増大してい
た。
As described above, in the conventional serial communication device, it is necessary to determine the number of connectable slave stations in advance.
The number of slave stations must be set larger than actually required, and the communication protocol and the data processing device must be designed. This has increased the cost for manufacturing a serial communication device.

【0007】さらに、電子機器内の従局数の構成が変更
され、これに応じて設計変更する場合には、基本となる
転送データのデータ長が変更されるため、少なくともデ
ータ処理装置部分は再設計する必要があった。
Further, when the configuration of the number of slave stations in the electronic equipment is changed and the design is changed accordingly, the data length of the basic transfer data is changed. I needed to.

【0008】そこで、近年では一つの従局へ転送される
データ(転送情報+識別子情報)のデータ長(転送情報
ビット数+識別子情報ビット数)を固定にしたままで、
半無限の数の従局を接続可能にする通信プロトコルおよ
びこの通信プロトコルに基づいてデータ処理を行うデー
タ処理装置で構成されるシリアル通信装置が開発される
ようになった。これにより、電子機器内に設けられる従
局数に拘わらず、同一のシリアル通信装置を最適な従局
数構成で使用できるようになり、したがって、途中の設
計変更にも簡単に対応できるようになるとともに、上記
従来のシリアル通信装置に比べて製造コストを削減する
ことができるようになった。
In recent years, therefore, the data length (the number of transfer information bits + the number of identifier information bits) of the data (the transfer information + identifier information) transferred to one slave station has been fixed.
2. Description of the Related Art A serial communication device including a communication protocol that enables connection of a semi-infinite number of slave stations and a data processing device that performs data processing based on the communication protocol has been developed. As a result, the same serial communication device can be used with an optimum number of slave stations regardless of the number of slave stations provided in the electronic device, so that it is possible to easily cope with a design change in the middle, and The manufacturing cost can be reduced as compared with the conventional serial communication device.

【0009】以下、この転送情報ビット数と識別子情報
ビット数を固定にしたままで、半無限の数の従局を接続
可能にするシリアル通信装置を、図7〜図15に基づい
て詳細に説明するが、その前に、このシリアル通信装置
の概要を説明する。
Hereinafter, a serial communication device which can connect a semi-infinite number of slave stations while keeping the number of transfer information bits and the number of identifier information bits fixed will be described in detail with reference to FIGS. Before that, an outline of this serial communication device will be described.

【0010】本シリアル通信装置では、主局が所定デー
タ長の転送情報を作成して、各従局が有するシフトレジ
スタ回路(その構成ビット数は、説明の都合上、たとえ
ば4ビットとするが、特にこのビット数に限定されるも
のではない)に、転送クロックと共に主局からの従局並
列出力情報をシフト転送し、この主局によるシフト転送
の前に予め、シフトレジスタ回路に主局へ返送すべき従
局並列入力情報をロードさせることで、主局が実行する
シフト転送で主局と各従局との情報交換が行われるよう
に構成されている。
In this serial communication apparatus, the master station creates transfer information of a predetermined data length, and the shift register circuit of each slave station (the number of constituent bits is, for example, 4 bits for convenience of explanation. The number of bits is not limited to this.) The slave station parallel output information from the master station is shift-transferred together with the transfer clock, and should be returned to the shift register circuit in advance to the shift register circuit before the shift transfer by the master station. By loading the parallel input information of the slave stations, information is exchanged between the master station and each slave station in the shift transfer performed by the master station.

【0011】また、各従局は、それぞれ位相制御カウン
タ回路を備え、この位相制御カウンタ回路のカウント値
で指示される動作を実行するように構成されている。そ
して、主局が、この位相制御カウンタのカウント値を操
作することにより、当該従局の、たとえばシフトレジス
タ回路などに対する動作制御を行うことができるように
なっている。この各従局の位相制御カウンタ回路を制御
するために、主局も位相制御カウンタを備え、従局側の
位相制御カウンタ回路と同様に動作制御させることで、
従局の動作状況をそのカウント値にて把握できるように
して伝送路中の各従局の動作制御を実行してシリアル通
信を行うようにしている。
Each slave station has a phase control counter circuit, and is configured to execute an operation specified by the count value of the phase control counter circuit. By controlling the count value of the phase control counter, the master station can control the operation of the slave station with respect to, for example, a shift register circuit. In order to control the phase control counter circuit of each slave station, the master station also includes a phase control counter, and by performing operation control in the same manner as the phase control counter circuit of the slave station,
The operation status of each slave station can be grasped by its count value, and the operation control of each slave station in the transmission path is executed to perform serial communication.

【0012】一方、主局は、伝送路に接続され得る半無
限の数の従局を、固定された識別子情報ビット数で認識
して1対1の情報交換を実施するために、二種類のシリ
アル通信を独立して実行するように構成されている。
On the other hand, the master station recognizes a semi-infinite number of slave stations that can be connected to the transmission line with a fixed number of identifier information bits, and implements one-to-one information exchange in order to perform two-to-one information exchange. It is configured to perform communication independently.

【0013】一つは、伝送路に存在する従局を認識する
ことを目的とした通信であり、本シリアル通信装置では
「初期化通信」と称している。この初期化通信では、各
従局が有する識別子情報を受信し、この識別子情報に基
づいて伝送路中の従局配列順番を認識する。
One is communication for the purpose of recognizing a slave station existing on a transmission line, and is called "initialization communication" in the present serial communication device. In this initialization communication, identifier information of each slave station is received, and the sequence of slave stations in the transmission path is recognized based on the identifier information.

【0014】もう一つは、初期化通信で認識された従局
配列順番に従ったシフト転送データを作成して、転送す
る通信であり、本シリアル通信装置では「通常通信」と
称している。この通常通信では、各従局との情報交換が
1対1で行われる。つまり、現状の伝送路に接続された
従局配列順番は、初期化通信で一度認識されれば、不変
であるため、その従局配列順番に従って作成されたデー
タを主局が各従局へシフト転送すれば、同様に、各従局
からは、その従局配列順番に従って作成された返送情報
データがシフト返送されるため、容易に情報交換が行わ
れる。
The other is communication for creating and transferring shift transfer data in accordance with the sequence of slave stations recognized in the initialization communication, and is called "normal communication" in the present serial communication device. In this normal communication, information exchange with each slave station is performed on a one-to-one basis. In other words, the sequence of the slave stations connected to the current transmission path is invariable once recognized by the initialization communication, so if the master station shifts and transfers data created according to the slave station order to each slave station, Similarly, from each slave station, return information data created in accordance with the order of arrangement of the slave stations is shifted and returned, so that information exchange is easily performed.

【0015】ここで、固定された識別子情報ビット数で
表現できる従局数以上の従局数を認識するための基本的
考えを説明する。なお、この固定された識別子情報ビッ
ト数は、たとえば4ビットとして説明するが、これは説
明の都合上であって、特に限定されたものではない。
Here, a basic idea for recognizing the number of slave stations equal to or greater than the number of slave stations that can be represented by a fixed number of bits of identifier information will be described. Note that the fixed number of identifier information bits will be described as, for example, 4 bits, but this is for convenience of description and is not particularly limited.

【0016】まず、前提として、本シリアル通信装置が
適用される電子機器の構成を基に従局を2種類に区別す
る。
First, as a premise, a slave station is classified into two types based on the configuration of electronic equipment to which the present serial communication device is applied.

【0017】一つは、電子機器本体の動作にとって必須
のユニットとして使用される従局を「本体ユニット」と
呼び、識別子情報を固定値コードで割り振る。
One is that a slave station used as an indispensable unit for the operation of the electronic device main body is called a “main unit”, and identifier information is assigned by a fixed value code.

【0018】もう一つは、電子機器本体の動作にとって
必須でない、いわゆる拡張ユニットとなるオプションと
して使用される従局を「オプションユニット」と呼び、
それぞれ、固定値コードを割り振った後の残りのコード
で識別子情報を割り振る。つまり、オプションユニット
の識別子情報は、オールゼロ(0000B)、オール1
(1111B)、本体ユニット用の固定値(たとえば、
1101Bに設定する)以外のコード値で、1(000
1B)から順に割り振られる。ここで、"B"は、その前
の数値が2進数(binary)であることを示す記号
である。
The other is a slave station which is not essential to the operation of the electronic device itself and is used as an option as a so-called extension unit, which is called an "option unit".
In each case, identifier information is allocated with the remaining codes after the fixed value code is allocated. That is, the identifier information of the option unit is all zero (0000B), all ones
(1111B), a fixed value for the main unit (for example,
Code value other than 1 (set to 1101B)
1B). Here, "B" is a symbol indicating that the preceding numerical value is a binary number (binary).

【0019】そして、本体ユニットの構成だけで伝送路
の配列順番を考えると、その配列順番は、本体ユニット
が必須のユニットであるが故に不変的な配列順番とな
る。つまり、設定された本体ユニット用の従局配列は、
本体ユニットだけで配列された場合には不変であるた
め、伝送路に配列された順番に従ってメモリマップ化す
ればよい。
When the arrangement order of the transmission lines is considered only by the configuration of the main unit, the arrangement order is invariable since the main unit is an essential unit. That is, the set slave station arrangement for the main unit is
Since there is no change when arranged only in the main unit, a memory map may be formed according to the order of arrangement in the transmission path.

【0020】次に、この本体ユニット従局配列順番を基
に接続可能なオプションユニット用従局について説明す
る。
Next, an optional unit slave station that can be connected based on the main unit slave station order will be described.

【0021】従局がオプションユニットの場合には、当
該従局が伝送路に接続されているか否かが不明であるた
め、識別子情報は順番に割り振るが、配列順番が本体ユ
ニット配列で確定している本体ユニットを利用して、各
本体ユニット間に存在する複数のオプションユニットを
一つのグループとして、同一グループ内では、重複しな
い識別子情報で順番に1、2、3…と割り振る。そし
て、これらグループを異なる各本体ユニット間で構成す
る。つまり、オプションユニットが割り振られる識別子
情報は、グループが異なれば、重複してもかまわないの
である。
When the slave station is an optional unit, it is not known whether the slave station is connected to the transmission line. Therefore, the identifier information is allocated in order, but the arrangement order is determined by the main unit unit arrangement. Using the units, a plurality of option units existing between the main units are grouped as one group, and in the same group, 1, 2, 3,... These groups are formed between different main units. That is, the identifier information to which the option unit is allocated may be duplicated as long as the group is different.

【0022】この方法により、従局の数を半無限で構成
しても、4ビット構成の識別子情報で区別できるように
なる。具体的には、一番目と二番目の本体ユニット間に
最大13(オール0、オール1および本体ユニットの固
定値コードを除くため)のオプションユニットを重複し
ないコード値で割り振ることができるため、本体ユニッ
トが、たとえば5つ存在すれば、4×13=52個のオ
プションユニットが1対1に識別できるようになる。逆
に、必要とされるオプションユニット数に応じた本体ユ
ニットをダミーも含めて用意すれば、伝送路の電気的伝
達能力の許容範囲内で、半無限の数の従局を認識するこ
とができる。
According to this method, even if the number of slave stations is half-infinite, it can be distinguished by 4-bit identifier information. More specifically, a maximum of 13 optional units can be allocated between the first and second main units (to exclude all 0s, all 1s, and fixed value codes of the main units) with non-overlapping code values. If there are five units, for example, 4 × 13 = 52 optional units can be identified on a one-to-one basis. Conversely, if a main unit including a dummy corresponding to the required number of optional units is prepared, a semi-infinite number of slave stations can be recognized within the allowable range of the electric transmission capacity of the transmission line.

【0023】以上説明した半無限の数の従局を接続可能
な本シリアル通信措置が実際に通信を実行する場合の全
体動作は、次の通りである。
The overall operation in the case where the present serial communication device capable of connecting a semi-infinite number of slave stations described above actually executes communication is as follows.

【0024】まず、主局が、本シリアル通信装置の適用
された電子機器において、シリアル通信伝送路に接続可
能な全従局数とその配列順番を予め設定して、従局並列
入出力情報内容を記憶するために主局側に設けられたメ
モリにマップ化する。
First, in the electronic equipment to which the present serial communication device is applied, the master station presets the number of all slave stations connectable to the serial communication transmission line and the arrangement order thereof, and stores the slave station parallel input / output information contents. Mapping to a memory provided on the master station side.

【0025】次に、主局は、初期化通信を実行すること
で、実際の伝送路に接続されている従局配列順番に従っ
た識別子情報を受信し、前記メモリに登録してある従局
の有無を設定することで、マップ化した従局配列順番を
現状の伝送路に存在する従局配列順番に再設定する。こ
れにより、主局は、伝送路に存在する従局配列順番を把
握でき、以降、この再設定されたメモリマップが示す従
局配列順番に従ってシフト転送データを構成して出力す
るとともに、入力されたシフト転送データを、この再設
定されたメモリマップが示す従局配列順番に従ってメモ
リにストアすることでシリアル通信を実行する。このと
きのシリアル通信が「通常通信」であり、この通常通信
が、シリアル通信の大部分を占めている。
Next, the master station executes the initialization communication to receive the identifier information in accordance with the arrangement order of the slave stations connected to the actual transmission line, and to determine whether or not there is a slave station registered in the memory. Is set, the mapped slave station arrangement order is reset to the slave station arrangement order existing in the current transmission path. Thus, the master station can grasp the slave station arrangement order existing on the transmission path, and thereafter, constructs and outputs shift transfer data in accordance with the slave station arrangement order indicated by the reset memory map, and outputs the input shift transfer data. The serial communication is executed by storing the data in the memory according to the slave station arrangement order indicated by the reset memory map. The serial communication at this time is “normal communication”, and the normal communication occupies most of the serial communication.

【0026】このように、所定の従局数に対応する情報
ビット数のデータを用意して、各従局に返送データをロ
ードさせた後、シフト動作を実行すれば、主局からは各
従局に、各従局からは主局に、各々情報を転送できるの
で、通信に費やされる時間が必要最小限になり、また、
信号処理がより簡素化されて、従局の回路構成が簡略化
されるので、製造コストが低減化される。
As described above, the data of the number of information bits corresponding to the predetermined number of slave stations is prepared, the return data is loaded to each slave station, and then the shift operation is executed. Since each slave station can transfer information to the master station, the time required for communication is minimized.
Since the signal processing is further simplified and the circuit configuration of the slave station is simplified, the manufacturing cost is reduced.

【0027】さらに、通常通信では、情報交換するシフ
ト転送を一巡した後、再び同じ内容の情報で二巡目のシ
フト転送を行って、1回分のシリアル通信動作とするこ
とにより、二度送りによる情報交換動作を行い、一巡目
の情報内容と二巡目の情報内容とを比較することによ
り、情報内容の精度を容易な構成で向上できて、情報の
誤伝達を防止できる。
Further, in the normal communication, after one cycle of the shift transfer for exchanging information, a second round of the shift transfer is performed again with the same information, and a single serial communication operation is performed. By performing the information exchange operation and comparing the information content of the first cycle with the information content of the second cycle, the accuracy of the information content can be improved with a simple configuration, and erroneous transmission of information can be prevented.

【0028】次に、本シリアル通信装置の詳細な構成を
説明する。
Next, a detailed configuration of the serial communication device will be described.

【0029】図7は、本シリアル通信装置を適用した電
子機器の概略構成を示すブロック図であり、本電子機器
は、1つの主局mと複数(図示例では12個)の従局s
1〜s12とにより構成されている。なお、図7は、接
続可能なすべての従局を図示したものであって、この中
から任意に選択した従局によって電子機器を構成するこ
とができる。
FIG. 7 is a block diagram showing a schematic configuration of an electronic apparatus to which the present serial communication apparatus is applied. The present electronic apparatus has one master station m and a plurality of (twelve in the illustrated example) slave stations s.
1 to s12. FIG. 7 illustrates all connectable slave stations, and an electronic device can be configured by a slave station arbitrarily selected from these slave stations.

【0030】図8は、図7の従局s1〜s12のいずれ
か1つの従局の詳細な構成を示すブロック図であり、各
従局s1〜s12はいずれも同一構成をなしている。
FIG. 8 is a block diagram showing a detailed configuration of any one of the slave stations s1 to s12 in FIG. 7, and each of the slave stations s1 to s12 has the same configuration.

【0031】図8において、入力セレクタ回路1には、
並列入力情報と識別子入力情報とが入力され、入力セレ
クタ回路1は、従局から主局に返送する情報として、並
列入力情報または識別子入力情報のいずれか一方を選択
して、入力ラッチ回路2および排他的論理和回路A(以
下、「EXOR回路A」という)3に出力する。入力ラ
ッチ回路2は、この選択された情報を一回分のシリアル
通信の実行期間だけラッチして保持し、EXOR回路A
3およびシフトレジスタ回路4に出力する。
In FIG. 8, the input selector circuit 1 includes:
The parallel input information and the identifier input information are input, and the input selector circuit 1 selects either the parallel input information or the identifier input information as information to be returned from the slave station to the master station, and selects the input latch circuit 2 and the exclusive input information. The logical OR circuit A (hereinafter, referred to as “EXOR circuit A”) 3. The input latch circuit 2 latches and holds the selected information for the execution period of one serial communication, and holds the EXOR circuit A
3 and the shift register circuit 4.

【0032】EXOR回路A3は、入力ラッチ回路2へ
の入力情報(入力セレクタ回路1からの出力情報)と、
入力ラッチ回路2からの出力情報とをビット毎に比較
し、その結果を多入力ゲートで一つの信号にまとめて出
力するもので、この信号は、いずれか1ビットでも変化
があるときにオン("1")され、それ以外のときにオフ
("0")されて、デコード回路B12に出力される。
The EXOR circuit A3 includes input information to the input latch circuit 2 (output information from the input selector circuit 1),
The output information from the input latch circuit 2 is compared for each bit, and the result is collectively output as one signal by a multi-input gate. This signal is turned on when any one bit changes. "1"), and at other times, it is turned off ("0") and output to the decode circuit B12.

【0033】シフトレジスタ回路4は、従局がシフト転
送を実行するためのものであり、転送クロックに同期し
て、シフトイン信号を読み込むとともに、すでに格納さ
れている情報をシフトアウト信号として出力する。さら
に、シフトレジスタ回路4は、その格納されている情報
を二度読みラッチ回路5およびEXOR回路B6に出力
する。
The shift register circuit 4 is for the slave station to execute shift transfer. The shift register circuit 4 reads a shift-in signal in synchronization with a transfer clock and outputs information already stored as a shift-out signal. Further, the shift register circuit 4 reads the stored information twice and outputs the information to the latch circuit 5 and the EXOR circuit B6.

【0034】二度読みラッチ回路5は、シフト転送の一
巡目の情報をラッチして保持し、EXOR回路B6およ
び出力ラッチ回路7に出力する。
The double read latch circuit 5 latches and holds the information of the first cycle of the shift transfer, and outputs the information to the EXOR circuit B 6 and the output latch circuit 7.

【0035】EXOR回路B6は、二巡目のシフト転送
での情報内容と二度読みラッチ回路5でラッチされ保持
された情報内容とをビット毎に比較し、その結果を多入
力ゲートで一つの信号にまとめて出力するもので、この
信号は、いずれか1ビットでも不一致であるときにオン
("1")され、それ以外のときにオフ("0")されて、
デコード回路B12に出力される。
The EXOR circuit B6 compares the information content in the second shift transfer with the information content latched and held by the twice-read latch circuit 5 on a bit-by-bit basis, and compares the result with one multi-input gate. This signal is turned on ("1") when any one bit does not match, and turned off ("0") otherwise.
Output to the decode circuit B12.

【0036】出力ラッチ回路7は、EXOR回路B6が
オン出力した信号に対してデコード回路B12が出力し
たラッチ信号に応じて、ラッチ保持動作を実行し、従局
の並列出力として外部に出力する。
The output latch circuit 7 performs a latch holding operation in response to the latch signal output from the decode circuit B12 with respect to the signal output from the EXOR circuit B6, and outputs the result to the outside as a parallel output of the slave station.

【0037】ゲート回路8は、入力セレクタ回路1に対
して、選択すべき情報の種類を指示するためのものであ
り、転送クロックとソフトリセット信号をその入力源と
して、これに基づいて選択指示信号を出力する。ここ
で、ソフトリセット信号とは、主局が出力する2ビット
の従局指示コード化信号に基づいてデコード回路A9が
分類した3種類の信号(ソフトリセット信号、強制リセ
ット信号およびカウント指示信号)のうちの1信号であ
る。
The gate circuit 8 is for instructing the input selector circuit 1 on the type of information to be selected. The gate circuit 8 uses the transfer clock and the soft reset signal as its input sources, and based on this, the selection instruction signal. Is output. Here, the soft reset signal is one of three types of signals (soft reset signal, forced reset signal, and count instruction signal) classified by the decoding circuit A9 based on a 2-bit slave station coded signal output by the master station. 1 signal.

【0038】転送クロックは、前記シフトレジスタ回路
4、クロック数カウンタ回路10および位相制御カウン
タ回路11に入力される。クロック数カウンタ回路10
は、この転送クロックをカウントし、所定の値毎にタイ
ミングパルスを出力し、位相制御カウンタ回路11は、
デコード回路A9によって分類されたカウント指示信号
に応じて、カウント動作やカウント停止保持動作などを
行う。
The transfer clock is input to the shift register circuit 4, clock number counter circuit 10, and phase control counter circuit 11. Clock counter circuit 10
Counts this transfer clock and outputs a timing pulse for each predetermined value, and the phase control counter circuit 11
In response to the count instruction signal classified by the decode circuit A9, a count operation, a count stop holding operation, and the like are performed.

【0039】なお、主局も、この位相制御カウンタ回路
11と同様に動作する主局位相制御カウンタ回路を備
え、シフト転送を制御している。
The master station also has a master station phase control counter circuit that operates in the same manner as the phase control counter circuit 11, and controls shift transfer.

【0040】デコード回路B12は、位相制御カウンタ
回路11のカウント結果であるQ出力を入力源として、
制御位相タイミングを基に各回路に対して動作指示を行
ったり、各回路からの入力信号を制御位相タイミングを
基に返送位相信号として主局に出力したりする。
The decoding circuit B12 uses the Q output, which is the count result of the phase control counter circuit 11, as an input source,
An operation instruction is issued to each circuit based on the control phase timing, and an input signal from each circuit is output to the master station as a return phase signal based on the control phase timing.

【0041】シフトレジスタ回路4は、基本的に、主局
が出力する従局指示コード化信号によって操作される位
相制御カウンタ回路11のカウント値に応じて、動作制
御される。このように、従局は、主局主導により制御さ
れる。具体的には、この位相制御カウンタ回路11のカ
ウント値(以下、単に「制御カウント値」と略して言
う)は、主局が出力する従局指示コード化信号に応じて
位相制御カウンタ回路11が転送クロックをクロック源
とするカウント動作(カウントアップ、停止、制御カウ
ント値リセットなどの動作)を行うことでカウントされ
る。そして、この制御カウント値は、次段のデコード回
路B12に入力され、デコード回路B12は、直接、各
従局動作を実行する回路にタイミング指示信号を出力す
る。
The operation of the shift register circuit 4 is basically controlled according to the count value of the phase control counter circuit 11 operated by the slave station coded signal output from the master station. In this way, the slave station is controlled by the master station. Specifically, the count value of the phase control counter circuit 11 (hereinafter simply referred to as “control count value”) is transferred by the phase control counter circuit 11 in accordance with a slave station instruction coded signal output by the master station. The count is performed by performing a count operation (operation such as count-up, stop, control count value reset, etc.) using the clock as a clock source. Then, the control count value is input to the next-stage decode circuit B12, and the decode circuit B12 directly outputs a timing instruction signal to a circuit that executes each slave station operation.

【0042】以下、シフト転送を中心に従局の動作処理
を説明する。
Hereinafter, the operation processing of the slave station will be described focusing on shift transfer.

【0043】従局指示コード化信号によってソフトリセ
ットが指示されると、制御カウンタ値は00H("H"
は、その前の数値が16進数(hexadecima
l)であることを示す記号である)にリセットされる。
ソフトリセット中は、転送クロックを受信しても制御カ
ウント値は不変であることを利用して、入力セレクタ回
路1の入力情報選択を実行する。ゲート回路8は、ソフ
トリセット中に転送クロックを受信するか否かで入力セ
レクタ回路1の選択指示信号を切り換えるように構成さ
れている。これにより、入力セレクタ回路1は、並列入
力または識別子入力のいずれかの情報を選択して入力ラ
ッチ回路2に情報伝達する。その後、ソフトリセットが
解除され、新たに転送クロックが受信されると、入力ラ
ッチ回路2は入力情報をラッチして保持するとともに、
情報をシフトレジスタ回路4のシフトイン並列入力にア
クセスする。
When a soft reset is instructed by the slave station coded signal, the control counter value becomes 00H ("H").
Means that the value before that is hexadecimal
l)).
During the soft reset, the input information of the input selector circuit 1 is selected by utilizing the fact that the control count value does not change even when the transfer clock is received. The gate circuit 8 is configured to switch the selection instruction signal of the input selector circuit 1 depending on whether or not the transfer clock is received during the soft reset. Thus, the input selector circuit 1 selects either the parallel input or the identifier input and transmits the information to the input latch circuit 2. Thereafter, when the soft reset is released and a new transfer clock is received, the input latch circuit 2 latches and holds the input information,
The information is accessed to the shift-in parallel input of the shift register circuit 4.

【0044】一方、入力ラッチ回路2にはデコード回路
B12からラッチ信号が供給され、EXOR回路A3
は、入力ラッチ回路2のラッチ入力と出力とをビット毎
に比較するとともに、ゲート回路で一つの信号にまとめ
てデコード回路B12へ供給する。この信号は、従局が
発生する通信要求信号の源であって、所定の制御カウン
ト値のとき(本シリアル通信装置では、0EH時のタイ
ミングで有効とされる)に返送位相信号から主局に伝送
される。
On the other hand, a latch signal is supplied from the decode circuit B12 to the input latch circuit 2, and the EXOR circuit A3
Compares the latch input and output of the input latch circuit 2 bit by bit and collectively supplies one signal to the decode circuit B12 by the gate circuit. This signal is a source of a communication request signal generated by the slave station, and is transmitted from the return phase signal to the master station at a predetermined control count value (valid at the timing of 0EH in this serial communication device). Is done.

【0045】次に、引続き制御カウント値を01Hにす
るよう主局が操作指示すると、シフトレジスタ回路4に
入力ラッチ回路2の出力情報がシフトロードされ、転送
クロックが受信されるに従ってシフト転送動作が開始さ
れる。このときから、主局は、後述する初期化通信処理
で把握した伝送路中の従局数に応じたビット数の転送デ
ータと転送クロックを発生して、従局指示コード化信号
により、所望のタイミングで制御カウント値を操作しな
がら、シフト転送を一巡させるシフト終了タイミングに
制御カウント値が06Hになるように指示制御する。
Next, when the master station continuously instructs the control count value to be 01H, the output information of the input latch circuit 2 is shift-loaded into the shift register circuit 4, and the shift transfer operation is performed as the transfer clock is received. Be started. From this time, the master station generates transfer data and a transfer clock of the number of bits corresponding to the number of slave stations in the transmission path grasped in the initialization communication processing described later, and at a desired timing by a slave station instruction coded signal. While manipulating the control count value, instruction control is performed so that the control count value becomes 06H at the shift end timing for making a round of shift transfer.

【0046】そして、従局は、制御カウント値が06H
になると一巡目のシフト動作が終了したと判断して、デ
コード回路B12から二度読みラッチ回路5にシフトレ
ジスタ回路4のシフトデータをラッチ保持させるための
ラッチパルスを出力する。一方、シフトレジスタ回路4
は、制御カウント値が00Hになったときにラッチ保持
された入力ラッチ回路2の情報をアクセス可能状態にな
っている。なお、この入力ラッチ回路2にラッチ保持さ
れた情報内容は、制御カウント値が00Hになるとき以
外は更新されないため、制御カウント値が06Hの段階
では、直前の情報内容と同じ情報内容が保持されてい
る。
The slave station has a control count value of 06H.
Then, it is determined that the first round of the shift operation has been completed, and the decode circuit B12 outputs a latch pulse for latching and holding the shift data of the shift register circuit 4 to the twice-read latch circuit 5. On the other hand, the shift register circuit 4
When the control count value becomes 00H, the information of the input latch circuit 2 latched and held can be accessed. Since the information content latched and held by the input latch circuit 2 is not updated except when the control count value becomes 00H, the same information content as the immediately preceding information content is retained when the control count value is 06H. ing.

【0047】そして、主局は、制御カウント値を07H
にして、シフト転送の二巡目を開始する。シフトレジス
タ回路4は、07Hでシフトデータを再びロードしてシ
フト動作を開始する。一方、主局も同様にシフト転送一
巡目と同じ情報内容をロードさせて、伝送路の従局数に
応じたビット数の転送データと転送クロックを発生させ
る。そして、一巡目と同様な操作を実行して、シフト転
送の終了タイミングに合わせて今度は、制御カウント値
が0CHになるように指示制御する。
Then, the master station sets the control count value to 07H.
Then, the second round of the shift transfer is started. The shift register circuit 4 loads the shift data again at 07H and starts the shift operation. On the other hand, the master station also loads the same information content as that in the first shift transfer, and generates transfer data and a transfer clock having the number of bits corresponding to the number of slave stations on the transmission path. Then, the same operation as in the first cycle is executed, and the instruction control is performed so that the control count value becomes 0CH in accordance with the shift transfer end timing.

【0048】従局は、制御カウント値が0CHになると
二巡目のシフト転送が終了したと判断して、EXOR回
路B6で一巡目のデータを保持している二度読みラッチ
回路5の出力と二巡目のデータが格納されているシフト
レジスタ回路4の出力とをビット毎に比較する。その結
果、EXOR回路B6は、全ての内容がビット毎に一致
しているときにはオフ信号を出力し、いずれか1ビット
でも不一致のときにはオン信号を出力する。
When the control count value reaches 0CH, the slave station determines that the second-cycle shift transfer has been completed, and the EXOR circuit B6 compares the output of the double-read latch circuit 5 holding the first-cycle data with the output of the second-time latch circuit 5. The output of the shift register circuit 4 in which the data of the cycle is stored is compared bit by bit. As a result, the EXOR circuit B6 outputs an OFF signal when all the contents match for each bit, and outputs an ON signal when any one bit does not match.

【0049】そして、制御カウント値が0DHになった
ときにデコード回路B12は、二度読み結果が一致して
いる場合には、出力ラッチ回路7にラッチ保持パルスを
出力して、二度読み結果に不一致があった場合には、出
力ラッチ回路7にラッチ保持パルスを出力せずに、返送
位相信号をオン出力する。この0DH時に返送位相信号
がオン出力されると、主局は、通信異常によるシフト転
送失敗と判断し、通信エラーと認識する。この場合、主
局の説明で後述するが、ソフトリセット信号で制御カウ
ント値を00Hに戻し、シリアル通信のリトライとし
て、再び、上述のシリアル通信を実行する。なお、所定
回数のリトライ通信を実行してもエラーとなる場合に
は、シリアル通信故障として機器装置全体の動作を停止
し、サービスマンコールなどの所定状態を維持して終了
する。
When the control count value becomes 0DH, the decode circuit B12 outputs a latch holding pulse to the output latch circuit 7 if the read results match each other, and outputs the read result twice. When there is a mismatch, the return phase signal is turned on without outputting the latch holding pulse to the output latch circuit 7. When the return phase signal is turned on at 0DH, the master station determines that the shift transfer has failed due to a communication error, and recognizes a communication error. In this case, as will be described later in the description of the master station, the control count value is returned to 00H by a soft reset signal, and the above serial communication is executed again as a serial communication retry. If an error occurs even after the retry communication is performed a predetermined number of times, the operation of the entire device is stopped as a serial communication failure, and the processing is terminated while maintaining a predetermined state such as a serviceman call.

【0050】一方、0DHでシフト転送が成功すれば、
従局への転送情報が従局並列出力として出力され、シフ
ト転送作業は終了する。これにより、主局は、入力した
従局からのシフト転送データを同様に二度読み比較し
て、全て一致したときに所定のメモリに情報内容を更新
する一方、二度読み比較して、不一致が1ビットでもあ
れば、同様にソフトリセット後にリトライ通信を実施す
る。
On the other hand, if the shift transfer is successful at 0DH,
The transfer information to the slave station is output as a slave station parallel output, and the shift transfer operation ends. Accordingly, the master station reads and compares the input shift transfer data from the slave station twice in the same manner, and updates the information content in a predetermined memory when all the data match, while reading and comparing the data twice and finds that there is no mismatch. If there is only one bit, the retry communication is similarly performed after the soft reset.

【0051】主局も無事シフト転送が成功したと判断す
ると、制御カウント値を0EHになるように操作して、
今度は、各従局からの従局通信要求信号の有無を判断す
るために返送位相信号の状態を検出する。この0EHの
状態は、少なくとも一つの従局、または、主局での通信
要求が発生するまで維持され、通信要求があれば、直ち
に制御カウンタ値を00Hにして、再びシリアル通信の
実行に移る。つまり、主局は、制御カウンタ値が0DH
時の返送位相信号は転送エラー判断として利用するが、
0EH時の返送位相信号は従局通信要求として判断す
る。
When the master station also determines that the shift transfer has succeeded, it operates the control count value to 0EH.
This time, the state of the return phase signal is detected in order to determine the presence / absence of a slave communication request signal from each slave station. This state of 0EH is maintained until at least one slave station or master station issues a communication request. If there is a communication request, the control counter value is immediately set to 00H, and the serial communication is again executed. That is, the master station determines that the control counter value is 0DH.
The return phase signal at the time is used as a transfer error judgment,
The return phase signal at the time of 0EH is determined as a slave station communication request.

【0052】このように、返送位相信号出力は、制御カ
ウント値に応じて、その意味を区別して主局により読み
取られる。したがって、主局は、制御カウント値に応じ
て種々な内容で判定できるように必要に応じて構成さ
れ、制御カウント値の操作タイミングを工夫することに
より、多種な意味を示す返送信号を部類分けできる。
As described above, the return phase signal output is read by the master station while distinguishing its meaning according to the control count value. Therefore, the master station is configured as necessary so that it can be determined with various contents according to the control count value, and by devising the operation timing of the control count value, it is possible to classify the return signal having various meanings. .

【0053】一方、従局は、制御カウント値が0EHに
なると、デコード回路B12によりEXOR回路A3の
出力状態を返送位相信号として出力する。この制御カウ
ント値が0EHの間は、従局通信要求の有無を伝送し、
上述したように、シフト転送した従局並列入力情報をラ
ッチ保持する入力ラッチ回路2のラッチ内容に対して、
入力ラッチ回路2の入力端子にアクセスされる現状での
従局並列情報内容が1ビットでも更新されると直ちに主
局に情報交換の実施を要求する従局通信要求として出力
される。この信号により、本来は、主局からの単方向性
シリアル通信構成でも、双方向性シリアル通信構成と同
様な作用を得ることができる。
On the other hand, when the control count value becomes 0EH, the slave station outputs the output state of the EXOR circuit A3 as a return phase signal by the decoding circuit B12. While this control count value is 0EH, the presence or absence of a slave communication request is transmitted.
As described above, with respect to the latch contents of the input latch circuit 2 for latching and holding the shift-transferred slave parallel input information,
As soon as even one bit of the current slave station parallel information content accessed to the input terminal of the input latch circuit 2 is updated, it is output as a slave station communication request for requesting the master station to perform information exchange. By this signal, the same operation as the bidirectional serial communication configuration can be originally obtained even in the unidirectional serial communication configuration from the master station.

【0054】次に、図9〜図15を参照して、主局が実
行する制御処理をさらに詳細に説明する。
Next, the control processing executed by the master station will be described in more detail with reference to FIGS.

【0055】図9は、前記図7の電子機器からオプショ
ンとして設置される従局をいくつか省略して構成した電
子機器の一例を示すブロック図である。なお、ここで言
うオプションと称される電気ユニット(従局)は、ユー
ザが設置するオプションだけに限定されず、たとえば、
工場での組み立て時に設置される電気ユニットも含んで
いる。
FIG. 9 is a block diagram showing an example of an electronic apparatus constructed by omitting some slave stations installed as options from the electronic apparatus of FIG. The electric unit (slave station) referred to as an option here is not limited to an option installed by a user.
It also includes electrical units installed during factory assembly.

【0056】図7において、主局は同図に示す順番に割
り振られた従局配列順番を基本に制御を実行する。な
お、この基本となる伝送路の従局配列順番は、使用する
電子機器の構成に応じて決定されるが、仕様変更などで
従局配列順番が入れ替わった場合には、その内容に応
じ、基本となる従局配列順番を変更する。
In FIG. 7, the master station executes control based on the slave station arrangement order allocated in the order shown in FIG. In addition, the slave station arrangement order of the basic transmission line is determined according to the configuration of the electronic device to be used. However, if the slave station arrangement order is changed due to a specification change or the like, the slave station arrangement order becomes the basic. Change the slave station order.

【0057】図7および図9では、主局mを起点とし
て、従局s1〜s12からなるリング状の伝送路が設け
られている。
In FIGS. 7 and 9, a ring-shaped transmission line including the slave stations s1 to s12 is provided starting from the master station m.

【0058】図10および図11は、本シリアル通信装
置が情報交換を実施する際に利用されるメモリマップの
一例を示す図であり、主局のみが有する記憶メモリ(図
示せず)のメモリマップの推移を示している。すなわ
ち、図10の従局並列出力情報(a)と従局並列入力情
報(b)が、図7の基本となる伝送路での従局配列順番
をマップ化したものであり、図11の従局並列出力情報
(a)と従局並列入力情報(b)が、後述する初期化通
信によって現状の、すなわち図9の伝送路における従局
配列順番をマップ化したものであり、メモリマップが再
設定された状態を示すものである。
FIGS. 10 and 11 are diagrams showing an example of a memory map used when the serial communication apparatus performs information exchange, and shows a memory map of a storage memory (not shown) provided only in the main station. It shows the transition of. That is, the slave station parallel output information (a) and the slave station parallel input information (b) in FIG. 10 are obtained by mapping the slave station arrangement order on the basic transmission line in FIG. (A) and the slave station parallel input information (b) map the current order of slave stations in the transmission path of FIG. 9 by initialization communication described later, and show a state in which the memory map is reset. Things.

【0059】そして、図11の再設定されたメモリマッ
プでの従局配列順番を基に、通常通信で各従局との情報
交換が実行され、データ内容が更新される。一方、本シ
リアル通信装置の適用された電子機器は、本メモリマッ
プを読み書き操作することで装置制御を実行する。
Then, based on the arrangement order of the slave stations in the reset memory map of FIG. 11, information exchange with each slave station is executed by normal communication, and the data content is updated. On the other hand, an electronic device to which the present serial communication device is applied executes device control by reading and writing the present memory map.

【0060】なお、図11中、"X","Z"で表現するビ
ットは、通常通信実行に伴って更新される情報内容を示
している。
In FIG. 11, the bits represented by "X" and "Z" indicate information contents updated with the execution of normal communication.

【0061】図12は、本シリアル通信装置が実行する
シリアル通信処理の手順を示すフローチャートであり、
図13は、図12中の初期化通信処理の詳細な手順を示
すフローチャートである。また、図14および図15
は、図12中の通常通信処理の詳細な手順を示すフロー
チャートである。
FIG. 12 is a flowchart showing a procedure of a serial communication process executed by the serial communication device.
FIG. 13 is a flowchart showing a detailed procedure of the initialization communication process in FIG. 14 and FIG.
13 is a flowchart showing a detailed procedure of a normal communication process in FIG.

【0062】なお、通常通信の場合は、シリアル通信動
作を実行するシフト転送を二巡して、一巡目と二巡目と
の情報内容を比較する、いわゆる二度送り、二度読み形
態を実行するように制御しているが、初期化通信の場合
は、シリアル通信動作を実行するシフト転送を一巡した
段階でソフトリセットをかけることで通信動作を強制的
に終了させるように制御している。これは、少しでも早
く、メモリマップの再設定を終了させて、通常通信に移
行できるように構成したからである。この処理により、
電子機器全体をできるだけ早い時間で立上げることがで
きるようにしている。したがって、初期化通信の場合は
シフト転送によるメモリマップの再設定は一巡のシフト
転送で切り上げて、一回分のシリアル通信として、次の
通常通信に移行して行く。
In the case of normal communication, a so-called double feed and double reading mode is executed in which the shift transfer for executing the serial communication operation is performed twice and the information contents of the first and second rounds are compared. However, in the case of the initialization communication, the communication operation is controlled to be forcibly terminated by performing a soft reset at the stage where the shift transfer for executing the serial communication operation has been completed. This is because the reset of the memory map is finished as soon as possible, and the system can be shifted to the normal communication. With this process,
The entire electronic device can be started up as quickly as possible. Therefore, in the case of initialization communication, resetting of the memory map by shift transfer is rounded up by one round of shift transfer, and the process proceeds to the next normal communication as one serial communication.

【0063】以降、主局を中心とした本シリアル通信装
置が実行する制御処理を、図12〜図15を参照して詳
細に説明する。
Hereinafter, the control processing executed by the present serial communication device centering on the master station will be described in detail with reference to FIGS.

【0064】電源が投入され、CPU(図示せず)のリ
セット後にCPUが有するメモリ(図示せず)の初期化
設定処理が実行されて、主局が有するメモリ部分に基本
となる伝送路に接続可能な全従局の配列順番がマップ化
されると、CPU動作による電子機器の制御プログラム
が起動され、同時に、主局の制御処理であるシリアル通
信処理(図12)も起動される。主局は、各従局との情
報交換を実行する、通常通信と称される通信を行う前
に、まず、現状の伝送路に存在する従局配列順番を確定
すべき通信、すなわち初期化通信を行う。その際、主局
が有するメモリ状態は、図10に示すメモリマップとな
っている。
When the power is turned on and the CPU (not shown) is reset, the initialization setting processing of the memory (not shown) of the CPU is executed, and the memory portion of the main station is connected to the basic transmission line. When the arrangement order of all possible slave stations is mapped, the control program of the electronic device by the CPU operation is started, and at the same time, the serial communication processing (FIG. 12) which is the control processing of the master station is started. Before performing information exchange with each slave station, the master station performs communication to determine the sequence of slave stations existing in the current transmission path, that is, initialization communication, before performing communication called normal communication. . At this time, the memory state of the master station is a memory map shown in FIG.

【0065】シリアル通信処理が起動されると、まず、
ステップS101でリトライカウンタ値をチェックして
所定値以下か否かを判断する。最初は、リトライカウン
タ値はゼロであるため、ステップS102に進む。
When the serial communication process is started, first,
In step S101, the retry counter value is checked to determine whether the value is equal to or less than a predetermined value. At first, since the retry counter value is zero, the process proceeds to step S102.

【0066】ステップS102では、メモリマップ再設
定フラグがセット("1")されているか否かを判断し、
セットされていないときにはステップS103に進み、
メモリマップの再設定作業を初期化通信処理で実行す
る。
In step S102, it is determined whether or not the memory map reset flag is set ("1").
If not set, the process proceeds to step S103,
The operation of resetting the memory map is executed in the initialization communication process.

【0067】図13の初期化通信処理において、まず、
ステップS121で、図8の従局の有する入力セレクタ
回路1に従局の識別子情報をアクセスさせる操作であ
る、転送クロック1発の空転送を実行する。(なお、転
送クロックの空転送を実行しない場合には、従局の有す
る入力セレクタ回路1に従局の情報内容をアクセスさせ
る操作となる。)次に、ステップS122では、メモリ
マップの再設定に使用するメモリポインタと通信結果の
異常を登録する通信異常フラグを初期化して、ステップ
S123以降の初期化通信の実行を開始する。
In the initialization communication process shown in FIG.
In step S121, an idle transfer from one transfer clock, which is an operation for making the input selector circuit 1 of the slave station of FIG. 8 access the identifier information of the slave station, is executed. (If the idle transfer of the transfer clock is not performed, the input selector circuit 1 of the slave station accesses the information content of the slave station.) Next, in step S122, the memory map is used for resetting. The communication abnormality flag for registering the abnormality of the memory pointer and the communication result is initialized, and the execution of the initialization communication after step S123 is started.

【0068】ステップS123では、メモリポインタを
インクリメントして01Hにし、ステップS124で
は、予め従局配列順番が登録されている従局配列出力情
報のメモリマップの先頭値アドレス:MTOとメモリポ
インタ値を加算した値で示されるメモリアドレスが、予
め従局配列順番が登録されている従局並列出力情報のメ
モリマップの最終値アドレス:MTEに一致しているか
否かを判断する。
In step S123, the memory pointer is incremented to 01H, and in step S124, the value obtained by adding the top address of the memory map of the slave array output information in which the slave array order is registered in advance: MTO and the memory pointer value It is determined whether or not the memory address indicated by matches the final value address: MTE in the memory map of the slave parallel output information in which the slave array order is registered in advance.

【0069】ステップS124で、一致していれば、メ
モリマップのスキャンが終了したことになる。今は、一
致していないとしてステップS125に進み、シフト転
送する転送データの出力準備をする。
If they match in step S124, it means that the scanning of the memory map has been completed. Now, it is determined that they do not match, and the flow advances to step S125 to prepare for output of transfer data to be shifted and transferred.

【0070】なお、この初期化通信処理では、オールゼ
ロの内容をシフト転送するが、これに限定されるもので
はなく、シリアル通信装置の利用具合でオールゼロ以外
をシフト転送してもよい。
In this initialization communication processing, the contents of all zeros are shift-transferred. However, the present invention is not limited to this, and shifts other than all zeros may be shift-transferred depending on the use of the serial communication device.

【0071】次に、ステップS126〜S128で、従
局の回路構成に合わせて4ビット分のシフト転送を実行
する。すなわち、1ビットのシフトアウト信号および1
発の転送クロックを出力するとともに、クロック数カウ
ンタをインクリメントし(ステップS126)、1ビッ
トのシフトイン信号を入力し(ステップS127)、4
ビット分のシフト転送を終了したか否かを判断し(ステ
ップS128)、終了しないときには終了するまで、ス
テップS126およびステップS127の処理を繰り返
す。
Next, in steps S126 to S128, 4-bit shift transfer is executed in accordance with the circuit configuration of the slave station. That is, 1-bit shift-out signal and 1-bit
The output transfer clock is output, and the clock counter is incremented (step S126), and a 1-bit shift-in signal is input (step S127).
It is determined whether or not the bit-wise shift transfer has been completed (step S128), and if not, the processes of steps S126 and S127 are repeated until the transfer is completed.

【0072】そして、4ビット分のシフト転送を終了す
るとステップS129に移り、シフト転送によって主局
に返送される第1番目の従局からの識別子情報を処理す
る。すなわち、基本となるメモリマップの従局並列出力
情報であるメモリマップの先頭値アドレス:MTOとメ
モリポインタ値を加算した値で示されるメモリアドレス
の内容をピックアップして、その上位4ビット内容をア
クセスする。そして、この上位4ビットの内容と、ステ
ップS128で入力終了と判断されたときの4ビット構
成のビット構成の識別子情報とを比較し(ステップS1
30)、一致していれば、基本となるメモリマップの従
局並列出力情報に登録された識別子情報の従局が存在す
ると判断して前記ステップS123に戻り、次のシフト
転送による識別子情報から同様に従局の有無を判断す
る。一方、不一致の場合には、基本となるメモリマップ
の従局並列出力情報に登録された識別子情報の従局が存
在しないと判断して、ステップS131で、その該当従
局の上位4ビットで示される識別子情報内容を、「従局
無し」を意味するオールゼロ(00H)にクリアして再
登録し、続くステップS132で、メモリポインタをイ
ンクリメントして、基本となるメモリマップの従局並列
出力情報の次に位置する登録された識別子情報の従局を
指定して、前記ステップS129に戻り、同様に該当従
局の存在を判断する。つまり、存在しない従局のメモリ
エリアは、00Hにして登録を抹消して、存在する従局
のメモリエリアは、既に登録されている識別子情報をそ
のまま残すことで、現状での従局配列順番が再設定され
る。
When the shift transfer of 4 bits is completed, the process shifts to step S129 to process the identifier information from the first slave station returned to the master station by the shift transfer. That is, the contents of the memory address indicated by the sum of the start value address: MTO and the memory pointer value of the memory map, which is the slave parallel output information of the base memory map, are accessed, and the upper 4 bits are accessed. . Then, the contents of the upper 4 bits are compared with the identifier information of the bit configuration of the 4-bit configuration when it is determined in step S128 that the input is completed (step S1).
30) If they match, it is determined that there is a slave whose identifier information is registered in the slave parallel output information of the basic memory map, and the process returns to step S123. Is determined. On the other hand, if they do not match, it is determined that there is no slave station of the identifier information registered in the slave station parallel output information of the basic memory map, and in step S131, the identifier information indicated by the upper four bits of the slave station is determined. The content is cleared to all zeros (00H) meaning "no slave station" and re-registered, and in the following step S132, the memory pointer is incremented and the registration located next to the slave parallel output information in the basic memory map is performed. The slave station of the identified identifier information is designated, and the process returns to the step S129 to determine the existence of the corresponding slave station. In other words, the memory area of the non-existing slave station is set to 00H to cancel the registration, and the existing memory area of the slave station retains the already registered identifier information, so that the current slave station arrangement order is reset. You.

【0073】以上の処理を繰り返して、基本となるメモ
リマップの従局配列順番を再設定すると、ステップS1
24で、登録従局のスキャンを終了すべきと判断するア
ドレス値MTEにスキャンアドレスが達するため、ステ
ップS133に移り、初期化通信実行で実際にシフト転
送出力した転送クロック総数をカウントするために主局
が有するクロック数カウンタのカウント値を一従局構成
ビット数である4ビットで除算して、現状の伝送路に存
在する従局総数を算出し、再設定されたメモリマップ上
で有りと判断された従局総数と比較することにより、こ
の初期化通信で再設定された従局配列順番が正常になさ
れたか否かを判定する自己診断を実施する。
By repeating the above processing and resetting the slave station arrangement order of the basic memory map, step S1
At 24, since the scan address reaches the address value MTE at which it is determined that the scan of the registered slave station should be terminated, the process moves to step S133, and the master station counts the total number of transfer clocks actually shifted and output during execution of the initialization communication. Divides the count value of the clock number counter provided by 4 bits, which is the number of bits constituting one slave station, to calculate the total number of slave stations present on the current transmission line, and determines the slave station determined to be present on the reset memory map. By comparing with the total number, self-diagnosis is performed to determine whether or not the slave station arrangement order reset by the initialization communication has been normally performed.

【0074】ステップS133で、一致した場合には、
正常に再設定されたと判断してステップS134に移
り、再設定フラグをセットした後に、本初期化通信処理
を終了する。
If it is determined in step S133 that they match,
It is determined that the reset has been normally performed, and the process proceeds to step S134. After the reset flag is set, the initialization communication process ends.

【0075】一方、ステップS133で、不一致であっ
た場合には、正常ではない再設定であったと判断して再
設定フラグをリセットのまま、ステップS135に移
り、リトライカウンタをインクリメントして、一旦本初
期化通信処理を終了する。
On the other hand, if there is a mismatch in step S133, it is determined that the reset is not normal, and the reset flag is reset, the process proceeds to step S135, the retry counter is incremented and the reset is performed once. The initialization communication processing ends.

【0076】図12に戻り、この初期化通信処理を終了
すると、一旦シリアル通信処理を終了する。
Returning to FIG. 12, when the initialization communication processing is completed, the serial communication processing is temporarily terminated.

【0077】そして、再びシリアル通信処理が起動され
ると、前記ステップS101でリトライカウンタ値をチ
ェックした上で、ステップS102でメモリマップが再
設定されているか否かを判断し、再設定に成功していれ
ば、ステップS105に移り、以下で説明する通常通信
の実行動作に進む一方、再設定に失敗していれば、再び
ステップS103に移って、初期化通信処理をリトライ
する。
When the serial communication process is started again, the retry counter value is checked in step S101, and it is determined in step S102 whether the memory map has been reset. If so, the process proceeds to step S105, and the process proceeds to a normal communication execution operation described below. If the reset has failed, the process returns to step S103 to retry the initialization communication process.

【0078】なお、初期化通信処理が一回でも成功すれ
ば、ステップS105以降の通常通信に移るが、失敗し
続けた場合には、図2のステップS135でリトライカ
ウンタ値がインクリメントされることによりそのカウン
ト値が所定値を越えるようになり、図12のステップS
101で、通信動作不能と判断されてステップS104
に移り、通信故障処理を実行する。なお、この通信故障
処理は、装置故障として、電子機器全体の動作を停止す
るもので、サービスマン対応が要求されるものである。
If the initialization communication process succeeds even once, the process proceeds to normal communication after step S105. If the initialization communication process continues to fail, the retry counter value is incremented in step S135 in FIG. The count value exceeds a predetermined value, and step S in FIG.
At 101, it is determined that the communication cannot be performed, and step S104
Then, the communication failure processing is executed. In this communication failure process, the operation of the entire electronic device is stopped as a device failure, and a serviceman's response is required.

【0079】以上が初期化通信の主局制御であるが、こ
こで、図9〜図11を用いて、具体的な初期化通信動作
をシリアル通信装置全体の動きから簡単に説明する。
The master station control of the initialization communication has been described above. Here, a specific initialization communication operation will be briefly described based on the entire operation of the serial communication device with reference to FIGS.

【0080】初期化シリアル通信によるメモリマップの
再設定は、図10に示す基本となる従局配列順番のメモ
リマップを基に実施される。主局は始めに、基本となる
従局配列順番のメモリマップの従局並列出力情報の下位
4ビット列の情報内容を各従局に対しシフト転送して従
局並列出力状態を初期化する。
The resetting of the memory map by the initialization serial communication is performed based on the basic memory map of the slave station arrangement order shown in FIG. First, the master station shifts and transfers the information contents of the lower 4-bit string of the slave station parallel output information of the memory map in the base station arrangement order to each slave station to initialize the slave station parallel output state.

【0081】なお、本シリアル通信装置では、従局並列
状態を初期化するためにオールゼロを設定しているが、
これに特に限定されるものではなく、初期化情報内容
は、基本となる従局配列順番のメモリマップを作成する
ときに予め設定しておけばよい。
In this serial communication apparatus, all zeros are set to initialize the slave station parallel state.
The present invention is not particularly limited to this, and the contents of the initialization information may be set in advance when a basic memory map in the slave station arrangement order is created.

【0082】そして、主局は、上述のように、各従局に
ソフトリセット信号を出力し、転送クロックを操作する
ことにより従局識別子入力内容をシフトレジスタ回路4
にロードさせる。その後、従局並列出力状態を初期化す
る従局並列出力情報をシフト転送する。その結果、各従
局には初期化する従局並列出力情報内容が並列出力端子
に出力されるとともに、主局には、順次、伝送路の従局
配列順番に識別子情報内容が返送されて来る。主局はこ
の識別子情報内容を4ビット毎に区切り、基本となる従
局配列順番のメモリマップに登録された識別子情報内容
の順番と比較しながら、現状の伝送路の従局配列順番を
再設定する。
Then, as described above, the master station outputs a soft reset signal to each slave station, and operates the transfer clock to shift the slave station identifier input contents to the shift register circuit 4.
To load. Thereafter, the slave parallel output information for initializing the slave parallel output state is shifted and transferred. As a result, the slave station parallel output information contents to be initialized are output to the parallel output terminals to the slave stations, and the identifier information contents are sequentially returned to the master station in the slave station arrangement order of the transmission path. The master station divides this identifier information content every 4 bits, and resets the current slave station sequence order of the transmission line while comparing it with the order of the identifier information content registered in the basic slave station sequence memory map.

【0083】次に、識別子情報についての取り決めを簡
単に説明する。
Next, the rules for the identifier information will be briefly described.

【0084】識別子情報は、電子機器の構成に必要とさ
れる電気ユニットを本体ユニットと称して、固定の値を
割り振り、電子機器の構成でなくても動作が実行できる
電気ユニットをオプションユニットと称して、順番に値
を割り振っている。但し、このオプションユニットの場
合は、単に1から順番に割り振るのではない。つまり、
本体ユニットは、必ず装置内に存在するため、予め設定
された伝送路順番の位置にあることを確認できればよ
く、したがって、識別子情報は固定値で設定できる。そ
して、オプションユニットは、既に位置順番が決定して
いる本体ユニット間に必ず存在するため、一つの本体ユ
ニットを基準とし、順番に番号を振る。したがって、オ
プションユニットの識別子情報は、一つの本体ユニット
間では重複する識別子情報内容は存在しないが、異なる
組みの本体ユニット間においては重複することが許され
るのであって、その識別判定も可能になる。図10で
は、その識別子情報の割り振りの一例が従局並列出力情
報の上位4ビットに示されている。
In the identifier information, an electric unit required for the configuration of the electronic device is referred to as a main unit, a fixed value is allocated, and an electric unit capable of performing an operation without the configuration of the electronic device is referred to as an optional unit. And assign values in order. However, in the case of this optional unit, it is not simply allocated in order from 1. That is,
Since the main unit always exists in the apparatus, it is sufficient that the main unit can be confirmed to be at a position in the transmission line order set in advance. Therefore, the identifier information can be set with a fixed value. Since the optional units always exist between the main units whose position order has already been determined, the optional units are numbered sequentially based on one main unit. Therefore, the identifier information of the option unit has no duplicate identifier information content between one main unit, but it is allowed to be duplicated between different sets of main units, and the identification judgment can be made. . In FIG. 10, an example of the assignment of the identifier information is shown in the upper four bits of the slave station parallel output information.

【0085】このような取り決めによる識別子情報の定
義に基づいて、図9に示す伝送路を例にメモリマップの
再設定処理を説明する。なお、このメモリ設定は、一般
的なCPUのメモリ操作と同様に実行されるものであっ
て、以下に一例として説明するが、特にこれに限定され
たものではない。
Based on the definition of the identifier information according to such an agreement, the process of resetting the memory map will be described using the transmission line shown in FIG. 9 as an example. Note that this memory setting is performed in the same manner as a general CPU memory operation, and will be described below as an example, but is not particularly limited to this.

【0086】メモリを操作する手段として、メモリの先
頭位置アドレス(図10中、MTOで示す)とメモリポ
インタカウンタがあり、メモリの先頭位置アドレスが示
すメモリ内容を基準カウンタとして利用する。そして、
シフト転送された識別子情報が本体ユニットの場合に
は、メモリの先頭位置アドレスが示すメモリ内容の基準
カウンタ値をインクリメントし、オプションユニットの
場合には、メモリポインタカウンタ値をインクリメント
する。
As means for operating the memory, there are a memory start position address (indicated by MTO in FIG. 10) and a memory pointer counter, and the contents of the memory indicated by the memory start position address are used as a reference counter. And
If the identifier information shifted and transferred is the main unit, the reference counter value of the memory content indicated by the head position address of the memory is incremented. If the identifier information is the optional unit, the memory pointer counter value is incremented.

【0087】主局には、まず、チェッカの識別子情報
(本体ユニット)がシフト転送される。この場合は、本
体ユニットであるため、基準カウンタ値がインクリメン
トされて01Hになる。一方、メモリポインタカウンタ
値はインクリメントされず00Hのままである。そし
て、基本とされるメモリマップの先頭位置アドレスから
スキャンして、基準カウンタ値が示す順番に位置する本
体ユニットの識別子情報内容が登録されているアドレス
位置を該基本とされるメモリマップから割り出し(この
場合には01Hであるため、最初に位置する本体ユニッ
トであるチェッカが割り出される)、そのアドレス位
置に基準カウンタアドレスを設定する。
First, checker identifier information (main unit) is shift-transferred to the master station. In this case, since the main unit is used, the reference counter value is incremented to 01H. On the other hand, the memory pointer counter value is not incremented and remains at 00H. Then, scanning is performed from the start position address of the base memory map, and an address position in which the identifier information content of the main unit located in the order indicated by the reference counter value is registered is determined from the base memory map ( In this case, since it is 01H, the checker which is the main body unit located first is calculated), and the reference counter address is set at that address position.

【0088】次に、基準カウンタ値とメモリポインタカ
ウンタ値との加算結果が示すアドレスのメモリの上位4
ビットとシフト転送された識別子情報内容とを比較す
る。この場合には、1番目に位置する本体ユニットの0
番目のメモリ内容(図10中、チェッカとなってい
る)と、転送されたチェッカの識別子情報内容とを比
較するため一致する。一致した場合には、該当従局有り
と判定し、基本となるメモリマップの設定された上位4
ビットはそのまま残して、従局有りという状態にしてお
く。
Next, the upper four bits of the memory at the address indicated by the result of adding the reference counter value and the memory pointer counter value
The bits are compared with the shift-transferred identifier information contents. In this case, the first main unit 0
The contents of the second memory (indicated as a checker in FIG. 10) match the contents of the identifier information of the transferred checker for comparison. If they match, it is determined that there is a corresponding slave station, and the upper 4
The bit is left as it is, and the state that there is a slave station is set.

【0089】次に、ソータの識別子情報(オプションユ
ニット)がシフト転送される。この場合には、オプショ
ンユニットであるため、基準カウンタ値がインクリメン
トされず01Hのままで、メモリポインタカウンタ値が
インクリメントされて01Hになる。その結果、1番目
に位置する本体ユニット後の1番目に示されるメモリ
(図10中、ソータとなっている)と、転送されたソー
タの識別子情報内容とを比較するため一致する。したが
って、同様に従局有りと処理される。
Next, the sorter identifier information (option unit) is shifted and transferred. In this case, since this is an optional unit, the reference counter value is not incremented and remains at 01H, and the memory pointer counter value is incremented to 01H. As a result, the first memory (shown as a sorter in FIG. 10) after the first main unit is matched with the transferred sorter identifier information for comparison. Therefore, it is similarly processed that there is a slave station.

【0090】次にシフト転送される識別子情報は、図9
より、高圧赤(オプションユニット)となる。この場合
には、本体ユニットではないため、メモリポインタカウ
ンタ値がインクリメントされて02Hになる。一方、基
準カウンタ値は01Hのままである。したがって、1番
目に位置する本体ユニット後の2番目に位置されるメモ
リ(図10中、スイッチバックとなっている)と、転送
されたソータの識別子情報内容とを比較する。その結
果、不一致となり、まず、1番目に位置する本体ユニッ
ト後の2番目に位置されるメモリであるスイッチバック
メモリの上位4ビットをオールゼロに再設定し、該当従
局無しにする。
The identifier information to be shifted next is shown in FIG.
Higher pressure red (optional unit). In this case, since it is not the main unit, the memory pointer counter value is incremented to 02H. On the other hand, the reference counter value remains at 01H. Therefore, the memory located second after the main unit located first (switched back in FIG. 10) is compared with the transferred identifier information of the sorter. As a result, a mismatch occurs. First, the upper 4 bits of the switchback memory, which is the second memory located after the first main unit, are reset to all zeros, and there is no corresponding slave station.

【0091】次に、再度メモリポインタカウンタ値をイ
ンクリメントし、03Hとして、次のメモリマップに位
置する内容と比較する。つまり、1番目に位置する本体
ユニット後の3番目に位置されるメモリと比較する。同
様にこの場合には、不一致と判断され、一致するまで、
不一致のメモリは該当従局無しと設定して比較を続け
る。
Next, the value of the memory pointer counter is incremented again, and 03H is compared with the content located in the next memory map. That is, it is compared with the memory located third after the main unit located first. Similarly, in this case, it is determined that they do not match,
The non-matching memory is set as no slave station and the comparison is continued.

【0092】この場合には、メモリポインタカウンタ値
が04Hのとき、つまり、1番目に位置する本体ユニッ
ト後の4番目に位置されるメモリと比較したときに一致
し、このメモリの従局を有りと設定する。
In this case, when the memory pointer counter value is 04H, that is, when the memory pointer counter value is compared with the fourth memory located after the first main unit, it is determined that the slave station of this memory is present. Set.

【0093】次は、図9に示されるように、高圧1の識
別子情報(本体ユニット)がシフト転送される。本体ユ
ニットの識別子情報内容を受信すると、まず、基準カウ
ンタ値とメモリポインタカウンタ値とが示す以降のメモ
リから始まり、基準カウンタ値がインクリメントされた
値で示される本体ユニット間に登録されたオプションユ
ニットのメモリ内容を全て該当従局無しに設定する。こ
の場合は、高圧黄(オプションユニット)がそれに該当
する。次に、インクリメントされた基準カウンタ値を基
に、上述のように、基本となるメモリマップの再設定を
続ける。なお、基準カウンタがインクリメントされると
きは、メモリポインタカウンタ値はクリアされ00Hに
戻すようになる。
Next, as shown in FIG. 9, the identifier information (main unit) of the high voltage 1 is shifted and transferred. When the identifier information content of the main unit is received, first, starting from the memory indicated by the reference counter value and the memory pointer counter value, the optional counter of the optional unit registered between the main units indicated by the incremented value of the reference counter value is started. Set all memory contents to no slave station. In this case, high-pressure yellow (optional unit) corresponds to this. Next, based on the incremented reference counter value, the reset of the basic memory map is continued as described above. When the reference counter is incremented, the memory pointer counter value is cleared and returned to 00H.

【0094】そして、上記動作を基本とされるメモリマ
ップ全てに対し実行することで、メモリの再設定が図1
1(a)に示すように実行されるのである。つまり、こ
のメモリ操作は、基本的に、何番目に位置する本体ユニ
ット後の何番目に位置されるオプションユニットという
形態で操作され、メモリ内容の設定がなされる。
By executing the above operation for all the basic memory maps, the resetting of the memory is performed as shown in FIG.
This is executed as shown in FIG. In other words, this memory operation is basically performed in the form of the optional unit located at the position after the main unit located at the position, and the memory contents are set.

【0095】以下、図12のステップS105〜S11
2で示される通常通信を説明する。
Hereinafter, steps S105 to S11 in FIG.
The normal communication indicated by No. 2 will be described.

【0096】同図において、上述の初期化通信処理をス
テップS103で実行すると、メモリマップ再設定フラ
グがセットされる。その結果、メモリマップは、図11
(a)の従局並列出力情報の上位4ビットに示すよう
に、基本となるメモリマップでの従局配列順番から、現
状の伝送路に存在する従局の従局配列順番に再設定され
る。通常通信は、この従局配列順番の状態を基に実行さ
れる。
In the figure, when the above-described initialization communication processing is executed in step S103, a memory map reset flag is set. As a result, the memory map is shown in FIG.
As shown in the upper four bits of the slave station parallel output information in FIG. 7A, the slave station arrangement order in the basic memory map is reset to the slave station arrangement order of the slave stations existing on the current transmission path. Normal communication is executed based on the state of the slave station arrangement order.

【0097】ステップS102からステップS105に
移ると、リトライフラグをチェックしてリトライ通信の
有無を判断する。このリトライ通信は、初期化通信で説
明した処理と同様に、一回のシリアル通信が失敗したと
きに、リトライカウンタをインクリメントして、そのカ
ウント値が所定値以内の場合には再通信を実行するもの
で、通常通信制御にも存在する。
When the process proceeds from step S102 to step S105, the retry flag is checked to determine whether or not there is retry communication. In the retry communication, similarly to the processing described in the initialization communication, when one serial communication fails, the retry counter is incremented, and when the count value is within a predetermined value, the retry communication is performed. And usually also exists in communication control.

【0098】なお、このリトライ通信手段の構成は、本
シリアル通信装置の2種類の通信手段である、初期化通
信と通常通信とが同時進行しないために、同じ手段構成
を利用し合う。つまり、リトライ通信で所定値を越えて
エラーとなるときには、初期化通信も通常通信もステッ
プS101からステップS104に移って、通信故障処
理ルーチンで処理される。一方、リトライ通信を実行す
るときには、初期化通信の場合は、前述したように、図
13のステップS135でリトライカウンタのインクリ
メント処理を行い、再設定フラグをリセットのまま、図
12のステップS102に到達し、再設定フラグが未設
定ということでリトライ通信が実行される。また、通常
通信の場合は、通常通信実行後のステップS112でリ
トライフラグのリセット処理を行い、このステップS1
05によって、リトライ通信実行の判断がなされる。つ
まり、初期化通信と通常通信とでのリトライ通信制御は
別々に制御されるが、エラー処理ルーチンや処理に必要
なフラグ、カウンタ類は共用している。
Note that the configuration of the retry communication means uses the same means configuration since the initialization communication and the normal communication, which are the two types of communication means of the present serial communication device, do not proceed simultaneously. That is, when an error occurs in the retry communication exceeding a predetermined value, both the initialization communication and the normal communication shift from step S101 to step S104, and are processed in the communication failure processing routine. On the other hand, when executing the retry communication, in the case of the initialization communication, as described above, the retry counter is incremented in step S135 in FIG. 13 and the process proceeds to step S102 in FIG. 12 while the reset flag is reset. Then, the retry communication is executed because the reset flag is not set. In the case of normal communication, the retry flag is reset in step S112 after the normal communication is executed.
05, it is determined that retry communication is to be executed. That is, the retry communication control for the initialization communication and the normal communication is controlled separately, but the flags and counters necessary for the error processing routine and processing are shared.

【0099】メモリマップの再設定を終えると、ステッ
プS105でリトライ通信なしと判断して、ステップS
106およびS107で主局での要求フラグか、また
は、従局での通信要求信号かのどちらかで通常通信の実
行要求を待機する。なお、初期化通信を終えたときに
は、従局の位相制御カウンタ11も主局位相制御カウン
ト手段での制御カウント値も共に通信ソフトリセットで
00Hになっているために、ステップS107での従局
通信要求信号は無効である。したがって、主局は、特に
図示していないが、初期化通信を終えた直後に主局通信
要求フラグをセットして、ステップS106で通常通信
の実行を指示する。一方、通常通信を一回でも実行して
いると制御カウント値は0EHとなっていて、上述した
ように、通常通信の実行指示を待機する。すなわち、ス
テップS107からステップS112に移り、リトライ
や故障などの処理信号をリセットして、本シリアル通信
処理を一旦終了して再び、ステップS105〜S107
のループにより待機して通常通信の実行指示を検知す
る。そして、通常通信の実行指示を受けるとステップS
108に移り、通常通信処理を実行する。
When the resetting of the memory map is completed, it is determined in step S105 that there is no retry communication.
At 106 and S107, a request for execution of normal communication is awaited by either the request flag at the master station or the communication request signal at the slave station. When the initialization communication has been completed, since both the phase control counter 11 of the slave station and the control count value of the master station phase control counting means are set to 00H by the communication software reset, the slave station communication request signal in step S107 is set. Is invalid. Therefore, although not particularly shown, the master station sets the master station communication request flag immediately after finishing the initialization communication, and instructs execution of the normal communication in step S106. On the other hand, if the normal communication has been performed even once, the control count value is 0EH, and as described above, the system waits for the execution instruction of the normal communication. That is, the process proceeds from step S107 to step S112, resets the processing signals for retries and failures, temporarily ends the serial communication processing, and again executes steps S105 to S107.
And waits for the execution of the normal communication to detect the execution instruction. Then, when an instruction to execute normal communication is received, step S
The routine proceeds to 108, where normal communication processing is executed.

【0100】図14の通常通信処理において、まず、ス
テップS141で、通信ソフトリセットを実行して通信
実行の同期を取る。
In the normal communication process shown in FIG. 14, first, in step S141, communication software reset is executed to synchronize the execution of communication.

【0101】次に、ステップS142で、通信実行のた
めのフラグや各カウンタ値をリセットする。
Next, in step S142, a flag for executing communication and each counter value are reset.

【0102】そして、ステップS143では、メモリ操
作のためのメモリポインタをインクリメントし、ステッ
プS144およびS145では、主局の位相制御カウン
タから制御カウンタ値をロードしてチェックし、予め登
録した所定値であるか否かを判断する。この場合では、
従局からシフト転送される従局入力情報を選択したとき
の00Hと、シフト転送を一巡実行したときの06Hの
2ポイントを判定している。さらに、シフト転送を二巡
実行した後の二度読み比較結果のときを0DHに設定
し、図15のステップS160およびS161で判定し
ている。一方、従局通信要求信号の有効期間を0EHと
設定しているが、ここでは、特にタイミング判定の実行
はしていないものの、通常通信での通信動作を終了し
て、次回通信実行可能状態を0EHにするように制御し
ている。
In step S143, the memory pointer for memory operation is incremented. In steps S144 and S145, the control counter value is loaded and checked from the phase control counter of the main station, and is a predetermined value registered in advance. It is determined whether or not. In this case,
Two points are determined: 00H when the slave station input information to be shifted from the slave station is selected and 06H when the shift transfer is performed once. Further, the value of the double reading comparison result after performing the shift transfer twice is set to 0DH, and the determination is made in steps S160 and S161 in FIG. On the other hand, the validity period of the slave station communication request signal is set to 0EH. Here, although the timing determination is not particularly performed, the communication operation in the normal communication is terminated, and the next communication executable state is set to 0EH. It is controlled to be.

【0103】ステップS145で、制御カウンタ値が上
記所定値(00H,06H)であれば、ステップS14
6に移り、返送位相信号のオンチェックを行う一方、ス
テップS145で、制御カウンタ値が上記所定値でなけ
れば、図15のステップS147に移り、返送位相信号
のオフチェックを行う。
If it is determined in step S145 that the control counter value is the predetermined value (00H, 06H), the process proceeds to step S14.
6, the on-check of the return phase signal is performed. On the other hand, if the control counter value is not the predetermined value in step S145, the process proceeds to step S147 in FIG. 15, and the off-check of the return phase signal is performed.

【0104】そして、ステップS146で返送位相信号
のオンチェックのときにオン、または、ステップS14
7で返送位相信号のオフチェックのときにオフであれ
ば、正常に位相タイミングの同期が取れていると判断し
て、図14のステップS150に移る。一方、ステップ
S146で返送位相信号のオンチェックのときにオフ、
またはステップS147で返送位相信号のオフチェック
のときにオンであれば、位相タイミングの同期がずれて
いると判断し、図15のステップS148で通信異常フ
ラグの位相エラービットをセットし、ステップS149
で通信ソフトリセットを実行して、現在実行している通
常通信をキャンセルする。この場合、図12のステップ
S109で異常と判断されて、ステップS110に移
り、通信異常フラグ解析が実行されて、ステップS11
1で、リトライ通信を指示するためにリトライフラグを
セットし、さらにリトライカウンタをインクリメントす
る。
Then, it is turned on when the return phase signal is checked on in step S146, or in step S14.
If it is off when the return phase signal is off-checked in step 7, it is determined that the phase timing is normally synchronized, and the routine goes to step S150 in FIG. On the other hand, when the return phase signal is turned on in step S146,
Alternatively, if the return phase signal is on at the time of off-check in step S147, it is determined that the phase timing is out of synchronization, and the phase error bit of the communication abnormality flag is set in step S148 in FIG.
Execute the communication software reset to cancel the normal communication currently being executed. In this case, it is determined in step S109 of FIG. 12 that there is an abnormality, and the process proceeds to step S110, where a communication abnormality flag analysis is performed, and the process proceeds to step S11.
In step 1, a retry flag is set to instruct retry communication, and the retry counter is incremented.

【0105】なお、通信異常フラグ解析ルーチンの実行
は、特に図示しないが各種異常状態に応じて、各々対応
した複数のフラグから構成されている。そして、異常状
態内容が軽いとされるフラグがセット(ここで言う異常
状態内容は、予め、軽度の部類と重度の部類とに識別さ
れて設定されているものである)されているときには、
リトライカウンタ値を次のステップS111でインクリ
メント(+1)処理して、リトライ通信の実行を指示す
る。一方、異常状態内容が重いとされるフラグがセット
されているときには、リトライカウンタ値をその場でエ
ラーとなる所定値にダイレクトにセットするように予め
部類分けされているために、次にステップS111でイ
ンクリメント(+1)処理することで、一旦本シリアル
通信処理を終了した後のステップS101の判断でリト
ライ通信は実行されず、即、ステップS101からステ
ップS104に移って、通信故障処理ルーチンで通信動
作および電子機器の動作が停止される。
The execution of the communication error flag analysis routine is made up of a plurality of flags corresponding to various types of abnormal conditions, not shown. Then, when a flag indicating that the content of the abnormal state is light is set (the content of the abnormal state referred to here is one that has been identified and set in advance as a minor category and a severe category),
The retry counter value is incremented (+1) in the next step S111 to instruct execution of retry communication. On the other hand, when the flag indicating that the content of the abnormal state is heavy is set, the retry counter value is classified in advance so as to be directly set to a predetermined value causing an error on the spot. In this case, the retry communication is not executed according to the determination in step S101 after the serial communication processing is completed, and the process immediately proceeds from step S101 to step S104 to perform the communication operation in the communication failure processing routine. And the operation of the electronic device is stopped.

【0106】図14のステップS146および図15の
ステップS147で、返送位相信号状態が正常と判断さ
れると、図14のステップS150に移り、通常通信の
実行に入る。
If it is determined in step S146 in FIG. 14 and step S147 in FIG. 15 that the state of the return phase signal is normal, the flow shifts to step S150 in FIG. 14 to start execution of normal communication.

【0107】まず、メモリポインタ値と従局並列出力情
報に示す再設定終了したメモリマップの先頭値アドレ
ス:MTOとの加算値がメモリマップの最終値アドレ
ス:MTEになっているか否かを判断し、等しい場合に
は、シフト転送するデータ一巡がスキャン終了したこと
を意味するため、ステップS160に移り、通常通信実
行後の後処理に入る。一方、等しくない場合、すなわち
シフト転送が終了していない場合には、ステップS15
1およびS152に移り、メモリポインタ値とメモリマ
ップの先頭値アドレス:MTOとの加算値のアドレスが
示すメモリ内容の上位4ビットをチェックする。
First, it is determined whether or not the sum of the memory pointer value and the head address: MTO of the reset memory map indicated by the slave station parallel output information is the final address of the memory map: MTE. If they are equal, it means that one round of data to be shifted and transferred has been scanned, so the flow shifts to step S160 to enter post-processing after execution of normal communication. On the other hand, if they are not equal, that is, if the shift transfer is not completed, step S15
1 and S152, the upper 4 bits of the memory content indicated by the address of the sum of the memory pointer value and the start value address of the memory map: MTO are checked.

【0108】ステップS152で、上位4ビットが00
Hであれば、再設定で登録従局なしとされているため、
再びステップS143に戻り、メモリポインタ値をイン
クリメントして、メモリマップの次の従局におけるシフ
ト転送の実行に移る。そして、再びステップS152に
到ると、同様にしてメモリ内容の上位4ビットをチェッ
クする。このとき、上位4ビットが00Hであれば、同
じ動作を繰り返し、00Hでなければ、そのメモリ内容
の下位4ビットをステップS153でアクセスし、ステ
ップS154でシフト転送のための1ビットシフトを実
行する。さらに、ステップS155で主局が有するクロ
ック数カウンタ手段が所定値か否かを判断して、主局お
よび従局が各々有する位相制御カウンタの制御カウント
値の制御を実行する。
In step S152, the upper 4 bits are set to 00.
If it is H, it is determined that there is no registered slave station by resetting,
Returning to step S143 again, the memory pointer value is incremented, and the process shifts to execution of shift transfer in the next slave station in the memory map. Then, when it reaches step S152 again, it similarly checks the upper 4 bits of the memory contents. At this time, if the upper 4 bits are 00H, the same operation is repeated. If the upper 4 bits are not 00H, the lower 4 bits of the memory contents are accessed in step S153, and 1-bit shift for shift transfer is executed in step S154. . Further, in step S155, it is determined whether or not the clock number counter means of the master station has a predetermined value, and control of the control count values of the phase control counters of the master station and the slave stations is executed.

【0109】そして、ステップS157でシフト転送に
よる1ビットの返送信号を入力し、ステップS158で
一つの従局分である4ビット分のシフト転送が終了した
か否かを判断する。ステップS158でまだの場合に
は、ステップS154に戻って同じ動作を繰り返す一
方、4ビット分のシフト転送が終了すれば、ステップS
159に移って、その4ビットデータを該当する従局で
ある図11(b)に示すメモリマップの従局並列入力情
報にストアする。具体的には、メモリポインタ値と従局
並列入力情報のメモリマップの先頭値アドレス:MTI
との加算値アドレスが示すメモリ内容の下位4ビットに
ストアして情報内容を更新する。
Then, in step S157, a 1-bit return signal by shift transfer is input, and in step S158, it is determined whether or not the shift transfer for 4 bits corresponding to one slave station has been completed. If it is not determined in step S158, the process returns to step S154 to repeat the same operation.
The process proceeds to 159, where the 4-bit data is stored in the slave-station parallel input information of the memory map shown in FIG. More specifically, the start value address of the memory map of the memory pointer value and the slave station parallel input information: MTI
Is stored in the lower 4 bits of the memory content indicated by the added value address to update the information content.

【0110】そして、次の従局のシフト転送を実行する
ために以上動作を繰り返すために、再びステップS14
3に戻る。
Then, in order to repeat the above operation to execute the shift transfer of the next slave station, step S14 is performed again.
Return to 3.

【0111】上述したように、ステップS150で、シ
フト転送する従局のデータスキャンが一巡して終了した
と判断したときには、図15のステップS160に移
り、主局の位相制御カウンタの制御カウント値を0DH
にして、各従局からの二度読み結果を判定する。ステッ
プS161で、返送位相信号がオンしていれば、いずれ
かの従局で二度読み比較にエラーがあったことを意味す
るために、ステップS163に進み、通信異常フラグの
二度読み比較エラービットをセットして、ステップS1
64でリトライ通信を実行するための通信ソフトリセッ
トを実行する。この後、再び図12のステップS109
に戻り、上述のように、ステップS109からステップ
S110へ移って、リトライ通信の実行要求処理がなさ
れる。
As described above, when it is determined in step S150 that the data scan of the slave station to be shifted and transferred has completed one cycle, the process proceeds to step S160 in FIG. 15, and the control count value of the phase control counter of the master station is set to 0DH
Then, the result of reading twice from each slave station is determined. If the return phase signal is on in step S161, it means that there is an error in the double reading comparison in any of the slave stations, and the process proceeds to step S163, where the double reading comparison error bit of the communication abnormality flag is set. Is set in step S1
At 64, a communication software reset for executing retry communication is executed. Thereafter, step S109 in FIG.
Then, as described above, the process proceeds from step S109 to step S110, where the execution request processing of the retry communication is performed.

【0112】一方、ステップS161で、返送信号がオ
ンされていない場合には、全ての従局で二度読み比較に
エラーがなかったことを意味するために、ステップS1
62に進み、主局の位相制御カウンタの制御カウント値
を0EHにして、各従局からの通信要求信号を有効に設
定して、無事、通常通信を終了したものとして図12の
ステップS109に戻る。そして、通常異常フラグは0
0Hのまま、ステップS112でリトライフラグとリト
ライカウンタをリセットして一回の通常通信を終える。
これにより、次回の通信実行では、ステップS106お
よびS107で、主局または従局からの通信要求がある
まで通信待機状態を続け、要求がない限り通信実行は基
本的になされない。
On the other hand, if the return signal is not turned on in step S161, it means that there is no error in the double reading comparison in all the slave stations, so that step S1 is executed.
In step 62, the control count value of the phase control counter of the master station is set to 0EH, the communication request signal from each slave station is set to be valid, and it is assumed that the normal communication has been safely completed, and the process returns to step S109 in FIG. And the normal abnormality flag is 0
At 0H, the retry flag and the retry counter are reset in step S112 to complete one normal communication.
Thus, in the next communication execution, in steps S106 and S107, the communication standby state is continued until there is a communication request from the master station or the slave station, and communication is basically not performed unless there is a request.

【0113】以上が通常通信の主局制御であるが、この
通常通信は、初期化通信の実行で現状の伝送路に存在す
る従局の配列順番を再設定できた後に実施されるもの
で、再設定された伝送路に存在する従局の配列順番が変
化した場合には、直ちに初期化通信を実行してメモリの
再設定を実行しなければならない。
The above is the master station control of the normal communication. This normal communication is performed after the arrangement order of the slave stations existing on the current transmission path can be reset by executing the initialization communication. When the arrangement order of the slave stations existing on the set transmission line changes, it is necessary to immediately execute the initialization communication to execute the resetting of the memory.

【0114】なお、主局通信要求の発生部分は、特に図
示していないが、電子機器本体の制御を司るCPUが各
従局に情報更新が必要と判断する主局通信要求フラグを
各制御タスク中にセットする。したがって、主局は、シ
リアル通信処理の通常通信を制御する部分(図12のス
テップS106)で主局通信要求フラグをチェックし
て、通常通信実行の有無を判断する。
Although a part for generating a master station communication request is not particularly shown, the CPU controlling the electronic device main body sets a master station communication request flag for determining that each slave station needs to update information in each control task. Set to. Therefore, the master station checks the master station communication request flag in the part for controlling the normal communication of the serial communication processing (step S106 in FIG. 12) and determines whether or not the normal communication is to be performed.

【0115】このように、通常通信の実行は、再設定さ
れたメモリマップの従局並列出力情報で有効とされる下
位4ビット情報内容を順次シフト転送するとともに、返
送される情報内容を順次、従局並列入力情報の下位4ビ
ットに格納するだけでよい。つまり、一旦メモリの再設
定を実施すれば、主局は単にメモリ内容を転送するよう
な簡単な制御で各従局との情報交換を行うことができ
る。またさらに、通常通信を実行する所要時間は、情報
交換するデータビット数のみのシフト転送で済むために
最小時間で処理できる。
As described above, the execution of the normal communication sequentially shifts and transfers the lower 4 bit information contents validated by the slave parallel output information of the reset memory map, and sequentially shifts the returned information contents to the slave station. Only the lower 4 bits of the parallel input information need be stored. That is, once the memory is reset, the master station can exchange information with each slave station by simple control such as simply transferring the contents of the memory. Furthermore, the time required to execute the normal communication can be processed in a minimum time because only the number of data bits for information exchange needs to be shifted and transferred.

【0116】[0116]

【発明が解決しようとする課題】しかしながら、上記従
来のシリアル通信装置では、次のような問題があった。
However, the conventional serial communication device has the following problems.

【0117】すなわち、上記従来のシリアル通信装置
は、主局主導により単方向性シリアル通信を行ってお
り、いずれかの従局で、その情報内容が更新されると、
当該従局は、主局に対して通信要求信号を発生する。主
局は、この通信要求信号を検出すると、主局内で発生す
る主局通信要求の有無に拘らずシリアル通信を実行す
る。これにより、主局と各従局とは、その情報内容を常
に最新の状態にしながら、情報交換を実行することがで
きる。上記従来のシリアル通信装置は、この双方向性の
シリアル通信形態での情報交換を実施するところに一つ
の特徴がある。つまり、上記従来のシリアル通信装置で
は、従局からの通信要求があって初めて情報交換が成立
し、従局からの通信要求信号に何等かの異常が生じ、主
局に対して正常に作用しない場合には、シリアル通信そ
のものが成立し得なかった。
That is, the above-described conventional serial communication device performs unidirectional serial communication under the initiative of the master station, and when the information content is updated in any of the slave stations,
The slave station issues a communication request signal to the master station. Upon detecting this communication request signal, the master station executes serial communication regardless of the presence or absence of a master station communication request generated in the master station. As a result, the master station and each slave station can exchange information while always keeping the information contents up to date. One feature of the conventional serial communication device is that information is exchanged in this bidirectional serial communication mode. In other words, in the above-described conventional serial communication device, information exchange is established only after a communication request from a slave station occurs, and some abnormality occurs in a communication request signal from the slave station, and when the master station does not normally operate. Could not establish serial communication itself.

【0118】したがって、上記従来のシリアル通信装置
では、従局からの通信要求信号による通信実行時は、通
信実行前後による従局からの情報内容の変化状態を判断
し、従局からの通信要求信号があったときには必ず通信
実行後の従局からの情報内容が、少なくとも1ビットは
更新されていることを判定することで、従局からの通信
要求信号が正常に作用していることを自己診断してい
た。
Therefore, in the above-described conventional serial communication device, when communication is performed by a communication request signal from a slave station, a change state of information content from the slave station before and after the execution of communication is determined, and a communication request signal from the slave station is received. In some cases, at least one bit of the information content from the slave station after the execution of the communication is determined to be updated, thereby performing a self-diagnosis that the communication request signal from the slave station is normally operating.

【0119】しかし、上記従来のシリアル通信装置が、
電子写真装置などの装置に適用されている場合には、プ
リント動作中とプリントスタンバイ(以下、単に「スタ
ンバイ」と略して言う)中とでは、通信実行頻度が非常
に異なる(これは、プリント動作中においては、各従局
の並列入力端子に接続されている多くのセンサ類それぞ
れが各位相で順次オンオフを繰り返したりして、刻々と
情報内容が変化するため、通信実行動作も次々と追われ
るようになされ、従局からの通信要求信号を受信する毎
に上記自己診断を行っていると、通信インターバルが長
くなってしまうからである)ため、従局からの信号変化
伝達に遅れが生じたり、場合によっては、あるセンサの
入力情報の変化推移を見逃してしまい得る虞もある。言
うまでもなく、センサ入力の情報変化を見逃せば、装置
本体の動作に支障をきたすが、従局からの信号変化伝達
が遅れるだけでも、それが即反応させたいセンサである
場合には、同期位相などに遅延が生じて、装置本体の動
作に支障をきたすこともある。
However, the conventional serial communication device described above
When the present invention is applied to an apparatus such as an electrophotographic apparatus, the communication execution frequency is very different between a print operation and a print standby (hereinafter simply referred to as “standby”). In the middle, many sensors connected to the parallel input terminal of each slave station repeatedly turn on and off sequentially at each phase, and the information content changes every moment, so that the communication execution operation is also followed one after another. If the self-diagnosis is performed each time a communication request signal is received from the slave station, the communication interval becomes longer.) However, there is a possibility that a change in input information of a certain sensor may be overlooked. Needless to say, if the information change of the sensor input is overlooked, the operation of the device itself will be hindered. A delay may occur and hinder the operation of the apparatus body.

【0120】これは、上記従来のシリアル通信装置が適
用される機器装置すべてに共通する事情であって、装置
がある特定動作時に通信が頻繁に行われれば、その間に
実行される上記自己診断が一回の通信所要時間を長くし
てしまい、従局情報伝達が遅れる虞が生じて装置動作に
支障をきたし得る。したがって、場合によっては、自己
診断が通信の信頼性を低めてしまう結果になる。
This is a situation common to all equipment to which the above-mentioned conventional serial communication device is applied. If communication is frequently performed during a certain specific operation, the self-diagnosis executed during that time is not performed. The time required for one communication is lengthened, and the transmission of slave station information may be delayed, which may hinder the operation of the apparatus. Therefore, in some cases, the self-diagnosis may reduce the reliability of communication.

【0121】本発明は、この点に着目してなされたもの
であり、主局と従局とのシリアル通信の信頼性を維持し
ながら、従局からの通信要求信号が正常に作用している
ことの自己診断を行うことが可能なシリアル通信装置、
シリアル通信方法および記憶媒体を提供することを目的
とする。
The present invention has been made by paying attention to this point. It is to be understood that the communication request signal from the slave station normally operates while maintaining the reliability of the serial communication between the master station and the slave station. A serial communication device capable of performing self-diagnosis,
It is an object to provide a serial communication method and a storage medium.

【0122】[0122]

【課題を解決するための手段】上記目的を達成するた
め、本発明のシリアル通信装置は、一つの主局および複
数の従局をループ状に接続する伝送路を備え、前記主局
は、該主局内部で発生する通信要求または前記各従局が
発生する通信要求信号に応じて当該従局と、前記伝送路
を介したシリアル通信を行うシリアル通信装置におい
て、前記各従局は、前記主局に送るべき信号が変化した
ときに、前記通信要求信号を発生し、前記主局は、前記
発生された通信要求信号に応じて当該従局から受信した
情報内容を保持する第1の記憶手段と、該第1の記憶手
段に新たな情報内容を保持するときに、その直前に保持
されている情報内容を待避する第2の記憶手段と、前記
第1および第2の記憶手段にそれぞれ記憶された情報内
容を比較することにより、正常なシリアル通信がなされ
ているか否かを自己診断する自己診断手段とを有し、前
記自己診断手段は、当該シリアル通信装置が所定の動作
状態のときにのみ、その自己診断を実行することを特徴
とする。
In order to achieve the above object, a serial communication apparatus according to the present invention comprises a transmission line for connecting one master station and a plurality of slave stations in a loop, wherein the master station is connected to the master station. In a serial communication device that performs serial communication via the transmission path with the slave station in response to a communication request generated inside the station or a communication request signal generated by each slave station, each slave station should send to the master station. When the signal changes, the master station generates the communication request signal, and the master station stores, in response to the generated communication request signal, information content received from the slave station; When storing new information content in the storage means, the second storage means for saving the information content held immediately before the new information content, and the information content stored in the first and second storage means, respectively. By comparing Self-diagnosis means for performing self-diagnosis as to whether or not normal serial communication is performed, wherein the self-diagnosis means executes the self-diagnosis only when the serial communication device is in a predetermined operation state. It is characterized by.

【0123】好ましくは、前記自己診断手段は、前記第
1および第2の記憶手段にそれぞれ記憶された情報内容
をビット毎に全ビットについて比較し、前記記憶された
両情報内容が全ビットについて一致しているときには、
正常でないシリアル通信がなされていると自己診断し、
前記記憶された両情報内容が1ビットでも不一致である
ときには、正常なシリアル通信がなされていると自己診
断することを特徴とする。
Preferably, the self-diagnosis means compares the information contents stored in the first and second storage means with respect to all bits on a bit-by-bit basis, and determines whether both of the stored information contents are the same for all bits. When we are
Self-diagnosis that abnormal serial communication is being performed,
When both stored information contents do not match even by one bit, self-diagnosis is made that normal serial communication is performed.

【0124】また、好ましくは、前記自己診断手段は、
正常でないシリアル通信がなされていると自己診断した
ときには、前記第2の記憶手段に待避されている情報内
容を前記第1の記憶手段に戻すことを特徴とする。
Preferably, said self-diagnosis means comprises:
When a self-diagnosis is made that abnormal serial communication is being performed, the information content saved in the second storage means is returned to the first storage means.

【0125】さらに、好ましくは、前記主局は、前記複
数の従局のうち、予め設定された少なくとも1つ以上の
従局に対して、当該従局が前記主局に送るべき信号の少
なくとも1ビット以上を遠隔操作可能な遠隔操作手段
と、前記自己診断手段により、正常でないシリアル通信
がなされていると自己診断されたときには、前記遠隔操
作手段により、当該従局が前記主局に送るべき信号の少
なくとも1ビット以上を操作することで、前記自己診断
手段に対して自己診断を繰り返し行わせるように制御す
る制御手段とを有することを特徴とする。
Further, preferably, the master station transmits at least one bit or more of a signal to be sent to the master station by the slave station to at least one or more preset slave stations among the plurality of slave stations. At least one bit of a signal that the slave station should send to the master station when the self-diagnosis is performed by the remote operation means capable of remote operation and the self-diagnosis means that abnormal serial communication is being performed. By operating the above, there is provided control means for controlling the self-diagnosis means to repeat the self-diagnosis.

【0126】また、さらに好ましくは、前記自己診断の
繰り返し実行により、所定回数以上連続して正常でない
シリアル通信がなされていると自己診断されたときに
は、当該シリアル通信装置が通信故障であると判断する
判断手段を有することを特徴とする。
Further, more preferably, when the self-diagnosis that the abnormal serial communication has been performed continuously for a predetermined number of times or more by the repetition of the self-diagnosis is performed, it is determined that the serial communication device has a communication failure. It is characterized by having judgment means.

【0127】上記目的を達成するため、本発明のシリア
ル通信方法は、一つの主局および複数の従局をループ状
に接続する伝送路を備え、前記主局は、該主局内部で発
生する通信要求または前記各従局が発生する通信要求信
号に応じて当該従局と、前記伝送路を介したシリアル通
信を行う電子機器のシリアル通信方法において、前記各
従局では、前記主局に送るべき信号が変化したときに、
前記通信要求信号を発生し、前記主局では、前記発生さ
れた通信要求信号に応じて当該従局から受信した情報内
容を第1の記憶手段に保持し、該第1の記憶手段に新た
な情報内容を保持するときに、その直前に保持されてい
る情報内容を第2の記憶手段に待避し、当該シリアル通
信装置が所定の動作状態のときにのみ、前記第1および
第2の記憶手段にそれぞれ記憶された情報内容を比較す
ることにより、正常なシリアル通信がなされているか否
かを自己診断することを特徴とする。
In order to achieve the above object, a serial communication method according to the present invention comprises a transmission line connecting one master station and a plurality of slave stations in a loop, wherein the master station communicates inside the master station. In the serial communication method of an electronic device that performs serial communication via the transmission path with the slave station in response to a request or a communication request signal generated by each slave station, in each slave station, a signal to be sent to the master station changes. When you do
The master station generates the communication request signal, and the master station stores information content received from the slave station in the first storage means in response to the generated communication request signal, and stores new information in the first storage means. When the content is held, the information content held immediately before is saved in the second storage means, and only when the serial communication device is in a predetermined operation state, the information is stored in the first and second storage means. It is characterized in that self-diagnosis is made as to whether or not normal serial communication is performed by comparing the stored information contents.

【0128】好ましくは、前記自己診断では、前記第1
および第2の記憶手段にそれぞれ記憶された情報内容を
ビット毎に全ビットについて比較し、前記記憶された両
情報内容が全ビットについて一致しているときには、正
常でないシリアル通信がなされていると自己診断し、前
記記憶された両情報内容が1ビットでも不一致であると
きには、正常なシリアル通信がなされていると自己診断
することを特徴とする。
Preferably, in the self-diagnosis, the first
And the information contents respectively stored in the second storage means are compared for all bits for each bit. When the stored information contents match for all bits, it is determined that abnormal serial communication is being performed. Diagnosis is performed, and when both of the stored information contents do not match even by one bit, self-diagnosis is made that normal serial communication is performed.

【0129】また、好ましくは、前記自己診断では、正
常でないシリアル通信がなされていると自己診断したと
きには、前記第2の記憶手段に待避されている情報内容
を前記第1の記憶手段に戻すことを特徴とする。
Preferably, in the self-diagnosis, when the self-diagnosis indicates that abnormal serial communication is being performed, the information content saved in the second storage means is returned to the first storage means. It is characterized by.

【0130】さらに、好ましくは、前記主局では、前記
複数の従局のうち、予め設定された少なくとも1つ以上
の従局に対して、当該従局が前記主局に送るべき信号の
少なくとも1ビット以上を遠隔操作可能とし、前記自己
診断により、正常でないシリアル通信がなされていると
自己診断されたときには、前記遠隔操作により、当該従
局が前記主局に送るべき信号の少なくとも1ビット以上
を操作することで、前記自己診断を繰り返し行わせるこ
とを特徴とする。
More preferably, the master station transmits at least one bit or more of a signal to be sent to the master station by the slave station to at least one or more preset slave stations among the plurality of slave stations. When the self-diagnosis enables self-diagnosis that abnormal serial communication is being performed, the remote control operates at least one bit of a signal to be sent to the master station by the remote control. The self-diagnosis is repeatedly performed.

【0131】また、さらに好ましくは、前記自己診断の
繰り返し実行により、所定回数以上連続して正常でない
シリアル通信がなされていると自己診断されたときに
は、当該電子機器が通信故障であると判断することを特
徴とする。
[0131] More preferably, when the self-diagnosis that the abnormal serial communication has been performed continuously for a predetermined number of times or more by the repetition of the self-diagnosis is performed, it is determined that the electronic device has a communication failure. It is characterized by.

【0132】上記目的を達成するため、本発明の記憶媒
体は、一つの主局および複数の従局をループ状に接続す
る伝送路を備え、前記主局は、該主局内部で発生する通
信要求または前記各従局が発生する通信要求信号に応じ
て当該従局と、前記伝送路を介したシリアル通信を行う
電子機器のシリアル通信方法を含む、コンピュータが実
現できるプログラムを格納した記憶媒体であって、前記
シリアル通信方法は、前記各従局では、前記主局に送る
べき信号が変化したときに、前記通信要求信号を発生
し、前記主局では、前記発生された通信要求信号に応じ
て当該従局から受信した情報内容を第1の記憶手段に保
持し、該第1の記憶手段に新たな情報内容を保持すると
きに、その直前に保持されている情報内容を第2の記憶
手段に待避し、当該シリアル通信装置が所定の動作状態
のときにのみ、前記第1および第2の記憶手段にそれぞ
れ記憶された情報内容を比較することにより、正常なシ
リアル通信がなされているか否かを自己診断することを
特徴とする。
In order to achieve the above object, the storage medium of the present invention comprises a transmission line connecting one master station and a plurality of slave stations in a loop, wherein the master station transmits a communication request generated inside the master station. Or a slave medium according to a communication request signal generated by each slave station, including a serial communication method of an electronic device performing serial communication via the transmission path, a storage medium storing a computer-implementable program, In the serial communication method, in each of the slave stations, when a signal to be sent to the master station changes, the communication request signal is generated, and in the master station, from the slave station in accordance with the generated communication request signal. The received information content is stored in the first storage means, and when the new information content is stored in the first storage means, the information content held immediately before the new information content is saved in the second storage means, The Only when the real communication device is in a predetermined operation state, by self-diagnosing whether or not normal serial communication is performed by comparing information contents respectively stored in the first and second storage means. It is characterized by.

【0133】好ましくは、前記自己診断では、前記第1
および第2の記憶手段にそれぞれ記憶された情報内容を
ビット毎に全ビットについて比較し、前記記憶された両
情報内容が全ビットについて一致しているときには、正
常でないシリアル通信がなされていると自己診断し、前
記記憶された両情報内容が1ビットでも不一致であると
きには、正常なシリアル通信がなされていると自己診断
することを特徴とする。
Preferably, in the self-diagnosis, the first
And the information contents respectively stored in the second storage means are compared for all bits for each bit. When the stored information contents match for all bits, it is determined that abnormal serial communication is being performed. Diagnosis is performed, and when both of the stored information contents do not match even by one bit, self-diagnosis is made that normal serial communication is performed.

【0134】また、好ましくは、前記自己診断では、正
常でないシリアル通信がなされていると自己診断したと
きには、前記第2の記憶手段に待避されている情報内容
を前記第1の記憶手段に戻すことを特徴とする。
Preferably, in the self-diagnosis, when the self-diagnosis indicates that abnormal serial communication is being performed, the information content saved in the second storage means is returned to the first storage means. It is characterized by.

【0135】さらに、好ましくは、前記主局では、前記
複数の従局のうち、予め設定された少なくとも1つ以上
の従局に対して、当該従局が前記主局に送るべき信号の
少なくとも1ビット以上を遠隔操作可能とし、前記自己
診断により、正常でないシリアル通信がなされていると
自己診断されたときには、前記遠隔操作により、当該従
局が前記主局に送るべき信号の少なくとも1ビット以上
を操作することで、前記自己診断を繰り返し行わせるこ
とを特徴とする。
Further, preferably, the master station transmits at least one bit or more of a signal to be sent to the master station by the slave station to at least one or more preset slave stations among the plurality of slave stations. When the self-diagnosis enables self-diagnosis that abnormal serial communication is being performed, the remote control operates at least one bit of a signal to be sent to the master station by the remote control. The self-diagnosis is repeatedly performed.

【0136】また、さらに好ましくは、前記自己診断の
繰り返し実行により、所定回数以上連続して正常でない
シリアル通信がなされていると自己診断されたときに
は、当該電子機器が通信故障であると判断することを特
徴とする。
More preferably, when the self-diagnosis is made that abnormal serial communication has been performed continuously for a predetermined number of times or more by repeating the self-diagnosis, it is determined that the electronic device has a communication failure. It is characterized by.

【0137】[0137]

【発明の実施の形態】以下、本発明の実施の形態を図面
に基づいて詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0138】図1および図2は、本発明の第1の実施の
形態に係るシリアル通信装置、特に主局mのCPUが実
行する制御処理の一部であるシリアル通信処理の手順を
示すフローチャートであり、前記図12に対応してい
る。
FIGS. 1 and 2 are flowcharts showing the procedure of the serial communication apparatus according to the first embodiment of the present invention, in particular, the serial communication processing which is a part of the control processing executed by the CPU of the master station m. And corresponds to FIG.

【0139】本実施の形態のシリアル通信装置は、上記
従来のシリアル通信装置に対して、シリアル通信処理の
一部が異なる(具体的には、主として、従局からの通信
要求信号が正常に作用していること自己診断する自己診
断処理を追加している)のみであるため、ハードウェア
は、上記従来のシリアル通信装置(図7〜図9)と同様
のものを使用する。さらに、図1および図2中、図12
と同様の処理を行うステップには同一符号を付して、そ
の説明を省略する。
The serial communication apparatus of the present embodiment differs from the above-described conventional serial communication apparatus in a part of the serial communication processing (specifically, a communication request signal from a slave station normally operates normally). (A self-diagnosis process for self-diagnosis is added), and the same hardware as the above-described conventional serial communication device (FIGS. 7 to 9) is used. 1 and FIG.
Steps for performing the same processing as those described above are denoted by the same reference numerals, and description thereof will be omitted.

【0140】ここで、この通常通信処理を説明する前
に、主局のCPUが実行するプログラムの構成について
簡単に説明する。
Before describing the normal communication processing, the configuration of a program executed by the CPU of the main station will be briefly described.

【0141】このプログラムは、タスク形式の並列処理
によって構成されている。つまり、各独立した制御プロ
グラムが複数のタスクを構成し、電源投入後のCPUリ
セットでメモリやポートの初期化設定などを実行して、
モニタプログラムと呼ばれる各タスクの起動動作を制御
するプログラムが実行される。
This program is configured by task type parallel processing. In other words, each independent control program configures a plurality of tasks, and executes initialization settings of memory and ports by resetting the CPU after turning on the power,
A program called a monitor program for controlling the start operation of each task is executed.

【0142】各タスクは、並列処理されてリアルタイム
で実行される。図2および図3に示すシリアル通信タス
ク中の通常通信タスク(処理)もモニタプログラムによ
り起動され、所定処理動作を実行すると一旦モニタプロ
グラムに戻るが、再び起動されると、前回の続きからプ
ログラム実行がなされる。同様に、別のタスクも所定処
理動作を実行して一旦停止するが、再び起動されて続き
の制御動作を実行する。これにより、各タスクは所定処
理動作を順次実行することで並列処理がなされ、装置全
体の動作が制御される。
Each task is processed in parallel and executed in real time. The normal communication task (processing) in the serial communication task shown in FIG. 2 and FIG. 3 is also started by the monitor program, and returns to the monitor program once after executing a predetermined processing operation. Is made. Similarly, another task executes a predetermined processing operation and temporarily stops, but is started again to execute a subsequent control operation. As a result, the respective tasks perform parallel processing by sequentially executing predetermined processing operations, and the operation of the entire apparatus is controlled.

【0143】また、各タスク間の連携は、各タスクによ
りアクセスされるメモリによってなされている。
The cooperation between the tasks is performed by a memory accessed by each task.

【0144】以下、本実施の形態について説明するが、
以下で述べるプログラムも同様に並列処理されるタスク
ではあるが、説明を容易にするために一つのつながった
プログラム処理のようにして説明する。
Hereinafter, the present embodiment will be described.
The programs described below are tasks that are similarly processed in parallel, but are described as one connected program process for ease of description.

【0145】モニタプログラムにより、前記図12で説
明したシリアル通信タスク(処理)が起動されると、従
来例で述べたように、ステップS103で、初期化通信
処理により現状の通信伝送路に接続される従局配列順番
のメモリ再設定が実行される。
When the serial communication task (processing) described with reference to FIG. 12 is started by the monitor program, as described in the conventional example, in step S103, the serial communication task (processing) is connected to the current communication transmission line by the initialization communication processing. The memory reset of the slave station arrangement order is executed.

【0146】そして、メモリの再設定が終了すると、初
期化通信処理後の初めての通常通信が、ステップS10
6またはS107からステップS108の通常通信処理
に移行される。
When the resetting of the memory is completed, the first normal communication after the initialization communication processing is performed in step S10.
6 or S107 is shifted to normal communication processing in step S108.

【0147】なお、従来例では、ステップS106で主
局内部で発生する通信要求を判断し、ステップS107
で従局からの通信要求信号を判断するようにしていた
が、本実施の形態では、順序を逆にして、ステップS1
07で従局からの通信要求信号を判断してから、ステッ
プS106で主局内部で発生する通信要求を判断するよ
うにしている。これは、従局からの通信要求がある場合
でのシリアル通信実行時には、シリアル通信の実行前後
の情報内容の変化状態を判断して、従局通信要求がある
にも拘らず情報内容に変化がなかった等、通信実行結果
に矛盾があったか否かを判断するためであり、従来例で
述べたように、主局または従局のいずれかに通信要求が
あれば、シリアル通信を実行して情報交換を終了するも
のとは異なっているからである。すなわち、本実施の形
態では、通信実行結果の矛盾を判定するために、シリア
ル通信が、主局内での通信要求であったか、従局からの
通信要求信号によるものであったかが重要であって、お
のずと優先順位が存在するからである。したがって、本
実施の形態では、シリアル通信を実行する際は、いずれ
にせよ、従局からの通信要求信号の有無を確認する必要
がある。
In the conventional example, a communication request generated inside the main station is determined in step S106, and the process proceeds to step S107.
Was used to determine the communication request signal from the slave station. However, in the present embodiment, the order is reversed, and step S1 is performed.
After determining the communication request signal from the slave station at 07, a communication request generated inside the master station is determined at step S106. This is because at the time of serial communication execution in the case where there is a communication request from the slave station, the information content before and after the execution of the serial communication is determined to be in a state of change, and the information content is not changed despite the slave station communication request. In order to determine whether there is any inconsistency in the communication execution result, as described in the conventional example, if there is a communication request from either the master station or the slave station, serial communication is executed and information exchange is terminated. Because it is different from what you do. That is, in the present embodiment, in order to determine inconsistency in the communication execution result, it is important whether serial communication is a communication request within the master station or a communication request signal from a slave station. This is because there is a ranking. Therefore, in this embodiment, when executing serial communication, it is necessary to confirm whether or not there is a communication request signal from a slave station anyway.

【0148】ステップS107で、従局からの通信要求
信号がオフと判断すると、ステップS106に移り、主
局内での通信要求フラグをチェックする。ステップS1
06でも通信要求がない(主局通信要求フラグ=0)と
判断すると、図2のステップS112へ進み、一旦本シ
リアル通信処理を終了して再び、ステップS107およ
びS106で通信要求ありと判断するまでプログラムを
ループする。
If it is determined in step S107 that the communication request signal from the slave station is off, the flow shifts to step S106 to check the communication request flag in the master station. Step S1
If it is determined that there is no communication request even at 06 (master station communication request flag = 0), the process proceeds to step S112 in FIG. 2, and the present serial communication process is ended once again until it is determined at steps S107 and S106 that there is a communication request. Loop through the program.

【0149】仮に、主局内での通信要求フラグのみがセ
ットされているときは、ステップS107→S106→
S108と進み、通常通信によるシリアル通信が実行さ
れる。この通常通信処理では、従来例で述べたように、
終了すると、ステップS109で通信異常がチェックさ
れる。
If only the communication request flag in the main station is set, the process proceeds from step S107 to step S106.
Proceeding to S108, serial communication by normal communication is executed. In this normal communication process, as described in the conventional example,
Upon completion, a communication error is checked in step S109.

【0150】そして、通常通信処理に異常があれば、ス
テップS110→S111と進み、従来例と同様に動作
する一方、通常通信処理に異常がなければ、図2のステ
ップS4で、本発明の特徴である従局通信要求自己診断
処理を実行するか否かを従局要求フラグの状態でチェッ
クする。ここでは、主局内での通信要求フラグのみがセ
ットされていると判断される場合であるので、従局要求
フラグはリセットと判断されて、ステップS112へ進
み、本シリアル通信処理を終了する。
If there is an abnormality in the normal communication processing, the process proceeds from step S110 to step S111 to operate in the same manner as in the conventional example. On the other hand, if there is no abnormality in the normal communication processing, in step S4 in FIG. It is checked in the state of the slave request flag whether or not to execute the slave communication request self-diagnosis processing. Here, since it is determined that only the communication request flag in the master station is set, the slave request flag is determined to be reset, the process proceeds to step S112, and the present serial communication process ends.

【0151】次に、本発明の特徴である従局通信要求自
己診断処理について説明する。
Next, the slave station communication request self-diagnosis processing which is a feature of the present invention will be described.

【0152】主局内での通信要求の有無に拘らず、従局
からの通信要求信号がオンと判断されるときは、ステッ
プS107からステップS1に移って、本実施の形態の
シリアル通信装置が適用される電子機器(たとえば電子
写真機器装置)の動作状態を検出する。この機器装置の
動作状態検出は、前述したように、機器制御は各種タス
クで並列処理されているものであって、各タスク間の情
報交換は特に図示していないが、予めCPUに割り振ら
れた、前記図10に示したような各タスク毎が有するメ
モリに最新状態が更新されている。したがって、タスク
を越えて、別タスクが必要とする該当するメモリ内容
は、タスク外からもメモリアドレスを指定してチェック
できるように構成されている。これにより、機器装置の
動作状態検出は、予め割り振られたメモリ内容を指定し
て検出でき、ステップS1では、装置全体の動作状態が
スタンバイ状態か否かをチェックしている。
If it is determined that the communication request signal from the slave station is on regardless of the presence or absence of a communication request in the master station, the process moves from step S107 to step S1 and the serial communication device of the present embodiment is applied. Operating state of an electronic device (for example, an electrophotographic device). As described above, in the operation state detection of the device, the device control is performed in parallel with various tasks, and information exchange between the tasks is not particularly illustrated, but is assigned to the CPU in advance. The latest state is updated in the memory of each task as shown in FIG. Therefore, the contents of the relevant memory required by another task beyond the task can be checked by specifying the memory address from outside the task. As a result, the operation state of the device can be detected by designating the memory contents allocated in advance, and in step S1, it is checked whether the operation state of the entire apparatus is a standby state.

【0153】仮に、プリント中であれば、従局からのセ
ンサ等の伝達遅延を防止するために、従局通信要求自己
診断処理を行わず、主局内での通信要求発生と同様に、
何もせずにステップS1からステップS108に進ん
で、通常通信処理を実行する一方、ステップS1で、ス
タンバイ中と判断すれば、従局からのセンサ等の伝達遅
延を防止する必要がないために、ステップS2に進ん
で、従局通信要求自己診断処理の実行を指示する。
If printing is being performed, the slave station does not perform communication request self-diagnosis processing to prevent transmission delay of sensors and the like from the slave station.
Proceeding from step S1 to step S108 without performing anything, the normal communication processing is executed. On the other hand, if it is determined in step S1 that the apparatus is in the standby state, it is not necessary to prevent the transmission delay of the sensor and the like from the slave station. Proceeding to S2, an instruction is issued to execute a slave station communication request self-diagnosis process.

【0154】すなわち、ステップS2では、通常通信前
後の従局からの返送情報内容の変化状態のチェックを指
示する従局要求フラグをセットし、ステップS3では、
前回のシリアル通信によって記憶保持された従局からの
返送情報内容を別のメモリ領域に一時退避させる。具体
的には、図3に示す再設定された従局並列入力情報と称
されたメモリの上位4ビット部分(図中、“Zn”で示
す)を、本実施の形態では、前回実行した従局からの返
送情報内容を一時退避させるメモリ領域としている。つ
まり、従来例で述べたように、シリアル通信により受信
した従局からの返送情報内容は、従局並列入力情報と称
されるメモリの下位4ビット部分に格納し、本実施の形
態の従局通信要求自己診断処理を実行する際は、利用さ
れていない、従局並列入力情報での上位4ビット部分を
一時退避用の入力情報メモリとして利用する。
That is, in step S2, a slave request flag for instructing to check a change state of the content of the return information from the slave before and after the normal communication is set, and in step S3,
The content of the return information from the slave station stored and held by the previous serial communication is temporarily saved in another memory area. Specifically, in the present embodiment, the upper 4 bits (indicated by “Zn” in the figure) of the memory called the reset slave parallel input information shown in FIG. Is a memory area for temporarily saving the return information content. In other words, as described in the conventional example, the content of the return information received from the slave station through the serial communication is stored in the lower 4 bits of the memory called the slave parallel input information, and the slave communication request information of the present embodiment is stored. When executing the diagnostic process, the upper 4 bits of the unused parallel input information of the slave station that are not used are used as input information memory for temporary saving.

【0155】ステップS3で、シリアル通信前の従局か
らの返送情報内容を従局並列入力情報での上位4ビット
部分に退避させると、ステップS108で、従来例と同
様に、通常通信処理を行ない、ステップS109で、通
信異常がなければ、ステップS4に移る。仮に、ステッ
プS109で通信異常があると判断したときには、本実
施の形態で言う情報交換内容の有効、無効に拘らず、ス
テップS110およびS111によりリトライ通信を実
行するために、従局通信要求自己診断処理は中断され
る。一方、ステップS109で通信異常がなければ、ス
テップS3に移り、従局要求フラグをチェックする。
In step S3, the contents of the return information from the slave station before serial communication are saved in the upper 4 bits of the slave station parallel input information. In step S108, the normal communication processing is performed as in the conventional example. If there is no communication error in S109, the process proceeds to step S4. If it is determined in step S109 that there is a communication error, regardless of the validity or invalidity of the information exchange content referred to in the present embodiment, a slave station communication request self-diagnosis process is performed to execute retry communication in steps S110 and S111. Is suspended. On the other hand, if there is no communication error in step S109, the process proceeds to step S3, and the slave request flag is checked.

【0156】前述したステップS107およびステップ
S1を経由した場合のみが、従局要求フラグがセット状
態となっており、この場合にステップS5以降に進む。
つまり、装置全体の動作がスタンバイ中のみ、ステップ
S5以降の従局通信要求自己診断処理を実行することに
なる。したがって、たとえ、従局からの通信要求信号に
よる通信実行であっても、この従局要求フラグがセット
されなければ、従来例で述べたように、通常通信処理で
一回の通信動作は終了する。
The slave station request flag is in the set state only when passing through the above-described steps S107 and S1, and in this case, the process proceeds to step S5 and thereafter.
That is, the slave station communication request self-diagnosis processing after step S5 is executed only when the operation of the entire apparatus is in the standby state. Therefore, even if the communication is performed by the communication request signal from the slave station, if the slave request flag is not set, one communication operation ends in the normal communication processing as described in the conventional example.

【0157】ステップS4では、ステップS2の処理で
従局要求フラグがセットされていると判断すると、ステ
ップS5に移って従局要求フラグをリセットし、ステッ
プS6で、一時退避した通常通信前の従局からの返送情
報を格納した上位4ビット部分の内容と、通常通信後の
従局からの返送情報を更新した下位4ビット部分の内容
とをビット毎に対応させて比較する。
In step S4, if it is determined in step S2 that the slave request flag has been set, the flow advances to step S5 to reset the slave request flag. In step S6, the temporarily saved slave from the slave before the normal communication is reset. The contents of the upper 4 bits storing the return information and the contents of the lower 4 bits of the updated return information from the slave station after the normal communication are compared for each bit.

【0158】そして、ステップS7で、全ビット毎の比
較の結果、全ての情報内容が一致したか否かを判断す
る。その結果、不一致であるビットが一つ以上あれば、
実行した通常通信処理による情報交換は成立したと判定
されて、ステップS8に移り、従局要求異常カウンタを
クリアして、ステップS112へ移る。つまり、従局か
らの情報内容が更新されることにより、従局通信要求が
発生して実行した通常通信であるが故に更新情報内容が
一つ以上変化したということで、従局からの通信要求信
号に矛盾がないと判定できるのであり、無事、通信前後
の従局からの情報内容の比較結果が不一致と判断されれ
ば、従局からの最新情報に更新されて一回の通信動作が
終了する。
Then, in step S7, it is determined whether or not all the information contents match as a result of the comparison for every bit. As a result, if there is one or more bits that do not match,
It is determined that the information exchange by the executed normal communication process has been established, and the process proceeds to step S8, where the slave station request abnormality counter is cleared, and the process proceeds to step S112. In other words, when the information content from the slave station is updated, the content of the update information changes by one or more because the normal communication was performed by generating and executing a slave station communication request. Therefore, if it is determined that there is no match between the information contents from the slave station before and after the communication, it is updated to the latest information from the slave station, and one communication operation ends.

【0159】一方、ステップS7で、全ビット毎の比較
の結果、全ての情報内容が一致したと判断されると、実
行した通常通信処理による情報内容は不成立であったと
判定される。つまり、同様に、従局通信要求が発生して
実行した通常通信であるにも拘らず、更新された情報内
容が一つもないと判断されたことになり、従局からの通
信要求信号の発生に矛盾があると考えられるからであ
る。
On the other hand, if it is determined in step S7 that all the information contents match as a result of the comparison for every bit, it is determined that the information content by the executed normal communication processing has not been established. That is, similarly, it is determined that there is no updated information content in spite of the normal communication executed by generating the slave station communication request, and the generation of the communication request signal from the slave station is inconsistent. It is thought that there is.

【0160】このように、通信前後の従局からの情報内
容の比較結果が一致していると判断されると、従局から
の通信要求信号か、シフト転送にノイズ等が入り込み、
たまたま各種エラー検出処理でエラー検出されずに情報
交換が終了したと推察できるからである。いずれにせ
よ、実行した通常通信による情報交換は不成立と判定し
て無効にすることで、主局に設定される従局情報内容を
前回の状態に戻して、それ以降の通信動作を引き続き継
続できるようにする。
As described above, when it is determined that the comparison results of the information contents from the slave station before and after the communication match, noise or the like enters the communication request signal from the slave station or the shift transfer, and
This is because it can be inferred that the information exchange has been completed without any error being detected by the various error detection processes. In any case, the information exchange by the executed normal communication is determined to be unsuccessful and invalidated, so that the content of the slave station information set in the master station can be returned to the previous state, and the subsequent communication operation can be continued. To

【0161】通信動作を引き続き継続できるようにする
ために、ステップS9で、今回実行した通常通信の実行
前の状態に戻す。つまり、一時退避した従局情報内容で
ある従局並列入力情報の上位4ビット部分を従局並列入
力情報の下位4ビット部分に転送する。
In order to continue the communication operation, in step S9, the state is returned to the state before the execution of the normal communication executed this time. That is, the upper 4-bit portion of the slave parallel input information, which is the temporarily saved slave information content, is transferred to the lower 4-bit portion of the slave parallel input information.

【0162】さらに、ステップS10で、従局要求異常
カウンタをインクリメントしてステップS11に移り、
上記従局通信要求での矛盾が所定の設定回数以上、連続
して発生したかを従局異常カウンタの値で判断する。そ
の結果、所定値以内であれば、実行した通常通信の結果
を単に無効にする動作だけでステップS112に移り、
今回の通常通信を終了する。一方、ステップS11で、
結果が所定値以上であれば、ステップS12で、一挙に
リトライカウンタ値を所定値以上にセットした後に、一
旦本シリアル通信処理を終了する。
Further, at step S10, the slave station request abnormality counter is incremented, and the routine goes to step S11.
Whether the contradiction in the slave station communication request has occurred continuously for a predetermined number of times or more is determined by the value of the slave station abnormality counter. As a result, if within the predetermined value, the operation proceeds to step S112 only by simply invalidating the result of the executed normal communication,
This normal communication ends. On the other hand, in step S11,
If the result is equal to or more than the predetermined value, the serial communication process is temporarily terminated after setting the retry counter value to a predetermined value or more at once in step S12.

【0163】そして、次にシリアル通信処理が起動され
ると、ステップS101の判断より、通信故障処理に移
り、従来例で述べたように、以降のシリアル通信は停止
されて、機器装置故障の通信故障としてサービスマンコ
ールされる。
Next, when the serial communication process is started, the process proceeds to the communication failure process from the judgment in step S101, and as described in the conventional example, the subsequent serial communication is stopped and the communication for the device failure is performed. The serviceman is called as a failure.

【0164】なお、本実施の形態では、従局通信要求自
己診断処理で情報交換が不成立となった場合には、主局
側が有する従局情報内容を元の状態に戻すようにしてい
るが、従局側の対処については、たとえば、ソフトリセ
ットにより従局並列出力状態を一旦初期化して通常通信
を続行してもよく、特に限定されるものではない。
In this embodiment, if the information exchange is not established in the slave station communication request self-diagnosis processing, the slave station information content of the master station is returned to the original state. For example, the parallel output state of the slave station may be temporarily initialized by soft reset to continue normal communication, and the present invention is not particularly limited.

【0165】このように、本実施の形態では、シリアル
通信装置が適用される電子機器の動作が、たとえばプリ
ント中、すなわち通常通信の頻度が多いとされる動作中
のときには、従局通信要求自己診断処理を行わずに通常
通信に専念する一方、電子機器の動作が、たとえばスタ
ンバイ中、すなわち通常通信の頻度が少ないとされる動
作中のときには(このときにのみ)、従局通信要求自己
診断処理を行うようにしたので、通信に費やされる時間
を必要最小限に抑えて、従局からの情報遅延を防止しな
がら、双方向シリアル通信を維持するための重要な信号
源である従局通信要求信号の自己診断を行うことで、シ
リアル通信の信頼をより向上させることができる。ま
た、本実施の形態では、従局通信要求自己診断処理は、
メモリ中の未使用領域を使うとともに、従来のシリアル
通信処理に少量の処理を追加するだけで実現されている
ので、製造コストの上昇を抑制しつつ自己診断を行うこ
とができる。
As described above, in the present embodiment, when the operation of the electronic device to which the serial communication device is applied is, for example, during printing, that is, during the operation in which normal communication is frequently performed, the slave station communication request self-diagnosis is performed. On the other hand, when the operation of the electronic device is, for example, in a standby state, that is, during an operation in which the frequency of the normal communication is considered to be low (only at this time), the slave communication request self-diagnosis processing is performed. The time required for communication is kept to a minimum and the delay of information from the slave is prevented, while the self-request of the slave communication request signal, which is an important signal source for maintaining bidirectional serial communication, is performed. By performing the diagnosis, the reliability of serial communication can be further improved. Further, in the present embodiment, the slave station communication request self-diagnosis processing
Since this is realized by using an unused area in the memory and adding a small amount of processing to the conventional serial communication processing, self-diagnosis can be performed while suppressing an increase in manufacturing cost.

【0166】次に、本発明の第2の実施の形態に係るシ
リアル通信装置を説明する。
Next, a serial communication device according to a second embodiment of the present invention will be described.

【0167】本実施の形態のシリアル通信装置は、上記
第1の実施の形態のシリアル通信装置と同様に、機器装
置がスタンバイ中に受信した従局からの通信要求信号の
有無に基づいて、通常通信前後の従局情報内容の変化状
態を判断し、矛盾が生じているか否かにより情報交換の
不成立を判定するように構成されているが、本実施の形
態のシリアル通信装置は、上記第1の実施の形態のシリ
アル通信装置に対して、情報交換の不成立を判定した後
の処理が異なっている。
The serial communication device according to the present embodiment, like the serial communication device according to the first embodiment, performs normal communication based on the presence or absence of a communication request signal from a slave station received by a device during standby. The serial communication device according to the present embodiment is configured so as to determine the change state of the slave station information contents before and after and determine whether information exchange is unsuccessful based on whether or not an inconsistency has occurred. The processing after determining that the information exchange has failed is different from the serial communication device according to the first embodiment.

【0168】具体的には、通常通信による情報交換が不
成立と判定して、従局からの情報内容を前回の通信によ
る情報内容に戻した後に、伝送路中に存在する、予め構
成されている特定従局の並列入力端子のうち、少なくと
も一つの並列入力端子を操作して、その従局に対して通
信要求信号を発生させるように制御することにより、上
記第1の実施の形態で説明した従局通信要求自己診断処
理が終了すると即座に、再び同様な従局通信要求自己診
断処理を繰り返し実行するようにした点が異なってい
る。
Specifically, it is determined that the information exchange by the normal communication is not established, and the information content from the slave station is returned to the information content by the previous communication. By controlling at least one of the parallel input terminals of the slave stations to generate a communication request signal for the slave station, the slave communication request described in the first embodiment can be controlled. The difference is that the same slave station communication request self-diagnosis processing is repeatedly executed immediately after the self-diagnosis processing ends.

【0169】したがって、本実施の形態では、ハードウ
ェアとして、前記従来例で用いた図9のハードウェアを
改良した図4のハードウェアを用い、シリアル通信処理
として、上記第1の実施の形態で用いた図1および図2
のシリアル通信処理を改良した図5および図6のシリア
ル通信処理を用いている。
Accordingly, in the present embodiment, the hardware of FIG. 4 which is an improvement of the hardware of FIG. 9 used in the conventional example is used as the hardware, and the serial communication processing in the first embodiment is used as the serial communication processing. Figures 1 and 2 used
The serial communication processing of FIGS. 5 and 6 which is an improvement of the serial communication processing of FIG.

【0170】図4において、従来例(図9)と比較して
異なる点は、主局mから要求操作と呼ぶ出力信号が、従
局s12の並列入力端子(の1ビット)に供給されてい
る点である。なお、この要求操作信号が供給される並列
入力端子を有する従局は、特に従局s12に限定される
必要はなく、伝送路中に存在する従局のうち一つ以上の
従局の一端子以上に接続されていればよい。
FIG. 4 is different from the conventional example (FIG. 9) in that an output signal called request operation is supplied from master station m to (one bit of) the parallel input terminal of slave station s12. It is. The slave having the parallel input terminal to which the request operation signal is supplied need not be particularly limited to the slave s12, and is connected to one or more terminals of one or more slaves among the slaves existing in the transmission path. It should just be.

【0171】従局からの通信要求信号は、従来例で述べ
たように、図8のEXOR回路A3が常に監視するビッ
ト毎の比較回路により、一つの通信後に状態変化がある
と位相制御カウンタ回路11とデコード回路B12で構
成される回路が発生する位相タイミングで、主局に返送
する通信要求信号を発生させる。
The communication request signal from the slave station is transmitted to the phase control counter circuit 11 by the bit-by-bit comparison circuit constantly monitored by the EXOR circuit A3 shown in FIG. And a communication request signal to be returned to the master station at a phase timing generated by the circuit composed of the decoding circuit B12 and the decoding circuit B12.

【0172】このように、主局が直接操作できる従局の
並列入力端子を伝送路中に存在する任意の従局との間に
接続するという極めて簡単な構成により、主局は、自己
の制御都合によって従局からの通信要求信号を操作する
ことができるようになる。以下、この主局が行う従局に
対する通信要求信号の操作を、「従局通信要求遠隔操
作」という。したがって、この従局通信要求遠隔操作を
行うことで容易に、従局通信要求自己診断を再度繰り返
し実行させることができる。
As described above, with the extremely simple configuration of connecting the parallel input terminal of the slave station which can be directly operated by the master station to any slave station existing on the transmission line, the master station can control the master station under its own control. The communication request signal from the slave station can be operated. Hereinafter, the operation of the communication request signal for the slave station performed by the master station is referred to as “slave station communication request remote operation”. Therefore, by performing the slave station communication request remote operation, the slave station communication request self-diagnosis can be easily executed again.

【0173】以下、図5および図6を用いて、本実施の
形態のシリアル通信装置、特に主局mのCPUが実行す
る制御処理の一部であるシリアル通信処理を説明する。
なお、図5のフローチャートは、前記図1のフローチャ
ートと同一であるため、その説明を省略する。
Hereinafter, the serial communication processing which is a part of the control processing executed by the CPU of the master station m will be described with reference to FIG. 5 and FIG.
Note that the flowchart of FIG. 5 is the same as the flowchart of FIG. 1, and a description thereof will be omitted.

【0174】図6において、ステップS9で、メモリに
格納する情報内容を戻すと、ステップS10で、従局要
求異常カウンタをインクリメントしてステップS11に
移る。
In FIG. 6, when the information stored in the memory is returned in step S9, the slave station request abnormality counter is incremented in step S10, and the routine goes to step S11.

【0175】そして、ステップS11で、前記第1の実
施の形態で説明したように、従局通信要求での矛盾が所
定の設定回数以上連続して発生したか否かを従局異常カ
ウンタの値で判断し、その結果が所定値以上であれば、
ステップS12で、一挙にリトライカウンタ値を所定値
以上にセットして、一旦本シリアル通信処理を終了した
後、次のシリアル通信処理が起動され、図5のステップ
S101の判断により、通信故障処理に移り、従来例で
述べたように、以降のシリアル通信は停止されて、機器
装置故障の通信故障としてサービスマンコールされる。
Then, in step S11, as described in the first embodiment, it is determined whether or not inconsistency in the slave station communication request has occurred continuously for a predetermined number of times or more, based on the value of the slave station abnormality counter. If the result is equal to or greater than a predetermined value,
In step S12, the retry counter value is set to a predetermined value or more at once, and after the present serial communication process is once completed, the next serial communication process is started. According to the determination in step S101 in FIG. Then, as described in the conventional example, the subsequent serial communication is stopped and a serviceman call is made as a communication failure due to a failure of the device.

【0176】一方、ステップS11で、所定値以内であ
れば、ステップS21に移り、要求操作出力信号の状態
を変化させる(すなわち、上記従局通信要求遠隔操作を
行う)。そして、一旦本シリアル通信処理を終了する。
On the other hand, if it is determined in step S11 that the value is within the predetermined value, the flow shifts to step S21 to change the state of the requested operation output signal (that is, the slave station communication request remote operation is performed). Then, the serial communication process is temporarily ended.

【0177】ステップS21での従局通信要求遠隔操作
処理は、基本的には要求操作出力信号の状態を変化させ
るだけでよく、その処理により次のシリアル通信処理が
実行されると再び、図5のステップS107で、従局か
らの通信要求信号を受信し、ステップS1で、スタンバ
イ中と判断され、従局通信要求自己診断処理が再び繰り
返し実行される。その結果、情報交換実行が成立するま
で、または、通信故障と判断されるまで、従局通信要求
自己診断処理が繰り返し実行される。
The slave station communication request remote operation processing in step S21 basically only needs to change the state of the request operation output signal, and when the next serial communication processing is executed by that processing, the operation returns to the state shown in FIG. In step S107, a communication request signal from the slave station is received. In step S1, it is determined that the apparatus is on standby, and the slave station communication request self-diagnosis processing is repeatedly executed again. As a result, the slave station communication request self-diagnosis processing is repeatedly executed until the information exchange execution is established or the communication failure is determined.

【0178】なお、ステップS21での従局通信要求遠
隔操作処理は、単に要求操作出力信号の状態を変化させ
るだけでなく、たとえば、CPU自体が有するタイマを
利用して、所定時間周期で要求操作出力信号の状態を変
化させるようにすることで、情報交換実行が成立するま
で、または、通信故障と判断されるまで、周期的に繰り
返し従局通信要求自己診断処理を実行させるようにして
もよい。
Note that the slave station communication request remote operation process in step S21 does not merely change the state of the request operation output signal, but also uses the timer of the CPU itself to output the request operation output signal at a predetermined time period. By changing the state of the signal, the slave station communication request self-diagnosis processing may be periodically and repeatedly executed until the information exchange execution is established or until it is determined that a communication failure has occurred.

【0179】また、シリアル通信以外の通信形態でも、
基本的に、各従局からの通信要求に従った通信形態であ
れば、その通信要求の有無に応じて、通信の実行毎に通
信前後の従局からの返送情報内容の変化状態を判断する
ことで、矛盾が生じたか否かを判定でき、通信要求の自
己診断を通信しながら、且つ、容易に実行できる。
In communication modes other than serial communication,
Basically, if the communication mode is in accordance with the communication request from each slave station, it is possible to determine the change state of the return information content from the slave station before and after the communication before and after each communication, depending on the presence or absence of the communication request. It is possible to determine whether or not a contradiction has occurred, and to easily execute the self-diagnosis of the communication request while communicating.

【0180】このように、本実施の形態では、従局通信
要求自己診断処理により、通常通信による情報交換が不
成立と判定された場合には、従局通信要求遠隔操作がな
されて、通常通信による情報交換が成立するまで、また
は、通信故障と判断されるまで、従局通信要求自己診断
処理が繰り返し実行されるので、一回通常通信による情
報交換が不成立と判定されたときでも、それが装置故障
によるものであるか、偶発的に生じたものであるかを、
集中的に短時間で自己診断することができる。
As described above, in the present embodiment, when it is determined by the slave communication request self-diagnosis processing that the information exchange by the normal communication is not established, the slave communication request remote operation is performed and the information exchange by the normal communication is performed. The self-diagnosis process of the slave station communication request is repeated until the communication is established or until the communication failure is determined. Or accidentally,
Self-diagnosis can be performed intensively in a short time.

【0181】なお、上述した各実施の形態の機能を実現
するソフトウェアのプログラムコードを記録した記憶媒
体を、システムまたは装置に供給し、そのシステムまた
は装置のコンピュータ(またはCPUやMPU)が記憶
媒体に格納されたプログラムコードを読出し実行するこ
とによっても、本発明の目的が達成されることは言うま
でもない。
A storage medium storing software program codes for realizing the functions of the above-described embodiments is supplied to a system or an apparatus, and the computer (or CPU or MPU) of the system or apparatus stores the storage medium in the storage medium. It goes without saying that the object of the present invention is also achieved by reading and executing the stored program code.

【0182】この場合、記憶媒体から読出されたプログ
ラムコード自体が本発明の新規な機能を実現することに
なり、そのプログラムコードを記憶した記憶媒体は本発
明を構成することになる。
In this case, the program code itself read from the storage medium realizes the novel function of the present invention, and the storage medium storing the program code constitutes the present invention.

【0183】プログラムコードを供給するための記憶媒
体としては、たとえば、フロッピーディスク、ハードデ
ィスク、光ディスク、光磁気ディスク、CD−ROM、
CD−R、磁気テープ、不揮発性のメモリカード、RO
M6などを用いることができる。また、通信ネットワー
クを介してサーバコンピュータからプログラムコードが
供給されるようにしてもよい。
As a storage medium for supplying the program code, for example, a floppy disk, hard disk, optical disk, magneto-optical disk, CD-ROM,
CD-R, magnetic tape, nonvolatile memory card, RO
M6 or the like can be used. Further, the program code may be supplied from a server computer via a communication network.

【0184】また、コンピュータが読出したプログラム
コードを実行することにより、上述した各実施の形態の
機能が実現されるだけでなく、そのプログラムコードの
指示に基づき、コンピュータ上で稼働しているOSなど
が実際の処理の一部または全部を行い、その処理によっ
て上述した実施の形態の機能が実現される場合も含まれ
ることは言うまでもない。
When the computer executes the readout program code, not only the functions of the above-described embodiments are realized, but also an OS or the like running on the computer based on the instructions of the program code. Does a part or all of the actual processing, and the processing realizes the functions of the above-described embodiments.

【0185】さらに、記憶媒体から読出されたプログラ
ムコードが、コンピュータに挿入された機能拡張ボード
やコンピュータに接続された機能拡張ユニットに備わる
メモリに書込まれた後、そのプログラムコードの指示に
基づき、その機能拡張ボードや機能拡張ユニットに備わ
るCPUなどが実際の処理の一部または全部を行い、そ
の処理によって上述した各実施の形態の機能が実現され
る場合も含まれることは言うまでもない。
Further, after the program code read from the storage medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, based on the instructions of the program code, It goes without saying that the CPU included in the function expansion board or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.

【0186】[0186]

【発明の効果】以上説明したように、請求項1,6また
は11に記載の発明によれば、機器装置が、たとえば通
信頻度が多いとされる動作状態のときには、正常なシリ
アル通信が行われているか否かの自己診断は行わずに、
本来のシリアル通信のみに専念させることで、通信に費
やされる時間を必要最小限に抑えて、従局からの情報伝
達遅延を防止する一方、機器装置が、たとえば通信頻度
が少ないとされる動作状態(特定の動作状態)のときに
は、正常なシリアル通信が行われているか否かの自己診
断を行い、本来のシリアル通信に加えて、双方向シリア
ル通信を維持するための重要な信号源である従局通信要
求信号の自己診断を行うことで、従局からの情報遅延を
抑えながら、シリアル通信の信頼をより向上させること
ができる。さらに、第2の記憶手段を第1の記憶手段の
使用されていない領域にとるようにすれば、自己診断に
伴う製造コストの上昇を抑制することができる。
As described above, according to the first, sixth, or eleventh aspect of the present invention, normal serial communication is performed when the apparatus is in an operating state in which the communication frequency is high, for example. Without self-diagnosis of whether
By concentrating only on the original serial communication, the time spent for communication is kept to a minimum and the information transmission delay from the slave station is prevented. In a specific operating state, self-diagnosis is performed to determine whether or not normal serial communication is being performed. In addition to the original serial communication, slave communication is an important signal source for maintaining bidirectional serial communication. By performing the self-diagnosis of the request signal, the reliability of the serial communication can be further improved while suppressing the information delay from the slave station. Further, if the second storage means is set in an area where the first storage means is not used, it is possible to suppress an increase in manufacturing cost due to the self-diagnosis.

【0187】また、請求項4,9または14に記載の発
明によれば、正常でないシリアル通信がなされていると
自己診断されたときには、遠隔操作により、当該従局が
前記主局に送るべき信号の少なくとも1ビット以上を操
作することで、前記自己診断が繰り返しなされるので、
正常でないシリアル通信がなされていると自己診断され
たときでも、それが装置故障によるものであるか、偶発
的に生じたものであるかを、集中的に短時間で自己診断
することができる。
According to the present invention, when a self-diagnosis is made that abnormal serial communication is being performed, a signal transmitted from the slave station to the master station by remote operation is determined by remote control. By operating at least one bit or more, the self-diagnosis is repeatedly performed.
Even when a self-diagnosis is made that abnormal serial communication is being performed, it is possible to perform a self-diagnosis intensively in a short time whether the self-diagnosis is caused by a device failure or an accidental occurrence.

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

【図1】本発明の第1の実施の形態に係るシリアル通信
装置が実行するシリアル通信処理の手順を示すフローチ
ャートである。
FIG. 1 is a flowchart illustrating a procedure of a serial communication process executed by a serial communication device according to a first embodiment of the present invention.

【図2】図1のシリアル通信処理の続きを示すフローチ
ャートである。
FIG. 2 is a flowchart showing a continuation of the serial communication process of FIG. 1;

【図3】図10のメモリマップを従局通信要求自己診断
処理で使用した後のメモリマップを示す図である。
FIG. 3 is a diagram showing a memory map after the memory map of FIG. 10 is used in a slave station communication request self-diagnosis process.

【図4】本発明の第2の実施の形態に係るシリアル通信
装置を適用した電子機器の概略構成を示すブロック図で
ある。
FIG. 4 is a block diagram illustrating a schematic configuration of an electronic apparatus to which a serial communication device according to a second embodiment of the present invention is applied.

【図5】図4のシリアル通信装置が実行するシリアル通
信処理の手順を示すフローチャートである。
FIG. 5 is a flowchart illustrating a procedure of a serial communication process executed by the serial communication device of FIG. 4;

【図6】図5のシリアル通信処理の続きを示すフローチ
ャートである。
FIG. 6 is a flowchart showing a continuation of the serial communication process of FIG. 5;

【図7】従来のシリアル通信装置を適用した電子機器の
概略構成を示すブロック図である。
FIG. 7 is a block diagram illustrating a schematic configuration of an electronic apparatus to which a conventional serial communication device is applied.

【図8】図7のいずれかの従局の詳細な構成を示すブロ
ック図である。
FIG. 8 is a block diagram showing a detailed configuration of one of the slave stations in FIG. 7;

【図9】図7の電子機器からオプションとして設置され
る従局をいくつか省略して構成した電子機器の一例を示
すブロック図である。
FIG. 9 is a block diagram illustrating an example of an electronic device configured by omitting some slave stations installed as options from the electronic device of FIG. 7;

【図10】図7のシリアル通信装置が情報交換を実施す
る際に利用するメモリマップの一例を示す図である。
FIG. 10 is a diagram showing an example of a memory map used when the serial communication device in FIG. 7 performs information exchange.

【図11】図10のメモリマップを初期化通信によって
再設定した後のメモリマップを示す図である。
FIG. 11 is a diagram showing a memory map after the memory map of FIG. 10 is reset by initialization communication.

【図12】図7のシリアル通信装置が実行するシリアル
通信処理の手順を示すフローチャートである。
FIG. 12 is a flowchart illustrating a procedure of a serial communication process executed by the serial communication device of FIG. 7;

【図13】図12中の初期化通信処理の詳細な手順を示
すフローチャートである。
13 is a flowchart showing a detailed procedure of an initialization communication process in FIG.

【図14】図12中の通常通信処理の詳細な手順を示す
フローチャートである。
14 is a flowchart showing a detailed procedure of a normal communication process in FIG.

【図15】図14の通常通信処理の続きを示すフローチ
ャートである。
FIG. 15 is a flowchart showing a continuation of the normal communication process of FIG. 14;

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

1 入力セレクタ回路 2 入力ラッチ回路 3 EXOR回路A 4 シフトレジスタ回路 5 二度読みラッチ回路 6 EXOR回路B 7 出力ラッチ回路 8 ゲート回路 9 デコード回路A 10 クロック数カウンタ回路 11 位相制御カウンタ回路 12 デコード回路B m 主局 s1〜s12 従局 Reference Signs List 1 input selector circuit 2 input latch circuit 3 EXOR circuit A 4 shift register circuit 5 double read latch circuit 6 EXOR circuit B 7 output latch circuit 8 gate circuit 9 decode circuit A 10 clock number counter circuit 11 phase control counter circuit 12 decode circuit B m master station s1 to s12 slave station

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5B021 AA01 AA30 BB10 CC06 NN17 5B045 BB31 BB43 JJ02 JJ14 5B077 NN02 5K031 AA06 AA08 BA01 CA03 CB06 DA01 DA15 EA04 5K035 AA03 AA05 BB02 CC01 CC10 DD01 EE02 FF01 FF04 GG00 HH04  ──────────────────────────────────────────────────続 き Continued on the front page F-term (reference)

Claims (15)

【特許請求の範囲】[Claims] 【請求項1】 一つの主局および複数の従局をループ状
に接続する伝送路を備え、前記主局は、該主局内部で発
生する通信要求または前記各従局が発生する通信要求信
号に応じて当該従局と、前記伝送路を介したシリアル通
信を行うシリアル通信装置において、 前記各従局は、前記主局に送るべき信号が変化したとき
に、前記通信要求信号を発生し、前記主局は、 前記発生された通信要求信号に応じて当該従局から受信
した情報内容を保持する第1の記憶手段と、 該第1の記憶手段に新たな情報内容を保持するときに、
その直前に保持されている情報内容を待避する第2の記
憶手段と、 前記第1および第2の記憶手段にそれぞれ記憶された情
報内容を比較することにより、正常なシリアル通信がな
されているか否かを自己診断する自己診断手段とを有
し、 前記自己診断手段は、当該シリアル通信装置が所定の動
作状態のときにのみ、その自己診断を実行することを特
徴とするシリアル通信装置。
1. A transmission line for connecting one master station and a plurality of slave stations in a loop, wherein the master station responds to a communication request generated inside the master station or a communication request signal generated by each of the slave stations. The slave station and the serial communication device that performs serial communication via the transmission path, wherein each of the slave stations generates the communication request signal when a signal to be sent to the master station changes, and the master station A first storage unit for storing information content received from the slave station in response to the generated communication request signal; and a first information storage unit for storing new information content in the first storage unit.
By comparing the information contents stored in the first and second storage means with the second storage means for evacuating the information content held immediately before, whether or not normal serial communication is performed A self-diagnosis unit for performing self-diagnosis of the serial communication device, wherein the self-diagnosis unit executes the self-diagnosis only when the serial communication device is in a predetermined operation state.
【請求項2】 前記自己診断手段は、前記第1および第
2の記憶手段にそれぞれ記憶された情報内容をビット毎
に全ビットについて比較し、前記記憶された両情報内容
が全ビットについて一致しているときには、正常でない
シリアル通信がなされていると自己診断し、前記記憶さ
れた両情報内容が1ビットでも不一致であるときには、
正常なシリアル通信がなされていると自己診断すること
を特徴とする請求項1に記載のシリアル通信装置。
2. The self-diagnosis means compares the information contents stored in the first and second storage means with respect to all bits on a bit-by-bit basis. Self-diagnosis that abnormal serial communication has been performed, and when the stored information contents do not match even one bit,
2. The serial communication device according to claim 1, wherein self-diagnosis is performed that normal serial communication is performed.
【請求項3】 前記自己診断手段は、正常でないシリア
ル通信がなされていると自己診断したときには、前記第
2の記憶手段に待避されている情報内容を前記第1の記
憶手段に戻すことを特徴とする請求項1または2のいず
れかに記載のシリアル通信装置。
3. The self-diagnosis means returns the information saved in the second storage means to the first storage means when the self-diagnosis means makes a self-diagnosis that abnormal serial communication is being performed. The serial communication device according to claim 1.
【請求項4】 前記主局は、 前記複数の従局のうち、予め設定された少なくとも1つ
以上の従局に対して、当該従局が前記主局に送るべき信
号の少なくとも1ビット以上を遠隔操作可能な遠隔操作
手段と、 前記自己診断手段により、正常でないシリアル通信がな
されていると自己診断されたときには、前記遠隔操作手
段により、当該従局が前記主局に送るべき信号の少なく
とも1ビット以上を操作することで、前記自己診断手段
に対して自己診断を繰り返し行わせるように制御する制
御手段とを有することを特徴とする請求項2または3の
いずれかに記載のシリアル通信装置。
4. The master station can remotely control at least one bit or more of a signal to be sent to the master station by at least one or more preset slave stations among the plurality of slave stations. When the self-diagnosis unit performs a self-diagnosis that abnormal serial communication has been performed, the remote operation unit operates at least one bit of a signal to be sent from the slave station to the master station. 4. The serial communication device according to claim 2, further comprising control means for controlling the self-diagnosis means to perform self-diagnosis repeatedly.
【請求項5】 前記自己診断の繰り返し実行により、所
定回数以上連続して正常でないシリアル通信がなされて
いると自己診断されたときには、当該シリアル通信装置
が通信故障であると判断する判断手段を有することを特
徴とする請求項4に記載のシリアル通信装置。
5. When the self-diagnosis is performed by performing the self-diagnosis repeatedly and abnormal serial communication is performed continuously for a predetermined number of times or more, the serial communication device includes a determination unit that determines that a communication failure has occurred. The serial communication device according to claim 4, wherein:
【請求項6】 一つの主局および複数の従局をループ状
に接続する伝送路を備え、前記主局は、該主局内部で発
生する通信要求または前記各従局が発生する通信要求信
号に応じて当該従局と、前記伝送路を介したシリアル通
信を行う電子機器のシリアル通信方法において、 前記各従局では、前記主局に送るべき信号が変化したと
きに、前記通信要求信号を発生し、 前記主局では、 前記発生された通信要求信号に応じて当該従局から受信
した情報内容を第1の記憶手段に保持し、 該第1の記憶手段に新たな情報内容を保持するときに、
その直前に保持されている情報内容を第2の記憶手段に
待避し、 当該シリアル通信装置が所定の動作状態のときにのみ、
前記第1および第2の記憶手段にそれぞれ記憶された情
報内容を比較することにより、正常なシリアル通信がな
されているか否かを自己診断することを特徴とするシリ
アル通信方法。
6. A transmission line for connecting one master station and a plurality of slave stations in a loop, wherein the master station responds to a communication request generated inside the master station or a communication request signal generated by each of the slave stations. The slave station and the serial communication method for an electronic device that performs serial communication via the transmission path, wherein each slave station generates the communication request signal when a signal to be sent to the master station changes. In the master station, the information content received from the slave station in response to the generated communication request signal is stored in the first storage means, and when the new information content is stored in the first storage means,
The information content held immediately before is saved in the second storage means, and only when the serial communication device is in a predetermined operation state,
A serial communication method, wherein self-diagnosis is performed as to whether or not normal serial communication is performed by comparing information contents stored in the first and second storage units.
【請求項7】 前記自己診断では、前記第1および第2
の記憶手段にそれぞれ記憶された情報内容をビット毎に
全ビットについて比較し、前記記憶された両情報内容が
全ビットについて一致しているときには、正常でないシ
リアル通信がなされていると自己診断し、前記記憶され
た両情報内容が1ビットでも不一致であるときには、正
常なシリアル通信がなされていると自己診断することを
特徴とする請求項6に記載のシリアル通信方法。
7. In the self-diagnosis, the first and second
The information contents respectively stored in the storage means are compared for all bits for each bit, and when the stored both information contents match for all bits, a self-diagnosis is made that abnormal serial communication is being performed, 7. The serial communication method according to claim 6, wherein when both of the stored information contents do not match even by one bit, a self-diagnosis is made that normal serial communication is performed.
【請求項8】 前記自己診断では、正常でないシリアル
通信がなされていると自己診断したときには、前記第2
の記憶手段に待避されている情報内容を前記第1の記憶
手段に戻すことを特徴とする請求項6または7のいずれ
かに記載のシリアル通信方法。
8. In the self-diagnosis, when a self-diagnosis that abnormal serial communication is being performed is made, the second self-diagnosis is performed.
8. The serial communication method according to claim 6, wherein the information content saved in said storage means is returned to said first storage means.
【請求項9】 前記主局では、 前記複数の従局のうち、予め設定された少なくとも1つ
以上の従局に対して、当該従局が前記主局に送るべき信
号の少なくとも1ビット以上を遠隔操作可能とし、 前記自己診断により、正常でないシリアル通信がなされ
ていると自己診断されたときには、前記遠隔操作によ
り、当該従局が前記主局に送るべき信号の少なくとも1
ビット以上を操作することで、前記自己診断を繰り返し
行わせることを特徴とする請求項7または8のいずれか
に記載のシリアル通信方法。
9. The master station can remotely control at least one bit or more of a signal to be sent to the master station from at least one or more preset slave stations among the plurality of slave stations. When the self-diagnosis determines that abnormal serial communication is being performed, at least one of the signals to be sent from the slave station to the master station by the remote operation is performed.
9. The serial communication method according to claim 7, wherein the self-diagnosis is repeatedly performed by operating more than one bit.
【請求項10】 前記自己診断の繰り返し実行により、
所定回数以上連続して正常でないシリアル通信がなされ
ていると自己診断されたときには、当該電子機器が通信
故障であると判断することを特徴とする請求項9に記載
のシリアル通信装置。
10. The repetitive execution of the self-diagnosis,
10. The serial communication device according to claim 9, wherein when a self-diagnosis is made that abnormal serial communication has been performed continuously for a predetermined number of times or more, the electronic device is determined to have a communication failure.
【請求項11】 一つの主局および複数の従局をループ
状に接続する伝送路を備え、前記主局は、該主局内部で
発生する通信要求または前記各従局が発生する通信要求
信号に応じて当該従局と、前記伝送路を介したシリアル
通信を行う電子機器のシリアル通信方法を含む、コンピ
ュータが実現できるプログラムを格納した記憶媒体であ
って、 前記シリアル通信方法は、 前記各従局では、前記主局に送るべき信号が変化したと
きに、前記通信要求信号を発生し、 前記主局では、 前記発生された通信要求信号に応じて当該従局から受信
した情報内容を第1の記憶手段に保持し、 該第1の記憶手段に新たな情報内容を保持するときに、
その直前に保持されている情報内容を第2の記憶手段に
待避し、 当該シリアル通信装置が所定の動作状態のときにのみ、
前記第1および第2の記憶手段にそれぞれ記憶された情
報内容を比較することにより、正常なシリアル通信がな
されているか否かを自己診断することを特徴とする記憶
媒体。
11. A transmission line for connecting one master station and a plurality of slave stations in a loop, wherein the master station responds to a communication request generated inside the master station or a communication request signal generated by each of the slave stations. And a slave medium, including a serial communication method of an electronic device that performs serial communication via the transmission path, a storage medium storing a computer-implementable program, wherein the serial communication method includes: The communication request signal is generated when the signal to be sent to the master station changes, and the master station stores the information content received from the slave station in the first storage means in response to the generated communication request signal. When storing new information content in the first storage means,
The information content held immediately before is saved in the second storage means, and only when the serial communication device is in a predetermined operation state,
A storage medium for performing self-diagnosis as to whether or not normal serial communication is performed by comparing information contents stored in the first and second storage means.
【請求項12】 前記自己診断では、前記第1および第
2の記憶手段にそれぞれ記憶された情報内容をビット毎
に全ビットについて比較し、前記記憶された両情報内容
が全ビットについて一致しているときには、正常でない
シリアル通信がなされていると自己診断し、前記記憶さ
れた両情報内容が1ビットでも不一致であるときには、
正常なシリアル通信がなされていると自己診断すること
を特徴とする請求項11に記載の記憶媒体。
12. In the self-diagnosis, information contents respectively stored in the first and second storage means are compared for all bits for each bit, and both stored information contents are matched for all bits. Self-diagnosis that abnormal serial communication has been performed, and when the stored information contents do not match even one bit,
12. The storage medium according to claim 11, wherein self-diagnosis is performed that normal serial communication is performed.
【請求項13】 前記自己診断では、正常でないシリア
ル通信がなされていると自己診断したときには、前記第
2の記憶手段に待避されている情報内容を前記第1の記
憶手段に戻すことを特徴とする請求項11または12の
いずれかに記載の記憶媒体。
13. In the self-diagnosis, when the self-diagnosis that an abnormal serial communication is performed is performed, information stored in the second storage unit is returned to the first storage unit. The storage medium according to claim 11, wherein
【請求項14】 前記主局では、 前記複数の従局のうち、予め設定された少なくとも1つ
以上の従局に対して、当該従局が前記主局に送るべき信
号の少なくとも1ビット以上を遠隔操作可能とし、 前記自己診断により、正常でないシリアル通信がなされ
ていると自己診断されたときには、前記遠隔操作によ
り、当該従局が前記主局に送るべき信号の少なくとも1
ビット以上を操作することで、前記自己診断を繰り返し
行わせることを特徴とする請求項12または13のいず
れかに記載の記憶媒体。
14. The master station can remotely control at least one bit or more of a signal to be sent to the master station from at least one or more preset slave stations among the plurality of slave stations. When the self-diagnosis determines that abnormal serial communication is being performed, at least one of the signals to be sent from the slave station to the master station by the remote operation is performed.
14. The storage medium according to claim 12, wherein the self-diagnosis is repeatedly performed by operating more than one bit.
【請求項15】 前記自己診断の繰り返し実行により、
所定回数以上連続して正常でないシリアル通信がなされ
ていると自己診断されたときには、当該電子機器が通信
故障であると判断することを特徴とする請求項14に記
載の記憶媒体。
15. By repeatedly executing the self-diagnosis,
15. The storage medium according to claim 14, wherein when the self-diagnosis is performed that serial communication that is not normal has been performed continuously for a predetermined number of times or more, the electronic device is determined to have a communication failure.
JP11184987A 1999-06-30 1999-06-30 Serial communication equipment, serial communication method and storage medium Withdrawn JP2001016297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11184987A JP2001016297A (en) 1999-06-30 1999-06-30 Serial communication equipment, serial communication method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11184987A JP2001016297A (en) 1999-06-30 1999-06-30 Serial communication equipment, serial communication method and storage medium

Publications (1)

Publication Number Publication Date
JP2001016297A true JP2001016297A (en) 2001-01-19

Family

ID=16162824

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11184987A Withdrawn JP2001016297A (en) 1999-06-30 1999-06-30 Serial communication equipment, serial communication method and storage medium

Country Status (1)

Country Link
JP (1) JP2001016297A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101057170B1 (en) 2009-06-05 2011-08-16 주식회사 에스원 Communication error detection method in serial communication system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101057170B1 (en) 2009-06-05 2011-08-16 주식회사 에스원 Communication error detection method in serial communication system

Similar Documents

Publication Publication Date Title
KR100239973B1 (en) Method of structuring messages for exchanging data and/or for synchronizing processes in a data processing system
US4809217A (en) Remote I/O port for transfer of I/O data in a programmable controller
EP0256463B1 (en) Improved token passing network
US4799052A (en) Method for communicating data on a communication network by token passing
US4586040A (en) Interruption handling system in time division multiplex remote control system
US4897834A (en) Bit oriented communications network
US5274637A (en) Token-ring-type local area network
EP0507381B1 (en) Method of processing control instruction
US4295122A (en) Bus priority control method in loop bus network system
JPS5947906B2 (en) loop transmission system
US20080101420A1 (en) Simultaneous serial transmission of messages with bit-arbitrated selection of the numerically largest or smallest value in the messages' data fields
CN104932997B (en) A kind of monobus communication means and system
US4034346A (en) Interface for establishing communications between a data-processing unit and a plurality of stations
CA1228168A (en) I/o scanner for an industrial control
JPH0210936A (en) Multistation communication bus system and station
US4181909A (en) Method and appratus for initializing remote data communication equipment
JP2001016297A (en) Serial communication equipment, serial communication method and storage medium
JPH0381862A (en) Equipment and method for communication of vehicle-mounted network
JP2001014287A (en) Serial communication device and serial communication method, and storage medium
JP2562703B2 (en) Data input controller for serial controller
JP2000293395A (en) Serial communication equipment, its abnormality detecting method and recording medium
JP6762546B1 (en) Serial communication method and serial communication system
JP2000183931A (en) Serial communication device and method therefor
JP2000276408A (en) Serial communication equipment, detection of abnormality for this equipment, and recording medium
JP2000200244A (en) Serial communication equipment, serial communication method, and storage medium

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20060302

A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20060905