JPH11112721A - Device and method for controlling switch in scanner device - Google Patents

Device and method for controlling switch in scanner device

Info

Publication number
JPH11112721A
JPH11112721A JP9275629A JP27562997A JPH11112721A JP H11112721 A JPH11112721 A JP H11112721A JP 9275629 A JP9275629 A JP 9275629A JP 27562997 A JP27562997 A JP 27562997A JP H11112721 A JPH11112721 A JP H11112721A
Authority
JP
Japan
Prior art keywords
switch
pressed
state
notification
host device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP9275629A
Other languages
Japanese (ja)
Inventor
Kazuhiro Tanaka
和宏 田中
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.)
PFU Ltd
Original Assignee
PFU 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 PFU Ltd filed Critical PFU Ltd
Priority to JP9275629A priority Critical patent/JPH11112721A/en
Publication of JPH11112721A publication Critical patent/JPH11112721A/en
Pending legal-status Critical Current

Links

Landscapes

  • Facsimiles In General (AREA)

Abstract

PROBLEM TO BE SOLVED: To correctly report a switch state to a host device regardless of a switch depressing time and the cycle of a reporting request from the host device by providing a reporting switch information part for storing the reported switch state as against a request to fetch the switch state from the host device. SOLUTION: When a switch 2 is being continuously depressed for more than a prescribed time, the state where the switch is being depressed is set in the reporting switch information part 7 and an input switch information part 6. The state where the switch 2 is not depressed is monitored in a state where the input switch information part 6 is depressed and the state where the switch 2 is not depressed is set in the input switch information part 6 when the state where the switch is not continuously depressed for more than the prescribed time is recognized. When the report of the switch state is requested from the host device 9, contents set in the reporting switch information part 7 is reported and the state where the switch 2 is not depressed is set in the reporting switch information part 7 after reporting.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、スイッチが設け
られたスキャナ装置で、かつスイッチの状態をホスト装
置から監視できるスキャナ装置におけるスイッチ制御方
法および装置に関するものであり、特に、オペレータに
よるスイッチの押下時間とホスト装置からのスイッチ状
態の通知要求の周期によらず、正確にスイッチ状態を通
知することを可能とする。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a switch control method and apparatus in a scanner device provided with a switch and capable of monitoring the state of the switch from a host device. It is possible to accurately notify the switch state regardless of the time and the cycle of the switch state notification request from the host device.

【0002】[0002]

【従来の技術】図7に、従来の構成ブロック図を示す。
図中、71はスキャナ装置、79はホスト装置である。
2. Description of the Related Art FIG. 7 is a block diagram showing a conventional structure.
In the figure, 71 is a scanner device, and 79 is a host device.

【0003】スキャナ装置71には、スイッチ72とス
イッチ制御装置73とが設けられており、スイッチ制御
装置73はスイッチ状態を記憶するスイッチ情報部75
と、オペレータにより操作されたスイッチ状態をスイッ
チ情報部75に設定するスイッチ状態設定手段74とで
構成されている。
The scanner device 71 is provided with a switch 72 and a switch control device 73. The switch control device 73 has a switch information section 75 for storing a switch state.
And switch state setting means 74 for setting the switch state operated by the operator in the switch information section 75.

【0004】また、スイッチ状態設定手段74は、ホス
ト装置79が記載されていないインタフェースを介し、
スキャナ装置71のスイッチ状態を取り込む要求を発行
した場合、スイッチ情報部75に設定されている状態を
ホスト装置79に通知することを行う。
[0004] The switch state setting means 74 is connected via an interface in which the host device 79 is not described.
When a request for capturing the switch state of the scanner device 71 is issued, the host device 79 is notified of the state set in the switch information section 75.

【0005】また、スイッチ状態設定手段74は、外部
からのノイズによりスイッチ72が押下されていないの
に押下されたように見える場合があるため、スイッチの
入力信号の変化が安定するのを待つノイズ除去処理が設
けられている。
In some cases, the switch state setting means 74 may cause the switch 72 to appear to be depressed even though it is not depressed due to external noise. A removal process is provided.

【0006】また、スイッチ状態設定手段74は、スイ
ッチにメカニカルセンサーが使用されたとき、チャタリ
ング現象が発生し、スイッチが複数回押下されたように
見える場合があるため、スイッチの入力信号の変化が安
定するのを待つチャタリング除去処理が設けられてい
る。
When a mechanical sensor is used as a switch, the switch state setting means 74 may cause a chattering phenomenon, and the switch may appear to have been pressed a plurality of times. A chattering elimination process that waits for stabilization is provided.

【0007】図8に、従来の一実施例のスイッチ状態設
定手段の処理フローチャートを示す。以下、このフロー
にしたがって動作を説明する。
FIG. 8 shows a processing flowchart of the switch state setting means of one embodiment of the prior art. Hereinafter, the operation will be described according to this flow.

【0008】ステップS801:スイッチが押下された
かを判定する。押下されているならばステップS802
に進み、押下されていないならばステップS804に進
む。
Step S801: It is determined whether a switch has been pressed. If pressed, step S802
If not, the process proceeds to step S804.

【0009】ステップS802:スイッチが所定時間の
間、押下されたかを判定する。押下されているならばス
テップS803に進み、押下されていないならばステッ
プS806に進む。なお、この処理でスイッチのノイズ
およびスイッチを押下した時に発生するチャタリングが
除去される。
Step S802: It is determined whether the switch has been pressed for a predetermined time. If the button has been pressed, the process proceeds to step S803. If the button has not been pressed, the process proceeds to step S806. In this process, noise of the switch and chattering generated when the switch is pressed are removed.

【0010】ステップS803:スイッチ情報部にスイ
ッチが押下されている状態を設定する。そして、ステッ
プS806に進む。
Step S803: The state where the switch is pressed is set in the switch information section. Then, the process proceeds to step S806.

【0011】ステップS804:スイッチが所定時間の
間、押下されていないかを判定する。押下されていない
ならばステップS805に進み、所定時間の間に押下さ
れたならばステップS806に進む。なお、この処理で
スイッチを離した時に発生するチャタリングが除去され
る。
Step S804: It is determined whether the switch has not been pressed for a predetermined time. If the button has not been pressed, the process proceeds to step S805. If the button has been pressed within a predetermined time, the process proceeds to step S806. In this process, chattering that occurs when the switch is released is removed.

【0012】ステップS805:スイッチ情報部にスイ
ッチが押下さていない状態を設定する。
Step S805: A state where no switch is pressed is set in the switch information section.

【0013】ステップS806:ホスト装置からスイッ
チの状態を取り込むためコマンドが発行されたかを判定
する。発行されたならばステップS807に進み、発行
されていないならば処理を終了する。
Step S806: It is determined whether or not a command has been issued to capture the state of the switch from the host device. If it has been issued, the process proceeds to step S807, and if it has not been issued, the process ends.

【0014】ステップS807:スイッチ情報部に設定
されている内容をホスト装置に通知する。そして、処理
を終了する。
Step S807: The host device is notified of the contents set in the switch information section. Then, the process ends.

【0015】[0015]

【発明が解決しようとする課題】しかしながら、従来技
術ではホスト装置がスキャナ装置のスイッチ状態を知る
ため、スイッチ状態を取り込むコマンドを一定の周期で
発行する。そして、コマンド発行の周期が短いとスイッ
チの安定を確認している時間の間に2回以上のコマンド
の発行を行うことになり、結果として複数回スイッチが
押下されたように見えるという問題点があった。またオ
ペレータがスイッチを長く押し続けた時も同様に複数回
スイッチが押下されたように見えるという問題点があっ
た。
However, in the prior art, in order for the host device to know the switch status of the scanner device, a command for capturing the switch status is issued at a constant cycle. If the command issuance cycle is short, the command is issued two or more times during the time when the switch is confirmed to be stable, and as a result, the switch appears to be pressed multiple times. there were. Also, when the operator keeps pressing the switch for a long time, there is also a problem that the switch looks like being pressed a plurality of times.

【0016】また、コマンド発行の周期が長く、スイッ
チの押下時間が短い場合は、スイッチの押下を見失うと
いう問題点があった。
In addition, when the command issuance cycle is long and the switch pressing time is short, there is a problem that the switch pressing is lost.

【0017】図9に、スイッチ情報とホスト装置からの
スイッチ状態通知の要求コマンド発行とその通知情報の
タイムチャートを示す。この図は、上記の問題点をわか
りやすく図にしたものである。
FIG. 9 is a timing chart showing the issuance of a request command for switch information and switch status notification from the host device, and the notification information. This figure illustrates the above problem in an easy-to-understand manner.

【0018】図9(a)はコマンド発行の周期が短い場
合を示したものであり、スイッチが1回押下されたとき
に、ホスト装置から周期の短いコマンド発行P1〜P6
が発行されると、コマンド発行P3,P4間はスイッチ
情報が押下状態となる。したがって、ホスト装置にはス
イッチが押下されている状態の通知情報が2回通知され
ることになる。
FIG. 9A shows a case where the command issuance cycle is short. When the switch is pressed once, the host apparatus issues short-cycle command issuance P1 to P6.
Is issued, the switch information is pressed between the command issuances P3 and P4. Therefore, the host device is notified twice of the notification information indicating that the switch is pressed.

【0019】また、図9(b)はコマンド発行の周期が
長い場合を示したものであり、スイッチが1回押下され
たときに、ホスト装置から周期の長いコマンド発行P1
〜P3が発行されると、コマンド発行P1〜P2間にス
イッチの押下状態が終了していまう。したがって、ホス
ト装置にはスイッチが押下されている状態の通知情報が
通知されないことになる。
FIG. 9B shows a case where the command issuance cycle is long. When the switch is pressed once, the host apparatus issues a long-term command issuance P1.
~ P3 are issued, the pressed state of the switch is completed between the command issuances P1 and P2. Therefore, the host device is not notified of the notification information indicating that the switch is pressed.

【0020】つまり、スイッチの押下時間とホスト装置
からのスイッチ状態を取り込むコマンド発行の周期との
相関関係により、スキャナ装置のスイッチ状態が正しく
通知されないという問題点があった。
That is, there is a problem in that the switch state of the scanner device is not correctly notified due to the correlation between the switch pressing time and the period of issuing a command for capturing the switch state from the host device.

【0021】また、スイッチの入力信号に発生するノイ
ズおよびスイッチを押下する時またはスイッチを離す時
に発生するチャタリングを除去するため、スイッチの入
力信号の変化が安定するのを待つ処理を設けている。こ
のため、ノイズやチャタリングを除去する処理時間が長
くなり、スイッチの反応が鈍くなるという問題点があっ
た。
Further, in order to eliminate noise generated in the input signal of the switch and chattering generated when the switch is pressed or released, a process for waiting for a change in the input signal of the switch to stabilize is provided. For this reason, there has been a problem that the processing time for removing noise and chatter becomes longer and the response of the switch becomes slower.

【0022】[0022]

【課題を解決するための手段】この発明は上記のような
問題点を考慮してなされたもので、オペレータによるス
イッチ操作の状態を記憶する入力用スイッチ情報部と、
ホスト装置からのスイッチ状態を取り込む要求に対して
通知されるスイッチ状態を記憶する通知用スイッチ情報
部を持つことにより、スイッチの押下時間とホスト装置
からのスイッチ状態の通知要求の周期によらず、スイッ
チ状態を正確にホスト装置に通知することが可能とな
る。
SUMMARY OF THE INVENTION The present invention has been made in consideration of the above problems, and has an input switch information section for storing a state of a switch operation by an operator;
By having a notification switch information section that stores a switch state notified in response to a request to capture the switch state from the host device, regardless of the switch pressing time and the cycle of the switch status notification request from the host device, The switch state can be accurately notified to the host device.

【0023】[0023]

【発明の実施の形態】スイッチが設けられたスキャナ装
置で、かつスイッチの状態をホスト装置から監視できる
スキャナ装置におけるスイッチ制御方法において、スイ
ッチが押下されていない状態と押下されている状態の2
つの状態を記憶する入力用スイッチ情報部と通知用スイ
ッチ情報部とを備え、入力用スイッチ情報部が押下され
てない状態のときは、スイッチが押下されたかを監視
し、所定時間以上連続して押下されていることを確認し
た場合に、通知用スイッチ情報部と入力用スイッチ情報
部にスイッチが押下されている状態を設定し、入力用ス
イッチ情報部が押下されている状態のときは、スイッチ
が押下されていない状態を監視し、所定時間以上連続し
て押下されていない状態を確認した場合に、入力用スイ
ッチ情報部にスイッチが押下されていない状態を設定
し、ホスト装置からスイッチ状態の通知を要求された場
合は、通知用スイッチ情報部に設定された内容を通知
し、通知後に通知用スイッチ情報部にスイッチが押下さ
れていない状態を設定することにより、オペレータによ
るスイッチの押下時間とホスト装置からのスイッチ状態
の通知要求の周期によらず、スイッチ状態を正確にホス
ト装置に通知することが可能となる。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS In a switch control method for a scanner device provided with a switch and capable of monitoring the state of the switch from a host device, there are provided two methods: a state in which the switch is not pressed and a state in which the switch is pressed.
An input switch information section for storing one state and a notification switch information section, and when the input switch information section is not pressed, monitors whether the switch is pressed, and continuously monitors for a predetermined time or more. When it is confirmed that the switch is pressed, the state where the switch is pressed is set in the notification switch information section and the input switch information section, and when the input switch information section is pressed, the switch is set. The state where the switch is not pressed is monitored.If the state where the switch is not pressed continuously for a predetermined time or more is confirmed, the state where the switch is not pressed is set in the input switch information section, and the switch state of the switch state is set from the host device. When a notification is requested, the content set in the notification switch information part is notified, and after the notification, the state where the switch is not pressed is set in the notification switch information part. It makes regardless of the period of the switch state of the notification request from depression time the host device switches by the operator, it is possible to notify the precise host device switches state.

【0024】また、入力用スイッチ情報部が押下されて
ない状態のとき、スイッチが連続して押下されたかを確
認する所定の時間を短くし、入力用スイッチ情報部が押
下されている状態のとき、スイッチが連続して押下され
ていないことを確認する所定の時間を長くすることによ
り、スイッチが押下された状態を入力用スイッチ情報部
に迅速に設定することが可能となり、スイッチ状態の通
知性能を高めることができる。
When the input switch information section is not depressed, the predetermined time for confirming whether the switches are continuously depressed is shortened, and when the input switch information section is depressed, By increasing the predetermined time for confirming that the switch is not continuously pressed, the state in which the switch is pressed can be quickly set in the input switch information section, and the switch state notification performance can be set. Can be increased.

【0025】また、ホスト装置からスイッチ状態の通知
の要求が所定時間絶えた場合、またはスキャナ装置の電
源投入からホスト装置がスイッチ状態の通知の要求を発
生するまでの間は、通知用スイッチ情報部にスイッチが
押下されていない状態を設定することにより、ホスト装
置が動作していないときにスイッチが押下された場合、
スイッチが押下された状態を解除することができ、ホス
ト装置が動作を開始しても、いきなりスキャナ装置が動
作してしまうことがなくなる。
Further, when the request for the notification of the switch status from the host device is stopped for a predetermined time, or between the time when the scanner device is turned on and the time when the host device issues the request for the notification of the switch status, the notification switch information portion is provided. By setting the state in which the switch is not pressed down, when the switch is pressed down when the host device is not operating,
The state in which the switch is pressed can be released, and even when the host device starts operating, the scanner device does not suddenly operate.

【0026】また、ホスト装置からスイッチ状態の通知
の要求が発生する間隔時間を測定し、スイッチ状態の通
知の要求が測定した時間を基にした所定時間を超えて絶
えた場合、通知用スイッチ情報部をスイッチが押下され
ていない状態に設定することにより、ホスト装置のハー
ドウェア性能やシステム環境によってスイッチ状態の通
知要求の周期が異なっても最適時間でスイッチ情報を解
除することができる。
Also, the interval time at which a request for notification of the switch status is generated from the host device is measured, and when the request for the notification of the switch status is cut off beyond a predetermined time based on the measured time, the switch information for notification is transmitted. By setting the switch to a state where the switch is not pressed, the switch information can be canceled at an optimal time even if the cycle of the switch status notification request varies depending on the hardware performance of the host device or the system environment.

【0027】[0027]

【実施例】図1に、本発明の構成ブロック図を示す。図
中、1はスキャナ装置、9はホスト装置である。
FIG. 1 is a block diagram showing the configuration of the present invention. In the figure, 1 is a scanner device, and 9 is a host device.

【0028】スキャナ装置1には、スイッチ2とスイッ
チ制御装置3とが設けられており、スイッチ制御装置3
はオペレータにより操作されたスイッチ状態を記憶する
入力用スイッチ情報部6と、ホスト装置からスイッチ状
態の通知を要求されたときに通知するスイッチ状態を記
憶する通知用スイッチ情報部7と、オペレータにより操
作されたスイッチ状態を入力用スイッチ情報部6に設定
およびホスト装置からスイッチ状態の通知を要求された
ときに通知用スイッチ情報部7の内容を通知するスイッ
チ状態設定手段4と、ホスト装置からのスイッチ状態の
通知要求が行われる周期をコマンド周期記憶部8に設定
するコマンド発行周期設定部5とで構成されている。
The scanner device 1 is provided with a switch 2 and a switch control device 3.
Is an input switch information section 6 for storing a switch state operated by the operator, a notification switch information section 7 for storing a switch state to be notified when a notification of the switch state is requested from the host device, Switch state setting means 4 for setting the set switch state in the input switch information section 6 and notifying the contents of the notification switch information section 7 when a notification of the switch state is requested from the host device, and a switch from the host device. A command issuance cycle setting unit 5 for setting a cycle in which a status notification request is made in the command cycle storage unit 8.

【0029】図2に、本発明の一実施例のスイッチ状態
設定手段の処理フローチャートを示す。以下、このフロ
ーにしたがって動作を説明する。
FIG. 2 shows a processing flowchart of the switch state setting means according to one embodiment of the present invention. Hereinafter, the operation will be described according to this flow.

【0030】ステップS201:スイッチが押下された
かを判定する。押下されているならばステップS202
に進み、押下されていないならばステップS205に進
む。
Step S201: It is determined whether a switch has been pressed. If pressed, step S202
If not, the process proceeds to step S205.

【0031】ステップS202:スイッチが所定時間の
間、押下されたかを判定する。押下されているならばス
テップS203に進み、押下されていないならばステッ
プS207に進む。なお、この処理でスイッチのノイズ
およびスイッチを押下した時に発生するチャタリングが
除去される。
Step S202: It is determined whether the switch has been pressed for a predetermined time. If the button has been pressed, the process proceeds to step S203. If the button has not been pressed, the process proceeds to step S207. In this process, noise of the switch and chattering generated when the switch is pressed are removed.

【0032】ステップS203:入力用スイッチ情報部
にスイッチが押下されている状態を設定する。
Step S203: The state where the switch is pressed is set in the input switch information section.

【0033】ステップS204:通知用スイッチ情報部
にスイッチが押下されている状態を設定する。そして、
ステップS207に進む。
Step S204: The state where the switch is pressed is set in the notification switch information section. And
Proceed to step S207.

【0034】ステップS205:スイッチが所定時間の
間、押下されていないかを判定する。押下されていない
ならばステップS206に進み、所定時間の間に押下さ
れたならばステップS207に進む。なお、この処理で
スイッチを離した時に発生するチャタリングが除去され
る。
Step S205: It is determined whether the switch has not been pressed for a predetermined time. If it has not been pressed, the process proceeds to step S206, and if it has been pressed for a predetermined time, the process proceeds to step S207. In this process, chattering that occurs when the switch is released is removed.

【0035】ステップS206:入力用スイッチ情報部
にスイッチが押下されていない状態を設定する。
Step S206: A state in which no switch is pressed is set in the input switch information section.

【0036】ステップS207:ホスト装置からスイッ
チの状態を取り込むためコマンドが発行されたかを判定
する。発行されたならばステップS208に進み、発行
されていないならばステップS211に進む。
Step S207: It is determined whether a command has been issued from the host device to capture the switch state. If it has been issued, the process proceeds to step S208. If it has not been issued, the process proceeds to step S211.

【0037】ステップS208:コマンドが発行された
周期を算出し、コマンド周期記憶部に設定する。なお、
この処理の詳細はあとで説明する。
Step S208: The cycle at which the command is issued is calculated and set in the command cycle storage unit. In addition,
Details of this processing will be described later.

【0038】ステップS209:通知用スイッチ情報部
に設定されている内容をホスト装置に通知する。
Step S209: The contents set in the notification switch information section are notified to the host device.

【0039】ステップS210:通知用スイッチ情報部
にスイッチが押下されていない状態を設定する。そし
て、処理を終了する。
Step S210: A state where no switch is pressed is set in the notification switch information section. Then, the process ends.

【0040】ステップS211:コマンドが発行されて
いない時間がステップS208で設定されたコマンド周
期より長いかを判定する。コマンド周期より長いならば
ステップS210に進み、コマンド周期より長くなけれ
ば処理を終了する。
Step S211: It is determined whether the time during which no command is issued is longer than the command cycle set at step S208. If it is longer than the command period, the process proceeds to step S210, and if it is not longer than the command period, the process ends.

【0041】次に、図2の処理フローチャートで実行さ
れる入力用スイッチ情報、通知用スイッチ情報、ホスト
装置からのコマンド発行、ホスト装置へ通知する通知情
報の状態をタイムチャートでわかりやすく示す。
Next, the states of the input switch information, the notification switch information, the command issued from the host device, and the notification information to be notified to the host device, which are executed in the processing flowchart of FIG.

【0042】図3と図4に、入力/通知用スイッチ情報
とホスト装置からのスイッチ状態通知の要求コマンド発
行とその通知情報のタイムチャート(1/2)を示す。
FIGS. 3 and 4 are timing charts (1/2) of input / notification switch information, issuance of a request command for switch status notification from the host device, and the notification information.

【0043】図3はコマンド発行の周期が短い場合を示
したものであり、ホスト装置から周期の短いコマンド発
行P1〜P6が発行され、コマンド発行P3,P4の時
点でスイッチが1回押下されている。
FIG. 3 shows a case where the command issuance cycle is short. The command issuance P1 to P6 having a short cycle is issued from the host device, and the switch is pressed once at the time of the command issuance P3 and P4. I have.

【0044】コマンド発行P1、P2の時点では通知用
スイッチ情報が押下されていない状態であり、ホスト装
置へはスイッチが押下されていない状態の通知情報が通
知される。そして、T1の時点でスイッチが押下される
と、入力用スイッチ情報部と通知用スイッチ情報部にス
イッチが押下された状態が設定される。
At the time of the command issuances P1 and P2, the notification switch information is in a state where the switch is not pressed, and the host device is notified of the notification information in a state where the switch is not pressed. Then, when the switch is pressed at the time T1, the state where the switch is pressed is set in the input switch information section and the notification switch information section.

【0045】コマンド発行P3の時点で、通知用スイッ
チ情報が押下された状態となるため、ホスト装置へはス
イッチが押下されている状態の通知情報が通知される。
そして、ホスト装置へ通知された直後に通知用スイッチ
情報は解除され、つまりスイッチが押下されていない状
態に設定される。
At the time of the command issuance P3, the notification switch information is in a pressed state, so that the host device is notified of the notification information of the state in which the switch is pressed.
Then, immediately after the notification to the host device, the notification switch information is released, that is, the switch is set in a state where the switch is not pressed.

【0046】そして、コマンド発行P4の時点では通知
用スイッチ情報が押下されていない状態であるため、ホ
スト装置へはスイッチが押下されていない状態の通知情
報が通知される。したがって、スイッチが1回押下され
ている間に、ホスト装置からスイッチ状態の通知要求が
複数回発生しても、ホスト装置にはスイッチが1回押下
された状態が通知されることになる。
Since the notification switch information is not pressed at the time of the command issuance P4, the host device is notified of the notification information indicating that the switch is not pressed. Therefore, even if the host device issues a switch status notification request a plurality of times while the switch is pressed once, the host device is notified of the state in which the switch is pressed once.

【0047】また、図4はコマンド発行の周期が長い場
合を示したものであり、ホスト装置から周期の長いコマ
ンド発行P1〜P3が発行され、コマンド発行P1とコ
マンド発行P2の間でスイッチが1回押下されている。
FIG. 4 shows a case where the command issuance cycle is long. The command issuance P1 to P3 having a long cycle is issued from the host device, and a switch is set between the command issuance P1 and the command issuance P2. Pressed twice.

【0048】コマンド発行P1の時点では通知用スイッ
チ情報が押下されていない状態であり、ホスト装置へは
スイッチが押下されていない状態の通知情報が通知され
る。そして、T1の時点でスイッチが押下されると、入
力用スイッチ情報部と通知用スイッチ情報部にスイッチ
が押下された状態が設定される。
At the time of the command issuance P1, the notification switch information is in a state where the switch is not pressed, and the host device is notified of the notification information in a state where the switch is not pressed. Then, when the switch is pressed at the time T1, the state where the switch is pressed is set in the input switch information section and the notification switch information section.

【0049】そして、T2の時点でスイッチが離され、
入力用スイッチ情報部にはスイッチが押下されていない
状態が設定されるが、通知用スイッチ情報部はそのまま
スイッチが押下されている状態が設定される。コマンド
発行P2の時点では、通知用スイッチ情報が押下された
状態となっているため、ホスト装置へはスイッチが押下
されている状態の通知情報が通知される。そして、ホス
ト装置へ通知された直後に通知用スイッチ情報は解除さ
れ、つまりスイッチが押下されていない状態に設定され
る。
Then, at time T2, the switch is released,
The state where the switch is not pressed is set in the input switch information section, whereas the state where the switch is pressed is set in the notification switch information section. At the time of the command issuance P2, since the notification switch information is in a pressed state, the host device is notified of the notification information indicating that the switch is being pressed. Then, immediately after the notification to the host device, the notification switch information is released, that is, the switch is set in a state where the switch is not pressed.

【0050】したがって、ホスト装置からスイッチ状態
の通知要求がない時点でスイッチが1回押下された場合
でも、次の通知要求でホスト装置にはスイッチが1回押
下された状態が通知されることになる。
Therefore, even if the switch is pressed once without a switch status notification request from the host device, the host device is notified of the state of the switch being pressed once by the next notification request. Become.

【0051】次に、図2のステップS208のホスト装
置からのコマンド発行の周期を算出する処理の詳細を説
明する。
Next, the process of calculating the command issuing cycle from the host device in step S208 in FIG. 2 will be described in detail.

【0052】図5に、ホスト装置からスイッチ状態の通
知要求が発生する周期を設定する処理フローチャートを
示す。以下、このフローにしたがって動作を説明する。
FIG. 5 is a processing flowchart for setting a cycle at which a switch status notification request is generated from the host device. Hereinafter, the operation will be described according to this flow.

【0053】ステップS501:ホスト装置からのスイ
ッチ状態の通知要求が1回目かを判定する。1回目なら
ばステップS502に進み、1回目でなければステップ
S503に進む。
Step S501: It is determined whether the switch status notification request from the host device is the first time. If it is the first time, the process proceeds to step S502, and if it is not the first time, the process proceeds to step S503.

【0054】ステップS502:タイマを読取り、現時
点の時間を一時記憶部に格納する。そして、処理を終了
する。
Step S502: The timer is read and the current time is stored in the temporary storage. Then, the process ends.

【0055】ステップS503:タイマを読取り、現時
点の時間と一時記憶部に格納されている時間との差を算
出する。そして、現時点の時間を一時記憶部に格納す
る。
Step S503: The timer is read, and the difference between the current time and the time stored in the temporary storage unit is calculated. Then, the current time is stored in the temporary storage unit.

【0056】ステップS504:ステップS503で算
出した時間の差をコマンド周期記憶部に格納する。そし
て、処理を終了する。
Step S504: The time difference calculated in step S503 is stored in the command cycle storage unit. Then, the process ends.

【0057】図6に、ノイズとチャタリングが発生した
ときのスイッチの入力信号図を示す。矢印Aはノイズで
あり、ノイズが発生している時間はT1であり、矢印B
はスイッチを押下した時に発生するチャタリング、矢印
Cはスイッチを離した時に発生するチャタリングであ
り、それぞれチャタリングが発生している時間はT2、
T3である。
FIG. 6 shows an input signal diagram of the switch when noise and chattering occur. The arrow A is noise, the time during which noise is generated is T1, and the arrow B is
Is the chattering that occurs when the switch is pressed, and the arrow C is the chattering that occurs when the switch is released. The time during which the chattering occurs is T2,
T3.

【0058】そして、ノイズが発生している時間T1は
チャタリングが発生している時間T2、T3より短い。
したがって、スイッチが押下されていない状態から押下
されている状態に変化し、押下されている状態で安定す
る監視時間、つまり図2のステップS202の所定時間
を短くすることにより、スイッチが押下された状態を入
力用スイッチ情報部に迅速に設定することが可能とな
る。
The time T1 during which noise occurs is shorter than the times T2 and T3 during which chattering occurs.
Therefore, the switch is changed from a non-pressed state to a pressed state, and the switch is pressed down by shortening the monitoring time that is stabilized in the pressed state, that is, the predetermined time in step S202 in FIG. The state can be quickly set in the input switch information section.

【0059】[0059]

【発明の効果】この発明は、上記に説明したような形態
で実施され、以下の効果がある。
The present invention is embodied in the form described above, and has the following effects.

【0060】オペレータによるスイッチの押下時間とホ
スト装置からのスイッチ状態の通知要求の周期によら
ず、スイッチ状態を正確にホスト装置に通知することが
可能となる。
The switch status can be accurately notified to the host device regardless of the switch pressing time by the operator and the cycle of the switch status notification request from the host device.

【0061】また、スイッチが押下された状態を入力用
スイッチ情報部に迅速に設定することが可能となり、ス
イッチ状態の通知性能を高めることができる。
Further, it is possible to quickly set the pressed state of the switch in the input switch information section, and it is possible to improve the performance of notifying the switch state.

【0062】また、ホスト装置が動作していないときに
スイッチが押下された場合、スイッチが押下された状態
を解除することができることにより、ホスト装置が動作
を開始しても、いきなりスキャナ装置が動作してしまう
ことを防ぐことができる。
When the switch is pressed when the host device is not operating, the state in which the switch is pressed can be released, so that even if the host device starts operating, the scanner device is immediately operated. Can be prevented.

【0063】また、ホスト装置のハードウェア性能やシ
ステム環境によってスイッチ状態の通知要求の周期は異
なるが、どのような場合においても最適時間でスイッチ
情報を解除することができる。
Although the cycle of the switch status notification request varies depending on the hardware performance of the host device and the system environment, the switch information can be canceled in an optimum time in any case.

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

【図1】 本発明の構成ブロック図である。FIG. 1 is a configuration block diagram of the present invention.

【図2】 本発明の一実施例のスイッチ状態設定手段の
処理フロチャートである。
FIG. 2 is a processing flowchart of a switch state setting unit according to one embodiment of the present invention.

【図3】 入力/通知用スイッチ情報とホスト装置から
のスイッチ状態通知の要求コマンド発行とその通知情報
のタイムチャート(1)である。
FIG. 3 is a time chart (1) of input / notification switch information, issuance of a request command for switch state notification from a host device, and notification information thereof.

【図4】 入力/通知用スイッチ情報とホスト装置から
のスイッチ状態通知の要求コマンド発行とその通知情報
のタイムチャート(2)である。
FIG. 4 is a time chart (2) of input / notification switch information, issuance of a request command for switch status notification from the host device, and notification information thereof.

【図5】 ホスト装置からスイッチ状態の通知要求が発
生する周期を設定する処理フローチャートである。
FIG. 5 is a processing flowchart for setting a cycle in which a switch state notification request is generated from a host device.

【図6】 ノイズとチャタリングが発生したときのスイ
ッチの入力信号図である。
FIG. 6 is an input signal diagram of a switch when noise and chattering occur.

【図7】 従来の構成ブロック図である。FIG. 7 is a block diagram of a conventional configuration.

【図8】 従来の一実施例のスイッチ状態設定手段の処
理フローチャートである。
FIG. 8 is a processing flowchart of a switch state setting unit according to a conventional embodiment.

【図9】 スイッチ情報とホスト装置からのスイッチ状
態通知の要求コマンド発行とその通知情報のタイムチャ
ートである。
FIG. 9 is a time chart of issuance of switch information, a request command for switch status notification from the host device, and the notification information.

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

4 スイッチ状態設定手段 6 入力用スイッチ情報部 7 通知用スイッチ情報部 4 switch status setting means 6 input switch information section 7 notification switch information section

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 スイッチが設けられたスキャナ装置で、
かつスイッチの状態をホスト装置から監視できるスキャ
ナ装置におけるスイッチ制御方法において、 スイッチが押下されていない状態と押下されている状態
の2つの状態を記憶する入力用スイッチ情報部(6)と
通知用スイッチ情報部(7)とを備え、 入力用スイッチ情報部(6)が押下されてない状態のと
きは、スイッチが押下されたかを監視し、所定時間以上
連続して押下されていることを確認した場合に、通知用
スイッチ情報部(7)と入力用スイッチ情報部(6)に
スイッチが押下されている状態を設定し、 入力用スイッチ情報部(6)が押下されている状態のと
きは、スイッチが押下されていない状態を監視し、所定
時間以上連続して押下されていない状態を確認した場合
に、入力用スイッチ情報部(6)にスイッチが押下され
ていない状態を設定し、 ホスト装置からスイッチ状態の通知を要求された場合
は、通知用スイッチ情報部(7)に設定された内容を通
知し、通知後に通知用スイッチ情報部(7)にスイッチ
が押下されていない状態を設定することを特徴とするス
イッチ制御方法。
1. A scanner device provided with a switch,
And a switch control method for a scanner device capable of monitoring a switch state from a host device, wherein an input switch information section (6) for storing two states of a state where the switch is not pressed and a state where the switch is pressed, and a notification switch. When the input switch information section (6) is not depressed, it is monitored whether the switch has been depressed and it has been confirmed that the switch has been depressed continuously for a predetermined time or more. In this case, the state in which the switch is pressed is set in the notification switch information section (7) and the input switch information section (6), and when the input switch information section (6) is in the pressed state, The state where the switch is not pressed is monitored, and when it is confirmed that the switch has not been pressed continuously for a predetermined time or more, the switch is pressed in the input switch information section (6). When the host device requests the switch state to be notified from the host device, the switch unit notifies the switch information unit for notification (7) of the set contents. After the notification, the switch is notified to the switch information unit for notification (7). A switch control method, wherein a state in which the switch is not pressed is set.
【請求項2】 入力用スイッチ情報部(6)が押下され
てない状態のとき、スイッチが連続して押下されたかを
確認する所定の時間を短くし、 入力用スイッチ情報部(6)が押下されている状態のと
き、スイッチが連続して押下されていないことを確認す
る所定の時間を長くする請求項1記載のスイッチ制御方
法。
2. When the input switch information section (6) is not depressed, a predetermined time for checking whether switches are continuously pressed is shortened, and the input switch information section (6) is depressed. 2. The switch control method according to claim 1, wherein a predetermined time for confirming that the switch is not continuously pressed when the switch is pressed is extended.
【請求項3】 ホスト装置からスイッチ状態の通知の要
求が所定時間絶えた場合、またはスキャナ装置の電源投
入からホスト装置がスイッチ状態の通知の要求を発生す
るまでの間は、通知用スイッチ情報部(7)にスイッチ
が押下されていない状態を設定する請求項1記載のスイ
ッチ制御方法。
3. The switch information unit for notification when the request for notification of the switch status from the host device has been stopped for a predetermined time, or from when the power of the scanner device is turned on until the host device issues a request for notification of the switch status. 2. The switch control method according to claim 1, wherein the state in which the switch is not pressed is set in (7).
【請求項4】 ホスト装置からスイッチ状態の通知の要
求が発生する間隔時間を測定し、スイッチ状態の通知の
要求が測定した時間を基にした所定時間を超えて絶えた
場合、通知用スイッチ情報部(7)をスイッチが押下さ
れていない状態に設定する請求項3記載のスイッチ制御
方法。
4. A switching time for a switch status notification request from a host device is measured, and when the request for a switch status notification is cut off for more than a predetermined time based on the measured time, notification switch information. 4. The switch control method according to claim 3, wherein the switch is set to a state where the switch is not pressed.
【請求項5】 スイッチが設けられたスキャナ装置で、
かつスイッチの状態をホスト装置から監視できるスキャ
ナ装置におけるスイッチ制御装置において、スイッチが
押下されていない状態と押下されている状態の2つの状
態を記憶する入力用スイッチ情報部(6)と通知用スイ
ッチ情報部(7)と、 入力用スイッチ情報部(6)が押下されてない状態のと
きは、スイッチが押下されたかを監視し、所定時間以上
連続して押下されていることを確認した場合に、通知用
スイッチ情報部(7)と入力用スイッチ情報部(6)に
スイッチが押下されている状態を設定し、 入力用スイッチ情報部(6)が押下されている状態のと
きは、スイッチが押下されていない状態を監視し、所定
時間以上連続して押下されていない状態を確認した場合
に、入力用スイッチ情報部(6)にスイッチが押下され
ていない状態を設定し、 ホスト装置からスイッチ状態の通知を要求された場合
は、通知用スイッチ情報部(7)に設定された内容を通
知し、通知後に通知用スイッチ情報部(7)にスイッチ
が押下されていない状態を設定するスイッチ状態設定手
段(4)とで構成されることを特徴とするスイッチ制御
装置。
5. A scanner device provided with a switch,
And a switch control unit in the scanner device capable of monitoring the state of the switch from the host device, wherein an input switch information unit (6) for storing two states of a state where the switch is not pressed and a state where the switch is pressed, and a notification switch. When the information section (7) and the input switch information section (6) are not pressed, it is monitored whether the switch is pressed, and when it is confirmed that the switch is continuously pressed for a predetermined time or more, The state where the switch is pressed is set in the notification switch information section (7) and the input switch information section (6), and when the input switch information section (6) is in the pressed state, the switch is set. A state where the switch is not pressed is monitored, and when a state where the switch is not pressed continuously for a predetermined time or more is confirmed, the switch is not pressed in the input switch information section (6). When the status is set and a notification of the switch status is requested from the host device, the content set in the notification switch information unit (7) is notified, and after the notification, the switch is pressed in the notification switch information unit (7). A switch state setting means (4) for setting a state not set.
【請求項6】 入力用スイッチ情報部(6)が押下され
てない状態のとき、スイッチが連続して押下されたかを
確認する所定の時間を短くし、 入力用スイッチ情報部(6)が押下されている状態のと
き、スイッチが連続して押下されていないことを確認す
る所定の時間を長くするスイッチ状態設定手段(4)が
設けられたことを特徴とする請求項5記載のスイッチ制
御装置。
6. When the input switch information section (6) is not depressed, a predetermined time for checking whether or not the switches are continuously depressed is shortened, and the input switch information section (6) is depressed. 6. The switch control device according to claim 5, further comprising: a switch state setting means for extending a predetermined time for confirming that the switch is not continuously pressed when the switch is set. .
【請求項7】 ホスト装置からスイッチ状態の通知の要
求が所定時間絶えた場合、またはスキャナ装置の電源投
入からホスト装置がスイッチ状態の通知の要求を発生す
るまでの間は、通知用スイッチ情報部(7)にスイッチ
が押下されていない状態を設定するスイッチ状態設定手
段(4)が設けられたことを特徴とする請求項5記載の
スイッチ制御装置。
7. A switch information unit for notification when a request for notification of a switch status from the host device has been stopped for a predetermined period of time, or during a period from when the power of the scanner device is turned on until the host device issues a request for notification of the switch status. 6. The switch control device according to claim 5, wherein a switch state setting means for setting a state in which the switch is not pressed is provided in (7).
【請求項8】 ホスト装置からスイッチ状態の通知の要
求が発生する間隔時間を測定し、スイッチ状態の通知の
要求が測定した時間を基にした所定時間を超えて絶えた
場合、通知用スイッチ情報部(7)をスイッチが押下さ
れていない状態に設定するスイッチ状態設定手段(4)
が設けられたことを特徴とする請求項7記載のスイッチ
制御装置。
8. A switch unit for notifying a switch status when a request for notification of a switch status is measured from a host apparatus and the request for notification of the switch status is cut off for a predetermined time based on the measured time. Switch state setting means (4) for setting the section (7) to a state where the switch is not pressed
The switch control device according to claim 7, wherein a switch is provided.
JP9275629A 1997-10-08 1997-10-08 Device and method for controlling switch in scanner device Pending JPH11112721A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9275629A JPH11112721A (en) 1997-10-08 1997-10-08 Device and method for controlling switch in scanner device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9275629A JPH11112721A (en) 1997-10-08 1997-10-08 Device and method for controlling switch in scanner device

Publications (1)

Publication Number Publication Date
JPH11112721A true JPH11112721A (en) 1999-04-23

Family

ID=17558128

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9275629A Pending JPH11112721A (en) 1997-10-08 1997-10-08 Device and method for controlling switch in scanner device

Country Status (1)

Country Link
JP (1) JPH11112721A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014144602A (en) * 2013-01-30 2014-08-14 Brother Ind Ltd Image processing device
JP2017192438A (en) * 2016-04-18 2017-10-26 シャープ株式会社 Vacuum cleaner

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014144602A (en) * 2013-01-30 2014-08-14 Brother Ind Ltd Image processing device
US9704077B2 (en) 2013-01-30 2017-07-11 Brother Kogyo Kabushiki Kaisha Image processing device having voltage generating unit outputting control voltage
JP2017192438A (en) * 2016-04-18 2017-10-26 シャープ株式会社 Vacuum cleaner

Similar Documents

Publication Publication Date Title
JP2004227586A (en) Method for initiating power supply to computer system from usb keyboard
JPH11112721A (en) Device and method for controlling switch in scanner device
US7251726B2 (en) Multiple functionality associated with a computer ON/OFF pushbutton switch
JP3088395B2 (en) Switch interrupt processing circuit and switch interrupt processing method
JP3981059B2 (en) Image processing apparatus, control method thereof, and control program thereof
JP2001030579A (en) Printer, control method therefor and data recording medium
KR100281541B1 (en) Computer system with switch for both power and reset
JPWO2023152786A5 (en)
JPH0137766B2 (en)
JPH0968897A (en) Copying machine
JPH0411355A (en) Floppy disk device
JPH06242970A (en) Real-time multitask system
JP3219438B2 (en) I / O control unit status storage method
JPH0675653A (en) Computer redundancy control system
KR100509456B1 (en) Automatic power-recovery method for printer
JP2003330501A (en) Program controller
JPH0519881A (en) Electronic equipment
JPH0356501B2 (en)
CN114030456A (en) Abnormity determining method, device, equipment and medium for parking system
JP3308311B2 (en) Telephone device selection signal transmission circuit and telephone device including the same
JPH09222938A (en) Power source controller
JPH0718329U (en) Operation switch device
JPH03252713A (en) Power source control method for system console
JPH05257829A (en) State detection system for input/output device
JPH06295346A (en) Microcomuputer