JPH07321878A - Device and method for data aqulsition - Google Patents

Device and method for data aqulsition

Info

Publication number
JPH07321878A
JPH07321878A JP6135119A JP13511994A JPH07321878A JP H07321878 A JPH07321878 A JP H07321878A JP 6135119 A JP6135119 A JP 6135119A JP 13511994 A JP13511994 A JP 13511994A JP H07321878 A JPH07321878 A JP H07321878A
Authority
JP
Japan
Prior art keywords
data
transmission command
sent
output device
transmitted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP6135119A
Other languages
Japanese (ja)
Inventor
Takashi Tanaka
崇 田中
Tokushige Masuko
徳茂 増子
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.)
Tokyo Gas Co Ltd
Original Assignee
Tokyo Gas 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 Tokyo Gas Co Ltd filed Critical Tokyo Gas Co Ltd
Priority to JP6135119A priority Critical patent/JPH07321878A/en
Publication of JPH07321878A publication Critical patent/JPH07321878A/en
Pending legal-status Critical Current

Links

Landscapes

  • Arrangements For Transmission Of Measured Signals (AREA)
  • Communication Control (AREA)

Abstract

PURPOSE:To efficiently use a CPU without stopping a program until a data output device enables the reception of a data transmitting instruction or data are transmitted from the data output device. CONSTITUTION:A transmitting instruction transmission judging means 21 of a CPU 20 judges whether the data transmitting instruction is transmitted to a measuring instrument 10 or not. When it is judged the data that transmitting instruction is not transmitted and the measuring instrument 10 is set in a reception enable state, a transmitting instruction transmission control means 22 transmits the data transmitting instruction but when the instrument 10 is not set in the reception enable state, the other processing is started. When it is judged that data transmitting instruction is transmitted and any data are transmitted from the measuring instrument 10, a data reception control means 23 fetches those data but when no data are transmitted, the other processing is started. An operation control means 24 repeatedly operates the respective means 21, 22 and 23.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、計測器等のデータ出力
装置によって得られるデータを取り込むデータ取得装置
および方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data acquisition device and method for capturing data obtained by a data output device such as a measuring instrument.

【0002】[0002]

【従来の技術】計測器によって得られるデータをCPU
(中央処理装置)に取り込む場合、CPUから計測器に
データ送信命令を送り、このデータ送信命令に応じて計
測器から送られてきたデータをCPUが取り込むという
方法がある。
2. Description of the Related Art Data obtained by a measuring instrument is stored in a CPU.
In the case of loading into the (central processing unit), there is a method in which the CPU sends a data transmission command to the measuring instrument, and the CPU fetches the data sent from the measuring instrument in response to this data transmission command.

【0003】図3は計測器によって得られるデータをC
PUに取り込む場合における従来のCPUの動作の一例
を示す流れ図である。この図3は、1秒毎に、計測デー
タ取得用モジュールS200によって計測器にデータ送
信命令を送り、計測器から送られてきたデータをCPU
が取り込むと共に、他のデータ取り込み用モジュールS
209によって他のデータも取り込み、これらのデータ
を画面に表示させる場合の動作を示している。
FIG. 3 shows the data obtained by the measuring instrument as C
It is a flow chart which shows an example of operation of the conventional CPU in the case of taking in to PU. In FIG. 3, the measurement data acquisition module S200 sends a data transmission command to the measuring instrument every second, and the data transmitted from the measuring instrument is sent to the CPU.
Other data acquisition module S
209 shows the operation in the case of fetching other data and displaying these data on the screen.

