JPH07183935A - Method and device for synchronous transmission and reception - Google Patents
Method and device for synchronous transmission and receptionInfo
- Publication number
- JPH07183935A JPH07183935A JP5323874A JP32387493A JPH07183935A JP H07183935 A JPH07183935 A JP H07183935A JP 5323874 A JP5323874 A JP 5323874A JP 32387493 A JP32387493 A JP 32387493A JP H07183935 A JPH07183935 A JP H07183935A
- Authority
- JP
- Japan
- Prior art keywords
- data
- station
- transmission
- slave 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
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 165
- 238000000034 method Methods 0.000 title claims description 26
- 230000001360 synchronised effect Effects 0.000 title claims description 26
- 230000008054 signal transmission Effects 0.000 claims 2
- 238000012545 processing Methods 0.000 abstract description 35
- 238000004891 communication Methods 0.000 abstract description 23
- 238000012546 transfer Methods 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 10
- 230000000694 effects Effects 0.000 description 3
- 238000012790 confirmation Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
Landscapes
- Communication Control (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、主局は従局に対してコ
マンドとデータとを能動的に送信し、従局は主局から要
求されてデータを主局へ受動的に送信する、同期型送受
信方法およびその装置に関するものである。BACKGROUND OF THE INVENTION The present invention relates to a synchronous type in which a master station actively transmits commands and data to slave stations, and slave stations passively transmit data to master stations when requested by the master station. The present invention relates to a transmission / reception method and an apparatus thereof.
【0002】[0002]
【従来の技術】従来、主局から従局への伝送に用いられ
る第1の伝送路と、従局から主局への伝送に用いられる
第2の伝送路と、クロック信号の伝送に用いられるクロ
ック伝送路とにより接続されて成り、主局は従局に対し
てコマンドとデータとを能動的に送信するものであり、
従局は主局から要求されてデータを主局へ受動的に送信
するものである同期型送受信装置にあっては、主局はソ
フトウェアであるところの主局送受信処理プログラムを
備えている。2. Description of the Related Art Conventionally, a first transmission line used for transmission from a master station to a slave station, a second transmission line used for transmission from a slave station to a master station, and a clock transmission used for transmission of a clock signal. The master station actively transmits commands and data to the slave stations.
In a synchronous transmission / reception device in which a slave station passively transmits data to the master station when requested by the master station, the master station includes a master station transmission / reception processing program which is software.
【0003】この主局の備える主局送受信処理プログラ
ムは、主局が従局へデータを送信する場合に実行される
主局送信処理プログラムと、主局が従局からデータを受
信する場合に実行される主局受信処理プログラムとを含
んで構成されている。しかも、この主局送信処理プログ
ラムと主局受信処理プログラムとは、それぞれ独立した
別個のプログラムとされている。The master station transmission / reception processing program provided in this master station is executed when the master station transmits data to the slave station and when the master station receives data from the slave station. The main station reception processing program is included. Moreover, the main station transmission processing program and the main station reception processing program are independent and independent programs.
【0004】図6は上述のような主局送受信処理プログ
ラムを示すフローチャートである。図6のフローチャー
トを用いて、主局と従局との送受信処理手順を説明する
と次のように成る。すなわち、主局が従局に対して通信
を始めようとすると、主局はステップ100を実行し
て、従局に対してデータを送信するのか、あるいは、従
局からデータを受信するのかの選択を要求する。FIG. 6 is a flowchart showing the main station transmission / reception processing program as described above. The transmission / reception processing procedure between the master station and the slave stations will be described below with reference to the flowchart of FIG. That is, when the master station tries to start communication with the slave station, the master station executes step 100 and requests the slave station to select whether to transmit data or receive data from the slave station. .
【0005】このとき主局が従局に対して送信すること
を望むのであれば、主局はステップ200を実行して、
主局の送信レジスタにコマンド(「これからデータを送
りますから受け取って下さい」と言うような従局に対す
る命令であり通常8ビットで構成される)を格納する。
その後、主局は、ステップ201を実行してクロック伝
送路を介して単位クロック信号を主局のクロック送信ポ
ートから従局のクロック受信ポートへ出力すると共に、
ステップ202を実行して第1の伝送路を介してコマン
ドの第1ビットを主局の送信ポートから従局の受信ポー
トへ出力する。At this time, if the master station wants to transmit to the slave station, the master station executes step 200,
A command (an instruction for a slave station, such as "Please send data, please receive it", which is usually composed of 8 bits) is stored in the transmission register of the master station.
After that, the master station executes step 201 to output the unit clock signal from the clock transmission port of the master station to the clock reception port of the slave station via the clock transmission path, and
Step 202 is executed to output the first bit of the command from the transmission port of the master station to the reception port of the slave station via the first transmission line.
【0006】その後、主局は、ステップ203を実行し
てコマンドの全ビットを送信し終えたか否かを判断し、
コマンドの全ビットを送信し終えていなければ繰り返し
ステップ201,202,203を実行し、コマンドの
第2ビット、コマンドの第3ビット、…………と言うよ
うにコマンドの全ビットを送信し終えると、ステップ2
04を実行する。Thereafter, the master station executes step 203 to judge whether or not all the bits of the command have been transmitted,
If all the bits of the command have not been transmitted, the steps 201, 202, and 203 are repeatedly executed, and the transmission of all the bits of the command is completed, such as the second bit of the command, the third bit of the command, .... And step 2
Execute 04.
【0007】ステップ204を実行する主局は、従局へ
送信するデータを送信レジスタに格納する。その後、主
局は、ステップ205を実行してクロック伝送路を介し
て単位クロック信号を主局のクロック送信ポートから従
局のクロック受信ポートへ出力すると共に、ステップ2
06を実行して第1の伝送路を介してデータの第1ビッ
トを主局の送信ポートから従局の受信ポートへ出力す
る。The master station executing step 204 stores the data to be transmitted to the slave stations in the transmission register. After that, the master station executes step 205 to output the unit clock signal from the clock transmission port of the master station to the clock reception port of the slave station via the clock transmission path, and at the same time, to execute step 2
Step 06 is executed to output the first bit of the data from the transmission port of the master station to the reception port of the slave station via the first transmission line.
【0008】その後、主局は、ステップ207を実行し
てデータの全ビットを送信し終えたか否かを判断し、デ
ータの全ビットを送信し終えていなければ繰り返しステ
ップ205,206,207を実行し、データの第2ビ
ット、データの第3ビット、…………と言うようにデー
タの全ビットを送信し終える。このようにして、主局
は、従局へデータを送信する目的を果たす。After that, the main station executes step 207 to determine whether or not all the bits of the data have been transmitted. If the transmission of all the bits of the data has not been completed, the main station repeatedly executes steps 205, 206 and 207. Then, the second bit of data, the third bit of data, ... In this way, the master station serves the purpose of transmitting data to the slave stations.
【0009】ところで、主局が従局からデータを受信す
ることを望むのであれば、主局はステップ100を実行
した後、ステップ300を実行して、主局の送信レジス
タにコマンド(「これこれのデータを送って下さい」と
言うような従局に対する命令であり通常8ビットで構成
される)を格納する。その後、主局は、ステップ301
を実行してクロック伝送路を介して単位クロック信号を
主局のクロック送信ポートから従局のクロック受信ポー
トへ出力すると共に、ステップ302を実行して第1の
伝送路を介してコマンドの第1ビットを主局の送信ポー
トから従局の受信ポートへ出力する。By the way, if the master station wants to receive data from the slave station, the master station performs step 100 and then step 300 to send a command ("this data Command, which normally consists of 8 bits). After that, the main station proceeds to step 301
To output the unit clock signal from the clock transmission port of the master station to the clock reception port of the slave station via the clock transmission line, and execute step 302 to execute the first bit of the command via the first transmission line. Is output from the transmission port of the master station to the reception port of the slave station.
【0010】その後、主局は、ステップ303を実行し
てコマンドの全ビットを送信し終えたか否かを判断し、
コマンドの全ビットを送信し終えていなければ繰り返し
ステップ301,302,303を実行し、コマンドの
第2ビット、コマンドの第3ビット、…………と言うよ
うにコマンドの全ビットを送信し終えると、ステップ3
04を実行する。Thereafter, the master station executes step 303 to judge whether or not all the bits of the command have been transmitted,
If all the bits of the command have not been transmitted, the steps 301, 302, 303 are repeatedly executed, and the transmission of all the bits of the command is finished, such as the second bit of the command, the third bit of the command, .... And step 3
Execute 04.
【0011】ステップ304を実行する主局は、クロッ
ク伝送路を介して単位クロック信号を主局のクロック送
信ポートから従局のクロック受信ポートへ出力すると共
に、ステップ305を実行して第2の伝送路を介して従
局の送信ポートから主局の受信ポートへ送信されるデー
タの第1ビットを受信して主局の受信レジスタに格納す
る。The master station executing step 304 outputs the unit clock signal from the clock transmitting port of the master station to the clock receiving port of the slave station via the clock transmission path, and executes step 305 to execute the second transmission path. The first bit of the data transmitted from the transmission port of the slave station to the reception port of the master station via is received and stored in the reception register of the master station.
【0012】その後、主局は、ステップ306を実行し
てデータの全ビットを受信し終えたか否かを判断し、デ
ータの全ビットを受信し終えていなければ繰り返しステ
ップ304,305,306を実行し、データの第2ビ
ット、データの第3ビット、…………と言うようにデー
タの全ビットを受信し終える。このようにして、主局
は、従局から所定のデータを読み出して受信する目的を
果たす。After that, the main station executes step 306 to judge whether or not all the bits of the data have been received. If all the bits of the data have not been received, the main station repeatedly executes steps 304, 305 and 306. Then, the second bit of data, the third bit of data, ... In this way, the master station serves the purpose of reading and receiving predetermined data from the slave stations.
【0013】すなわち、上述の説明から理解できるよう
に、主局送信処理プログラム(ステップ200〜20
7)と主局受信処理プログラム(ステップ300〜30
6)とは、それぞれ独立した別個のプログラムとされて
いる。That is, as can be understood from the above description, the main station transmission processing program (steps 200 to 20)
7) and main station reception processing program (steps 300 to 30)
6) is a separate program that is independent of each other.
【0014】図7は主局の送信ポートと主局の受信ポー
トとの動作のタイミングを示す説明図であり、図7
(a)は主局が従局にデータを送信する場合を示し、図
7(b)は主局が従局からデータを受信する場合を示し
ている。図7からは、主局が従局にデータを送信する場
合と、主局が従局からデータを受信する場合とでは、主
局の送信ポートと主局の受信ポートとの動作の仕方の異
なることが理解できる。すなわち、主局が従局にデータ
を送信する図7(a)の場合は、主局の送信ポートはコ
マンドに対してもデータに対しても動作し、主局の受信
ポートはコマンドに対してもデータに対しても動作しな
い。しかし、主局が従局からデータを受信する図7
(b)の場合は、主局の送信ポートはコマンドに対して
は動作するもののデータに対しては動作せず、主局の受
信ポートはコマンドに対しては動作しないもののデータ
に対しては動作するのである。FIG. 7 is an explanatory diagram showing the operation timings of the transmission port of the main station and the reception port of the main station.
7A shows a case where the master station transmits data to the slave station, and FIG. 7B shows a case where the master station receives data from the slave station. It can be seen from FIG. 7 that the operation modes of the transmission port of the master station and the reception port of the master station are different when the master station transmits data to the slave station and when the master station receives data from the slave station. It can be understood. That is, in the case of FIG. 7A in which the master station transmits data to the slave station, the master station transmission port operates for both commands and data, and the master station reception port for commands. It also does not work on data. However, the master station receives data from the slave stations.
In the case of (b), the transmission port of the main station operates for commands but does not operate for data, and the reception port of the main station does not operate for commands but operates for data. To do.
【0015】図8は通信処理時間を示す説明図である。
図8は、通信処理時間tは、コマンド格納時間(ステッ
プ200またはステップ300の処理時間)t1 と、コ
マンド送信時間(ステップ201〜ステップ203を脱
出するまでの処理時間またはステップ301〜ステップ
303を脱出するまでの処理時間)t2 と、データ格納
時間(ステップ204の処理時間)t3 と、データ送信
時間またはデータ受信時間(ステップ205〜ステップ
207を脱出するまでの処理時間またはステップ304
〜ステップ306を脱出するまでの処理時間)t4 とを
それぞれ加算したものであることを示している。また、
図8は、通信を開始する以前に、送信受信選択時間(ス
テップ100の処理時間)t0 が必要であることを現し
ている。FIG. 8 is an explanatory diagram showing the communication processing time.
In FIG. 8, the communication processing time t is the command storage time (processing time of Step 200 or Step 300) t 1 and the command transmission time (processing time until exiting Step 201 to Step 203 or Step 301 to Step 303). processing time) t 2 until escape, data storage time (processing time) t 3 in step 204, the data transmission time or a data reception time (step 205 to process time to escape step 207 or step 304
~ Processing time until exiting step 306) t 4 is added respectively. Also,
FIG. 8 shows that the transmission / reception selection time (processing time of step 100) t 0 is required before communication is started.
【0016】[0016]
【発明が解決しようとする課題】従って、従来の同期型
送受信装置の主局送受信処理プログラムにあっては、そ
れぞれ独立した別個のプログラムである主局送信処理プ
ログラムと主局受信処理プログラムとから構成されてい
るので、プログラムのためのメモリ容量が大きく成って
しまうと共に、主局が従局に対して通信を始めようとし
た場合に、従局に対してデータを送信するのか、あるい
は、従局からデータを受信するのかの選択を要求する必
要があるので該選択のための処理時間分だけ通信速度が
遅くなると言う問題点があった。Therefore, the main station transmission / reception processing program of the conventional synchronous transmission / reception device is composed of a main station transmission processing program and a main station reception processing program which are independent programs. As a result, the memory capacity for the program becomes large, and when the master station tries to start communication with the slave station, data is transmitted to the slave station or data is transmitted from the slave station. Since it is necessary to request selection of whether to receive, there is a problem that the communication speed becomes slower by the processing time for the selection.
【0017】本発明は、上記の問題点を解決するために
成されたもので、その目的とするところは、通信処理プ
ログラムのためのメモリ容量を少なくできると共に通信
速度を速くすることのできる優れた同期型送受信方法お
よびその装置を提供することにある。The present invention has been made to solve the above problems, and an object of the present invention is to reduce the memory capacity for a communication processing program and to increase the communication speed. Another object is to provide a synchronous transmission / reception method and its device.
【0018】[0018]
【課題を解決するための手段】本発明は上記の問題点を
解決するため、請求項1記載の発明にあっては、主局と
従局とは、主局から従局への伝送に用いられる第1の伝
送路と、従局から主局への伝送に用いられる第2の伝送
路と、クロック信号の伝送に用いられるクロック伝送路
とにより接続され、前記主局は従局に対してコマンドと
データとを能動的に送信し、前記従局は主局から要求さ
れてデータを主局へ受動的に送信する同期型送受信方法
において、主局は、従局に対してデータを送信するとき
にあっても、従局からデータを受信するときにあって
も、データ授受時にあっては、前記クロック信号に同期
して従局へのデータの送信と従局からのデータの受信と
を対にして実行するようにしたことを特徴とする。SUMMARY OF THE INVENTION In order to solve the above problems, the present invention provides a master station and a slave station which are used for transmission from the master station to the slave station. One transmission line, a second transmission line used for transmission from the slave station to the master station, and a clock transmission line used for transmission of a clock signal are connected, and the master station sends commands and data to the slave station. In a synchronous transmission / reception method in which the slave station passively transmits data to the master station when requested by the master station, the master station, even when transmitting data to the slave station, Even when receiving data from a slave station, at the time of data transfer, the transmission of data to the slave station and the reception of data from the slave station are performed in pairs in synchronization with the clock signal. Is characterized by.
【0019】請求項2記載の発明にあっては、主局と従
局とは、主局から従局への伝送に用いられる第1の伝送
路と、従局から主局への伝送に用いられる第2の伝送路
と、クロック信号の伝送に用いられるクロック伝送路と
により接続され、前記主局は従局に対してコマンドとデ
ータとを能動的に送信するものであり、前記従局は主局
から要求されてデータを主局へ受動的に送信するもので
ある同期型送受信装置において、主局は、従局に対して
データを送信するときにあっても、従局からデータを受
信するときにあっても、データ授受時にあっては、前記
クロック信号に同期して従局へのデータの送信と従局か
らのデータの受信とを対にして実行する、データ授受手
段を備えていることを特徴とする。According to another aspect of the invention, the master station and the slave station have a first transmission path used for transmission from the master station to the slave station and a second transmission path used for transmission from the slave station to the master station. Connected by a clock transmission line used for transmitting a clock signal, the master station actively transmits commands and data to the slave stations, and the slave stations are requested by the master station. In a synchronous transmission / reception device that passively transmits data to the master station, the master station, even when transmitting data to the slave station, when receiving data from the slave station, At the time of data transmission / reception, the data transmission / reception means is provided for performing transmission of data to the slave station and reception of data from the slave station as a pair in synchronization with the clock signal.
【0020】[0020]
【作用】以上のように、請求項1記載の発明にあって
は、主局は、従局に対してデータを送信するときにあっ
ても、従局からデータを受信するときにあっても、とに
かくデータの授受時にあっては、クロック信号に同期し
て従局へのデータの送信と従局からのデータの受信とを
対にして実行する方法である。従って、主局が従局へデ
ータを送信する場合の送信処理手順と主局が従局からデ
ータを受信する場合の受信処理手順とは、それぞれ独立
した別個のプログラムとする必要は無く、共通にするこ
とができる。また、主局が通信を始める場合にデータの
送信をするのかあるいはデータの受信をするのかの確認
を行って、該確認結果に応じて実行するプログラムを切
り替える必要が無いのである。As described above, according to the first aspect of the present invention, the master station does not matter whether the master station transmits data to the slave station or receives data from the slave station. At the time of data transmission / reception, it is a method in which data transmission to a slave station and data reception from a slave station are performed as a pair in synchronization with a clock signal. Therefore, the transmission processing procedure when the master station transmits data to the slave station and the reception processing procedure when the master station receives data from the slave station do not have to be independent programs, but should be common. You can Further, it is not necessary to confirm whether to transmit data or receive data when the main station starts communication and to switch the program to be executed according to the confirmation result.
【0021】また、請求項2記載の発明にあっては、主
局は、従局に対してデータを送信するときにあっても、
従局からデータを受信するときにあっても、データ授受
時にあっては、前記クロック信号に同期して従局へのデ
ータの送信と従局からのデータの受信とを対にして実行
するデータ授受手段を備えたものである。従って、請求
項1記載の発明と同様の作用を有するのである。Further, in the invention according to the second aspect, even when the master station transmits data to the slave station,
Even when receiving data from a slave station, at the time of data transfer, a data transfer means for performing paired data transmission to the slave station and reception of data from the slave station in synchronization with the clock signal is provided. Be prepared. Therefore, it has the same effect as the invention according to claim 1.
【0022】[0022]
【実施例】以下、本発明に係る同期型送受信方法および
その装置の一実施例を、図1〜図5に基づいて詳細に説
明する。図1は同期型送受信装置を示すブロック図で有
る。図2は主局のデータ授受手段を説明するフローチャ
ートである。図3は従局の動作を説明するフローチャー
トである。図4は主局の送信ポートと主局の受信ポート
との動作のタイミングを示す説明図であり、図4(a)
は主局が従局にデータを送信する場合を示し、図4
(b)は主局が従局からデータを受信する場合を示して
いる。図5は同期型送受信装置の通信処理時間を示す説
明図である。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the synchronous transmission / reception method and apparatus according to the present invention will be described in detail below with reference to FIGS. FIG. 1 is a block diagram showing a synchronous transmission / reception device. FIG. 2 is a flow chart for explaining the data transfer means of the main station. FIG. 3 is a flow chart for explaining the operation of the slave station. FIG. 4 is an explanatory diagram showing operation timings of the transmission port of the main station and the reception port of the main station, and FIG.
Shows the case where the master station transmits data to the slave station.
(B) shows the case where the master station receives data from the slave station. FIG. 5 is an explanatory diagram showing the communication processing time of the synchronous transmission / reception device.
【0023】図1に示すように、同期型送受信装置は主
局Aと従局Bとを備えている。主局Aは、送信レジスタ
A1 と受信レジスタA2 と制御部A3 とクロック発生部
A4と備えている。従局Bは、送信レジスタB1 と受信
レジスタB2 と制御部B3 とを備えている。また、主局
Aと従局Bとは第1の伝送路L1 と第2の伝送路L2と
クロック伝送路L3 とで接続されている。第1の伝送路
L1 は主局Aの送信ポートAT と従局Bの受信ポートB
R とを接続している。第2の伝送路L2 は主局Aの受信
ポートAR と従局Bの送信ポートBT とを接続してい
る。クロック伝送路L3 は主局Aのクロック送信ポート
AC と従局Bのクロック受信ポートBC とを接続してい
る。As shown in FIG. 1, the synchronous transmission / reception apparatus includes a master station A and a slave station B. The main station A includes a transmission register A 1 , a reception register A 2 , a control unit A 3, and a clock generation unit A 4 . The slave station B includes a transmission register B 1 , a reception register B 2, and a control unit B 3 . The master station A and the slave station B are connected by a first transmission line L 1 , a second transmission line L 2, and a clock transmission line L 3 . The first transmission line L 1 is a transmission port AT of the master station A and a reception port B of the slave station B.
It is connected to R. The second transmission line L 2 connects the reception port A R of the master station A and the transmission port B T of the slave station B. The clock transmission line L 3 connects the clock transmission port A C of the master station A and the clock reception port B C of the slave station B.
【0024】送信レジスタA1 は、主局Aがこれから従
局Bに対して送信する直前のコマンドあるいはデータを
1ビットづつ、1バイト単位で格納するシフトレジスタ
部分である。受信レジスタA2 は、主局Aが従局Bから
受信したデータを1ビットづつ、1バイト単位で格納す
るシフトレジスタ部分である。制御部A3 は、クロック
発生部A4 からのクロック信号で動作しており、送信レ
ジスタA1 や受信レジスタA2 を制御している。The transmission register A 1 is a shift register portion for storing the command or the data immediately before the master station A transmits to the slave station B bit by bit in units of 1 byte. The reception register A 2 is a shift register portion that stores the data received by the master station A from the slave station B bit by bit in 1-byte units. The control unit A 3 operates with the clock signal from the clock generation unit A 4 , and controls the transmission register A 1 and the reception register A 2 .
【0025】送信レジスタB1 は、主局Aが従局Bに対
してデータ要求コマンドを送信した場合に、従局Bが主
局Aに対してこれから送信する直前のデータを1ビット
づつ、1バイト単位で格納するシフトレジスタ部分であ
る。受信レジスタB2 は、主局Aが従局Bに対してデー
タ送信コマンドを送信した場合に、従局Bが主局Aから
受信したデータを1ビットづつ、1バイト単位で格納す
るシフトレジスタ部分である。制御部B3 は、クロック
伝送路L3 を介してクロック発生部A4 から出力される
クロック信号で動作しており、送信レジスタB1 や受信
レジスタB2 を制御している。When the master station A transmits a data request command to the slave station B, the transmission register B 1 stores the data immediately before the slave station B transmits to the master station A bit by bit, byte by byte. This is the shift register part to store in. The reception register B 2 is a shift register portion that stores the data received by the slave station B from the master station A bit by bit when the master station A sends a data transmission command to the slave station B in 1-byte units. . The control unit B 3 is operated by the clock signal output from the clock generation unit A 4 via the clock transmission line L 3 , and controls the transmission register B 1 and the reception register B 2 .
【0026】上述のように構成されている同期型送受信
装置にあっては、主局Aは従局Bと次のようにデータの
授受を行う。すなわち、図2に示すように、主局Aは、
従局Bに対してデータを送信する場合であれ、従局Bに
対してデータを要求する場合であれ、先ずステップ50
0を実行して制御部A3 により、送信レジスタA1 にコ
マンドを格納する。該送信レジスタA1 に格納されるコ
マンドは、従局Bに対してデータを送信する場合であれ
ば、データ送信コマンド(「これからデータを送ります
から受け取って下さい」)とされ、従局Bに対してデー
タを要求する場合であれば、データ要求コマンド(「こ
れこれのデータを送って下さい」)とされる。In the synchronous transmitter / receiver configured as described above, the master station A exchanges data with the slave station B as follows. That is, as shown in FIG.
Whether transmitting data to the slave station B or requesting data from the slave station B, first, step 50
0 is executed and the control unit A 3 stores the command in the transmission register A 1 . The command stored in the transmission register A 1 is a data transmission command ("I will send data from now on, please receive it") when transmitting data to the subordinate station B. When requesting data, a data request command ("send this data") is issued.
【0027】ステップ500を実行した主局Aは、次に
ステップ501を実行して、クロック伝送路L3 を介し
て単位クロック信号を従局Bの制御部B3 へ出力すると
共に、ステップ502を実行して第1の伝送路L1 を介
してコマンドの第1ビットを主局Aの送信ポートAT か
ら従局Bの受信ポートBR へ出力する。After executing step 500, the master station A then executes step 501 to output the unit clock signal to the control unit B 3 of the slave station B via the clock transmission line L 3 and also executes step 502. the first through the transmission line L 1 outputs the first bit of the command from the sending port a T of the main station a to the reception port B R of the slave station B to.
【0028】その後、主局Aは、ステップ503を実行
して、制御部A3 により、ステップ500で送信レジス
タA1 に格納したコマンドの全ビットを送信し終えたか
否かを判断し、コマンドの全ビットを送信し終えていな
ければ繰り返しステップ501,502,503を実行
し、コマンドの第2ビット、コマンドの第3ビット、…
………と言うようにコマンドの全ビットを送信し終える
と、ステップ504を実行する。Thereafter, the main station A executes step 503, and the control section A 3 judges whether or not all the bits of the command stored in the transmission register A 1 in step 500 have been transmitted, and the command If all bits have not been transmitted, steps 501, 502, and 503 are repeatedly executed, and the second bit of the command, the third bit of the command, ...
When all the bits of the command have been transmitted as in the case of "...", step 504 is executed.
【0029】ステップ504を実行する主局Aは、制御
部A3 により、従局Bへ送信するデータを送信レジスタ
A1 に格納する。このとき、ステップ500で送信レジ
スタA1 に格納されたコマンドがデータ送信コマンドで
あれば、ステップ504で送信レジスタA1 に格納され
るデータは本データであるものの、ステップ500で送
信レジスタA1 に格納されたコマンドがデータ要求コマ
ンドであれば、ステップ504で送信レジスタA1 に格
納されるデータは無効データ(ダミーデータ)である。The master station A which executes step 504 stores the data to be transmitted to the slave station B in the transmission register A 1 by the control section A 3 . At this time, if the commands data transmission command stored in the transmission register A 1 in step 500, although data stored in the transmission register A 1 in step 504 is present data, the transmission register A 1 in step 500 If the stored command is a data request command, the data stored in the transmission register A 1 in step 504 is invalid data (dummy data).
【0030】その後、主局Aは、ステップ505を実行
して、クロック伝送路L3 を介して単位クロック信号を
主局Aのクロック送信ポートAC から従局Bの制御部B
3 へ出力すると共に、主局Aはステップ506を実行し
て制御部A3 により、ステップ504で送信レジスタA
1 に格納したデータの第1ビットを、第1の伝送路L 1
を介して主局Aの送信ポートAT から従局Bの受信ポー
トBR へ出力する。また同時に、主局Aはステップ50
7を実行して制御部A3 により、従局Bが送信ポートB
T から主局Aの受信ポートAR に出力するデータを受信
して受信レジスタA2 に格納する。このとき、ステップ
500で送信レジスタA1 に格納されたコマンドがデー
タ送信コマンドであれば、主局Aがステップ507で受
信するデータは無効データ(ダミーデータ)であるもの
の、ステップ500で送信レジスタA1 に格納されたコ
マンドがデータ要求コマンドであれば、主局Aがステッ
プ507で受信するデータは本データである。Thereafter, the master station A executes step 505.
Then, the clock transmission line L3A unit clock signal via
Clock transmission port A of main station ACTo control unit B of slave station B
3The master station A executes step 506
Control unit A3Thus, in step 504, the transmission register A
1The first bit of the data stored in the first transmission line L 1
Transmission port A of main station A viaTFrom slave station B reception port
To BROutput to. At the same time, the main station A makes a step 50
7 to execute the control unit A3Causes slave station B to send port B
TTo reception port A of main station ARReceive data to output to
And receive register A2To store. At this time, step
Send register A at 5001The commands stored in
If it is a data transmission command, master station A receives it in step 507.
The received data is invalid data (dummy data)
In step 500, the transmission register A1Stored in
If the command is a data request command, master station A
The data received in step 507 is this data.
【0031】その後、主局Aは、ステップ508を実行
して、制御部A3 により、ステップ504で送信レジス
タA1 に格納したデータの全ビットを送信し終えたか否
かを判断し、データの全ビットを送信し終えていなけれ
ば繰り返しステップ505,506,507を実行し、
データの第2ビット、データの第3ビット、…………と
言うようにデータの全ビットを送信し終える。Thereafter, the main station A executes step 508, and the control section A 3 judges whether or not all the bits of the data stored in the transmission register A 1 in step 504 have been transmitted, and If all bits have not been transmitted, steps 505, 506 and 507 are repeatedly executed,
The second bit of data, the third bit of data, and so on ...
【0032】このようにして、主局Aは、従局Bに対し
てデータを送信する目的あるいは従局Bからデータを受
信する目的を果たす。しかも、主局Aは、従局Bに対し
てデータを送信する場合にあっても、従局Bからデータ
を読み出して受信する場合にあっても、本データと無効
データとの違いはあるものの、ソフトウェアであるとこ
ろの主局送信プログラムと主局受信プログラムとを共通
にできる。In this way, the master station A serves the purpose of transmitting data to the slave station B or the purpose of receiving data from the slave station B. Moreover, although the master station A transmits data to the slave station B or reads and receives data from the slave station B, there is a difference between this data and invalid data The main station transmission program and the main station reception program can be commonly used.
【0033】すなわち、主局送受信プログラムは図2に
示すフローチャートのように一本化することができ、主
局が従局へデータを送信する場合の送信処理手順と主局
が従局からデータを受信する場合の受信処理手順とは、
それぞれ独立した別個のプログラムとする必要は無く共
通にすることができる。従って、ソフトウェアである主
局送受信プログラムのためのメモリ容量は少なくて済
む。また、主局Aが通信を始める場合にデータの送信を
するのかあるいはデータの受信をするのかの確認を行っ
て、該確認結果に応じて実行するプログラムを切り替え
る必要も無いので、通信処理速度を速めることができる
のである。That is, the master station transmission / reception program can be unified as shown in the flow chart of FIG. 2, and the transmission processing procedure when the master station transmits data to the slave station and the master station receives data from the slave station. In the case of the reception processing procedure,
They do not have to be independent programs and can be shared. Therefore, the memory capacity for the main station transmission / reception program, which is software, can be small. In addition, it is not necessary to confirm whether the main station A transmits data or receives data when starting communication, and it is not necessary to switch the program to be executed according to the confirmation result. You can speed it up.
【0034】また、従局Bの主局Aとのデータ授受の仕
方を図3を用いて説明すると次のように成る。すなわ
ち、図3に示すように、従局Bはステップ600を実行
して主局Aからのクロック信号の有無を監視している。
従局Bは、クロック信号を受信するとステップ601を
実行し、主局Aが送信するコマンドの1ビットを受信し
て受信レジスタB2 に格納する。その後、従局Bは、ス
テップ602を実行し、主局Aが送信するコマンド(こ
の実施例では1バイト単位でコマンドが構成されてい
る)の全ビットを受信し終えたか否かを判断し、コマン
ドの全ビットを受信し終えていなければ繰り返しステッ
プ600,601,602を実行し、コマンドの第2ビ
ット、コマンドの第3ビット、…………と言うようにコ
マンドの全ビットを受信し終える。A method of exchanging data between the slave station B and the master station A will be described below with reference to FIG. That is, as shown in FIG. 3, the slave station B executes step 600 to monitor the presence or absence of the clock signal from the master station A.
Upon receiving the clock signal, the slave station B executes step 601 to receive 1 bit of the command transmitted by the master station A and store it in the reception register B 2 . After that, the slave station B executes step 602, judges whether or not all the bits of the command transmitted by the master station A (in this embodiment, the command is configured in 1-byte units) have been received, and the command is transmitted. If all the bits of the command have not been received, steps 600, 601, and 602 are repeatedly executed, and the reception of all the bits of the command is completed, such as the second bit of the command, the third bit of the command, ....
【0035】コマンドの全ビットを受信し終えた従局B
は、ステップ603を実行し、ステップ600,60
1,602を実行して受信したコマンドの意味を解析す
る。そして、従局Bは、ステップ604を実行し、コマ
ンドの意味が、データ送信コマンド(「これからデータ
を送りますから受け取って下さい」)であるのか、ある
いは、データ要求コマンド(「これこれのデータを送っ
て下さい」)であるのかを判断する。従局Bは、ステッ
プ603でのコマンド解析結果がデータ送信コマンドで
あればステップ700に進み、ステップ603でのコマ
ンド解析結果がデータ要求コマンドであればステップ8
00に進む。Slave station B which has received all the bits of the command
Performs step 603 and steps 600, 60
1, 602 is executed to analyze the meaning of the received command. Then, the slave station B executes step 604, and whether the command means a data transmission command ("I will send data, please receive it.") Or a data request command ("Please send this data." Please "). The slave station B proceeds to step 700 if the command analysis result in step 603 is a data transmission command, and proceeds to step 8 if the command analysis result in step 603 is a data request command.
Go to 00.
【0036】ステップ700に進んだ従局Bは、主局A
からのクロック信号の有無を監視しており、クロック信
号を受信するとステップ701を実行し、主局Aが送信
するデータの1ビットを受信して受信レジスタB2 に格
納する。その後、従局Bは、ステップ702を実行し、
主局Aが送信するデータ(この実施例では1バイト単位
でデータが構成されている)の全ビットを受信し終えた
か否かを判断し、コマンドの全ビットを受信し終えてい
なければ繰り返しステップ700,701,702を実
行し、データの第2ビット、データの第3ビット、……
……と言うようにデータの全ビットを受信し終える。そ
の後、従局Bは、データの全ビットを受信し終えるとス
テップ703を実行して、受信したデータに基づいた処
理を行った後に、再びステップ600に進み同様の処理
を繰り返す。The slave station B which has proceeded to step 700 is the master station A.
The presence / absence of the clock signal is monitored. When the clock signal is received, step 701 is executed, and 1 bit of the data transmitted by the main station A is received and stored in the reception register B 2 . Thereafter, the slave station B executes step 702,
It is judged whether or not all the bits of the data transmitted by the main station A (in this embodiment, the data is configured in 1-byte units) have been received, and if all the bits of the command have not been received, a repeating step is performed. 700, 701, 702 are executed, the second bit of data, the third bit of data, ...
Finish receiving all the bits of the data. After that, when the slave station B finishes receiving all the bits of the data, it executes step 703 to perform the processing based on the received data, and then proceeds to step 600 again and repeats the same processing.
【0037】また、ステップ800に進んだ従局Bは、
ステップ603でのコマンド解析結果に基づいて主局A
の所望しているところの返信のためのデータを作成し、
該データを送信レジスタB1 に格納する。すると、従局
Bは、ステップ801に進み、主局Aからのクロック信
号の有無を監視しており、クロック信号を受信するとス
テップ802を実行し、ステップ800で送信レジスタ
B1 に格納したデータの1ビットを送信ポートBT から
送信する。その後、従局Bは、ステップ803を実行
し、従局Bが主局Aから要求された送信すべきデータを
全て送信し終えたか否かを判断し、送信すべきデータの
送信が完了していないのであれば、送信すべきデータの
送信が完了するまでステップ800,801,802,
803を繰り返し実行し、最終的にステップ600に進
み同様の処理を繰り返す。The slave station B which has proceeded to step 800 is
Based on the command analysis result in step 603, master station A
Create data for replying where you want,
The data is stored in the transmission register B 1 . Then, the slave station B proceeds to step 801 and monitors the presence or absence of a clock signal from the master station A. When the clock signal is received, the slave station B executes step 802, and sets 1 of the data stored in the transmission register B 1 at step 800. Transmit bits from transmit port B T. After that, the slave station B executes step 803, determines whether the slave station B has transmitted all the data to be transmitted requested by the master station A, and the transmission of the data to be transmitted is not completed. If so, steps 800, 801, 802 until the transmission of the data to be transmitted is completed.
803 is repeatedly executed, and finally the process proceeds to step 600 to repeat the same processing.
【0038】上述の説明からも明らかなように、上述の
ように構成される同期型送受信装置は、図4に示すよう
に、主局Aが従局Bにデータを送信する場合と、主局A
が従局Bからデータを受信する場合とでは、主局Aの送
信ポートAT と受信ポートA R との動作の仕方が同じで
あることが理解できる。すなわち、主局Aが従局Bにデ
ータを送信する図4(a)の場合は、主局Aの送信ポー
トAT はコマンドに対してもデータに対しても動作し、
主局Aの受信ポートAR は、データは無効データではあ
るが、コマンドに対しては動作しないもののデータに対
しては動作する。また同様に、主局Aが従局Bからデー
タを受信する図4(b)の場合は、主局Aの送信ポート
AT は、データは無効データではあるが、コマンドに対
してもデータに対しても動作し、主局Aの受信ポートA
R は、コマンドに対しては動作しないもののデータに対
しては動作するのである。As is apparent from the above description, the above
The synchronous transmitter / receiver configured as shown in FIG.
When the master station A transmits data to the slave station B,
When the master station A receives data from the slave station B.
Shin Port ATAnd receiving port A RThe same way of operation with
I understand that there is. That is, master station A
In the case of FIG. 4 (a) for transmitting data, the transmission port of the main station A is
To ATWorks for commands and data,
Reception port A of main station ARData is invalid data
However, although it does not work for commands,
Then it works. Similarly, master station A receives data from slave station B
In the case of FIG. 4B for receiving the data, the transmission port of the main station A
ATData is invalid data, but
However, it also operates on data, and reception port A of main station A
RDoes not work for commands but
Then it works.
【0039】また、上述のように構成される同期型送受
信装置の通信処理時間は図5に示すように成る。すなわ
ち、通信処理時間tは、コマンド格納時間(ステップ5
00の処理時間)t1 と、コマンド送信時間(ステップ
501〜ステップ503を脱出するまでの処理時間)t
2 と、データ格納時間(ステップ504の処理時間)t
3 と、データ送信時間またはデータ受信時間(ステップ
505〜ステップ508を脱出するまでの処理時間)t
4 とをそれぞれ加算した時間に成る。しかも、主局A
は、図2に示すフローチャートに従った通信処理手順を
常に繰り返し実行しているので、従来の同期型送受信装
置のような図8に示した送信受信選択時間(ステップ1
00の処理時間)t0 は不要と成り、この処理時間t0
を短縮でき、通信処理速度を速くできる。The communication processing time of the synchronous transmission / reception apparatus configured as described above is as shown in FIG. That is, the communication processing time t is the command storage time (step 5
00 processing time) t 1 and command transmission time (processing time until exiting from step 501 to step 503) t
2 and data storage time (processing time of step 504) t
3 and data transmission time or data reception time (processing time until the process exits from step 505 to step 508) t
This is the time when 4 and 4 are added together. Moreover, the main station A
Always repeats the communication processing procedure according to the flowchart shown in FIG. 2, so that the transmission / reception selection time (step 1) shown in FIG.
00 processing time) t 0 becomes unnecessary, and this processing time t 0
Can be shortened and the communication processing speed can be increased.
【0040】[0040]
【発明の効果】本発明の同期型送受信方法およびその装
置は上述のような方法およびものであり、請求項1記載
の発明にあっては、主局が従局へデータを送信する場合
の送信処理手順と、主局が従局からデータを受信する場
合の受信処理手順とは共通にすることができるので、通
信処理プログラムのためのメモリ容量を少なくできると
共に通信速度を速くすることのできる優れた同期型送受
信方法が提供できると言う効果を奏し、請求項2記載の
発明にあっては、主局が従局へデータを送信する場合の
送信処理手順と、主局が従局からデータを受信する場合
の受信処理手順とは共通にすることができるので、通信
処理プログラムのためのメモリ容量を少なくできると共
に通信速度を速くすることのできる優れた同期型送受信
装置が提供できると言う効果を奏する。The synchronous transmission / reception method and apparatus of the present invention are the above-mentioned method and apparatus. According to the invention of claim 1, a transmission process when the master station transmits data to the slave station. Since the procedure and the reception processing procedure when the master station receives data from the slave station can be made common, excellent synchronization that can reduce the memory capacity for the communication processing program and increase the communication speed In the invention according to claim 2, there is an effect that a type transmission / reception method can be provided, and a transmission processing procedure when the master station transmits data to the slave station and a transmission processing procedure when the master station receives data from the slave station Since it can be shared with the reception processing procedure, it is possible to provide an excellent synchronous transmission / reception device that can reduce the memory capacity for the communication processing program and increase the communication speed. The effect to say.
【図1】本発明に係る同期型送受信装置の一実施例を示
すブロック図である。FIG. 1 is a block diagram showing an embodiment of a synchronous transmission / reception device according to the present invention.
【図2】上記同期型送受信装置の主局のデータ授受手段
を説明するフローチャートである。FIG. 2 is a flow chart for explaining a data transfer means of a main station of the synchronous transmission / reception device.
【図3】上記同期型送受信装置の従局の動作を説明する
フローチャートである。FIG. 3 is a flowchart illustrating an operation of a slave station of the synchronous transmission / reception device.
【図4】上記同期型送受信装置の主局の送信ポートと主
局の受信ポートとの動作のタイミングを示す説明図であ
る。FIG. 4 is an explanatory diagram showing operation timings of a transmission port of a main station and a reception port of the main station of the synchronous transmission / reception device.
【図5】上記同期型送受信装置の通信処理時間を示す説
明図である。FIG. 5 is an explanatory diagram showing communication processing time of the synchronous transmission / reception device.
【図6】従来の同期型送受信装置の主局の送受信処理プ
ログラムを示すフローチャートである。FIG. 6 is a flowchart showing a transmission / reception processing program of a main station of a conventional synchronous transmission / reception device.
【図7】従来の同期型送受信装置の主局の送信ポートと
主局の受信ポートとの動作のタイミングを示す説明図で
ある。FIG. 7 is an explanatory diagram showing operation timings of a transmission port of a main station and a reception port of the main station of a conventional synchronous transmission / reception device.
【図8】従来の同期型送受信装置の通信処理時間を示す
説明図である。FIG. 8 is an explanatory diagram showing communication processing time of a conventional synchronous transmission / reception device.
A 主局 B 従局 L1 第1の伝送路 L2 第2の伝送路 L3 クロック伝送路A master station B slave station L 1 first transmission line L 2 second transmission line L 3 clock transmission line
Claims (2)
に用いられる第1の伝送路と、従局から主局への伝送に
用いられる第2の伝送路と、クロック信号の伝送に用い
られるクロック伝送路とにより接続され、前記主局は従
局に対してコマンドとデータとを能動的に送信し、前記
従局は主局から要求されてデータを主局へ受動的に送信
する同期型送受信方法において、主局は、従局に対して
データを送信するときにあっても、従局からデータを受
信するときにあっても、データ授受時にあっては、前記
クロック信号に同期して従局へのデータの送信と従局か
らのデータの受信とを対にして実行するようにしたこと
を特徴とする同期型送受信方法。1. A master station and a slave station include a first transmission path used for transmission from the master station to the slave station, a second transmission path used for transmission from the slave station to the master station, and a clock signal transmission. The master station actively transmits commands and data to the slave station, and the slave station passively transmits data to the master station when requested by the master station. In the type transmission / reception method, the master station synchronizes with the clock signal and transmits / receives data to / from the slave station regardless of whether the master station transmits data to the slave station or receives data from the slave station. A method for transmitting and receiving data to and from a slave station is performed as a pair.
に用いられる第1の伝送路と、従局から主局への伝送に
用いられる第2の伝送路と、クロック信号の伝送に用い
られるクロック伝送路とにより接続され、前記主局は従
局に対してコマンドとデータとを能動的に送信するもの
であり、前記従局は主局から要求されてデータを主局へ
受動的に送信するものである同期型送受信装置におい
て、主局は、従局に対してデータを送信するときにあっ
ても、従局からデータを受信するときにあっても、デー
タ授受時にあっては、前記クロック信号に同期して従局
へのデータの送信と従局からのデータの受信とを対にし
て実行する、データ授受手段を備えていることを特徴と
する同期型送受信装置。2. The master station and the slave station are a first transmission path used for transmission from the master station to the slave station, a second transmission path used for transmission from the slave station to the master station, and a clock signal transmission. The master station actively transmits commands and data to the slave station, and the slave station passively sends data to the master station when requested by the master station. In a synchronous transmission / reception device that transmits data, the master station transmits the data to the slave station, receives the data from the slave station, and transmits or receives the data. 1. A synchronous transmission / reception device, comprising: data transmission / reception means for performing paired transmission of data to a slave station and reception of data from a slave station in synchronization with a signal.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5323874A JPH07183935A (en) | 1993-12-22 | 1993-12-22 | Method and device for synchronous transmission and reception |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5323874A JPH07183935A (en) | 1993-12-22 | 1993-12-22 | Method and device for synchronous transmission and reception |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH07183935A true JPH07183935A (en) | 1995-07-21 |
Family
ID=18159567
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP5323874A Withdrawn JPH07183935A (en) | 1993-12-22 | 1993-12-22 | Method and device for synchronous transmission and reception |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07183935A (en) |
-
1993
- 1993-12-22 JP JP5323874A patent/JPH07183935A/en not_active Withdrawn
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH069361B2 (en) | Message transmission method | |
| JPH07183935A (en) | Method and device for synchronous transmission and reception | |
| JP2003258922A (en) | Communication device using three-step communication buffer | |
| JPS59161956A (en) | Transmission controller | |
| JPS62132444A (en) | Radio communication system provided with centralized control function | |
| JP2006304011A (en) | Interface circuit | |
| JPH0630506B2 (en) | Serial communication device | |
| JP2924135B2 (en) | Switching system circuit test method | |
| JP2821162B2 (en) | Data line termination equipment | |
| KR910000700B1 (en) | Data transmission system using sending right request signal transferred trough loop transmission path | |
| CN120498230A (en) | Frequency converter station number determining method, device and equipment based on frequency converter keyboard | |
| JPH0365702B2 (en) | ||
| JP2590773B2 (en) | Facsimile communication system | |
| JPH0741231Y2 (en) | Data transmission system | |
| JPS589620B2 (en) | Peer communication system | |
| JPH0879225A (en) | Data communication system and data communication method | |
| JPH11177654A (en) | Data transmission reception method | |
| JPH07212873A (en) | Transmission method in remote monitoring and control device | |
| JPH05336082A (en) | Detection of response data validity | |
| JPH01296743A (en) | Data communication system | |
| JPH04331996A (en) | Test system for voice storage device | |
| JPH0349446A (en) | Inter-processor communication equipment | |
| JPH0435242A (en) | Start-stop synchronization type serial communication system | |
| JPS6239577B2 (en) | ||
| JPS60117941A (en) | Data transfer system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20010306 |