JP3482285B2 - Photoelectric switch - Google Patents

Photoelectric switch

Info

Publication number
JP3482285B2
JP3482285B2 JP27406995A JP27406995A JP3482285B2 JP 3482285 B2 JP3482285 B2 JP 3482285B2 JP 27406995 A JP27406995 A JP 27406995A JP 27406995 A JP27406995 A JP 27406995A JP 3482285 B2 JP3482285 B2 JP 3482285B2
Authority
JP
Japan
Prior art keywords
sensitivity
setting
setting data
light
photoelectric switch
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
JP27406995A
Other languages
Japanese (ja)
Other versions
JPH09116411A (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.)
Keyence Corp
Original Assignee
Keyence Corp
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 Keyence Corp filed Critical Keyence Corp
Priority to JP27406995A priority Critical patent/JP3482285B2/en
Publication of JPH09116411A publication Critical patent/JPH09116411A/en
Application granted granted Critical
Publication of JP3482285B2 publication Critical patent/JP3482285B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Electronic Switches (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は感度設定機能を有す
る光電スイッチに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a photoelectric switch having a sensitivity setting function.

【0002】[0002]

【従来の技術】従来より、検知領域に光を投射しその反
射光または透過光を検出することにより物体の有無を判
定する光電スイッチが用いられている。反射型の光電ス
イッチでは、被検出物体が検知領域に存在する場合に、
投光部から投射された光が物体により反射され、その反
射光が受光部に入光する。この場合、受光部での受光量
のレベルが所定の動作レベルを越えたときに被検出物体
が存在すると判定される。一方、透過型の光電スイッチ
では、被検出物体が検知領域に存在しない場合に、投光
部から投射された光が受光部に入光する。この場合、受
光部での受光量のレベルが所定の動作レベルを越えたと
きに被検出物体が存在しないと判定される。光電スイッ
チは、例えば工場の搬送ライン等で用いられる。
2. Description of the Related Art Conventionally, there has been used a photoelectric switch that determines the presence or absence of an object by projecting light on a detection area and detecting reflected light or transmitted light thereof. In the reflective photoelectric switch, when the detected object is in the detection area,
The light projected from the light projecting unit is reflected by the object, and the reflected light enters the light receiving unit. In this case, it is determined that the detected object exists when the level of the amount of light received by the light receiving unit exceeds a predetermined operation level. On the other hand, in the transmissive photoelectric switch, when the object to be detected does not exist in the detection area, the light projected from the light projecting unit enters the light receiving unit. In this case, it is determined that there is no detected object when the level of the amount of light received by the light receiving unit exceeds a predetermined operation level. The photoelectric switch is used, for example, in a transportation line of a factory.

【0003】このような光電スイッチでは、経時的な光
量の低下や周囲の環境の変化を考慮して、始業時ごとま
たはラインの稼働中に検出感度(以下、単に感度と呼
ぶ)を再設定する必要が生じる。また、埃、粉、油等が
舞う悪環境下で、またはライン稼働中に感度を頻繁に再
設定する必要が生じることもある。光電スイッチの感度
は動作レベルを変化させることにより調整される。
In such a photoelectric switch, the detection sensitivity (hereinafter, simply referred to as "sensitivity") is reset every start of work or during operation of the line in consideration of a decrease in light amount with time and a change in surrounding environment. The need arises. In addition, it may be necessary to frequently reset the sensitivity under a bad environment in which dust, powder, oil, etc. fly, or during line operation. The sensitivity of the photoelectric switch is adjusted by changing the operation level.

【0004】[0004]

【発明が解決しようとする課題】従来、光電スイッチの
感度を設定するための方式としてボリューム方式および
自動設定方式が知られている。
Conventionally, a volume method and an automatic setting method are known as methods for setting the sensitivity of a photoelectric switch.

【0005】従来のボリューム方式は、可変抵抗器を操
作することにより直接動作レベルを変化させるものであ
る。感度設定時には、作業者が手動で可変抵抗器を操作
して動作レベルを変化させながら、判別したい2つの状
態でそれぞれ受光状態を確認する作業を行う。そのた
め、ライン稼働中に感度を調整すると、検出漏れが生ず
ることがある。したがって、実稼働中のラインに影響を
与えることなく光電スイッチを最適な感度に設定するこ
とは困難である。また、可変抵抗器の構造による特性
上、感度設定中に検出結果を示す検出信号がチャタリン
グを起こすおそれもある。ただし、動作レベルは可変抵
抗器の抵抗値により決まるので、感度設定中でも応答速
度は低下しない。
The conventional volume method directly changes the operation level by operating a variable resistor. At the time of setting the sensitivity, the operator manually operates the variable resistor to change the operation level, and confirms the light receiving state in each of the two states to be determined. Therefore, if the sensitivity is adjusted during the line operation, detection omission may occur. Therefore, it is difficult to set the photoelectric switch to the optimum sensitivity without affecting the line in actual operation. Further, due to the characteristics of the structure of the variable resistor, the detection signal indicating the detection result may chatter during sensitivity setting. However, since the operation level is determined by the resistance value of the variable resistor, the response speed does not decrease even when the sensitivity is set.

【0006】一方、自動設定方式は、外部からの制御入
力により受光量をサンプリングし、マイクロコンピュー
タ等に演算させることにより得られたデータ群に基づい
て動作レベルを設定するものである。従来の自動感度設
定方式では、割り込み処理により光電スイッチの動作中
に自動的に動作レベルが設定される。図7は従来の自動
設定方式による感度設定処理を示すフローチャートであ
る。
On the other hand, the automatic setting method sets the operation level based on a data group obtained by sampling the amount of received light by a control input from the outside and calculating it by a microcomputer or the like. In the conventional automatic sensitivity setting method, the operation level is automatically set during the operation of the photoelectric switch by interrupt processing. FIG. 7 is a flowchart showing a sensitivity setting process according to the conventional automatic setting method.

【0007】主処理では、投光部により投光動作を行な
い(ステップS41)、受光部から出力される受光信号
をアナログ/デジタル変換(A/D変換)することによ
り(ステップS42)、受光量を受光データとして取り
込む(ステップS43)。
In the main processing, the light projecting operation is performed by the light projecting section (step S41), and the light receiving signal output from the light receiving section is subjected to analog / digital conversion (A / D conversion) (step S42). Is received as light reception data (step S43).

【0008】その後、感度設定の割り込みがあるか否か
を判別し(ステップS44)、感度設定の割り込みがあ
る場合には、割り込み処理で感度設定の演算処理を行う
(ステップS51)。そして、設定データ更新要求の割
り込みがあるか否かを判別し(ステップS45),設定
データ更新要求の割り込みがある場合には、割り込み処
理で設定データを更新する(ステップS52)。ここ
で、設定データとは、動作レベルの算出に用いるデータ
である。
Thereafter, it is determined whether or not there is a sensitivity setting interrupt (step S44), and if there is a sensitivity setting interrupt, a sensitivity setting calculation process is performed by interrupt processing (step S51). Then, it is determined whether or not there is a setting data update request interrupt (step S45), and if there is a setting data update request interrupt, the setting data is updated by an interrupt process (step S52). Here, the setting data is data used for calculating the behavior level.

【0009】その後、EEPROM(電気的に消去およ
び書き込み可能なリードオンリメモリ)への新たな設定
データの書き込み要求の割り込みがあるか否かを判別し
(ステップS46)、書き込み要求の割り込みがある場
合には、割り込み処理でEEPROMに新たな設定デー
タを書き込む(ステップS53)。
After that, it is determined whether or not there is an interrupt request for writing new setting data to the EEPROM (electrically erasable and writable read-only memory) (step S46). In step S53, new setting data is written in the EEPROM by interruption processing.

【0010】その後、設定データに基づいて動作レベル
を生成する(ステップS47)。そして、受光データと
動作レベルとを比較し(ステップS48)、比較結果に
基づいて入光および非入光の判定処理を行う(ステップ
S49)。その後、判定結果に基づいて検出信号の出力
動作を行ない(ステップS50)、ステップS41に戻
り、ステップS41〜S50の処理を繰り返す。
Then, an operation level is generated based on the setting data (step S47). Then, the received light data is compared with the operation level (step S48), and the light entering and non-light entering determination processing is performed based on the comparison result (step S49). Then, the detection signal output operation is performed based on the determination result (step S50), the process returns to step S41, and the processes of steps S41 to S50 are repeated.

【0011】このように、従来の自動設定方式の光電ス
イッチでは、主処理の実行中に割り込み処理により感度
が設定されるため、感度設定中は、割り込み処理のため
に応答速度が著しく低下し、あるいは出力動作を休止す
る必要が生じる。
As described above, in the conventional automatic setting type photoelectric switch, the sensitivity is set by the interrupt process during the execution of the main process. Therefore, during the sensitivity setting, the response speed is remarkably lowered due to the interrupt process. Alternatively, it becomes necessary to suspend the output operation.

【0012】図8は感度設定中に応答速度が低下する場
合を示す図であり、図9は感度設定中に出力動作が休止
する場合を示す図である。図8および図9において、感
度設定期間TSとは、感度設定指令の入力期間、動作レ
ベルの切換え期間およびEEPROMへの書き込み期間
を含む。
FIG. 8 is a diagram showing a case where the response speed is lowered during sensitivity setting, and FIG. 9 is a diagram showing a case where the output operation is stopped during sensitivity setting. 8 and 9, the sensitivity setting period TS includes a sensitivity setting command input period, an operation level switching period, and an EEPROM writing period.

【0013】図8に示すように、感度設定期間TSに光
電スイッチの応答速度が遅くなると、P1で示すよう
に、被検出物体の検出時間が短い場合に検出信号に検出
結果が反映されず、検出漏れが発生する。また、図9に
示すように、感度設定期間TSに検出信号を強制的にオ
フ状態あるいは保持状態にして出力動作を休止させる光
電スイッチの場合にも、検出漏れが発生する。そのた
め、従来の自動設定方式の光電スイッチにおいて感度を
再設定する場合には、検出漏れが避けられないので、一
旦ラインや装置の通常の稼働を中断させなければなら
ず、生産性の低下を招いていた。
As shown in FIG. 8, when the response speed of the photoelectric switch becomes slow during the sensitivity setting period TS, as shown by P1, the detection result is not reflected in the detection signal when the detection time of the detected object is short, Detection failure occurs. In addition, as shown in FIG. 9, detection omission also occurs in the case of a photoelectric switch in which the detection signal is forcibly turned off or held in the sensitivity setting period TS to suspend the output operation. Therefore, in the case of resetting the sensitivity in the conventional automatic setting type photoelectric switch, the omission of detection cannot be avoided, so that the normal operation of the line or the device must be temporarily interrupted, which causes a decrease in productivity. Was there.

【0014】本発明の目的は、検出動作および出力動作
を行ないつつ、検出漏れおよび応答速度の低下を生じる
ことなく容易に感度を設定することができる光電スイッ
チを提供することである。
It is an object of the present invention to provide a photoelectric switch capable of easily setting sensitivity while performing detection operation and output operation, without causing detection omission and reduction in response speed.

【0015】[0015]

【課題を解決するための手段および発明の効果】第1の
発明に係る光電スイッチは、光を投射しその透過光また
は反射光を受光することにより物体の有無を検出する光
電スイッチであって、検出動作、検出結果の出力動作お
よび感度更新許可タイミングを含む主処理を周期的に繰
り返し実行する主制御手段と、外部からの感度設定指令
に基づいて設定データを生成し、主処理における感度更
新許可タイミングで設定データに基づく感度更新を行な
う感度設定制御手段とを備えたものである
Means for Solving the Problems and Effects of the Invention The photoelectric switch according to the first invention projects light and transmits it.
Is light that detects the presence or absence of an object by receiving reflected light
It is a power switch that detects and outputs the detection result.
And the main process including sensitivity update permission timing is repeated periodically.
Main control means to execute return and sensitivity setting command from outside
The setting data is generated based on the
The sensitivity is updated based on the setting data at the new permission timing.
It has a sensitivity setting control means.

【0016】 第の発明に係る光電スイッチは、第1
の発明に係る光電スイッチの構成において、感度設定制
御手段は、設定データに基づく感度更新を主処理と並列
的に実行するものである。
A photoelectric switch according to a second invention is the photoelectric switch according to the first invention.
In the configuration of the photoelectric switch according to the invention,
The means is to update the sensitivity based on the setting data in parallel with the main processing.
Is to be carried out in a targeted manner.

【0017】 第の発明に係る光電スイッチは、第1
または第2の発明に係る光電スイッチの構成において、
設定データを記憶するための不揮発性記憶手段と、不揮
発性記憶手段への設定データの書き込みを制御する書き
込み制御手段とをさらに備え、感度設定制御手段が、設
定データに基づく感度更新と並行して不揮発性記憶手段
への設定データの書き込み要求を行い、書き込み制御手
段が、書き込み要求に応答して感度設定制御手段により
得られた設定データを不揮発性記憶手段に書き込むもの
である。
A photoelectric switch according to a third invention is the photoelectric switch according to the first invention.
Alternatively, in the configuration of the photoelectric switch according to the second invention,
Non-volatile storage means for storing the setting data,
Writing to control writing of setting data to the memory
And a sensitivity setting control means.
Non-volatile storage means in parallel with sensitivity update based on constant data
To write the setting data to the
In response to the write request, the stage is set by the sensitivity setting control means.
Writing the obtained setting data to the non-volatile storage means
Is.

【0018】 第1、第2および第3の発明に係る光電
スイッチにおいては、主制御手段による主処理と並列的
に感度設定制御手段による設定データの生成が行われ、
主処理における感度更新許可タイミングで設定データに
基づく感度更新が行われる。そのため、設定データの生
成による主処理の速度低下が生じない。また、感度更新
許可タイミングが検出動作および検出結果の出力動作に
同期し、かつ互いに競合しないので、感度更新中に検出
漏れが生じず、かつ応答速度の低下も生じない。
The photoelectric devices according to the first, second and third inventions
In the switch, parallel to the main processing by the main control means
The setting data is generated by the sensitivity setting control means.
In the setting data at the sensitivity update permission timing in the main processing
Based on the sensitivity update. Therefore, the raw setting data
There is no reduction in the speed of main processing due to the growth. Also updated sensitivity
The permission timing depends on the detection operation and the detection result output operation.
Detected during sensitivity update as they are synchronized and do not conflict with each other
Leakage does not occur and the response speed does not decrease.

【0019】 したがって、検出動作および出力動作を
行ないつつ検出漏れおよび応答速度の低下を生じること
なく容易に感度を設定することができる。
Therefore, the detection operation and the output operation are
It may cause detection omission and decrease in response speed while performing
The sensitivity can be easily set without the need.

【0020】 特に、第2の発明に係る光電スイッチに
おいては、外部からの感度設定指令に基づく感度設定処
理が主処理と並列的に実行されるので、感度設定処理に
よる主処理の速度低下が生じない。したがって、検出動
作および出力動作を行ないつつ応答速度の低下を招くこ
となく容易に感度を設定することができる。
Particularly, in the photoelectric switch according to the second invention,
The sensitivity setting process based on the sensitivity setting command from the outside.
Since the processing is executed in parallel with the main processing, the sensitivity setting processing
The main processing speed does not decrease. Therefore, the detection motion
Operation and output operations are performed while the response speed is reduced.
Sensitivity can be easily set.

【0021】 また、第3の発明に係る光電スイッチに
おいては、設定データに基づく感度更新と並行して書き
込み制御手段により不揮発性記憶手段への設定データの
書き込みが行われる。したがって、不揮発性記憶手段へ
の設定データの書き込み処理により感度設定制御手段に
よる感度更新処理の速度が低下しない。
In addition, in the photoelectric switch according to the third invention,
In addition, write in parallel with sensitivity update based on setting data.
Of the setting data to the non-volatile storage means by the
Writing is done. Therefore, to the non-volatile storage means
Sensitivity setting control means by writing setting data of
Therefore, the speed of the sensitivity update process does not decrease.

【0022】[0022]

【発明の実施の形態】図1は本発明の一実施例における
光電スイッチの構成を示すブロック図である。
1 is a block diagram showing the structure of a photoelectric switch according to an embodiment of the present invention.

【0023】図1において、主制御手段1は、光電スイ
ッチ内の各部を制御する。投光回路2は、検知領域に光
を投射する。反射型の光電スイッチの場合には、検知領
域に被検出物体が存在するときに、被検出物体からの反
射光が受光・増幅回路3で受光される。一方、透過型の
光電スイッチの場合には、検知領域に被検出物体が存在
しないときに、投光回路2から投射された光が受光・増
幅回路3で受光される。
In FIG. 1, the main control means 1 controls each part in the photoelectric switch. The light projecting circuit 2 projects light onto the detection area. In the case of the reflection type photoelectric switch, when the object to be detected is present in the detection area, the reflected light from the object to be detected is received by the light receiving / amplifying circuit 3. On the other hand, in the case of the transmissive photoelectric switch, the light projected from the light projecting circuit 2 is received by the light receiving / amplifying circuit 3 when there is no detected object in the detection region.

【0024】受光・増幅回路3は受光した光をアナログ
の受光信号に変換および増幅して出力する。A/D変換
器(アナログ/デジタル変換器)4は、受光・増幅回路
3から出力された受光信号をアナログ・デジタル変換し
て受光データVinとして出力する。受光データ記憶手
段5は、A/D変換器4から出力された受光データVi
nを記憶する。
The light receiving / amplifying circuit 3 converts the received light into an analog light receiving signal, amplifies it, and outputs it. The A / D converter (analog / digital converter) 4 analog-digital converts the light reception signal output from the light reception / amplification circuit 3 and outputs the light reception data Vin. The received light data storage means 5 receives the received light data Vi output from the A / D converter 4.
Remember n.

【0025】ピークホールド手段6は、受光データ記憶
手段5に記憶された受光データVinのピーク値(極大
値および極小値)を検出するとともに、検出したピーク
値を用いて所定の演算を行う。ピーク値記憶手段7は、
ピークホールド手段6により検出されたピーク値および
演算結果を記憶する。設定データ演算手段8は、ピーク
値記憶手段7に記憶された演算結果に基づいて設定デー
タを算出する。ここで、設定データとは、動作レベルの
算出に用いられるデータである。設定データ記憶手段9
は、設定データ演算手段8により得られた設定データを
記憶する。
The peak hold means 6 detects the peak value (maximum value and minimum value) of the received light data Vin stored in the received light data storage means 5 and performs a predetermined calculation using the detected peak value. The peak value storage means 7 is
The peak value detected by the peak hold means 6 and the calculation result are stored. The setting data calculation means 8 calculates setting data based on the calculation result stored in the peak value storage means 7. Here, the setting data is data used for calculating the behavior level. Setting data storage means 9
Stores the setting data obtained by the setting data calculating means 8.

【0026】動作レベル演算手段10は、設定データ記
憶手段9に記憶された設定データに基づいて動作レベル
OPを算出する。なお、動作レベルOPは、検出信号が
オフ状態からオン状態に変化するときのオンレベルおよ
び検出信号がオン状態からオフ状態に変化するときのオ
フレベルからなる。
The operation level calculation means 10 calculates the operation level OP based on the setting data stored in the setting data storage means 9. The operation level OP includes an on level when the detection signal changes from the off state to the on state and an off level when the detection signal changes from the on state to the off state.

【0027】比較器11は、受光データ記憶手段5に記
憶された受光データVinを動作レベル演算手段10に
より得られた動作レベルOPと比較する。入光判定手段
12は、比較器11の比較結果に基づいて入光の有無を
判定する。出力制御手段13は、入光判定手段12の判
定結果を検出信号DETとして出力装置14を介して外
部に出力する。
The comparator 11 compares the received light data Vin stored in the received light data storage means 5 with the operation level OP obtained by the operation level calculation means 10. The light incident determination means 12 determines the presence or absence of light incident based on the comparison result of the comparator 11. The output control unit 13 outputs the determination result of the light incident determination unit 12 as a detection signal DET to the outside via the output device 14.

【0028】感度設定制御手段15は、設定データを更
新するための感度設定処理を行う。EEPROM制御手
段16は、感度設定処理により得られた設定データをE
EPROM(電気的に消去および書き込み可能なリード
オンリメモリ)17に書き込むためのEEPROM制御
処理を行う。
The sensitivity setting control means 15 performs sensitivity setting processing for updating the setting data. The EEPROM control means 16 sets the setting data obtained by the sensitivity setting processing to E
An EEPROM control process for writing to an EPROM (electrically erasable and writable read-only memory) 17 is performed.

【0029】動作モード切換入力手段18は、動作モー
ドを切り換えるための動作モード切換信号OSを出力制
御手段13に入力する。動作モードとは、例えば入光オ
ンモードおよび遮光オンモードである。入光オンモード
では、検出信号DETが入光時にオンし、遮光時にオフ
する。遮光オンモードでは、検出信号DETが遮光時に
オンし、入光時にオフする。
The operation mode switching input means 18 inputs an operation mode switching signal OS for switching the operation mode to the output control means 13. The operation modes are, for example, a light-on mode and a light-shielding on mode. In the light-on mode, the detection signal DET turns on when light enters and turns off when light is blocked. In the light-shielding on mode, the detection signal DET is turned on when light is shielded and is turned off when light is incident.

【0030】設定制御入力手段19は、感度設定を指令
するための設定制御信号CTを感度設定制御手段15に
入力する。この設定制御信号CTは、作業者が操作ボタ
ンを操作することにより入力されるか、あるいはシーケ
ンサ等の外部機器から与えられる。例えば、設定制御信
号CTが入力されている間、感度設定処理が行われても
よく、あるいは感度設定開始を示す設定制御信号CTの
入力により感度設定が開始され、感度設定終了を示す設
定制御信号CTの入力により感度設定が終了してもよ
い。
The setting control input means 19 inputs a setting control signal CT for instructing the sensitivity setting to the sensitivity setting control means 15. The setting control signal CT is input by an operator operating an operation button or is given from an external device such as a sequencer. For example, the sensitivity setting process may be performed while the setting control signal CT is being input, or the sensitivity setting is started by the input of the setting control signal CT indicating the start of the sensitivity setting and the setting control signal indicating the end of the sensitivity setting. The sensitivity setting may be completed by inputting CT.

【0031】本実施例では、EEPROM17が不揮発
性記憶手段を構成し、EEPROM制御手段が書き込み
制御手段を構成する。次に図2〜図4を参照しながら図
1の光電スイッチの動作を説明する。
In this embodiment, the EEPROM 17 constitutes a non-volatile storage means, and the EEPROM control means constitutes a write control means. Next, the operation of the photoelectric switch shown in FIG. 1 will be described with reference to FIGS.

【0032】図2は主制御手段1による主処理を示すフ
ローチャートである。まず、投光回路2が投光動作を行
う(ステップS1)。そして、受光・増幅回路3から出
力される受光信号をA/D変換器4がアナログ・デジタ
ル変換し(ステップS2)、受光量を受光データVin
として受光データ記憶手段5に取り込む(ステップS
3)。
FIG. 2 is a flow chart showing the main processing by the main control means 1. First, the light projecting circuit 2 performs a light projecting operation (step S1). Then, the light reception signal output from the light reception / amplification circuit 3 is analog-digital converted by the A / D converter 4 (step S2), and the light reception amount is received light data Vin
Is taken into the received light data storage means 5 (step S
3).

【0033】次に、比較器11が受光データVinと動
作レベルOPとの比較を行う(ステップS4)。そし
て、比較器11による比較結果に基づいて入光判定手段
12が入光および非入光の判定処理を行う(ステップS
5)。その後、入光判定手段12の判定結果に基づいて
出力制御手段13が検出信号DETの出力動作を行う
(ステップS6)。
Next, the comparator 11 compares the received light data Vin with the operation level OP (step S4). Then, based on the comparison result by the comparator 11, the light incident determination means 12 performs the light incident and non-light incident determination processing (step S
5). After that, the output control unit 13 outputs the detection signal DET based on the determination result of the light incident determination unit 12 (step S6).

【0034】その後、主制御手段1は、設定データ記憶
手段9に設定データ更新要求の受付を許可する(ステッ
プS7)。設定データ記憶手段9に記憶される設定デー
タの更新後、動作レベル演算手段10が、更新された設
定データに基づいて動作レベルOPを生成し(ステップ
S8)、ステップS1に戻る。
After that, the main control means 1 permits the setting data storage means 9 to accept the setting data update request (step S7). After updating the setting data stored in the setting data storage means 9, the operation level calculating means 10 generates the operation level OP based on the updated setting data (step S8), and returns to step S1.

【0035】図3は感度設定制御手段15による感度設
定処理を示すフローチャートである。まず、設定制御入
力手段19により入力される設定制御信号CTに基づい
て感度設定を開始するか否かを判別する(ステップS1
1)。例えば、設定制御信号CTが入力されると感度設
定を開始する。
FIG. 3 is a flow chart showing the sensitivity setting processing by the sensitivity setting control means 15. First, it is determined whether or not the sensitivity setting is started based on the setting control signal CT input by the setting control input means 19 (step S1).
1). For example, when the setting control signal CT is input, sensitivity setting is started.

【0036】感度設定を開始する場合には、受光データ
記憶手段5内の受光データVinが確定しているか否か
を判別する(ステップS12)。受光データVinが確
定している場合には、ピークホールド手段6が受光デー
タVinに基づく所定の演算処理を行ない(ステップS
13)、ピーク値記憶手段7に記憶された演算結果を更
新する(ステップS14)。
When the sensitivity setting is started, it is determined whether or not the received light data Vin in the received light data storage means 5 is fixed (step S12). If the received light data Vin is confirmed, the peak hold means 6 performs a predetermined calculation process based on the received light data Vin (step S).
13), the calculation result stored in the peak value storage means 7 is updated (step S14).

【0037】その後、設定制御入力手段19により入力
される設定制御信号CTに基づいて感度設定を終了する
か否かを判別する(ステップS15)。例えば、設定制
御信号CTの入力が終了すると感度設定を終了する。感
度設定を終了しない場合には、ステップS12に戻り、
ステップS12〜S14の処理を繰り返す。感度設定処
理を終了する場合には、設定データ演算手段8がピーク
値記憶手段7に記憶された演算結果に基づいて設定デー
タを生成する(ステップS16)。
After that, it is determined whether or not the sensitivity setting is completed based on the setting control signal CT input by the setting control input means 19 (step S15). For example, the sensitivity setting ends when the input of the setting control signal CT ends. If the sensitivity setting is not completed, the process returns to step S12,
The processing of steps S12 to S14 is repeated. When ending the sensitivity setting process, the setting data calculation means 8 generates setting data based on the calculation result stored in the peak value storage means 7 (step S16).

