JPH0541700A - Automatic detection device for communication data - Google Patents
Automatic detection device for communication dataInfo
- Publication number
- JPH0541700A JPH0541700A JP3174851A JP17485191A JPH0541700A JP H0541700 A JPH0541700 A JP H0541700A JP 3174851 A JP3174851 A JP 3174851A JP 17485191 A JP17485191 A JP 17485191A JP H0541700 A JPH0541700 A JP H0541700A
- Authority
- JP
- Japan
- Prior art keywords
- data
- parity
- personal computer
- automatic detection
- detection device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Detection And Prevention Of Errors In Transmission (AREA)
- Information Transfer Systems (AREA)
- Computer And Data Communications (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、一方の装置との間で非
同期シリアル通信が行なわれる他方の装置に設けられ
て、一方の装置からの通信データのビット長とパリテイ
を自動的に検出することのできる通信データの自動検出
装置に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is provided in another device for performing asynchronous serial communication with one device and automatically detects the bit length and parity of communication data from one device. The present invention relates to an automatic detection device for communication data that can be used.
【0002】[0002]
【従来の技術】一般に非同期のシリアル通信機能を備え
た装置どうしを接続してデータのやりとりを行なう場合
には、通信データのビット長・パリテイビット・ストッ
プビット等の設定を合致させなければならなかった。2. Description of the Related Art Generally, when devices having an asynchronous serial communication function are connected to exchange data, the bit length, parity bit, stop bit, etc. of communication data must be matched. There wasn't.
【0003】[0003]
【発明が解決しようとする課題】従来は、両装置の通信
フォーマットの設定について詳細に知っていなければ、
これらをすべて同じに設定することが困難であるという
問題点があった。Conventionally, unless one knows in detail about the communication format setting of both devices,
There is a problem that it is difficult to set them all the same.
【0004】本発明は、二つの装置間で非同期のシリア
ル通信を行なう場合、送信側の通信フォーマットを受信
側で自動的に検出できるようにすることを目的としてい
る。It is an object of the present invention to enable the receiving side to automatically detect the communication format of the transmitting side when asynchronous serial communication is performed between two devices.
【0005】[0005]
【課題を解決するための手段】本発明に係る通信データ
の自動検出装置は、一方の装置との間で非同期のシリア
ル通信が行なわれる他方の装置に設けられ、前記一方の
装置から送信されてくる偶数個の「1」を有するテスト
データ及び奇数個の「1」を有するテストデータを8ビ
ット長パリテイ無の状態で受信する受信部と、前記受信
部が受信した前記テストデータの変化の態様から送信側
のビット長とパリテイを判断する制御部とを具備してい
る。An automatic detection device for communication data according to the present invention is provided in another device which performs asynchronous serial communication with one device, and is transmitted from the one device. A receiving unit that receives an even number of test data having "1" and an odd number of test data having "1" without an 8-bit length parity, and a mode of change of the test data received by the receiving unit. From the transmitting side to a control unit for judging the bit length and the parity.
【0006】[0006]
【作用】一方の装置から、偶数個の「1」を有するテス
トデータと奇数個の「1」を有するテストデータが送信
される。これらのデータは、8ビット長パリテイ無の状
態で本装置の受信部において受信される。受信されたデ
ータの変化の態様には規則性があるので、制御部は、こ
の規則に基づいて送信側の通信データのビット長とパリ
テイを検出する。From one device, test data having an even number of "1" s and test data having an odd number of "1s" are transmitted. These data are received by the receiving unit of the present apparatus in the state where the 8-bit length is not parity. Since the variation of the received data has regularity, the control unit detects the bit length and parity of the communication data on the transmission side based on this rule.
【0007】[0007]
【実施例】図1〜図4によって一実施例を説明する。図
1において、一方の装置であるパソコンAは、他方の装
置であるプリンタBと接続されて、非同期のシリアル通
信を行なえるようになっている。EXAMPLE An example will be described with reference to FIGS. In FIG. 1, a personal computer A, which is one device, is connected to a printer B, which is the other device, so that asynchronous serial communication can be performed.
【0008】前記プリンタBは、通信データの自動検出
装置1と、プリント部2とを有している。前記自動検出
装置1は、前記パソコンAから送信されてくるシリアル
データを8ビット長・パリテイ無の状態で受信し、パラ
レルデータに変換する受信部3を有している。この受信
部3の通信フォーマットの設定は後述する制御部5から
の信号によって任意に変更することができる。The printer B has a communication data automatic detection device 1 and a printing unit 2. The automatic detection device 1 has a receiving unit 3 that receives serial data transmitted from the personal computer A in an 8-bit length / non-parity state and converts the serial data into parallel data. The setting of the communication format of the receiver 3 can be arbitrarily changed by a signal from the controller 5 described later.
【0009】前記自動検出装置1は、前記受信部3が受
信したデータを記憶する記憶部4と、該記憶部4のデー
タによって前記パソコンAからのデータのデータ長及び
パリテイを検出する制御部5とを有している。また、こ
の制御部5は、検出結果に応じて前記受信部3に通信フ
ォーマット設定信号を出力し、前記受信部3のデータ長
及びパリテイの設定を、前記パソコンAからのデータに
合致させることができるようになっている。The automatic detection device 1 stores a data received by the receiving unit 3, and a control unit 5 for detecting the data length and the parity of the data from the personal computer A based on the data in the storage unit 4. And have. Further, the control unit 5 may output a communication format setting signal to the receiving unit 3 according to the detection result, and make the data length and the parity setting of the receiving unit 3 match the data from the personal computer A. You can do it.
【0010】また、前記プリント部2は前記自動検出装
置1の制御部5に接続され、前記パソコンAからのデー
タを非同期式に印字していくことができる。Further, the printing unit 2 is connected to the control unit 5 of the automatic detection device 1 and can print data from the personal computer A asynchronously.
【0011】次に、以上の構成における作用を説明す
る。まず、パソコンAとプリンタBとの間で通信を開始
する前に、パソコンAからプリンタBへ8ビットのAS
CIIコードで2個のテストデータを送信する。これら
のテストデータは、2進法で考えた場合に「1」が偶数
個のものと、「1」が奇数個のものとする。例えば、A
SCIIコードの“5”(35H=00110101
B,1が4個)と“1”(31H=00110001
B,1が3個)をテスト信号として順次送信する。Next, the operation of the above configuration will be described. First, before starting the communication between the personal computer A and the printer B, the 8-bit AS is transferred from the personal computer A to the printer B.
Two pieces of test data are transmitted by the CII code. These test data are assumed to be an even number of "1" and an odd number of "1" when considered in the binary system. For example, A
"5" of the SCII code (35H = 00110101
B, 1 is 4) and “1” (31H = 00110001)
B and 3 are 3) are sequentially transmitted as test signals.
【0012】図2のステップ100に示すように、前記
テストデータは、それぞれ受信部3において8ビット長
・パリテイ無の状態で受信され、パラレルに変換され
る。As shown in step 100 of FIG. 2, the test data is received by the receiving unit 3 in the state of 8 bits long and without parity, and is converted into parallel data.
【0013】ステップ101に示すように、“偶数個
1”のデータと“奇数個1”のデータが記憶部4に読み
込まれる。As shown in step 101, the data of "even number 1" and the data of "odd number 1" are read into the storage unit 4.
【0014】ステップ102,103に示すように、記
憶部4に読み込まれたデータが制御部5において調べら
れ、送信されたデータのビット長とパリテイが判断され
る。即ち、送信側であるパソコンAの各設定により、受
信データの化け方には一定の規則性がある。As shown in steps 102 and 103, the data read into the storage unit 4 is examined by the control unit 5 to determine the bit length and the parity of the transmitted data. That is, there is a certain regularity in how the received data is garbled, depending on each setting of the personal computer A on the transmitting side.
【0015】図3及び図4に示すように、送信側が7ビ
ット長・パリテイ無(7N)の場合には、両方の受信デ
ータの8ビット目がそれぞれ“1”に化ける。送信側が
7ビット長・偶数パリテイ(7E)の場合には、2つの
受信データのうち、“1”が奇数個であるASCIIコ
ード1の8ビット目が“1”に化ける。送信側が7ビッ
ト長・奇数パリテイ(7O)の場合には、2つの受信デ
ータのうち、“1”が偶数個であるASCIIコード5
の8ビット目が“1”に化ける。送信側が受信側と同じ
8ビット長・パリテイ無(8N)の場合には、どちらの
受信データも正しい値で読むことができる。As shown in FIGS. 3 and 4, when the transmitting side has a 7-bit length and no parity (7N), the 8th bit of both received data can be transformed into "1". When the transmitting side has a 7-bit length and even parity (7E), the 8th bit of the ASCII code 1 in which two "1" s are odd numbers can be transformed into "1". When the transmitting side has a 7-bit length and odd parity (7O), the ASCII code 5 is an even number of "1" s out of the two received data.
The 8th bit of is garbled to "1". If the transmitting side has the same 8-bit length and no parity (8N) as the receiving side, both received data can be read with correct values.
【0016】テストデータとして送信されてくるASC
IIコードが8ビットであり、受信側が8Nで受信する
ようになっているので、図4に示すように送信側の設定
が異なれば、受信側における2つの受信データの組合せ
に同じものは生じない。従って、送信側の設定値を正し
く判断することができる。ASC transmitted as test data
Since the II code is 8 bits and the receiving side receives 8N, if the setting of the transmitting side is different as shown in FIG. 4, the same combination of two received data on the receiving side does not occur. .. Therefore, the set value on the transmission side can be correctly determined.
【0017】次に、図2のステップ104に示すよう
に、制御部5は受信部3に信号を送り、受信部3のデー
タ長及びパリテイの設定を、ステップ103で判断した
前記パソコンAからのデータに合致させる。Next, as shown in step 104 of FIG. 2, the controller 5 sends a signal to the receiver 3 to set the data length and parity of the receiver 3 from the personal computer A judged in step 103. Match the data.
【0018】次に、ステップ105に示すように、制御
部5はパソコンA側に受信準備完了の信号を送る。これ
で、パソコンAとプリンタBは正しい通信を行なうこと
ができる。また、パソコンAが通信データの設定を変更
すれば、プリンタBはこの自動検出装置によって通信フ
ォーマットを自動的に設定し直すことができる。なお、
以上の説明では装置の通信速度については言及しなかっ
たが、これは正しく設定されていなければならない。Next, as shown in step 105, the control section 5 sends a signal of reception preparation completion to the personal computer A side. With this, the personal computer A and the printer B can perform correct communication. Further, if the personal computer A changes the setting of the communication data, the printer B can automatically reset the communication format by this automatic detection device. In addition,
Although the above description did not mention the communication speed of the device, it must be set correctly.
【0019】以上説明した一実施例では、非同期のシリ
アル通信を行なう装置としてパソコンとプリンタを例示
したが、同様の自動検出装置はパソコンどうしの通信に
も適用できる。またパソコンに限らず、広く各種産業機
器どうしのデータ通信に適用できる。例えば、移動自在
のテーブルを有する工作機械に、ワークの位置決めやテ
ーブル位置の制御等のために測長装置を設けることがあ
る。従来は工作機械の制御部が出力するデータに合わせ
て、測長装置の受信フォーマットを設定していたが、本
発明の自動検出装置を測長装置に内蔵させれば、手間の
かかる設定作業が不要になり、様々な種類の工作機械等
に同一機種の測長装置を装備することが可能になる。In the above-described embodiment, the personal computer and the printer are exemplified as the device for performing the asynchronous serial communication, but the same automatic detection device can be applied to the communication between the personal computers. Further, it is not limited to a personal computer but can be widely applied to data communication between various industrial devices. For example, a machine tool having a movable table may be provided with a length measuring device for positioning a work, controlling the table position, and the like. Conventionally, the receiving format of the length measuring device was set according to the data output by the control unit of the machine tool. It becomes unnecessary, and it becomes possible to equip various types of machine tools with the same length measuring device.
【0020】[0020]
【発明の効果】本発明によれば、相手側が出力してくる
データによって通信データのビット長及びパリテイビッ
トを自動的に検出できるので、接続する相手方の設定を
詳しく知らなくとも、正しい接続を行なうことができ
る。According to the present invention, since the bit length and parity bit of communication data can be automatically detected by the data output from the other party, a correct connection can be made without knowing details of the other party to be connected. Can be done.
【図1】一実施例の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of an example.
【図2】同実施例の動作順序を示すフローチャートであ
る。FIG. 2 is a flowchart showing an operational sequence of the embodiment.
【図3】同実施例において、同じデータが送信側の設定
によって受信側で変わることを示した図である。FIG. 3 is a diagram showing that the same data changes on the receiving side according to the setting on the transmitting side in the embodiment.
【図4】同実施例において、送信側の設定値と受信側で
の受信データとの対応を示す表図である。FIG. 4 is a table showing correspondence between set values on the transmitting side and received data on the receiving side in the embodiment.
A 一方の装置としてのパソコン B 他方の装置としてのプリンタ 1 通信データの自動検出装置 3 受信部 5 制御部 A PC as one device B Printer as the other device 1 Automatic detection device for communication data 3 Receiver 5 Controller
Claims (1)
信が行なわれる他方の装置に設けられ、 前記一方の装置から送信されてくる偶数個の「1」を有
するテストデータ及び奇数個の「1」を有するテストデ
ータを8ビット長パリテイ無の状態で受信する受信部
と、 前記受信部が受信した前記テストデータの変化の態様か
ら送信側のビット長とパリテイを判断する制御部とを具
備する通信データの自動検出装置。1. A test data having an even number of "1" s and an odd number of "1s" which are provided in another device which performs asynchronous serial communication with one device and which are transmitted from the one device. And a control unit for determining the bit length and the parity of the transmission side from the change mode of the test data received by the receiving unit. Automatic detection device for communication data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3174851A JPH0541700A (en) | 1991-06-20 | 1991-06-20 | Automatic detection device for communication data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3174851A JPH0541700A (en) | 1991-06-20 | 1991-06-20 | Automatic detection device for communication data |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0541700A true JPH0541700A (en) | 1993-02-19 |
Family
ID=15985762
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP3174851A Pending JPH0541700A (en) | 1991-06-20 | 1991-06-20 | Automatic detection device for communication data |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0541700A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6026704A (en) * | 1996-08-02 | 2000-02-22 | Kabushiki Kaisha Yamada Seisakusho | Steering shaft |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0267032A (en) * | 1988-08-31 | 1990-03-07 | Nec Corp | Data transmission controller |
-
1991
- 1991-06-20 JP JP3174851A patent/JPH0541700A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0267032A (en) * | 1988-08-31 | 1990-03-07 | Nec Corp | Data transmission controller |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6026704A (en) * | 1996-08-02 | 2000-02-22 | Kabushiki Kaisha Yamada Seisakusho | Steering shaft |
US6223619B1 (en) | 1996-08-02 | 2001-05-01 | Kabushiki Kaisha Yamada Seisakusho | Steering shaft |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5654983A (en) | Method and apparatus of operating data communications equipment in command mode and autobauding | |
CA2433013A1 (en) | Apparatus and method for transmitting/receiving error detection information in a communication system | |
US5889817A (en) | Communication system with data comparison circuit | |
JPH0541700A (en) | Automatic detection device for communication data | |
JPS622744B2 (en) | ||
JPH06205073A (en) | Automatic detector for communication speed | |
JPH07264263A (en) | Serial communication interface device | |
US20020146085A1 (en) | System and method for establishing word synchronization | |
US6229866B1 (en) | Apparatus for detecting errors in asynchronous data receiver and transmitter | |
KR0167910B1 (en) | Remote data service unit controlling apparatus | |
JPH08125712A (en) | Discrimination method and discrimination device for communication parameter | |
JP3001008U (en) | Data converter | |
JPH06284121A (en) | Synchronizing word detection system | |
KR20020054388A (en) | Apparatus and method for collision detection by using parity in common data bus | |
JP3266034B2 (en) | Communication control device | |
JPH04141741A (en) | Error detection code checking system | |
JPH05191468A (en) | Data converting device | |
JPH034623A (en) | Serial data transmission system | |
JPH0637738A (en) | Data transmission error control system | |
JPH05336082A (en) | Detection of response data validity | |
JPH06236348A (en) | Data transmission system | |
JPH05241995A (en) | Serial data transmission method | |
JPH02240753A (en) | Asynchronous communication ic | |
JPH03282762A (en) | Measuring system for line processing response time | |
JPS5869147A (en) | Data transmission system |