【0004】この動作では、CPUはまず、1秒たった
か否かを判断し(ステップS201)、1秒たっていな
い場合(N)はこの判断(ステップS201)を繰り返
す。1秒たった場合(Y)は、計測器からの受信可能信
号を監視することで計測器が受信可能状態か否かを判断
し(ステップS202)、受信可能状態ではない場合
(N)はこの判断(ステップS202)を繰り返す。受
信可能状態になった場合(Y)は、複数の文字からなる
データ送信命令のうちの1文字分を計測器に送る(ステ
ップS203)。あるいは、ステップS202で受信可
能状態ではない場合(N)は、受信可能になるのに十分
な待ち時間を決めてその待ち時間だけ待ってからデータ
送信命令のうちの1文字分を計測器に送る。次に、CP
Uはデータ送信命令を全部送ったか否かを判断し(ステ
ップS204)、送っていない場合(N)はステップS
202へ戻る。データ送信命令を全部送った場合(ステ
ップS204;Y)には、CPUは、計測器からのデー
タが受信バッファに入っているか否かを判断し(ステッ
プS205)、入っていない場合はこの判断(ステップ
S205)を繰り返す。入っている場合(Y)は、バッ
ファからデータを1文字分読み込む(ステップS20
6)。次に、CPUはバッファから読み込んだデータが
文字列で送られてきたデータの最後か否かを判断し(ス
テップS207)、最後ではない場合(N)はステップ
S205へ戻る。最後の場合(ステップS207;Y)
は、CPUは、データ(文字列)を数値に変換する(ス
テップS208)。なお、ステップS202〜S208
が計測データ取得用モジュールS200を構成する。
In this operation, the CPU first determines whether or not one second has passed (step S201), and if not one second (N), repeats this determination (step S201). If 1 second has passed (Y), it is determined whether or not the measuring instrument is in the receivable state by monitoring the receivable signal from the measuring instrument (step S202). If it is not in the receivable state (N), this determination is made. (Step S202) is repeated. If the data is ready to be received (Y), one character of the data transmission command consisting of a plurality of characters is sent to the measuring instrument (step S203). Alternatively, when it is not in the receivable state in step S202 (N), a waiting time sufficient to become receivable is determined, the waiting time is waited for, and one character of the data transmission command is sent to the measuring instrument. . Next, CP
The U judges whether or not all the data transmission commands have been sent (step S204), and if not (N), the step S
Return to 202. When all the data transmission commands have been sent (step S204; Y), the CPU determines whether or not the data from the measuring instrument is stored in the reception buffer (step S205), and if not, this determination (step S205). Step S205) is repeated. If it is included (Y), the data for one character is read from the buffer (step S20).
6). Next, the CPU determines whether the data read from the buffer is the end of the data sent in the character string (step S207), and if not (N), the process returns to step S205. In the last case (step S207; Y)
The CPU converts the data (character string) into a numerical value (step S208). Note that steps S202 to S208
Constitutes a measurement data acquisition module S200.

【0005】次に、CPUは、他のデータ取り込み用モ
ジュールS209を実行し、モジュールS200、S2
09で取り込んだデータを画面に表示する(ステップS
210)。次に、CPUは、処理を終了するか否かを判
断し(ステップS211)、終了しない場合(N)はス
テップS201へ戻り、終了する場合(Y)は動作を終
了する。
Next, the CPU executes the other data fetching module S209, and the modules S200 and S2 are executed.
The data captured in 09 is displayed on the screen (step S
210). Next, the CPU determines whether or not to end the process (step S211). If the process is not ended (N), the process returns to step S201, and if the process is ended (Y), the operation is ended.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、図3に
示す動作では、計測器にデータ送信命令を送る際に、ス
テップS202で計測器が受信可能状態になるのを待っ
たり、待ち時間が経過するのを待ったりするためプログ
ラムが停留する。また、計測器からのデータを受信する
際にも、ステップS205でデータが来るのを待つため
プログラムが停留する。このように従来の動作では、プ
ログラムが停留している間、CPUが独占されるため、
CPUが他の処理を行うことができず、効率が悪いとい
う問題点がある。また、そのため、非常時の対応等が遅
れる場合があるという問題点がある。
However, in the operation shown in FIG. 3, when a data transmission command is sent to the measuring instrument, the measuring instrument waits for a receivable state or a waiting time elapses in step S202. The program stops because it waits for you. Also, when receiving data from the measuring instrument, the program is stopped in order to wait for the data to come in step S205. In this way, in the conventional operation, the CPU is monopolized while the program is stopped,
There is a problem that the efficiency is poor because the CPU cannot perform other processing. In addition, there is a problem that the emergency response may be delayed.

【0007】また、図3に示す動作では、1秒たった時
点でデータ送信命令を出し始めるため、実際に画面に表
示されるのは、1秒たった時点から暫くしてからになっ
てしまうという問題点がある。更に、データ送信命令を
出し始めようとしてから、画面表示まで(ステップS2
02〜S210)は必ず1秒以内におさまるようにしな
ければならないという問題点がある。
Further, in the operation shown in FIG. 3, since the data transmission command is started to be issued at the time of 1 second, the problem that the data is actually displayed on the screen is a while after 1 second. There is a point. Further, from the start of issuing the data transmission command to the screen display (step S2
02-S210) has a problem that it must be set within 1 second.

【0008】本発明はかかる問題点に鑑みてなされたも
ので、その目的は、計測器等のデータ出力装置にデータ
送信命令を送り、このデータ送信命令に応じてデータ出
力装置から送られてきたデータをCPUに取り込む場合
において、データ出力装置がデータ送信命令を受信可能
になるまでの間や、データ出力装置からデータが送られ
てくるまでの間、プログラムが停留することがなく、C
PUを効率的に使用することができるようにしたデータ
取得装置および方法を提供することにある。
The present invention has been made in view of the above problems, and an object thereof is to send a data transmission command to a data output device such as a measuring instrument, and to send from the data output device in response to the data transmission command. When data is taken into the CPU, the program does not stop until the data output device can receive the data transmission command or until the data is sent from the data output device.
It is to provide a data acquisition device and method capable of efficiently using a PU.

【0009】[0009]

【課題を解決するための手段】請求項1記載のデータ取
得装置は、データ出力装置にデータ送信命令を送ってあ
るか否かを判断する第1の処理を行う送信命令送信判断
手段と、この送信命令送信判断手段によってデータ送信
命令を送っていないと判断されたときに、データ出力装
置が受信可能状態か否かを確認し、受信可能状態である
場合にはデータ送信命令を送り、受信可能状態ではない
場合には他の処理へ移行する第2の処理を行う送信命令
送信制御手段と、送信命令送信判断手段によってデータ
送信命令を送ってあると判断されたときに、データ出力
装置よりデータが送られているか否かを判断し、送られ
ている場合にはデータを取り込み、送られていない場合
には他の処理へ移行する第3の処理を行うデータ受信制
御手段と、送信命令送信判断手段、送信命令送信制御手
段およびデータ受信制御手段を繰り返し動作させる動作
制御手段とを備えたものである。
According to a first aspect of the present invention, there is provided a data acquisition device, which comprises a transmission command transmission determining means for performing a first process of determining whether or not a data transmission command is transmitted to a data output device, and When the transmission command transmission determination means determines that the data transmission command has not been transmitted, the data output device confirms whether or not the data output device is in the receivable state, and if the data output device is in the receivable state, the data transmission command is transmitted and the reception is possible. If it is determined that the data transmission command has been transmitted by the transmission command transmission control unit that performs the second process of shifting to another process when it is not in the state and the data transmission command is transmitted by the transmission command transmission determination unit. Is sent, and if it is sent, the data reception control means that takes in the data, and if it is not sent, performs the third process of shifting to another process, and the transmission order. Transmission determination unit, in which a motion control means for operating repeatedly transmitted command transmission control means and data receiving control means.

【0010】このデータ取得装置では、送信命令送信判
断手段は、データ出力装置にデータ送信命令を送ってあ
るか否かを判断する第1の処理を行う。送信命令送信制
御手段は、送信命令送信判断手段によってデータ送信命
令を送っていないと判断されたときに、データ出力装置
が受信可能状態か否かを確認し、受信可能状態である場
合にはデータ送信命令を送り、受信可能状態ではない場
合には他の処理へ移行する第2の処理を行う。データ受
信制御手段は、送信命令送信判断手段によってデータ送
信命令を送ってあると判断されたときに、データ出力装
置よりデータが送られているか否かを判断し、送られて
いる場合にはデータを取り込み、送られていない場合に
は他の処理へ移行する第3の処理を行う。そして、動作
制御手段は、送信命令送信判断手段、送信命令送信制御
手段およびデータ受信制御手段を繰り返し動作させる。
In this data acquisition device, the transmission command transmission judgment means carries out a first process for judging whether or not a data transmission command has been sent to the data output device. The transmission command transmission control means confirms whether or not the data output device is in the receivable state when the transmission command transmission determination means determines that the data transmission command is not transmitted, and if the data output device is in the receivable state, transmits the data. A second command is sent to send a transmission command and shift to another process if not in a receivable state. The data reception control means, when the transmission command transmission judgment means judges that the data transmission command has been sent, judges whether or not the data is sent from the data output device, and if it is sent, the data reception control means Is taken in, and if it has not been sent, a third process for shifting to another process is performed. Then, the operation control means repeatedly operates the transmission command transmission determination means, the transmission command transmission control means, and the data reception control means.

【0011】請求項2記載のデータ取得方法は、データ
出力装置にデータ送信命令を送ってあるか否かを判断す
る第1の処理と、この第1の処理によってデータ送信命
令を送っていないと判断されたときに、データ出力装置
が受信可能状態か否かを確認し、受信可能状態である場
合にはデータ送信命令を送り、受信可能状態ではない場
合には他の処理へ移行する第2の処理と、第1の処理に
よってデータ送信命令を送ってあると判断されたとき
に、データ出力装置よりデータが送られているか否かを
判断し、送られている場合にはデータを取り込み、送ら
れていない場合には他の処理へ移行する第3の処理とを
繰り返し行うものである。
In the data acquisition method according to the second aspect of the present invention, the first process for determining whether or not a data transmission command has been sent to the data output device and the data transmission command has not been sent by this first process. When judged, it is confirmed whether or not the data output device is in the receivable state. If the data output device is in the receivable state, a data transmission command is sent, and if it is not in the receivable state, the process shifts to another process. And the first process, when it is determined that the data transmission command is sent, it is determined whether the data is sent from the data output device, and if the data is sent, the data is taken in, If it has not been sent, the third process of shifting to another process is repeatedly performed.

【0012】[0012]

【実施例】以下、本発明の実施例について図面を参照し
て詳細に説明する。
Embodiments of the present invention will now be described in detail with reference to the drawings.

【0013】図1は本発明の一実施例に係るデータ取得
装置の構成を表すブロック図である。本実施例のデータ
取得装置は、データ出力装置としての計測器10からの
データを取り込むCPU20と、このCPU20と計測
器10とを接続するインタフェース30とを備えてい
る。
FIG. 1 is a block diagram showing the configuration of a data acquisition device according to an embodiment of the present invention. The data acquisition device of the present embodiment includes a CPU 20 as a data output device for taking in data from the measuring instrument 10 and an interface 30 connecting the CPU 20 and the measuring instrument 10.

【0014】インタフェース30は、内部バス31と、
この内部バス31に接続された送信バッファ32、受信
バッファ33、双方向ゲート34および制御部35を備
えている。送信バッファ32は計測器10に接続され、
計測器10に送るデータ送信命令41を保持するように
なっている。受信バッファ33は計測器10に接続さ
れ、計測器10からのデータ42を保持するようになっ
ている。双方向ゲート34はCPU20に接続され、C
PU20からデータ送信命令を受けると共に、計測器1
0からのデータをCPU20へ送るようになっている。
制御部35は計測器10、CPU20、送信バッファ3
2および受信バッファ33に接続され、計測器10から
の受信可能信号43を受けると共に、CPU20の制御
の下で送信バッファ32と受信バッファ33を制御する
ようになっている。
The interface 30 includes an internal bus 31 and
A transmission buffer 32, a reception buffer 33, a bidirectional gate 34, and a control unit 35 connected to the internal bus 31 are provided. The transmission buffer 32 is connected to the measuring instrument 10,
A data transmission command 41 to be sent to the measuring instrument 10 is held. The reception buffer 33 is connected to the measuring instrument 10 and holds the data 42 from the measuring instrument 10. The bidirectional gate 34 is connected to the CPU 20, and C
The measuring instrument 1
The data from 0 is sent to the CPU 20.
The control unit 35 includes the measuring device 10, the CPU 20, and the transmission buffer 3.
2 is connected to the reception buffer 33, receives the receivable signal 43 from the measuring instrument 10, and controls the transmission buffer 32 and the reception buffer 33 under the control of the CPU 20.

【0015】CPU20は、計測器10にデータ送信命
令を送ってあるか否かを判断する第1の処理を行う送信
命令送信判断手段21と、この送信命令送信判断手段2
1によってデータ送信命令を送っていないと判断された
ときに、計測器10が受信可能状態か否かを確認し、受
信可能状態である場合にはデータ送信命令を送り、受信
可能状態ではない場合には他の処理へ移行する第2の処
理を行う送信命令送信制御手段22と、送信命令送信判
断手段21によってデータ送信命令を送ってあると判断
されたときに、計測器10よりデータが送られているか
否かを判断し、送られている場合にはデータを取り込
み、送られていない場合には他の処理へ移行する第3の
処理を行うデータ受信制御手段23と、送信命令送信判
断手段21、送信命令送信制御手段22およびデータ受
信制御手段23を繰り返し動作させる動作制御手段24
とを備えている。これらの手段はプログラムを実行する
ことによって実現される。なお、図示しないが、CPU
20にはメモリやディスプレイ等、処理に応じて必要な
装置が接続されている。
The CPU 20 has a transmission command transmission determination means 21 for performing a first process for determining whether or not a data transmission command has been sent to the measuring instrument 10, and this transmission command transmission determination means 2.
When it is determined by 1 that the data transmission command is not sent, it is checked whether the measuring instrument 10 is in the receivable state, and if it is in the receivable state, the data transmission command is sent, and if it is not in the receivable state. When the transmission command transmission control means 22 that performs the second processing for shifting to another processing and the transmission command transmission determination means 21 determine that the data transmission instruction is transmitted, the measuring instrument 10 transmits the data. Data reception control means 23 for performing a third process of determining whether or not the data has been sent, if the data has been sent, and taking the data if the data has not been sent, and sending command sending judgment Operation control means 24 for repeatedly operating the means 21, the transmission command transmission control means 22 and the data reception control means 23
It has and. These means are realized by executing a program. Although not shown, the CPU
A device required for processing, such as a memory and a display, is connected to the unit 20.

【0016】次に、本実施例のデータ取得装置の動作お
よび本実施例のデータ取得方法について説明する。
Next, the operation of the data acquisition device of this embodiment and the data acquisition method of this embodiment will be described.

【0017】図2は図1に示すCPU20の動作、すな
わち本実施例のデータ取得方法を表す流れ図である。こ
の動作は、1秒毎に、計測データ取得用モジュールS1
00によって計測器10からのデータを取り込むと共
に、他のデータ取り込み用モジュールS110によって
他のデータも取り込み、これらのデータをディスプレイ
の画面に表示させる場合の動作を示している。この動作
では、CPU20はまず、前回の画面表示から1秒たっ
たか否かを判断し(ステップS101)、1秒たってい
る場合(Y)は、メモリのデータ格納領域に入っている
データをディスプレイの画面に表示させ(ステップS1
02)、計測データ取得用モジュールS100へ進む。
1秒たっていない場合(ステップS101;N)は、そ
のまま計測データ取得用モジュールS100へ進む。
FIG. 2 is a flow chart showing the operation of the CPU 20 shown in FIG. 1, that is, the data acquisition method of this embodiment. This operation is performed every 1 second by the measurement data acquisition module S1.
00 shows the operation in the case where the data from the measuring instrument 10 is loaded by 00, the other data is loaded by the other data loading module S110, and these data are displayed on the screen of the display. In this operation, the CPU 20 first determines whether or not one second has passed from the previous screen display (step S101), and if one second has passed (Y), the data stored in the data storage area of the memory is displayed on the display. Display it on the screen (step S1
02), and proceeds to the measurement data acquisition module S100.
When 1 second has not passed (step S101; N), the process directly proceeds to the measurement data acquisition module S100.

【0018】計測データ取得用モジュールS100で
は、CPU20はまず、送信命令送信判断手段21によ
って、計測器10にデータ送信命令を送ってあるか否か
を判断する(ステップS103)。なお、データ送信命
令は複数の文字からなり、データ送信命令を送っている
途中でも、データ送信命令の全てを送っていないとき
は、ステップS103においてデータ送信命令を送って
いないと判断する。
In the measurement data acquisition module S100, the CPU 20 first determines by the transmission command transmission determination means 21 whether or not a data transmission command has been sent to the measuring instrument 10 (step S103). The data transmission command is composed of a plurality of characters. Even if the data transmission command is being transmitted, if all the data transmission commands have not been transmitted, it is determined in step S103 that the data transmission command has not been transmitted.

【0019】ステップS103においてデータ送信命令
を送っていないと判断された場合(N)には、CPU2
0は、送信命令送信制御手段22によって、計測器10
が受信可能状態か否かを確認する(ステップS10
4)。なお、計測器10が受信可能状態か否かの確認
は、インタフェース30の制御部35が計測器10から
受ける受信可能信号43によって行う。送信命令送信制
御手段22は、計測器10が受信可能状態である場合
(ステップS104;Y)には、双方向ゲート34、内
部バス31および送信バッファ32を介して計測器10
にデータ送信命令1文字分を送り(ステップS10
5)、他のデータ取り込み用モジュールS110へ移行
する。計測器10が受信可能状態ではない場合(ステッ
プS104;N)には、そのまま他のデータ取り込み用
モジュールS110へ移行する。
If it is determined in step S103 that the data transmission command has not been sent (N), the CPU 2
0 indicates the measuring instrument 10 by the transmission command transmission control means 22.
It is confirmed whether or not is in a receivable state (step S10).
4). The control unit 35 of the interface 30 confirms whether the measuring instrument 10 is in the receivable state by the receivable signal 43 received from the measuring instrument 10. When the measuring instrument 10 is in the receivable state (step S104; Y), the transmission command transmission control means 22 passes the bidirectional gate 34, the internal bus 31, and the transmission buffer 32 to the measuring instrument 10.
Send one character of data transmission command to (step S10
5) Then, the process proceeds to another data capturing module S110. When the measuring instrument 10 is not in the receivable state (step S104; N), the process directly proceeds to another data capturing module S110.

【0020】ステップS103においてデータ送信命令
を送ってあると判断された場合(Y)には、CPU20
は、データ受信制御手段23によって、計測器10から
のデータが受信バッファ33に入っているか否かを判断
する(ステップS106)。データ受信制御手段23
は、データが受信バッファ33に入っている場合(Y)
には、受信バッファ33、内部バス31および双方向ゲ
ート34を介してデータを1文字分読み込む(ステップ
S107)。データが受信バッファ33に入っていない
場合(N)には、そのまま他のデータ取り込み用モジュ
ールS110へ移行する。データ受信制御手段23は、
データを1文字分読み込んだら、そのデータが文字列で
送られてきたデータの最後か否かを判断し(ステップS
108)、最後の場合(Y)はデータ(文字列)を数値
に変換し、メモリのデータ格納領域に格納して(ステッ
プS109)、他のデータ取り込み用モジュールS11
0へ移行し、最後ではない場合(N)はそのまま他のデ
ータ取り込み用モジュールS110へ移行する。
If it is determined in step S103 that the data transmission command has been sent (Y), the CPU 20
The data reception control means 23 determines whether or not the data from the measuring instrument 10 is stored in the reception buffer 33 (step S106). Data reception control means 23
Indicates that the data is stored in the reception buffer 33 (Y).
Data is read for one character via the reception buffer 33, the internal bus 31, and the bidirectional gate 34 (step S107). If the data is not stored in the reception buffer 33 (N), the process directly proceeds to another data capturing module S110. The data reception control means 23
After reading the data for one character, it is determined whether the data is the end of the data sent in the character string (step S
108), in the last case (Y), the data (character string) is converted into a numerical value, which is stored in the data storage area of the memory (step S109), and another data fetching module S11.
If it is not the last (N), the process directly proceeds to another data acquisition module S110.

【0021】なお、ステップS103〜S109が計測
データ取得用モジュールS100を構成する。
The steps S103 to S109 constitute a measurement data acquisition module S100.

【0022】次に、CPU20は、他のデータ取り込み
用モジュールS110を実行する。この他のデータ取り
込み用モジュールS110も、計測データ取得用モジュ
ールS100と同様に、プログラムが停留しない形にし
ておく。次に、CPU20は、処理を終了するか否かを
判断し(ステップS111)、終了しない場合(N)は
ステップS101へ戻り、終了する場合(Y)は動作を
終了する。このように、画面表示(ステップS10
2)、計測データ取得用モジュールS100および他の
データ取り込み用モジュールS110は、処理を終了す
る(ステップS111;Y)まで、動作制御手段24に
よって繰り返し実行される。
Next, the CPU 20 executes another data acquisition module S110. Similarly to the measurement data acquisition module S100, the other data acquisition module S110 is also set in a form in which the program does not stop. Next, the CPU 20 determines whether or not to end the process (step S111). If not ended (N), the process returns to step S101, and if ended (Y), the operation is ended. In this way, the screen display (step S10
2) The measurement data acquisition module S100 and the other data acquisition module S110 are repeatedly executed by the operation control means 24 until the processing is completed (step S111; Y).

【0023】このように本実施例によれば、計測器10
がデータ送信命令を受信可能になるまでの間や、計測器
10からデータが送られてくるまでの間、プログラムが
停留することがなく、CPU20を効率的に使用するこ
とができる。
As described above, according to this embodiment, the measuring instrument 10
The CPU 20 can be used efficiently until the program can be received until the device can receive the data transmission command or until the data is sent from the measuring instrument 10.

【0024】また、プログラムが停留することがないた
め、非常時でも速やかに対応することができる。
Further, since the program does not stay, it is possible to respond promptly even in an emergency.

【0025】また、本実施例では、前回の画面表示から
1秒たったら、その時点でデータ格納領域に入っている
データを表示するようにしているので、データ送信命令
を送ったりデータを受信したりするのに要する時間分だ
け1秒たった時間から遅れて画面表示が行われることが
なく、1秒たった時点で瞬時にデータを画面に表示する
ことができる。
In this embodiment, the data stored in the data storage area at that time is displayed 1 second after the previous screen display. Therefore, a data transmission command is sent or data is received. It is possible to instantly display the data on the screen at a time point of 1 second without delaying the screen display from the time of 1 second which is the time required for the movement.

【0026】また、データ送信命令を送り始めようとし
てから、データを受信し終わるまでに1秒以上かかって
も、1秒たった時点で、前回のデータが必ずデータ格納
領域に入っているため、画面表示を行うことができる。
Even if it takes more than 1 second from the start of sending a data transmission command to the end of receiving the data, the previous data is always stored in the data storage area at the time of 1 second. The display can be done.

【0027】なお、本発明は上記実施例に限定されず、
例えば図2における計測データ取得用モジュールS10
0において、データ送信命令を1文字分ずつではなく、
1回で全てを送るようにしても良い。また、データも1
文字分ずつではなく、1回で全てを読み込むようにして
も良い。
The present invention is not limited to the above embodiment,
For example, the measurement data acquisition module S10 in FIG.
In 0, the data transmission command is not one character at a time, but
It is also possible to send all at once. Also, the data is 1
You may make it read all at once rather than character by character.

【0028】[0028]

【発明の効果】以上説明したように本発明によれば、計
測器等のデータ出力装置にデータ送信命令を送り、この
データ送信命令に応じてデータ出力装置から送られてき
たデータをCPUに取り込む場合において、データ出力
装置にデータ送信命令を送ってあるか否かを判断する第
1の処理と、この第1の処理によってデータ送信命令を
送っていないと判断されたときに、データ出力装置が受
信可能状態か否かを確認し、受信可能状態である場合に
はデータ送信命令を送り、受信可能状態ではない場合に
は他の処理へ移行する第2の処理と、第1の処理によっ
てデータ送信命令を送ってあると判断されたときに、デ
ータ出力装置よりデータが送られているか否かを判断
し、送られている場合にはデータを取り込み、送られて
いない場合には他の処理へ移行する第3の処理とを繰り
返し行うようにしたので、データ出力装置がデータ送信
命令を受信可能になるまでの間や、データ出力装置から
データが送られてくるまでの間、プログラムが停留する
ことがなく、CPUを効率的に使用することができると
いう効果がある。
As described above, according to the present invention, a data transmission command is sent to a data output device such as a measuring instrument, and the data sent from the data output device in response to this data transmission command is taken into the CPU. In this case, the first process for determining whether or not a data transmission command is sent to the data output device, and the data output device when the first process determines that the data transmission command is not sent, It is confirmed whether or not it is in the receivable state, and if it is in the receivable state, a data transmission command is sent, and if it is not in the receivable state, the second process of moving to another process and the first process When it is judged that the transmission command has been sent, it is judged whether or not the data is sent from the data output device. If the data is sent, the data is taken in. If not, other data is sent. Since the third process of shifting to the processing is repeatedly performed, the program is executed until the data output device can receive the data transmission command or until the data is transmitted from the data output device. There is an effect that the CPU can be used efficiently without being stopped.

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

【図1】本発明の一実施例に係るデータ取得装置の構成
を表すブロック図である。
FIG. 1 is a block diagram showing a configuration of a data acquisition device according to an embodiment of the present invention.

【図2】図1に示したCPUの動作を説明するための流
れ図である。
FIG. 2 is a flowchart for explaining the operation of the CPU shown in FIG.

【図3】計測器によって得られるデータをCPUに取り
込む場合における従来のCPUの動作の一例を説明する
ための流れ図である。
FIG. 3 is a flowchart for explaining an example of the operation of the conventional CPU when the data obtained by the measuring instrument is loaded into the CPU.

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

10 計測器 20 CPU 21 送信命令送信判断手段 22 送信命令送信制御手段 23 データ受信制御手段 24 動作制御手段 30 インタフェース 32 送信バッファ 33 受信バッファ 34 双方向ゲート 35 制御部 10 Measuring Instrument 20 CPU 21 Transmission Command Transmission Judgment Means 22 Transmission Command Transmission Control Means 23 Data Reception Control Means 24 Operation Control Means 30 Interface 32 Transmission Buffer 33 Reception Buffer 34 Bidirectional Gate 35 Control Section

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 データ出力装置にデータ送信命令を送っ
てあるか否かを判断する第1の処理を行う送信命令送信
判断手段と、 この送信命令送信判断手段によってデータ送信命令を送
っていないと判断されたときに、データ出力装置が受信
可能状態か否かを確認し、受信可能状態である場合には
データ送信命令を送り、受信可能状態ではない場合には
他の処理へ移行する第2の処理を行う送信命令送信制御
手段と、 前記送信命令送信判断手段によってデータ送信命令を送
ってあると判断されたときに、データ出力装置よりデー
タが送られているか否かを判断し、送られている場合に
はデータを取り込み、送られていない場合には他の処理
へ移行する第3の処理を行うデータ受信制御手段と、 前記送信命令送信判断手段、送信命令送信制御手段およ
びデータ受信制御手段を繰り返し動作させる動作制御手
段とを具備することを特徴とするデータ取得装置。
1. A transmission command transmission determination means for performing a first process for determining whether or not a data transmission command is transmitted to a data output device, and a data transmission command is not transmitted by this transmission command transmission determination means. When judged, it is confirmed whether or not the data output device is in the receivable state. If the data output device is in the receivable state, a data transmission command is sent, and if it is not in the receivable state, the process shifts to another process. When it is determined by the transmission command transmission control means that performs the processing of step 1 and the transmission command transmission determination means, the data output device determines whether or not the data is transmitted, and the data is transmitted. If it is, the data reception control means for performing the third processing to take in the data, and if it is not sent, to the other processing, the transmission command transmission determination means, the transmission command transmission control means, And an operation control means for repeatedly operating the data reception control means.
【請求項2】 データ出力装置にデータ送信命令を送っ
てあるか否かを判断する第1の処理と、この第1の処理
によってデータ送信命令を送っていないと判断されたと
きに、データ出力装置が受信可能状態か否かを確認し、
受信可能状態である場合にはデータ送信命令を送り、受
信可能状態ではない場合には他の処理へ移行する第2の
処理と、前記第1の処理によってデータ送信命令を送っ
てあると判断されたときに、データ出力装置よりデータ
が送られているか否かを判断し、送られている場合には
データを取り込み、送られていない場合には他の処理へ
移行する第3の処理とを繰り返し行うことを特徴とする
データ取得方法。
2. A first process for determining whether or not a data transmission command has been sent to the data output device, and a data output when it is determined that the data transmission command has not been sent by this first process. Check if the device is ready to receive,
If it is in the receivable state, a data transmission command is sent, and if it is not in the receivable state, it is judged that the data transmission command has been sent by the second process and the first process. When it is sent, it is judged whether or not the data is sent from the data output device. If the data is sent, the data is taken in, and if it is not sent, the third process of shifting to another process is performed. A data acquisition method characterized by being repeated.
JP6135119A 1994-05-25 1994-05-25 Device and method for data aqulsition Pending JPH07321878A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6135119A JPH07321878A (en) 1994-05-25 1994-05-25 Device and method for data aqulsition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6135119A JPH07321878A (en) 1994-05-25 1994-05-25 Device and method for data aqulsition

Publications (1)

Publication Number Publication Date
JPH07321878A true JPH07321878A (en) 1995-12-08

Family

ID=15144271

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6135119A Pending JPH07321878A (en) 1994-05-25 1994-05-25 Device and method for data aqulsition

Country Status (1)

Country Link
JP (1) JPH07321878A (en)

Similar Documents

Publication Publication Date Title
US4949241A (en) Microcomputer system including a master processor and a slave processor synchronized by three control lines
JPH07321878A (en) Device and method for data aqulsition
JP2001014227A (en) Method and device for updating time-out time and machine-readable recording medium with program recorded thereon
JPH10254738A (en) Emulator device and emulation method
JP3450735B2 (en) Processing equipment
JPH06230806A (en) Remote i/o system for programmable controller
JP2973665B2 (en) How to display process volume
JP2584616B2 (en) Photoelectric fire sensor
JP3006268B2 (en) Collective panel device
JP2003029954A (en) Sleep mode canceling method for electronic equipment, computer and program
JPH0767159A (en) Key telephone system
JPH09237241A (en) Physical number/logic number conversion control substrate and logic number storage controlled substrate
JPS6356737B2 (en)
JPS5850037A (en) Communication controller
JP2616406B2 (en) Data transfer time measurement method
JP3207890B2 (en) Memory access method for waveform storage device
JP2000049808A (en) External storage device and data processing unit having infrared ray communication function and communication system
JPH08223245A (en) Data transmission system
JPH07319625A (en) Device and method for data acquisition
JPH0644104A (en) Information processor
JPH066358A (en) Token control method and its equipment
JP2001074810A (en) Semiconductor testing method and testing apparatus
JPH04278616A (en) Initialization system for data input/output device
JPS62237830A (en) Communication control equipment
JPH01251285A (en) Image processor