JP4891869B2 - A / D conversion unit - Google Patents

A / D conversion unit Download PDF

Info

Publication number
JP4891869B2
JP4891869B2 JP2007221836A JP2007221836A JP4891869B2 JP 4891869 B2 JP4891869 B2 JP 4891869B2 JP 2007221836 A JP2007221836 A JP 2007221836A JP 2007221836 A JP2007221836 A JP 2007221836A JP 4891869 B2 JP4891869 B2 JP 4891869B2
Authority
JP
Japan
Prior art keywords
reference digital
digital value
analog
signal level
linear
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
JP2007221836A
Other languages
Japanese (ja)
Other versions
JP2009055484A (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.)
Panasonic Industrial Devices SUNX Co Ltd
Original Assignee
Panasonic Electric Works SUNX 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 Panasonic Electric Works SUNX Co Ltd filed Critical Panasonic Electric Works SUNX Co Ltd
Priority to JP2007221836A priority Critical patent/JP4891869B2/en
Publication of JP2009055484A publication Critical patent/JP2009055484A/en
Application granted granted Critical
Publication of JP4891869B2 publication Critical patent/JP4891869B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Analogue/Digital Conversion (AREA)

Description

本発明は、A/D変換ユニットに関するものである。   The present invention relates to an A / D conversion unit.

従来、入力された電流或いは電圧などのアナログ信号をアナログ−デジタル変換回路によりデジタル値に変換し、デジタル値と電流或いは電圧等の物理量との関係を示す一次直線式に上記デジタル値を代入して、測定対象の物理量の大きさを示す出力値を得るA/D変換ユニットが提供されている(例えば特許文献1参照)。   Conventionally, an input analog signal such as current or voltage is converted into a digital value by an analog-digital conversion circuit, and the digital value is substituted into a linear linear expression indicating the relationship between the digital value and a physical quantity such as current or voltage. An A / D conversion unit that obtains an output value indicating the magnitude of a physical quantity to be measured is provided (see, for example, Patent Document 1).

図16(a)は従来のA/D変換ユニット1の概略構成を示すブロック図であり、マイコン11と、アナログ−デジタル変換回路(以下、A/D変換回路と略称す。)12と、RAM13と、フラッシュメモリ(以下、FROMと言う。)14と、DIPスイッチ(以下、DIPSWと言う。)15とを主要な構成として備えている。DIPSW15は図16(b)に示すように例えば4ビットのディップスイッチからなり、1ビット目はマイコン11の動作モードを通常モード又は校正モードに切り替えるスイッチ、2ビット目は基準デジタル値を取得するか否かを設定するスイッチ、3ビット目は基準デジタル値をFROM14に登録するか否かを設定するスイッチ、4ビット目はFROM14に登録された基準デジタル値を消去するか否かを設定するスイッチである。   FIG. 16A is a block diagram showing a schematic configuration of a conventional A / D conversion unit 1, a microcomputer 11, an analog-digital conversion circuit (hereinafter abbreviated as A / D conversion circuit) 12, and a RAM 13. And a flash memory (hereinafter referred to as FROM) 14 and a DIP switch (hereinafter referred to as DIPSW) 15 as main components. As shown in FIG. 16B, the DIPSW 15 is composed of, for example, a 4-bit dip switch, the first bit is a switch for switching the operation mode of the microcomputer 11 to the normal mode or the calibration mode, and the second bit is a reference digital value. A switch for setting whether or not, a third bit is a switch for setting whether or not to register a reference digital value in the FROM 14, and a fourth bit is a switch for setting whether or not to delete the reference digital value registered in the FROM 14 is there.

ここで、A/D変換回路12によるA/D変換に誤差がなければ、図17に実線aで示すようにA/D変換回路12に入力されるアナログ信号の信号レベルYと、変換後のデジタル値Xとの関係は、マイコン11に予め組み込まれたY=aXなる標準の一次直線式で示されることになる。例えば入力スパンが0〜5Vで、アナログ信号Yが0Vの時にデジタル値Xが0、アナログ信号Yが5.0Vの時にデジタル値Xが2000であれば、Y=X/400となり、マイコン11ではこの一次直線式を用いて、A/D変換回路12の出力からアナログ信号Yの信号レベルを求めている。   If there is no error in the A / D conversion by the A / D conversion circuit 12, the signal level Y of the analog signal input to the A / D conversion circuit 12 as shown by the solid line a in FIG. The relationship with the digital value X is represented by a standard linear equation of Y = aX incorporated in advance in the microcomputer 11. For example, if the input span is 0 to 5V, the digital value X is 0 when the analog signal Y is 0V, and the digital value X is 2000 when the analog signal Y is 5.0V, then Y = X / 400. The signal level of the analog signal Y is obtained from the output of the A / D conversion circuit 12 using this linear linear equation.

しかしながら、実際には、A/D変換回路12で使用している個々の部品にばらつきが存在するため、アナログ信号と変換後のデジタル値が示すアナログ量との間には誤差が発生し、アナログ信号の信号レベルYと、変換後のデジタル値Xとの関係は次式のように表される。   However, in practice, there are variations in the individual parts used in the A / D conversion circuit 12, so that an error occurs between the analog signal and the analog amount indicated by the converted digital value. The relationship between the signal level Y of the signal and the converted digital value X is expressed by the following equation.

Y=a’×X+b …(1)
例えば図17に点線bで示すようにアナログ信号Yが0(V)の時にデジタル値Xが300、アナログ信号Yが5.0(V)の時にデジタル値Xが1800であれば、傾きa=1/300、切片b=−1となり、一次直線式はY=X/300−1となる。
Y = a ′ × X + b (1)
For example, as indicated by a dotted line b in FIG. 17, when the analog signal Y is 0 (V), the digital value X is 300, and when the analog signal Y is 5.0 (V), the digital value X is 1800, the slope a = 1/300, intercept b = -1, and the linear equation is Y = X / 300-1.

このように、A/D変換回路12によるA/D変換にばらつきが存在する場合は、マイコン11に標準的に組み込まれた一次直線式の代わりに、A/D変換の誤差を校正するための一次直線式(上記の式(1))を求める必要があった。   As described above, when there is a variation in the A / D conversion by the A / D conversion circuit 12, the error for A / D conversion is calibrated instead of the linear linear expression built in the microcomputer 11 as a standard. It was necessary to obtain a linear equation (the above equation (1)).

以下に、従来のA/D変換ユニット1において変換誤差を校正するための一次直線式を求める手順を図18のフローチャートに従って説明する。A/D変換ユニットに電源が投入されると(S61)、マイコン11が組込のプログラムを実行し、DIPSW15の1ビット目を確認する(S62)。1ビット目のスイッチがOFFであれば、マイコン11は通常モード(入力されたアナログ値をデジタル値に変換して出力するモード)で動作し、1ビット目のスイッチがONであれば、マイコン11は校正用の一次直線式を求める校正モードで動作する。   Hereinafter, a procedure for obtaining a linear equation for calibrating the conversion error in the conventional A / D conversion unit 1 will be described with reference to the flowchart of FIG. When power is turned on to the A / D conversion unit (S61), the microcomputer 11 executes a built-in program and confirms the first bit of the DIPSW 15 (S62). If the first bit switch is OFF, the microcomputer 11 operates in a normal mode (a mode in which an input analog value is converted into a digital value and output). If the first bit switch is ON, the microcomputer 11 operates. Operates in a calibration mode to obtain a linear equation for calibration.

A/D変換ユニットの使用開始時に一次直線式の校正処理を行う場合、ユーザはDIPSW15の1ビット目をONにした状態で電源を投入しており、S52の判定の結果、マイコン11の動作が校正モードに切り替えられる。校正モードにおいて、マイコン11は、先ずDIPSW15の2ビット目を確認し(S63)、2ビット目のスイッチがONにセットされていれば、A/D変換回路12の出力を基準デジタル値として取得する処理ルーチンを実行した後(S66)、ステップS62に戻る。また2ビット目のスイッチがOFFにセットされていた場合、マイコン11は、DIPSW15の3ビット目を確認し(S64)、3ビット目のスイッチがONにセットされていれば、基準デジタル値を登録する処理ルーチンを実行した後(S67)、ステップS62に戻る。また3ビット目のスイッチがOFFにセットされていた場合、マイコン11は、DIPSW15の4ビット目を確認し(S65)、4ビット目のスイッチがOFFにセットされていれば、ステップS62に戻り、4ビット目のスイッチがONにセットされていれば、基準デジタル値を消去する処理ルーチンを実行した後(S68)、ステップS62に戻る。而して、校正モードを実行する場合、ユーザは先ずDIPスイッチの2ビット目をON、3,4ビット目をOFFにした状態で、取得ルーチンを実行させて、基準デジタル値を取り込んだ後、DIPスイッチの3ビット目をON、2,4ビット目をOFFにして、登録ルーチンを実行させ、取り込んだ基準デジタル値をFROM14に登録させるのである。また校正モードにおいて、ユーザがDIPスイッチの4ビット目をON、2,3ビット目をOFFにすると、消去ルーチンが実行され、FROM14に登録された基準デジタル値が消去されるようになっている。   When the linear linear calibration process is performed at the start of use of the A / D conversion unit, the user turns on the power with the first bit of the DIPSW 15 turned ON, and the operation of the microcomputer 11 is determined as a result of the determination in S52. Switch to calibration mode. In the calibration mode, the microcomputer 11 first confirms the second bit of the DIPSW 15 (S63), and if the switch of the second bit is set to ON, acquires the output of the A / D conversion circuit 12 as a reference digital value. After executing the processing routine (S66), the process returns to step S62. If the second bit switch is set to OFF, the microcomputer 11 checks the third bit of the DIPSW 15 (S64), and if the third bit switch is set to ON, registers the reference digital value. After executing the processing routine (S67), the process returns to step S62. If the third bit switch is set to OFF, the microcomputer 11 checks the fourth bit of the DIPSW 15 (S65). If the fourth bit switch is set to OFF, the microcomputer 11 returns to step S62. If the fourth bit switch is set to ON, a processing routine for erasing the reference digital value is executed (S68), and the process returns to step S62. Thus, when executing the calibration mode, the user first executes the acquisition routine with the second bit of the DIP switch turned on and the third and fourth bits turned off, and after acquiring the reference digital value, The third bit of the DIP switch is turned on and the second and fourth bits are turned off to execute the registration routine, and the fetched reference digital value is registered in the FROM 14. In the calibration mode, when the user turns on the fourth bit of the DIP switch and turns off the second and third bits, the erasing routine is executed, and the reference digital value registered in the FROM 14 is erased.

ここで、基準デジタル値の取得ルーチン、登録ルーチン、および、消去ルーチンについて図19〜図21を参照して説明する。   Here, the reference digital value acquisition routine, registration routine, and erasure routine will be described with reference to FIGS.

図19は基準デジタル値を取得する処理ルーチンのフローチャートであり、基準デジタル値として2点の出力D0、D1を取り込むようになっている。出力D0,D1に対応するアナログ信号レベルは予め決められており、例えば出力D0はアナログ信号が0.0Vの時、出力D1はアナログ信号が5.0Vの時の出力である。マイコン11が取得ルーチンを開始すると、マイコン11はA/D変換回路12から出力(デジタル値)を読み込み(S81)、基準デジタル値D0がクリアされているか否かを判定し(S82)、クリアされていれば、取得したデジタル値を基準デジタル値D0とし(S83)、取得ルーチンを終了する。一方、S82の判定において基準デジタル値D0がクリアされていなければ、マイコン11は、基準デジタル値D1がクリアされているか否かを判定し(S84)、クリアされていれば、取得したデジタル値を基準デジタル値D1とし(S85)、取得ルーチンを終了する。一方、S84の判定において基準デジタル値D1がクリアされていなければ、マイコン11は、基準デジタル値D0,D1の取り込みが完了したものと判断し、取得ルーチンを終了する。尚、ユーザは取得ルーチンを実行させる場合、DIPSW15の2ビット目をONする前に、基準デジタル値D0又はD1に対応したアナログ信号をA/D変換回路12の入力端に印加しておくものとし、例えば、基準デジタル値D0に対応したアナログ信号を入力した状態で、上記取得ルーチンを実行することによって基準デジタル値D0が取り込まれ、その後、基準デジタル値D1に対応したアナログ信号を入力した状態で、上記取得ルーチンを実行することによって基準デジタル値D1が取り込まれるのである。   FIG. 19 is a flowchart of a processing routine for acquiring a reference digital value, and two outputs D0 and D1 are captured as the reference digital value. The analog signal levels corresponding to the outputs D0 and D1 are determined in advance. For example, the output D0 is an output when the analog signal is 0.0V, and the output D1 is an output when the analog signal is 5.0V. When the microcomputer 11 starts the acquisition routine, the microcomputer 11 reads the output (digital value) from the A / D conversion circuit 12 (S81), determines whether or not the reference digital value D0 is cleared (S82), and is cleared. If so, the acquired digital value is set as the reference digital value D0 (S83), and the acquisition routine is terminated. On the other hand, if the reference digital value D0 is not cleared in the determination of S82, the microcomputer 11 determines whether or not the reference digital value D1 is cleared (S84). The reference digital value D1 is set (S85), and the acquisition routine is terminated. On the other hand, if the reference digital value D1 is not cleared in the determination of S84, the microcomputer 11 determines that the acquisition of the reference digital values D0 and D1 has been completed, and ends the acquisition routine. When executing the acquisition routine, the user applies an analog signal corresponding to the reference digital value D0 or D1 to the input terminal of the A / D conversion circuit 12 before turning on the second bit of DIPSW15. For example, in a state where an analog signal corresponding to the reference digital value D0 is input, the reference digital value D0 is acquired by executing the above acquisition routine, and thereafter, an analog signal corresponding to the reference digital value D1 is input. The reference digital value D1 is captured by executing the acquisition routine.

また、図20(a)は基準デジタル値D0,D1を登録する処理ルーチンのフローチャートを示し、同図(b)はFROM14の初期状態のメモリマップを、同図(c)はFROM14に1データが書き込まれた状態のメモリマップをそれぞれ示している。尚、図中の○はFROM14のアドレス14aのうち、データが未書込でアドレス番号が最小のアドレス(先頭アドレス)を示し、斜線を付したアドレスはデータ書込済みのアドレスをそれぞれ示している。マイコン11が登録ルーチンを開始すると、図20(b)に示すようにマイコン11はFROM14のデータを消去し(S86)、FROM14の書き込みポインタを先頭アドレスに移動させた後(S87)、図20(c)に示すように取得ルーチンで取得した基準デジタル値D0およびD1を1データとしてFROM14に書き込み(S88)、登録ルーチンを終了する。   20A shows a flowchart of a processing routine for registering the reference digital values D0 and D1, FIG. 20B shows a memory map in the initial state of the FROM 14, and FIG. 20C shows one data in the FROM 14. A memory map in a written state is shown. In the figure, ○ indicates the address (start address) in which the data is not written and the address number is the smallest among the addresses 14a of the FROM 14, and the hatched address indicates the address where the data has been written. . When the microcomputer 11 starts the registration routine, as shown in FIG. 20B, the microcomputer 11 erases the data in the FROM 14 (S86), moves the write pointer of the FROM 14 to the head address (S87), As shown in c), the reference digital values D0 and D1 acquired in the acquisition routine are written in the FROM 14 as one data (S88), and the registration routine is terminated.

また図21(a)は基準デジタル値D0,D1を消去する処理ルーチンのフローチャート、図21(b)はFROM14のメモリマップをそれぞれ示し、図中の○はFROM14の先頭アドレスを示している。マイコン11が消去ルーチンを開始すると、マイコン11はFROM14に格納されたデータを消去するとともに(S89)、基準デジタル値D0,D1をクリアした後(S90)、消去ルーチンを終了する。   FIG. 21A shows a flowchart of a processing routine for deleting the reference digital values D0 and D1, FIG. 21B shows a memory map of the FROM 14, and “◯” in the figure shows the leading address of the FROM 14. When the microcomputer 11 starts the erase routine, the microcomputer 11 erases the data stored in the FROM 14 (S89), clears the reference digital values D0 and D1 (S90), and ends the erase routine.

校正モードの処理を終え、ユーザがDIPSW15の1ビット目をOFFにすると、マイコン11は、図18のS62の判定の結果、動作モードを通常モードに切り替え、校正モードで求めた基準デジタル値D0,D1を用いて一次直線式を設定する処理ルーチンを実行する(S69)。   When the processing in the calibration mode is completed and the user turns OFF the first bit of DIPSW 15, the microcomputer 11 switches the operation mode to the normal mode as a result of the determination in S62 of FIG. 18, and the reference digital value D0, A processing routine for setting a linear expression using D1 is executed (S69).

図22(a)は一次直線式を設定する処理ルーチンのフローチャート、同図(b)はFROM14の初期状態のメモリマップ、同図(c)はFROM14に1データが書き込まれている状態のメモリマップをそれぞれ示している。マイコン11は、一次直線式を設定する処理ルーチンを開始すると、FROM14に書き込まれたデータの有無を確認し(S91)、図22(c)に示すように書き込みデータがあれば、FROM14の読み出しポインタを先頭アドレスに移動させ(S92)、FROM14から1データを読み出して、基準デジタル値D0,D1とし、基準デジタル値D0,D1をRAM13に記憶させる(S93)。そして、マイコン11では、基準デジタル値D0,D1の値とそれに対応するアナログ信号の信号レベルから、一次直線式の傾きa’と切片bとを演算により求めた後、アナログ−デジタル変換回路51の出力からアナログ信号の信号レベルを求める一次直線式を設定し(S94)、処理ルーチンを終了する。またS91の判定の結果、図22(b)に示すように書き込みデータがなければ、マイコン11は、予め組み込まれている標準の一次直線式を使用する一次直線式に設定した後(S95)、処理ルーチンを終了する。   22A is a flowchart of a processing routine for setting a linear equation, FIG. 22B is a memory map in the initial state of the FROM 14, and FIG. 22C is a memory map in which one data is written in the FROM 14. Respectively. When the microcomputer 11 starts a processing routine for setting a linear equation, it checks the presence or absence of data written in the FROM 14 (S91), and if there is write data as shown in FIG. Is moved to the head address (S92), one data is read out from the FROM 14 to be the reference digital values D0 and D1, and the reference digital values D0 and D1 are stored in the RAM 13 (S93). In the microcomputer 11, the slope a ′ and intercept b of the linear linear equation are obtained by calculation from the values of the reference digital values D 0 and D 1 and the signal level of the corresponding analog signal, and then the analog-digital conversion circuit 51 A linear equation for obtaining the signal level of the analog signal from the output is set (S94), and the processing routine is terminated. As a result of the determination in S91, if there is no write data as shown in FIG. 22B, the microcomputer 11 sets a primary linear equation using a standard linear equation built in beforehand (S95), The processing routine ends.

通常モードにおいて一次直線式の設定処理(S69)が終了すると、マイコン11は、所定の演算周期(サンプリング周期)に達したか否かを判断し(S70)、演算周期に達していれば、A/D変換回路12から中間出力値(デジタル値)を取り込み(S71)、S69で設定した一次直線式に中間出力値を代入してアナログ信号の信号レベルを演算により求めた後(S72)、算出した信号レベル(アナログ値)を外部装置に出力する(S73)。
特開2005−57468号公報(段落[0007]−[0009]、及び、第1図)
When the linear linear type setting process (S69) is completed in the normal mode, the microcomputer 11 determines whether or not a predetermined calculation period (sampling period) has been reached (S70). The intermediate output value (digital value) is taken from the / D conversion circuit 12 (S71), the intermediate output value is substituted into the linear equation set in S69, and the signal level of the analog signal is obtained by calculation (S72) and then calculated. The signal level (analog value) is output to the external device (S73).
Japanese Patent Laying-Open No. 2005-57468 (paragraphs [0007]-[0009] and FIG. 1)

上述のA/D変換ユニットでは、A/D変換回路12の中間出力値(デジタル値)から入力されたアナログ量の信号レベル(大きさ)を演算するために用いる一次直線式の傾き及び切片を求める際に、DIPSW15を操作して動作モードを校正モードに切り替えるとともに、DIPSW15を操作して、校正モードにおける各処理ルーチンを実行させていた。したがって、A/D変換ユニットの基板にDIPSW15のようなユーザが手で操作するためのスイッチを実装する必要があり、このようなスイッチは人の手で操作できる程度の大きさに形成されているので、基板の小型化に限界があった。   In the A / D conversion unit described above, the slope and intercept of the linear linear equation used for calculating the signal level (magnitude) of the analog quantity input from the intermediate output value (digital value) of the A / D conversion circuit 12 are obtained. When obtaining, the DIPSW 15 is operated to switch the operation mode to the calibration mode, and the DIPSW 15 is operated to execute each processing routine in the calibration mode. Therefore, it is necessary to mount a switch such as the DIPSW 15 for a user to operate by hand on the substrate of the A / D conversion unit, and such a switch is formed to a size that can be operated by a human hand. Therefore, there was a limit to the miniaturization of the substrate.

本発明は上記問題点に鑑みて為されたものであり、その目的とするところは、A/D変換のばらつきを補正することが可能な小型のA/D変換ユニットを提供することにある。   The present invention has been made in view of the above problems, and an object thereof is to provide a small A / D conversion unit capable of correcting variations in A / D conversion.

上記目的を達成するために、請求項1の発明は、アナログ信号をA/D変換して、アナログ信号の信号レベルに比例した大きさの中間出力値を得るアナログ−デジタル変換部と、アナログ信号の信号レベルと中間出力値との関係を示す一次直線式に、中間出力値を代入してアナログ信号の信号レベルを演算する演算処理部と、演算処理部の演算データを一時的に記憶するRAMとを備え、演算処理部は、外部との間で通信を行う通信手段を有し、一次直線式の傾き及び切片を求める校正モードで動作中に、アナログ−デジタル変換部に所定レベルのアナログ信号が入力された状態で、外部装置から送信された基準デジタル値取得コマンドを通信手段を介して受信すると、コマンド受信時における中間出力値を基準デジタル値としてRAMに格納するとともに、基準デジタル値を応答信号として通信手段から外部装置へ送信させ、少なくとも2点の基準デジタル値および当該基準デジタル値に対応するアナログ信号の信号レベルに基づいて一次直線式の傾き及び切片を算出することを特徴とする。   In order to achieve the above object, an invention according to claim 1 is an analog-to-digital converter that performs A / D conversion of an analog signal to obtain an intermediate output value having a magnitude proportional to the signal level of the analog signal; An arithmetic processing unit that calculates the signal level of an analog signal by substituting the intermediate output value into a linear equation that indicates the relationship between the signal level and the intermediate output value, and a RAM that temporarily stores the operation data of the arithmetic processing unit The arithmetic processing unit has communication means for communicating with the outside, and operates in a calibration mode for obtaining a linear linear slope and intercept, an analog signal of a predetermined level is supplied to the analog-digital conversion unit. When the reference digital value acquisition command transmitted from the external device is received via the communication means in the input state, the intermediate output value at the time of command reception is stored in the RAM as the reference digital value. In addition, the reference digital value is transmitted as a response signal from the communication means to the external device, and the slope and intercept of the linear linear equation are obtained based on at least two reference digital values and the signal level of the analog signal corresponding to the reference digital value. It is characterized by calculating.

請求項2の発明は、請求項1の発明において、基準デジタル値を記憶させるFROMを備え、演算処理部が、基準デジタル値取得コマンドの受信後に、外部装置から送信された基準デジタル値登録コマンドを通信手段を介して受信すると、RAMに格納した基準デジタル値をFROMに格納し、当該基準デジタル値を応答信号として通信手段から外部装置へ返送させることを特徴とする。   According to a second aspect of the present invention, in the first aspect of the invention, there is provided a FROM for storing a reference digital value, and the arithmetic processing unit receives a reference digital value registration command transmitted from an external device after receiving the reference digital value acquisition command. When received via the communication means, the reference digital value stored in the RAM is stored in the FROM, and the reference digital value is returned as a response signal from the communication means to the external device.

請求項3の発明は、請求項2の発明において、演算処理部が、外部装置から送信された基準デジタル値消去コマンドを通信手段を介して受信すると、RAMおよびFROMに格納されている基準デジタル値を消去した後、消去完了を示すデータを応答信号として通信手段から外部装置へ返送させることを特徴とする請求項2記載のA/D変換ユニット。   According to a third aspect of the present invention, in the second aspect of the present invention, when the arithmetic processing unit receives the reference digital value erasure command transmitted from the external device via the communication means, the reference digital value stored in the RAM and FROM. 3. The A / D conversion unit according to claim 2, wherein after the data is erased, data indicating completion of data erase is returned as a response signal from the communication means to the external device.

請求項4の発明は、請求項1の発明において、演算処理部が、FROMに基準デジタル値を書き込む前にFROM内のデータを消去する処理を、FROMに空き容量が無い場合のみ行うことを特徴とする。   According to a fourth aspect of the present invention, in the first aspect of the invention, the arithmetic processing unit performs the process of erasing the data in the FROM before writing the reference digital value into the FROM only when there is no free space in the FROM. And

請求項5の発明は、請求項1乃至4の何れかの発明において、演算処理部が、外部装置から送信された一次直線式を算出させるための一次直線式読み出しコマンドを通信手段を介して受信すると、RAMに格納された複数の基準デジタル値と各基準デジタル値に対応するアナログ信号の信号レベルとに基づいて、一次直線式の傾き及び切片を算出し、算出した傾き及び切片を応答信号として通信手段から外部装置へ返送させることを特徴とする。   According to a fifth aspect of the present invention, in any one of the first to fourth aspects of the present invention, the arithmetic processing unit receives, via the communication means, a primary linear expression read command for calculating a linear expression that is transmitted from an external device. Then, based on the plurality of reference digital values stored in the RAM and the signal level of the analog signal corresponding to each reference digital value, the slope and intercept of the linear linear equation are calculated, and the calculated slope and intercept are used as response signals. It is characterized in that it is returned from the communication means to the external device.

請求項6の発明は、請求項1乃至5の何れかの発明において、外部装置から送信される基準デジタル値取得コマンドに、基準デジタル値に対応するアナログ信号の信号レベル情報が付加されており、演算処理部は、基準デジタル値取得コマンドに付加された信号レベル情報と、コマンド受信時に取得した基準デジタル値とをもとに、一次直線式の傾き及び切片を算出することを特徴とする。   The invention of claim 6 is the invention of any one of claims 1 to 5, wherein signal level information of an analog signal corresponding to the reference digital value is added to the reference digital value acquisition command transmitted from the external device, The arithmetic processing unit calculates the slope and intercept of the linear equation based on the signal level information added to the reference digital value acquisition command and the reference digital value acquired when the command is received.

請求項7の発明は、請求項1乃至6の何れかの発明において、校正モードにおいてアナログ−デジタル変換部に入力されるアナログ信号の信号レベルが少なくとも3通りに切り替えられ、アナログ信号の信号レベルが切り替えられる毎に、外部装置から基準デジタル値取得コマンドが送信されており、演算処理部は、基準デジタル値取得コマンドの受信時に取得した少なくとも3つの基準デジタル値および各基準デジタル値に対応するアナログ信号の信号レベルに基づいて、少なくとも3つの基準デジタル値の各区間毎にアナログ信号の信号レベルと中間出力値との関係を示す一次直線式の傾き及び切片を求めたことを特徴とする。   According to a seventh aspect of the present invention, in any one of the first to sixth aspects, the signal level of the analog signal input to the analog-digital conversion unit in the calibration mode is switched in at least three ways, and the signal level of the analog signal is changed. Each time switching is performed, a reference digital value acquisition command is transmitted from the external device, and the arithmetic processing unit acquires at least three reference digital values acquired when receiving the reference digital value acquisition command and an analog signal corresponding to each reference digital value On the basis of the signal level, a slope and an intercept of a linear linear expression indicating the relationship between the signal level of the analog signal and the intermediate output value are obtained for each section of at least three reference digital values.

請求項1の発明によれば、演算処理部が校正モードで動作中に、アナログ−デジタル変換部に所定レベルのアナログ信号が入力された状態で、外部装置からの基準デジタル値取得コマンドを通信手段を介して受信すると、コマンド受信時における中間出力値を基準デジタル値としてRAMに格納しているおり、少なくとも2点の基準デジタル値および当該基準デジタル値に対応したアナログ信号の信号レベルに基づいて一次直線式の傾き及び切片を算出しているので、アナログ−デジタル変換部のばらつきによる変換誤差を低減することができる。したがって、従来のA/D変換ユニットのようにDIPスイッチなどの機械的なスイッチを用いて、校正モードに切り替えたり、基準デジタル値を取得させたりする必要が無く、DIPスイッチなどの機械的なスイッチが不要になるから、A/D変換のばらつきを補正することが可能な小型のA/D変換ユニットを実現できる。さらに、演算処理部では、基準デジタル値取得コマンドの受信時に取得した基準デジタル値を外部装置に返送しているので、一次直線式の傾きや切片を求めるために使用する基準デジタル値を外部装置側で確認することができ、アナログ信号の信号レベルに合致した基準デジタル値を取得できているか否かで、一次直線式の校正が良好に行えるか否かを校正時に推測できる。したがって、基準デジタル値が対応するアナログ信号の信号レベルに合致していない場合は、外部装置側で基準デジタル値取得コマンドを再送することによって適切な基準デジタル値を取得させることができ、校正モードの終了後に正常に行えなかったことが判明して再度校正をやり直すといった事態を防止できるから、一次直線式の校正作業にかかる時間を短縮することができる。   According to the first aspect of the present invention, when the arithmetic processing unit is operating in the calibration mode and the analog signal of a predetermined level is input to the analog-digital conversion unit, a reference digital value acquisition command from the external device is communicated. The intermediate output value at the time of receiving the command is stored in the RAM as a reference digital value, and the primary output is based on at least two reference digital values and the signal level of the analog signal corresponding to the reference digital value. Since the linear inclination and intercept are calculated, conversion errors due to variations in the analog-digital conversion unit can be reduced. Therefore, there is no need to switch to the calibration mode or acquire the reference digital value using a mechanical switch such as a DIP switch as in the conventional A / D conversion unit, and a mechanical switch such as a DIP switch. Therefore, a small A / D conversion unit capable of correcting variations in A / D conversion can be realized. In addition, the arithmetic processing unit returns the reference digital value acquired at the time of receiving the reference digital value acquisition command to the external device, so that the reference digital value used to obtain the slope and intercept of the linear linear equation is set on the external device side. Whether or not the linear linear calibration can be satisfactorily performed can be estimated based on whether or not the reference digital value matching the signal level of the analog signal can be acquired. Therefore, if the reference digital value does not match the signal level of the corresponding analog signal, an appropriate reference digital value can be acquired by resending the reference digital value acquisition command on the external device side, and the calibration mode Since it is possible to prevent a situation in which calibration cannot be performed normally after completion and the calibration is performed again, it is possible to reduce the time required for the linear linear calibration work.

請求項2の発明によれば、演算処理部が、基準デジタル値登録コマンドの受信時にFROMに格納する基準デジタル値を外部装置に返送しているので、FROMに格納された基準デジタル値を外部装置側で確認することができ、アナログ信号の信号レベルに合致した基準デジタル値を取得できているか否かで、一次直線式の校正が良好に行えるか否かを校正時に推測できるという効果がある。   According to the second aspect of the present invention, the arithmetic processing unit returns the reference digital value stored in the FROM to the external device when the reference digital value registration command is received. There is an effect that it can be estimated at the time of calibration whether or not the linear linear calibration can be satisfactorily performed based on whether or not the reference digital value matching the signal level of the analog signal can be acquired.

請求項3の発明によれば、演算処理部が、基準デジタル値消去コマンドの受信時にRAMおよびFROMに格納されている基準デジタル値を消去すると、消去完了を示すデータを外部装置に返送させているので、外部装置側でRAMおよびFROMに格納された基準デジタル値が正常に消去できたか否かをその場で確認することができる。したがって、外部装置側では、消去完了を示すデータを受信できない場合に、基準デジタル値消去コマンドを再度送信することで、RAMおよびFROMに格納された基準デジタル値を確実に消去させることができる。   According to the invention of claim 3, when the arithmetic processing unit erases the reference digital value stored in the RAM and the FROM when receiving the reference digital value erase command, the data indicating the completion of the erase is returned to the external device. Therefore, it can be confirmed on the spot whether or not the reference digital values stored in the RAM and FROM can be normally erased on the external device side. Accordingly, when the data indicating the completion of erasure cannot be received on the external device side, the reference digital value stored in the RAM and FROM can be surely erased by transmitting the reference digital value erasure command again.

請求項4の発明によれば、FROMに空き容量がある場合は、FROM内のデータを消去する処理が行われないので、データを消去する時間を省いて、データの書き込みに要する時間を短縮することができる。またFROMの寿命は消去回数に依存するため、消去回数を減らすことで、FROMの寿命を延ばすことができる。   According to the fourth aspect of the present invention, when there is a free space in the FROM, the process of deleting the data in the FROM is not performed, so that the time required for writing the data is reduced by omitting the time for deleting the data. be able to. Since the life of the FROM depends on the number of times of erasing, the life of the FROM can be extended by reducing the number of times of erasing.

請求項5の発明によれば、演算処理部が、一次直線式の傾き及び切片を算出した結果を外部装置に返送しているので、演算処理部がどのような一次直線式を用いてアナログ信号の信号レベルを求めているのかを外部装置側で把握することができる。したがって、演算処理部が使用している一次直線式の傾き及び切片が不適切な場合には、外部装置側から基準デジタル値取得コマンドや基準デジタル値登録コマンドや一次直線式読み出しコマンドをA/D変換ユニットに送信することで、一次直線式の傾き及び切片を算出する処理を再度実行させることができる。   According to the invention of claim 5, since the arithmetic processing unit returns the result of calculating the slope and intercept of the linear linear equation to the external device, the arithmetic processing unit uses any linear linear equation to determine the analog signal. It is possible for the external device side to grasp whether the signal level is obtained. Therefore, when the slope and intercept of the primary linear expression used by the arithmetic processing unit are inappropriate, a reference digital value acquisition command, a reference digital value registration command, or a primary linear expression read command is sent from the external device side to the A / D. By transmitting to the conversion unit, the process of calculating the slope and intercept of the linear equation can be executed again.

請求項6の発明によれば、外部装置から基準デジタル値取得コマンドと共に送られたアナログ信号の信号レベル情報と、コマンド受信時に取得した基準デジタル値とを用いて、一次直線式の切片及び傾きを算出することができるので、入出力の仕様や測定対象のアナログ信号の信号レベルに合わせて、基準デジタル値を取得する際に与えるアナログ信号の信号レベルを途中で変更することができ、個々のA/D変換ユニット毎に使用形態に合わせた最適な一次直線式を設定することができる。   According to the sixth aspect of the present invention, the intercept and slope of the linear equation can be obtained by using the signal level information of the analog signal sent together with the reference digital value acquisition command from the external device and the reference digital value acquired when the command is received. Since it can be calculated, the signal level of the analog signal given when acquiring the reference digital value can be changed in the middle according to the input / output specifications and the signal level of the analog signal to be measured. An optimal linear linear equation can be set for each / D conversion unit according to the usage pattern.

ここで、アナログ信号の信号レベルと中間出力値との関係が一次直線式で表せない場合、中間出力値を一つの一次直線式に代入してアナログ信号の信号レベルを求めると、一次直線式を用いて算出した信号レベルと実際の信号レベルとの間に誤差が発生するが、請求項7の発明によれば、少なくとも3つの基準デジタル値の各区間毎にアナログ信号の信号レベルと中間出力値との関係を示す一次直線式の傾き及び切片を求め、各区間毎に求めた一次直線式を用いて中間出力値からアナログ信号の信号レベルを算出しているので、一次直線式を用いて算出した信号レベルと実際の信号レベルとの誤差を小さくすることができる。   Here, when the relationship between the signal level of the analog signal and the intermediate output value cannot be expressed by a linear expression, the linear output is obtained by substituting the intermediate output value into one primary linear expression to obtain the signal level of the analog signal. Although an error occurs between the signal level calculated using the actual signal level, the signal level of the analog signal and the intermediate output value for each section of at least three reference digital values. The slope and intercept of the linear linear equation that shows the relationship between and the signal level of the analog signal is calculated from the intermediate output value using the linear linear equation obtained for each section, so calculate using the linear linear equation The error between the measured signal level and the actual signal level can be reduced.

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

(実施形態1)
図1は本実施形態のA/D変換ユニット1の概略構成を示すブロック図であり、演算処理部としてのマイコン11と、アナログ−デジタル変換回路12(アナログ−デジタル変換部)と、RAM13と、FROM14とを主要な構成として備え、マイコン11は、拡張バス3を介して外部装置たる制御装置2との間で通信を行う通信ポート11a(通信手段)を有している。このA/D変換ユニット1では、入力されたアナログ信号をアナログ−デジタル変換回路12によりA/D変換して、アナログ信号の信号レベルに比例した大きさの中間出力値を得た後、マイコン11が、アナログ−デジタル変換回路12から入力された中間出力値を、中間出力値とアナログ信号の信号レベルとの関係を示す一次直線式に代入してアナログ信号の信号レベルを演算により求めており、演算により求めた信号レベルのデータを通信ポート11aから拡張バス3を介してPLCなどの制御装置2(外部装置)へ送信している。尚、アナログ−デジタル変換回路12に入力されるアナログ信号の信号レベルをY、変換後の中間出力値(デジタル値)をXとすると、上述の一次直線式はY=a×X+bと表される。
(Embodiment 1)
FIG. 1 is a block diagram showing a schematic configuration of an A / D conversion unit 1 according to the present embodiment. A microcomputer 11 as an arithmetic processing unit, an analog-digital conversion circuit 12 (analog-digital conversion unit), a RAM 13, The microcomputer 11 includes a FROM 14 as a main configuration, and the microcomputer 11 includes a communication port 11a (communication means) that communicates with the control device 2 that is an external device via the expansion bus 3. In the A / D conversion unit 1, the input analog signal is A / D converted by the analog-digital conversion circuit 12 to obtain an intermediate output value having a magnitude proportional to the signal level of the analog signal, and then the microcomputer 11. However, by substituting the intermediate output value input from the analog-digital conversion circuit 12 into a linear equation representing the relationship between the intermediate output value and the signal level of the analog signal, the signal level of the analog signal is obtained by calculation, Data of the signal level obtained by the calculation is transmitted from the communication port 11a to the control device 2 (external device) such as PLC via the expansion bus 3. If the signal level of the analog signal input to the analog-digital conversion circuit 12 is Y and the intermediate output value (digital value) after conversion is X, the above linear expression is expressed as Y = a × X + b. .

このA/D変換ユニット1の動作を図2のフローチャートに従って説明する。A/D変換ユニット1に電源が投入されると(S1)、マイコン11が組込のプログラムを実行し、電源投入後2秒以内に制御装置2からのコマンドを受信したか否かを判定する(S2)。ここで、電源投入後2秒以内に制御装置2からのコマンドを受信した場合は、マイコン11の動作モードが、校正用の一次直線式(傾きa及び切片b)を求める校正モードに切り替えられ、コマンドを受信していない場合は、入力されたアナログ信号のA/D変換を行う通常モードに切り替えられる。   The operation of the A / D conversion unit 1 will be described with reference to the flowchart of FIG. When the power is turned on to the A / D conversion unit 1 (S1), the microcomputer 11 executes a built-in program to determine whether or not a command from the control device 2 is received within 2 seconds after the power is turned on. (S2). Here, when a command is received from the control device 2 within 2 seconds after the power is turned on, the operation mode of the microcomputer 11 is switched to a calibration mode for obtaining a linear linear equation (inclination a and intercept b) for calibration, When no command is received, the mode is switched to the normal mode in which A / D conversion of the input analog signal is performed.

先ず、通常モードでの動作について説明する。S2においてコマンドを受信していないと判断された場合、マイコン11は、後述の校正モードにおいて傾き及び切片が算出された一次直線式を設定した後(S13)、所定の演算周期(サンプリング周期)に達したか否かを判断し(S14)、演算周期に達していれば、アナログ−デジタル変換回路12から中間出力値(デジタル値)を取り込み(S15)、S13で設定した一次直線式にS15で取り込んだ中間出力値を代入してアナログ信号の信号レベル(アナログ値)を演算により求めた後(S16)、算出した信号レベルを拡張バス3を介して制御装置2に出力する(S17)。この時、制御装置2では、A/D変換ユニット1から拡張バス3を介して入力された信号レベルのデータをもとに、フィードバック制御やデータ蓄積などを行うようになっており、例えばA/D変換ユニット1にアナログ信号として温度センサの出力(電流値又は電圧値)が入力される場合には、制御装置2が温度センサの信号レベルに基づいて温度制御や温度データの蓄積などを行うことができる。   First, the operation in the normal mode will be described. If it is determined in S2 that the command has not been received, the microcomputer 11 sets a linear equation whose slope and intercept are calculated in the calibration mode described later (S13), and then at a predetermined calculation cycle (sampling cycle). It is determined whether or not it has been reached (S14), and if the calculation period has been reached, an intermediate output value (digital value) is taken from the analog-digital conversion circuit 12 (S15), and the linear linear equation set in S13 is obtained in S15. After the obtained intermediate output value is substituted and the signal level (analog value) of the analog signal is obtained by calculation (S16), the calculated signal level is output to the control device 2 via the expansion bus 3 (S17). At this time, the control device 2 performs feedback control and data accumulation based on the signal level data input from the A / D conversion unit 1 via the expansion bus 3. When the output (current value or voltage value) of the temperature sensor is input as an analog signal to the D conversion unit 1, the control device 2 performs temperature control, accumulation of temperature data, and the like based on the signal level of the temperature sensor. Can do.

次に、校正モードでの動作について説明する。S2においてコマンドを受信したと判断された場合、マイコン11は、受信したコマンドが基準デジタル値取得コマンドであるか否かを判定し(S3)、基準デジタル値取得コマンドであれば、基準デジタル値を取得する処理ルーチンを実行する(S7)。また基準デジタル値取得コマンドでなければ、マイコン11は、受信したコマンドが基準デジタル値登録コマンドであるか否かを判定し(S4)、基準デジタル値登録コマンドであれば、基準デジタル値を登録する処理ルーチンを実行する(S8)。また基準デジタル値登録コマンドでなければ、マイコン11は、受信したコマンドが基準デジタル値消去コマンドであるか否かを判定し(S5)、基準デジタル値消去コマンドであれば、基準デジタル値を消去する処理ルーチンを実行する(S9)。また基準デジタル値消去コマンドでなければ、マイコン11は、受信したコマンドが一次直線式読み出しコマンドであるか否かを判定し(S6)、一次直線式読み出しコマンドであれば、一次直線式を算出する処理ルーチンを実行し(S10)、一次直線式読み出しコマンドでなければ、ステップS3に戻って処理を繰り返す。また、ステップS7〜S10で各処理ルーチンを実行すると、マイコン11は、受信したコマンドに対する応答信号(レスポンス)を作成し(S11)、通信ポート11aを介して制御装置2に返送する。   Next, the operation in the calibration mode will be described. If it is determined in S2 that the command has been received, the microcomputer 11 determines whether or not the received command is a reference digital value acquisition command (S3). If the command is a reference digital value acquisition command, the microcomputer 11 determines the reference digital value. A processing routine to be acquired is executed (S7). If it is not a reference digital value acquisition command, the microcomputer 11 determines whether or not the received command is a reference digital value registration command (S4), and if it is a reference digital value registration command, registers the reference digital value. A processing routine is executed (S8). If it is not a reference digital value registration command, the microcomputer 11 determines whether or not the received command is a reference digital value deletion command (S5). If it is a reference digital value deletion command, the microcomputer 11 deletes the reference digital value. A processing routine is executed (S9). If it is not a reference digital value erasure command, the microcomputer 11 determines whether or not the received command is a primary linear read command (S6), and if it is a primary linear read command, calculates a primary linear equation. A processing routine is executed (S10), and if it is not a linear linear read command, the process returns to step S3 and is repeated. When each processing routine is executed in steps S7 to S10, the microcomputer 11 creates a response signal (response) to the received command (S11), and returns it to the control device 2 via the communication port 11a.

ここで、基準デジタル値の取得ルーチン、登録ルーチン、消去ルーチンおよび一次直線式の算出ルーチンについて図3〜図6を参照して説明する。   Here, a reference digital value acquisition routine, a registration routine, an erasure routine, and a linear linear calculation routine will be described with reference to FIGS.

図3は基準デジタル値を取得する処理ルーチンのフローチャートであり、本実施形態では基準デジタル値として2点の中間出力値D0、D1を取り込むようになっている。中間出力値D0,D1に対応するアナログ信号レベルは予め決められており、例えば中間出力値D0はアナログ信号が0.0Vの時、中間出力値D1はアナログ信号が5.0Vの時の中間出力値である。なお、制御装置2から基準デジタル値取得コマンドを送信する前に所定レベルのアナログ信号がアナログ−デジタル変換回路12に入力されているものとする。マイコン11が取得ルーチンを開始すると、マイコン11はアナログ−デジタル変換回路12から中間出力値(デジタル値)を読み込み(S21)、受信した基準デジタル値取得コマンドに対応する基準デジタル値の種別を判定する(S22)。すなわち、基準デジタル値取得コマンドには取得する基準デジタル値の種別(D0又はD1)を示す情報が付加されており、基準デジタル値の種別がD0であれば、マイコン11は、S21で読み込んだ中間出力値を基準デジタル値D0としてRAM13に格納し(S23)、処理ルーチンを終了する。一方、基準デジタル値の種別がD1であれば、マイコン11は、S21で読み込んだ中間出力値を基準デジタル値D1としてRAM13に格納し(S24)、処理ルーチンを終了する。またマイコン11は、基準デジタル値の取得ルーチンを終了すると、RAM13に格納した基準デジタル値を応答信号として、通信ポート11aから制御装置2へ返送させる(S11,S12)。   FIG. 3 is a flowchart of a processing routine for acquiring a reference digital value. In this embodiment, two intermediate output values D0 and D1 are taken in as reference digital values. The analog signal levels corresponding to the intermediate output values D0 and D1 are determined in advance. For example, the intermediate output value D0 is an intermediate output when the analog signal is 0.0V, and the intermediate output value D1 is an intermediate output when the analog signal is 5.0V. Value. It is assumed that an analog signal of a predetermined level is input to the analog-digital conversion circuit 12 before transmitting a reference digital value acquisition command from the control device 2. When the microcomputer 11 starts the acquisition routine, the microcomputer 11 reads the intermediate output value (digital value) from the analog-digital conversion circuit 12 (S21), and determines the type of the reference digital value corresponding to the received reference digital value acquisition command. (S22). That is, information indicating the type of reference digital value (D0 or D1) to be acquired is added to the reference digital value acquisition command. If the type of reference digital value is D0, the microcomputer 11 reads the intermediate value read in S21. The output value is stored in the RAM 13 as the reference digital value D0 (S23), and the processing routine is terminated. On the other hand, if the type of the reference digital value is D1, the microcomputer 11 stores the intermediate output value read in S21 in the RAM 13 as the reference digital value D1 (S24), and ends the processing routine. When the microcomputer 11 completes the reference digital value acquisition routine, it returns the reference digital value stored in the RAM 13 as a response signal from the communication port 11a to the control device 2 (S11, S12).

次に、RAM13に格納された基準デジタル値D0,D1をFROM14に登録する処理ルーチンを図4(a)に示すフローチャートに基づいて説明する。尚、図4(b)は初期状態のFROM14のメモリマップ、同図(c)は1データが書き込まれた状態のメモリマップ、同図(d)は2データが書き込まれた状態のメモリマップ、同図(e)は6データが書き込まれた状態のメモリマップであり、複数のアドレス14aの内、斜線を付したアドレスは書き込み済みのアドレスを示し、○は未書き込みのアドレスの内、アドレス番号が最小のアドレスを、●は書き込み済みのアドレスのうちアドレス番号が最大のアドレスをそれぞれ示している。マイコン11が登録ルーチンを開始すると、マイコン11は、FROM14に空き容量があるか否かを判定し(S31)、図4(b)〜(d)に示すように空き容量がある場合には、FROM14の書き込みポインタを未書き込みのアドレスのうちアドレス番号が最小のアドレス(○のアドレス)に移動させ(S32)、基準デジタル値D0,D1を1データとしてFROM14に書き込み(S34)、書込ルーチンを終了する。また、S31の判定の結果、図4(e)に示すようにFROM14に空き容量が無い場合、マイコン11は、FROM14内のデータを全て消去した後(S33)、S32に移行し上述と同様の処理を行う。そして、マイコン11は、基準デジタル値の登録ルーチンを終了すると、FROM14に格納した基準デジタル値を応答信号として、通信ポート11aから制御装置2へ返送させる(S11,S12)。   Next, a processing routine for registering the reference digital values D0 and D1 stored in the RAM 13 in the FROM 14 will be described based on the flowchart shown in FIG. 4B is a memory map of the FROM 14 in the initial state, FIG. 4C is a memory map in which one data is written, FIG. 4D is a memory map in which two data are written, FIG. 6E is a memory map in a state where 6 data are written. Among the plurality of addresses 14a, hatched addresses indicate written addresses, and ◯ indicates an address number among unwritten addresses. Indicates the smallest address, and ● indicates the address with the largest address number among the written addresses. When the microcomputer 11 starts the registration routine, the microcomputer 11 determines whether or not the FROM 14 has a free space (S31), and when there is a free space as shown in FIGS. 4B to 4D, The write pointer of the FROM 14 is moved to the address (o address) with the smallest address number among the unwritten addresses (S32), the reference digital values D0 and D1 are written as one data in the FROM 14 (S34), and the write routine is executed. finish. As a result of the determination in S31, if there is no free space in the FROM 14 as shown in FIG. 4 (e), the microcomputer 11 erases all the data in the FROM 14 (S33), then proceeds to S32 and is similar to the above. Process. When the microcomputer 11 finishes the reference digital value registration routine, the microcomputer 11 returns the reference digital value stored in the FROM 14 as a response signal from the communication port 11a to the control device 2 (S11, S12).

また、RAMおよびFROMに格納された基準デジタル値を消去する処理ルーチンを図5(a)のフローチャートに従って説明する。尚、図5(b)はFROM14のメモリマップをそれぞれ示し、○は未書き込みのアドレスの内、アドレス番号が最小のアドレスを示している。マイコン11が消去ルーチンを開始すると、図5(b)に示すようにFROM14内のデータを全て消去した後(S41)、RAM13内に格納された基準デジタル値D0,D1を消去して(S42)、消去ルーチンを終了する。そして、マイコン11は、基準デジタル値の消去ルーチンを終了すると、基準デジタル値の消去完了を示すデータを応答信号として通信ポート11aから制御装置2へ返送させる(S11,S12)。   A processing routine for erasing the reference digital value stored in the RAM and FROM will be described with reference to the flowchart of FIG. FIG. 5B shows a memory map of the FROM 14, and ◯ shows the address with the smallest address number among unwritten addresses. When the microcomputer 11 starts the erasing routine, as shown in FIG. 5B, after all the data in the FROM 14 is erased (S41), the reference digital values D0 and D1 stored in the RAM 13 are erased (S42). Then, the erase routine is terminated. When the microcomputer 11 completes the reference digital value erasing routine, it returns data indicating completion of erasing the reference digital value from the communication port 11a to the control device 2 as a response signal (S11, S12).

次に、一次直線式を算出する処理ルーチンについて図6(a)のフローチャートを参照して説明する。尚、図6(b)〜(e)はFROM14のメモリマップをそれぞれ示し、斜線を付したアドレスは書き込み済みのアドレスを示し、○は未書き込みのアドレスの内、アドレス番号が最小のアドレスを、●は書き込み済みのアドレスのうちアドレス番号が最大のアドレスをそれぞれ示している。マイコン11は、一次直線式の算出ルーチンを開始すると、先ずFROM14に書き込まれたデータの有無を判定する(S51)。ここで、図5(c)〜(e)に示すようにFROM14内に書込データがあれば、マイコン11は、FROM14の読み出しポインタを、アドレス番号が最大の書き込み済みアドレスに移動させた後(S52)、FROM14から1データを読み出して、基準デジタル値D0、D1とし(S53)、読み出した基準デジタル値D0,D1と各基準デジタル値D0,D1に対応するアナログ信号の信号レベルA0,A1とを用いて、一次直線式Y=a×X+bの傾きa=(A0−A1)/(D0−D1)と、切片b=(A0・D1−A1・D0)/(D1−D0)とを算出して、RAM13に格納した後(S54)、処理ルーチンを終了する。また、S51の判定の結果、図5(b)に示すようにFROM14に書込データがなければ、マイコン11は、予め設定されている標準の傾き及び切片を一次直線式に設定し(S55)、処理ルーチンを終了する。そして、マイコン11は、一次算出式の傾き及び切片の設定値を応答信号として通信ポート11aから制御装置2へ返送させる(S11,S12)。   Next, a processing routine for calculating a linear equation will be described with reference to the flowchart of FIG. 6B to 6E show the memory maps of the FROM 14, respectively, the hatched addresses indicate the addresses that have been written, the circles indicate the addresses that have the smallest address number among the unwritten addresses, ● indicates the address with the largest address number among the written addresses. When the microcomputer 11 starts the primary linear equation calculation routine, it first determines the presence or absence of data written in the FROM 14 (S51). Here, as shown in FIGS. 5C to 5E, if there is write data in the FROM 14, the microcomputer 11 moves the read pointer of the FROM 14 to the written address with the largest address number ( S52) One data is read out from the FROM 14 and set as reference digital values D0 and D1 (S53). The read reference digital values D0 and D1 and signal levels A0 and A1 of analog signals corresponding to the respective reference digital values D0 and D1 Is used to calculate the slope a = (A0−A1) / (D0−D1) and the intercept b = (A0 · D1−A1 · D0) / (D1−D0) in the linear equation Y = a × X + b. Then, after storing in the RAM 13 (S54), the processing routine is terminated. As a result of the determination in S51, if there is no write data in the FROM 14 as shown in FIG. 5B, the microcomputer 11 sets a standard inclination and intercept set in advance to a linear equation (S55). The processing routine is terminated. Then, the microcomputer 11 returns the slope of the primary calculation formula and the set value of the intercept as a response signal from the communication port 11a to the control device 2 (S11, S12).

校正モードにおけるマイコン11の動作は以上の通りであり、マイコン11が校正モードで動作中に、アナログ−デジタル変換回路12に所定レベルのアナログ信号が入力された状態で、制御装置2からの基準デジタル値取得コマンドを通信ポート11aを介して受信すると、コマンド受信時における中間出力値を基準デジタル値としてRAM13に格納している。そして、一次直線式の設定ルーチンでは、マイコン11が、少なくとも2点の基準デジタル値および当該基準デジタル値に対応したアナログ信号の信号レベルに基づいて、一次直線式の傾き及び切片を算出しているので、アナログ−デジタル変換回路12のばらつきによる変換誤差を低減することができる。したがって、従来のA/D変換ユニットのようにDIPスイッチなどの機械的なスイッチを用いて、校正モードに切り替えたり、基準デジタル値を取得させたりする必要が無く、DIPスイッチなどの機械的なスイッチが不要になるから、A/D変換のばらつきを補正することが可能な小型のA/D変換ユニット1を実現できる。さらに、マイコン11は、基準デジタル値取得コマンドの受信時に取得した基準デジタル値を制御装置2に返送しているので、一次直線式の傾きや切片を求めるために使用する基準デジタル値を制御装置2側で確認することができ、アナログ信号の信号レベルに合致した基準デジタル値を取得できているか否かで、一次直線式の校正が良好に行えるか否かを校正時に推測できる。したがって、基準デジタル値が対応するアナログ信号の信号レベルに合致していない場合は、制御装置2側で基準デジタル値取得コマンドを再送することによって適切な基準デジタル値を取得させることができ、校正モードの終了後に一次直線式の校正が正常に行えなかったことが判明して再度校正をやり直すといった事態を防止できるから、一次直線式の校正作業にかかる時間を短縮することができる。   The operation of the microcomputer 11 in the calibration mode is as described above. While the microcomputer 11 is operating in the calibration mode, the reference digital signal from the control device 2 is input in a state where an analog signal of a predetermined level is input to the analog-digital conversion circuit 12. When a value acquisition command is received via the communication port 11a, the intermediate output value at the time of command reception is stored in the RAM 13 as a reference digital value. In the linear linear setting routine, the microcomputer 11 calculates the slope and intercept of the linear linear expression based on at least two reference digital values and the signal level of the analog signal corresponding to the reference digital value. Therefore, conversion errors due to variations in the analog-digital conversion circuit 12 can be reduced. Therefore, there is no need to switch to the calibration mode or acquire the reference digital value using a mechanical switch such as a DIP switch as in the conventional A / D conversion unit, and a mechanical switch such as a DIP switch. Therefore, a small A / D conversion unit 1 capable of correcting variations in A / D conversion can be realized. Furthermore, since the microcomputer 11 returns the reference digital value acquired at the time of receiving the reference digital value acquisition command to the control device 2, the reference digital value used for obtaining the slope or intercept of the linear linear equation is used as the control device 2. It can be confirmed at the time of calibration whether or not the linear linear calibration can be satisfactorily performed based on whether or not the reference digital value matching the signal level of the analog signal has been acquired. Therefore, when the reference digital value does not match the signal level of the corresponding analog signal, an appropriate reference digital value can be acquired by retransmitting the reference digital value acquisition command on the control device 2 side, and the calibration mode Therefore, it is possible to prevent a situation in which the calibration of the linear linear type is not normally performed after the completion of the process and the calibration is performed again. Therefore, the time required for the calibration of the linear linear type can be shortened.

また、マイコン11では、基準デジタル値登録コマンドの受信時にFROM14に格納する基準デジタル値を制御装置2に返送しているので、FROM14に格納された基準デジタル値を制御装置2側で確認することができ、アナログ信号の信号レベルに合致した基準デジタル値を取得できているか否かで、一次直線式の校正が良好に行えるか否かを校正時に推測できる。   Further, since the microcomputer 11 returns the reference digital value stored in the FROM 14 to the control device 2 when the reference digital value registration command is received, the reference digital value stored in the FROM 14 can be confirmed on the control device 2 side. Whether or not the linear linear calibration can be satisfactorily performed can be estimated at the time of calibration depending on whether or not the reference digital value matching the signal level of the analog signal has been acquired.

また更に、マイコン11は、基準デジタル値消去コマンドの受信時にRAM13およびFROM14に格納されている基準デジタル値を消去すると、消去完了を示すデータを制御装置2に返送させているので、外部装置側2でRAM13およびFROM14に格納された基準デジタル値が正常に消去できたか否かをその場で確認することができる。したがって、制御装置2側では、消去完了を示すデータを受信できない場合に、基準デジタル値消去コマンドを再度送信することで、RAM13およびFROM14に格納された基準デジタル値を確実に消去させることができる。   Furthermore, when the microcomputer 11 erases the reference digital value stored in the RAM 13 and the FROM 14 upon reception of the reference digital value erase command, it returns data indicating completion of the erase to the control device 2, so that the external device side 2 Thus, it can be confirmed on the spot whether or not the reference digital values stored in the RAM 13 and the FROM 14 have been successfully erased. Therefore, on the control device 2 side, when the data indicating the completion of erasure cannot be received, the reference digital value stored in the RAM 13 and the FROM 14 can be reliably erased by transmitting the reference digital value erasure command again.

また、マイコン11は、制御装置2から送信された基準デジタル値登録コマンドに基づいて、FROM14に基準デジタル値を書き込む前にFROM14内のデータを消去する処理を、FROM14に空き容量が無い場合のみ行っており、FROM14に空き容量がある場合は、FROM14内のデータを消去する処理が行われないので、データを消去する時間を省いて、データの書き込みに要する時間を短縮することができる。またFROM14の寿命は消去回数に依存するため、消去回数を減らすことで、FROM14の寿命を延ばすことができる。   Further, the microcomputer 11 performs the process of erasing the data in the FROM 14 before writing the reference digital value in the FROM 14 based on the reference digital value registration command transmitted from the control device 2 only when the FROM 14 has no free space. If the FROM 14 has a free space, the data in the FROM 14 is not erased. Therefore, the time for erasing data can be saved and the time required for data writing can be shortened. Further, since the life of the FROM 14 depends on the number of times of erasing, the life of the FROM 14 can be extended by reducing the number of times of erasing.

また更に、マイコン11は、一次直線式の設定ルーチンの実行後、一次直線式の傾き及び切片を算出した結果を外部装置に返送しているので、A/D変換ユニット1のマイコン11がどのような一次直線式を用いてアナログ信号の信号レベルを求めているのかを制御装置2側で把握することができる。したがって、A/D変換ユニット1が使用している一次直線式の傾き及び切片が不適切な場合には、制御装置2側から基準デジタル値取得コマンドや基準デジタル値登録コマンドや一次直線式読み出しコマンドをA/D変換ユニット1に送信することで、一次直線式の傾き及び切片を算出する処理を再度実行させることができる。   Further, since the microcomputer 11 returns the result of calculating the slope and intercept of the linear linear equation after executing the linear linear equation setting routine, how the microcomputer 11 of the A / D conversion unit 1 is operated. It is possible to grasp on the control device 2 side whether the signal level of the analog signal is obtained using a simple linear equation. Therefore, when the slope and intercept of the linear linear expression used by the A / D conversion unit 1 are inappropriate, a reference digital value acquisition command, a reference digital value registration command, or a linear linear readout command from the control device 2 side. Is transmitted to the A / D conversion unit 1, the process of calculating the slope and intercept of the linear equation can be executed again.

(実施形態2)
本発明の実施形態2を図7〜図10に基づいて説明する。尚、A/D変換ユニット1の構成は実施形態1と同様であるので、共通する構成要素には、同一の符号を付して、その説明は省略する。
(Embodiment 2)
A second embodiment of the present invention will be described with reference to FIGS. Since the configuration of the A / D conversion unit 1 is the same as that of the first embodiment, common constituent elements are denoted by the same reference numerals and description thereof is omitted.

実施形態1では、基準デジタル値を取得する際にアナログ−デジタル変換回路12に入力するアナログ信号の信号レベルが予め決められているのに対して、本実施形態ではアナログ信号の信号レベルを任意に変更できるようにしてあり、制御装置2からA/D変換ユニット1へ基準デジタル値取得コマンドと共に、基準デジタル値を取得する際に印加するアナログ信号の信号レベル情報を送信するようにし、A/D変換ユニット1のマイコン11では、基準デジタル値取得コマンドに付加された信号レベル情報と、コマンド受信時にアナログ−デジタル変換回路12から取得した基準デジタル値とをもとに、一次直線式の傾き及び切片を算出している。   In the first embodiment, the signal level of the analog signal input to the analog-to-digital conversion circuit 12 when the reference digital value is acquired is determined in advance. In the present embodiment, the signal level of the analog signal is arbitrarily set. The signal level information of the analog signal applied when acquiring the reference digital value is transmitted together with the reference digital value acquisition command from the control device 2 to the A / D conversion unit 1, and the A / D is transmitted. In the microcomputer 11 of the conversion unit 1, the slope and intercept of the linear linear expression are based on the signal level information added to the reference digital value acquisition command and the reference digital value acquired from the analog-digital conversion circuit 12 when the command is received. Is calculated.

以下に本実施形態のA/D変換ユニット1の動作を図7〜図10のフローチャートに従って説明する。尚、基準デジタル値の取得ルーチン、登録ルーチン、消去ルーチン、一次直線式の設定ルーチン以外の動作は実施形態1と同様であるので、共通する動作については説明を省略し、異なる動作についてのみ以下に説明する。   Hereinafter, the operation of the A / D conversion unit 1 of the present embodiment will be described with reference to the flowcharts of FIGS. Since operations other than the reference digital value acquisition routine, registration routine, deletion routine, and linear linear setting routine are the same as those in the first embodiment, description of common operations is omitted, and only different operations are described below. explain.

