JP2019057239A - Control device - Google Patents

Control device Download PDF

Info

Publication number
JP2019057239A
JP2019057239A JP2017182696A JP2017182696A JP2019057239A JP 2019057239 A JP2019057239 A JP 2019057239A JP 2017182696 A JP2017182696 A JP 2017182696A JP 2017182696 A JP2017182696 A JP 2017182696A JP 2019057239 A JP2019057239 A JP 2019057239A
Authority
JP
Japan
Prior art keywords
pulse width
diagnostic
pulse
unit
statistical data
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.)
Granted
Application number
JP2017182696A
Other languages
Japanese (ja)
Other versions
JP6834883B2 (en
Inventor
喬 花井
Takashi Hanai
喬 花井
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.)
Denso Wave Inc
Original Assignee
Denso Wave Inc
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 Denso Wave Inc filed Critical Denso Wave Inc
Priority to JP2017182696A priority Critical patent/JP6834883B2/en
Publication of JP2019057239A publication Critical patent/JP2019057239A/en
Application granted granted Critical
Publication of JP6834883B2 publication Critical patent/JP6834883B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

To prevent false diagnosis while maintaining good response to failure detection, regarding a fault diagnosis of an input circuit.SOLUTION: PLC1 includes: an input circuit 3 which receives signals from one of normally closed contacts C1 to C4 and outputs contact input signals Si1 to Si4; and a diagnostic signal output unit 5 and a diagnostic unit 6 outputting diagnostic signals Sd1 to Sd4 to the other terminals of the contacts C1 to C4. The diagnostic unit 6 includes: a pulse width measuring unit 7 for detecting pulses included in the contact input signals Si1 to Si4 and measuring a width of the detected pulse; a statistical data creation unit 8 that creates statistical data in which the number of times of detection of the pulse detected in the measurement period and the width of the measured pulse are associated with each other; and a pulse width setting unit 9 for setting a diagnostic pulse width of the diagnostic signals Sd1 to Sd4 based on the statistical data. The diagnostic unit 6 excludes a pulse having a width different from the diagnostic pulse width from the pulses included in the contact input signals Si1 to Si4, to thereby diagnose a failure of the input circuit 3.SELECTED DRAWING: Figure 1

Description

本発明は、常閉型の接点の開閉状態に対応したレベルを有する接点入力信号を内部回路へと出力する入力回路を備える制御装置に関する。   The present invention relates to a control device including an input circuit that outputs a contact input signal having a level corresponding to an open / close state of a normally closed contact to an internal circuit.

特許文献1に開示されているように、プログラマブルロジックコントローラなどの制御装置には、その制御対象となる外部機器から与えられる信号を内部回路に取り込むための入力回路が設けられている。なお、以下では、プログラマブルロジックコントローラのことをPLCとも称する。   As disclosed in Patent Document 1, a control device such as a programmable logic controller is provided with an input circuit for taking a signal supplied from an external device to be controlled into an internal circuit. Hereinafter, the programmable logic controller is also referred to as PLC.

例えば非常停止スイッチなどの常閉型の接点であるB接点の操作状態を検出するために用いられる入力回路では、B接点が操作されて開放状態になった際、その開放状態に対応したレベル、例えばLowレベルの信号を内部回路であるマイクロコントローラに出力するといった動作が行われるようになっている。   For example, in an input circuit used for detecting an operation state of a B contact which is a normally closed contact such as an emergency stop switch, when the B contact is operated and becomes an open state, a level corresponding to the open state, For example, an operation of outputting a low level signal to a microcontroller which is an internal circuit is performed.

仮に入力回路が故障し、このような動作が行われなくなると、非常停止スイッチが操作されたにもかかわらず対象機器の動作が停止されない、といった事態が生じるおそれがある。そのため、入力回路が正常に動作できるかどうか、つまり入力回路に故障が生じていないかどうかを定期的に診断する機能が必要となる。   If the input circuit breaks down and such an operation is not performed, a situation may occur in which the operation of the target device is not stopped even though the emergency stop switch is operated. Therefore, a function for periodically diagnosing whether or not the input circuit can operate normally, that is, whether or not a failure has occurred in the input circuit is required.

このような事情から、従来の制御装置には、入力回路の故障を診断する機能を備えたものがある。この場合、制御装置は、所定の診断周期毎にLowレベルに変化するパルスが含まれる診断信号を出力する診断信号出力部を備えている。そして、制御装置は、B接点を介して診断信号を入力回路にフィードバックし、上記診断周期毎に入力回路の出力信号に上記パルスが含まれるか否かにより入力回路の故障を診断するようになっている。   For these reasons, some conventional control devices have a function of diagnosing an input circuit failure. In this case, the control device includes a diagnostic signal output unit that outputs a diagnostic signal including a pulse that changes to a low level every predetermined diagnostic cycle. The control device feeds back a diagnostic signal to the input circuit via the B contact, and diagnoses the failure of the input circuit depending on whether or not the pulse is included in the output signal of the input circuit at each diagnostic cycle. ing.

特開2013−73450号公報JP 2013-73450 A

上記従来の構成では、診断信号の伝達経路に外来ノイズなどのノイズが重畳すると、その影響により入力回路の出力信号がLowレベルになることが考えられる。その結果、実際には、入力回路が故障してLowレベルの信号を出力できない故障が生じているにもかかわらず、ノイズの影響によりLowレベルの信号が出力されてしまい、正常であると誤診断されるおそれがある。   In the above conventional configuration, when noise such as external noise is superimposed on the diagnostic signal transmission path, the output signal of the input circuit may be at a low level due to the influence. As a result, in reality, a low level signal is output due to the influence of noise even though the input circuit has failed and a failure that cannot output a low level signal has occurred. There is a risk of being.

診断信号に意図的に含まれるパルスと、ノイズの影響による意図しないパルスとを明確に区別することができれば、上記誤診断の発生を防ぐことができると考えられる。しかし、PLCが設置される環境、PLCに接続される外部機器の有無および種類などにより、上述したノイズの発生状況が変化するため、上記区別についてのルールを一律に定めることは困難である。   If the pulse intentionally included in the diagnostic signal can be clearly distinguished from the unintended pulse due to the influence of noise, it is considered that the occurrence of the above-described misdiagnosis can be prevented. However, since the noise generation state described above varies depending on the environment in which the PLC is installed, the presence and type of external devices connected to the PLC, and the like, it is difficult to uniformly determine the rules for the above-described distinction.

そこで、このようなノイズによる誤診断を防止するため、上記した診断を複数の診断周期にわたって実行し、それら複数回実行した診断の結果に基づいて、入力回路の故障を診断する、という手法を採用することが考えられる。しかし、この手法では、入力回路の故障発生から故障検出までに要する時間が延びてしまい、故障検出の応答性が低下するという別の問題が生じてしまう。   Therefore, in order to prevent such erroneous diagnosis due to noise, a method is adopted in which the above-described diagnosis is performed over a plurality of diagnosis cycles, and the failure of the input circuit is diagnosed based on the results of the diagnosis executed a plurality of times. It is possible to do. However, with this technique, the time required from the occurrence of a failure in the input circuit to the detection of the failure increases, and another problem arises that the responsiveness of failure detection decreases.

本発明は上記事情に鑑みてなされたものであり、その目的は、入力回路の故障診断について、故障検出の応答性を良好に維持しつつ、誤診断の発生を防止することができる制御装置を提供することにある。   The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a control device capable of preventing the occurrence of misdiagnosis while maintaining good failure detection responsiveness for failure diagnosis of an input circuit. It is to provide.

請求項1に記載の制御装置は、入力回路、診断信号出力部および診断部を備えている。入力回路は、外部に設けられた常閉型の接点の一方の端子の信号を入力し、接点の開閉状態に対応したレベルを有する接点入力信号を内部回路へと出力する。診断信号出力部は、接点の他方の端子に対し、接点の開放状態に対応したレベルに変化するパルスが所定の診断周期毎に含まれる診断信号を出力する。診断信号出力部から出力される診断信号は、接点を介して入力回路にフィードバックされることになる。そして、入力回路に故障が生じていなければ、入力回路から出力される接点入力信号には、上記診断周期毎に、診断信号に含まれるパルスと同様のパルスが現れることになる。   The control apparatus according to claim 1 includes an input circuit, a diagnostic signal output unit, and a diagnostic unit. The input circuit inputs a signal of one terminal of a normally closed contact provided outside and outputs a contact input signal having a level corresponding to the open / closed state of the contact to the internal circuit. The diagnostic signal output unit outputs, to the other terminal of the contact, a diagnostic signal including a pulse that changes to a level corresponding to the open state of the contact every predetermined diagnosis cycle. The diagnostic signal output from the diagnostic signal output unit is fed back to the input circuit via the contact. If no failure has occurred in the input circuit, a pulse similar to the pulse included in the diagnostic signal appears in the contact input signal output from the input circuit at each diagnostic cycle.

この点を踏まえ、診断部は、接点入力信号に含まれるパルスに基づいて入力回路の故障を診断する。基本的には、診断部は、接点入力信号に診断信号に含まれるパルスと同様のパルスが含まれていれば、入力回路が正常であると診断し、上記パルスが含まれていなければ、入力回路が故障していると診断することができる。そして、診断部は、外来ノイズによる誤診断の発生を抑制するため、さらに次のような機能を有している。   Based on this point, the diagnosis unit diagnoses a failure of the input circuit based on the pulse included in the contact input signal. Basically, the diagnosis unit diagnoses that the input circuit is normal if the contact input signal includes a pulse similar to the pulse included in the diagnosis signal. It can be diagnosed that the circuit is faulty. The diagnosis unit further has the following functions to suppress the occurrence of misdiagnosis due to external noise.

すなわち、診断部は、パルス幅測定部、統計データ作成部およびパルス幅設定部を備えている。パルス幅測定部は、接点入力信号に含まれるパルスを検出するとともに、その検出されたパルスの幅を測定する。統計データ作成部は、所定の測定期間においてパルス幅測定部により検出されたパルスの検出回数と測定されたパルスの幅とを関連付けた統計データを作成する。パルス幅設定部は、統計データに基づいて診断信号に含まれるパルスの幅である診断パルス幅を設定する。   That is, the diagnosis unit includes a pulse width measurement unit, a statistical data creation unit, and a pulse width setting unit. The pulse width measurement unit detects a pulse included in the contact input signal and measures the width of the detected pulse. The statistical data creation unit creates statistical data that associates the number of detected pulses detected by the pulse width measurement unit in a predetermined measurement period with the measured pulse width. The pulse width setting unit sets a diagnostic pulse width that is a width of a pulse included in the diagnostic signal based on the statistical data.

この場合、統計データには、診断のために意図的に含まれるパルスおよび外来ノイズなどの影響による意図しないパルスの双方が含まれる。しかし、診断のために意図的に含まれるパルスが測定期間中に何回出力されているか、およびそのパルスの幅は既知である。そのため、接点入力信号に含まれるパルスから、診断のために意図的に含まれたパルスを識別することは容易である。したがって、パルス幅設定部は、統計データに基づいて、外来ノイズなどの影響による意図しないパルスの幅と重複しない、または重複する頻度の少ないと考えられるパルス幅を、診断パルス幅に設定することができる。   In this case, the statistical data includes both a pulse intentionally included for diagnosis and an unintended pulse due to an influence such as external noise. However, the number of pulses intentionally included for diagnosis is output during the measurement period and the width of the pulse is known. Therefore, it is easy to identify a pulse intentionally included for diagnosis from a pulse included in the contact input signal. Therefore, based on the statistical data, the pulse width setting unit may set, as the diagnostic pulse width, a pulse width that is considered not to overlap with an unintended pulse width due to the influence of external noise or the like, or is less likely to overlap. it can.

上記構成によれば、外来ノイズなどの影響により接点入力信号に現れるパルスの幅は、高い確率で、診断パルス幅とは異なる幅となる。そこで、診断部は、接点入力信号に含まれるパルスのうち、パルス幅設定部により設定された診断パルス幅とは異なる幅のパルスを除外して入力回路の故障を診断する。このようにすれば、診断の回数を少なく抑えたとしても、外来ノイズなどの影響による誤診断の発生を低く抑えることができる。したがって、上記構成によれば、入力回路の故障診断について、故障検出の応答性を良好に維持しつつ、誤診断の発生を防止することができるという優れた効果が得られる。   According to the above configuration, the width of the pulse appearing in the contact input signal due to the influence of external noise or the like is different from the diagnostic pulse width with a high probability. Therefore, the diagnosis unit diagnoses a failure of the input circuit by excluding pulses having a width different from the diagnosis pulse width set by the pulse width setting unit from the pulses included in the contact input signal. In this way, even if the number of diagnoses is reduced, the occurrence of misdiagnosis due to the influence of external noise or the like can be kept low. Therefore, according to the above configuration, it is possible to obtain an excellent effect that it is possible to prevent the occurrence of a misdiagnosis while maintaining a good responsiveness of the failure detection for the failure diagnosis of the input circuit.

診断信号に重畳する可能性がある外来ノイズなどのノイズの発生状況は、制御装置が設置される環境、制御装置に接続される外部機器の有無、それら外部機器の種類などによって変化する。そこで、請求項2に記載の制御装置では、統計データ作成部による統計データの作成およびパルス幅設定部による診断パルス幅の設定は、装置の起動時に行われるようになっている。このようにすれば、実際の設置環境におけるパルスの検出回数およびパルス幅の測定結果から作成された統計データに基づいて診断パルス幅が設定されるため、実際に生じる可能性が高い外来ノイズなどの影響を受け難い診断を実現することができる。   The occurrence of noise such as external noise that may be superimposed on the diagnostic signal varies depending on the environment in which the control device is installed, the presence / absence of external devices connected to the control device, the type of these external devices, and the like. Therefore, in the control device according to the second aspect, the creation of the statistical data by the statistical data creation unit and the setting of the diagnostic pulse width by the pulse width setting unit are performed when the device is started. In this way, the diagnostic pulse width is set based on the statistical data created from the pulse detection count and pulse width measurement results in the actual installation environment. Diagnosis that is not easily affected can be realized.

ただし、ノイズの発生状況は、装置の起動時における状況と同一の状況がそのまま維持されるわけではなく、例えば外部機器の動作状況などに応じて変化する可能性がある。そこで、請求項2に記載の制御装置では、統計データの作成および診断パルス幅の設定は、装置の起動時に行われた後、所定の更新周期毎に行われるようになっている。このようにすれば、外部機器の動作状況などに応じて変化するノイズの発生状況に応じて、診断パルス幅が変更されるため、外来ノイズなどの影響を一層受け難い診断を実現することができる。   However, the noise generation state is not maintained as it is at the time of starting the apparatus, and may change depending on, for example, the operation state of the external device. Therefore, in the control device according to the second aspect, the creation of the statistical data and the setting of the diagnostic pulse width are performed at a predetermined update cycle after being performed at the time of starting the device. In this way, since the diagnostic pulse width is changed according to the noise generation status that changes according to the operation status of the external device, it is possible to realize a diagnosis that is less susceptible to external noise and the like. .

請求項3に記載の制御装置では、パルス幅設定部は、統計データにおけるパルスの検出回数に基づいて診断パルス幅を設定する。統計データにおけるパルスの検出回数は、外来ノイズの発生状況に変化が無い、または変化が小さいと仮定すれば、そのパルスの幅と同様の幅を持つ意図しないパルスが発生する頻度に比例すると考えられる。したがって、上述したように診断パルス幅を設定すれば、外来ノイズなどの影響による意図しないパルスの幅と重複しない、または重複する頻度の少ないパルス幅を、診断パルス幅に設定することができ、その結果、外来ノイズなどの影響による誤診断の発生を一層抑制することができる。   According to a third aspect of the present invention, the pulse width setting unit sets the diagnostic pulse width based on the number of detected pulses in the statistical data. The number of detected pulses in the statistical data is considered to be proportional to the frequency of occurrence of an unintended pulse having the same width as that of the pulse, assuming that there is no change in the occurrence of external noise or the change is small. . Therefore, if the diagnostic pulse width is set as described above, a pulse width that does not overlap with an unintended pulse width due to the influence of external noise or the like, or a pulse width that does not frequently overlap can be set as the diagnostic pulse width. As a result, the occurrence of misdiagnosis due to the influence of external noise and the like can be further suppressed.

前述したように、ノイズの発生状況は、外部機器の動作状態などの周囲環境に応じて変化する。そのため、外部機器の動作状態などが比較的短い周期で変化するような用途に制御装置が用いられる場合には、ノイズの発生状況の変化の周期も短くなる可能性がある。請求項2に記載の制御装置のように、更新周期毎に統計データの作成および診断パルス幅の設定を行えば、このような変化に対応することができると考えられるが、更新周期がノイズの発生状況の変化の周期よりも長くなる場合には、対応が不十分になる可能性がある。なお、想定されるノイズの発生状況の変化の周期よりも更新周期を十分に短く設定すれば、このような問題の発生が解消されると考えられるが、更新周期をむやみに短くすると、統計データの作成回数が増え、その作成に係る処理負荷の増大などの問題が生じる。   As described above, the noise generation state changes according to the surrounding environment such as the operating state of the external device. For this reason, when the control device is used for an application in which the operating state of the external device changes at a relatively short cycle, there is a possibility that the cycle of change in the noise generation state may be shortened. If the statistical data is created and the diagnostic pulse width is set for each update cycle as in the control device according to claim 2, it is considered that such a change can be dealt with. When it becomes longer than the period of change of the occurrence situation, there is a possibility that the response becomes insufficient. It should be noted that if the update cycle is set sufficiently shorter than the expected change cycle of noise generation, the occurrence of such a problem is considered to be eliminated, but if the update cycle is shortened excessively, statistical data The number of times of creation increases, causing problems such as an increase in processing load related to the creation.

そこで、請求項4に記載の制御装置では、診断信号出力部は、診断周期毎に診断パルス幅を持つ1つのパルスが含まれた診断信号を出力する。そして、診断部は、同一の診断周期内の接点入力信号に診断パルス幅を持つパルスが複数含まれていることを条件として診断信号の診断パルス幅を変更するパルス幅変更部を備えている。つまり、この場合、ノイズの発生状況の変化により、当初設定された診断パルス幅と同様のパルス幅を持つ意図しないパルスが発生するようになると、診断パルス幅が変更されるようになっている。   Therefore, in the control device according to the fourth aspect, the diagnostic signal output unit outputs a diagnostic signal including one pulse having a diagnostic pulse width for each diagnostic period. The diagnostic unit includes a pulse width changing unit that changes the diagnostic pulse width of the diagnostic signal on condition that a plurality of pulses having a diagnostic pulse width are included in the contact input signal within the same diagnostic cycle. That is, in this case, when an unintended pulse having a pulse width similar to the initially set diagnostic pulse width is generated due to a change in the noise generation state, the diagnostic pulse width is changed.

このように、上記構成では、ノイズの発生状況の変化に応じて、診断パルス幅が動的に変更されるようになっている。このようにすれば、周囲環境が時々刻々と変化するような場合でも、その変化に合わせて、診断パルス幅を、ノイズによる誤診断が生じ難いようなパルス幅へと変更することが可能となる。したがって、上記構成によれば、周囲環境が比較的短い周期で変化する用途に制御装置が用いられる場合でも、外来ノイズなどの影響による誤診断の発生を抑制することができる。   As described above, in the above configuration, the diagnostic pulse width is dynamically changed according to the change in the noise generation state. In this way, even when the surrounding environment changes from moment to moment, the diagnostic pulse width can be changed to a pulse width that is unlikely to cause erroneous diagnosis due to noise. . Therefore, according to the above configuration, even when the control device is used for an application in which the surrounding environment changes at a relatively short cycle, it is possible to suppress the occurrence of erroneous diagnosis due to the influence of external noise or the like.

請求項5に記載の制御装置では、パルス幅変更部は、統計データにおけるパルスの検出回数に基づいて診断パルス幅を変更する。前述したように、統計データにおけるパルスの検出回数は、外来ノイズの発生状況に変化が無い、または変化が小さいと仮定すれば、そのパルスの幅と同様の幅を持つ意図しないパルスが発生する頻度に比例すると考えられる。したがって、上述したように診断パルス幅を変更すれば、外来ノイズなどの影響による意図しないパルスの幅と重複しない、または重複する頻度の少ないパルス幅を、診断パルス幅に設定することができ、その結果、外来ノイズなどの影響による誤診断の発生を一層抑制することができる。   In the control device according to the fifth aspect, the pulse width changing unit changes the diagnostic pulse width based on the number of detected pulses in the statistical data. As described above, the frequency of detection of pulses in statistical data is the frequency of occurrence of unintended pulses having the same width as that of the pulses, assuming that there is no change in the occurrence of external noise or the change is small. It is thought that it is proportional to Therefore, if the diagnostic pulse width is changed as described above, a pulse width that does not overlap with an unintended pulse width due to the influence of external noise or the like, or a pulse width that rarely overlaps, can be set as the diagnostic pulse width. As a result, the occurrence of misdiagnosis due to the influence of external noise and the like can be further suppressed.

請求項6に記載の制御装置では、統計データ作成部は、パルス幅測定部により測定されたパルスの幅を複数のグループに分け、それらグループ毎の検出回数が記録されたものを統計データとして作成するものである。また、この場合、統計データ作成部は、グループ毎のパルス幅の範囲を変更することができるようになっている。外来ノイズの特徴として、同程度のパルス幅のノイズが群発することが挙げられる。そのため、発生頻度が高いパルス幅の群と群との間に、発生頻度が極めて低いパルス幅の群が存在する可能性がある。上述したように、グループ毎のパルス幅の範囲を変更することで、このような発生頻度が低いパルス幅の群を発見することができる可能性がある。このようにすれば、診断パルス幅として、外来ノイズとして発生する頻度が少ないパルス幅に設定することができる。   The control device according to claim 6, wherein the statistical data creation unit divides the pulse widths measured by the pulse width measurement unit into a plurality of groups, and creates the statistical data in which the number of times of detection for each group is recorded. To do. Further, in this case, the statistical data creation unit can change the range of the pulse width for each group. As a feature of external noise, noise having a similar pulse width is swarmed. For this reason, there may be a group having a pulse width with a very low occurrence frequency between the groups having a pulse width with a high occurrence frequency. As described above, by changing the range of the pulse width for each group, there is a possibility that a group of such pulse widths with low occurrence frequency can be found. In this way, the diagnostic pulse width can be set to a pulse width that is less frequently generated as external noise.

請求項7に記載の制御装置では、統計データ作成部は、パルス幅測定部により測定されたパルスの幅を複数のグループに分け、それらグループ毎の検出回数が記録されたものを統計データとして作成するものである。また、この場合、統計データ作成部は、グループの少なくとも1つの検出回数がゼロとなるようにグループを設定するようになっている。前述した通り、外来ノイズの特徴として、発生頻度が高いパルス幅の群と群との間に、発生頻度が極めて低いパルス幅の群が存在する可能性がある。上記構成によれば、このような発生頻度が極めて低いパルス幅の群が上記グループの1つとして設定されることになり、その結果、診断パルス幅として、外来ノイズとして発生する頻度が少ないパルス幅に設定することができる。   In the control device according to claim 7, the statistical data generation unit divides the pulse widths measured by the pulse width measurement unit into a plurality of groups, and generates the statistical data obtained by recording the number of times of detection for each group. To do. Further, in this case, the statistical data creation unit sets the group so that the number of detection times of at least one of the groups is zero. As described above, as a feature of external noise, there is a possibility that a group having a pulse width with a very low occurrence frequency exists between groups having a pulse width with a high occurrence frequency. According to the above configuration, a group having such a pulse width that is extremely low in frequency is set as one of the above groups, and as a result, a pulse width that is less frequently generated as external noise as a diagnostic pulse width. Can be set to

第1実施形態に係るPLCおよび接点の構成を模式的に示す図The figure which shows typically the structure of PLC which concerns on 1st Embodiment, and a contact point 第1実施形態に係る統計データの具体的な一例を示す図The figure which shows a specific example of the statistical data which concerns on 1st Embodiment. 第1実施形態に係る候補データの具体的な一例を示す図The figure which shows a specific example of the candidate data which concerns on 1st Embodiment 第1実施形態に係る診断部による処理の内容を模式的に示す図The figure which shows typically the content of the process by the diagnostic part which concerns on 1st Embodiment. 診断パルス幅を更新しない場合における入力回路の故障検出を説明するためのタイミングチャートTiming chart for explaining fault detection of input circuit when diagnostic pulse width is not updated 第1実施形態に係る診断パルス幅の更新を説明するためのタイミングチャートTiming chart for explaining update of diagnostic pulse width according to the first embodiment 第1実施形態に係る入力回路の故障検出を説明するためのタイミングチャートTiming chart for explaining failure detection of an input circuit according to the first embodiment 第2実施形態に係るPLCおよび接点の構成を模式的に示す図The figure which shows typically the structure of PLC and contact concerning 2nd Embodiment 第2実施形態に係る候補データの具体的な一例を示す図The figure which shows a specific example of the candidate data which concerns on 2nd Embodiment 第2実施形態に係る診断部による処理の内容を模式的に示す図The figure which shows typically the content of the process by the diagnostic part which concerns on 2nd Embodiment.

以下、複数の実施形態について図面を参照して説明する。なお、各実施形態において実質的に同一の構成には同一の符号を付して説明を省略する。
(第1実施形態)
以下、第1実施形態について、図1〜図7を参照して説明する。
Hereinafter, a plurality of embodiments will be described with reference to the drawings. In each embodiment, substantially the same components are denoted by the same reference numerals and description thereof is omitted.
(First embodiment)
The first embodiment will be described below with reference to FIGS.

図1に示すように、制御装置に相当するPLC1には、外部機器2に設けられたN個(ただし、Nは正の整数)の接点が接続される。なお、図1では、PLC1に対し4つの接点C1〜C4が接続される場合を例示しているが、PLC1に接続される接点の数は3つ以下でもよいし、5つ以上でもよい。また、図1には、PLC1の構成のうち、外部機器2との間における信号の入出力を担うI/Oユニットに関連する構成だけが図示されている。   As shown in FIG. 1, N (where N is a positive integer) contacts provided in the external device 2 are connected to the PLC 1 corresponding to the control device. 1 illustrates the case where four contacts C1 to C4 are connected to the PLC 1, the number of contacts connected to the PLC 1 may be three or less, or may be five or more. FIG. 1 shows only the configuration related to the I / O unit responsible for input / output of signals with the external device 2 among the configurations of the PLC 1.

接点C1〜C4は、PLC1に接続される外部機器2に設けられた常閉型の接点、つまりB接点である。したがって、接点C1〜C4は、操作されてない状態では閉鎖状態(Close)となっており、ユーザにより操作されると開放状態(Open)となる。この場合、接点C1〜C4は、例えば対象機器の動作を強制的に停止するための非常停止スイッチとして用いられる。   The contacts C1 to C4 are normally closed contacts provided on the external device 2 connected to the PLC 1, that is, B contacts. Therefore, the contacts C1 to C4 are in a closed state (Close) when not operated, and are opened (Open) when operated by the user. In this case, the contacts C1 to C4 are used as an emergency stop switch for forcibly stopping the operation of the target device, for example.

PLC1は、接点C1〜C4の各一方の端子に接続される端子P1〜P4と、接点C1〜C4の各他方の端子に接続されるP5〜P8とを備えている。端子P1〜P4は、接点C1〜C4の一方の端子の信号を入力するための端子である。端子P5〜P8は、接点C1〜C4の他方の端子に対し、診断信号Sd1〜Sd4を出力するための端子である。詳細は後述するが、診断信号Sd1〜Sd4は、ほとんどの期間、例えば+24VなどのHighレベルとなる信号である。   The PLC 1 includes terminals P1 to P4 connected to one of the contacts C1 to C4 and P5 to P8 connected to the other terminals of the contacts C1 to C4. The terminals P1 to P4 are terminals for inputting signals from one of the contacts C1 to C4. Terminals P5 to P8 are terminals for outputting diagnostic signals Sd1 to Sd4 to the other terminals of the contacts C1 to C4. Although details will be described later, the diagnostic signals Sd1 to Sd4 are signals that are at a high level such as +24 V for most of the period.

PLC1は、入力回路3およびマイクロコントローラ4などを備えている。なお、以下では、マイクロコントローラ4のことをマイコン4と称する。入力回路3は、接点C1〜C4の一方の端子の信号を入力し、接点C1〜C4の開閉状態に対応したレベルを有する接点入力信号Si1〜Si4を内部回路であるマイコン4へと出力する。   The PLC 1 includes an input circuit 3 and a microcontroller 4. Hereinafter, the microcontroller 4 is referred to as a microcomputer 4. The input circuit 3 inputs signals from one of the contacts C1 to C4 and outputs contact input signals Si1 to Si4 having levels corresponding to the open / closed states of the contacts C1 to C4 to the microcomputer 4 that is an internal circuit.

この場合、入力回路3は、その信号の入出力経路において、絶縁およびレベル変換を行う。そのため、入力回路3から出力される接点入力信号Si1〜Si4は、接点C1〜C4が閉鎖状態である期間には診断信号Sd1〜Sd4と同様のレベル、つまりほぼHighレベルとなり、接点C1〜C4が開放状態である期間には例えば0VなどのLowレベルとなる。ただし、入力回路3が上記レベル変換を行うことにより、接点入力信号Si1〜Si4のHighレベルは、マイコン4のHigh入力電圧(例えば+5V)となる。   In this case, the input circuit 3 performs insulation and level conversion in the signal input / output path. For this reason, the contact input signals Si1 to Si4 output from the input circuit 3 are at the same level as the diagnostic signals Sd1 to Sd4, that is, almost at the high level during the period when the contacts C1 to C4 are closed, and the contacts C1 to C4 are For example, the low level such as 0V is applied during the open state. However, when the input circuit 3 performs the above level conversion, the high level of the contact input signals Si1 to Si4 becomes the high input voltage (for example, + 5V) of the microcomputer 4.

したがって、本実施形態では、接点C1〜C4の閉鎖状態に対応したレベルがHighレベルとなり、開放状態に対応したレベルがLowレベルとなる。なお、以下では、HighレベルのことをHレベルと称するとともに、LowレベルのことをLレベルと称する。   Therefore, in this embodiment, the level corresponding to the closed state of the contacts C1 to C4 is the High level, and the level corresponding to the open state is the Low level. In the following, the high level is referred to as the H level, and the low level is referred to as the L level.

マイコン4は、接点入力信号Si1〜Si4のレベルに基づいて接点C1〜C4の操作状態を検出する機能を備えている。具体的には、マイコン4は、接点入力信号Si1〜Si4のうちいずれかがLレベルとなる期間が一定時間以上継続すると、接点C1〜C4のうち、それに対応する接点がユーザにより操作されたことを検出する。マイコン4は、この機能により接点C1〜C4のうちいずれかが操作されたことを検出すると、それに対応した対象機器の動作を強制停止させるための処理を実行する。   The microcomputer 4 has a function of detecting the operation state of the contacts C1 to C4 based on the levels of the contact input signals Si1 to Si4. Specifically, when the period during which any one of the contact input signals Si1 to Si4 is at the L level continues for a certain time or more, the microcomputer 4 indicates that the corresponding contact among the contacts C1 to C4 has been operated by the user. Is detected. When the microcomputer 4 detects that any one of the contacts C1 to C4 has been operated by this function, the microcomputer 4 executes a process for forcibly stopping the operation of the target device corresponding thereto.

このような構成において、入力回路3において信号をLowレベルにする回路が機能しなくなる故障が生じると、接点C1〜C4のいずれかがユーザにより操作されたにもかかわらず、接点入力信号Si1〜Si4のうち、対応する信号がLレベルにならない。このような場合、非常停止スイッチが操作されたにもかかわらず、対象機器の動作が停止されない、といった事態が生じるおそれがある。   In such a configuration, when a failure occurs in the input circuit 3 in which the circuit for setting the signal to a low level does not function, the contact input signals Si1 to Si4 are used even though any of the contacts C1 to C4 is operated by the user. Among these, the corresponding signal does not become L level. In such a case, there is a possibility that the operation of the target device may not be stopped even though the emergency stop switch is operated.

そこで、マイコン4は、入力回路3に故障が生じていないかどうかを定期的に診断する機能を備えている。具体的には、マイコン4は、診断信号出力部5および診断部6を備えている。診断信号出力部5は、接点C1〜C4の他方の端子に対し、端子P5〜P8を介して診断信号Sd1〜Sd4を出力する。診断信号Sd1〜Sd4は、前述したように、ほとんどの期間はHレベルとなっているが、所定の診断周期毎に所定期間だけLレベルに変化する。つまり、診断信号Sd1〜Sd4は、HレベルからLレベルに変化する1つのパルスが診断周期毎に含まれるようになっている。   Therefore, the microcomputer 4 has a function of periodically diagnosing whether or not a failure has occurred in the input circuit 3. Specifically, the microcomputer 4 includes a diagnostic signal output unit 5 and a diagnostic unit 6. The diagnostic signal output unit 5 outputs diagnostic signals Sd1 to Sd4 to the other terminals of the contacts C1 to C4 via the terminals P5 to P8. As described above, the diagnostic signals Sd1 to Sd4 are at the H level for most of the period, but change to the L level for a predetermined period every predetermined diagnostic cycle. That is, the diagnostic signals Sd1 to Sd4 include one pulse that changes from the H level to the L level for each diagnostic period.

診断信号Sd1〜Sd4がLレベルになる上記所定期間、つまり診断信号Sd1〜Sd4に含まれるパルスの幅は、診断部6により設定される。以下、このパルスの幅のことを、診断パルス幅と称する。なお、上述した診断パルス幅および診断周期は、接点C1〜C4の操作状態を検出する機能に影響を与えないようにするため、ユーザによる接点C1〜C4の操作時間に対して十分に短い時間に設定される。   The diagnostic unit 6 sets the predetermined period during which the diagnostic signals Sd1 to Sd4 are at the L level, that is, the width of the pulse included in the diagnostic signals Sd1 to Sd4. Hereinafter, this pulse width is referred to as a diagnostic pulse width. Note that the above-described diagnostic pulse width and diagnostic cycle do not affect the function of detecting the operation state of the contacts C1 to C4, so that the time is sufficiently shorter than the operation time of the contacts C1 to C4 by the user. Is set.

上記構成によれば、通常時、つまり接点C1〜C4が操作されておらず閉鎖状態であるとき、診断信号Sd1〜Sd4は、接点C1〜C4を介して入力回路3へとフィードバックされる。ここで、入力回路3に故障が生じておらず正常であれば、接点入力信号Si1〜Si4には、診断周期毎に、診断信号Sd1〜Sd4に含まれるパルスと同様の幅のパルスが現れることになる。   According to the above configuration, the diagnosis signals Sd1 to Sd4 are fed back to the input circuit 3 through the contacts C1 to C4 at the normal time, that is, when the contacts C1 to C4 are not operated. Here, if no failure has occurred in the input circuit 3 and it is normal, the contact input signals Si1 to Si4 appear with pulses having the same width as the pulses included in the diagnostic signals Sd1 to Sd4 for each diagnostic cycle. become.

このような点を踏まえ、診断部6は、接点入力信号Si1〜Si4に含まれるパルスに基づいて入力回路3の故障を診断する。基本的には、診断部6は、接点入力信号Si1〜Si4に診断信号Sd1〜Sd4に含まれるパルスと同様の幅のパルスが含まれていれば、入力回路3が正常であると診断し、上記パルスが含まれていなければ、入力回路3が故障していると診断することができる。そして、診断部6は、外来ノイズによる誤診断の発生を抑制するため、さらに次のような機能を有している。   Based on such points, the diagnosis unit 6 diagnoses a failure of the input circuit 3 based on the pulses included in the contact input signals Si1 to Si4. Basically, the diagnosis unit 6 diagnoses that the input circuit 3 is normal if the contact input signals Si1 to Si4 include pulses having the same width as the pulses included in the diagnosis signals Sd1 to Sd4. If the pulse is not included, it can be diagnosed that the input circuit 3 has failed. The diagnosis unit 6 further has the following functions to suppress the occurrence of misdiagnosis due to external noise.

すなわち、診断部6は、パルス幅測定部7、統計データ作成部8およびパルス幅設定部9を備えている。パルス幅測定部7は、接点入力信号Si1〜Si4に含まれるパルスを検出するとともに、その検出されたパルスの幅を測定する。パルス幅の測定は、例えば、信号のエッジを検出して動作するカウンタを用いて行うことができる。この場合、カウンタは、立ち下がりエッジが検出されるとカウント動作を開始し、立ち上がりエッジが検出されるとカウント動作を停止する。このように動作するカウンタのカウント値からパルスの幅を求めることができる。   That is, the diagnosis unit 6 includes a pulse width measurement unit 7, a statistical data creation unit 8, and a pulse width setting unit 9. The pulse width measuring unit 7 detects a pulse included in the contact input signals Si1 to Si4 and measures the width of the detected pulse. The pulse width can be measured using, for example, a counter that operates by detecting an edge of a signal. In this case, the counter starts counting when a falling edge is detected, and stops counting when a rising edge is detected. The pulse width can be obtained from the count value of the counter operating in this way.

この場合、パルス幅測定部7は、上述した検出および測定の対象から、診断信号Sd1〜Sd4に含まれるパルスと同一のタイミングで発生しているパルス、つまり診断のために意図的に含まれるパルスを除外するようになっている。したがって、パルス幅測定部7は、接点入力信号Si1〜Si4に含まれるパルスのうち、外来ノイズなどの影響による意図しないパルスを検出するとともに、その検出されたパルスの幅を測定する。   In this case, the pulse width measuring unit 7 generates pulses generated at the same timing as the pulses included in the diagnostic signals Sd1 to Sd4 from the detection and measurement targets described above, that is, pulses intentionally included for diagnosis. Is supposed to be excluded. Therefore, the pulse width measuring unit 7 detects an unintended pulse due to the influence of external noise or the like among pulses included in the contact input signals Si1 to Si4, and measures the width of the detected pulse.

なお、上記構成において、パルス幅測定部7は、意図的に含まれるパルスを容易に特定することができる。なぜなら、パルス幅測定部7は、診断信号Sd1〜Sd4を出力する診断信号出力部5と同一のマイコン4に設けられている。したがって、診断信号出力部5から、パルス幅測定部7に対し、診断信号Sd1〜Sd4に含まれるパルスが発生するタイミングを伝達することが可能である。このようにすれば、パルス幅測定部7は、診断信号出力部5から伝達されたタイミングで発生するパルスが診断のために意図的に含まれたパルスであると判断し、検出および測定の対象から除外することができる。そのため、この場合、外来ノイズの等の影響による意図しないパルスを検出するとともに、その検出されたパルスの幅を測定することができる。   In the above configuration, the pulse width measurement unit 7 can easily identify the pulse intentionally included. This is because the pulse width measuring unit 7 is provided in the same microcomputer 4 as the diagnostic signal output unit 5 that outputs the diagnostic signals Sd1 to Sd4. Therefore, it is possible to transmit the timing at which the pulses included in the diagnostic signals Sd1 to Sd4 are generated from the diagnostic signal output unit 5 to the pulse width measurement unit 7. In this way, the pulse width measurement unit 7 determines that the pulse generated at the timing transmitted from the diagnostic signal output unit 5 is a pulse intentionally included for diagnosis, and detects and measures the target. Can be excluded. Therefore, in this case, an unintended pulse due to the influence of external noise or the like can be detected, and the width of the detected pulse can be measured.

本実施形態では、パルス幅測定部7は、マイコン4が備えるCPUがROMなどに記憶されたプログラムを実行することにより実現されている、つまりソフトウェアにより実現されている。なお、パルス幅測定部7は、専用回路、つまり専用のハードウェアにより実現することもできる。   In the present embodiment, the pulse width measurement unit 7 is realized by a CPU included in the microcomputer 4 executing a program stored in a ROM or the like, that is, realized by software. The pulse width measurement unit 7 can also be realized by a dedicated circuit, that is, dedicated hardware.

統計データ作成部8は、所定の測定期間においてパルス幅測定部7により検出されたパルスの検出回数と測定されたパルスの幅とを関連付けた統計データを作成する。なお、本実施形態では、上記測定期間は、例えば1時間に設定されている。統計データは、具体的には、図2に示すように、測定されたパルス幅をグループ分けし、グループ毎の測定期間あたりの検出回数、つまり発生頻度[回/1時間]が記録されている。   The statistical data creating unit 8 creates statistical data in which the number of detected pulses detected by the pulse width measuring unit 7 in a predetermined measurement period is associated with the measured pulse width. In the present embodiment, the measurement period is set to 1 hour, for example. Specifically, as shown in FIG. 2, the statistical data groups the measured pulse widths, and records the number of detections per measurement period for each group, that is, the occurrence frequency [times / 1 hour]. .

この場合、測定されたパルス幅は、10個のグループG1〜G10に分けられている。グループG1は、パルスの幅が500μs以上且つ550μs未満の範囲のグループであり、その発生頻度は「101」となっている。グループG2は、パルスの幅が550μs以上且つ600μs未満の範囲のグループであり、その発生頻度は「1059」となっている。   In this case, the measured pulse width is divided into 10 groups G1 to G10. The group G1 is a group whose pulse width is in the range of 500 μs or more and less than 550 μs, and the occurrence frequency is “101”. The group G2 is a group whose pulse width is in the range of 550 μs or more and less than 600 μs, and the frequency of occurrence is “1059”.

グループG3は、パルスの幅が600μs以上且つ650μs未満の範囲のグループであり、その発生頻度は「32」となっている。グループG4は、パルスの幅が650μs以上且つ700μs未満の範囲のグループであり、その発生頻度は「2045」となっている。グループG5は、パルスの幅が700μs以上且つ750μs未満の範囲のグループであり、その発生頻度は「14」となっている。グループG6は、パルスの幅が750μs以上且つ800μs未満の範囲のグループであり、その発生頻度は「4981」となっている。   The group G3 is a group whose pulse width is in the range of 600 μs or more and less than 650 μs, and the frequency of occurrence is “32”. The group G4 is a group whose pulse width is in the range of 650 μs or more and less than 700 μs, and the occurrence frequency thereof is “2045”. The group G5 is a group whose pulse width is in the range of 700 μs or more and less than 750 μs, and its occurrence frequency is “14”. Group G6 is a group whose pulse width is in the range of 750 μs or more and less than 800 μs, and the frequency of occurrence thereof is “4981”.

グループG7は、パルスの幅が800μs以上且つ850μs未満の範囲のグループであり、その発生頻度は「302」となっている。グループG8は、パルスの幅が850μs以上且つ900μs未満の範囲のグループであり、その発生頻度は「2040」となっている。グループG9は、パルスの幅が900μs以上且つ950μs未満の範囲のグループであり、その発生頻度は「10394」となっている。グループG10は、パルスの幅が950μs以上且つ1000μs未満の範囲のグループであり、その発生頻度は「0」となっている。   The group G7 is a group whose pulse width is in the range of 800 μs or more and less than 850 μs, and the frequency of occurrence is “302”. The group G8 is a group whose pulse width is in the range of 850 μs or more and less than 900 μs, and the occurrence frequency thereof is “2040”. The group G9 is a group whose pulse width is in the range of 900 μs or more and less than 950 μs, and the frequency of occurrence is “10394”. The group G10 is a group whose pulse width is in the range of 950 μs or more and less than 1000 μs, and the frequency of occurrence thereof is “0”.

上述した統計データは、接点入力信号Si1〜Si4毎に、それぞれ作成されるようになっている。パルス幅設定部9は、統計データ作成部8により作成された各統計データに基づいて、対応する診断信号Sd1〜Sd4に含まれるパルスの幅である診断パルス幅をそれぞれ設定する。具体的には、パルス幅設定部9は、次のように、統計データにおけるパルスの検出回数に基づいて診断パルス幅を設定する。   The statistical data described above is created for each of the contact input signals Si1 to Si4. The pulse width setting unit 9 sets diagnostic pulse widths, which are the widths of pulses included in the corresponding diagnostic signals Sd1 to Sd4, based on the statistical data created by the statistical data creation unit 8. Specifically, the pulse width setting unit 9 sets the diagnostic pulse width based on the number of detected pulses in the statistical data as follows.

すなわち、パルス幅設定部9は、測定されたパルス幅のグループG1〜G10のうち、発生頻度が少ないものから順に、設定する診断パルス幅の候補を選出する。このような候補を表す候補データは、例えば図3に示すようなものとなる。この場合、第1候補は、最も発生頻度の少ないグループG10のパルス幅の範囲内の値となる。この場合、クロックドリフトなどによる誤差を考慮し、該当するグループのパルス幅の範囲の中心値を、診断パルス幅の候補とするようにしている。したがって、第1候補は、グループG10のパルス幅の範囲の中心値である「975μs」となる。   That is, the pulse width setting unit 9 selects the diagnostic pulse width candidates to be set in order from the least frequently generated group G1 to G10 of the measured pulse widths. Candidate data representing such candidates is, for example, as shown in FIG. In this case, the first candidate is a value within the range of the pulse width of the group G10 with the lowest occurrence frequency. In this case, in consideration of an error due to clock drift or the like, the center value of the pulse width range of the corresponding group is set as a diagnostic pulse width candidate. Therefore, the first candidate is “975 μs” which is the center value of the pulse width range of the group G10.

また、第2候補は、2番目に発生頻度の少ないグループG5のパルス幅の範囲内の値、具体的にはグループG5のパルス幅の範囲の中心値である「725μs」となる。そして、第3候補は、3番目に発生頻度の少ないグループG3のパルス幅の範囲内の値、具体的にはグループG3のパルス幅の範囲の中心値である「625μs」となる。   The second candidate is a value within the range of the pulse width of the group G5 having the second lowest occurrence frequency, specifically, “725 μs”, which is the center value of the range of the pulse width of the group G5. The third candidate is a value within the range of the pulse width of the group G3 with the third lowest occurrence frequency, specifically, “625 μs” that is the center value of the range of the pulse width of the group G3.

なお、パルス幅設定部9は、統計データ作成部8により作成された統計データにおいて発生頻度が同じグループが複数存在する場合、パルス幅が短いグループを優先して診断パルス幅の候補として選出するようになっている。このようにすれば、パルス幅測定部7が前述したカウンタを用いた構成である場合、パルス幅を測定するための時間を短く抑えることができる。   When there are a plurality of groups having the same occurrence frequency in the statistical data created by the statistical data creation unit 8, the pulse width setting unit 9 preferentially selects a group having a short pulse width as a candidate for the diagnostic pulse width. It has become. In this way, when the pulse width measurement unit 7 is configured to use the counter described above, the time for measuring the pulse width can be kept short.

上記構成によれば、外来ノイズなどの影響により接点入力信号Si1〜Si4に現れるパルスの幅は、極めて高い確率で、診断パルス幅とは異なる幅となる。そこで、診断部6は、接点入力信号Si1〜Si4に含まれるパルスのうち、パルス幅設定部9により設定された診断パルス幅とは異なる幅を有するパルスを除外して入力回路3の故障を診断するようになっている。   According to the above configuration, the width of the pulse appearing in the contact input signals Si1 to Si4 due to the influence of external noise or the like is different from the diagnostic pulse width with a very high probability. Therefore, the diagnosis unit 6 excludes pulses having a width different from the diagnosis pulse width set by the pulse width setting unit 9 from pulses included in the contact input signals Si1 to Si4, and diagnoses a failure of the input circuit 3. It is supposed to be.

次に、本実施形態の作用について説明する。
PLC1が実際に使用される現場に設置されるとともに接続対象となる外部機器が接続された状態で起動されると、マイコン4が有する診断部6(パルス幅測定部7、統計データ作成部8およびパルス幅設定部9)により図4に示すような内容の処理が実行される。
Next, the operation of this embodiment will be described.
When the PLC 1 is installed at a site where the PLC 1 is actually used and started up in a state where an external device to be connected is connected, the diagnosis unit 6 (pulse width measurement unit 7, statistical data creation unit 8 and The processing shown in FIG. 4 is executed by the pulse width setting unit 9).

まず、ステップS100では、接点入力信号Si1〜Si4に含まれる意図しないパルスの検出と、その検出されたパルスの幅の測定が行われる。続いて、ステップS200では、検出されたパルスの検出回数と測定されたパルスの幅との関連付けが行われ、それに基づいて統計データの作成が進められる。その後、ステップS300では、統計データの作成が完了したか否かが判断される。   First, in step S100, an unintended pulse included in the contact input signals Si1 to Si4 is detected, and the width of the detected pulse is measured. Subsequently, in step S200, the number of detected pulses is correlated with the measured pulse width, and statistical data is created based on the correlation. Thereafter, in step S300, it is determined whether the creation of statistical data has been completed.

統計データの作成が完了していない場合、ステップS300で「NO」となり、ステップS100に戻り、意図しないパルスの検出と、その検出されたパルスの幅の測定とが再び行われる。一方、統計データの作成が完了している場合、ステップS300で「YES」となり、ステップS400に進む。ステップS400では、統計データに基づいて診断パルス幅が設定または更新される。なお、本実施形態では、最初にステップS400が実行されるまでの期間、診断パルス幅は、所定の初期値に設定されている。   If the creation of statistical data has not been completed, “NO” is determined in the step S300, the process returns to the step S100, and the detection of the unintended pulse and the measurement of the width of the detected pulse are performed again. On the other hand, if the creation of statistical data has been completed, “YES” is determined in the step S300, and the process proceeds to the step S400. In step S400, the diagnostic pulse width is set or updated based on the statistical data. In the present embodiment, the diagnostic pulse width is set to a predetermined initial value until the first time step S400 is executed.

ステップS400の実行後はステップS500に進み、更新タイミングが到来したか否かが判断される。更新タイミングは、前回の統計データが作成された時点から所定の更新周期が経過した時点に設定されている。なお、本実施形態では、更新周期は例えば1時間に設定されている。更新タイミングが到来すると、ステップS500で「YES」となり、ステップS100に戻る。このように、本実施形態では、統計データの作成および診断パルス幅の設定は、PLC1の起動時に行われた後、更新周期毎に行われるようになっている。   After execution of step S400, the process proceeds to step S500, where it is determined whether or not the update timing has come. The update timing is set at a time when a predetermined update cycle has elapsed from the time when the previous statistical data was created. In the present embodiment, the update cycle is set to 1 hour, for example. When the update timing comes, “YES” is determined in the step S500, and the process returns to the step S100. As described above, in the present embodiment, the creation of statistical data and the setting of the diagnostic pulse width are performed at the update cycle after the PLC 1 is started.

以上説明したように、本実施形態によれば次のような効果が得られる。
本実施形態のPLC1は、入力回路3の故障を診断する診断部6を備えており、その診断部6は、外来ノイズによる誤診断の発生を抑制するために次のような機能を有している。すなわち、診断部6は、接点入力信号Si1〜Si4に含まれる外来ノイズの影響によるパルスを検出するとともに検出されたパルスの幅を測定するパルス幅測定部7と、測定期間において検出されたパルスの検出回数と測定されたパルスの幅とを関連付けた統計データを作成する統計データ作成部8と、統計データに基づいて診断信号Sd1〜Sd4に含まれるパルスの幅である診断パルス幅を設定するパルス幅設定部9と、を備えている。
As described above, according to the present embodiment, the following effects can be obtained.
The PLC 1 of the present embodiment includes a diagnosis unit 6 that diagnoses a failure of the input circuit 3, and the diagnosis unit 6 has the following functions to suppress the occurrence of misdiagnosis due to external noise. Yes. That is, the diagnostic unit 6 detects a pulse due to the influence of external noise included in the contact input signals Si1 to Si4 and measures the width of the detected pulse, and the pulse detected in the measurement period. A statistical data creation unit 8 that creates statistical data that associates the number of detections with the measured pulse width, and a pulse that sets a diagnostic pulse width that is the width of a pulse included in the diagnostic signals Sd1 to Sd4 based on the statistical data A width setting unit 9.

この場合、統計データは、外来ノイズの影響による意図しないパルスの幅と、その幅のパルスの発生頻度が記憶されたデータとなっている。したがって、パルス幅設定部9は、その統計データに基づいて、外来ノイズの影響による意図しないパルスの幅と重複しない、または重複する頻度の少ないと考えられるパルス幅を、診断パルス幅に設定することができる。   In this case, the statistical data is data in which the width of an unintended pulse due to the influence of external noise and the frequency of occurrence of pulses of that width are stored. Therefore, based on the statistical data, the pulse width setting unit 9 sets, as the diagnostic pulse width, a pulse width that is considered not to overlap with an unintended pulse width due to the influence of external noise or is less likely to overlap. Can do.

上記構成によれば、外来ノイズなどの影響により接点入力信号Si1〜Si4に現れるパルスの幅は、高い確率で診断パルス幅とは異なる幅となる。そこで、診断部6は、接点入力信号Si1〜Si4に含まれるパルスのうち、パルス幅設定部9により設定された診断パルス幅とは異なる幅のパルスを除外して入力回路3の故障を診断する。このようにすれば、診断の回数を少なく抑えたとしても、外来ノイズなどの影響による誤診断の発生を低く抑えることができる。したがって、本実施形態によれば、入力回路3の故障診断について、故障検出の応答性を良好に維持しつつ、誤診断の発生を防止することができるという優れた効果が得られる。   According to the above configuration, the width of the pulse appearing in the contact input signals Si1 to Si4 due to the influence of external noise or the like is different from the diagnostic pulse width with high probability. Therefore, the diagnosis unit 6 diagnoses a failure of the input circuit 3 by excluding pulses having a width different from the diagnosis pulse width set by the pulse width setting unit 9 from the pulses included in the contact input signals Si1 to Si4. . In this way, even if the number of diagnoses is reduced, the occurrence of misdiagnosis due to the influence of external noise or the like can be kept low. Therefore, according to the present embodiment, it is possible to obtain an excellent effect that the fault diagnosis of the input circuit 3 can be prevented from occurring while the response of the fault detection is well maintained.

診断信号Sd1〜Sd4に重畳する可能性がある外来ノイズなどのノイズの発生状況は、PLC1が設置される環境、PLC1に接続される外部機器の有無、それら外部機器の種類などによって変化する。そこで、本実施形態のPLC1では、統計データ作成部8による統計データの作成およびパルス幅設定部9による診断パルス幅の設定は、PLC1が設置された後の起動時に行われるようになっている。このようにすれば、実際の設置環境におけるパルスの検出回数およびパルス幅の測定結果から作成された統計データに基づいて診断パルス幅が設定されるため、実際に生じる可能性が高い外来ノイズなどの影響を受け難い診断を実現することができる。   The occurrence of noise such as external noise that may be superimposed on the diagnostic signals Sd1 to Sd4 varies depending on the environment in which the PLC 1 is installed, the presence / absence of an external device connected to the PLC 1, the type of these external devices, and the like. Therefore, in the PLC 1 of the present embodiment, the creation of statistical data by the statistical data creation unit 8 and the setting of the diagnostic pulse width by the pulse width setting unit 9 are performed at startup after the PLC 1 is installed. In this way, the diagnostic pulse width is set based on the statistical data created from the pulse detection count and pulse width measurement results in the actual installation environment. Diagnosis that is not easily affected can be realized.

ただし、ノイズの発生状況は、PLC1の起動時における状況と同一の状況がそのまま維持されるわけではなく、例えば外部機器の動作状況などに応じて変化する可能性がある。そのため、診断パルス幅を固定の値とした場合には、次のような問題が生じる。例えば、当初はノイズの影響による意図しないパルスの幅と重複し難いパルス幅であるとして診断信号Sd1の診断パルス幅に設定されたパルス幅W1が、その後のノイズの発生状況の変化に伴い、ノイズの影響による意図しないパルスの幅と重複し易くなったとする。   However, the noise generation state is not maintained as it is when the PLC 1 is started, and may change depending on, for example, the operation state of the external device. Therefore, when the diagnostic pulse width is set to a fixed value, the following problem occurs. For example, the pulse width W1 that is initially set to the diagnostic pulse width of the diagnostic signal Sd1 as a pulse width that hardly overlaps with the width of an unintended pulse due to the influence of noise is changed according to the subsequent change in the noise generation state. It is easy to overlap with an unintended pulse width due to the influence of.

そうすると、図5に示すように、時刻t1において入力回路3に故障が発生して接点入力信号Si1をLレベルにすることができなくなった場合でも、以降の診断周期において、外来ノイズの影響によりパルス幅W1のパルスが現れる可能性が高く、その結果、入力回路3が故障していると診断されるまでの時間が延びてしまう。   Then, as shown in FIG. 5, even when a failure occurs in the input circuit 3 at the time t1 and the contact input signal Si1 cannot be set to the L level, the pulse is affected by the external noise in the subsequent diagnosis cycle. There is a high possibility that a pulse with a width W1 will appear, and as a result, the time until the input circuit 3 is diagnosed as having a failure is increased.

そこで、本実施形態のPLC1では、統計データの作成および診断パルス幅の設定は、PLC1の起動時に行われた後、所定の更新周期毎に行われるようになっている。このようにすれば、診断パルス幅は、更新周期毎に、その時点におけるノイズの発生状況に応じて最適なパルス幅に更新されることとなる。例えば、図6に示すように、例えば起動時に設定されたパルス幅W1が、その後のノイズの発生状況の変化に伴い、ノイズの影響による意図しないパルスの幅と重複し易くなったとしても、次の更新タイミングtaにおいて重複し難いパルス幅W10へと変更される。   Therefore, in the PLC 1 of the present embodiment, the creation of statistical data and the setting of the diagnostic pulse width are performed at a predetermined update cycle after being performed when the PLC 1 is started. In this way, the diagnostic pulse width is updated to the optimum pulse width in accordance with the noise generation status at that time for each update period. For example, as shown in FIG. 6, even if the pulse width W1 set at the time of start-up becomes more likely to overlap with the width of an unintended pulse due to the influence of noise, At the update timing ta, the pulse width is changed to a pulse width W10 that is difficult to overlap.

その結果、図7に示すように、時刻t1において入力回路3に故障が発生して接点入力信号Si1をLレベルにすることができなくなった場合には、次の診断周期において、外来ノイズの影響によりパルス幅W1のパルスが現れたとしても、診断パルス幅W10のパルスが現れないことから、直ちに入力回路3が故障していると診断することができる。つまり、この場合、診断パルス幅の更新を行わない場合に比べ、入力回路3の故障診断に要する時間を短縮することができる。   As a result, as shown in FIG. 7, when a failure occurs in the input circuit 3 at the time t1 and the contact input signal Si1 cannot be set to the L level, the influence of external noise in the next diagnostic cycle. Even if a pulse with a pulse width W1 appears, a pulse with a diagnostic pulse width W10 does not appear, so that it is possible to immediately diagnose that the input circuit 3 has failed. That is, in this case, the time required for the failure diagnosis of the input circuit 3 can be shortened as compared with the case where the diagnosis pulse width is not updated.

このように、統計データの作成および診断パルス幅の設定を所定の更新周期毎に行うようにすれば、外部機器の動作状況などに応じて変化する外来ノイズなどのノイズの発生状況に応じて、診断パルス幅が最適な値へと更新されるため、外来ノイズなどの影響を一層受け難い診断を実現することができる。   In this way, if the creation of statistical data and the setting of the diagnostic pulse width are performed every predetermined update cycle, according to the occurrence status of noise such as external noise that changes according to the operating status of the external device, Since the diagnostic pulse width is updated to an optimum value, it is possible to realize a diagnosis that is less affected by external noise and the like.

パルス幅設定部9は、統計データにおけるパルスの検出回数に基づいて診断パルス幅を設定する。統計データにおけるパルスの検出回数は、外来ノイズの発生状況に変化が無い、または変化が小さいと仮定すれば、そのパルスの幅と同様の幅を持つ意図しないパルスが発生する頻度に比例すると考えられる。したがって、上述したように診断パルス幅を設定すれば、外来ノイズなどの影響による意図しないパルスの幅と重複しない、または重複する頻度の少ないパルス幅を、診断パルス幅に設定することができ、その結果、外来ノイズなどの影響による誤診断の発生を一層抑制することができる。   The pulse width setting unit 9 sets a diagnostic pulse width based on the number of detected pulses in the statistical data. The number of detected pulses in the statistical data is considered to be proportional to the frequency of occurrence of an unintended pulse having the same width as that of the pulse, assuming that there is no change in the occurrence of external noise or the change is small. . Therefore, if the diagnostic pulse width is set as described above, a pulse width that does not overlap with an unintended pulse width due to the influence of external noise or the like, or a pulse width that does not frequently overlap can be set as the diagnostic pulse width. As a result, the occurrence of misdiagnosis due to the influence of external noise and the like can be further suppressed.

(第2実施形態)
以下、第2実施形態について図8〜図10を参照して説明する。
図8に示すように、本実施形態のPLC21が備えるマイコン22は、第1実施形態のマイコン4に対し、診断部6に代えて診断部23を備えている点が異なる。診断部23は、診断部6が備える各構成に加え、設定された診断パルス幅と同じパルス幅を有するノイズに起因するパルスが検出されると診断パルス幅を変更するパルス幅変更部24を備えている。
(Second Embodiment)
The second embodiment will be described below with reference to FIGS.
As shown in FIG. 8, the microcomputer 22 included in the PLC 21 of the present embodiment is different from the microcomputer 4 of the first embodiment in that a diagnosis unit 23 is provided instead of the diagnosis unit 6. In addition to the components included in the diagnosis unit 6, the diagnosis unit 23 includes a pulse width changing unit 24 that changes the diagnosis pulse width when a pulse caused by noise having the same pulse width as the set diagnosis pulse width is detected. ing.

この場合、診断信号出力部5は、診断周期毎に診断パルス幅を持つ1つのパルスが含まれた診断信号Sd1〜Sd4を出力するようになっている。したがって、診断周期内の接点入力信号Si1〜Si4に診断パルス幅を持つパルスが複数含まれている場合、設定された診断パルス幅と同じパルス幅を有するノイズに起因するパルスが重畳していると考えられる。そこで、パルス幅変更部24は、同一の診断周期内の接点入力信号Si1〜Si4に診断パルス幅を持つパルスが複数含まれていることを条件として診断信号Sd1〜Sd4の診断パルス幅を変更するようになっている。   In this case, the diagnostic signal output unit 5 is configured to output diagnostic signals Sd1 to Sd4 including one pulse having a diagnostic pulse width for each diagnostic period. Therefore, when a plurality of pulses having a diagnostic pulse width are included in the contact input signals Si1 to Si4 within the diagnostic cycle, pulses caused by noise having the same pulse width as the set diagnostic pulse width are superimposed. Conceivable. Therefore, the pulse width changing unit 24 changes the diagnostic pulse width of the diagnostic signals Sd1 to Sd4 on condition that the contact input signals Si1 to Si4 within the same diagnostic cycle include a plurality of pulses having the diagnostic pulse width. It is like that.

パルス幅変更部24は、統計データ作成部8により作成された各統計データに基づいて、対応する診断信号Sd1〜Sd4の診断パルス幅をそれぞれ変更する。具体的には、パルス幅変更部24は、次のように、統計データにおけるパルスの検出回数に基づいて診断パルス幅を変更する。   The pulse width changing unit 24 changes the diagnostic pulse widths of the corresponding diagnostic signals Sd1 to Sd4 based on the statistical data created by the statistical data creating unit 8, respectively. Specifically, the pulse width changing unit 24 changes the diagnostic pulse width based on the number of detected pulses in the statistical data as follows.

すなわち、パルス幅変更部24は、例えば図2に示した統計データにおけるパルス幅のグループG1〜G10のうち、発生頻度が少ないものから順に、変更する診断パルス幅の候補を選出する。ただし、パルス幅変更部24は、この候補から、現在設定されている診断パルス幅に対応するグループは除外する。この場合の候補データは、例えば図9に示すようなものとなる。   That is, for example, the pulse width changing unit 24 selects candidates of diagnostic pulse widths to be changed in order from the least frequently occurring among the pulse width groups G1 to G10 in the statistical data shown in FIG. However, the pulse width changing unit 24 excludes the group corresponding to the currently set diagnostic pulse width from this candidate. The candidate data in this case is, for example, as shown in FIG.

この場合、第1候補は、2番目に発生頻度の少ないグループG5のパルス幅の範囲の中心値である「725μs」となる。また、第2候補は、3番目に発生頻度の少ないグループG3のパルス幅の範囲の中心値である「625μs」となる。そして、第3候補は、4番目に発生頻度の少ないグループG1のパルス幅の範囲の中心値である「525μs」となる。   In this case, the first candidate is “725 μs”, which is the center value of the range of the pulse width of the group G5 having the second lowest occurrence frequency. The second candidate is “625 μs”, which is the center value of the pulse width range of the group G3, which is the third least frequently generated. The third candidate is “525 μs”, which is the center value of the pulse width range of the group G1 having the fourth lowest occurrence frequency.

次に、本実施形態の作用について説明する。
図10に示すように、本実施形態の診断部23が実行する処理は、第1実施形態の診断部6が実行する処理に対し、ステップS600およびS700が追加されている。ステップS600は、診断パルス幅が設定(更新)された後に未だ更新タイミングが到来していない場合、つまりステップS500で「NO」の場合に実行される。
Next, the operation of this embodiment will be described.
As shown in FIG. 10, steps S600 and S700 are added to the process executed by the diagnosis unit 23 of the present embodiment, compared to the process executed by the diagnosis unit 6 of the first embodiment. Step S600 is executed when the update timing has not yet arrived after the diagnostic pulse width is set (updated), that is, when “NO” in step S500.

ステップS600では、同一の診断周期内の接点入力信号Si1〜Si4に診断パルス幅を持つパルスが複数含まれているか否かに基づいて、診断パルス幅の変更の要否が判断される。同一の診断周期内の接点入力信号Si1〜Si4に診断パルス幅を持つパルスが複数含まれている場合、診断パルス幅の変更が必要であることから、ステップS600で「YES」となり、ステップS700に進む。   In step S600, whether or not the diagnostic pulse width needs to be changed is determined based on whether or not the contact input signals Si1 to Si4 within the same diagnostic cycle include a plurality of pulses having the diagnostic pulse width. If the contact input signals Si1 to Si4 within the same diagnostic cycle include a plurality of pulses having a diagnostic pulse width, it is necessary to change the diagnostic pulse width. Therefore, “YES” is determined in the step S600, and the process returns to the step S700. move on.

ステップS700では、統計データに基づいて診断パルス幅が変更される。そして、ステップS700の実行後は、ステップS500に戻る。一方、同一の診断周期内の接点入力信号Si1〜Si4に診断パルス幅を持つパルスが複数含まれていない場合、診断パルス幅の変更が不要であることから、ステップS600で「NO」となり、ステップS500に戻る。   In step S700, the diagnostic pulse width is changed based on the statistical data. And after execution of step S700, it returns to step S500. On the other hand, if the contact input signals Si1 to Si4 within the same diagnostic cycle do not include a plurality of pulses having a diagnostic pulse width, it is not necessary to change the diagnostic pulse width. Return to S500.

前述したように、ノイズの発生状況は、外部機器の動作状態などの周囲環境に応じて変化する。そのため、外部機器の動作状態などが比較的短い周期で変化するような用途にPLC21が用いられる場合には、ノイズの発生状況の変化の周期も短くなる可能性がある。更新周期毎に統計データの作成および診断パルス幅の設定を行えば、このような変化に対応することができると考えられるが、更新周期がノイズの発生状況の変化の周期よりも長くなる場合には、対応が不十分になる可能性がある。なお、想定されるノイズの発生状況の変化の周期よりも更新周期を十分に短く設定すれば、このような問題の発生が解消されると考えられるが、更新周期をむやみに短くすると、統計データの作成回数が増え、その作成に係るマイコン22の処理負荷の増大などの問題が生じる。   As described above, the noise generation state changes according to the surrounding environment such as the operating state of the external device. Therefore, when the PLC 21 is used for an application in which the operating state of the external device changes at a relatively short cycle, there is a possibility that the cycle of change in the noise generation state may be shortened. If statistical data is created and the diagnostic pulse width is set for each update cycle, it is considered that such changes can be accommodated, but when the update cycle is longer than the cycle of the change in the noise generation status. May become inadequate. It should be noted that if the update cycle is set sufficiently shorter than the expected change cycle of noise generation, the occurrence of such a problem is considered to be eliminated, but if the update cycle is shortened excessively, statistical data The number of times of creation increases, causing problems such as an increase in processing load on the microcomputer 22 related to the creation.

そこで、本実施形態のPLC21では、診断部23は、同一の診断周期内の接点入力信号Si1〜Si4に診断パルス幅を持つパルスが複数含まれていることを条件として診断信号Sd1〜Sd4の診断パルス幅を変更するパルス幅変更部24を備えている。つまり、本実施形態では、ノイズの発生状況の変化により、当初設定された診断パルス幅と同様のパルス幅を持つ意図しないパルスが発生するようになると、診断パルス幅が変更されるようになっている。   Therefore, in the PLC 21 of the present embodiment, the diagnosis unit 23 diagnoses the diagnosis signals Sd1 to Sd4 on condition that the contact input signals Si1 to Si4 within the same diagnosis cycle include a plurality of pulses having a diagnosis pulse width. A pulse width changing unit 24 for changing the pulse width is provided. In other words, in the present embodiment, when an unintended pulse having a pulse width similar to the initially set diagnostic pulse width is generated due to a change in the noise generation state, the diagnostic pulse width is changed. Yes.

このように、上記構成では、ノイズの発生状況の変化に応じて、診断パルス幅が動的に変更されるようになっている。このようにすれば、周囲環境が時々刻々と変化するような場合でも、その変化に合わせて、診断パルス幅を、ノイズによる誤診断が生じ難いようなパルス幅へと変更することが可能となる。したがって、上記構成によれば、周囲環境が比較的短い周期で変化する用途にPLC21が用いられる場合でも、外来ノイズなどの影響による誤診断の発生を抑制することができる。つまり、本実施形態によれば、環境変化に対するノイズ耐性が向上するという効果が得られる。   As described above, in the above configuration, the diagnostic pulse width is dynamically changed according to the change in the noise generation state. In this way, even when the surrounding environment changes from moment to moment, the diagnostic pulse width can be changed to a pulse width that is unlikely to cause erroneous diagnosis due to noise. . Therefore, according to the said structure, generation | occurrence | production of the misdiagnosis by the influence of an external noise etc. can be suppressed even when PLC21 is used for the use whose surrounding environment changes with a comparatively short period. That is, according to this embodiment, the effect that the noise tolerance with respect to an environmental change improves is acquired.

パルス幅変更部24は、統計データにおけるパルスの検出回数に基づいて診断パルス幅を変更する。前述したように、統計データにおけるパルスの検出回数は、外来ノイズの発生状況に変化が無い、または変化が小さいと仮定すれば、そのパルスの幅と同様の幅を持つ意図しないパルスが発生する頻度に比例すると考えられる。したがって、上述したように診断パルス幅を変更すれば、外来ノイズなどの影響による意図しないパルスの幅と重複しない、または重複する頻度の少ないパルス幅を、診断パルス幅に設定することができ、その結果、外来ノイズなどの影響による誤診断の発生を一層抑制することができる。   The pulse width changing unit 24 changes the diagnostic pulse width based on the number of detected pulses in the statistical data. As described above, the frequency of detection of pulses in statistical data is the frequency of occurrence of unintended pulses having the same width as that of the pulses, assuming that there is no change in the occurrence of external noise or the change is small. It is thought that it is proportional to Therefore, if the diagnostic pulse width is changed as described above, a pulse width that does not overlap with an unintended pulse width due to the influence of external noise or the like, or a pulse width that rarely overlaps, can be set as the diagnostic pulse width. As a result, the occurrence of misdiagnosis due to the influence of external noise and the like can be further suppressed.

(その他の実施形態)
なお、本発明は上記し且つ図面に記載した各実施形態に限定されるものではなく、その要旨を逸脱しない範囲で任意に変形、組み合わせ、あるいは拡張することができる。
上記各実施形態で示した数値などは例示であり、それに限定されるものではない。
(Other embodiments)
In addition, this invention is not limited to each embodiment described above and described in drawing, In the range which does not deviate from the summary, it can change, combine or expand arbitrarily.
The numerical values and the like shown in the above embodiments are examples and are not limited thereto.

統計データの作成および診断パルス幅の設定を実行するタイミングは、上記各実施形態において示したタイミングに限らずともよく、任意のタイミングで実行してもよい。
上記各実施形態では、統計データ作成部8としての機能をPLC1、21の内部に設けられたマイコン4、22により実現した構成を例示したが、これに限らずともよい。例えば、PLC1、21と通信可能な外部機器により、統計データ作成部8としての機能を実現してもよい。
The timing of creating the statistical data and setting the diagnostic pulse width is not limited to the timing shown in the above embodiments, and may be executed at an arbitrary timing.
In each of the above embodiments, the configuration in which the function as the statistical data creation unit 8 is realized by the microcomputers 4 and 22 provided in the PLCs 1 and 21 is illustrated, but the configuration is not limited thereto. For example, the function as the statistical data creation unit 8 may be realized by an external device that can communicate with the PLCs 1 and 21.

パルス幅測定部7は、接点入力信号Si1〜Si4に含まれるすべてのパルスを検出するとともに、その検出されたパルスの幅を測定してもよい。この場合、統計データには、診断のために意図的に含まれるパルスおよび外来ノイズなどの影響による意図しないパルスの双方が含まれる。しかし、診断のために意図的に含まれるパルスが測定期間中に何回出力されているか、およびそのパルスの幅は既知である。そのため、接点入力信号Si1〜Si4に含まれるパルスから、診断のために意図的に含まれたパルスを識別することは容易である。したがって、この場合、作成された統計データから診断のために意図的に含まれるパルスに関するデータを除外すればよい。あるいは、診断のために意図的に含まれるパルスに関するデータを除外して統計データを作成すればよい。   The pulse width measurement unit 7 may detect all the pulses included in the contact input signals Si1 to Si4 and measure the width of the detected pulse. In this case, the statistical data includes both a pulse intentionally included for diagnosis and an unintended pulse due to an influence such as external noise. However, the number of pulses intentionally included for diagnosis is output during the measurement period and the width of the pulse is known. Therefore, it is easy to identify a pulse intentionally included for diagnosis from pulses included in the contact input signals Si1 to Si4. Therefore, in this case, data relating to pulses intentionally included for diagnosis may be excluded from the generated statistical data. Alternatively, statistical data may be created by excluding data related to pulses intentionally included for diagnosis.

統計データ作成部8は、グループ毎のパルス幅の範囲を変更することができるようにしてもよい。外来ノイズの特徴として、同程度のパルス幅のノイズが群発することが挙げられる。そのため、発生頻度が高いパルス幅の群と群との間に、発生頻度が極めて低いパルス幅の群が存在する可能性がある。上述したように、グループ毎のパルス幅の範囲を変更することで、このような発生頻度が低いパルス幅の群を発見することができる可能性がある。このようにすれば、診断パルス幅として、外来ノイズとして発生する頻度が少ないパルス幅に設定することができる。   The statistical data creation unit 8 may change the pulse width range for each group. As a feature of external noise, noise having a similar pulse width is swarmed. For this reason, there may be a group having a pulse width with a very low occurrence frequency between the groups having a pulse width with a high occurrence frequency. As described above, by changing the range of the pulse width for each group, there is a possibility that a group of such pulse widths with low occurrence frequency can be found. In this way, the diagnostic pulse width can be set to a pulse width that is less frequently generated as external noise.

上述したグループ毎のパルス幅の範囲は、例えば各グループのパルス幅の範囲を所定値だけシフトするようにすればよい。例えば、上記各実施形態では、グループG1は、500μs〜550μsの範囲であったが、これを「+25μs」だけシフトし、525μ〜575μsの範囲に変更する、といった具合である。   The above-described pulse width range for each group may be shifted, for example, by a predetermined value from the pulse width range for each group. For example, in each of the above embodiments, the group G1 was in the range of 500 μs to 550 μs, but this is shifted by “+25 μs” and changed to the range of 525 μs to 575 μs.

また、統計データ作成部8は、グループの少なくとも1つの検出回数がゼロとなるようにグループを設定するようにしてもよい。前述した通り、外来ノイズの特徴として、発生頻度が高いパルス幅の群と群との間に、発生頻度が極めて低いパルス幅の群が存在する可能性がある。上記構成によれば、このような発生頻度が極めて低いパルス幅の群が上記グループの1つとして設定されることになり、その結果、診断パルス幅として、外来ノイズとして発生する頻度が少ないパルス幅に設定することができる。   Further, the statistical data creation unit 8 may set the group so that at least one detection number of the group becomes zero. As described above, as a feature of external noise, there is a possibility that a group having a pulse width with a very low occurrence frequency exists between groups having a pulse width with a high occurrence frequency. According to the above configuration, a group having such a pulse width that is extremely low in frequency is set as one of the above groups, and as a result, a pulse width that is less frequently generated as external noise as a diagnostic pulse width. Can be set to

1、21…PLC、3…入力回路、5…診断信号出力部、6、23…診断部、7…パルス幅測定部、8…統計データ作成部、9…パルス幅設定部、24…パルス幅変更部、C1〜C4…接点。   DESCRIPTION OF SYMBOLS 1,21 ... PLC, 3 ... Input circuit, 5 ... Diagnostic signal output part, 6, 23 ... Diagnostic part, 7 ... Pulse width measurement part, 8 ... Statistic data creation part, 9 ... Pulse width setting part, 24 ... Pulse width Change part, C1-C4 ... contact.

Claims (7)

外部に設けられた常閉型の接点の一方の端子の信号を入力し、前記接点の開閉状態に対応したレベルを有する接点入力信号を内部回路へと出力する入力回路と、
前記接点の他方の端子に対し、前記接点の開放状態に対応したレベルに変化するパルスが所定の診断周期毎に含まれる診断信号を出力する診断信号出力部と、
前記接点入力信号に含まれる前記パルスに基づいて前記入力回路の故障を診断する診断部と、
を備え、
前記診断部は、
前記接点入力信号に含まれる前記パルスを検出するとともに、その検出されたパルスの幅を測定するパルス幅測定部と、
所定の測定期間において前記パルス幅測定部により検出された前記パルスの検出回数と測定された前記パルスの幅とを関連付けた統計データを作成する統計データ作成部と、
前記統計データに基づいて前記診断信号に含まれる前記パルスの幅である診断パルス幅を設定するパルス幅設定部と、
を備え、
前記接点入力信号に含まれる前記パルスのうち前記診断パルス幅とは異なる幅の前記パルスを除外して前記入力回路の故障を診断する制御装置。
An input circuit that inputs a signal of one terminal of a normally closed contact provided outside and outputs a contact input signal having a level corresponding to the open / closed state of the contact to an internal circuit;
A diagnostic signal output unit that outputs a diagnostic signal including a pulse that changes to a level corresponding to an open state of the contact with respect to the other terminal of the contact at every predetermined diagnosis cycle;
A diagnostic unit for diagnosing a failure of the input circuit based on the pulse included in the contact input signal;
With
The diagnostic unit
A pulse width measuring unit for detecting the pulse included in the contact input signal and measuring a width of the detected pulse;
A statistical data creating unit that creates statistical data that associates the number of detected pulses detected by the pulse width measuring unit with a measured pulse width in a predetermined measurement period;
A pulse width setting unit that sets a diagnostic pulse width that is a width of the pulse included in the diagnostic signal based on the statistical data;
With
A control device for diagnosing a failure of the input circuit by excluding the pulse having a width different from the diagnostic pulse width from the pulses included in the contact input signal.
前記統計データ作成部による前記統計データの作成および前記パルス幅設定部による前記診断パルス幅の設定は、装置の起動時に行われるとともに、その後、所定の更新周期毎に行われる請求項1に記載の制御装置。   The creation of the statistical data by the statistical data creation unit and the setting of the diagnostic pulse width by the pulse width setting unit are performed when the apparatus is started up, and thereafter, performed every predetermined update cycle. Control device. 前記パルス幅設定部は、前記統計データにおける前記パルスの検出回数に基づいて前記診断パルス幅を設定する請求項1または2に記載の制御装置。   The control device according to claim 1, wherein the pulse width setting unit sets the diagnostic pulse width based on the number of detections of the pulse in the statistical data. 前記診断信号出力部は、前記診断周期毎に前記診断パルス幅を持つ1つの前記パルスが含まれた前記診断信号を出力し、
前記診断部は、
同一の前記診断周期内の前記接点入力信号に前記診断パルス幅を持つ前記パルスが複数含まれていることを条件として前記診断信号の前記診断パルス幅を変更するパルス幅変更部を備えている請求項1から3のいずれか一項に記載の制御装置。
The diagnostic signal output unit outputs the diagnostic signal including one pulse having the diagnostic pulse width for each diagnostic cycle,
The diagnostic unit
A pulse width changing unit that changes the diagnostic pulse width of the diagnostic signal on condition that the contact input signal within the same diagnostic cycle includes a plurality of pulses having the diagnostic pulse width. Item 4. The control device according to any one of Items 1 to 3.
前記パルス幅変更部は、前記統計データにおける前記パルスの検出回数に基づいて前記診断パルス幅を変更する請求項4に記載の制御装置。   The control device according to claim 4, wherein the pulse width changing unit changes the diagnostic pulse width based on the number of detection times of the pulse in the statistical data. 前記統計データ作成部は、
前記パルス幅測定部により測定された前記パルスの幅を複数のグループに分け、それらグループ毎の前記検出回数が記録されたものを前記統計データとして作成するものであり、
前記グループ毎のパルス幅の範囲を変更することができる請求項1から5のいずれか一項に記載の制御装置。
The statistical data creation unit
The pulse width measured by the pulse width measurement unit is divided into a plurality of groups, and the number of detection times for each group is recorded as the statistical data.
The control device according to claim 1, wherein a range of a pulse width for each group can be changed.
前記統計データ作成部は、
前記パルス幅測定部により測定された前記パルスの幅を複数のグループに分け、それらグループ毎の前記検出回数が記録されたものを前記統計データとして作成するものであり、
前記グループの少なくとも1つの前記検出回数がゼロとなるように前記グループを設定する請求項1から5のいずれか一項に記載の制御装置。
The statistical data creation unit
The pulse width measured by the pulse width measurement unit is divided into a plurality of groups, and the number of detection times for each group is recorded as the statistical data.
The control device according to any one of claims 1 to 5, wherein the group is set so that the number of detection times of at least one of the group is zero.
JP2017182696A 2017-09-22 2017-09-22 Control device Active JP6834883B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017182696A JP6834883B2 (en) 2017-09-22 2017-09-22 Control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017182696A JP6834883B2 (en) 2017-09-22 2017-09-22 Control device

Publications (2)

Publication Number Publication Date
JP2019057239A true JP2019057239A (en) 2019-04-11
JP6834883B2 JP6834883B2 (en) 2021-02-24

Family

ID=66107703

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017182696A Active JP6834883B2 (en) 2017-09-22 2017-09-22 Control device

Country Status (1)

Country Link
JP (1) JP6834883B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6735953B1 (en) * 2019-07-11 2020-08-05 三菱電機株式会社 Test pulse width calculation device, control device, test pulse width calculation method and program
JP2021022206A (en) * 2019-07-29 2021-02-18 株式会社デンソーウェーブ Input module for industrial control device
JP6880353B1 (en) * 2020-10-14 2021-06-02 三菱電機株式会社 External signal input / output unit, control system, machine learning device and inference device
JP7233616B1 (en) * 2022-03-04 2023-03-06 三菱電機株式会社 PULSE WIDTH DISPLAY SYSTEM AND PULSE WIDTH DISPLAY METHOD

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010250692A (en) * 2009-04-17 2010-11-04 Mitsubishi Electric Corp Safety monitoring input device
JP2011145988A (en) * 2010-01-18 2011-07-28 Toshiba Corp Safety input device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010250692A (en) * 2009-04-17 2010-11-04 Mitsubishi Electric Corp Safety monitoring input device
JP2011145988A (en) * 2010-01-18 2011-07-28 Toshiba Corp Safety input device

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6735953B1 (en) * 2019-07-11 2020-08-05 三菱電機株式会社 Test pulse width calculation device, control device, test pulse width calculation method and program
WO2021005785A1 (en) * 2019-07-11 2021-01-14 三菱電機株式会社 Test pulse width calculation device, control device, test pulse width calculation method, and program
CN114127648A (en) * 2019-07-11 2022-03-01 三菱电机株式会社 Test pulse width calculation device, control device, test pulse width calculation method, and program
US20220121193A1 (en) * 2019-07-11 2022-04-21 Mitsubishi Electric Corporation Test pulse width calculation device, control device, test pulse width calculation method, and program
CN114127648B (en) * 2019-07-11 2023-09-29 三菱电机株式会社 Test pulse width calculation device, control device and test pulse width calculation method
JP2021022206A (en) * 2019-07-29 2021-02-18 株式会社デンソーウェーブ Input module for industrial control device
JP6880353B1 (en) * 2020-10-14 2021-06-02 三菱電機株式会社 External signal input / output unit, control system, machine learning device and inference device
WO2022079838A1 (en) * 2020-10-14 2022-04-21 三菱電機株式会社 External signal input/output unit, control system, machine learning device, and inference device
CN115335785A (en) * 2020-10-14 2022-11-11 三菱电机株式会社 External signal input/output unit, control system, machine learning device, and estimation device
JP7233616B1 (en) * 2022-03-04 2023-03-06 三菱電機株式会社 PULSE WIDTH DISPLAY SYSTEM AND PULSE WIDTH DISPLAY METHOD
WO2023166720A1 (en) * 2022-03-04 2023-09-07 三菱電機株式会社 Input/output device, pulse width display system, and pulse width display method

Also Published As

Publication number Publication date
JP6834883B2 (en) 2021-02-24

Similar Documents

Publication Publication Date Title
JP6834883B2 (en) Control device
US7426449B2 (en) Sensor fusion using self evaluating process sensors
JP4334572B2 (en) Process measurement device with extended hardware error detection
JP2008250594A (en) Device diagnostic method, device-diagnosing module and device with device-diagnosing module mounted thereon
US11531048B2 (en) Voltage diagnostic circuit
US11099105B2 (en) Data processing method, data processing device, and non-transitory computer-readable recording medium having recorded thereon data processing program
JP2018173948A (en) Malfunction diagnosis device, malfunction diagnosis method, and computer program
US8762792B2 (en) Event monitor having switch matrix, separate counter, and compare circuitry
TWI755794B (en) Abnormality diagnosis method, abnormality diagnosis apparatus, and abnormality diagnosis program
US20120074785A1 (en) Method for Operating a Redundant System and System Therefor
Abdelwahed et al. System diagnosis using hybrid failure propagation graphs
JP2021022206A (en) Input module for industrial control device
US6658606B1 (en) Method and device for checking an error control procedure of a circuit
EP2278571A1 (en) Field device
JP4431883B2 (en) Transmitter
JP5740791B2 (en) Digital output circuit
JP2007286707A (en) Equipment diagnostic system
JP6757182B2 (en) Vehicle electronic control unit and timer diagnostic method
US10528417B2 (en) Clock signal inspection device, plant monitoring controller, and method for diagnosing clock signal inspection device
JP6906719B2 (en) Input device and input diagnostic method
JP4835207B2 (en) Temperature transmitter
JP6660818B2 (en) Control device
JP2007328805A (en) Unwanted event detecting device
US9903907B2 (en) Electronic system and method for testing capacitive circuit lines
CN116301432A (en) Touch recognition processing method, system, server and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200207

TRDD Decision of grant or rejection written
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20201224

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20210105

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210118

R150 Certificate of patent or registration of utility model

Ref document number: 6834883

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250