【0038】その後、感度設定制御手段15は、設定デ
ータ記憶手段9に設定データ更新要求を行う(ステップ
S17)。そして、設定データ記憶手段9は、主制御手
段1により設定データ更新要求の受付が許可されている
か否かを判別する(ステップS18)。設定データ更新
要求の受付が許可されていない場合には、ステップS1
7に戻る。設定データ更新要求の受付が許可されている
場合には、設定データ記憶手段9は設定データを更新す
る(ステップS19)。同時に、感度設定制御手段15
は、EEPROM制御手段16に新たな設定データVt
hの書き込み要求を行う(ステップS20)。
After that, the sensitivity setting control means 15 makes a setting data update request to the setting data storage means 9 (step S17). Then, the setting data storage unit 9 determines whether or not acceptance of the setting data update request is permitted by the main control unit 1 (step S18). If the acceptance of the setting data update request is not permitted, step S1
Return to 7. When the acceptance of the setting data update request is permitted, the setting data storage unit 9 updates the setting data (step S19). At the same time, the sensitivity setting control means 15
Is the new setting data Vt for the EEPROM control means 16.
A write request for h is made (step S20).

【0039】感度設定制御手段15は、EEPROM制
御手段16により設定される書き込み終了フラグの状態
に基づいて、EEPROM17への新たな設定データの
書き込みが終了したか否かを判別する(ステップS2
1)。EEPROM17への新たな設定データの書き込
みが終了していない場合には待機し、EEPROM17
への新たな設定データの書き込みが終了するとステップ
S11に戻る。
The sensitivity setting control means 15 determines whether or not the writing of new setting data to the EEPROM 17 has been completed, based on the state of the write end flag set by the EEPROM control means 16 (step S2).
1). If the writing of new setting data to the EEPROM 17 has not been completed, the operation waits and the EEPROM 17
When the writing of the new setting data to is completed, the process returns to step S11.

【0040】図4はEEPROM制御手段16によるE
EPROM制御処理を示すフローチャートである。ま
ず、書き込み終了フラグをセットする(ステップS3
1)。その後、EEPROM17への新たな設定データ
の書き込み要求があるか否かを判別する(ステップS3
2)。書き込み要求がない場合にはステップS31に戻
る。書き込み要求がある場合には、書き込み終了フラグ
をリセットした後(ステップS33)、EEPROM1
7への新たな設定データの書き込み処理を行う(ステッ
プS34)。その後、ステップS31に戻る。
FIG. 4 shows E by the EEPROM control means 16.
It is a flowchart which shows EPROM control processing. First, the write end flag is set (step S3).
1). Then, it is determined whether or not there is a request to write new setting data to the EEPROM 17 (step S3).
2). If there is no write request, the process returns to step S31. If there is a write request, after resetting the write end flag (step S33), the EEPROM 1
A process for writing new setting data to 7 is performed (step S34). Then, it returns to step S31.

【0041】以上のように、主制御手段1による主処
理、感度設定制御手段15による感度設定処理、および
EEPROM制御手段16によるEEPROM制御処理
が並列的に実行される。動作順位は、主制御手段1、感
度設定制御手段15およびEEPROM制御手段16の
順に低くなる。
As described above, the main processing by the main control means 1, the sensitivity setting processing by the sensitivity setting control means 15, and the EEPROM control processing by the EEPROM control means 16 are executed in parallel. The order of operation becomes lower in the order of the main control means 1, the sensitivity setting control means 15 and the EEPROM control means 16.

【0042】図5は本実施例の感度設定処理の一例を示
す信号波形図である。図5において、OL1は感度設定
前の動作レベルを示し、OL2は感度設定後の動作レベ
ルを示す。
FIG. 5 is a signal waveform diagram showing an example of the sensitivity setting process of this embodiment. In FIG. 5, OL1 shows an operation level before sensitivity setting, and OL2 shows an operation level after sensitivity setting.

【0043】期間T1において受光データVinのレベ
ルが徐々に低下すると、検出動作の安定度が低くなる。
そこで、感度設定期間TSにおいて感度設定処理を行
う。時刻t1で感度設定処理が完了すると、期間T2に
おいて動作レベルOL1が動作レベルOL2に更新され
る。それにより、検出動作の安定度が高くなる。
When the level of the received light data Vin gradually decreases in the period T1, the stability of the detecting operation becomes low.
Therefore, the sensitivity setting process is performed in the sensitivity setting period TS. When the sensitivity setting process is completed at time t1, the operation level OL1 is updated to the operation level OL2 in the period T2. As a result, the stability of the detection operation becomes high.

【0044】図2および図3に示したように、感度設定
制御手段15による感度設定処理は主制御手段1による
主処理と並列的に行われるので、感度設定期間TSにお
いても検出動作および検出信号DETの出力動作の速度
が低下しない。
As shown in FIGS. 2 and 3, since the sensitivity setting processing by the sensitivity setting control means 15 is performed in parallel with the main processing by the main control means 1, the detection operation and the detection signal during the sensitivity setting period TS. The speed of DET output operation does not decrease.

【0045】図6は検出信号の切替えタイミングおよび
動作レベルの切替えタイミングを示す図である。図6に
示すように、検出信号の切替えタイミングおよび動作レ
ベルの切替えタイミングは、投光回路2における投光パ
ルスの発生タイミングに同期しており、互いに競合しな
い。したがって、感度設定中に検出漏れが生じず、応答
速度の低下も生じない。
FIG. 6 is a diagram showing the switching timing of the detection signal and the switching timing of the operation level. As shown in FIG. 6, the switching timing of the detection signal and the switching timing of the operation level are synchronized with the generation timing of the light projecting pulse in the light projecting circuit 2 and do not conflict with each other. Therefore, no detection omission occurs during sensitivity setting, and the response speed does not decrease.

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

【図1】本発明の一実施例における光電スイッチの構成
を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a photoelectric switch according to an embodiment of the present invention.

【図2】図1の主制御手段による主処理を示すフローチ
ャートである。
FIG. 2 is a flowchart showing a main process by a main control means of FIG.

【図3】図1の感度設定制御手段による感度設定処理を
示すフローチャートである。
FIG. 3 is a flowchart showing a sensitivity setting process by a sensitivity setting control means of FIG.

【図4】図1のEEPROM制御手段によるEEPRO
M制御処理を示すフローチャートである。
4 is an EEPROM by the EEPROM control means of FIG.
It is a flow chart which shows M control processing.

【図5】感度設定処理の一例を示す信号波形図である。FIG. 5 is a signal waveform diagram showing an example of sensitivity setting processing.

【図6】検出信号の切替えタイミングおよび動作レベル
の切替えタイミングを示す図である。
FIG. 6 is a diagram showing switching timing of detection signals and switching timing of operation levels.

【図7】従来の光電スイッチの動作を示すフローチャー
トである。
FIG. 7 is a flowchart showing the operation of a conventional photoelectric switch.

【図8】従来の検出スイッチにおいて感度設定中に応答
速度が低下する場合を示す波形図である。
FIG. 8 is a waveform diagram showing a case where the response speed decreases during sensitivity setting in the conventional detection switch.

【図9】従来の光電スイッチにおいて感度設定中に検出
信号の出力動作が休止する場合を示す波形図である。
FIG. 9 is a waveform diagram showing a case where the output operation of the detection signal is stopped during sensitivity setting in the conventional photoelectric switch.

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

1 主制御手段 2 投光回路 3 受光・増幅回路 4 A/D変換器 5 受光データ記憶手段 6 ピークホールド手段 7 ピーク値記憶手段 8 設定データ演算手段 9 設定データ記憶手段 10 動作レベル演算手段 11 比較器 12 入光判定手段 13 出力制御手段 14 出力装置 15 感度設定制御手段 16 EEPROM制御手段 17 EEPROM 18 動作モード切換入力手段 19 設定制御入力手段 1 Main control means 2 Emitter circuit 3 Light receiving / amplifying circuit 4 A / D converter 5 Light reception data storage means 6 Peak hold means 7 Peak value storage means 8 Setting data calculation means 9 Setting data storage means 10 Behavior level calculation means 11 comparator 12 Light input determination means 13 Output control means 14 Output device 15 Sensitivity setting control means 16 EEPROM control means 17 EEPROM 18 Operation mode switching input means 19 Setting control input means

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 光を投射しその透過光または反射光を受
光することにより物体の有無を検出する光電スイッチで
あって 検出動作、検出結果の出力動作および感度更新許可タイ
ミングを含む主処理を周期的に繰り返し実行する主制御
手段と、 外部からの感度設定指令に基づいて設定データを生成
し、前記主処理における前記感度更新許可タイミングで
前記設定データに基づく感度更新を行なう感度設定制御
手段とを備えた ことを特徴とする光電スイッチ。
1. A photoelectric switch for detecting the presence or absence of an object by the light projecting receiving transmitted light or reflected light, detecting operation, the detection result permits the output operation and sensitivity update Thailand
Main control that periodically executes main processing including
And setting data based on external sensitivity setting command
At the sensitivity update permission timing in the main process
Sensitivity setting control for updating sensitivity based on the setting data
A photoelectric switch comprising: a means .
【請求項2】 前記感度設定制御手段は、前記設定デー
タに基づく感度更新を前記主処理と並列的に実行するこ
とを特徴とする請求項1記載の光電スイッチ。
2. The sensitivity setting control means is configured to set the setting data.
Parameter-based sensitivity update in parallel with the main process.
The photoelectric switch according to claim 1, wherein:
【請求項3】 前記設定データを記憶するための不揮発
性記憶手段と、前記不揮発性記憶手段への前記設定デー
タの書き込みを制御する書き込み制御手段とをさらに備
え、 前記感度設定制御手段は、前記設定データに基づく感度
更新と並行して前記不揮発性記憶手段への前記設定デー
タの書き込み要求を行ない、前記書き込み制御手段は、
前記書き込み要求に応答して前記感度設定制御手段によ
り得られた前記設定データを不揮発性記憶手段に書き込
むことを特徴とする請求項1または2記載の光電スイッ
チ。
3. A non-volatile storage means for storing the setting data, and a writing control means for controlling writing of the setting data to the non-volatile storage means, wherein the sensitivity setting control means comprises: In parallel with updating the sensitivity based on the setting data, a request for writing the setting data to the non-volatile storage means is performed, and the writing control means,
3. The photoelectric switch according to claim 1, wherein the setting data obtained by the sensitivity setting control unit is written in the nonvolatile storage unit in response to the write request.
JP27406995A 1995-10-23 1995-10-23 Photoelectric switch Expired - Fee Related JP3482285B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27406995A JP3482285B2 (en) 1995-10-23 1995-10-23 Photoelectric switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27406995A JP3482285B2 (en) 1995-10-23 1995-10-23 Photoelectric switch

Publications (2)

Publication Number Publication Date
JPH09116411A JPH09116411A (en) 1997-05-02
JP3482285B2 true JP3482285B2 (en) 2003-12-22

Family

ID=17536545

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27406995A Expired - Fee Related JP3482285B2 (en) 1995-10-23 1995-10-23 Photoelectric switch

Country Status (1)

Country Link
JP (1) JP3482285B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4598042B2 (en) * 2007-10-22 2010-12-15 株式会社キーエンス Detection switch and photoelectric switch
JP5740858B2 (en) * 2010-07-12 2015-07-01 竹中電子工業株式会社 Optical phase difference detection type object detection sensor

Also Published As

Publication number Publication date
JPH09116411A (en) 1997-05-02

Similar Documents

Publication Publication Date Title
KR950010677A (en) Remote controller for selecting and setting preset data
JP3482285B2 (en) Photoelectric switch
JP3632103B2 (en) Photoelectric switch
JP3645637B2 (en) Photoelectric switch
JPH05206821A (en) Photoelectric switch and controlling method thereof
KR100719257B1 (en) The touch sensor which automatic movement is adapted to a external environment
JPH09167952A (en) Photoelectric switch
JPH10153139A (en) Throttle opening detector
CN111614918B (en) Human eye protection method and device for laser television and computer equipment
JP3401800B2 (en) Photoelectric switch
JPH09167951A (en) Photoelectric switch
US6853931B2 (en) Method and device for inputting data into an electronic data processing device
JP3097935B2 (en) Analog-digital converter
JP2523053B2 (en) Rewriting method of EEPROM in industrial instrument
JPH11271835A (en) Method for controlling iris of zoom lens, and zoom lens
JP2022120233A (en) Route guidance control device, navigation system, and route guidance control program
JP2554473Y2 (en) Active ranging device
JP2003032093A (en) Detection switch system
SU1667251A1 (en) Shaft rotation angle-to-digit converter
JP3208143B2 (en) Input / output controller of power controller
JPH03261218A (en) Photoelectric switch
JP2953879B2 (en) Microcomputer
JPH03240102A (en) Identifying method for control parameter
JPH06331738A (en) Ultrasonic vehicle detector
JPH03193287A (en) Automatic alignment device for laser oscillator

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

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

Free format text: PAYMENT UNTIL: 20121010

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20121010

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20131010

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees