JP2742153B2 - Printer received code analysis method - Google Patents

Printer received code analysis method

Info

Publication number
JP2742153B2
JP2742153B2 JP3163577A JP16357791A JP2742153B2 JP 2742153 B2 JP2742153 B2 JP 2742153B2 JP 3163577 A JP3163577 A JP 3163577A JP 16357791 A JP16357791 A JP 16357791A JP 2742153 B2 JP2742153 B2 JP 2742153B2
Authority
JP
Japan
Prior art keywords
code
command
received
parameter
print
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.)
Expired - Fee Related
Application number
JP3163577A
Other languages
Japanese (ja)
Other versions
JPH0671977A (en
Inventor
正木 藤原
雄 中村
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.)
SHINKO MECHATROTECH CO., LTD.
Original Assignee
SHINKO MECHATROTECH CO., 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 SHINKO MECHATROTECH CO., LTD. filed Critical SHINKO MECHATROTECH CO., LTD.
Priority to JP3163577A priority Critical patent/JP2742153B2/en
Publication of JPH0671977A publication Critical patent/JPH0671977A/en
Application granted granted Critical
Publication of JP2742153B2 publication Critical patent/JP2742153B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Accessory Devices And Overall Control Thereof (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、プリンタがホストコン
ピュータから受信するコードにデータ誤りがないか否か
をチェックするためのプリンタの受信コード解析方法に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for analyzing a received code of a printer for checking whether or not a code received by a printer from a host computer has a data error.

【0002】[0002]

【従来の技術】プリンタの印字結果に、例えば、罫線の
乱れや、スペース又は文字のずれや、文字書体の変形な
どの異常が発生した場合は、ホストコンピュータからプ
リンタに与えられる出力データに誤りがあることを意味
する。その誤りの原因を見付け出すためには、ホストコ
ンピュータがプリンタにどのようなコード(コマンド、
パラメータ又は印字データ)を出力したかを調べる必要
がある。
2. Description of the Related Art When an abnormality such as a disorder of ruled lines, a displacement of a space or a character, or a deformation of a character typeface occurs in a printing result of a printer, an error occurs in output data given from the host computer to the printer. It means there is. To find the cause of the error, the host computer tells the printer what code (command,
Parameter or print data).

【0003】ところで、ホストコンピュータからプリン
タに出力するコードは、通常、8ビット構成の1バイト
のデータで出力され、その1バイトのデータは、
“0”、“1”の2値の羅列であるから、プリンタがホ
ストコンピュータから受信したコードを1バイトのデー
タずつプリントアウト(以下、印字という)して見て
も、そのデータの意味内容が判らないので、どこにどの
ような出力データの誤りがあるかも解析することはでき
ない。
A code output from a host computer to a printer is normally output as 1-byte data having an 8-bit configuration.
Since the code is a binary sequence of “0” and “1”, even if the printer receives and prints out the code received from the host computer by one byte of data (hereinafter referred to as “printing”), the meaning of the data remains unchanged. Because it is not known, it is not possible to analyze where and what kind of output data error exists.

【0004】そこで、従来の受信コード解析方法は、ホ
ストコンピュータより受信したコードを、上位4ビット
と下位4ビットとに分けて、4ビットずつを16進数で
表わして、順次1データずつ16進数に変換して印字し
ている。図1は、このような受信コードを16進数で印
字したもの(通常、ヘキサダンプと称されている)であ
る。
Therefore, the conventional reception code analysis method divides a code received from a host computer into upper 4 bits and lower 4 bits, and expresses each 4 bits in hexadecimal, and sequentially converts each data into hexadecimal. Converted and printed. FIG. 1 shows such a reception code printed in hexadecimal (usually called a hexa-dump).

【0005】ヘキサダンプは、図1から明らかなよう
に、単に全ての受信コードを16進数で表示するのみで
あるから、ヘキサダンプを見ても、どれがコマンドで、
どれが印字データであるか判らない。
As is apparent from FIG. 1, the hexa-dump simply displays all the received codes in hexadecimal numbers.
I do not know which is the print data.

【0006】そのため、従来は、受信コードを解析する
には、各16進数とその意味とを対応して表記したコマ
ンド一覧表を用意し、上記のヘキサダンプに表された1
6進数表示の受信コード(例えば、図1の1B,25、
33、34…)を一つずつ順次コマンド一覧表と照合し
て、ヘキサダンプに付記しながら、意味を確認しなけれ
ばならなかった。
Therefore, conventionally, in order to analyze a received code, a command list in which each hexadecimal number and its meaning are described in correspondence with each other is prepared, and the command list shown in the above hex dump is prepared.
The received code in hexadecimal notation (for example, 1B, 25 in FIG. 1,
33, 34...) One by one against the command list one by one, and the meaning must be confirmed while adding to the hexadump.

【0007】[0007]

【解決しようとする技術課題】従って、コード解析に
は、プリンタによるヘキサダンプの印字と、印字された
ヘキサダンプの各16進数とコマンド一覧表とのオペレ
ータによる照合とに非常に多くの時間がかかり、しか
も、照合するまではコマンドの意味内容が判らず、ま
た、ヘキサダンプには受信コードに誤りがあるか否かに
係わりなく、受信コードの受信開始から終了まで、一様
に連続して印字されているので、その受信データに誤り
があったか否かを容易に発見することができず、オペレ
ータを非常に疲労させる問題があった。
Therefore, in code analysis, it takes a very long time to print a hexa-dump by a printer and to check each hexadecimal number of the printed hexa-dump and a command list by an operator. , The meaning of the command is not known until it is matched, and the hexadecimal dump is printed uniformly and continuously from the start to the end of reception of the received code regardless of whether or not the received code has an error. Therefore, it was not possible to easily find out whether or not the received data contained an error, and there was a problem that the operator was very tired.

【0008】本発明は、上記の点に鑑みてなされたもの
であり、オペレータ自身によるヘキサダンプを用いての
解析を不要化することを目的とする。換言すると、プリ
ンタ自体に受信コードを解析させ、その解析結果に対応
して態様を変えて印字させることにより、印字されたも
のをオペレータが見るだけで、容易に受信コードの内容
を理解することができ、しかも、データ誤りの有無の判
定及び誤り発生位置が一目瞭然に判るようにすることを
目的とする。
The present invention has been made in view of the above points, and has as its object to eliminate the need for an operator to perform an analysis using a hexadump. In other words, by causing the printer itself to analyze the received code and printing in a different mode according to the analysis result, the operator can easily understand the contents of the received code simply by looking at the printed one. It is another object of the present invention to make it possible to determine the presence or absence of a data error and to recognize the error occurrence position at a glance.

【0009】[0009]

【課題を解決するための手段】上記の目的を達成するた
め、本発明に係るプリンタの受信コード解析方法は、ホ
ストコンピュータからの受信コードを、所定の標準コー
ドに基づいて制御コードと印字コードとに分類する分類
処理と、前記分類処理により制御コードに分類された受
信コードに含まれるコマンドを各コマンドに予め付けら
れたシンボルに変換して印字し、かつ、前記コマンドに
パラメータがついているときには、各コマンドの形態に
基づいて前記パラメータを所定の10進数に変換して、
その10進数表示のパラメータを前記コマンドのシンボ
ルに付随して一つの制御コード毎に一まとめにして印字
するものであり、前記制御コードに分類された前記受信
コードが1以上の制御コードからなる制御コード群の始
めに位置しているときのみ、改行を行ってから前記制御
コードに対応する印字を行う制御コード処理と、前記分
類処理により印字コードに分類された受信コードを前記
制御コードの末尾から改行して16進数表示で印字する
印字コード処理と、前記分類処理において、前記制御コ
ードに分類された受信コードに含まれるコマンドが未定
義のものであるときには、その時点で改行して、未定義
の前記コマンドを示している前記受信コードを16進数
表示で印字する未定義コマンド処理と、前記制御コード
処理において、前記パラメータが未定義のものであると
きには、その時点で改行して、未定義の前記パラメータ
を示している前記受信コードを16進数表示で印字する
未定義パラメータ処理とを有することを特徴としてい
る。
In order to achieve the above-mentioned object, a method for analyzing a received code of a printer according to the present invention converts a received code from a host computer into a control code and a print code based on a predetermined standard code. Classification process to classify, the command included in the received code classified into the control code by the classification process is converted into a symbol attached to each command in advance and printed, and when the command has a parameter, The parameters are converted into a predetermined decimal number based on the form of each command,
The parameters in decimal notation are printed collectively for each control code accompanying the symbol of the command, and the received code classified into the control code is composed of one or more control codes. Only when located at the beginning of the code group, a control code process for performing printing corresponding to the control code after performing a line feed, and a received code classified as a print code by the classification process from the end of the control code In the print code processing for printing a new line and displaying in hexadecimal notation, and in the classification processing, when a command included in the reception code classified as the control code is undefined, a line feed is performed at that time and the line is undefined. In the undefined command process of printing the received code indicating the command in hexadecimal notation, and in the control code process, Parameter when those undefined, a new line at that time, is characterized by having a undefined parameter processing for printing the received code showing the undefined said parameters in hexadecimal notation.

【0010】[0010]

【作用】本発明方法によれば、ホストコンピュータから
の受信コードを所定の標準コードに基づいて制御コード
と印字コードとに分類し、制御コードに分類された受信
コードについては、制御コードに含まれるコマンドに対
応するシンボルに変換して印字し、そのコマンドにパラ
メータが付されている場合には、そのパラメータを10
進数に変換して上記パラメータに付随して印字する。こ
の際、制御コードに分類された受信コードが1以上の制
御コードからなる制御コード群の始めに位置していると
きのみ、改行を行ってから制御コードに対応するシンボ
ル及びパラメータの印字を行う。また、印字コードに分
類された受信コードについては、印字コードに先だって
受信した制御コードの末尾から改行して16進数表示で
印字する。
According to the method of the present invention, the received code from the host computer is classified into a control code and a print code based on a predetermined standard code, and the received code classified into the control code is included in the control code. The command is converted into a symbol corresponding to the command and printed. If a parameter is added to the command, the parameter is set to 10
It is converted to a decimal number and printed along with the above parameters. At this time, only when the received code classified as the control code is located at the beginning of the control code group including one or more control codes, the line and the line corresponding to the control code are printed after the line feed. The received codes classified as print codes are printed in hexadecimal notation starting from the end of the control code received prior to the print code.

【0011】なお、制御コードに分類された受信コード
に含まれるコマンドが未定義のものである場合、すなわ
ちデータ誤りを生じている場合には、その時点で改行動
作を行って上記未定義のコマンドを示す受信コードを1
6進数表示で印字する。また、コマンドに付されたパラ
メータが未定義のものであった場合、すなわちデータ誤
りを生じている場合には、その時点で改行動作を行って
上記未定義のパラメータを示す受信コードを16進数表
示で印字する。
If the command included in the received code classified as the control code is undefined, that is, if a data error has occurred, a line feed operation is performed at that time to execute the undefined command. The reception code indicating
Print in hexadecimal notation. If the parameter attached to the command is undefined, that is, if a data error has occurred, a line feed operation is performed at that point and the received code indicating the undefined parameter is displayed in hexadecimal. Print with.

【0012】[0012]

【実施例】次に、本発明の実施例について、図面に基づ
いて説明する。図2は、図1に表わされた受信コードと
同一内容の受信コードを、本発明方法によりプリンタの
解析装置において解析し、出力したものを印字したもの
である。
Next, embodiments of the present invention will be described with reference to the drawings. FIG. 2 shows a received code having the same contents as the received code shown in FIG. 1 analyzed by a printer analyzing apparatus according to the method of the present invention, and the output is printed.

【0013】図2の各段落に印字されたものの内容を、
一つのブロックで対応して示すと、図3のようになる。
すなわち、図2の最初の段落には制御コードA1 が、次
の段落には、その制御コードによって設定された印字フ
ォーマットに従って印字される印字データB1 が、それ
ぞれ表わされ、以下、同様の順序で、他の制御コードと
印字データA2 ,B2 ;A3 ,B3 …がそれぞれ段落を
異にして、すなわち、受信コードの種類毎に改行して、
出力印字されている。換言すると、制御コードと印字コ
ードが交互に段落を換えて印字され、表示される。ま
た、上記各制御コードの欄には、図4に例示するよう
に、制御コードの内容に応じて、シンボル、データ量、
接続データ、パラメータ等が受信した順序に沿って、印
字されている。
The contents printed in each paragraph of FIG.
FIG. 3 shows one block correspondingly.
That is, first the paragraphs control code A 1 in FIG. 2, the following paragraphs print data B 1 to be printed according to the print format set by the control code is represented respectively, and the same In the order, the other control codes and the print data A 2 , B 2 ; A 3 , B 3, ...
Output is printed. In other words, the control code and the print code are printed alternately by changing paragraphs and displayed. In addition, as shown in FIG. 4, in the columns of the respective control codes, a symbol, a data amount,
Connection data, parameters, and the like are printed in the order in which they were received.

【0014】続いて、図1のヘキサダンプで示されてい
る受信コードが、本発明方法によりいかに解析されて、
図2の解析出力データが作成されるかについて、図5及
び図6に基づいて説明する。図5は、本発明方法を実施
するための解析装置である。図6は、同装置の作用を説
明するフローチャートである。
Subsequently, the received code shown by the hexa-dump in FIG. 1 is analyzed by the method of the present invention,
Whether the analysis output data of FIG. 2 is created will be described with reference to FIGS. FIG. 5 shows an analyzer for implementing the method of the present invention. FIG. 6 is a flowchart for explaining the operation of the apparatus.

【0015】解析装置は、プリンタのコンピュータを構
成するCPU10とRAM20とROM30の一部で構
成されている。CPUは図外のホストコンピュータから
図外の通信制御部及びインタフェースを介して受信する
コードをRAMの受信コード記憶部21に格納する。
The analyzing apparatus comprises a CPU 10, a RAM 20, and a part of a ROM 30 which constitute a computer of the printer. The CPU stores a code received from a host computer (not shown) via a communication control unit and an interface (not shown) in a received code storage unit 21 of the RAM.

【0016】また、CPU10は、本発明方法に必要な
機能を実現するための手段として、コード種類判別部1
1と、シンボル変換部12と、パラメータ型判定部13
と、第一パラメータ変換部14と、第二パラメータ変換
部15と、ヘキサ値変換部16と、編集部17とを有す
る。
The CPU 10 includes a code type discriminating unit 1 as means for realizing functions required for the method of the present invention.
1, a symbol conversion unit 12, and a parameter type determination unit 13
, A first parameter converter 14, a second parameter converter 15, a hex value converter 16, and an editor 17.

【0017】コード種類判別部11は、受信したコード
(以下、受信コードという)の種類が制御コード(コマ
ンド)に該当するか、印字コードに該当するかを判別す
るものである。シンボル変換部12は、受信コードが制
御コード、すなわちコマンドである場合に、そのコマン
ドに対応するシンボルに変換するものであり、パラメー
タ型判定部13は、そのコマンドに続いてパラメータを
受信した場合に、そのパラメータの型を判定するもので
ある。そして、第一パラメータ変換部14は、受信した
パラメータが第一の型、例えば、2Xタイプ(2は第二
桁の数値がヘキサ値2のもの、Xは第一桁のヘキサ値が
各種変化することを意味する。)のものである場合に、
そのパラメータを所定数値に変換するものであり、第二
パラメータ変換部15は、受信したパラメータが第二の
型、例えば、3Xタイプ(3は第二桁のヘキサ値が3の
もの、Xは第一桁のヘキサ値が各種変化することを意味
する。)のものである場合にそのパラメータを所定値に
変換するものである。ヘキサ値変換部16は、受信した
コードが印字コードである場合に、コード種類判別部1
1からの出力に基づいて、そのコードを構成する例えば
8ビット構成のデータを、上位4ビットと下位4ビット
に分けて、それぞれを16進数に変換し、また、先の第
一、第二パラメータ変換部14,15から与えられる変
換不能であったパラメータを、それぞれヘキサ値に変換
して、編集部17に出力するものである。なお、第一及
び第二パラメータ変換部14,15において変換不能な
パラメータとは、当該プリンタにおいて定義されていな
い未定義のデータを意味しており、ホストコンピュータ
からの受信データに誤りがあったことを示している。
The code type determining section 11 determines whether the type of a received code (hereinafter, referred to as a received code) corresponds to a control code (command) or a print code. When the received code is a control code, that is, a command, the symbol conversion unit 12 converts the received code into a symbol corresponding to the command. The parameter type determination unit 13 performs a process when a parameter is received following the command. , The type of the parameter. Then, the first parameter conversion unit 14 determines that the received parameter is of a first type, for example, a 2X type (2 is a hexadecimal value of the second digit of 2 and X is a hexadecimal value of the first digit in various ways. ).
The second parameter conversion unit 15 converts the received parameter into a second type, for example, a 3X type (3 is a second digit hexadecimal value of 3, and X is a second type). If the single digit hexadecimal value changes in various ways, the parameter is converted to a predetermined value. If the received code is a print code, the hex value conversion unit 16
For example, based on the output from 1, the 8-bit data constituting the code is divided into upper 4 bits and lower 4 bits, each of which is converted into a hexadecimal number. The unconvertible parameters provided from the conversion units 14 and 15 are converted into hexadecimal values and output to the editing unit 17. The parameters that cannot be converted by the first and second parameter conversion units 14 and 15 mean undefined data that is not defined in the printer, and that there is an error in the data received from the host computer. Is shown.

【0018】そして、前記シンボル変換部12が変換し
たシンボル、第一及び第二パラメータ変換部14,15
が変換したパラメータ並びにヘキサ値変換部16が出力
するヘキサ値は、それぞれ変換した順序に沿って、編集
部17に与えられるようになっている。この編集部によ
り編集された解析データは、このプリンタの印字制御部
18に出力される。印字制御部18は、図示を省略した
インタフェースを介して、印字部40に上記解析データ
を印字データとして出力するため、このプリンタが受信
したコードがその印字部40により、図2に示されたよ
うな態様で印字される。
The symbols converted by the symbol conversion unit 12, the first and second parameter conversion units 14, 15
The converted parameters and the hex values output by the hex value conversion unit 16 are provided to the editing unit 17 in the order of conversion. The analysis data edited by the editing unit is output to the print control unit 18 of the printer. The print control unit 18 outputs the analysis data as print data to the print unit 40 via an interface (not shown), so that the code received by the printer is output by the print unit 40 as shown in FIG. Is printed in an appropriate manner.

【0019】ROM30には、上記コード種類判別部に
よる判別に必要な標準コードを記憶している標準コード
記憶部31と、上記シンボル変換部によるシンボル変換
に必要な、各コードに対応して予め割り振られたシンボ
ルを記憶しているシンボル記憶部32を有している。シ
ンボルは、16進数で表されているコードに対して、そ
のコードの意味するコマンド内容をアルファベット文字
の結合により理解しやすい形で通常表示され、使用され
ているものである。表1に16進コードとシンボルとそ
の意味を表わす名称の対応表の一部を示す。
The ROM 30 stores a standard code storage section 31 for storing standard codes required for the discrimination by the code type discriminating section, and a pre-allocated code corresponding to each code required for symbol conversion by the symbol converting section. And a symbol storage unit 32 for storing the obtained symbols. The symbol is normally displayed and used for a code represented by a hexadecimal number in a form that makes it easy to understand the contents of the command that the code means by combining alphabetic characters. Table 1 shows a part of a correspondence table between hexadecimal codes, symbols, and names representing their meanings.

【0020】[0020]

【表1】 [Table 1]

【0021】上記の構成による解析装置の作用を図6に
基づいて説明する。同図中、Sと数字はステップを意味
する。CPU10は受信コードチェックモードのプログ
ラムを実行すると、ホストコンピュータからコードを受
信したとき(S1肯定)には、まず、その受信コードR
AMの受信コード記憶部21に格納する。次いで、コー
ド種類判別部11がRAMの受信コード記憶部21から
読出した受信コードを、ROM31に記憶されている標
準コードと比較して、その受信コードがコマンドである
か、印字コードであるかを判別する(S2)。
The operation of the analyzer having the above configuration will be described with reference to FIG. In the figure, S and the numbers mean steps. When the CPU 10 executes the program in the reception code check mode, when a code is received from the host computer (Yes at S1), first, the reception code R
The received code is stored in the received code storage unit 21 of the AM. Next, the code type discriminating unit 11 compares the received code read from the received code storage unit 21 of the RAM with the standard code stored in the ROM 31 and determines whether the received code is a command or a print code. It is determined (S2).

【0022】コマンドである場合は、その受信コードを
シンボル変換部12とパラメータ型判定部13に与え
る。シンボル変換部12は、コマンドについて既に定義
されたものか否かを検査する(S3)。定義済み(検査
OK)の場合は、そのコマンドがコマンド群の始めか否
かを調べ(S4)、始めならば、改行の印字指令を出し
(S5)、ステップS6に進む。S4においてコマンド
群の始めでない場合は、S6にジャンプする。そして、
S6では、与えられたコードのデータ構成を、ROMの
シンボル記憶部32に記憶されているシンボルのいずれ
と一致するかを調べ、一致したものを、その受信コード
のシンボルとして取出し、編集部17に出力する(S
7)。すなわち、コマンドから変換されたシンボルの印
字指令を出力する。
If the command is a command, the received code is given to the symbol conversion unit 12 and the parameter type determination unit 13. The symbol conversion unit 12 checks whether or not the command is already defined (S3). If the command has been defined (check OK), it is checked whether the command is the start of a command group (S4). If so, a line feed print command is issued (S5), and the process proceeds to step S6. If it is not the start of the command group in S4, the process jumps to S6. And
In S6, the data structure of the given code is checked to see which one of the symbols stored in the symbol storage unit 32 of the ROM matches, and the matched one is taken out as a symbol of the received code, and sent to the editing unit 17. Output (S
7). That is, a print command of the symbol converted from the command is output.

【0023】また、パラメータ型判定部13は、コード
種類判別部11から与えられたコードに、コマンドに対
応するパラメータがあるか否か(S8)を、また、パラ
メータがある場合は、その内容が2X型か、3X型か、
あるいはヘキサ型かをROMの標準パラメータの型と照
合して判定し(S9)、それぞれ判定結果に応じて、第
一パラメータ変換部14、又は第二パラメータ変換部1
5などに出力する。各パラメータ変換部は、与えられた
コードを、その内容に応じて10進数表示のパラメータ
に変換する(S10a,S10b,S10c)。続い
て、変換が成功したか否かを調べ(S11)、変換成功
時には、そのパラメータを編集部17に与え(S1
2)、変換不成功時、すなわちパラメータが未定義(ホ
ストコンピュータからの受信コードが誤ったデータ)で
ある場合には、その時点で改行の印字指令をそれぞれ出
力する(S13)とともに、そのパラメータをヘキサ変
換部16に与えて、これをヘキサ表示に変換して(S1
4)、編集部17に与える(S15)。
The parameter type determination unit 13 determines whether or not the code provided from the code type determination unit 11 includes a parameter corresponding to the command (S8). 2X type or 3X type,
Alternatively, it is determined whether the type is hexa type by comparing it with the type of the standard parameter of the ROM (S9), and the first parameter converting unit 14 or the second parameter converting unit 1 is determined according to the determination result.
5 and so on. Each parameter converter converts the given code into a parameter in decimal notation according to the content (S10a, S10b, S10c). Subsequently, it is checked whether or not the conversion is successful (S11). When the conversion is successful, the parameter is given to the editing unit 17 (S1).
2) If the conversion is unsuccessful, that is, if the parameter is undefined (the code received from the host computer is incorrect data), a line feed printing command is output at that time (S13), and the parameter is changed. It is provided to the hex conversion unit 16 and converted to hex display (S1
4), which is given to the editing unit 17 (S15).

【0024】また、コマンド検査のステップ(S3)に
おいて、受信コードが未定義のものである場合、すなわ
ちホストコンピュータからの受信コードが誤ったデータ
である場合には、その時点で改行指令を出力する(S1
6)とともに、その未定義のコマンドをコード種類判別
部11からヘキサ変換部16に与えて、これをヘキサ表
示に変換し(S17)、編集部17に与える(S1
8)。
In the command checking step (S3), if the received code is undefined, that is, if the received code from the host computer is incorrect data, a line feed command is output at that time. (S1
6), the undefined command is supplied from the code type discriminating unit 11 to the hex converting unit 16, which is converted into hex display (S17), and supplied to the editing unit 17 (S1).
8).

【0025】さらに、受信コードが印字データであると
き(S2否定)は、それが印字コード群の始めであるか
否かを調べ(S19)、始めである時は、改行指令を出
力し(S20)、ステップS21に進む。印字コード群
の始めでないときは、S19からS21にジャンプす
る。S21においては、ヘキサ変換部16により印字コ
ードをヘキサ表示データに変換し、これをを編集部17
に与える(S22)。
Further, if the received code is print data (No at S2), it is checked whether or not it is the beginning of a print code group (S19). If it is the beginning, a line feed command is output (S20). ), And proceed to step S21. If it is not the beginning of the print code group, the process jumps from S19 to S21. In S21, the print code is converted into hexadecimal display data by the hexadecimal conversion unit 16, and this is converted into the edit unit 17
(S22).

【0026】編集部17は、上記の各ステップS5,
7,13,15,16,18,20,22において与え
られる改行指令、印字データの印字順序を設定する。従
って、コマンドについては、一まとまりにし、コマンド
から印字コードに変わるときは、改行するようになって
いる。また、いったんコマンドと判別されても、そのコ
マンドが未定義のものであるとき、及び、受信したパラ
メータのデータが未定義のものであるときは、その時点
で印字行を改行するようになっている。
The editing unit 17 executes the above steps S5 and S5.
The line feed command given in 7, 13, 15, 16, 18, 20, 22 and the print data printing order are set. Therefore, commands are grouped together, and when a command is changed to a print code, a line feed is performed. Also, even if the command is once determined, if the command is undefined and if the received parameter data is undefined, the print line will be broken at that point. I have.

【0027】このようにして、解析装置は、プリンタが
ホストコンピュータから受信したコードを順次、コマン
ドか印字コードかの判別、コマンドである場合は、それ
を所定のシンボルに変換し、パラメータがついている場
合は、その型に応じて10進数のパラメータに変換し、
また、印字コードである場合は、従来と同様に印字デー
タの確認が容易な16進数(ヘキサ値)にそれぞれ変換
して、これを解析結果として編集部17に出力するの
で、編集部の出力する編集データが印字制御部18を介
して印字部40により印字される。
As described above, the analyzing device sequentially determines whether the code received from the host computer by the printer is a command or a print code, and if the code is a command, converts the code into a predetermined symbol and attaches a parameter. If so, convert it to a decimal parameter according to its type,
In the case of a print code, the print data is converted into a hexadecimal number (hex value), which is easy to confirm the print data, and output to the editing unit 17 as an analysis result. The editing data is printed by the printing unit 40 via the printing control unit 18.

【0028】図2は、上記のように、図1のヘキサダン
プで示された受信コードの内容を本発明方法により解
析、出力して、印字したものでものであるが、この図に
おいて、最初の「SVFU」は、図1の「1B 25 」に対応す
るコマンドであり、次の「33.34 」は、図1の「33 34
」に対応し、そのコマンドのデータ量が34個である
ことを表わし、続く<>(括弧)で括られた数字「41,4
0,…」は、そのコマンドに接続するデータであることを
表わす。<>で括られた数が続く間は、制御データであ
ることを意味する。
FIG. 2 shows the result of analyzing, outputting, and printing the contents of the received code indicated by the hexa-dump shown in FIG. 1 by the method of the present invention as described above. “SVFU” is a command corresponding to “1B 25” in FIG. 1, and the next “33.34” is “33 34” in FIG.
, Indicating that the data amount of the command is 34, and following the numbers “41,4” enclosed in <> (parentheses).
0,... "Represents data connected to the command. While the number enclosed by <> continues, it means control data.

【0029】図2においては、シンボル「SVFU」とデー
タ量を示す「33,34 」の次の最初の数「41」から「4
0」と「42」の繰返しの後の数「41」までが、垂直
タブの位置をセットするデータであり、何行目に何チャ
ンネルのタブをセットするかを1行単位で指定してい
る。
In FIG. 2, the symbol “SVFU” and the first number “41” to “4” following “33,34” indicating the data amount are shown.
The number up to the number "41" after the repetition of "0" and "42" is the data for setting the position of the vertical tab, and specifies on which line the tab of which channel is to be set in units of one line. .

【0030】一つのシンボル(例えば図2の「SVFU」)
から次のシンボル(例えば図2の「PGL 」)までが、一
つのコマンドである。そして、当該コマンドにパラメー
タがある場合は、そのシンボルの後に、数字で示され
る。例えば、「PGL 」の後の「2640」である。「PGL 」
は表1にも記載されているように、頁長指定のコマンド
を表わすシンボルであり、「2640」は、画素数を264
0にするためのパラメータある。この2640のパラメータ
は、図1の「 22 26 24 70」の2xタイプのパラメータ
を判定して変換されたものである。
One symbol (for example, "SVFU" in FIG. 2)
The next command (for example, “PGL” in FIG. 2) is one command. If the command has a parameter, it is indicated by a number after the symbol. For example, "2640" after "PGL". "PGL"
Is a symbol representing a page length designation command, as described in Table 1, and "2640" is a symbol representing 264 pixels.
There is a parameter for setting it to 0. The 2640 parameters are converted by determining the 2 × type parameters of “22 26 24 70” in FIG.

【0031】以下、同様にして、各シンボルと、そのパ
ラメータの結合が、一つのファンクションに対するコマ
ンドが終了するまで、改行されずに、すなわち、一つの
段落の中に一まとまりにして、印字される。図2では、
「SVFU」から最後のシンボル「SPI 」とそのパラメータ
である「24」までが、一まとまりのファンクションのコ
マンドである。
In the same manner, the combination of each symbol and its parameters is printed without line breaks, that is, in one paragraph, until the command for one function is completed. . In FIG.
The commands from "SVFU" to the last symbol "SPI" and its parameter "24" are a group of function commands.

【0032】そして、そのファンクションに基づいて印
字される印字データは、コマンドから改行して印字され
る。図2において第2段落の「 31 32 33 34 35 」は、
英数字を意味する。
Then, the print data to be printed based on the function is printed with a line feed from the command. In FIG. 2, "31 32 33 34 35" in the second paragraph is
Means alphanumeric.

【0033】上述のように、図2には、受信したコード
が、コマンドの場合はそのコマンドがオペレータに判読
しやすいシンボルにより表示され、パラメータがある場
合は、通常の数値観念で判り易い10進数の形に変換し
て出力印字しており、また、印字コードについては、馴
れた16進数(ヘキサ値)で表示している。さらに、コ
マンドと印字コードは、それぞれ異なる段落に改行して
印字している。従って、オペレータは、図2を見るだけ
で、どこからどこまでがコマンド又は印字コードである
かを、判別することができ、かつ、コマンドのどの部分
にどのようなコマンドとパラメータがあるかを容易に判
断することができ、従来のようにコマンド一覧表を常備
して、一々対応して照合確認する煩わしさがなくなっ
た。
As described above, in FIG. 2, when the received code is a command, the command is displayed by a symbol which is easy for the operator to read, and when there is a parameter, a decimal number which is easy to understand by a normal numerical idea. , And output and print. The print code is displayed in a familiar hexadecimal number (hex value). Further, the command and the print code are each printed on a new line in a different paragraph. Therefore, the operator can determine where and how the command or print code is located only by looking at FIG. 2 and easily determine what command and parameter are included in which part of the command. This eliminates the hassle of having to prepare a command list as in the prior art, and to check and match each time.

【0034】そして、受信コードのいずれかにデータ誤
りがある場合は、適切なシンボルへの変換又はパラメー
タへの変換等ができないため、図3(2)のように段落
の途中で改行されて16進数表示で印字される。図3
(2)は、第7段落と第8段落にコマンドが続いて印字
されているので、データ誤りがあることが即座に判る。
このようにして、どの部分にデータ誤りが発生したか
を、瞬時に発見することができる。
If there is a data error in any of the received codes, conversion to an appropriate symbol or conversion to a parameter cannot be performed, so that a line break occurs in the middle of a paragraph as shown in FIG. Printed in hexadecimal notation. FIG.
In (2), since a command is printed following the seventh and eighth paragraphs, it is immediately known that there is a data error.
In this way, it is possible to instantly find out in which part a data error has occurred.

【0035】ここで、上述した実施例の説明と請求項の
記載との対応関係について説明しておく。図6に示され
ているS2の動作が、ホストコンピュータからの受信コ
ードを、所定の標準コードに基づいて制御コードと印字
コードとに分類する「分類処理」に相当している。図6
に示されているS4,S5,S6,S7,S8,S9,
S10a〜S10c、S12の動作が、前記分類処理に
より制御コードに分類された受信コードに含まれるコマ
ンドを各コマンドに予め付けられたシンボルに変換して
印字し、かつ、前記コマンドにパラメータがついている
ときには、各コマンドの形態に基づいて前記パラメータ
を所定の10進数に変換して、その10進数表示のパラ
メータを前記コマンドのシンボルに付随して一つの制御
コード毎に一まとめにして印字し、前記制御コードに分
類された前記受信コードが1以上の制御コードからなる
制御コード群の始めに位置しているときのみ、改行を行
ってから前記制御コードに対応する印字を行う「制御コ
ード処理」に相当している。図6に示されているS19
〜S22の動作が、前記分類処理により印字コードに分
類された受信コードを前記印字コードに先だって受信さ
れる前記制御コードの末尾から改行して16進数表示で
印字する「印字コード処理」に相当している。図6に示
されているS16,S17,S18の動作が、前記分類
処理において、前記制御コードに分類された受信コード
に含まれているコマンドが未定義のものであるときに
は、その時点で改行して、未定義の前記コマンドを示し
ている前記受信コードを16進数表示で印字する「未定
義コマンド処理」に相当している。図6に示されている
S11,S13,S14,S15の動作が、前記制御コ
ード処理において、前記パラメータが未定義のものであ
るときには、その時点で改行して、未定義の前記パラメ
ータを示している前記受信コードを16進数表示で印字
する「未定義パラメータ処理」に相当している。
Here, the correspondence between the description of the above-described embodiment and the description of the claims will be described. The operation of S2 shown in FIG. 6 corresponds to “classification processing” for classifying a received code from the host computer into a control code and a print code based on a predetermined standard code. FIG.
S4, S5, S6, S7, S8, S9,
In the operations of S10a to S10c and S12, the commands included in the received code classified into the control codes by the classification processing are converted into symbols pre-attached to each command and printed, and the command has parameters. In some cases, the parameters are converted into a predetermined decimal number based on the form of each command, and the parameters in decimal notation are printed collectively for each control code accompanying the symbol of the command, and Only when the received code classified as a control code is located at the beginning of a control code group consisting of one or more control codes, a line feed is performed, and then printing corresponding to the control code is performed. Is equivalent. S19 shown in FIG.
The operations of S22 to S22 correspond to "print code processing" in which the received code classified into the print code by the classification processing is printed in hexadecimal notation with a line feed from the end of the control code received prior to the print code. ing. The operation of S16, S17, and S18 shown in FIG. 6 is such that, in the classification process, when a command included in the received code classified as the control code is undefined, a line feed is performed at that time. This corresponds to “undefined command processing” in which the received code indicating the undefined command is printed in hexadecimal notation. In the operation of S11, S13, S14, and S15 shown in FIG. 6, when the parameter is undefined in the control code processing, a line feed is performed at that time to indicate the undefined parameter. This corresponds to “undefined parameter processing” in which the received reception code is printed in hexadecimal notation.

【0036】[0036]

【発明の効果】上述のように、本発明によれば、ホスト
コンピュータからの受信コードを、制御コードについて
は対応するシンボルで印字するとともに、制御コードに
付随するパラメータについては10進数表示で印字する
一方、印字コードについては、16進数表示で印字す
る。また、制御コードと印字コードとは、異なる段落に
改行されて印字される。したがって、印字結果をオペレ
ータが見るだけで、容易に受信コードの内容を理解する
ことができる。また、制御コードに分類された受信コー
ドに含まれるコマンド又はパラメータが未定義であった
ときは、その時点で改行動作を行ってから、上記未定義
の受信コード、すなわちデータ誤りを生じている受信コ
ードを16進数表示で印字する。したがって、データ誤
りの有無及び誤り発生位置の発見を容易に行うことがで
きる。この結果、オペレータ自身によるヘキサダンプを
用いての解析が不要であり、受信コードのチェック作業
で疲労することがなくなるという大きな利点がある。
As described above, according to the present invention, the reception code from the host computer is printed with the corresponding symbol for the control code, and the parameter accompanying the control code is printed in decimal notation. On the other hand, the print code is printed in hexadecimal notation. In addition, the control code and the print code are printed with line breaks in different paragraphs. Accordingly, the operator can easily understand the contents of the received code only by looking at the print result. If the command or parameter included in the received code classified as the control code is undefined, a line feed operation is performed at that time, and then the undefined received code, Print the code in hexadecimal notation. Therefore, the presence / absence of a data error and the location of the error can be easily found. As a result, there is a great advantage that the operator does not need to perform the analysis using the hexadump and himself / herself does not get tired by the work of checking the received code.

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

【図1】従来の受信コード解析に用いられていたヘキサ
ダンプの一例を示す。
FIG. 1 shows an example of a hexa-dump used for conventional reception code analysis.

【図2】本発明方法により印字された解析結果の出力デ
ータを示す。
FIG. 2 shows output data of an analysis result printed by the method of the present invention.

【図3】図2の解析結果の出力データを説明する概念図
である。
FIG. 3 is a conceptual diagram illustrating output data of an analysis result of FIG. 2;

【図4】コマンドの詳細内容の一例を示す概念図であ
る。
FIG. 4 is a conceptual diagram showing an example of the details of a command.

【図5】本発明方法を実施する解析装置のブロック構成
図である。
FIG. 5 is a block diagram of an analyzer for implementing the method of the present invention.

【図6】解析装置の動作を説明するフローチャートであ
る。
FIG. 6 is a flowchart illustrating an operation of the analysis device.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ホストコンピュータからの受信コード
を、所定の標準コードに基づいて制御コードと印字コー
ドとに分類する分類処理と、 前記分類処理により制御コードに分類された受信コード
に含まれるコマンドを各コマンドに予め付けられたシン
ボルに変換して印字し、かつ、前記コマンドにパラメー
タがついているときには、各コマンドの形態に基づいて
前記パラメータを所定の10進数に変換して、その10
進数表示のパラメータを前記コマンドのシンボルに付随
して一つの制御コード毎に一まとめにして印字するもの
であり、前記制御コードに分類された前記受信コードが
1以上の制御コードからなる制御コード群の始めに位置
しているときのみ、改行を行ってから前記制御コードに
対応する印字を行う制御コード処理と、 前記分類処理により印字コードに分類された受信コード
を前記印字コードに先だって受信される前記制御コード
の末尾から改行して16進数表示で印字する印字コード
処理と、 前記分類処理において、前記制御コードに分類された受
信コードに含まれるコマンドが未定義のものであるとき
には、その時点で改行して、未定義の前記コマンドを示
している前記受信コードを16進数表示で印字する未定
義コマンド処理と、 前記制御コード処理において、前記パラメータが未定義
のものであるときには、その時点で改行して、未定義の
前記パラメータを示している前記受信コードを16進数
表示で印字する未定義パラメータ処理とを有すること、 を特徴とするプリンタの受信コード解析方法。
1. A classification process for classifying a reception code from a host computer into a control code and a print code based on a predetermined standard code, and a command included in the reception code classified as a control code by the classification process. When each command is converted into a symbol attached in advance and printed, and when the command has a parameter, the parameter is converted into a predetermined decimal number based on the form of each command, and 10
A control code group consisting of one or more control codes, in which the parameters in hexadecimal notation are printed collectively for each control code in association with the command symbol, and the received codes classified into the control codes are one or more control codes. Control code processing for performing printing corresponding to the control code after performing a line feed only when positioned at the beginning of the received code, and a reception code classified as a print code by the classification processing is received prior to the print code. A print code process for printing a new line from the end of the control code and printing in hexadecimal notation; and in the classification process, when a command included in the reception code classified into the control code is undefined, at that time, An undefined command process for printing the received code indicating the undefined command in a hexadecimal notation by line feed; In the control code processing, when the parameter is undefined, a line feed is performed at that time and the undefined parameter processing for printing the reception code indicating the undefined parameter in hexadecimal notation is provided. A method for analyzing a received code of a printer, comprising:
JP3163577A 1991-06-08 1991-06-08 Printer received code analysis method Expired - Fee Related JP2742153B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3163577A JP2742153B2 (en) 1991-06-08 1991-06-08 Printer received code analysis method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3163577A JP2742153B2 (en) 1991-06-08 1991-06-08 Printer received code analysis method

Publications (2)

Publication Number Publication Date
JPH0671977A JPH0671977A (en) 1994-03-15
JP2742153B2 true JP2742153B2 (en) 1998-04-22

Family

ID=15776556

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3163577A Expired - Fee Related JP2742153B2 (en) 1991-06-08 1991-06-08 Printer received code analysis method

Country Status (1)

Country Link
JP (1) JP2742153B2 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6319275A (en) * 1986-07-11 1988-01-27 Nec Corp Printer
JPS63145048A (en) * 1986-12-09 1988-06-17 Brother Ind Ltd Printing apparatus
JPS63272145A (en) * 1987-04-30 1988-11-09 Canon Inc Dump output device
JP2839247B2 (en) * 1987-04-30 1998-12-16 キヤノン株式会社 Output control device

Also Published As

Publication number Publication date
JPH0671977A (en) 1994-03-15

Similar Documents

Publication Publication Date Title
JPH05282452A (en) Method and device for pattern recognition
EP0590949B1 (en) Variable replacement apparatus
CA1175578A (en) Word processing system having a formatting bidirectional printer
JP2742153B2 (en) Printer received code analysis method
US20070279706A1 (en) Network scanner and image file sending method
EP0284355A2 (en) Document processing apparatus
JPS6120887B2 (en)
JPS63272145A (en) Dump output device
JP3213167B2 (en) Image forming device
JPS63254542A (en) Control system for mixed field
JPS6231375B2 (en)
KR100509486B1 (en) Method and apparatus for continuous print
JPH052576A (en) Method for judging sort of code
JPH05158757A (en) Dump output method
CN117591042A (en) Information processing apparatus, recording medium, and information processing method
JPH096892A (en) Processor and method for image processing
JPH02121868A (en) Compression printer
CN117332762A (en) Method and device for adding text field to cell, electronic equipment and storage medium
JP3077580B2 (en) Character reader
JPH0736803A (en) Method for analyzing/displaying data with variable length and nesting structure
JPS63272144A (en) Dump output device
JPH06247010A (en) Command processor in printer
JPH079705A (en) Method of printing designated page in one lump and apparatus thereof
JPH04293185A (en) Filing device
JPH05127955A (en) Recording system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees