JP2001014287A - Serial communication device and serial communication method, and storage medium - Google Patents

Serial communication device and serial communication method, and storage medium

Info

Publication number
JP2001014287A
JP2001014287A JP11184988A JP18498899A JP2001014287A JP 2001014287 A JP2001014287 A JP 2001014287A JP 11184988 A JP11184988 A JP 11184988A JP 18498899 A JP18498899 A JP 18498899A JP 2001014287 A JP2001014287 A JP 2001014287A
Authority
JP
Japan
Prior art keywords
slave
information
slave stations
station
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
JP11184988A
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 JP11184988A priority Critical patent/JP2001014287A/en
Publication of JP2001014287A publication Critical patent/JP2001014287A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Small-Scale Networks (AREA)
  • Communication Control (AREA)
  • Multi Processors (AREA)
  • Information Transfer Systems (AREA)

Abstract

PROBLEM TO BE SOLVED: To make normally performable the subsequent serial communications even when an option unit is removed from an electronic device without turning off the power supply of the electronic device main body. SOLUTION: The array order of slave station having the states '1' of bit 2 among the data on lower 4 bits stored in a memory is scanned and retrieved via the loops of steps S1-S4. When the first normal communication processing is not decided after the initialization communication processing, the retrieved array order of slave stations is compared with the array order of slave stations stored in the memory (S3→S5→S7). If the difference is recognized between both array orders, it is required to perform again the initialization communication processing (S8).

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】以下、この転送情報ビット数と識別子情報
ビット数を固定にしたままで、半無限の数の従局を接続
可能にするシリアル通信装置を、図6〜図13に基づい
て詳細に説明するが、その前に、このシリアル通信装置
の概要を説明する。
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】図6は、本シリアル通信装置を適用した電
子機器の概略構成を示すブロック図であり、本電子機器
は、1つの主局mと複数(図示例では12個)の従局s
1〜s12とにより構成されている。なお、図6は、接
続可能なすべての従局を図示したものであって、この中
から任意に選択した従局によって電子機器を構成するこ
とができる。
FIG. 6 is a block diagram showing a schematic configuration of an electronic apparatus to which the present serial communication device 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. 6 shows all connectable slave stations, and an electronic device can be configured by a slave station arbitrarily selected from these slave stations.

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

【0031】図7において、入力セレクタ回路1には、
並列入力情報と識別子入力情報とが入力され、入力セレ
クタ回路1は、従局から主局に返送する情報として、並
列入力情報または識別子入力情報のいずれか一方を選択
して、入力ラッチ回路2および排他的論理和回路A(以
下、「EXOR回路A」という)3に出力する。入力ラ
ッチ回路2は、この選択された情報を一回分のシリアル
通信の実行期間だけラッチして保持し、EXOR回路A
3およびシフトレジスタ回路4に出力する。
In FIG. 7, 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, turned off ("0") otherwise, and output to the decoding circuit B12. Is done.

【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】次に、図8〜図14を参照して、主局が実
行する制御処理をさらに詳細に説明する。
Next, the control processing executed by the master station will be described in more detail with reference to FIGS.

【0055】図8は、前記図6の電子機器からオプショ
ンとして設置される従局をいくつか省略して構成した電
子機器の一例を示すブロック図である。なお、ここで言
うオプションと称される電気ユニット(従局)は、ユー
ザが設置するオプションだけに限定されず、たとえば、
工場での組み立て時に設置される電気ユニットも含んで
いる。
FIG. 8 is a block diagram showing an example of an electronic apparatus in which some of the optional stations installed from the electronic apparatus of FIG. 6 are omitted. 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】図6において、主局は同図に示す順番に割
り振られた従局配列順番を基本に制御を実行する。な
お、この基本となる伝送路の従局配列順番は、使用する
電子機器の構成に応じて決定されるが、仕様変更などで
従局配列順番が入れ替わった場合には、その内容に応
じ、基本となる従局配列順番を変更する。
In FIG. 6, 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】図6および図8では、主局mを起点とし
て、従局s1〜s12からなるリング状の伝送路が設け
られている。
In FIGS. 6 and 8, a ring-shaped transmission line including the slave stations s1 to s12 is provided starting from the master station m.

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

【0059】そして、図10の再設定されたメモリマッ
プでの従局配列順番を基に、通常通信で各従局との情報
交換が実行され、データ内容が更新される。一方、本シ
リアル通信装置の適用された電子機器は、本メモリマッ
プを読み書き操作することで装置制御を実行する。
Then, based on the arrangement order of the slave stations in the reset memory map of FIG. 10, information exchange with each slave station is performed 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】なお、図10中、“X”,“Z”で表現す
るビットは、通常通信実行に伴って更新される情報内容
を示している。
In FIG. 10, the bits represented by "X" and "Z" indicate information contents updated with the execution of normal communication.

【0061】図11は、本シリアル通信装置が実行する
シリアル通信処理の手順を示すフローチャートであり、
図12は、図11中の初期化通信処理の詳細な手順を示
すフローチャートである。また、図13および図14
は、図11中の通常通信処理の詳細な手順を示すフロー
チャートである。
FIG. 11 is a flowchart showing a procedure of a serial communication process executed by the present serial communication device.
FIG. 12 is a flowchart showing a detailed procedure of the initialization communication process in FIG. 13 and FIG.
12 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】以降、主局を中心とした本シリアル通信装
置が実行する制御処理を、図11〜図14を参照して詳
細に説明する。
Hereinafter, the control processing executed by the present serial communication device centering on the main station will be described in detail with reference to FIGS.

【0064】電源が投入され、CPU(図示せず)のリ
セット後にCPUが有するメモリ(図示せず)の初期化
設定処理が実行されて、主局が有するメモリ部分に基本
となる伝送路に接続可能な全従局の配列順番がマップ化
されると、CPU動作による電子機器の制御プログラム
が起動され、同時に、主局の制御処理であるシリアル通
信処理(図11)も起動される。主局は、各従局との情
報交換を実行する、通常通信と称される通信を行う前
に、まず、現状の伝送路に存在する従局配列順番を確定
すべき通信、すなわち初期化通信を行う。その際、主局
が有するメモリ状態は、図9に示すメモリマップとなっ
ている。
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. 11) 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 the flag is not set, the flow advances to step S103 to reset the memory map in the initialization communication process. Execute.

【0067】図12の初期化通信処理において、まず、
ステップS121で、図7の従局の有する入力セレクタ
回路1に従局の識別子情報をアクセスさせる操作であ
る、転送クロック1発の空転送を実行する。(なお、転
送クロックの空転送を実行しない場合には、従局の有す
る入力セレクタ回路1に従局の情報内容をアクセスさせ
る操作となる。)次に、ステップS122では、メモリ
マップの再設定に使用するメモリポインタと通信結果の
異常を登録する通信異常フラグを初期化して、ステップ
S123以降の初期化通信の実行を開始する。
In the initialization communication process shown in FIG.
In step S121, the idle transfer of one transfer clock, which is the operation of making the input selector circuit 1 of the slave station of FIG. 7 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】図11に戻り、この初期化通信処理を終了
すると、一旦シリアル通信処理を終了する。
Returning to FIG. 11, 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でリトライカ
ウンタ値がインクリメントされることによりそのカウン
ト値が所定値を越えるようになり、図11のステップ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】以上が初期化通信の主局制御であるが、こ
こで、図8〜図10を用いて、具体的な初期化通信動作
をシリアル通信装置全体の動きから簡単に説明する。
The master station control of the initialization communication has been described above. Here, a specific initialization communication operation will be briefly described with reference to FIGS.

【0080】初期化シリアル通信によるメモリマップの
再設定は、図9に示す基本となる従局配列順番のメモリ
マップを基に実施される。主局は始めに、基本となる従
局配列順番のメモリマップの従局並列出力情報の下位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. The master station first determines the lower 4 levels of the slave station parallel output information in the memory map in the order of the base station arrangement order.
The information content of the bit string is shifted and transferred 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から順番に割り振るのではない。つまり、
本体ユニットは、必ず装置内に存在するため、予め設定
された伝送路順番の位置にあることを確認できればよ
く、したがって、識別子情報は固定値で設定できる。そ
して、オプションユニットは、既に位置順番が決定して
いる本体ユニット間に必ず存在するため、一つの本体ユ
ニットを基準とし、順番に番号を振る。したがって、オ
プションユニットの識別子情報は、一つの本体ユニット
間では重複する識別子情報内容は存在しないが、異なる
組みの本体ユニット間においては重複することが許され
るのであって、その識別判定も可能になる。図9では、
その識別子情報の割り振りの一例が従局並列出力情報の
上位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.
An example of the assignment of the identifier information is shown in the upper 4 bits of the slave station parallel output information.

【0085】このような取り決めによる識別子情報の定
義に基づいて、図8に示す伝送路を例にメモリマップの
再設定処理を説明する。なお、このメモリ設定は、一般
的なCPUのメモリ操作と同様に実行されるものであっ
て、以下に一例として説明するが、特にこれに限定され
たものではない。
The resetting process of the memory map will be described by taking the transmission line shown in FIG. 8 as an example based on the definition of the identifier information according to such a rule. 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】メモリを操作する手段として、メモリの先
頭位置アドレス(図9中、MTOで示す)とメモリポイ
ンタカウンタがあり、メモリの先頭位置アドレスが示す
メモリ内容を基準カウンタとして利用する。そして、シ
フト転送された識別子情報が本体ユニットの場合には、
メモリの先頭位置アドレスが示すメモリ内容の基準カウ
ンタ値をインクリメントし、オプションユニットの場合
には、メモリポインタカウンタ値をインクリメントす
る。
As means for operating the memory, there are a head position address of the memory (indicated by MTO in FIG. 9) and a memory pointer counter, and the contents of the memory indicated by the head position address of the memory are used as a reference counter. If the identifier information of the shifted unit is the main unit,
The reference counter value of the memory content indicated by the head position address of the memory is incremented. In the case of 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
番目のメモリ内容(図9中、チェッカとなっている)
と、転送されたチェッカの識別子情報内容とを比較す
るため一致する。一致した場合には、該当従局有りと判
定し、基本となるメモリマップの設定された上位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 memory (the checker in Fig. 9)
Matches with the transferred identifier information content of the checker. If they match, it is determined that there is a corresponding slave station, and the upper 4 bits set in the basic memory map are left as they are, and a state is set where there is a slave station.

【0089】次に、ソータの識別子情報(オプションユ
ニット)がシフト転送される。この場合には、オプショ
ンユニットであるため、基準カウンタ値がインクリメン
トされず01Hのままで、メモリポインタカウンタ値が
インクリメントされて01Hになる。その結果、1番目
に位置する本体ユニット後の1番目に示されるメモリ
(図9中、ソータとなっている)と、転送されたソータ
の識別子情報内容とを比較するため一致する。したがっ
て、同様に従局有りと処理される。
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 (the sorter in FIG. 9) after the main unit, which is located first, matches the identifier information of the transferred sorter for comparison. Therefore, it is similarly processed that there is a slave station.

【0090】次にシフト転送される識別子情報は、図8
より、高圧赤(オプションユニット)となる。この場合
には、本体ユニットではないため、メモリポインタカウ
ンタ値がインクリメントされて02Hになる。一方、基
準カウンタ値は01Hのままである。したがって、1番
目に位置する本体ユニット後の2番目に位置されるメモ
リ(図9中、スイッチバックとなっている)と、転送さ
れたソータの識別子情報内容とを比較する。その結果、
不一致となり、まず、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. 9) is compared with the transferred identifier information of the sorter. as a result,
If there is no match, first, the upper 4 bits of the switchback memory, which is the memory located second after the main unit located first, 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】次は、図8に示されるように、高圧1の識
別子情報(本体ユニット)がシフト転送される。本体ユ
ニットの識別子情報内容を受信すると、まず、基準カウ
ンタ値とメモリポインタカウンタ値とが示す以降のメモ
リから始まり、基準カウンタ値がインクリメントされた
値で示される本体ユニット間に登録されたオプションユ
ニットのメモリ内容を全て該当従局無しに設定する。こ
の場合は、高圧黄(オプションユニット)がそれに該当
する。次に、インクリメントされた基準カウンタ値を基
に、上述のように、基本となるメモリマップの再設定を
続ける。なお、基準カウンタがインクリメントされると
きは、メモリポインタカウンタ値はクリアされ00Hに
戻すようになる。
Next, as shown in FIG. 8, 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
0(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 performed 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】以下、図11のステップS105〜S11
2で示される通常通信を説明する。
Hereinafter, steps S105 to S11 in FIG.
The normal communication indicated by No. 2 will be described.

【0096】同図において、上述の初期化通信処理をス
テップS103で実行すると、メモリマップ再設定フラ
グがセットされる。その結果、メモリマップは、図10
(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に移って、通信故障処
理ルーチンで処理される。一方、リトライ通信を実行す
るときには、初期化通信の場合は、前述したように、図
12のステップS135でリトライカウンタのインクリ
メント処理を行い、再設定フラグをリセットのまま、図
11のステップ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 the retry communication is executed, in the case of the initialization communication, as described above, the retry counter is incremented in step S135 in FIG. 12, and the process proceeds to step S102 in FIG. 11 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】図13の通常通信処理において、まず、ス
テップS141で、通信ソフトリセットを実行して通信
実行の同期を取る。
In the normal communication processing shown in FIG. 13, 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に設定
し、図14のステップ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で、制御カウンタ値が上記所定値でなけ
れば、図14のステップ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, while the return phase signal is checked on, while the control counter value is not the predetermined value in step S145, the process proceeds to step S147 in FIG. 14, where the return phase signal is checked off.

【0104】そして、ステップS146で返送位相信号
のオンチェックのときにオン、または、ステップS14
7で返送位相信号のオフチェックのときにオフであれ
ば、正常に位相タイミングの同期が取れていると判断し
て、ステップS150に移る。一方、ステップS146
で返送位相信号のオンチェックのときにオフ、またはス
テップS147で返送位相信号のオフチェックのときに
オンであれば、位相タイミングの同期がずれていると判
断し、図14のステップS148で通信異常フラグの位
相エラービットをセットし、ステップS149で通信ソ
フトリセットを実行して、現在実行している通常通信を
キャンセルする。この場合、図11のステップS109
で異常と判断されて、ステップS110に移り、通信異
常フラグ解析が実行されて、ステップS111で、リト
ライ通信を指示するためにリトライフラグをセットし、
さらにリトライカウンタをインクリメントする。
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. On the other hand, step S146
If it is off when the return phase signal is on-checked in step S147, or if it is on when the return phase signal is off-checked in step S147, it is determined that the phase timing is out of synchronization, and a communication error is detected in step S148 in FIG. The phase error bit of the flag is set, and communication software reset is executed in step S149 to cancel the currently executed normal communication. In this case, step S109 in FIG.
In step S110, a communication error flag analysis is performed. In step S111, a retry flag is set to instruct retry communication.
Further, 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】図13のステップS146および図14の
ステップS147で、返送位相信号状態が正常と判断さ
れると、ステップS150に移り、通常通信の実行に入
る。
If it is determined in step S146 in FIG. 13 and step S147 in FIG. 14 that the state of the return phase signal is normal, the flow shifts to step S150 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ビットデータを該当する従局で
ある図10(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.
In step 159, 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で、シ
フト転送する従局のデータスキャンが一巡して終了した
と判断したときには、図14のステップS160に移
り、主局の位相制御カウンタの制御カウント値を0DH
にして、各従局からの二度読み結果を判定する。ステッ
プS161で、返送位相信号がオンしていれば、いずれ
かの従局で二度読み比較にエラーがあったことを意味す
るために、ステップS163に進み、通信異常フラグの
二度読み比較エラービットをセットして、ステップS1
64でリトライ通信を実行するための通信ソフトリセッ
トを実行する。この後、再び図11のステップ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. 14, 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にして、各従局からの通信要求信号を有効に設
定して、無事、通常通信を終了したものとして図11の
ステップ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 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が各
従局に情報更新が必要と判断する主局通信要求フラグを
各制御タスク中にセットする。したがって、主局は、シ
リアル通信処理の通常通信を制御する部分(図11のス
テップ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. 11) and determines whether or not the normal communication is to be executed.

【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, in this serial communication device, the plurality of slave stations existing on the transmission path are constituted by a slave station for a main unit that cannot be detached from the electronic device main body and a slave station for an optional unit that can be detached from the electronic device main body. Some optional units are removable at the user level and others are not.

【0118】ユーザレベルで着脱可能なオプションユニ
ットは、電子機器の取扱い説明書などで、その着脱実行
の際は必ず電源を切るようにと記載されているととも
に、ユーザに対する指導を徹底しているが、場合によっ
ては、今まで利用していたユーザレベルで着脱可能なオ
プションユニットの利用を止める際に、電子機器本体の
電源を切らずに、単にそのオプションユニットを取り外
すだけで、継続して電子機器を使うことが極くまれに生
じたりする。
Optional units that can be attached and detached at the user level are described in the instruction manual of the electronic equipment so that the power is always turned off when the attachment / detachment is executed, and the user is thoroughly instructed. In some cases, when stopping the use of a user-level detachable option unit that has been used in the past, the user can simply remove the option unit without turning off the power of the electronic device itself, and continue to use the electronic device. The use of is very rare.

【0119】また、特に、電子写真装置のように紙搬送
中に発生する紙詰まり現象(一般的には「ジャム」と呼
ばれているもので、以下、単に「ジャム」と略して言
う)などが発生すると、装置によっては、ジャム処理の
ためにユーザレベルで着脱可能なオプションユニットを
装置から外して、ジャム処理を実行する必要があったり
する。その結果、装置本体の電源を切らずにオプション
ユニットを外し、ジャム処理後にオプションユニットを
接続し忘れ、そのまま継続して機器装置を使うことが極
くまれに生じたりもする。
Also, in particular, a paper jam phenomenon (generally referred to as “jam”, hereinafter simply referred to as “jam”) that occurs during paper conveyance as in an electrophotographic apparatus, etc. Occurs, depending on the device, it is necessary to remove the optional unit detachable at the user level from the device for the jam processing and execute the jam processing. As a result, in some rare cases, the user disconnects the option unit without turning off the power of the apparatus main body, forgets to connect the option unit after the jam has been cleared, and continues to use the device as it is.

【0120】このシリアル通信装置は、上述したよう
に、初期化通信により伝送路に存在する従局の配列順番
をメモリに再設定し、登録された従局に対応する情報内
容のみで構成されるシフト転送情報を通常通信によりシ
フト転送し、主局は複数の従局との情報交換を実行する
ものであるが故に、電子機器本体の電源を切らずにオプ
ションユニットを外し、継続して電子機器を使うことが
あると、初期化通信によって認識している伝送路に存在
する従局の配列順番に狂いを生じてしまう。つまり、伝
送路に存在する従局の配列順番をメモリに再設定する初
期化通信を実行した後の通常通信実行中では、確定した
従局の配列順番を基に構成されたシフト転送情報で通信
実行をするために、一つの従局接続が実際になくなるこ
とにより、伝送路に実際に接続されている従局配列と主
局のメモリに登録されている従局配列との間に狂いが生
じてしまう。
As described above, this serial communication device resets the arrangement order of the slave stations existing on the transmission line in the memory by the initialization communication, and shift-transfers only the information contents corresponding to the registered slave stations. Because information is shifted and transferred by normal communication, and the master station exchanges information with multiple slave stations, remove the option unit without turning off the power of the electronic device itself and continue using the electronic device If there is, the arrangement order of the slave stations existing on the transmission path recognized by the initialization communication will be out of order. In other words, during the normal communication after the initialization communication for resetting the arrangement order of the slave stations present on the transmission line to the memory, the communication execution is performed with the shift transfer information configured based on the determined arrangement order of the slave stations. Therefore, when one slave station connection is actually lost, a deviation occurs between the slave station array actually connected to the transmission path and the slave station array registered in the memory of the master station.

【0121】したがって、電子機器本体の電源を切って
オプションユニットを外す場合には、その後のオプショ
ンユニットの接続の有無に関係なく電源投入後に実行す
る初期化通信により再び従局の配列順番が更新されるの
で問題はないが、電子機器本体の電源を切らずに、一つ
の従局が外され継続して電子機器が使われる場合には、
実際の伝送路に接続される従局の配列順番と以前の初期
化通信で確定した、主局のメモリに保持した従局の配列
順番に狂いが生じ、本来、ある従局に伝達したい情報内
容が別の従局に誤伝達してしまう等、誤伝達に気付くこ
となく、通常通信による情報交換が継続され実行される
ため、シリアル通信そのものが成立できなくなる。
Therefore, when the power of the electronic device is turned off and the optional unit is removed, the arrangement order of the slave stations is updated again by the initialization communication executed after the power is turned on, regardless of whether the optional unit is connected or not. So there is no problem, but if one slave station is removed and the electronic device is used continuously without turning off the power of the electronic device body,
The arrangement order of the slaves connected to the actual transmission path and the arrangement order of the slaves held in the memory of the master determined in the previous initialization communication may be out of order, and the information contents originally intended to be transmitted to a certain slave may be different. Since the information exchange by the normal communication is continued and executed without noticing the erroneous transmission such as erroneous transmission to the slave station, the serial communication itself cannot be established.

【0122】本発明は、この点に着目してなされたもの
であり、電子機器本体の電源を切らずに当該電子機器に
設置されたオプションユニットを取り外した場合であっ
ても、その後のシリアル通信を正常に行うことが可能な
シリアル通信装置、シリアル通信方法および記憶媒体を
提供することを目的とする。
The present invention has been made in view of this point, and even if the optional unit installed in the electronic device is removed without turning off the power of the electronic device main body, the serial communication after that is performed. It is an object of the present invention to provide a serial communication device, a serial communication method, and a storage medium that can perform the normal operation.

【0123】[0123]

【課題を解決するための手段】上記目的を達成するた
め、本発明のシリアル通信装置は、一つの主局および複
数の従局をループ状に接続する伝送路と、前記複数の従
局の前記伝送路上の配列順番を記憶する記憶手段と、前
記主局の要求に応じて前記各従局がそれぞれ前記伝送路
を介してシリアル返送する識別子情報に基づいて、前記
伝送路上に現在配列されている従局の配列順番を前記記
憶手段に再設定する初期化通信手段と、該初期化通信手
段によって再設定された従局の配列順番に基づき、前記
伝送路を介して、前記主局から前記各従局へ情報をシリ
アル転送するとともに、前記各従局から前記主局へ情報
をシリアル転送し、該主局へシリアル転送された情報を
前記記憶手段の当該従局に対応する位置に記憶する通常
通信手段と、第1の従局と第2の従局に分類された前記
伝送路上に存在する複数の従局のうち、前記第1の従局
に対しては、前記主局へ転送される情報中、予め設定さ
れた少なくとも1つ以上のビットを第1の固定値に設定
し、前記第2の従局に対しては、前記ビットを前記第1
の固定値とは状態の異なる第2の固定値に設定する設定
手段と、前記記憶手段に記憶された前記主局へ転送され
た情報中前記ビットに設定された固定値の状態と、その
配列順番とを比較することにより、両者間にずれが生じ
ているか否かを判定する判定手段と、該判定の結果、ず
れが生じているときには、前記初期化通信手段による処
理を再度実行させるように制御する制御手段とを有する
ことを特徴とする。
To achieve the above object, a serial communication apparatus according to the present invention comprises a transmission line connecting one master station and a plurality of slave stations in a loop, and a transmission line connecting the plurality of slave stations. Storage means for storing the arrangement order of the slave stations, based on the identifier information that each of the slave stations serially returns via the transmission path in response to the request of the master station, the arrangement of the slave stations currently arranged on the transmission path. Initialization communication means for resetting the order in the storage means, and, based on the arrangement order of the slave stations reset by the initialization communication means, information is serially transmitted from the master station to the slave stations via the transmission path. A normal communication unit for transferring and serially transferring information from each of the slave stations to the master station, and storing the information serially transferred to the master station in a position corresponding to the slave station in the storage unit; Among a plurality of slave stations existing on the transmission line classified into a station and a second slave station, at least one or more of a plurality of preset slave stations, among information transferred to the master station, are set for the first slave station. Is set to a first fixed value, and for the second slave station, the bit is set to the first fixed value.
Setting means for setting a second fixed value having a state different from the fixed value of the fixed value, a state of the fixed value set for the bit in the information transferred to the master station stored in the storage means, and an array thereof. A determination unit that determines whether or not there is a shift between the two by comparing the order, and as a result of the determination, when there is a shift, the processing by the initialization communication unit is executed again. And control means for controlling.

【0124】好ましくは、前記第1の従局の個数は、前
記第2の従局の個数に比較して極めて少なく選択される
ことを特徴とする。
[0124] Preferably, the number of the first slave stations is selected to be extremely small as compared with the number of the second slave stations.

【0125】また、好ましくは、前記判定手段は、前記
記憶手段に記憶された前記主局へ転送された情報中、前
記第1の固定値が設定された情報と、その配列順番とを
比較することを特徴とする。
Preferably, the judging means compares the information, in which the first fixed value is set, in the information transferred to the master station stored in the storage means with the arrangement order thereof. It is characterized by the following.

【0126】さらに、好ましくは、前記判定手段は、前
記通常通信手段による処理が前記複数の従局すべてに対
して1通り終了した後に、ずれ判定を行うことを特徴と
する。
Further, preferably, the determination means performs the shift determination after the processing by the normal communication means has been completed for all of the plurality of slave stations.

【0127】また、さらに好ましくは、前記判定手段
は、前記通常通信手段による処理が前記複数の従局のそ
れぞれに対して終了する度に、ずれ判定を行うことを特
徴とする。
[0127] More preferably, the determination means performs the deviation determination each time the processing by the normal communication means ends for each of the plurality of slave stations.

【0128】上記目的を達成するため、本発明のシリア
ル通信方法は、一つの主局および複数の従局をループ状
に接続する伝送路と、前記複数の従局の前記伝送路上の
配列順番を記憶する記憶手段とを備えた電子機器におけ
るシリアル通信方法であって、前記主局の要求に応じて
前記各従局がそれぞれ前記伝送路を介してシリアル返送
する識別子情報に基づいて、前記伝送路上に現在配列さ
れている従局の配列順番を前記記憶手段に再設定する初
期化通信工程と、該初期化通信工程によって再設定され
た従局の配列順番に基づき、前記伝送路を介して、前記
主局から前記各従局へ情報をシリアル転送するととも
に、前記各従局から前記主局へ情報をシリアル転送し、
該主局へシリアル転送された情報を前記記憶手段の当該
従局に対応する位置に記憶する通常通信工程と、第1の
従局と第2の従局に分類された前記伝送路上に存在する
複数の従局のうち、前記第1の従局に対しては、前記主
局へ転送される情報中、予め設定された少なくとも1つ
以上のビットを第1の固定値に設定し、前記第2の従局
に対しては、前記ビットを前記第1の固定値とは状態の
異なる第2の固定値に設定する設定工程と、前記記憶手
段に記憶された前記主局へ転送された情報中前記ビット
に設定された固定値の状態と、その配列順番とを比較す
ることにより、両者間にずれが生じているか否かを判定
する判定工程と、該判定の結果、ずれが生じているとき
には、前記初期化通信工程による処理を再度実行させる
ように制御する制御工程とを有することを特徴とする。
In order to achieve the above object, a serial communication method of the present invention stores a transmission path connecting one master station and a plurality of slave stations in a loop, and an arrangement order of the plurality of slave stations on the transmission path. A serial communication method in an electronic device comprising a storage unit, wherein each of the slave stations responds to a request from the master station based on identifier information serially returned via the transmission path. The initialization communication step of resetting the arrangement order of the slave stations that have been set in the storage means, and based on the arrangement order of the slave stations reset by the initialization communication step, via the transmission path, from the master station. While serially transferring information to each slave station, serially transferring information from each slave station to the master station,
A normal communication step of storing information serially transferred to the master station at a position corresponding to the slave station in the storage means; and a plurality of slave stations existing on the transmission line classified into a first slave station and a second slave station. Of the information transferred to the master station, at least one or more bits set in advance are set to a first fixed value for the first slave station. Setting the bit to a second fixed value having a state different from the first fixed value; and setting the bit in the information stored in the storage means and transferred to the master station. A determination step of determining whether or not there is a difference between the two by comparing the state of the fixed value and the arrangement order thereof, and as a result of the determination, when there is a difference, the initialization communication A system that controls the process to be executed again Characterized by a step.

【0129】好ましくは、前記第1の従局の個数は、前
記第2の従局の個数に比較して極めて少なく選択される
ことを特徴とする。
Preferably, the number of the first slave stations is selected to be extremely small as compared with the number of the second slave stations.

【0130】また、好ましくは、前記判定工程では、前
記記憶手段に記憶された前記主局へ転送された情報中、
前記第1の固定値が設定された情報と、その配列順番と
を比較することを特徴とする。
Preferably, in the determining step, the information transferred to the master station stored in the storage means includes:
The information in which the first fixed value is set is compared with the arrangement order thereof.

【0131】さらに、好ましくは、前記判定工程では、
前記通常通信工程による処理が前記複数の従局すべてに
対して1通り終了した後に、ずれ判定を行うことを特徴
とする。
More preferably, in the determining step,
The shift determination is performed after the processing in the normal communication step is completed for all of the plurality of slave stations.

【0132】また、さらに好ましくは、前記判定工程で
は、前記通常通信工程による処理が前記複数の従局のそ
れぞれに対して終了する度に、ずれ判定を行うことを特
徴とする。
[0132] More preferably, in the determination step, a shift determination is performed each time the processing in the normal communication step ends for each of the plurality of slave stations.

【0133】上記目的を達成するため、本発明の記憶媒
体は、一つの主局および複数の従局をループ状に接続す
る伝送路と、前記複数の従局の前記伝送路上の配列順番
を記憶する記憶手段とを備えた電子機器におけるシリア
ル通信モジュールを含む、コンピュータが実現できるプ
ログラムを格納した記憶媒体であって、前記シリアル通
信モジュールは、前記主局の要求に応じて前記各従局が
それぞれ前記伝送路を介してシリアル返送する識別子情
報に基づいて、前記伝送路上に現在配列されている従局
の配列順番を前記記憶手段に再設定する初期化通信モジ
ュールと、該初期化通信モジュールによって再設定され
た従局の配列順番に基づき、前記伝送路を介して、前記
主局から前記各従局へ情報をシリアル転送するととも
に、前記各従局から前記主局へ情報をシリアル転送し、
該主局へシリアル転送された情報を前記記憶手段の当該
従局に対応する位置に記憶する通常通信モジュールと、
第1の従局と第2の従局に分類された前記伝送路上に存
在する複数の従局のうち、前記第1の従局に対しては、
前記主局へ転送される情報中、予め設定された少なくと
も1つ以上のビットを第1の固定値に設定し、前記第2
の従局に対しては、前記ビットを前記第1の固定値とは
状態の異なる第2の固定値に設定する設定モジュール
と、前記記憶手段に記憶された前記主局へ転送された情
報中前記ビットに設定された固定値の状態と、その配列
順番とを比較することにより、両者間にずれが生じてい
るか否かを判定する判定モジュールと、該判定の結果、
ずれが生じているときには、前記初期化通信モジュール
による処理を再度実行させるように制御する制御モジュ
ールとを有することを特徴とする。
In order to achieve the above object, a storage medium of the present invention is a storage medium for storing a transmission line for connecting one master station and a plurality of slave stations in a loop, and an arrangement order of the plurality of slave stations on the transmission line. And a storage medium storing a program that can be implemented by a computer, including a serial communication module in an electronic device provided with the means. An initialization communication module for resetting the arrangement order of the slave stations currently arranged on the transmission path in the storage unit based on the identifier information serially returned via the communication station; and a slave station reset by the initialization communication module. Based on the arrangement order, via the transmission path, while serially transferring information from the master station to each of the slave stations, from each of the slave stations The information to the serial master station and serial transfer,
A normal communication module for storing information serially transferred to the master station at a position corresponding to the slave station in the storage means;
Of the plurality of slave stations existing on the transmission path classified into the first slave station and the second slave station, for the first slave station,
In the information transferred to the master station, at least one bit set in advance is set to a first fixed value;
A setting module for setting the bit to a second fixed value having a state different from the first fixed value, and the information stored in the storage means and transferred to the master station. A determination module that determines whether or not there is a shift between the two by comparing the state of the fixed value set in the bit with the arrangement order thereof, and a result of the determination,
And a control module for controlling the initialization communication module to execute the processing again when a deviation occurs.

【0134】好ましくは、前記第1の従局の個数は、前
記第2の従局の個数に比較して極めて少なく選択される
ことを特徴とする。
Preferably, the number of the first slave stations is selected to be extremely small as compared with the number of the second slave stations.

【0135】また、好ましくは、前記判定モジュールで
は、前記記憶手段に記憶された前記主局へ転送された情
報中、前記第1の固定値が設定された情報と、その配列
順番とを比較することを特徴とする。
Preferably, in the determination module, the information in which the first fixed value is set in the information transferred to the master station stored in the storage means is compared with the arrangement order thereof. It is characterized by the following.

【0136】さらに、好ましくは、前記判定モジュール
では、前記通常通信モジュールによる処理が前記複数の
従局すべてに対して1通り終了した後に、ずれ判定を行
うことを特徴とする。
[0136] More preferably, in the determination module, the shift determination is performed after the processing by the normal communication module is completed for all of the plurality of slave stations.

【0137】また、さらに好ましくは、前記判定モジュ
ールでは、前記通常通信モジュールによる処理が前記複
数の従局のそれぞれに対して終了する度に、ずれ判定を
行うことを特徴とする。
[0137] More preferably, in the determination module, each time the processing by the normal communication module is completed for each of the plurality of slave stations, a shift determination is performed.

【0138】[0138]

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

【0139】図1は、本発明の第1の実施の形態に係る
シリアル通信装置を適用した電子機器の概略構成を示す
ブロック図であり、前記図8に対応するものである。
FIG. 1 is a block diagram showing a schematic configuration of an electronic apparatus to which the serial communication device according to the first embodiment of the present invention is applied, and corresponds to FIG.

【0140】図8では、伝送路に接続される全ての従局
が有する複数の並列入力端子は全ビットとも主局への返
送情報として利用するように構成されていたが、本実施
の形態では、図1に示すように、伝送路に接続される全
ての従局が有する複数の並列入力端子のうち、ビット2
が、予め設定される所定ビットの情報内容に固定される
ように構成されている。この所定ビットは、特に限定さ
れるのものではなく、一つの従局の1ビットが割り振ら
れていればよい。そして、所定のビット2は、本実施の
形態では、従局s2のみが第1の固定値状態(ハイレベ
ル)に設定され、その他の従局は、第2の固定値状態
(ロウレベル)に設定されるという従局構成で伝送路に
混在している。
In FIG. 8, a plurality of parallel input terminals of all slave stations connected to the transmission line are configured so that all bits are used as return information to the master station. However, in this embodiment, As shown in FIG. 1, among a plurality of parallel input terminals of all slave stations connected to the transmission line, bit 2
Are fixed to information contents of predetermined bits set in advance. The predetermined bits are not particularly limited, as long as one bit of one slave station is allocated. In this embodiment, only the slave station s2 is set to the first fixed value state (high level), and the other predetermined stations are set to the second fixed value state (low level). And are mixed in the transmission line.

【0141】なお、この伝送路での従局構成は、本発明
の趣旨をできる限り容易に説明するために、最も簡単な
ものを例示しているに過ぎず、予め設定される所定ビッ
トの構成は複数ビット構成でもよいし、また、第1の固
定値状態と第2の固定値状態は区別がつけばどのような
ものを採用してもよく、たとえばコード化されていても
よい。さらには、一つの従局のみが第1の固定値状態と
してなくてもよく、第1の固定値状態と第2の固定値状
態が適当な数で伝送路中に混在するように構成してもよ
いことは言うまでもない。
The slave station configuration on this transmission path is merely the simplest one in order to explain the gist of the present invention as easily as possible. A multi-bit configuration may be used, and the first fixed value state and the second fixed value state may be of any type as long as they can be distinguished, and may be coded, for example. Further, only one slave station need not be in the first fixed value state, and the first fixed value state and the second fixed value state may be mixed in an appropriate number in the transmission path. It goes without saying that it is good.

【0142】本実施の形態では、図1に示すように、従
局s2のみが第1の固定値状態であるハイレベルに設定
されているため、通常通信処理を実行すると主局に返送
される情報内容を記憶保持する図9(b)および10
(b)に示すメモリの従局並列入力情報は、下位4ビッ
トのビット2が所定ビットとなり、通常通信処理が正常
に実行されると、従局s2である手差しユニット(本体
ユニット列に属する)の下位4ビットのビット2に”
1”が入力されて、それ以外の下位4ビットのビット2
が”0”となるのである。そして、初期化通信処理によ
って再設定された従局の配列順番に狂いが生じると、こ
の手差しユニットの下位4ビットのビット2が”0”に
なり、”0”となるべき従局が”1”を示すことにな
る。したがって、図2に示す制御を実行することで、本
発明の特徴である配列順番ずれ補正自己診断処理を実現
することができる。
In the present embodiment, as shown in FIG. 1, only slave station s2 is set to the high level, which is the first fixed value state. Therefore, when normal communication processing is executed, information returned to the master station is obtained. 9 (b) and 10 for storing contents
In the slave-side parallel input information of the memory shown in (b), bit 2 of the lower 4 bits becomes a predetermined bit. 4 bit bit 2 "
1 ”is input and the other lower 4 bits, bit 2
Becomes “0”. Then, when the arrangement order of the slave stations reset by the initialization communication processing becomes out of order, bit 2 of the lower 4 bits of this manual feed unit becomes “0”, and the slave station that should become “0” changes “1”. Will show. Therefore, by executing the control shown in FIG. 2, it is possible to realize the arrangement order deviation correction self-diagnosis processing which is a feature of the present invention.

【0143】以下、本実施の形態のシリアル通信装置が
実行する制御処理を、図2および図3を参照して説明す
る。
Hereinafter, control processing executed by the serial communication device according to the present embodiment will be described with reference to FIG. 2 and FIG.

【0144】なお、本発明は上記従来のシリアル通信装
置を基に配列順番ずれ補正自己診断を実行できるように
したものであるが、本発明が意図する制御処理を実行可
能なシリアル通信装置であれば、特にシリアル通信装置
は限定されない。また、本実施の形態の説明で、上述し
た従来例と重複する説明内容と図面については、説明を
容易にするため省略する。
Although the present invention is such that the self-diagnosis of the arrangement order deviation correction can be executed based on the above-mentioned conventional serial communication device, any serial communication device capable of executing the control processing intended by the present invention is applicable. The serial communication device is not particularly limited as long as it is used. In the description of the present embodiment, description and drawings which are the same as those in the above-described conventional example will be omitted to facilitate the description.

【0145】図2および図3は、本実施の形態のシリア
ル通信装置、特に主局mのCPUが実行する制御処理の
一部である通常通信処理の手順を示すフローチャートで
あり、前記図13および図14に対応している。
FIGS. 2 and 3 are flow charts showing the procedure of the normal communication process which is a part of the control process executed by the CPU of the serial communication device of the present embodiment, in particular, the master station m. This corresponds to FIG.

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

【0147】このプログラムは、タスク形式の並列処理
によって構成されている。つまり、各独立した制御プロ
グラムが複数のタスクを構成し、電源投入後の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.

【0148】各タスクは、並列処理されてリアルタイム
で実行される。図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.

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

【0150】以下、本実施の形態について説明するが、
以下で述べるプログラムも同様に並列処理されるタスク
ではあるが、説明を容易にするために一つのつながった
プログラム処理のようにして説明する。
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.

【0151】モニタプログラムにより、前記図11で説
明したシリアル通信タスク(処理)が起動されると、従
来例で述べたように、ステップS103で、初期化通信
処理により現状の通信伝送路に接続される従局配列順番
のメモリ再設定が実行される。
When the serial communication task (processing) described with reference to FIG. 11 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.

【0152】そして、メモリの再設定が終了すると、初
期化通信処理後の初めての通常通信が、ステップ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.

【0153】この通常通信処理に移ると、従来例で述べ
たように、シフト転送制御が順次実行され、メモリに伝
送路中に存在する全従局からの並列入力情報が格納され
る。そして、ステップS150でシフト転送動作が終了
したと判断されると、図3のステップS1に移り、予め
設定される所定ビット(本実施の形態では、ビット2)
が第1の固定値状態で設定される従局の配列順番を認識
し、その配列順番を記憶保持する、基本となる従局の配
列順番を認識する制御を実行する。これにより、初期化
通信後の初めての通常通信で、基本となる従局の配列順
番を認識し、以降に実行する通常通信毎に、認識した基
本となる従局の配列順番を監視することで本発明の特徴
である配列順番ずれ補正自己診断を実施する。
When the processing shifts to the normal communication processing, as described in the conventional example, the shift transfer control is sequentially performed, and the parallel input information from all the slave stations existing on the transmission path is stored in the memory. If it is determined in step S150 that the shift transfer operation has been completed, the process proceeds to step S1 in FIG. 3, and a predetermined bit (bit 2 in the present embodiment) that is set in advance
Performs a control for recognizing the arrangement order of the slave stations set in the first fixed value state, storing the arrangement order, and recognizing the basic arrangement order of the slave stations. Thus, in the first normal communication after the initialization communication, the arrangement order of the basic slave stations is recognized, and the arrangement order of the recognized basic slave stations is monitored for each subsequent normal communication. The self-diagnosis of the sequence order deviation correction, which is the feature of the above, is performed.

【0154】初期化通信後の初めての通常通信で全従局
からの並列入力情報がメモリに格納されると、ステップ
S1〜S4のループにより、メモリに格納された所定ビ
ットであるビット2の状態が、”1”(オン状態)であ
る従局の配列順番をスキャンして検索する。なお、本実
施の形態では、一つの従局のみが”1”(オン状態)で
あるため、ビット2がオンと判断できる従局が見つかれ
ば、スキャン検索を終了できるのであって、ビット2が
オンと判断できる従局が複数あれば、メモリに存在する
全ての従局のビット2のスキャン検索を実行する。
When the parallel input information from all slave stations is stored in the memory in the first normal communication after the initialization communication, the state of bit 2, which is a predetermined bit stored in the memory, is changed by the loop of steps S1 to S4. , "1" (ON state), the order of arrangement of slave stations is scanned and searched. In this embodiment, since only one slave station is "1" (on state), if a slave station whose bit 2 can be determined to be on is found, the scan search can be terminated. If there are a plurality of slave stations that can be determined, a scan search of bit 2 of all slave stations existing in the memory is executed.

【0155】そして、ステップS3でビット2がオンと
判断すると、ステップS5で順番フラグをチェックし、
リセットされているときには、初期化通信後の初めての
通常通信ということで、ステップS6に移って、その従
局の配列順番をカウンタB(図示せず)に記憶保持する
とともに、基本となる従局の配列順番を認識したという
ことで順番フラグをセットして、ステップS160以降
の通常通信の後処理を、従来例で述べたように実行す
る。
If bit 2 is determined to be on in step S3, the order flag is checked in step S5.
If reset, it means that the communication is the first normal communication after the initialization communication, and the process proceeds to step S6, where the arrangement order of the slave stations is stored and held in the counter B (not shown), and the basic arrangement of the slave stations is performed. Since the order is recognized, the order flag is set, and post-processing of the normal communication after step S160 is executed as described in the conventional example.

【0156】このように、メモリに格納された情報内容
をスキャン検索し、カウンタBにその該当する従局の配
列順番を記憶保持する処理が所定状態検索記憶処理であ
る。
As described above, the process of scanning and searching the information content stored in the memory and storing and holding the sequence number of the corresponding slave station in the counter B is the predetermined state search and storage process.

【0157】そして、順番フラグがセットされている
間、カウンタBに記憶保持された従局の配列順番は維持
されて、次に説明するように、通常通信の実行毎に検出
される従局の配列順番と比較される。
While the order flag is set, the arrangement order of the slave stations stored in the counter B is maintained, and as will be described below, the arrangement order of the slave stations detected each time normal communication is executed. Is compared to

【0158】次に、初期化通信後の初めての通常通信の
実行が終了して、その後の通常通信が実行されると、メ
モリに格納された情報内容が更新されて、同様にステッ
プS1に移ってくる。そして、所定状態検索記憶処理の
スキャン検索ルーチン(ステップS2〜S4)を利用
し、更新された情報内容のうち、所定ビットがオンされ
ている従局の配列順番を割り出すための信号状態判断処
理を実行する。
Next, when the execution of the first normal communication after the initialization communication is completed, and the subsequent normal communication is executed, the information content stored in the memory is updated, and the process similarly proceeds to step S1. Come. Using the scan search routine (steps S2 to S4) of the predetermined state search and storage processing, a signal state determination processing for determining the arrangement order of the slave stations whose predetermined bits are turned on in the updated information content is executed. I do.

【0159】なお、本実施の形態では、所定状態検索記
憶処理のスキャン検索ルーチンを利用したが、後述する
第2の実施の形態のように、信号状態判断処理を独自に
設けてもよい。
In this embodiment, the scan search routine of the predetermined state search and storage processing is used, but the signal state determination processing may be independently provided as in a second embodiment described later.

【0160】信号状態判断処理の実行の結果、ステップ
S5で順番フラグを判断してステップS7に移る。ステ
ップS7では、カウンタBに記憶された、従局の配列順
番と現シフト転送で得た所定ビットがオンされている従
局の配列順番とを比較する該当従局順番判定処理を実行
し、一致した場合には、従来例と同様に、ステップS1
60以降の通常通信の後処理を実行する。つまり、伝送
路に存在する従局の配列順番に狂いがなかったと判定さ
れたことになる。
As a result of the execution of the signal state determination processing, the order flag is determined in step S5, and the process proceeds to step S7. In step S7, a slave station order determination process for comparing the array order of the slave stations stored in the counter B with the array order of the slave stations whose predetermined bits obtained in the current shift transfer are turned on is executed. Is the same as in the conventional example, step S1
Post-processing of normal communication after 60 is executed. That is, it is determined that there is no deviation in the arrangement order of the slave stations existing on the transmission path.

【0161】一方、ステップS7で不一致と判断する
と、ステップS8で初期化通信を再度実行させるため
に、メモリマップの再設定フラグをリセットするととも
に、その後の所定状態検索記憶処理の実行のために順番
フラグもリセットする。そして、ステップS8からステ
ップS164に移り、従来例で述べたように、通信ソフ
トリセットを実行して、シリアル通信処理の実行で伝送
路に接続される従局の配列順番を再度設定させるように
処理する。
On the other hand, if it is determined that they do not match in step S7, the reset flag in the memory map is reset in order to execute the initialization communication again in step S8. The flag is also reset. Then, the process proceeds from step S8 to step S164, where the communication software reset is executed as described in the conventional example, and processing is performed so that the arrangement order of the slave stations connected to the transmission path is set again by executing the serial communication processing. .

【0162】このように、本実施の形態では、所定状態
検索記憶処理で、基本となる従局の配列順番を認識して
記憶し、信号状態判断処理で、その後に実行する通信毎
に基本となる従局の配列順番を確認し、該当従局順番判
定処理で、基本となる従局の配列順番のズレを確認し、
ずれていると判定すると直ちに、実行した通信による情
報交換内容をソフトリセットして、従局の配列順番を再
び認識する初期化通信を実行させる配列順番ずれ補正自
己診断処理を行うようにしたので、何等かの原因で生じ
る伝送路に存在する従局の配列順番の狂いを、情報交換
を実行しながらにして検出するとともに、配列順番ずれ
を補正する自己診断機能をコストアップせずに、従来の
制御動作を利用して、容易に実現できる。
As described above, according to the present embodiment, the arrangement order of the base stations is recognized and stored in the predetermined state search and storage processing, and the signal state determination processing is performed for each subsequent communication. Check the arrangement order of the slave stations, and in the corresponding slave station order determination process, confirm the deviation of the arrangement order of the base slave stations,
As soon as it is determined that there is a deviation, the information exchanged by the executed communication is soft-reset, and the arrangement order deviation correction self-diagnosis processing for executing the initialization communication for re-recognizing the arrangement order of the slave stations is performed. The conventional control operation can be performed without detecting the out-of-order sequence of the slave stations existing on the transmission line while performing information exchange and without increasing the cost of the self-diagnosis function to correct the out-of-order sequence. And can be easily realized.

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

【0164】本実施の形態のシリアル通信装置は、上記
第1の実施の形態のシリアル通信装置と同様に、図1に
示す従局構成の伝送路において、基本となる従局の配列
順番のズレを確認し、ずれていると判定すると直ちに、
実行した通信による情報交換内容をソフトリセットし
て、従局の配列順番を再び認識する初期化通信を実行さ
せる配列順番ずれ補正自己診断処理を行うが、前記第1
の実施の形態では、所定状態検索記憶処理で基本となる
従局の配列順番を認識して記憶した後、信号状態判断処
理でメモリに更新された情報内容をスキャン検索し、所
定ビットがオンとなる従局の配列順番を見い出す該当従
局順番判定処理で基本となる従局の配列順番のズレを確
認するのに対して、本実施の形態では、所定状態検索記
憶処理で基本となる従局の配列順番を認識し記憶した後
に実行する通常通信において、順次返送される従局から
の情報内容を各従局毎に、所定ビットの状態を判断する
ことにより、所定ビットがオフとなる従局はオフである
か、所定ビットがオンとなる従局はオンであるかを判定
し、いずれの場合でも異なる判定であると、基本となる
従局の配列順番にズレがあると判定するようにした点が
異なっている。
In the serial communication device of the present embodiment, similar to the serial communication device of the first embodiment, a shift in the arrangement order of the basic slave stations is confirmed in the transmission line of the slave station configuration shown in FIG. As soon as it is determined to be off,
The information exchange performed by the executed communication is software-reset, and the arrangement order deviation correction self-diagnosis processing for executing the initialization communication for re-recognizing the arrangement order of the slave stations is performed.
In the first embodiment, after the sequence of the base stations is recognized and stored in the predetermined state search and storage process, the information content updated in the memory in the signal state determination process is scanned and searched, and the predetermined bit is turned on. In the present embodiment, the sequence of the base stations is determined in a predetermined order search and storage process. In the normal communication executed after storing and storing, the information contents from the slave stations sequentially returned are determined for each slave station by determining the state of a predetermined bit. Is determined to be on, and in any case, if the determinations are different, it is determined that there is a shift in the arrangement order of the base slaves.

【0165】本実施の形態でも説明を容易にするため
に、前提となる伝送路に接続される従局構成は、図1に
おける伝送路の従局のブロック図を用いることにする。
また、従来例および第1の実施例と同様な部分は同符号
で示して、その説明は省略する。
For ease of explanation in the present embodiment, too, the configuration of the slave station connected to the transmission path is based on the block diagram of the slave station of the transmission path in FIG.
The same parts as those in the conventional example and the first embodiment are denoted by the same reference numerals, and the description thereof will be omitted.

【0166】図4および図5は、本実施の形態のシリア
ル通信装置、特に主局mのCPUが実行する制御処理の
一部である通常通信処理の手順を示すフローチャートで
ある。
FIGS. 4 and 5 are flowcharts showing the procedure of the normal communication process which is a part of the control process executed by the CPU of the serial communication device of the present embodiment, particularly, the main station m.

【0167】モニタプログラムにより、前記図11のシ
リアル通信タスクが起動されると、上述したように、ス
テップS103で初期化通信による現状の通信伝送路に
接続される従局配列順番のメモリ再設定が実行される。
メモリの再設定が終了すると、初期化通信後の初めての
通常通信がステップS108で実行される。このときの
通常通信では、第1の実施の形態と同様に、順番フラグ
はリセットのままであるため、ステップS142からス
テップS159、そしてステップS21からステップS
143へ従来例で述べたように、メモリに従局から返送
される情報内容を格納し、ステップS150でシフト転
送の終了判断をすると、図5のステップS11に移り所
定状態検索記憶処理を実行する。この所定状態検索記憶
処理は、第1の実施の形態と同様に、ステップS11〜
S14のループによって、メモリに格納された所定ビッ
トであるビット2の状態が、”1”(オン状態)である
従局の配列順番をスキャンして検索する。そして、ステ
ップS13でビット2がオンと判断すると、ステップS
15に移りその従局の配列順番をカウンタBに記憶保持
するとともに、基本となる従局の配列順番を認識したと
いうことで、順番フラグをセットして、ステップS16
0以降の通常通信の後処理を、従来例で述べたように実
行することで、初期化通信後の初めての通常通常手段を
終了する。
When the serial communication task shown in FIG. 11 is started by the monitor program, as described above, in step S103, the memory reset of the sequence of the slave stations connected to the current communication transmission line by the initialization communication is executed. Is done.
When the resetting of the memory is completed, the first normal communication after the initialization communication is performed in step S108. In the normal communication at this time, as in the first embodiment, the order flag remains reset, so that steps S142 to S159 and steps S21 to S159 are performed.
As described in the conventional example, the information content returned from the slave station is stored in the memory 143, and when the end of the shift transfer is determined in step S150, the process proceeds to step S11 in FIG. This predetermined state search and storage process is performed in steps S11 to S11, as in the first embodiment.
In the loop of S14, the arrangement order of the slave stations in which the state of bit 2 which is a predetermined bit stored in the memory is "1" (on state) is scanned and searched. If it is determined in step S13 that bit 2 is on, then step S13 is executed.
In step S16, the arrangement order of the slave stations is stored and held in the counter B, and since the arrangement order of the basic slave stations is recognized, the order flag is set.
By executing the post-processing of the normal communication after 0 as described in the conventional example, the first normal normal means after the initialization communication is completed.

【0168】次に、所定状態検索記憶処理でカウンタB
に記憶された、基本となる従局の配列順番を基に順番フ
ラグがセットされた後での通常通信での処理について説
明する。なお、このカウンタBの内容は、初期化通信後
の初めての通常通信で実行される所定状態検索記憶処理
にて更新されるが、それ以外では更新されずに記憶保持
される。
Next, in the predetermined state retrieval / storage processing, the counter B
The processing in the normal communication after the order flag is set based on the basic arrangement order of the slave stations stored in the base station will be described. The contents of the counter B are updated in the predetermined state search and storage process executed in the first normal communication after the initialization communication, but are not updated and stored in other cases.

【0169】本実施の形態では、従局から返送される情
報内容毎に、その従局の配列順番と所定ビットの状態を
随時チェックして、異常があると引続きの通信動作は即
キャンセルされ、それだけ早く配列順番ずれ補正自己診
断処理による従局の配列順番のリカバリーが実行され
る。通常通信処理では、従来例で述べたように、一つの
従局毎に返送情報を所定のメモリに格納しながら、全従
局の返送情報を処理する。つまり、図4のステップS1
43からステップS159までの一回の実行で一従局が
処理されて、ステップS150で全従局の処理が終了し
たと判断するまで、ステップS143からステップS1
59を繰り返し実行する。そこで、一従局毎に所定ビッ
トの状態を判定するのが本実施の形態である。
In the present embodiment, for each information content returned from the slave station, the arrangement order of the slave station and the state of a predetermined bit are checked as needed, and if there is an abnormality, the subsequent communication operation is immediately canceled, and Recovery of the arrangement order of the slave stations by the arrangement order deviation correction self-diagnosis processing is executed. In the normal communication process, as described in the conventional example, return information is processed for all slave stations while return information is stored in a predetermined memory for each slave station. That is, step S1 in FIG.
One slave station is processed by one execution from 43 to step S159, and steps S143 to S1 are performed until it is determined in step S150 that the processing of all slave stations is completed.
59 is repeatedly executed. Therefore, in the present embodiment, the state of a predetermined bit is determined for each slave station.

【0170】したがって、ステップS159を終えると
ステップS21に移って、順番フラグを判断することで
初期化通信後の初めての通常通信でないことを確認し
て、ステップS22に移る。そして、ステップS22
で、今ステップS159で格納した従局のメモリポイン
タ値と、カウンタBに記憶されたメモリポインタ値とを
比較する該当従局順番判定処理で該当従局か否かを判定
する。カウンタBに登録される従局以外の従局は、ここ
で該当従局でないためにステップS24に移って、信号
状態判断処理で所定ビットがオフであることを判断す
る。また、カウンタBに登録される従局のときは、ここ
で該当従局であるためにステップS23に移り、信号状
態判断処理で所定ビットがオンであることを判断する。
Therefore, after step S159 is completed, the process proceeds to step S21, where it is determined that the communication is not the first normal communication after the initialization communication by judging the order flag, and then the process proceeds to step S22. Then, step S22
Then, in the pertinent station order judging process for comparing the memory pointer value of the subordinate station stored in step S159 with the memory pointer value stored in the counter B, it is determined whether or not it is the pertinent substation. Since the slave stations other than the slave stations registered in the counter B are not the corresponding slave stations, the process proceeds to step S24, and the signal state determination processing determines that the predetermined bit is off. If the slave station is registered in the counter B, the process proceeds to step S23 because it is the slave station, and it is determined in the signal state determination processing that the predetermined bit is on.

【0171】このステップS23およびS24では、所
定ビットがオフであるべき従局はオフであって、所定ビ
ットがオンであるべき従局はオンであることを判断し、
問題ないときには、ステップS143に戻って次の従局
に対して同様に返送情報のメモリへの格納、所定ビット
チェックが実行され、全従局が終了するまで繰り返され
る。
In steps S23 and S24, it is determined that the slave station whose predetermined bit is to be off is off and the slave station whose predetermined bit is to be on is on.
If there is no problem, the process returns to step S143, where the return information is similarly stored in the memory and the predetermined bit check is executed for the next slave station, and the process is repeated until all slave stations are completed.

【0172】一方、このステップS23およびS24
で、所定ビットがオフであるべき従局がオンであったと
き、または、所定ビットがオンであるべき従局はオフで
あると判断すると伝送路の従局の配列順番に狂いが発生
したと判断し、即、ステップS25で順番フラグをリセ
ットするとともに、初期化通信の実行を指示し、図5の
ステップS164で通信ソフトリセットを実行してタス
クを一旦終了する。つまり、通常通信の実行中であって
も、従局の配列順番に異常があると判断すれば、通信を
中断して、できるだけ早く初期化通信を実行させて、従
局の配列順番の再度の設定を実行させることができる。
On the other hand, steps S23 and S24
In the case where the slave whose predetermined bit is to be off is on, or when it is determined that the slave whose predetermined bit is to be on is off, it is determined that the arrangement order of the slaves in the transmission path has been out of order, Immediately, the order flag is reset in step S25, the execution of the initialization communication is instructed, and the communication software reset is executed in step S164 in FIG. 5 to temporarily end the task. In other words, if it is determined that there is an abnormality in the arrangement order of the slave stations even during normal communication, the communication is interrupted, the initialization communication is executed as soon as possible, and the arrangement order of the slave stations is set again. Can be executed.

【0173】このように、本実施の形態では、所定状態
検索記憶処理で所定ビットがオンとなる基本の従局の配
列順番をメモリから検索して記憶させて、次の通常通信
の実行以降、該当従局順番判定処理で入力される返送情
報を従局毎に随時、該当従局であるかを判断して、その
結果に対応する所定ビットの信号状態かを信号状態判断
処理で判断することで、従局の配列順番のズレを確認
し、従局の配列順番にズレがあると判定すると通信動作
を即時中断して初期化通信の実行に切り換えることで、
従局の配列順番の再度の設定を実行させるので、配列順
番ずれを補正する自己診断機能をコストアップせずに、
従来の制御動作を利用して容易に構成できるとともに、
本シリアル通信装置のような、通信形態における情報交
換の信頼性をさらに高めることができる。
As described above, in the present embodiment, the arrangement order of the basic slave stations whose predetermined bits are turned on in the predetermined state search and storage processing is searched from the memory and stored, and after execution of the next normal communication, The return information input in the slave station order determination process is determined for each slave station at any time to determine whether or not the slave station is the corresponding slave station, and the signal state of a predetermined bit corresponding to the result is determined by the signal state determination process. By confirming the deviation of the arrangement order, if it is determined that there is a deviation in the arrangement order of the slave stations, by immediately interrupting the communication operation and switching to the execution of the initialization communication,
Since the setting of the arrangement order of the slave stations is executed again, without increasing the cost of the self-diagnosis function for correcting the arrangement order deviation,
It can be easily configured using conventional control operations,
The reliability of information exchange in a communication mode such as the present serial communication device can be further improved.

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

【0175】この場合、記憶媒体から読出されたプログ
ラムコード自体が本発明の新規な機能を実現することに
なり、そのプログラムコードを記憶した記憶媒体は本発
明を構成することになる。
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.

【0176】プログラムコードを供給するための記憶媒
体としては、たとえば、フロッピーディスク、ハードデ
ィスク、光ディスク、光磁気ディスク、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.

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

【0178】さらに、記憶媒体から読出されたプログラ
ムコードが、コンピュータに挿入された機能拡張ボード
やコンピュータに接続された機能拡張ユニットに備わる
メモリに書込まれた後、そのプログラムコードの指示に
基づき、その機能拡張ボードや機能拡張ユニットに備わ
るCPUなどが実際の処理の一部または全部を行い、そ
の処理によって上述した実施の形態の機能が実現される
場合も含まれることは言うまでもない。
Further, after the program code read from the storage medium is written into the memory provided in the function expansion board inserted into the computer or the function expansion unit connected to the computer, the program code is read based on the instruction 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.

【0179】[0179]

【発明の効果】以上説明したように、請求項1,6また
は11に記載の発明によれば、第1の従局と第2の従局
に分類された伝送路上に存在する複数の従局のうち、前
記第1の従局に対しては、主局へ転送される情報中、予
め設定された少なくとも1つ以上のビットが第1の固定
値に設定され、前記第2の従局に対しては、前記ビット
が前記第1の固定値とは状態の異なる第2の固定値に設
定され、記憶手段に記憶された前記主局へ転送された情
報中前記ビットに設定された固定値の状態と、その配列
順番とを比較することにより、両者間にずれが生じてい
るか否かが判定され、判定の結果、ずれが生じていると
きには、初期化通信による処理が再度実行されるので、
たとえば、ユーザが何らかの事情で電子機器本体の電源
を切らずに一つの従局を本体から外し、そのまま機器本
体の動作を継続させたときでも、従局の配列順番が狂っ
たことを認識せずにシリアル通信を実行して誤動作を誘
発することはなく、直ちに従局の配列順番を自動的に再
設定し、その後の機器本体の動作に支障を与えないシリ
アル通信を行うことができ、したがって、このような形
態の電子機器における情報交換の信頼をさらに向上させ
ることができる。
As described above, according to the first, sixth or eleventh aspect, of the plurality of slave stations existing on the transmission path classified into the first slave station and the second slave station, For the first slave station, at least one or more bits set in advance in the information transferred to the master station are set to a first fixed value, and for the second slave station, The bit is set to a second fixed value having a state different from the first fixed value, and the state of the fixed value set to the bit in the information transferred to the master station stored in the storage means, By comparing the arrangement order, it is determined whether or not a shift has occurred between the two. As a result of the determination, when a shift has occurred, the process by the initialization communication is executed again,
For example, even if the user disconnects one slave from the main unit without turning off the power of the electronic device for some reason and continues operation of the device itself, the serial number is not recognized even if the arrangement order of the slaves is out of order. It does not cause a malfunction by executing communication, and can immediately reset the arrangement order of the slave stations immediately and perform serial communication that does not hinder the subsequent operation of the device main body. The reliability of information exchange in the electronic device of the embodiment can be further improved.

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

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

【図2】図1のシリアル通信装置、特に主局のCPUが
実行する制御処理の一部である通常通信処理の手順を示
すフローチャートである。
FIG. 2 is a flowchart illustrating a procedure of a normal communication process which is a part of a control process executed by a CPU of a serial communication device of FIG. 1, in particular, a master station.

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

【図4】本発明の第2の実施の形態に係るシリアル通信
装置、特に主局のCPUが実行する制御処理の一部であ
る通常通信処理の手順を示すフローチャートである。
FIG. 4 is a flowchart illustrating a procedure of a normal communication process which is a part of a control process executed by a CPU of a serial communication device, particularly, a master station according to a second embodiment of the present invention.

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

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

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

【図8】図6の電子機器からオプションとして設置され
る従局をいくつか省略して構成した電子機器の一例を示
すブロック図である。
FIG. 8 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. 6;

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

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

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

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

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

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

【符号の説明】[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 BB10 CC06 5B045 BB31 BB42 HH06 JJ45 5B077 NN02 5K031 AA10 BA01 CB06 CB09 DA02 DA16 EA07 EC01 5K034 AA05 CC06 DD02 DD04 EE05 HH01 HH02 HH08 HH09 HH11 HH14 HH17 HH26 LL01 LL03 MM01 MM03 MM39 NN26 RR01 TT01 TT02 Continuation of the front page F term (reference) 5B021 AA01 BB10 CC06 5B045 BB31 BB42 HH06 JJ45 5B077 NN02 5K031 AA10 BA01 CB06 CB09 DA02 DA16 EA07 EC01 5K034 AA05 CC06 DD02 DD04 EE05 HH01 HH02HHH HMM HHH HMM HHH TT01 TT02

Claims (15)

【特許請求の範囲】[Claims] 【請求項1】 一つの主局および複数の従局をループ状
に接続する伝送路と、 前記複数の従局の前記伝送路上の配列順番を記憶する記
憶手段と、 前記主局の要求に応じて前記各従局がそれぞれ前記伝送
路を介してシリアル返送する識別子情報に基づいて、前
記伝送路上に現在配列されている従局の配列順番を前記
記憶手段に再設定する初期化通信手段と、 該初期化通信手段によって再設定された従局の配列順番
に基づき、前記伝送路を介して、前記主局から前記各従
局へ情報をシリアル転送するとともに、前記各従局から
前記主局へ情報をシリアル転送し、該主局へシリアル転
送された情報を前記記憶手段の当該従局に対応する位置
に記憶する通常通信手段と、 第1の従局と第2の従局に分類された前記伝送路上に存
在する複数の従局のうち、前記第1の従局に対しては、
前記主局へ転送される情報中、予め設定された少なくと
も1つ以上のビットを第1の固定値に設定し、前記第2
の従局に対しては、前記ビットを前記第1の固定値とは
状態の異なる第2の固定値に設定する設定手段と、 前記記憶手段に記憶された前記主局へ転送された情報中
前記ビットに設定された固定値の状態と、その配列順番
とを比較することにより、両者間にずれが生じているか
否かを判定する判定手段と、 該判定の結果、ずれが生じているときには、前記初期化
通信手段による処理を再度実行させるように制御する制
御手段とを有することを特徴とするシリアル通信装置。
A transmission line for connecting one master station and a plurality of slave stations in a loop; a storage unit for storing an arrangement order of the plurality of slave stations on the transmission line; Initialization communication means for resetting the arrangement order of the slave stations currently arranged on the transmission path in the storage means based on the identifier information which each slave station serially returns via the transmission path; and Based on the arrangement order of the slave stations reset by the means, the information is serially transferred from the master station to each slave station via the transmission line, and the information is serially transferred from each slave station to the master station. Normal communication means for storing information serially transferred to the master station at a position corresponding to the slave station in the storage means; and a plurality of slave stations existing on the transmission line classified into a first slave station and a second slave station. U , For the first slave station,
In the information transferred to the master station, at least one bit set in advance is set to a first fixed value;
Setting means for setting the bit to a second fixed value having a state different from the first fixed value; and in the information transferred to the master station stored in the storage means, Determining means for comparing the state of the fixed value set in the bit with the arrangement order thereof to determine whether or not there is a deviation between the two; Control means for controlling the processing by the initialization communication means to be executed again.
【請求項2】 前記第1の従局の個数は、前記第2の従
局の個数に比較して極めて少なく選択されることを特徴
とする請求項1に記載のシリアル通信装置。
2. The serial communication device according to claim 1, wherein the number of said first slave stations is selected to be extremely smaller than the number of said second slave stations.
【請求項3】 前記判定手段は、前記記憶手段に記憶さ
れた前記主局へ転送された情報中、前記第1の固定値が
設定された情報と、その配列順番とを比較することを特
徴とする請求項2に記載のシリアル通信装置。
3. The information processing apparatus according to claim 2, wherein the determination unit compares the information, in which the first fixed value is set, in the information transferred to the master station stored in the storage unit with an arrangement order thereof. The serial communication device according to claim 2, wherein
【請求項4】 前記判定手段は、前記通常通信手段によ
る処理が前記複数の従局すべてに対して1通り終了した
後に、ずれ判定を行うことを特徴とする請求項1から3
のいずれかに記載のシリアル通信装置。
4. The apparatus according to claim 1, wherein said determination means performs a shift determination after the processing by said normal communication means has been completed once for all of said plurality of slave stations.
The serial communication device according to any one of the above.
【請求項5】 前記判定手段は、前記通常通信手段によ
る処理が前記複数の従局のそれぞれに対して終了する度
に、ずれ判定を行うことを特徴とする請求項1から3の
いずれかに記載のシリアル通信装置。
5. The apparatus according to claim 1, wherein the determination unit performs a shift determination each time the processing by the normal communication unit ends for each of the plurality of slave stations. Serial communication device.
【請求項6】 一つの主局および複数の従局をループ状
に接続する伝送路と、前記複数の従局の前記伝送路上の
配列順番を記憶する記憶手段とを備えた電子機器におけ
るシリアル通信方法であって、 前記主局の要求に応じて前記各従局がそれぞれ前記伝送
路を介してシリアル返送する識別子情報に基づいて、前
記伝送路上に現在配列されている従局の配列順番を前記
記憶手段に再設定する初期化通信工程と、 該初期化通信工程によって再設定された従局の配列順番
に基づき、前記伝送路を介して、前記主局から前記各従
局へ情報をシリアル転送するとともに、前記各従局から
前記主局へ情報をシリアル転送し、該主局へシリアル転
送された情報を前記記憶手段の当該従局に対応する位置
に記憶する通常通信工程と、 第1の従局と第2の従局に分類された前記伝送路上に存
在する複数の従局のうち、前記第1の従局に対しては、
前記主局へ転送される情報中、予め設定された少なくと
も1つ以上のビットを第1の固定値に設定し、前記第2
の従局に対しては、前記ビットを前記第1の固定値とは
状態の異なる第2の固定値に設定する設定工程と、 前記記憶手段に記憶された前記主局へ転送された情報中
前記ビットに設定された固定値の状態と、その配列順番
とを比較することにより、両者間にずれが生じているか
否かを判定する判定工程と、 該判定の結果、ずれが生じているときには、前記初期化
通信工程による処理を再度実行させるように制御する制
御工程とを有することを特徴とするシリアル通信方法。
6. A serial communication method in an electronic device, comprising: a transmission line connecting one master station and a plurality of slave stations in a loop; and storage means for storing an arrangement order of the plurality of slave stations on the transmission line. In response to the request from the master station, the arrangement order of the slave stations currently arranged on the transmission path is re-stored in the storage means based on the identifier information that each of the slave stations serially returns via the transmission path. An initialization communication step to set, and, based on the arrangement order of the slave stations reset by the initialization communication step, serially transfer information from the master station to the slave stations via the transmission path, and A normal communication step of serially transferring information from the first station to the master station, and storing the information serially transferred to the master station at a position corresponding to the slave station in the storage means; and a first slave station and a second slave station. Of the plurality of slave stations present on the classified transmission path, for the first slave station,
In the information transferred to the master station, at least one bit set in advance is set to a first fixed value;
A setting step of setting the bit to a second fixed value having a state different from the first fixed value; and setting the bit in the information stored in the storage means and transferred to the master station. A determination step of comparing the state of the fixed value set in the bit with the arrangement order thereof to determine whether or not there is a shift between the two; and, as a result of the determination, when there is a shift, A control step of controlling the initialization communication step to execute the processing again.
【請求項7】 前記第1の従局の個数は、前記第2の従
局の個数に比較して極めて少なく選択されることを特徴
とする請求項6に記載のシリアル通信方法。
7. The serial communication method according to claim 6, wherein the number of said first slave stations is selected to be extremely smaller than the number of said second slave stations.
【請求項8】 前記判定工程では、前記記憶手段に記憶
された前記主局へ転送された情報中、前記第1の固定値
が設定された情報と、その配列順番とを比較することを
特徴とする請求項7に記載のシリアル通信方法。
8. The information processing apparatus according to claim 1, wherein, in the information transferred to the master station stored in the storage unit, the information in which the first fixed value is set is compared with the arrangement order thereof. The serial communication method according to claim 7, wherein
【請求項9】 前記判定工程では、前記通常通信工程に
よる処理が前記複数の従局すべてに対して1通り終了し
た後に、ずれ判定を行うことを特徴とする請求項6〜8
のいずれかに記載のシリアル通信方法。
9. The method according to claim 6, wherein, in the determining step, a shift determination is performed after the processing in the normal communication step has been completed for all of the plurality of slave stations.
The serial communication method according to any one of the above.
【請求項10】 前記判定工程では、前記通常通信工程
による処理が前記複数の従局のそれぞれに対して終了す
る度に、ずれ判定を行うことを特徴とする請求項6〜8
のいずれかに記載のシリアル通信方法。
10. The method according to claim 6, wherein in the determining step, each time the processing in the normal communication step is completed for each of the plurality of slave stations, a shift determination is performed.
The serial communication method according to any one of the above.
【請求項11】 一つの主局および複数の従局をループ
状に接続する伝送路と、前記複数の従局の前記伝送路上
の配列順番を記憶する記憶手段とを備えた電子機器にお
けるシリアル通信モジュールを含む、コンピュータが実
現できるプログラムを格納した記憶媒体であって、 前記シリアル通信モジュールは、 前記主局の要求に応じて前記各従局がそれぞれ前記伝送
路を介してシリアル返送する識別子情報に基づいて、前
記伝送路上に現在配列されている従局の配列順番を前記
記憶手段に再設定する初期化通信モジュールと、 該初期化通信モジュールによって再設定された従局の配
列順番に基づき、前記伝送路を介して、前記主局から前
記各従局へ情報をシリアル転送するとともに、前記各従
局から前記主局へ情報をシリアル転送し、該主局へシリ
アル転送された情報を前記記憶手段の当該従局に対応す
る位置に記憶する通常通信モジュールと、 第1の従局と第2の従局に分類された前記伝送路上に存
在する複数の従局のうち、前記第1の従局に対しては、
前記主局へ転送される情報中、予め設定された少なくと
も1つ以上のビットを第1の固定値に設定し、前記第2
の従局に対しては、前記ビットを前記第1の固定値とは
状態の異なる第2の固定値に設定する設定モジュール
と、 前記記憶手段に記憶された前記主局へ転送された情報中
前記ビットに設定された固定値の状態と、その配列順番
とを比較することにより、両者間にずれが生じているか
否かを判定する判定モジュールと、 該判定の結果、ずれが生じているときには、前記初期化
通信モジュールによる処理を再度実行させるように制御
する制御モジュールとを有することを特徴とする記憶媒
体。
11. A serial communication module in an electronic device, comprising: a transmission line for connecting one master station and a plurality of slave stations in a loop; and storage means for storing an arrangement order of the plurality of slave stations on the transmission line. A storage medium storing a program that can be realized by a computer, wherein the serial communication module is based on identifier information that each of the slave stations serially returns via the transmission path in response to a request from the master station. An initialization communication module for resetting the arrangement order of the slave stations currently arranged on the transmission path in the storage unit; and, based on the arrangement order of the slave stations reset by the initialization communication module, via the transmission path. Serially transferring information from the master station to the slave stations, serially transferring information from the slave stations to the master station, A normal communication module for storing serially transferred information at a position corresponding to the slave station in the storage means; and a plurality of slave stations existing on the transmission path classified into a first slave station and a second slave station. For the first slave,
In the information transferred to the master station, at least one bit set in advance is set to a first fixed value;
A setting module for setting the bit to a second fixed value having a state different from the first fixed value, and the information transferred to the master station stored in the storage means. A determination module that determines whether or not there is a difference between the two by comparing the state of the fixed value set in the bit and the arrangement order thereof, and when the result of the determination indicates that there is a difference, A control module for controlling the initialization communication module to execute the processing again.
【請求項12】 前記第1の従局の個数は、前記第2の
従局の個数に比較して極めて少なく選択されることを特
徴とする請求項11に記載の記憶媒体。
12. The storage medium according to claim 11, wherein the number of said first slave stations is selected to be extremely smaller than the number of said second slave stations.
【請求項13】 前記判定モジュールでは、前記記憶手
段に記憶された前記主局へ転送された情報中、前記第1
の固定値が設定された情報と、その配列順番とを比較す
ることを特徴とする請求項7に記載の記憶媒体。
13. The information processing apparatus according to claim 1, wherein the information transferred to the master station stored in the storage means is the first one.
8. The storage medium according to claim 7, wherein the information in which the fixed value is set is compared with the arrangement order.
【請求項14】 前記判定モジュールでは、前記通常通
信モジュールによる処理が前記複数の従局すべてに対し
て1通り終了した後に、ずれ判定を行うことを特徴とす
る請求項11〜13のいずれかに記載の記憶媒体。
14. The apparatus according to claim 11, wherein the determination module performs a shift determination after the normal communication module completes one process for all of the plurality of slave stations. Storage media.
【請求項15】 前記判定モジュールでは、前記通常通
信モジュールによる処理が前記複数の従局のそれぞれに
対して終了する度に、ずれ判定を行うことを特徴とする
請求項11〜13のいずれかに記載の記憶媒体。
15. The apparatus according to claim 11, wherein the determination module performs a shift determination each time the processing by the normal communication module ends for each of the plurality of slave stations. Storage media.
JP11184988A 1999-06-30 1999-06-30 Serial communication device and serial communication method, and storage medium Withdrawn JP2001014287A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11184988A JP2001014287A (en) 1999-06-30 1999-06-30 Serial communication device and serial communication method, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11184988A JP2001014287A (en) 1999-06-30 1999-06-30 Serial communication device and serial communication method, and storage medium

Publications (1)

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

Family

ID=16162840

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11184988A Withdrawn JP2001014287A (en) 1999-06-30 1999-06-30 Serial communication device and serial communication method, and storage medium

Country Status (1)

Country Link
JP (1) JP2001014287A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8387775B2 (en) 2008-09-05 2013-03-05 Diamond Automations, Inc. Egg handling system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8387775B2 (en) 2008-09-05 2013-03-05 Diamond Automations, Inc. Egg handling system

Similar Documents

Publication Publication Date Title
EP0256463B1 (en) Improved token passing network
KR100239973B1 (en) Method of structuring messages for exchanging data and/or for synchronizing processes in a data processing system
EP0282628B1 (en) Dual path bus structure for computer interconnection
US5077732A (en) LAN with dynamically selectable multiple operational capabilities
EP0409539B1 (en) Frame routing method for communication networks
CN106557446B (en) Bus system
CN104932997B (en) A kind of monobus communication means and system
JP3310006B2 (en) Computer system
CN103189834A (en) Method, apparatus and system for determining drive
US7428686B2 (en) Error detection/correction system, and controller using this system
US5699504A (en) Multiprocessor system formed of a plurality of duplex processors
CN100571255C (en) Processing node address fault in distributed nodal system of processors
JP2001014287A (en) Serial communication device and serial communication method, and storage medium
AU600408B2 (en) Network management
CN110495157B (en) Communication system for serial communication between communication devices
JP2001016297A (en) Serial communication equipment, serial communication method and storage medium
US5867705A (en) Device control apparatus and method of controlling parallel execution of device-control instructions to devices of a system
JP5490101B2 (en) Method and apparatus for correcting information transmitted in digital form
JP6762546B1 (en) Serial communication method and serial communication system
JP2000293395A (en) Serial communication equipment, its abnormality detecting method and recording medium
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
JP2003140704A (en) Process controller
US20210006429A1 (en) Identification number numbering method and multipoint communication system
JPH0799516B2 (en) Multiple control method for computer controller

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