JPH11220510A - Communication method - Google Patents

Communication method

Info

Publication number
JPH11220510A
JPH11220510A JP10032013A JP3201398A JPH11220510A JP H11220510 A JPH11220510 A JP H11220510A JP 10032013 A JP10032013 A JP 10032013A JP 3201398 A JP3201398 A JP 3201398A JP H11220510 A JPH11220510 A JP H11220510A
Authority
JP
Japan
Prior art keywords
command
character
data processing
characters
host
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP10032013A
Other languages
Japanese (ja)
Inventor
Sadahiro Yasura
定浩 安良
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.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan Ltd
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 Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP10032013A priority Critical patent/JPH11220510A/en
Publication of JPH11220510A publication Critical patent/JPH11220510A/en
Pending legal-status Critical Current

Links

Landscapes

  • Communication Control (AREA)

Abstract

PROBLEM TO BE SOLVED: To allow a host to detect correctly the state of a data processing unit, transmission of erroneous data, and missing of data or the like in such a way that the host regards the data processing unit interfaced with the host through a serial interface as a black box. SOLUTION: A command outputted from a host CPU 5 to a data processing unit 1 and a command return value outputted from the data processing unit 1 as its return value are respectively configured with characters where head and final characters are specified as specific characters and number of the characters is definite. The host CPU 5 sends the command in units of one character. The data processing unit 1 receiving the command discriminates the number of characters in the command, a command number and data ancillary to the command when the processing unit 1 detects its head character, and its final character and returns a command return value after the execution of the command if they are correct. Thus, it is possible to detect the possibility of hang-up of the data processing unit, data error, missing of characters and exception commands.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、シリアルインター
フェースを用いた通信方法に係り、特にホスト側とデー
タ処理装置側とでシリアルインターフェースを介してデ
ータ通信を行う通信方法に関するものである。
The present invention relates to a communication method using a serial interface, and more particularly to a communication method for performing data communication between a host and a data processing device via a serial interface.

【0002】[0002]

【従来の技術】ホストとデータ処理装置間のデータ通信
は、RS−232C、セントロニクス等のインターフェ
ースを介して行われている。特に、RS−232Cイン
ターフェースを用いて行われる通信は、シリアル通信方
法と呼ばれる。
2. Description of the Related Art Data communication between a host and a data processing device is performed via an interface such as RS-232C or Centronics. In particular, communication performed using the RS-232C interface is called a serial communication method.

【0003】ところで、例えば、実際に開発したプログラム
を外部からインターフェースを介して制御する場合に
は、開発したプログラムに外部からの制御信号を受信す
ると共に外部に対して信号を送信するための送受信機能
を持たせることが必要になってくる。このため、その送
受信ルーチンを新たに作成して開発したプログラムに組
み込む必要がある。
[0003] Incidentally, for example, when an actually developed program is externally controlled via an interface, a transmission / reception function for receiving an external control signal from the developed program and transmitting the signal to the outside. It is necessary to have Therefore, it is necessary to newly create the transmission / reception routine and incorporate it into the developed program.

【0004】[0004]

【発明が解決しようとする課題】例えば、汎用のパソコ
ンとソフトウエアで構成され、独立して(スタンドアロ
ーンで)動作するデータ処理装置を、ネットワークで結
ばれたオーサリングシステムに組み込んで、ホストから
シリアルインターフェースを介して制御することを考え
る。この場合、データ処理の自動化やデータ処理装置の
設置場所と異なる場所にホストを設置して操作を行う等
を考慮すると、ホスト側からはデータ処理装置をブラッ
クボックスのように扱える必要がある。すなわち、新た
に作成した送受信プログラムは、ホストとデータ処理装
置間のデータの送受信を行うだけでなく、データ処理装
置の状態や誤りデータの送信、データの欠落等を正しく
検出することが要求される。
For example, an independent (stand-alone) data processing device which is composed of a general-purpose personal computer and software and operates independently (stand-alone) is incorporated into an authoring system connected by a network, and a serial communication is performed from a host. Consider controlling via an interface. In this case, in consideration of automation of data processing, installation of a host at a location different from the location where the data processing device is installed, and the like, the host needs to be able to handle the data processing device like a black box. That is, the newly created transmission / reception program is required not only to transmit / receive data between the host and the data processing device, but also to correctly detect the state of the data processing device, transmission of erroneous data, missing data, and the like. .

【0005】そこで本発明は、上記の課題に鑑みて、シリア
ルインターフェースを用いた通信方法において、ホスト
とデータ処理装置間でエラー検出度が高く、安定したデ
ータ送受信を行うことのできる通信方法を提供すること
を目的とする。
In view of the above problems, the present invention provides a communication method using a serial interface, which has a high degree of error detection between a host and a data processing device and can perform stable data transmission and reception. The purpose is to do.

【0006】[0006]

【課題を解決するための手段】上記目的を達成するため
の手段として、請求項1の発明は、コマンドを送出する
ホストと、このコマンドを受信すると共に前記ホストに
コマンド戻り値を送出するデータ処理装置との間で前記
コマンド及び前記コマンド戻り値をシリアル送受信する
通信方法であって、前記コマンドは、前記コマンドの同
期を取るための第1の特定文字である先頭文字とこの先
頭文字とは異なる第2の特定文字でコマンドの区切りを
示す最終文字とに挟まれた領域に、コマンドナンバーと
コマンドに付随したデータとを有するあらかじめ決めら
れた文字数によって構成され、前記コマンド戻り値は、
前記コマンド戻り値の同期を取るための第1の特定文字
である先頭文字とこの先頭文字とは異なる第2の特定文
字でコマンド戻り値の区切りを示す最終文字とに挟まれ
た領域に、コマンドナンバーとコマンド認識メッセージ
または、コマンドナンバーとエラーナンバー及びエラー
メッセージを有するあらかじめ決められた文字数によっ
て構成されることを特徴としている。このように、コマ
ンド及びコマンド戻り値として使用される文字列は、2
つの特定文字によって挟まれる形になっているので、コ
マンド列を特定しやすいという利点がある。
In order to achieve the above object, the present invention provides a host for sending a command, and a data processing for receiving the command and sending a command return value to the host. A communication method for serially transmitting and receiving the command and the command return value to and from an apparatus, wherein the command is different from a first character that is a first specific character for synchronizing the command. In a region sandwiched by a second specific character and a final character indicating a command delimiter, the command return value is constituted by a predetermined number of characters having a command number and data accompanying the command,
In the area between the first character which is the first specific character for synchronizing the command return value and the last character indicating the delimiter of the command return value with the second specific character different from this first character, It is characterized by comprising a number and a command recognition message or a predetermined number of characters having a command number, an error number and an error message. Thus, the character string used as the command and the command return value is 2
Since it is sandwiched between two specific characters, there is an advantage that it is easy to specify a command sequence.

【0007】請求項2の発明は、請求項1記載の通信方法に
おいて、前記ホストから送信される前記コマンドは1文
字単位で送信され、前記データ処理装置はその回答とし
て前記ホストより送信された文字をそのまま返信する処
理を前記最終文字が送信されるまで繰り返し、前記デー
タ処理装置は前記最終文字を検出して返信した後、前記
コマンド戻り値を前記ホストに返信することを特徴とし
ている。この場合、ホストは、データ処理装置側からの
返信の有無を確認できることから、データ処理装置のハ
ングアップの可能性を検出することができ、1文字単位
で送信した文字と返信された文字の比較ができることか
ら、伝送路での文字化けエラーを検出することができ
る。
According to a second aspect of the present invention, in the communication method according to the first aspect, the command transmitted from the host is transmitted in units of one character, and the data processing device responds to the character transmitted from the host. Is repeated until the last character is transmitted, and after the data processing device detects and returns the last character, it returns the command return value to the host. In this case, since the host can confirm whether or not there is a reply from the data processing device, the host can detect the possibility of a hang-up of the data processing device, and can compare the character transmitted in units of one character with the returned character. Therefore, a garbled error in the transmission path can be detected.

【0008】請求項3の発明は、請求項2記載の通信方法に
おいて、前記データ処理装置は、前記先頭文字を受信し
た時点で前記コマンドの始まりとみなして受信した文字
のバッファ保存を開始すると同時に受信した文字数のカ
ウントを開始し、前記最終文字を受信した時点でコマン
ドの区切りとみなして文字数のカウントを終了すること
を特徴としている。この場合、検出した先頭文字が誤検
出である可能性を考慮して、先頭文字と最終文字の確認
と、先頭文字から最終文字までの文字数をカウントする
ことで、先頭文字がコマンドの先頭であるか、途中に現
れた文字であるかを判定することができる。
[0008] According to a third aspect of the present invention, in the communication method according to the second aspect, the data processing device regards the beginning of the command as a start of the command when the first character is received, and simultaneously starts buffer storage of the received character. The present invention is characterized in that counting of the number of received characters is started, and counting of the number of characters is terminated when the last character is received, which is regarded as a command delimiter. In this case, the first character is the first character of the command by checking the first character and the last character and counting the number of characters from the first character to the last character in consideration of the possibility that the detected first character is erroneously detected. It can be determined whether the character appears in the middle.

【0009】請求項4の発明は、請求項3記載の発明におい
て、前記データ処理装置が前記最終文字を受信した時
に、カウントされている文字数があらかじめ決められた
文字数と一致しない場合、または、バッファ保存された
前記コマンドのコマンドナンバー及びコマンドに付随す
るデータがあらかじめ決められた値にない場合には、コ
マンドナンバーとエラーナンバー及びエラーメッセージ
を含んだ前記コマンド戻り値を前記ホストに返信するこ
とを特徴としている。この場合、請求項2におけるエラ
ー検出をさらに進めたコマンドとしてのエラーを検出す
ることができる。そして、ホストはエラーナンバーとエ
ラーメッセージにより、どのコマンドエラーが発生した
かを知ることができる。また、このコマンド戻り値によ
り、データ処理装置のハングアップの可能性と、伝送路
での文字化けエラーを検出することができる。
According to a fourth aspect of the present invention, in the third aspect of the present invention, when the data processing device receives the last character, if the counted number of characters does not match a predetermined number of characters, or If the stored command number and data accompanying the command are not at predetermined values, the command return value including the command number, the error number, and the error message is returned to the host. And In this case, it is possible to detect an error as a command in which the error detection in claim 2 is further advanced. Then, the host can know which command error has occurred from the error number and the error message. Also, the possibility of a hang-up of the data processing device and a garbled error in the transmission path can be detected from the command return value.

【0010】請求項5の発明は、請求項3記載の通信方法に
おいて、前記データ処理装置が前記最終文字を受信した
時に、カウントされている文字数があらかじめ決められ
た文字数と一致し、かつバッファ保存された前記コマン
ドのコマンドナンバー及びコマンドに付随するデータが
あらかじめ決められた値である場合には、コマンドナン
バーとコマンド認識メッセージを含んだ前記コマンド戻
り値を前記ホストに返信することを特徴としている。こ
のことにより、ホストはデータ処理装置が送られたコマ
ンドを正しく認識したことを知ることができる。
[0010] According to a fifth aspect of the present invention, in the communication method according to the third aspect, when the data processing device receives the last character, the counted number of characters matches a predetermined number of characters, and the data is stored in a buffer. When the command number of the command and the data accompanying the command are predetermined values, the command return value including the command number and the command recognition message is returned to the host. This allows the host to know that the data processing device has correctly recognized the sent command.

【0011】[0011]

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

【0012】図1は、本発明の通信方法で実施するデータ処
理装置の一実施例を示す構成図である。
FIG. 1 is a configuration diagram showing one embodiment of a data processing device implemented by the communication method of the present invention.

【0013】同図において、データ処理装置1は、タイムコ
ード入力を受け付けるタイムコードI/F部11と、デ
ータ入力を受け付けるデータ入力I/F部12と、外部
からの操作信号(コマンド)を受け付けてコマンド戻り
値を出力するユーザーインターフェース部13と、装置
全体を制御するCPU(中央処理装置)14と、データ
を一時的に記憶するバッファを内蔵してデータ入力I/
F部12から供給される入力データの処理を行うデータ
処理部15と、このデータ処理部15により処理された
データを出力するデータ出力I/F部16とで構成さ
れ、タイムコードI/F部11に入力されるタイムコー
ドとユーザーインターフェース部13からCPU14を
介して供給されるコマンドに従って、データ入力I/F
部12から供給される入力データをデータ処理部15に
て処理する。そして、処理されたデータはデータ出力I
/F部16から外部に出力される。
In FIG. 1, a data processing device 1 includes a time code I / F unit 11 for receiving a time code input, a data input I / F unit 12 for receiving a data input, and an external operation signal (command). A user interface unit 13 for outputting a command return value, a CPU (central processing unit) 14 for controlling the entire apparatus, and a buffer for temporarily storing data.
A data processing unit 15 for processing input data supplied from the F unit 12 and a data output I / F unit 16 for outputting data processed by the data processing unit 15; Data input I / F according to a time code input to the CPU 11 and a command supplied from the user interface unit 13 via the CPU 14.
Input data supplied from the unit 12 is processed by the data processing unit 15. The processed data is output to the data output I
It is output from the / F unit 16 to the outside.

【0014】図2は、本発明の通信方法が実施されるオーサ
リングシステムの一実施例を実現するための構成図であ
る。
FIG. 2 is a configuration diagram for realizing an embodiment of an authoring system in which the communication method of the present invention is implemented.

【0015】同図において、操作コマンドを入力するための
GUI(Graphical-user-interface)2と、データ及び
タイムコードを出力するVTR4及びこのVTR4を制
御するVTRコントローラ3、オーサリングシステム全
体を制御するホストCPU(ホスト)5、図1に示した
データ処理装置1及び処理データ再生部6とからなって
いる。
In FIG. 1, a GUI (Graphical-user-interface) 2 for inputting an operation command, a VTR 4 for outputting data and time code, a VTR controller 3 for controlling the VTR 4, a host for controlling the entire authoring system It comprises a CPU (host) 5, the data processing device 1 shown in FIG.

【0016】GUI2からネットワークを介して供給される
制御パラメータ値に応じて、ホストCPU5は、VTR
コントローラ3を制御すると共にRS−232Cシリア
ルインターフェースを介してデータ処理装置1を制御す
る。そして、VTRコントローラ3はVTR4を制御し
て、データとタイムコードをデータ処理装置1に出力さ
せる。データ処理装置1では、入力されたデータに対し
てエンコードなどの処理を行って、処理データ再生部6
に出力し、デコード処理されて再生が行われる。
According to the control parameter value supplied from the GUI 2 via the network, the host CPU 5
It controls the controller 3 and the data processing device 1 via the RS-232C serial interface. Then, the VTR controller 3 controls the VTR 4 to output the data and the time code to the data processing device 1. The data processing device 1 performs processing such as encoding on the input data,
, And decoded and reproduced.

【0017】図3は、ホストがデータ処理装置に送るコマン
ドのフォーマットを示す図である。1つのコマンドは1
5文字で構成されている。そして、先頭文字として、あ
らかじめ決められた特定の文字(第1の特定文字)が用
いられ、例えば、“C”(0x43)という文字コード
が使用される。さらに、次の文字はコマンドナンバーを
表しており、コマンドのカテゴリを示すものである。カ
テゴリ内の詳細が複数存在する場合には、コマンドに付
随したデータが続き、さらにスペース文字“ ”(0x
20)を有している。そして、最終文字としてあらかじ
め決められた特定の文字(第2の特定文字)が用いら
れ、例えば、“¥n”(0x0A)が使用される。な
お、使用されるスペース文字の文字数は、コマンドナン
バーごとに決められている。また、実際には、1文字に
対して制御ビットやチェックビットが付加されたフォー
マットでシリアル通信が行われる。
FIG. 3 is a diagram showing a format of a command sent from the host to the data processing device. One command is 1
It consists of 5 characters. Then, a predetermined specific character (first specific character) is used as the first character, and for example, a character code “C” (0x43) is used. Further, the next character indicates a command number and indicates a category of the command. If there is more than one detail in the category, the data accompanying the command follows, followed by the space character "" (0x
20). Then, a predetermined specific character (second specific character) is used as the last character, for example, “$ n” (0x0A). The number of space characters used is determined for each command number. Actually, serial communication is performed in a format in which control bits and check bits are added to one character.

【0018】図4は、図3のフォーマットによって構成され
たコマンド例の一部を示す一覧図である。図中、コマン
ド欄の第1文字目の“C”は先頭文字であり、第2文字
目はカテゴリを示すコマンドナンバーである。そして、
第3文字目以降は詳細を示すコマンドに付随したデータ
であり、スペース文字” ”(0x20)と最終文字”
¥n”(0x0A)は省略して記載している。
FIG. 4 is a list showing a part of a command example constituted by the format of FIG. In the figure, the first character "C" in the command column is the first character, and the second character is a command number indicating a category. And
The third and subsequent characters are data attached to a command indicating details, and include a space character "" (0x20) and a final character "
\ N "(0x0A) is omitted.

【0019】図5は、データ処理部1がホストCPU5に送
信するコマンド戻り値のフォーマットを示す図である。
1つのコマンド戻り値のフォーマットは、図3に示した
コマンドとほぼ同じであるが、メッセージ用文字列を含
んでいるため、32文字構成となっている。そして、デ
ータ処理部1が得たコマンドに問題がある場合には、同
図(B)に示すように、メッセージ用文字列にエラーナ
ンバーとエラーメッセージが含まれることになる。ま
た、正常のコマンドとして認識した場合には、同図
(A)に示すように、メッセージ用文字列にコマンドを
受け取った旨のメッセージ(コマンド認識メッセージ)
が入る。
FIG. 5 is a diagram showing a format of a command return value transmitted from the data processing unit 1 to the host CPU 5.
The format of one command return value is almost the same as that of the command shown in FIG. 3, but has a 32-character configuration because it contains a message character string. If there is a problem with the command obtained by the data processing unit 1, the message character string contains an error number and an error message as shown in FIG. When the command is recognized as a normal command, a message indicating that the command has been received in the message character string (command recognition message), as shown in FIG.
Enters.

【0020】図6は、図5のフォーマットによって構成され
たコマンド戻り値の一部を示す図であり、同図(A)は
正常時のメッセージを示し、同図(B)はエラー検出時
のメッセージを示している。なお、同図では、メッセー
ジ用文字列だけを表記し、それ以外の部分は省略してい
る。
FIG. 6 is a diagram showing a part of a command return value constituted by the format shown in FIG. 5, wherein FIG. 6A shows a message in a normal state, and FIG. 6B shows a state when an error is detected. Indicates a message. In FIG. 2, only the message character string is shown, and other parts are omitted.

【0021】そして、正常時には、図5(A)に示すコマン
ド戻り値のフォーマットのコマンドナンバーには、ホス
トCPU5から供給されたコマンドのコマンドナンバー
がそのまま入り、コマンド認識メッセージには、図6
(A)で示すコマンド認識メッセージがそのまま入る。
また、異常発生時には、図5(B)に示すコマンド戻り
値のフォーマットのエラーナンバー及びエラーメッセー
ジには、図6(B)に示すエラーナンバー及びエラーメ
ッセージが入っている。
Under normal conditions, the command number of the command supplied from the host CPU 5 is directly entered in the command number in the format of the command return value shown in FIG.
The command recognition message shown in FIG.
When an error occurs, the error number and error message in the format of the command return value shown in FIG. 5B contain the error number and error message shown in FIG. 6B.

【0022】図7は、データ処理装置1で実行されるプログ
ラムをフローチャートで表したものである。
FIG. 7 is a flowchart showing a program executed by the data processing device 1.

【0023】同図にしたがって、データ処理装置1の動作を
説明すると、以下のようになる。まず、データ処理装置
1の電源が投入されると、シリアルインターフェースの
初期化(ステップ101)とコマンド用バッファのクリ
アが行われ(ステップ102)、ホストCPU5との接
続が行われる。そして、シリアルインターフェースを介
したデータ入力待ちになる(ステップ103)。
The operation of the data processing device 1 will be described below with reference to FIG. First, when the power of the data processing apparatus 1 is turned on, the serial interface is initialized (step 101), the command buffer is cleared (step 102), and the connection with the host CPU 5 is performed. Then, it waits for data input via the serial interface (step 103).

【0024】ここで、データ入力があると(ステップ103
→Yes)、ホストCPU5に対して得られたデータ
(1文字)を返信する(ステップ104)。そして、こ
のデータがコマンドの先頭文字である場合には(ステッ
プ105→Yes)、文字数カウンタによるカウントを
開始し、バッファにデータを蓄える(ステップ10
6)。これ以降のデータは、すべてホストCPU5に返
信すると共にバッファに蓄えるという動作を、コマンド
の最終文字が入力されるまで繰り返す(ステップ107
〜ステップ110)。なお、この時点で、入力されるデ
ータがコマンドの先頭文字でない場合には(ステップ1
05→No)、先頭文字を受信するまで受信データを読
み捨てる。
Here, if there is a data input (step 103)
→ Yes), the obtained data (one character) is returned to the host CPU 5 (step 104). If this data is the first character of the command (step 105 → Yes), counting by the character counter is started, and the data is stored in the buffer (step 10).
6). The operation of returning all subsequent data to the host CPU 5 and storing it in the buffer is repeated until the last character of the command is input (step 107).
~ Step 110). At this point, if the input data is not the first character of the command (step 1).
05 → No), the received data is read and discarded until the first character is received.

【0025】そして、コマンドの最終文字“¥n”が入力さ
れると(ステップ109→Yes)、バッファに保存す
ると共に文字数カウンタをストップし(ステップ11
1)、文字数の判定を行う(ステップ112)。ここ
で、文字数が所定の値(本実施例では15文字)でない
場合は(ステップ112→No)、ホストCPU5に対
してエラーメッセージ付きのコマンド戻り値(図5
(B)参照)を送出し(ステップ116)、再びコマン
ド先頭文字“C”が送られるのを待つ。
When the last character "$ n" of the command is input (step 109 → Yes), the command is stored in the buffer and the character number counter is stopped (step 11).
1), the number of characters is determined (step 112). Here, if the number of characters is not a predetermined value (15 characters in this embodiment) (step 112 → No), a command return value with an error message is sent to the host CPU 5 (FIG. 5).
(See (B)) (step 116), and waits until the command head character "C" is sent again.

【0026】また、文字数が正しい場合には(ステップ11
2→Yes)、バッファに保存されたコマンドのコマン
ドナンバーおよび、コマンドに付随したデータを得て
(ステップ113)、これらが図4で定義された値の範
囲内であるかを判定する(ステップ114)。そして、
コマンドナンバー及びコマンドに付随したデータが正し
い場合には(ステップ114→Yes)、コマンドを実
行後(ステップ115)、コマンドを受け取った旨のメ
ッセージ付きコマンド戻り値(図5(A)参照)を送出
する(ステップ116)。そして再び、コマンド先頭文
字が送られるのを待つ。なお、コマンドナンバー及びコ
マンドに付随したデータに問題がある場合には(ステッ
プ114→No)、ホストCPU5に対してエラーメッ
セージ付きのコマンド戻り値(図5(B)参照)を送出
し(ステップ116)、再びコマンド先頭文字“C”が
送られるのを待つ。
If the number of characters is correct (step 11)
(2 → Yes), the command number of the command stored in the buffer and the data accompanying the command are obtained (step 113), and it is determined whether or not these are within the range of values defined in FIG. 4 (step 114). ). And
If the command number and the data attached to the command are correct (step 114 → Yes), after executing the command (step 115), a command return value with a message indicating that the command has been received (see FIG. 5A) is sent. (Step 116). Then, it waits for the first character of the command to be sent again. If there is a problem with the command number and the data accompanying the command (Step 114 → No), a command return value with an error message (see FIG. 5B) is sent to the host CPU 5 (Step 116). ), And waits until the command head character "C" is sent again.

【0027】図8は、ホストCPU5側で実行されるプログ
ラムをフローチャートで表したものである。
FIG. 8 is a flowchart showing a program executed on the host CPU 5 side.

【0028】同図にしたがって、ホストCPU5の動作を説
明すると、以下のようになる。まず、ホストCPU5の
電源が投入されると、シリアルインターフェースの初期
化が行われ(ステップ201)、データ処理装置1との
接続がなされる。ホストCPU5は、データ処理装置1
との送受信がうまく行くことを確認した後(ステップ2
02)、実際のパラメータ用コマンドを送ることにな
る。
The operation of the host CPU 5 will be described below with reference to FIG. First, when the power of the host CPU 5 is turned on, the serial interface is initialized (step 201), and the connection with the data processing device 1 is established. The host CPU 5 includes the data processing device 1
After confirming that the transmission and reception with
02), an actual parameter command is sent.

【0029】ホストCPU5は図3に示したフォーマットに
従ってコマンド文字列を作成し(ステップ203)、1
文字単位で送信を行って(ステップ204)、データ処
理装置1からの返信を待つ(ステップ205)。ここ
で、データ処理装置からの返信が所定の時間を経過して
も戻ってこない場合には(ステップ205→No)、タ
イムアウトとして通信に問題があったとみなし(ステッ
プ206→Yes)、エラー表示を行って処理を停止す
る(ステップ208)。また、送信した文字と返信され
た文字とを比較して、一致しない場合にも(ステップ2
07→No)、同様にエラー表示を行って処理を停止す
る(ステップ208)。
The host CPU 5 creates a command character string according to the format shown in FIG. 3 (step 203).
The transmission is performed in units of characters (step 204), and a reply from the data processing device 1 is waited (step 205). Here, if the reply from the data processing device does not return even after the lapse of a predetermined time (step 205 → No), it is considered that there is a communication problem as a timeout (step 206 → Yes), and an error display is displayed. Then, the processing is stopped (step 208). If the transmitted character is compared with the returned character and they do not match (step 2).
07 → No), an error message is displayed, and the process is stopped (step 208).

【0030】そして、データ処理装置1から返信された文字
が送信した文字と一致している場合には(ステップ20
7→Yes)、コマンドを構成する文字をすべて送信し
たか否かを判断し(ステップ210)、すべて送信して
いない場合には(ステップ210→No)、すべて送信
し終えるまで、一文字単位での送信を継続する(ステッ
プ204〜207,210)。
If the character returned from the data processing device 1 matches the transmitted character (step 20).
7 → Yes), it is determined whether or not all the characters constituting the command have been transmitted (step 210). If not all of the characters have been transmitted (step 210 → No), until all the characters have been transmitted, it is determined in units of characters. Transmission is continued (steps 204 to 207, 210).

【0031】全ての文字を送信した後は(ステップ210→
Yes)、データ処理装置1が図5に示したフォーマッ
トのコマンド戻り値を送信してくるのを待つ(ステップ
211)。そして、受信したコマンド戻り値がエラーメ
ッセージ付きのもの(図5(B)参照)である場合には
(ステップ213→Yes)、ホストCPU5はこのエ
ラーメッセージを表示して処理を停止するか、エラーに
応じたエラーリカバリルーチンを実行しても良い(ステ
ップ208)。また、正常表示である場合には(ステッ
プ213→No)、次のコマンドを転送する動作に入る
(ステップ203)。なお、コマンド戻り値が所定の時
間を経過しても戻ってこない場合には(ステップ211
→No,ステップ212→Yes)、タイムアウトとし
てエラー表示を行い処理を停止する(ステップ20
8)。
After all characters have been transmitted (step 210 →
Yes), and waits for the data processing device 1 to transmit a command return value in the format shown in FIG. 5 (step 211). If the received command return value is one with an error message (see FIG. 5B) (step 213 → Yes), the host CPU 5 displays this error message and stops the processing or returns an error message. May be executed (step 208). If the display is normal (step 213 → No), the operation for transferring the next command is started (step 203). If the command return value does not return after a predetermined time has elapsed (step 211).
→ No, Step 212 → Yes), an error is displayed as a timeout, and the processing is stopped (Step 20).
8).

【0032】また、処理を一旦停止した後、コマンドの再送
を行いたい場合には、コマンドの最終文字はコマンドの
区切りとして使用されているため、コマンド最終文字を
最初に送ることでコマンドエラーを強制的に起こすこと
ができる(ステップ209)。なお、コマンド戻り値が
戻ってきている場合には(ステップ211→Yes)、
コマンドが区切られたことを示しているため、処理を停
止せずにそのまま再送手段(ステップ203)に入って
も良い。
If it is desired to resend the command after the processing is temporarily stopped, the last character of the command is used as a command delimiter, so that the last character of the command is sent first to force a command error. (Step 209). If the command return value is returned (step 211 → Yes),
Since this indicates that the command has been separated, the command may be entered directly into the resending means (step 203) without stopping the processing.

【0033】[0033]

【発明の効果】本発明の通信方法によれば、ホストおよ
びデータ処理装置間の通信において、ホストがデータ処
理装置側の状況をかなり確認できるため、ホストおよび
データ処理装置を含むシステムのエラー耐性を高めるこ
とができる。
According to the communication method of the present invention, in the communication between the host and the data processing device, the host can considerably check the status on the data processing device side, so that the error tolerance of the system including the host and the data processing device can be improved. Can be enhanced.

【0034】また、請求項2および請求項4に記載した通信
方法によれば、データ処理装置のハングアップの可能性
と、伝送路における文字化けエラーの検出が可能にな
る。
[0034] Further, according to the communication method described in the second and fourth aspects, the possibility of a hang-up of the data processing device and the detection of a garbled error in a transmission path can be detected.

【0035】そして、請求項4および請求項5に記載した通
信方法によれば、伝送路におけるコマンド文字列中の文
字の欠落や、例外コマンド送信時のエラー検出が可能に
なる。
[0035] According to the communication method described in claims 4 and 5, it is possible to detect a missing character in a command character string on a transmission path and an error when transmitting an exception command.

【0036】さらに、請求項3に記載した通信方法によれ
ば、コマンド文字列の誤検出をほとんど防ぐことができ
る。
[0036] Further, according to the communication method described in claim 3, erroneous detection of the command character string can be almost prevented.

【0037】そして、請求項4または請求項5に記載した通
信方法によれば、正常時またはエラー時にコメント付き
戻り値が戻るため、これをログファイルに落とすなどし
て記録しておくことにより、後のシステム検証に役立て
ることができるという効果がある。
According to the communication method described in claim 4 or claim 5, since a return value with a comment is returned in a normal state or an error state, the return value with a comment is recorded in a log file or the like. This has the effect of being useful for later system verification.

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

【図1】本発明の通信方法を実施するデータ処理装置の
一実施例を示す構成図である。
FIG. 1 is a configuration diagram showing one embodiment of a data processing device that implements a communication method of the present invention.

【図2】本発明の通信方法を実施するオーサリングシス
テムの一実施例を示す構成図である。
FIG. 2 is a configuration diagram showing one embodiment of an authoring system for implementing the communication method of the present invention.

【図3】ホストCPUが送信するコマンドのフォーマッ
ト構成を示す図である。
FIG. 3 is a diagram showing a format configuration of a command transmitted by a host CPU.

【図4】ホストCPUが送信するコマンドの一例を示す
図である。
FIG. 4 is a diagram illustrating an example of a command transmitted by a host CPU.

【図5】データ処理装置が返信するコマンド戻り値のフ
ォーマット構成を示す図である。
FIG. 5 is a diagram showing a format configuration of a command return value returned by the data processing device.

【図6】データ処理装置が返信するコマンド戻り値で使
用されるメッセージの一例を示す図である。
FIG. 6 is a diagram illustrating an example of a message used in a command return value returned by the data processing device.

【図7】データ処理装置の動作プログラムを示すフロー
チャート図である。
FIG. 7 is a flowchart illustrating an operation program of the data processing device.

【図8】ホストCPU側の動作プログラムを示すフロー
チャート図である。
FIG. 8 is a flowchart showing an operation program on the host CPU side.

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

1 データ処理装置 2 GUI 3 VTRコントローラ 4 VTR 5 ホストCPU(ホスト) 6 処理データ再生部 DESCRIPTION OF SYMBOLS 1 Data processing apparatus 2 GUI 3 VTR controller 4 VTR 5 Host CPU (host) 6 Processing data reproduction part

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】コマンドを送出するホストと、このコマン
ドを受信すると共に前記ホストにコマンド戻り値を送出
するデータ処理装置との間で前記コマンド及び前記コマ
ンド戻り値をシリアル送受信する通信方法であって、 前記コマンドは、前記コマンドの同期を取るための第1
の特定文字である先頭文字とこの先頭文字とは異なる第
2の特定文字でコマンドの区切りを示す最終文字とに挟
まれた領域に、コマンドナンバーとコマンドに付随した
データとを有するあらかじめ決められた文字数によって
構成され、 前記コマンド戻り値は、前記コマンド戻り値の同期を取
るための第1の特定文字である先頭文字とこの先頭文字
とは異なる第2の特定文字でコマンド戻り値の区切りを
示す最終文字とに挟まれた領域に、コマンドナンバーと
コマンド認識メッセージまたは、コマンドナンバーとエ
ラーナンバー及びエラーメッセージを有するあらかじめ
決められた文字数によって構成されることを特徴とする
通信方法。
1. A communication method for serially transmitting and receiving said command and said command return value between a host transmitting said command and a data processing device receiving said command and transmitting a command return value to said host. The command is a first command for synchronizing the command.
A predetermined number having a command number and data associated with a command in an area sandwiched between a first character which is a specific character and a second character which is different from the first character and which indicates a command delimiter. The command return value indicates a delimiter of the command return value by using a first character which is a first specific character for synchronizing the command return value and a second specific character different from the first character. A communication method comprising a command number and a command recognition message or a command number, an error number, and a predetermined number of characters having an error message in an area sandwiched by last characters.
【請求項2】前記ホストから送信される前記コマンドは
1文字単位で送信され、前記データ処理装置はその回答
として前記ホストより送信された文字をそのまま返信す
る処理を前記最終文字が送信されるまで繰り返し、 前記データ処理装置は前記最終文字を検出して返送した
後、前記コマンド戻り値を前記ホストに返信することを
特徴とする請求項1記載の通信方法。
2. The command transmitted from the host is transmitted in units of one character, and the data processing device performs a process of directly returning the character transmitted from the host as a response until the last character is transmitted. 2. The communication method according to claim 1, wherein the data processing device returns the command return value to the host after detecting and returning the last character.
【請求項3】前記データ処理装置は、前記先頭文字を受
信した時点で前記コマンドの始まりとみなして受信した
文字のバッファ保存を開始すると同時に受信した文字数
のカウントを開始し、前記最終文字を受信した時点でコ
マンドの区切りとみなして文字数のカウントを終了する
ことを特徴とする請求項2記載の通信方法。
3. The data processing device, upon receiving the first character, starts counting the number of received characters at the same time as starting to store the received character in a buffer as a start of the command, and receives the last character. 3. The communication method according to claim 2, wherein the counting of the number of characters is terminated at the time when the command is delimited.
【請求項4】前記データ処理装置が前記最終文字を受信
した時に、カウントされている文字数があらかじめ決め
られた文字数と一致しない場合、または、バッファ保存
された前記コマンドのコマンドナンバー及びコマンドに
付随するデータがあらかじめ決められた値にない場合に
は、コマンドナンバーとエラーナンバー及びエラーメッ
セージを含んだ前記コマンド戻り値を前記ホストに返信
することを特徴とする請求項3記載の通信方法。
4. When the number of characters counted does not match a predetermined number of characters when the data processing device receives the last character, or when the command number and the command of the command stored in the buffer are stored. 4. The communication method according to claim 3, wherein when the data is not at a predetermined value, the command return value including a command number, an error number, and an error message is returned to the host.
【請求項5】前記データ処理装置が前記最終文字を受信
した時に、カウントされている文字数があらかじめ決め
られた文字数と一致し、かつバッファ保存された前記コ
マンドのコマンドナンバー及びコマンドに付随するデー
タがあらかじめ決められた値である場合には、コマンド
ナンバーとコマンド認識メッセージを含んだ前記コマン
ド戻り値を前記ホストに返信することを特徴とする請求
項3記載の通信方法。
5. When the data processing device receives the last character, the counted number of characters matches the predetermined number of characters, and the command number of the command stored in the buffer and the data accompanying the command are stored in the buffer. 4. The communication method according to claim 3, wherein if the value is a predetermined value, the command return value including a command number and a command recognition message is returned to the host.
JP10032013A 1998-01-29 1998-01-29 Communication method Pending JPH11220510A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10032013A JPH11220510A (en) 1998-01-29 1998-01-29 Communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10032013A JPH11220510A (en) 1998-01-29 1998-01-29 Communication method

Publications (1)

Publication Number Publication Date
JPH11220510A true JPH11220510A (en) 1999-08-10

Family

ID=12346990

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10032013A Pending JPH11220510A (en) 1998-01-29 1998-01-29 Communication method

Country Status (1)

Country Link
JP (1) JPH11220510A (en)

Similar Documents

Publication Publication Date Title
US7548736B2 (en) Transmitter, receiver, data transfer system, transmission method, reception method, computer program for transmission, computer program for reception, and recording medium
CN112965908A (en) Communication test method, communication test device, communication equipment and storage medium
JPH11220510A (en) Communication method
CN110492979B (en) Incremental data transmission method and device, slave and storage medium
JP2006155047A (en) Verification system and verification method
CN117176515A (en) Automatic message reading and sending method and related equipment thereof
JP2009288852A (en) Image forming apparatus
KR20080068339A (en) Infrared receiving error detecting method of cell phone
JPS59117628A (en) Program changing system
JPH05260563A (en) Centralized automatic metering device
JPS5829243A (en) Signal monitoring device of transmission system
JPH06282694A (en) Information storage medium and information transmitter/ receiver
JP3460502B2 (en) Serial transmission system
JPH10136019A (en) Reception-side equipment for data transfer system, and storage medium storing operation program of the same
JP3068485B2 (en) Keyboard log information output device
JP2945123B2 (en) Communications system
JPH05197405A (en) Programmable controller with automatic access function for telephone line
US7716539B2 (en) Serial communication control system
JPH1168802A (en) Faulty environment supervisory system
JP2551336B2 (en) Transmission control method for facsimile machine
CN116260581A (en) Control signal remote transmission method and system
CN113064736A (en) Message processing system, method, device, electronic equipment and storage medium
JPS6051045A (en) Facsimile store and forward switching device
JPH0897803A (en) Data transmission system
US20030226099A1 (en) Method for communicating data between digital camera and portable electronic communication device