図7は基準デジタル値を取得する処理ルーチンのフローチャートであり、本実施形態においても基準デジタル値として2点の中間出力値D0、D1を取り込むようになっており、基準デジタル値取得コマンドを送信する前に所定レベルのアナログ信号がアナログ−デジタル変換回路12に入力されているものとする。マイコン11が取得ルーチンを開始すると、マイコン11はアナログ−デジタル変換回路12から中間出力値(デジタル値)を読み込み(S21)、受信した基準デジタル値取得コマンドに対応する基準デジタル値の種別を判定する(S22)。すなわち、基準デジタル値取得コマンドには取得する基準デジタル値の種別(D0又はD1)を示す情報が付加されており、基準デジタル値の種別がD0であれば、マイコン11は、S21で読み込んだ中間出力値を基準デジタル値D0としてRAM13に格納するとともに(S23)、基準デジタル値取得コマンドに付加された信号レベル情報を基準アナログ値A0としてRAM13に格納した後(S25)、処理ルーチンを終了する。一方、S22の判定の結果、基準デジタル値の種別がD1であれば、マイコン11は、S21で読み込んだ中間出力値を基準デジタル値D1としてRAM13に格納するとともに(S24)、基準デジタル値取得コマンドに付加された信号レベル情報を基準アナログ値A1としてRAM13に格納した後(S26)、処理ルーチンを終了する。またマイコン11は、基準デジタル値の取得ルーチンを終了すると、RAM13に格納した基準デジタル値を応答信号として、通信ポート11aから制御装置2へ返送させる(S11,S12)。   FIG. 7 is a flowchart of a processing routine for acquiring a reference digital value. In this embodiment as well, two intermediate output values D0 and D1 are captured as reference digital values, and a reference digital value acquisition command is transmitted. It is assumed that an analog signal of a predetermined level has been input to the analog-digital conversion circuit 12 before. When the microcomputer 11 starts the acquisition routine, the microcomputer 11 reads the intermediate output value (digital value) from the analog-digital conversion circuit 12 (S21), and determines the type of the reference digital value corresponding to the received reference digital value acquisition command. (S22). That is, information indicating the type of reference digital value (D0 or D1) to be acquired is added to the reference digital value acquisition command. If the type of reference digital value is D0, the microcomputer 11 reads the intermediate value read in S21. The output value is stored in the RAM 13 as the reference digital value D0 (S23), and the signal level information added to the reference digital value acquisition command is stored in the RAM 13 as the reference analog value A0 (S25), and the processing routine is terminated. On the other hand, if the result of the determination in S22 is that the type of the reference digital value is D1, the microcomputer 11 stores the intermediate output value read in S21 in the RAM 13 as the reference digital value D1 (S24), and a reference digital value acquisition command After the signal level information added to is stored in the RAM 13 as the reference analog value A1 (S26), the processing routine is terminated. When the microcomputer 11 completes the reference digital value acquisition routine, it returns the reference digital value stored in the RAM 13 as a response signal from the communication port 11a to the control device 2 (S11, S12).

次に、RAM13に格納された基準デジタル値D0,D1をFROM14に登録する処理ルーチンを図8に示すフローチャートに基づいて説明する。マイコン11が登録ルーチンを開始すると、マイコン11は、FROM14に空き容量があるか否かを判定し(S31)、空き容量がある場合には、FROM14の書き込みポインタを未書き込みのアドレスのうちアドレス番号が最小のアドレスに移動させ(S32)、基準デジタル値D0,D1と基準アナログ値A0,A1を1データとしてFROM14に書き込み(S34)、書込ルーチンを終了する。また、S31の判定の結果、FROM14に空き容量が無い場合、マイコン11は、FROM14内のデータを全て消去した後(S33)、S32に移行し上述と同様の処理を行う。そして、マイコン11は、基準デジタル値の登録ルーチンを終了すると、FROM14に格納した基準デジタル値(または基準デジタル値と基準アナログ値)を応答信号として、通信ポート11aから制御装置2へ返送させる(S11,S12)。   Next, a processing routine for registering the reference digital values D0 and D1 stored in the RAM 13 in the FROM 14 will be described based on the flowchart shown in FIG. When the microcomputer 11 starts the registration routine, the microcomputer 11 determines whether or not the FROM 14 has free space (S31), and if there is free space, the write pointer of the FROM 14 is set to the address number of the unwritten addresses. Is moved to the minimum address (S32), the reference digital values D0, D1 and the reference analog values A0, A1 are written as one data in the FROM 14 (S34), and the writing routine is terminated. As a result of the determination in S31, if there is no free space in the FROM 14, the microcomputer 11 erases all the data in the FROM 14 (S33), then proceeds to S32 and performs the same processing as described above. When the microcomputer 11 ends the reference digital value registration routine, the reference digital value (or the reference digital value and the reference analog value) stored in the FROM 14 is returned as a response signal from the communication port 11a to the control device 2 (S11). , S12).

また、RAMおよびFROMに格納された基準デジタル値及び基準アナログ値を消去する処理ルーチンを図9のフローチャートに従って説明する。マイコン11が消去ルーチンを開始すると、FROM14内のデータを全て消去した後(S41)、RAM13内に格納された基準デジタル値D0,D1を消去するとともに(S42)、RAM13内に格納された基準アナログ値A0,A1を消去して(S43)、消去ルーチンを終了する。そして、マイコン11は、基準デジタル値および基準デジタル値の消去ルーチンを終了すると、基準デジタル値および基準デジタル値の消去完了を示すデータを応答信号として通信ポート11aから制御装置2へ返送させる(S11,S12)。   A processing routine for erasing the reference digital value and the reference analog value stored in the RAM and FROM will be described with reference to the flowchart of FIG. When the microcomputer 11 starts the erasing routine, all data in the FROM 14 is erased (S41), the reference digital values D0 and D1 stored in the RAM 13 are erased (S42), and the reference analog stored in the RAM 13 is erased. The values A0 and A1 are erased (S43), and the erase routine is terminated. When the microcomputer 11 finishes the reference digital value and the reference digital value erasing routine, the microcomputer 11 returns the reference digital value and data indicating completion of erasure of the reference digital value as a response signal from the communication port 11a to the control device 2 (S11, S12).

次に、一次直線式を算出する処理ルーチンについて図10のフローチャートを参照して説明する。マイコン11は、一次直線式の算出ルーチンを開始すると、先ずFROM14に書き込まれたデータの有無を判定する(S51)。ここで、FROM14内に書込データがあれば、マイコン11は、FROM14の読み出しポインタを、アドレス番号が最大の書き込み済みアドレスに移動させた後(S52)、FROM14から1データを読み出して、基準デジタル値D0、D1、基準アナログ値A0、A1とする(S53’)。そして、これらの基準デジタル値D0、D1、基準アナログ値A0、A1から、一次直線式Y=a×X+bの傾きa=(A0−A1)/(D0−D1)と、切片b=(A0・D1−A1・D0)/(D1−D0)とを算出して、RAM13に格納した後(S54’)、処理ルーチンを終了する。また、S51の判定の結果、FROM14に書込データがなければ、マイコン11は、予め設定されている標準の傾き及び切片を一次直線式に設定し(S55)、処理ルーチンを終了する。そして、マイコン11は、一次算出式の傾き及び切片の設定値を応答信号として通信ポート11aから制御装置2へ返送させる(S11,S12)。   Next, a processing routine for calculating the linear equation will be described with reference to the flowchart of FIG. When the microcomputer 11 starts the primary linear equation calculation routine, it first determines the presence or absence of data written in the FROM 14 (S51). If there is write data in the FROM 14, the microcomputer 11 moves the read pointer of the FROM 14 to the written address having the largest address number (S 52), reads one data from the FROM 14, and reads the reference digital Values D0 and D1 and reference analog values A0 and A1 are set (S53 ′). Then, from these reference digital values D0 and D1 and reference analog values A0 and A1, the slope a = (A0−A1) / (D0−D1) of the linear equation Y = a × X + b and the intercept b = (A0 · D1-A1 · D0) / (D1-D0) is calculated and stored in the RAM 13 (S54 ′), and then the processing routine is terminated. If there is no write data in the FROM 14 as a result of the determination in S51, the microcomputer 11 sets the standard inclination and intercept set in advance to a linear equation (S55), and ends the processing routine. Then, the microcomputer 11 returns the slope of the primary calculation formula and the set value of the intercept as a response signal from the communication port 11a to the control device 2 (S11, S12).

校正モードにおけるマイコン11の動作は以上の通りであり、本実施形態では、制御装置2から基準デジタル値取得コマンドと共に送られたアナログ信号の信号レベル情報と、コマンド受信時に取得した基準デジタル値とを用いて、一次直線式の傾きa及び切片bを算出しているので、入出力の仕様や測定対象のアナログ信号の信号レベルに合わせて、基準デジタル値を取得する際に与えるアナログ信号の信号レベルを途中で変更することができ、個々のA/D変換ユニット毎に使用形態に合わせた最適な一次直線式を設定することができる。   The operation of the microcomputer 11 in the calibration mode is as described above. In the present embodiment, the signal level information of the analog signal sent together with the reference digital value acquisition command from the control device 2 and the reference digital value acquired when the command is received. Since the slope a and intercept b of the linear linear equation are used, the signal level of the analog signal given when acquiring the reference digital value according to the input / output specifications and the signal level of the analog signal to be measured Can be changed on the way, and an optimal linear linear expression can be set for each A / D conversion unit in accordance with the usage pattern.

(実施形態3)
本発明の実施形態3を図11〜図15に基づいて説明する。尚、A/D変換ユニット1の構成は実施形態1と同様であるので、共通する構成要素には、同一の符号を付して、その説明は省略する。
(Embodiment 3)
A third embodiment of the present invention will be described with reference to FIGS. Since the configuration of the A / D conversion unit 1 is the same as that of the first embodiment, common constituent elements are denoted by the same reference numerals and description thereof is omitted.

上述の実施形態2では、2点の基準デジタル値D0,D1と、基準デジタル値D0,D1に対応する基準アナログ値A0,A1とを用いて一次直線式の傾き及び切片を算出しているが、アナログ信号の信号レベルと中間出力値との関係が一つの一次直線式で表せない場合、一つの一次直線式に中間出力値を代入してアナログ信号の信号レベルを求めると、一次直線式を用いて算出した信号レベルと実際の信号レベルとの間に誤差が発生するが、本実施形態によれば、(n+1)個(nは2以上の整数)の基準デジタル値D0,D1,…,Dnの各区間毎にアナログ信号の信号レベルA0,A1,…,Anと基準デジタル値A0,A1,…,Anとの関係を示す一次直線式の傾き及び切片を求め、各区間毎に求めた一次直線式を用いて中間出力値からアナログ信号の信号レベルを算出しているので、一次直線式を用いて算出した信号レベルと実際の信号レベルとの誤差を小さくすることができる。図13は基準デジタル値を5個取り込んだ場合を示しており、基準デジタル値の各区間(−1000〜0、0〜1000、1000〜2000、2000〜3000)毎に4つの一次直線式f1,f2,f3,f4を求めているので、各区間毎に対応する一次直線式f1〜f4を用いることで、一次直線式を用いて算出した信号レベルと実際の信号レベルとの誤差を小さくすることができる。   In Embodiment 2 described above, the slope and intercept of the linear equation are calculated using the two reference digital values D0 and D1 and the reference analog values A0 and A1 corresponding to the reference digital values D0 and D1. When the relationship between the signal level of the analog signal and the intermediate output value cannot be expressed by one primary linear equation, the intermediate linear value is substituted into one primary linear equation to obtain the signal level of the analog signal. Although an error occurs between the signal level calculated using the signal level and the actual signal level, according to the present embodiment, (n + 1) (n is an integer of 2 or more) reference digital values D0, D1,. The slope and intercept of the linear linear equation indicating the relationship between the signal level A0, A1,..., An of the analog signal and the reference digital values A0, A1,. Intermediate output using a linear equation Since calculating the signal level of the analog signals from, it is possible to reduce the error between the actual signal level and the signal level calculated using a first order linear equation. FIG. 13 shows a case in which five reference digital values are taken, and four linear linear expressions f1, f1, f1 and f2 for each section (−1000 to 0, 0 to 1000, 1000 to 2000, 2000 to 3000) of the reference digital value. Since f2, f3, and f4 are obtained, the error between the signal level calculated using the linear equation and the actual signal level is reduced by using the linear equations f1 to f4 corresponding to each section. Can do.

本実施形態のA/D変換ユニット1の動作を図11,図12,図14および図15のフローチャートに従って説明する。尚、基準デジタル値の取得ルーチン、登録ルーチン、消去ルーチン、一次直線式の設定ルーチン以外の動作は実施形態2と同様であるので、共通する動作については説明を省略し、異なる動作についてのみ以下に説明する。   The operation of the A / D conversion unit 1 of this embodiment will be described with reference to the flowcharts of FIGS. 11, 12, 14 and 15. Since operations other than the reference digital value acquisition routine, registration routine, deletion routine, and linear linear setting routine are the same as those in the second embodiment, the description of common operations is omitted, and only different operations are described below. explain.

図11は基準デジタル値を取得する処理ルーチンのフローチャートであり、本実施形態では基準デジタル値として(n+1)点の中間出力値D0,D1,…,Dnを取り込むようになっており、基準デジタル値取得コマンドを送信する前に所定レベルのアナログ信号がアナログ−デジタル変換回路12に入力されているものとする。マイコン11が取得ルーチンを開始すると、マイコン11はアナログ−デジタル変換回路12から中間出力値(デジタル値)を読み込み(S21)、受信した基準デジタル値取得コマンドに対応する基準デジタル値の種別を判定する(S22)。すなわち、基準デジタル値取得コマンドには取得する基準デジタル値の種別(D0,D1,…,Dn)を示す情報が付加されており、基準デジタル値の種別がD0であれば、マイコン11は、S21で読み込んだ中間出力値を基準デジタル値D0としてRAM13に格納するとともに(S23)、基準デジタル値取得コマンドに付加された信号レベル情報を基準アナログ値A0としてRAM13に格納した後(S25)、処理ルーチンを終了する。また、基準デジタル値の種別がD1であれば、マイコン11は、S21で読み込んだ中間出力値を基準デジタル値D1としてRAM13に格納するとともに(S24)、基準デジタル値取得コマンドに付加された信号レベル情報を基準アナログ値A1としてRAM13に格納した後(S26)、処理ルーチンを終了する。さらに、基準デジタル値の種別がDnであれば、マイコン11は、S21で読み込んだ中間出力値を基準デジタル値DnとしてRAM13に格納するとともに(S27)、基準デジタル値取得コマンドに付加された信号レベル情報を基準アナログ値AnとしてRAM13に格納した後(S28)、処理ルーチンを終了する。またマイコン11は、基準デジタル値の取得ルーチンを終了すると、RAM13に格納した基準デジタル値(または基準デジタル値と基準アナログ値)を応答信号として、通信ポート11aから制御装置2へ返送させる(S11,S12)。   FIG. 11 is a flowchart of a processing routine for acquiring a reference digital value. In this embodiment, (n + 1) -point intermediate output values D0, D1,..., Dn are captured as reference digital values. It is assumed that an analog signal of a predetermined level is input to the analog-digital conversion circuit 12 before transmitting the acquisition command. When the microcomputer 11 starts the acquisition routine, the microcomputer 11 reads the intermediate output value (digital value) from the analog-digital conversion circuit 12 (S21), and determines the type of the reference digital value corresponding to the received reference digital value acquisition command. (S22). That is, information indicating the type of reference digital value (D0, D1,..., Dn) to be acquired is added to the reference digital value acquisition command. If the type of reference digital value is D0, the microcomputer 11 performs S21. The intermediate output value read in step S3 is stored in the RAM 13 as the reference digital value D0 (S23), and the signal level information added to the reference digital value acquisition command is stored in the RAM 13 as the reference analog value A0 (S25). Exit. If the type of the reference digital value is D1, the microcomputer 11 stores the intermediate output value read in S21 in the RAM 13 as the reference digital value D1 (S24), and the signal level added to the reference digital value acquisition command. After the information is stored in the RAM 13 as the reference analog value A1 (S26), the processing routine is terminated. Further, if the type of the reference digital value is Dn, the microcomputer 11 stores the intermediate output value read in S21 as the reference digital value Dn in the RAM 13 (S27), and the signal level added to the reference digital value acquisition command. After the information is stored in the RAM 13 as the reference analog value An (S28), the processing routine is ended. When the microcomputer 11 finishes the routine for acquiring the reference digital value, the reference digital value (or the reference digital value and the reference analog value) stored in the RAM 13 is returned as a response signal from the communication port 11a to the control device 2 (S11, S12).

次に、RAM13に格納された基準デジタル値D0〜Dnおよび基準アナログ値A0〜AnをFROM14に登録する処理ルーチンを図12に示すフローチャートに基づいて説明する。マイコン11が登録ルーチンを開始すると、マイコン11は、FROM14に空き容量があるか否かを判定し(S31)、空き容量がある場合には、FROM14の書き込みポインタを未書き込みのアドレスのうちアドレス番号が最小のアドレスに移動させ(S32)、基準デジタル値D0〜Dnと基準アナログ値A0〜Anを1データとしてFROM14に書き込み(S34)、書込ルーチンを終了する。また、S31の判定の結果、FROM14に空き容量が無い場合、マイコン11は、FROM14内のデータを全て消去した後(S33)、S32に移行し上述と同様の処理を行う。そして、マイコン11は、基準デジタル値の登録ルーチンを終了すると、FROM14に格納した基準デジタル値を応答信号として、通信ポート11aから制御装置2へ返送させる(S11,S12)。   Next, a processing routine for registering the reference digital values D0 to Dn and the reference analog values A0 to An stored in the RAM 13 in the FROM 14 will be described based on the flowchart shown in FIG. When the microcomputer 11 starts the registration routine, the microcomputer 11 determines whether or not the FROM 14 has free space (S31), and if there is free space, the write pointer of the FROM 14 is set to the address number of the unwritten addresses. Is moved to the smallest address (S32), the reference digital values D0 to Dn and the reference analog values A0 to An are written as one data in the FROM 14 (S34), and the writing routine is terminated. As a result of the determination in S31, if there is no free space in the FROM 14, the microcomputer 11 erases all the data in the FROM 14 (S33), then proceeds to S32 and performs the same processing as described above. When the microcomputer 11 finishes the reference digital value registration routine, the microcomputer 11 returns the reference digital value stored in the FROM 14 as a response signal from the communication port 11a to the control device 2 (S11, S12).

また、RAMおよびFROMに格納された基準デジタル値及び基準アナログ値を消去する処理ルーチンを図14のフローチャートに従って説明する。マイコン11が消去ルーチンを開始すると、FROM14内のデータを全て消去した後(S41)、RAM13内に格納された基準デジタル値D0,D1,…,Dnを消去するとともに(S42)、RAM13内に格納された基準アナログ値A0,A1,…,Anを消去して(S43)、消去ルーチンを終了する。そして、マイコン11は、基準デジタル値及び基準アナログ値の消去ルーチンを終了すると、基準デジタル値及び基準アナログ値の消去完了を示すデータを応答信号として通信ポート11aから制御装置2へ返送させる(S11,S12)。   A processing routine for erasing the reference digital value and the reference analog value stored in the RAM and FROM will be described with reference to the flowchart of FIG. When the microcomputer 11 starts the erase routine, all data in the FROM 14 is erased (S41), and then the reference digital values D0, D1,..., Dn stored in the RAM 13 are erased (S42) and stored in the RAM 13. The reference analog values A0, A1,..., An that have been erased are erased (S43), and the erase routine ends. When the microcomputer 11 finishes the routine for erasing the reference digital value and the reference analog value, data indicating completion of erasure of the reference digital value and the reference analog value is returned from the communication port 11a to the control device 2 as a response signal (S11, S12).

次に、一次直線式を算出する処理ルーチンについて図15のフローチャートを参照して説明する。マイコン11は、一次直線式の算出ルーチンを開始すると、先ずFROM14に書き込まれたデータの有無を判定する(S51)。ここで、FROM14内に書込データがあれば、マイコン11は、FROM14の読み出しポインタを、アドレス番号が最大の書き込み済みアドレスに移動させた後(S52)、FROM14から1データを読み出して、基準デジタル値D0,D1,…,Dn、および、基準アナログ値A0,A1,…,Anとする(S53’)。そして、これらの基準デジタル値D0〜Dnおよび基準アナログ値A0〜Anから、隣接する基準デジタル値の区間毎に一次直線式Y=a×X+bの傾きa及び切片bを算出して、RAM13に格納した後(S54)、処理ルーチンを終了する。尚、基準デジタル値の区間(D0,D1)では、傾きa=(A0−A1)/(D0−D1)、切片b=(A0・D1−A1・D0)/(D1−D0)となる。また、S51の判定の結果、FROM14に書込データがなければ、マイコン11は、予め設定されている標準の傾き及び切片を一次直線式に設定し(S55)、処理ルーチンを終了する。そして、マイコン11は、一次算出式の傾き及び切片の設定値を応答信号として通信ポート11aから制御装置2へ返送させる(S11,S12)。   Next, a processing routine for calculating a linear equation will be described with reference to the flowchart of FIG. When the microcomputer 11 starts the primary linear equation calculation routine, it first determines the presence or absence of data written in the FROM 14 (S51). If there is write data in the FROM 14, the microcomputer 11 moves the read pointer of the FROM 14 to the written address having the largest address number (S 52), reads one data from the FROM 14, and reads the reference digital , Dn and reference analog values A0, A1,..., An (S53 ′). Then, from these reference digital values D0 to Dn and reference analog values A0 to An, the slope a and the intercept b of the linear linear equation Y = a × X + b are calculated for each section of the adjacent reference digital values and stored in the RAM 13. (S54), the processing routine is terminated. In the reference digital value section (D0, D1), the slope a = (A0−A1) / (D0−D1) and the intercept b = (A0 · D1−A1 · D0) / (D1−D0). If there is no write data in the FROM 14 as a result of the determination in S51, the microcomputer 11 sets the standard inclination and intercept set in advance to a linear equation (S55), and ends the processing routine. Then, the microcomputer 11 returns the slope of the primary calculation formula and the set value of the intercept as a response signal from the communication port 11a to the control device 2 (S11, S12).

校正モードにおけるマイコン11の動作は以上の通りであり、本実施形態では、マイコン11が、少なくとも3つの基準デジタル値の各区間毎にアナログ信号の信号レベルと中間出力値との関係を示す一次直線式の傾き及び切片を求め、各区間毎に求めた一次直線式を用いて中間出力値からアナログ信号の信号レベルを算出しているので、一次直線式を用いて算出した信号レベルと実際の信号レベルとの誤差を小さくすることができる。   The operation of the microcomputer 11 in the calibration mode is as described above. In the present embodiment, the microcomputer 11 is a primary straight line indicating the relationship between the signal level of the analog signal and the intermediate output value for each section of at least three reference digital values. Since the slope and intercept of the equation is obtained and the signal level of the analog signal is calculated from the intermediate output value using the linear equation obtained for each section, the signal level calculated using the linear equation and the actual signal The error from the level can be reduced.

尚、本実施形態では実施形態2のA/D変換ユニット1において、少なくとも3点の基準デジタル値D0,D1,…,Dnの各区間毎にアナログ信号の信号レベルと中間出力値との関係を示す一次直線式の傾き及び切片を求めているが、実施形態1のA/D変換ユニット1において、少なくとも3点の基準デジタル値D0,D1,…,Dnの各区間毎に、予め設定されたアナログ信号の信号レベルA0,A1,…,Anと基準デジタル値D0,D1,…,Dnとの関係を示す一次直線式の傾き及び切片を求め、各区間毎に求めた一次直線式を用いて中間出力値からアナログ信号の信号レベルを算出するようにしても良い。   In the present embodiment, in the A / D conversion unit 1 of the second embodiment, the relationship between the signal level of the analog signal and the intermediate output value is determined for each section of at least three reference digital values D0, D1,. The slope and intercept of the linear linear equation shown are obtained. In the A / D conversion unit 1 of the first embodiment, at least three reference digital values D0, D1,..., Dn are set in advance. .., An and the reference digital values D0, D1,..., Dn, the slope and intercept of the linear linear equation showing the relationship between the analog signal levels A0, A1,. The signal level of the analog signal may be calculated from the intermediate output value.

実施形態1のA/D変換ユニットの概略的なブロック図である。2 is a schematic block diagram of an A / D conversion unit according to Embodiment 1. FIG. 同上の全体の動作を説明するフローチャートである。It is a flowchart explaining the whole operation | movement same as the above. 同上の基準デジタル値の取得ルーチンを示すフローチャートである。It is a flowchart which shows the acquisition routine of a reference | standard digital value same as the above. (a)は同上の基準デジタル値の登録ルーチンを示すフローチャート、(b)〜(e)は同上に用いるFROMの記憶領域を示す説明図である。(A) is a flowchart showing a reference digital value registration routine as described above, and (b) through (e) are explanatory diagrams showing storage areas of the FROM used in the above. (a)は同上の基準デジタル値の消去ルーチンを示すフローチャート、(b)は同上に用いるFROMの記憶領域を示す説明図である。(A) is a flow chart showing a reference digital value erasing routine same as above, and (b) is an explanatory diagram showing a storage area of the FROM used in the above. (a)は同上の一次直線式の設定ルーチンを示すフローチャート、(b)〜(e)は同上に用いるFROMの記憶領域を示す説明図である。(A) is a flowchart showing a linear linear setting routine as described above, and (b) through (e) are explanatory diagrams showing storage areas of the FROM used in the above. 実施形態2の基準デジタル値の取得ルーチンを示すフローチャートである。10 is a flowchart illustrating a reference digital value acquisition routine according to the second embodiment. 同上の基準デジタル値の登録ルーチンを示すフローチャートである。It is a flowchart which shows the registration routine of a reference | standard digital value same as the above. 同上の基準デジタル値の消去ルーチンを示すフローチャートである。It is a flowchart which shows the deletion routine of a reference | standard digital value same as the above. 同上の一次直線式の設定ルーチンを示すフローチャートである。It is a flowchart which shows the setting routine of the primary linear type same as the above. 実施形態3の基準デジタル値の取得ルーチンを示すフローチャートである。10 is a flowchart illustrating a reference digital value acquisition routine according to the third embodiment. 同上の基準デジタル値の登録ルーチンを示すフローチャートである。It is a flowchart which shows the registration routine of a reference | standard digital value same as the above. 同上に入力されるアナログ信号の信号レベルと、A/D変換後のデジタル値の関係を示す説明図である。It is explanatory drawing which shows the relationship between the signal level of the analog signal input into the same as above, and the digital value after A / D conversion. 同上の基準デジタル値の消去ルーチンを示すフローチャートである。It is a flowchart which shows the deletion routine of a reference | standard digital value same as the above. 同上の一次直線式の設定ルーチンを示すフローチャートである。It is a flowchart which shows the setting routine of the primary linear type same as the above. (a)は従来のA/D変換ユニットの概略的なブロック図、(b)は同上に用いるDIPSWの外観図である。(A) is a schematic block diagram of a conventional A / D conversion unit, and (b) is an external view of a DIPSW used in the same. 同上に入力されるアナログ信号の信号レベルと、A/D変換後のデジタル値の関係を示す説明図である。It is explanatory drawing which shows the relationship between the signal level of the analog signal input into the same as above, and the digital value after A / D conversion. 同上の全体の動作を説明するフローチャートである。It is a flowchart explaining the whole operation | movement same as the above. 同上の基準デジタル値の取得ルーチンを示すフローチャートである。It is a flowchart which shows the acquisition routine of a reference | standard digital value same as the above. (a)は同上の基準デジタル値の登録ルーチンを示すフローチャート、(b)(c)は同上に用いるFROMの記憶領域を示す説明図である。(A) is a flow chart showing a reference digital value registration routine as described above, and (b) and (c) are explanatory diagrams showing storage areas of the FROM used in the above. (a)は同上の基準デジタル値の消去ルーチンを示すフローチャート、(b)は同上に用いるFROMの記憶領域を示す説明図である。(A) is a flow chart showing a reference digital value erasing routine same as above, and (b) is an explanatory diagram showing a storage area of the FROM used in the above. (a)は同上の一次直線式の設定ルーチンを示すフローチャート、(b)(c)は同上に用いるFROMの記憶領域を示す説明図である。(A) is a flowchart showing a linear linear equation setting routine, and (b) and (c) are explanatory diagrams showing storage areas of the FROM used in the above.

符号の説明Explanation of symbols

1 A/D変換ユニット
2 制御装置
3 拡張バス
11 マイコン(演算処理部)
11a 通信ポート(通信手段)
12 アナログ−デジタル変換回路(アナログ−デジタル変換部)
13 RAM
14 FROM
1 A / D conversion unit 2 Control device 3 Expansion bus 11 Microcomputer (arithmetic processing unit)
11a Communication port (communication means)
12 Analog-digital conversion circuit (analog-digital converter)
13 RAM
14 FROM

Claims (7)

アナログ信号をA/D変換して、アナログ信号の信号レベルに比例した大きさの中間出力値を得るアナログ−デジタル変換部と、前記アナログ信号の信号レベルと前記中間出力値との関係を示す一次直線式に、前記中間出力値を代入してアナログ信号の信号レベルを演算する演算処理部と、演算処理部の演算データを一時的に記憶するRAMとを備え、
演算処理部は、外部との間で通信を行う通信手段を有し、前記一次直線式の傾き及び切片を求める校正モードで動作中に、アナログ−デジタル変換部に所定レベルのアナログ信号が入力された状態で、外部装置から送信された基準デジタル値取得コマンドを通信手段を介して受信すると、コマンド受信時における中間出力値を基準デジタル値としてRAMに格納するとともに、前記基準デジタル値を応答信号として通信手段から外部装置へ送信させ、少なくとも2点の基準デジタル値および当該基準デジタル値に対応するアナログ信号の信号レベルに基づいて前記一次直線式の傾き及び切片を算出することを特徴とするA/D変換ユニット。
An analog-to-digital converter that obtains an intermediate output value that is proportional to the signal level of the analog signal by performing A / D conversion on the analog signal, and a primary that indicates the relationship between the signal level of the analog signal and the intermediate output value An arithmetic processing unit that calculates the signal level of an analog signal by substituting the intermediate output value into a linear equation, and a RAM that temporarily stores arithmetic data of the arithmetic processing unit,
The arithmetic processing unit has communication means for communicating with the outside, and an analog signal of a predetermined level is input to the analog-to-digital conversion unit during operation in the calibration mode for obtaining the slope and intercept of the linear linear equation. When the reference digital value acquisition command transmitted from the external device is received through the communication means in the state, the intermediate output value at the time of command reception is stored in the RAM as the reference digital value, and the reference digital value is used as the response signal. A / is transmitted from the communication means to the external device, and the slope and intercept of the linear equation are calculated based on at least two reference digital values and the signal level of the analog signal corresponding to the reference digital values. D conversion unit.
前記基準デジタル値を記憶させるFROMを備え、前記演算処理部が、前記基準デジタル値取得コマンドの受信後に、前記外部装置から送信された基準デジタル値登録コマンドを前記通信手段を介して受信すると、前記RAMに格納した基準デジタル値をFROMに格納し、当該基準デジタル値を応答信号として通信手段から外部装置へ返送させることを特徴とする請求項1記載のA/D変換ユニット。   A FROM for storing the reference digital value; and when the arithmetic processing unit receives a reference digital value registration command transmitted from the external device via the communication unit after receiving the reference digital value acquisition command, The A / D conversion unit according to claim 1, wherein the reference digital value stored in the RAM is stored in the FROM, and the reference digital value is returned as a response signal from the communication means to the external device. 前記演算処理部が、前記外部装置から送信された基準デジタル値消去コマンドを前記通信手段を介して受信すると、前記RAMおよび前記FROMに格納されている基準デジタル値を消去した後、消去完了を示すデータを応答信号として通信手段から外部装置へ返送させることを特徴とする請求項2記載のA/D変換ユニット。   When the arithmetic processing unit receives a reference digital value erasure command transmitted from the external device via the communication means, it indicates erasure completion after erasing the reference digital value stored in the RAM and the FROM. 3. The A / D conversion unit according to claim 2, wherein data is returned as a response signal from the communication means to the external device. 前記演算処理部が、前記FROMに前記基準デジタル値を書き込む前にFROM内のデータを消去する処理を、FROMに空き容量が無い場合のみ行うことを特徴とする請求項2記載のA/D変換ユニット。   3. The A / D conversion according to claim 2, wherein the arithmetic processing unit performs a process of erasing data in the FROM before writing the reference digital value in the FROM only when there is no free space in the FROM. unit. 前記演算処理部が、前記外部装置から送信された一次直線式を算出させるための一次直線式読み出しコマンドを前記通信手段を介して受信すると、前記RAMに格納された複数の基準デジタル値と各基準デジタル値に対応するアナログ信号の信号レベルとに基づいて、前記一次直線式の傾き及び切片を算出し、算出した傾き及び切片を応答信号として通信手段から外部装置へ返送させることを特徴とする請求項1乃至4の何れか1項に記載のA/D変換ユニット。   When the arithmetic processing unit receives a primary linear equation read command for calculating a primary linear equation transmitted from the external device via the communication unit, a plurality of reference digital values stored in the RAM and each reference The slope and intercept of the linear equation are calculated based on the signal level of the analog signal corresponding to the digital value, and the calculated slope and intercept are returned as a response signal from the communication means to the external device. Item 5. The A / D conversion unit according to any one of Items 1 to 4. 前記外部装置から送信される基準デジタル値取得コマンドに、前記基準デジタル値に対応するアナログ信号の信号レベル情報が付加されており、前記演算処理部は、基準デジタル値取得コマンドに付加された信号レベル情報と、コマンド受信時に取得した基準デジタル値とをもとに、前記一次直線式の傾き及び切片を算出することを特徴とする請求項1乃至5の何れか1項に記載のA/D変換ユニット。   Signal level information of an analog signal corresponding to the reference digital value is added to the reference digital value acquisition command transmitted from the external device, and the arithmetic processing unit is configured to output the signal level added to the reference digital value acquisition command. 6. The A / D conversion according to claim 1, wherein a slope and an intercept of the linear equation are calculated based on information and a reference digital value acquired at the time of command reception. unit. 前記校正モードにおいてアナログ−デジタル変換部に入力されるアナログ信号の信号レベルが少なくとも3通りに切り替えられ、前記アナログ信号の信号レベルが切り替えられる毎に、外部装置から基準デジタル値取得コマンドが送信されており、前記演算処理部は、基準デジタル値取得コマンドの受信時に取得した少なくとも3つの基準デジタル値および各基準デジタル値に対応するアナログ信号の信号レベルに基づいて、少なくとも3つの基準デジタル値の各区間毎にアナログ信号の信号レベルと中間出力値との関係を示す一次直線式の傾き及び切片を求めたことを特徴とする請求項1乃至6の何れか1項に記載のA/D変換ユニット。   In the calibration mode, the signal level of the analog signal input to the analog-digital conversion unit is switched at least in three ways, and a reference digital value acquisition command is transmitted from an external device each time the signal level of the analog signal is switched. The arithmetic processing unit is configured to obtain at least three sections of the reference digital value based on at least three reference digital values acquired at the time of receiving the reference digital value acquisition command and the signal level of the analog signal corresponding to each reference digital value. The A / D conversion unit according to any one of claims 1 to 6, wherein an inclination and intercept of a linear linear expression indicating a relationship between the signal level of the analog signal and the intermediate output value are obtained every time.
JP2007221836A 2007-08-28 2007-08-28 A / D conversion unit Expired - Fee Related JP4891869B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007221836A JP4891869B2 (en) 2007-08-28 2007-08-28 A / D conversion unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007221836A JP4891869B2 (en) 2007-08-28 2007-08-28 A / D conversion unit

Publications (2)

Publication Number Publication Date
JP2009055484A JP2009055484A (en) 2009-03-12
JP4891869B2 true JP4891869B2 (en) 2012-03-07

Family

ID=40506115

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007221836A Expired - Fee Related JP4891869B2 (en) 2007-08-28 2007-08-28 A / D conversion unit

Country Status (1)

Country Link
JP (1) JP4891869B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011017657A (en) * 2009-07-10 2011-01-27 Yamatake Corp Apparatus, method, and program for current measurement
CN102687422B (en) 2010-06-29 2014-12-17 Lg电子株式会社 Method and apparatus for transmitting data frame in WLAN system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5853223A (en) * 1981-09-25 1983-03-29 Fuji Facom Corp Fault informing system
JPS6229318A (en) * 1985-07-31 1987-02-07 Yamatake Honeywell Co Ltd Method of analog-digital conversion and analog-digital converter
JPH06204868A (en) * 1993-01-05 1994-07-22 Fujitsu Ten Ltd Analog/digital converting circuit
JP4074823B2 (en) * 2003-03-05 2008-04-16 株式会社デンソー A / D conversion output data non-linearity correction method and non-linearity correction apparatus

Also Published As

Publication number Publication date
JP2009055484A (en) 2009-03-12

Similar Documents

Publication Publication Date Title
US7440306B2 (en) Method for programming one-time programmable memory of integrated circuit
US8321765B2 (en) Method of reading data in non-volatile memory device
JP2821278B2 (en) Semiconductor integrated circuit
US8154919B2 (en) Method of reading nonvolatile memory device and nonvolatile memory device for implementing the method
KR20100049924A (en) Non-volatile memory device having temperature compensator and memory system thereof
KR20120056424A (en) Flash memory device and data storage device including the same
US7885141B2 (en) Non-volatile memory device and method for setting configuration information thereof
JP2009259186A (en) Rfid device
CN101197189A (en) Flash memory devices and programming methods for the same
CN103093831A (en) Built-in self trim for non-volatile memory reference current
KR20160095468A (en) Semiconductor memory device, memory system including the same and operating method thereof
CN107884065B (en) Sensor circuit and sensor device
JP4891869B2 (en) A / D conversion unit
JP2009282923A (en) Semiconductor storage device and nonvolatile memory
JP5884663B2 (en) Electronic control device and data rewriting system
JP2006275761A (en) Setting technique of sensor module
US7490025B2 (en) Integrated circuit with self-proofreading function, measuring device using the same and method for self-recording parameter
JP4936271B2 (en) Semiconductor memory device
JP2001203579A (en) Analog module
JP4491267B2 (en) Nonvolatile semiconductor memory device
US7428474B2 (en) Integrated circuit with self-proofreading function and measuring device using the same
CN103581573A (en) Semiconductor device, method of controlling the same, and camera
CN113284533B (en) Memory device and method of adjusting parameters for memory device
KR20180005584A (en) Non-Volatile Memory System and Method for Error Decision
KR101411975B1 (en) Write voltage generating circuit and write voltage generating method thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20091203

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20101102

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20110701

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20110701

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20110627

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111128

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20111206

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111216

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20141222

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20141222

Year of fee payment: 3

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20141222

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees