JP2009230722A - Counter system - Google Patents

Counter system Download PDF

Info

Publication number
JP2009230722A
JP2009230722A JP2008078816A JP2008078816A JP2009230722A JP 2009230722 A JP2009230722 A JP 2009230722A JP 2008078816 A JP2008078816 A JP 2008078816A JP 2008078816 A JP2008078816 A JP 2008078816A JP 2009230722 A JP2009230722 A JP 2009230722A
Authority
JP
Japan
Prior art keywords
input
unit
central processing
count
detection device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2008078816A
Other languages
Japanese (ja)
Inventor
Tsutomu Shiroi
努 城井
Yoichi Tanaka
陽一 田中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Electric Works Co Ltd
Original Assignee
Panasonic Electric Works Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Electric Works Co Ltd filed Critical Panasonic Electric Works Co Ltd
Priority to JP2008078816A priority Critical patent/JP2009230722A/en
Publication of JP2009230722A publication Critical patent/JP2009230722A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To attain count processing using many input signals. <P>SOLUTION: In configuration including a central processing unit 1 and a detector 2, a detection part 21 of the detector 2 detects predetermined edges of the input signals S1-Sn input via a plurality of input ports 20 as effective edges according to a count processing system by each of the input signals S1-Sn. A communication control part 23 transmits information about the effective edges from a sub side input/output interface 22 to the central processing unit 1. A communication control part 11 of the central processing unit 1 receives the information about the effective edges from a main side input/output interface 10. A count part 12 performs the count processing according to the count processing system using the effective edges detected by the detection part 21 to update a count value. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、異なる入力信号を用いてカウント値を求めるカウンタシステムに関するものである。   The present invention relates to a counter system for obtaining a count value using different input signals.

カウント値を求めるカウンタは、例えば機器制御を行うPLCなど、さまざまな用途に用いられている。例えば自動昇降機の場合、カウンタによるカウント値が大きくなるにつれて上方に上がっていく制御が行われている。また、回転モータの場合、1回転ごとにカウンタがカウント値を1ずつ増やすことによってモータの回転数を制御している。   A counter for obtaining a count value is used in various applications such as a PLC that performs device control. For example, in the case of an automatic elevator, control is performed so as to increase upward as the count value by the counter increases. In the case of a rotary motor, the counter controls the number of rotations of the motor by incrementing the count value by one for each rotation.

従来、上記カウンタの機能を全て中央処理装置が有していた(例えば、特許文献1参照)。例えば、図11に示すように、中央処理装置7は、異なる入力信号S1〜Snが送信される入力線L1〜Lnが接続され、上記入力信号S1〜Snを用いて、予め設定されたカウント処理方式(入力方式)にしたがってカウント処理を行ってカウント値を求める。   Conventionally, the central processing unit has all the functions of the counter (for example, see Patent Document 1). For example, as shown in FIG. 11, the central processing unit 7 is connected to input lines L1 to Ln to which different input signals S1 to Sn are transmitted, and uses the input signals S1 to Sn to perform preset count processing. Count processing is performed according to a method (input method) to obtain a count value.

上記カウント処理方式には、図12に示すように、単相入力方式(図12(a))、二相入力方式(図12(b))、個別入力方式(図12(c))、方向判別入力方式(図12(d))などがある。   As shown in FIG. 12, the count processing method includes a single-phase input method (FIG. 12 (a)), a two-phase input method (FIG. 12 (b)), an individual input method (FIG. 12 (c)), and a direction. There is a discrimination input method (FIG. 12D).

単相入力方式は、図12(a)に示すように、1つの入力信号の立上りエッジ(又は立下りエッジ)が検出されるごとに、カウント値を1ずつ増やしてカウントする方式である。   As shown in FIG. 12A, the single-phase input method is a method in which the count value is incremented by one every time a rising edge (or falling edge) of one input signal is detected.

二相入力方式は、図12(b)に示すように、2つの入力信号を用いてカウントする方式であり、一方(A相)の入力信号がオフ状態であるときに、他方(B相)の入力信号の立下りエッジが検出されるとカウント値を1増やし、B相の入力信号の立上りエッジが検出されるとカウント値を1減らすようにカウントする。A相の入力信号がオン状態であるときは、B相の入力信号のエッジは検出されない。   As shown in FIG. 12B, the two-phase input method is a method of counting using two input signals, and when one (A phase) input signal is in an OFF state, the other (B phase). When the falling edge of the input signal is detected, the count value is increased by 1. When the rising edge of the B-phase input signal is detected, the count value is decreased by 1. When the A-phase input signal is in the ON state, the edge of the B-phase input signal is not detected.

個別入力方式は、図12(c)に示すように、2つの入力信号を用いてカウントする方式であり、一方(A相)の入力信号の立上りエッジが検出されるとカウント値を1増やし、他方(B相)の入力信号の立上りエッジが検出されるとカウント値を1減らすようにカウントする方式である。   The individual input method is a method of counting using two input signals as shown in FIG. 12 (c), and when the rising edge of one (A phase) input signal is detected, the count value is increased by 1, When the rising edge of the other (B phase) input signal is detected, the count value is counted so as to be reduced by one.

方向判別方式は、図12(d)に示すように、2つの入力信号を用いてカウントする方式であり、一方(A相)の入力信号の立上りエッジが検出されたときに、他方(B相)の入力信号がオフ状態であるとカウント値を1増やし、B相の入力信号がオン状態であるとカウント値を1減らすようにカウントする方式である。
特開2001−216155号公報
The direction discrimination method is a method of counting using two input signals as shown in FIG. 12 (d). When a rising edge of one (A phase) input signal is detected, the other (B phase) is detected. ) Is incremented by 1 when the input signal is off, and the count value is decremented by 1 when the B-phase input signal is on.
JP 2001-216155 A

しかしながら、従来の中央処理装置7は、SRAMやFROM、入出力線、通信線、拡張バスなどの多くのデバイスが接続されているため、カウント処理に必要な入力信号S1〜Snが送信される入力線L1〜Lnを多数接続することができなかった。このため、従来の中央処理装置7では、多数の入力信号を用いたカウント処理を実現することができなかった。   However, since the conventional central processing unit 7 is connected to many devices such as SRAM, FROM, input / output lines, communication lines, and expansion buses, the input signals S1 to Sn necessary for the count process are transmitted. Many lines L1 to Ln could not be connected. For this reason, the conventional central processing unit 7 cannot realize count processing using a large number of input signals.

本発明は上記の点に鑑みて為されたものであり、その目的は、多数の入力信号を用いたカウント処理を実現することができるカウンタシステムを提供することにある。   The present invention has been made in view of the above points, and an object of the present invention is to provide a counter system capable of realizing count processing using a large number of input signals.

請求項1の発明は、2値信号の入力信号をカウント処理方式にしたがってカウント処理することによって得られたカウント値を利用した処理を行う中央処理装置を備えるとともに、異なる2値信号の入力信号が送信される入力線がそれぞれに接続される複数の入力ポートと、前記複数の入力ポートを介して入力された入力信号ごとに当該入力信号の有効エッジを検出する検出手段と、前記中央処理装置との間で通信を行う第1の通信制御手段とを有する検出装置を備え、前記中央処理装置は、前記検出装置との間で通信を行う第2の通信制御手段を有し、前記中央処理装置又は前記検出装置の何れかには、前記入力信号ごとに予め設定されたカウント処理方式に応じた前記有効エッジの情報を取得し、前記予め設定されたカウント処理方式にしたがってカウント処理を行ってカウント値を更新するカウント手段が設けられることを特徴とする。   The invention of claim 1 includes a central processing unit that performs processing using a count value obtained by performing count processing on an input signal of a binary signal according to a count processing method, and input signals of different binary signals are A plurality of input ports to which input lines to be transmitted are respectively connected; detection means for detecting a valid edge of the input signal for each input signal input via the plurality of input ports; and the central processing unit; A first communication control unit that communicates with each other, and the central processing unit includes a second communication control unit that performs communication with the detection unit, and the central processing unit Alternatively, in any of the detection devices, the information on the effective edge corresponding to a preset count processing method is acquired for each input signal, and the preset count processing method is used. Therefore, it characterized in that counting means are provided for updating the count value by performing the counting process.

請求項2の発明は、請求項1の発明において、複数種類のカウント処理方式から一のカウント処理方式を選択するための設定手段を備え、前記カウント手段は、前記設定手段で設定されたカウンタ処理方式にしたがってカウント処理を行うことを特徴とする。   According to a second aspect of the present invention, in the first aspect of the invention, there is provided a setting means for selecting one count processing method from a plurality of types of count processing methods, and the counting means is a counter process set by the setting means. Counting processing is performed according to a method.

請求項3の発明は、請求項1の発明において、前記検出手段が前記入力信号のエッジを検出してから一定レベルを継続して前記エッジを前記有効エッジとして取り込むまでの時間である入力時定数を設定するための設定手段を備えることを特徴とする。   According to a third aspect of the present invention, in the first aspect of the present invention, the input time constant is a time from when the detecting means detects an edge of the input signal until a certain level is continued and the edge is taken as the effective edge. It is characterized by comprising setting means for setting.

請求項4の発明は、請求項1の発明において、前記カウント値の開始値を設定するための設定手段を備え、前記カウント手段は、前記設定手段で設定されたカウント値の開始値から前記カウント処理を開始することを特徴とする。   According to a fourth aspect of the present invention, there is provided a setting means for setting a start value of the count value according to the first aspect of the invention, and the count means counts the count value from the start value of the count value set by the setting means. Processing is started.

請求項5の発明は、請求項1の発明において、前記カウント値の終了値を設定するための設定手段を備え、前記カウント手段は、前記設定手段で設定されたカウント値が前記終了値に達するまで前記カウント処理を行うことを特徴とする。   According to a fifth aspect of the present invention, in the first aspect of the invention, there is provided setting means for setting an end value of the count value, and the count means reaches the end value when the count value set by the setting means is reached. The count processing is performed until the above.

請求項6の発明は、請求項2乃至5の何れか1項の発明において、前記設定手段は前記中央処理装置に設けられることを特徴とする。   The invention of claim 6 is the invention according to any one of claims 2 to 5, wherein the setting means is provided in the central processing unit.

請求項7の発明は、請求項2乃至5の何れか1項の発明において、前記設定手段を有し前記検出装置に接続されるスイッチを備え、前記検出装置は、前記設定手段で設定された設定内容を前記スイッチから受信することを特徴とする。   The invention according to claim 7 is the invention according to any one of claims 2 to 5, further comprising a switch having the setting means and connected to the detection device, wherein the detection device is set by the setting means. The setting content is received from the switch.

請求項8の発明は、請求項5の発明において、前記カウント手段で前記カウント値が前記終了値に達したときにその旨を他の機器に通知する通知手段を備えることを特徴とする。   The invention according to claim 8 is characterized in that, in the invention according to claim 5, when the count means reaches the end value by the counting means, notification means is provided for notifying other devices.

請求項9の発明は、請求項8の発明において、前記検出装置は、前記カウント手段と、前記通知手段とを有し、前記通知手段は、前記中央処理装置に通知することを特徴とする。   The invention according to claim 9 is the invention according to claim 8, wherein the detection device includes the counting unit and the notification unit, and the notification unit notifies the central processing unit.

請求項10の発明は、請求項8の発明において、前記検出装置に接続される外部機器を備え、前記検出装置は、前記カウント手段と、前記通知手段とを有し、前記通知手段は、前記外部機器に通知することを特徴とする。   The invention of claim 10 comprises the external device connected to the detection device according to the invention of claim 8, wherein the detection device has the counting means and the notification means, and the notification means It is characterized by notifying an external device.

請求項11の発明は、請求項1乃至8の何れか1項の発明において、前記カウント手段は前記中央処理装置に設けられ、前記検出装置は、前記検出手段で前記有効エッジが検出されたときに、前記有効エッジが検出された入力信号を識別する情報を前記有効エッジの情報として前記中央処理装置に送信することを特徴とする。   According to an eleventh aspect of the present invention, in the invention according to any one of the first to eighth aspects, the counting means is provided in the central processing unit, and the detecting device is configured to detect the effective edge by the detecting means. In addition, information for identifying an input signal in which the valid edge is detected is transmitted as the valid edge information to the central processing unit.

請求項12の発明は、請求項1乃至11の何れか1項の発明において、前記複数の入力ポートのそれぞれは割込入力ポートであることを特徴とする。   According to a twelfth aspect of the present invention, in any one of the first to eleventh aspects, each of the plurality of input ports is an interrupt input port.

請求項13の発明は、請求項1乃至12の何れか1項の発明において、前記中央処理装置は、割込入力ポートを有し、前記検出装置からの情報を前記割込入力ポートから取得することを特徴とする。   The invention according to claim 13 is the invention according to any one of claims 1 to 12, wherein the central processing unit has an interrupt input port, and acquires information from the detection device from the interrupt input port. It is characterized by that.

請求項14の発明は、請求項1乃至13の何れか1項の発明において、前記中央処理装置と前記検出装置とがパラレルバスで接続されることを特徴とする。   The invention of claim 14 is characterized in that, in the invention of any one of claims 1 to 13, the central processing unit and the detection device are connected by a parallel bus.

請求項15の発明は、請求項1乃至13の何れか1項の発明において、前記中央処理装置と前記検出装置とがシリアルバスで接続されることを特徴とする。   A fifteenth aspect of the invention is characterized in that, in the invention of any one of the first to thirteenth aspects, the central processing unit and the detection device are connected by a serial bus.

請求項16の発明は、請求項1乃至15の何れか1項の発明において、前記中央処理装置と前記検出装置とがマスタ・スレーブ通信によって通信が行われることを特徴とする。   A sixteenth aspect of the invention is characterized in that, in the invention of any one of the first to fifteenth aspects, the central processing unit and the detection device communicate with each other by master / slave communication.

請求項1の発明によれば、入力信号ごとの入力線が検出装置の複数の入力ポートに接続され、検出装置の検出手段が入力信号の有効エッジを検出し、カウント手段が有効エッジを用いてカウント処理を行うことによって、複数の入力信号を用いたカウント処理を実現することができる。   According to the invention of claim 1, the input line for each input signal is connected to the plurality of input ports of the detection device, the detection means of the detection device detects the valid edge of the input signal, and the count means uses the valid edge. By performing the count process, a count process using a plurality of input signals can be realized.

請求項2の発明によれば、ユーザが設定手段を操作することによって、各入力信号のカウンタ処理方式を任意に設定することができる。   According to the second aspect of the present invention, the counter processing method for each input signal can be arbitrarily set by the user operating the setting means.

請求項3の発明によれば、ユーザが設定手段を操作することによって、入力時定数を任意に設定することができる。これにより、入力信号に散発的に発生するノイズの影響を低減することができる。   According to the invention of claim 3, the input time constant can be arbitrarily set by the user operating the setting means. Thereby, the influence of the noise sporadically generated in the input signal can be reduced.

請求項4の発明によれば、ユーザが設定手段を操作することによって、各カウント値の初期値を任意に設定することができる。   According to the invention of claim 4, the user can arbitrarily set the initial value of each count value by operating the setting means.

請求項5の発明によれば、ユーザが設定手段を操作することによって、各カウント値の終了値を任意に設定することができる。   According to the invention of claim 5, the end value of each count value can be arbitrarily set by the user operating the setting means.

請求項6の発明によれば、設定手段が中央処理装置に設けられるので、ユーザが、中央処理装置を介して設定内容を容易に設定することができる。   According to the invention of claim 6, since the setting means is provided in the central processing unit, the user can easily set the setting contents via the central processing unit.

請求項7の発明によれば、ユーザが、スイッチを介して設定内容を容易に設定することができる。   According to the invention of claim 7, the user can easily set the setting contents via the switch.

請求項8の発明によれば、入力信号ごとにカウント値が終了値に達したときに通知手段が通知することによって、ユーザが、入力信号ごとにカウント値が終了値であることを知ることができる。   According to the invention of claim 8, the notification means notifies when the count value reaches the end value for each input signal, so that the user knows that the count value is the end value for each input signal. it can.

請求項9の発明によれば、ユーザは、入力信号ごとにカウント値が終了値であることを、中央処理装置を通して容易に知ることができる。   According to the invention of claim 9, the user can easily know through the central processing unit that the count value is the end value for each input signal.

請求項10の発明によれば、ユーザは、入力信号ごとにカウント値が終了値であることを、外部機器を通して容易に知ることができる。   According to the invention of claim 10, the user can easily know through the external device that the count value is the end value for each input signal.

請求項11の発明によれば、有効エッジの情報を、有効エッジが検出された入力信号を識別する情報とすることによって、有効エッジの情報として入力信号ごとに1ビットずつ与えられたnビットの情報に比べて、ビット数を少なくすることができる。   According to the eleventh aspect of the invention, the effective edge information is information for identifying the input signal from which the effective edge is detected, so that n bits of 1 bit are provided for each input signal as the effective edge information. Compared to information, the number of bits can be reduced.

請求項12の発明によれば、検出装置は、レベル変化した入力信号を優先して取得することができるので、レベル変化した入力信号の有効エッジを確実に取りこぼすことなく確実に検出することができ、その結果、複数の入力信号を用いたカウント処理をより正確に行うことができる。   According to the twelfth aspect of the invention, since the detection device can preferentially acquire the input signal whose level has changed, the detection device can reliably detect the effective edge of the input signal whose level has changed. As a result, the counting process using a plurality of input signals can be performed more accurately.

請求項13の発明によれば、中央処理装置が他の処理を行っている場合であっても、検出装置からの割込入力によって、中央処理装置は、カウント処理を優先的に行うことができる。その結果、複数の入力信号を用いたカウント処理をより正確に行うことができる。   According to the invention of claim 13, even when the central processing unit is performing other processing, the central processing unit can preferentially perform the count processing by the interrupt input from the detection device. . As a result, the counting process using a plurality of input signals can be performed more accurately.

請求項14の発明によれば、中央処理装置と検出装置とがパラレルバスで接続されることによって、中央処理装置と検出装置との間で伝達される情報を1ビットずつ順に送信する場合比べて、短時間で送信することができる。   According to the invention of claim 14, the information transmitted between the central processing unit and the detection device is transmitted one bit at a time by connecting the central processing unit and the detection device via a parallel bus. Can be sent in a short time.

請求項15の発明によれば、中央処理装置と検出装置とがシリアルバスで接続されることによって、中央処理装置がn個の入力信号を用いたカウント値を利用したい場合に、シリアルバスとして3本の信号線が中央処理装置に接続されるだけで、中央処理装置と検出装置との情報伝達を実現することができるので、入力信号の個数が多くなるほど、中央処理装置に入力信号の入力線が直接接続される場合に比べて、中央処理装置に接続される信号線の本数を少なくすることができ、その結果、中央処理装置に必要なポート数を低減することができる。   According to the fifteenth aspect of the present invention, when the central processing unit and the detection unit are connected by a serial bus, and the central processing unit wants to use a count value using n input signals, the serial bus is 3 Since the signal transmission between the central processing unit and the detection device can be realized only by connecting the signal lines to the central processing unit, the input signal input line to the central processing unit increases as the number of input signals increases. As compared with the case where the CPUs are directly connected, the number of signal lines connected to the central processing unit can be reduced, and as a result, the number of ports required for the central processing unit can be reduced.

請求項16の発明によれば、マスタ側が、自己に都合のよいタイミングでスレーブ側との間で情報伝達を行うことができる。   According to the invention of claim 16, the master side can transmit information to and from the slave side at a timing convenient for itself.

(実施形態1)
まず、実施形態1のカウンタシステムの構成について図1を用いて説明する。本実施形態のカウンタシステムは、カウント値を利用した処理を行う中央処理装置1と、複数の異なる2値信号の入力信号S1〜Snのエッジを検出する検出装置2とを備えている。
(Embodiment 1)
First, the configuration of the counter system according to the first embodiment will be described with reference to FIG. The counter system of this embodiment includes a central processing unit 1 that performs processing using count values, and a detection device 2 that detects edges of input signals S1 to Sn of a plurality of different binary signals.

検出装置2は、入力信号S1〜Snが送信される入力線L1〜Lnがそれぞれに接続される複数の入力ポート20(20〜20)と、複数の入力ポート20を介して入力された入力信号S1〜Snごとに上記入力信号S1〜Snの有効エッジを検出する検出部(検出手段)21と、中央処理装置1との情報伝達に用いられるサブ側入出力インタフェース22と、中央処理装置1との間で通信を行う通信制御部(第1の通信制御手段)23とを備えている。 The detection device 2 is input via a plurality of input ports 20 (20 1 to 20 n ) to which input lines L1 to Ln to which input signals S1 to Sn are transmitted are respectively connected, and a plurality of input ports 20. A detection unit (detection means) 21 that detects the valid edges of the input signals S1 to Sn for each of the input signals S1 to Sn, a sub-side input / output interface 22 used for information transmission with the central processing unit 1, and a central processing unit 1 is provided with a communication control unit (first communication control means) 23 that performs communication with the communication device 1.

各入力ポート20には、それぞれ対応する入力信号S1〜Snが入力される。具体的には、入力ポート20には入力信号S1が入力され、入力ポート20には入力信号S2が入力される。このようにして、入力ポート20には入力信号Snが入力される。 Corresponding input signals S1 to Sn are input to each input port 20, respectively. Specifically, the input port 20 1 is the input signal S1 is input, the input port 20 2 is input signal S2 is input. In this way, the input signal Sn is input to the input port 20 n .

検出部21は、各入力ポート20〜20に入力される入力信号S1〜Snを入力ポート20から順に取得し、予め設定されたカウント処理方式にしたがって、取得した入力信号S1〜Snの有効エッジを検出する。本実施形態では、各入力信号S1〜Snのカウント処理方式を全て単相入力方式として説明する。例えば入力信号S1の場合について説明すると、検出部21は、図12(a)に示すように、入力信号S1の立上りエッジ(オフからオンへの変化)を有効エッジとして検出する。他の入力信号S2〜Snの場合も、検出部21は、入力信号S1の場合と同様の方法で有効エッジを検出する。 Detector 21, an input signal S1~Sn inputted to each input port 20 1 to 20 n from the input port 20 1 acquired sequentially, according to a preset counting method, the acquired input signal S1~Sn Detect valid edges. In the present embodiment, the count processing method for each of the input signals S1 to Sn will be described as a single-phase input method. For example, in the case of the input signal S1, as illustrated in FIG. 12A, the detection unit 21 detects a rising edge (change from OFF to ON) of the input signal S1 as an effective edge. In the case of other input signals S2 to Sn, the detection unit 21 detects a valid edge in the same manner as in the case of the input signal S1.

通信制御部23は、検出部21で有効エッジが検出された入力信号S1〜Snの識別情報(番号情報)を中央制御装置1に伝達する。   The communication control unit 23 transmits the identification information (number information) of the input signals S <b> 1 to Sn in which the valid edge is detected by the detection unit 21 to the central control device 1.

中央処理装置1は、プログラムによって演算処理及び機器制御を行うものであり、検出装置2のサブ側入出力インタフェース22に接続されるメイン側入出力インタフェース10と、検出装置2との間で通信を行う通信制御部(第2の通信制御手段)11と、入力信号S1〜Snごとにカウント処理方式にしたがってカウント処理を行ってカウント値を更新するカウント部(カウント手段)12とを備えている。   The central processing unit 1 performs arithmetic processing and device control by a program, and communicates between the main input / output interface 10 connected to the sub input / output interface 22 of the detection device 2 and the detection device 2. A communication control unit (second communication control unit) 11 for performing, and a count unit (counting unit) 12 for performing count processing according to the count processing method for each of the input signals S1 to Sn and updating the count value.

カウント部12は、検出装置2の検出部21で有効エッジが検出されたときに、メイン側入出力インタフェース10を介して、有効エッジが検出された入力信号S1〜Snの識別情報を取得する。本実施形態では、各入力信号S1〜Snのカウンタ処理方式が全て単相入力方式であるため、例えば入力信号S1の場合について説明すると、カウント部12は、検出部21で有効エッジが検出された入力信号S1の識別情報を取得するごとに、図12(a)に示すように、カウント値を1ずつ増やす。他の入力信号S2〜Snの場合も、カウント部12は、入力信号S1の場合と同様の方法でカウント値を更新する。   When the detection unit 21 of the detection device 2 detects a valid edge, the count unit 12 acquires the identification information of the input signals S <b> 1 to Sn from which the valid edge is detected via the main-side input / output interface 10. In the present embodiment, since the counter processing method for each of the input signals S1 to Sn is a single-phase input method, for example, the case of the input signal S1 will be described. In the count unit 12, the detection unit 21 detects a valid edge. Each time the identification information of the input signal S1 is acquired, the count value is incremented by one as shown in FIG. In the case of other input signals S2 to Sn, the count unit 12 updates the count value in the same manner as in the case of the input signal S1.

ところで、本実施形態のカウンタシステムにおいて、中央処理装置1のメイン側入出力インタフェース10と検出装置2のサブ側入出力インタフェース22とは、パラレルバス30で接続されている。このとき、各入力信号S1〜Snの識別情報は、入力信号S1〜Snの個数をn個とすると、(logn)ビットで表わすことができる。例えば、入力信号S1〜Snが2個の場合、1ビットであり、入力信号S1〜Snが3個又は4個の場合、2ビットであり、129個以上256個以下の場合、8ビットとなる。したがって、パラレルバス30に用いられる信号線は、パラレルバス30で送受信される信号のビット数と同じ本数であるため、入力信号S1〜Snの本数をn本とすると、(logn)本となる。 By the way, in the counter system of this embodiment, the main side input / output interface 10 of the central processing unit 1 and the sub side input / output interface 22 of the detection device 2 are connected by a parallel bus 30. At this time, the identification information of each of the input signals S1 to Sn can be represented by (log 2 n) bits, where n is the number of input signals S1 to Sn. For example, when there are two input signals S1 to Sn, it is 1 bit, when there are 3 or 4 input signals S1 to Sn, it is 2 bits, and when it is 129 or more and 256 or less, it is 8 bits. . Therefore, since the number of signal lines used for the parallel bus 30 is the same as the number of bits of signals transmitted and received by the parallel bus 30, assuming that the number of input signals S1 to Sn is n, (log 2 n) Become.

また、メイン側入出力インタフェース10とサブ側入出力インタフェース22には、中央処理装置1と検出装置2との間でハンドシェイクをするために用いられる2本の信号線31,32が接続されている。信号線31では、ハンドシェイクを行いたい旨の信号であるA信号Saを検出装置2から中央処理装置1に送信される。信号線32では、中央処理装置1から検出装置2にB信号Sbが送信される。   In addition, two signal lines 31 and 32 used for handshaking between the central processing unit 1 and the detection device 2 are connected to the main-side input / output interface 10 and the sub-side input / output interface 22. Yes. On the signal line 31, an A signal Sa, which is a signal indicating that handshaking is to be performed, is transmitted from the detection device 2 to the central processing unit 1. On the signal line 32, the B signal Sb is transmitted from the central processing unit 1 to the detection device 2.

以下、中央処理装置1と検出装置2との間での情報伝達動作について図2を用いて説明する。ここでは、入力信号S1を代表して説明するが、他の入力信号S2〜Snについても同様である。   Hereinafter, an information transmission operation between the central processing unit 1 and the detection device 2 will be described with reference to FIG. Here, the input signal S1 will be described as a representative, but the same applies to the other input signals S2 to Sn.

まず、検出装置2において、検出部21が入力信号S1の有効エッジを検出すると、通信制御部23は、有効エッジが検出された入力信号S1の識別情報をパラレルバス30で送信させる。上記識別情報の送信は、検出部21が入力信号S1〜Snの有効エッジを検出するまで継続して行われる。上記識別情報が継続して送信されている間、通信制御部23は、A信号Saをオフからオンにし、信号線31を介してオンのA信号Saを中央処理装置1に送信する。   First, in the detection device 2, when the detection unit 21 detects a valid edge of the input signal S <b> 1, the communication control unit 23 causes the parallel bus 30 to transmit identification information of the input signal S <b> 1 in which the valid edge is detected. The transmission of the identification information is continued until the detection unit 21 detects valid edges of the input signals S1 to Sn. While the identification information is continuously transmitted, the communication control unit 23 turns the A signal Sa on from off and transmits the on A signal Sa to the central processing unit 1 via the signal line 31.

中央処理装置1の通信制御部11は、オンのA信号Saを受信すると、有効エッジが検出された入力信号S1の識別情報をパラレルバス30から取得する。上記識別情報を取得した後、通信制御部11は、B信号Sbをオフからオンにし、信号線32を介してオンのB信号Sbを検出装置2に送信する。   When the communication control unit 11 of the central processing unit 1 receives the ON A signal Sa, the communication control unit 11 acquires the identification information of the input signal S1 in which the valid edge is detected from the parallel bus 30. After acquiring the identification information, the communication control unit 11 turns the B signal Sb from OFF to ON, and transmits the ON B signal Sb to the detection device 2 via the signal line 32.

その後、検出装置2の通信制御部23は、オンのB信号Sbを受信すると、A信号Saをオンからオフにし、信号線31を介してオフのA信号Saを中央処理装置1に送信する。   Thereafter, when receiving the ON B signal Sb, the communication control unit 23 of the detection device 2 turns the A signal Sa from ON to OFF, and transmits the OFF A signal Sa to the central processing unit 1 through the signal line 31.

その後、中央制御装置1の通信制御部11は、オフのA信号Saを受信すると、B信号Sbをオンからオフにし、信号線32を介してオフのB信号Sbを検出装置2に送信する。また、カウント部12は、通信制御部11がパラレルバス30を介して取得した入力信号S1の識別情報に基づいて、入力信号S1のカウント値を更新する。   Thereafter, when receiving the OFF A signal Sa, the communication control unit 11 of the central control device 1 turns the B signal Sb from ON to OFF, and transmits the OFF B signal Sb to the detection device 2 via the signal line 32. Further, the count unit 12 updates the count value of the input signal S1 based on the identification information of the input signal S1 acquired by the communication control unit 11 via the parallel bus 30.

その後、検出装置2の通信制御部23は、オフのB信号Sbを受信する。   Thereafter, the communication control unit 23 of the detection device 2 receives the OFF B signal Sb.

上記より、中央処理装置1と検出装置2との間では、マスタ・スレーブ通信が行われる。本実施形態では、検出装置2がマスタであり、中央処理装置1がスレーブである。   As described above, master / slave communication is performed between the central processing unit 1 and the detection device 2. In the present embodiment, the detection device 2 is a master and the central processing unit 1 is a slave.

以上、本実施形態によれば、入力信号S1〜Snごとの入力線L1〜Lnが検出装置2の複数の入力ポート20に接続され、検出装置2の検出部21が入力信号S1〜Snの有効エッジを検出し、中央処理装置1のカウント部12が有効エッジを用いてカウント処理を行うことによって、複数の入力信号S1〜Snを用いたカウント処理を実現することができる。   As described above, according to the present embodiment, the input lines L1 to Ln for the input signals S1 to Sn are connected to the plurality of input ports 20 of the detection device 2, and the detection unit 21 of the detection device 2 validates the input signals S1 to Sn. When the edge is detected and the counting unit 12 of the central processing unit 1 performs the counting process using the effective edge, the counting process using the plurality of input signals S1 to Sn can be realized.

また、中央処理装置1と検出装置2とがパラレルバス30で接続されることによって、中央処理装置1がn個の入力信号S1〜Snを用いたカウント値を利用したい場合に、パラレルバス30としての(logn)本の信号線と、ハンドシェイク用の2本の信号線31,32とを用意するだけで、中央処理装置1と検出装置2との情報の伝達を実現することができるので、入力信号S1〜Snの個数が多くなるほど、中央処理装置1に複数の入力信号S1〜Snの入力線L1〜Lnが直接接続される場合に比べて、中央処理装置1に接続される信号線の本数を少なくすることができ、その結果、中央処理装置1に必要なポート数を低減することができる。 In addition, when the central processing unit 1 and the detection device 2 are connected by the parallel bus 30, the central processing unit 1 uses the count value using the n input signals S1 to Sn as the parallel bus 30. (Log 2 n) signal lines and two signal lines 31 and 32 for handshaking can be prepared, and information transmission between the central processing unit 1 and the detection unit 2 can be realized. Therefore, as the number of the input signals S1 to Sn increases, the signal connected to the central processing unit 1 compared to the case where the input lines L1 to Ln of the plurality of input signals S1 to Sn are directly connected to the central processing unit 1. The number of lines can be reduced, and as a result, the number of ports required for the central processing unit 1 can be reduced.

さらに、中央処理装置1と検出装置2とがマスタ・スレーブ通信によって通信が行われることによって、マスタ側が、自己に都合のよいタイミングでスレーブ側との間で情報伝達を行うことができる。   Furthermore, communication between the central processing unit 1 and the detection device 2 is performed by master / slave communication, so that the master side can transmit information to and from the slave side at a timing convenient for itself.

また、本実施形態によれば、有効エッジの情報を、有効エッジが検出された入力信号S1〜Snを識別する情報とすることによって、有効エッジの情報として入力信号S1〜Snごとに1ビットずつ与えられたnビットの情報に比べて、ビット数を少なくすることができる。特に、有効エッジの情報を(logn)ビットの情報とし、この情報をパラレルバス30で送信することによって、パラレルバス30としての(logn)本の信号線と、ハンドシェイク用の2本の信号線31,32とを用意するだけで、検出装置2から中央処理装置1に有効エッジの情報を送信することができる。これにより、入力信号S1〜Snの数が多くなるほど、中央処理装置に複数の入力信号の入力線が直接接続される場合に比べて、中央処理装置1に接続される信号線の本数を少なくすることができ、その結果、中央処理装置1において検出装置2との通信に必要なポート数を低減することができる。 Further, according to the present embodiment, the valid edge information is information for identifying the input signals S1 to Sn in which the valid edge is detected, so that one bit is provided for each of the input signals S1 to Sn as the valid edge information. The number of bits can be reduced compared to the given n-bit information. In particular, effective edge information is (log 2 n) -bit information, and this information is transmitted by the parallel bus 30, whereby (log 2 n) signal lines as the parallel bus 30 and 2 for handshaking are used. By preparing only the signal lines 31 and 32 of the book, it is possible to transmit information on the effective edge from the detection device 2 to the central processing unit 1. Thereby, as the number of input signals S1 to Sn increases, the number of signal lines connected to the central processing unit 1 is reduced as compared to the case where input lines for a plurality of input signals are directly connected to the central processing unit. As a result, the number of ports required for communication with the detection device 2 in the central processing unit 1 can be reduced.

なお、実施形態1の変形例として、入力信号S1〜Snごとにカウント処理方式にしたがってカウント処理を行うカウント部(カウント手段)を中央処理装置1ではなく検出装置2に備える構成であってもよい。このような構成であっても、入力信号S1〜Snごとの入力線L1〜Lnが検出装置2の複数の入力ポート20に接続され、検出装置2の検出部21が入力信号S1〜Snの有効エッジを検出し、検出装置2のカウント部が各入力信号S1〜Snの有効エッジを用いてカウント処理を行うことによって、実施形態1と同様に、複数の入力信号S1〜Snを用いたカウント処理を実現することができる。   As a modification of the first embodiment, the detection device 2 may include a count unit (counting unit) that performs count processing according to the count processing method for each of the input signals S1 to Sn. . Even in such a configuration, the input lines L1 to Ln for each of the input signals S1 to Sn are connected to the plurality of input ports 20 of the detection device 2, and the detection unit 21 of the detection device 2 enables the input signals S1 to Sn to be valid. Count processing using a plurality of input signals S1 to Sn as in the first embodiment by detecting an edge and performing a count process using the valid edges of the input signals S1 to Sn by the count unit of the detection device 2 Can be realized.

また、実施形態1の他の変形例として、各入力信号S1〜S2のカウント処理方式を二相入力方式や個別入力方式、方向判別入力方式などにしてもよい。以下の実施形態においても同様である。このとき、パラレルバス30で用いられる信号線の本数は、検出装置2から中央処理装置1への伝達する情報量に応じて適宜設定される。   As another modification of the first embodiment, the count processing method for each of the input signals S1 to S2 may be a two-phase input method, an individual input method, a direction determination input method, or the like. The same applies to the following embodiments. At this time, the number of signal lines used in the parallel bus 30 is appropriately set according to the amount of information transmitted from the detection device 2 to the central processing unit 1.

二相入力方式の場合、図12(b)に示すように、A相の入力信号をS1、B相の入力信号をS2とすると、検出部21は、入力信号S1がオフであるときの入力信号S2の立上りエッジ(オフからオンへの変化)及び立下りエッジ(オンからオフへの変化)を有効エッジとして検出する。そして、カウント部12は、検出部21で検出された有効エッジの情報を取得すると、立下りエッジのときにカウント値を1増やし、立上りエッジのときにカウント値を1減らす。他の入力信号S2〜Snを組み合わせた二相入力方式の場合も、検出部21は、入力信号S1,S2の場合と同様の方法で有効エッジを検出し、カウント部12は、入力信号S1,S2の場合と同様の方法でカウント値を更新する。   In the case of the two-phase input method, as shown in FIG. 12 (b), when the A-phase input signal is S1 and the B-phase input signal is S2, the detection unit 21 inputs when the input signal S1 is OFF. The rising edge (change from OFF to ON) and the falling edge (change from ON to OFF) of the signal S2 are detected as effective edges. When the count unit 12 acquires information about the valid edge detected by the detection unit 21, the count unit 12 increases the count value by 1 at the falling edge and decreases the count value by 1 at the rising edge. In the case of the two-phase input method in which other input signals S2 to Sn are combined, the detection unit 21 detects the valid edge in the same manner as the input signals S1 and S2, and the count unit 12 receives the input signals S1 and S2. The count value is updated by the same method as in S2.

個別入力方式の場合、図12(c)に示すように、A相の入力信号をS1、B相の入力信号をS2とすると、検出部21は、入力信号S1の立上りエッジ及び入力信号S2の立上りエッジを有効エッジとして検出する。そして、カウント部12は、検出装置2の検出部21で検出された有効エッジの情報を取得すると、有効エッジが入力信号S1の立上りエッジであるときにカウント値を1増やし、有効エッジが入力信号S2の立上りエッジであるときにカウント値を1減らす。他の入力信号S2〜Snを組み合わせた個別入力方式の場合も、検出部21は、入力信号S1,S2の場合と同様の方法で有効エッジを検出し、カウント部12は、入力信号S1,S2の場合と同様の方法でカウント値を更新する。   In the case of the individual input method, as shown in FIG. 12C, when the A-phase input signal is S1 and the B-phase input signal is S2, the detection unit 21 detects the rising edge of the input signal S1 and the input signal S2. A rising edge is detected as a valid edge. When the count unit 12 acquires information about the valid edge detected by the detection unit 21 of the detection device 2, the count value is incremented by 1 when the valid edge is the rising edge of the input signal S1, and the valid edge is the input signal. When it is the rising edge of S2, the count value is decreased by one. Also in the case of the individual input method in which other input signals S2 to Sn are combined, the detection unit 21 detects a valid edge in the same manner as the input signals S1 and S2, and the count unit 12 receives the input signals S1 and S2. The count value is updated in the same manner as in.

方向判別入力方式の場合、図12(d)に示すように、A相の入力信号をS1、B相の入力信号をS2とすると、検出部21は、有効エッジとして、入力信号S1の立上りエッジと、このときの入力信号S2のオンオフ状態とを検出する。そして、カウント部12は、検出装置2の検出部21で検出された有効エッジの情報を取得すると、有効エッジが入力信号S2のオフ状態時の入力信号S1の立上りエッジであるときにカウント値を1増やし、有効エッジが入力信号S2のオン状態時の入力信号S1の立上りエッジであるときにカウント値を1減らす。他の入力信号S2〜Snを組み合わせた方向判別入力方式の場合も、検出部21は、入力信号S1,S2の場合と同様の方法で有効エッジを検出し、カウント部12は、入力信号S1,S2の場合と同様の方法でカウント値を更新する。   In the case of the direction discrimination input method, as shown in FIG. 12D, when the A-phase input signal is S1 and the B-phase input signal is S2, the detection unit 21 uses the rising edge of the input signal S1 as a valid edge. And the ON / OFF state of the input signal S2 at this time is detected. And the count part 12 will acquire a count value, if the information on the effective edge detected by the detection part 21 of the detection apparatus 2 is a rising edge of the input signal S1 at the time of the OFF state of the input signal S2. When the valid edge is the rising edge of the input signal S1 when the input signal S2 is on, the count value is decreased by one. Also in the case of the direction discrimination input method in which other input signals S2 to Sn are combined, the detection unit 21 detects a valid edge in the same manner as the input signals S1 and S2, and the count unit 12 receives the input signals S1 and S1. The count value is updated by the same method as in S2.

(実施形態2)
実施形態2のカウンタシステムは、図3に示すように、中央処理装置1のメイン側入出力インタフェース10と検出装置2のサブ側入出力インタフェース22とがシリアルバス40で接続される点で、実施形態1のカウンタシステム(図1参照)と相違する。なお、実施形態1と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 2)
The counter system according to the second embodiment is implemented in that the main input / output interface 10 of the central processing unit 1 and the sub input / output interface 22 of the detection device 2 are connected by a serial bus 40 as shown in FIG. This is different from the counter system of the first embodiment (see FIG. 1). In addition, about the component similar to Embodiment 1, the same code | symbol is attached | subjected and description is abbreviate | omitted.

シリアルバス40で送受信される信号のビット数は、入力信号S1〜Snの本数をn本とすると、(logn)ビットとなる。例えば、入力信号S1〜Snが2本の場合、1ビットであり、入力信号S1〜Snが3,4本の場合、2ビットであり、129本以上256本以下の場合、8ビットとなる。一方、シリアルバス40に用いられる信号線は、シリアルバス40で送受信される信号のビット数に関係なく、3本である。 The number of bits of signals transmitted and received on the serial bus 40 is (log 2 n) bits, where n is the number of input signals S1 to Sn. For example, when the number of input signals S1 to Sn is 2, it is 1 bit, when the number of input signals S1 to Sn is 3 or 4, it is 2 bits, and when it is 129 or more and 256 or less, it is 8 bits. On the other hand, the number of signal lines used for the serial bus 40 is three regardless of the number of bits of signals transmitted and received on the serial bus 40.

以下、中央処理装置1と検出装置2との間での情報伝達動作について図4を用いて説明する。ここでは、入力信号S1を代表して説明するが、他の入力信号S2〜Snについても同様である。   Hereinafter, an information transmission operation between the central processing unit 1 and the detection device 2 will be described with reference to FIG. Here, the input signal S1 will be described as a representative, but the same applies to the other input signals S2 to Sn.

まず、検出装置2において、検出部21が入力信号S1の有効エッジを検出すると、通信制御部23は、有効エッジが検出された入力信号S1の検出コマンドを生成し、生成した検出コマンドをシリアルバス40で送信する。   First, in the detection device 2, when the detection unit 21 detects a valid edge of the input signal S1, the communication control unit 23 generates a detection command of the input signal S1 in which the valid edge is detected, and the generated detection command is transmitted to the serial bus. 40.

中央処理装置1の通信制御部11は、検出コマンドを受信し、有効エッジが検出された入力信号S1の識別情報を取得する。上記識別情報を取得した後、通信制御部11は、レスポンスを生成し、生成したレスポンスを検出装置2に送信する。   The communication control unit 11 of the central processing unit 1 receives the detection command and acquires the identification information of the input signal S1 in which the valid edge is detected. After acquiring the identification information, the communication control unit 11 generates a response and transmits the generated response to the detection device 2.

その後、検出装置2の通信制御部23は、レスポンスを受信する。   Thereafter, the communication control unit 23 of the detection device 2 receives the response.

その後、中央制御装置1のカウント部12は、通信制御部11が取得した入力信号S1の識別情報に基づいて、入力信号S1のカウント値を更新する。   Thereafter, the count unit 12 of the central control device 1 updates the count value of the input signal S1 based on the identification information of the input signal S1 acquired by the communication control unit 11.

以上、本実施形態によれば、中央処理装置1と検出装置2とがシリアルバス40で接続されることによって、中央処理装置1がn個の入力信号S1〜Snを用いたカウント値を利用したい場合に、シリアルバス40として3本の信号線が中央処理装置1に接続されるだけで、中央処理装置1と検出装置2との情報伝達を実現することができるので、入力信号S1〜Snの個数が多くなるほど、中央処理装置1に入力信号S1〜Snの入力線L1〜Lnが直接接続される場合に比べて、中央処理装置1に接続される信号線の本数を少なくすることができ、その結果、中央処理装置1に必要なポート数を低減することができる。   As described above, according to the present embodiment, the central processing unit 1 and the detection device 2 are connected by the serial bus 40, so that the central processing unit 1 wants to use the count value using the n input signals S1 to Sn. In this case, the information transmission between the central processing unit 1 and the detection unit 2 can be realized only by connecting three signal lines as the serial bus 40 to the central processing unit 1. As the number increases, the number of signal lines connected to the central processing unit 1 can be reduced as compared with the case where the input lines L1 to Ln of the input signals S1 to Sn are directly connected to the central processing unit 1, As a result, the number of ports required for the central processing unit 1 can be reduced.

(実施形態3)
実施形態3のカウンタシステムは、図5に示すように、各入力信号S1〜Snのカウント処理方式を複数種類のカウント処理方式から選択するための設定部(設定手段)13を中央処理装置1に備える点で、実施形態1のカウンタシステム(図1参照)と相違する。なお、実施形態1と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 3)
As shown in FIG. 5, in the counter system of the third embodiment, the central processing unit 1 has a setting unit (setting means) 13 for selecting the count processing method of each input signal S1 to Sn from a plurality of types of count processing methods. It differs from the counter system (refer FIG. 1) of Embodiment 1 by the point provided. In addition, about the component similar to Embodiment 1, the same code | symbol is attached | subjected and description is abbreviate | omitted.

設定部13では、入力信号の番号とカウント処理方式とが設定される。例えば各入力信号S1〜Snの番号を順に1〜nとし、カウント処理方式について、単相入力方式を0、二相入力方式を1、個別入力方式を2、方向判別方式を3とすると、入力信号S2のカウント処理方式を単相入力方式としたい場合、ユーザは設定部13を用いて入力信号S1〜Snの番号を2、カウント処理方式の番号を0と設定すればよい。なお、二相入力方式や個別入力方式、方向判別方式に設定する場合、隣接する2つの入力信号S1〜Snを用いるため、2つの入力信号S1〜Snのうち小さいほうの番号を設定すればよい。   In the setting unit 13, the number of the input signal and the count processing method are set. For example, if the input signals S1 to Sn are numbered 1 to n in order, and the count processing method is 0 for the single-phase input method, 1 for the two-phase input method, 2 for the individual input method, and 3 for the direction discrimination method, If the count processing method of the signal S2 is to be a single-phase input method, the user may set the number of the input signals S1 to Sn and the number of the count processing method to 0 using the setting unit 13. When the two-phase input method, the individual input method, or the direction determination method is used, since the two adjacent input signals S1 to Sn are used, the smaller one of the two input signals S1 to Sn may be set. .

本実施形態のカウント部12は、設定部13で設定されたカウント処理方式にしたがってカウント処理を行う。また、本実施形態の通信制御部11は、設定部13で設定されたカウント処理方式をパラレルバス33で検出装置2に送信する。パラレルバス33の本数は、カウント処理方式の情報がNビットの場合、N本である。   The count unit 12 of the present embodiment performs count processing according to the count processing method set by the setting unit 13. Further, the communication control unit 11 according to the present embodiment transmits the count processing method set by the setting unit 13 to the detection device 2 via the parallel bus 33. The number of parallel buses 33 is N when the count processing method information is N bits.

本実施形態の通信制御部23は、設定部13で設定されたカウント処理方式を中央処理装置1から受信する。また、本実施形態の検出部21は、通信制御部23で受信されたカウント処理方式にしたがって入力信号S1〜Snの有効エッジを検出する。   The communication control unit 23 according to the present embodiment receives the count processing method set by the setting unit 13 from the central processing device 1. Further, the detection unit 21 of the present embodiment detects the valid edges of the input signals S1 to Sn according to the count processing method received by the communication control unit 23.

次に、本実施形態のカウンタシステムにおけるカウント処理方式の設定動作について図6を用いて説明する。ここでは、入力信号S1を代表して説明するが、他の入力信号S2〜Snについても同様である。   Next, the setting operation of the count processing method in the counter system of this embodiment will be described with reference to FIG. Here, the input signal S1 will be described as a representative, but the same applies to the other input signals S2 to Sn.

まず、中央処理装置1において、設定部13で入力信号S1のカウント処理方式が設定されると、通信制御部11は、設定されたカウント処理方式に対応する入力信号S1の識別情報をパラレルバス30で送信する。また、通信制御部11は、入力信号S1のカウント処理方式をパラレルバス33で送信する。そして、通信制御部11は、A信号Saをオフからオンにし、信号線31を介してオンのA信号Saを検出装置2に送信する。   First, in the central processing unit 1, when the count processing method of the input signal S1 is set by the setting unit 13, the communication control unit 11 sends the identification information of the input signal S1 corresponding to the set count processing method to the parallel bus 30. Send with. In addition, the communication control unit 11 transmits the count processing method of the input signal S1 through the parallel bus 33. Then, the communication control unit 11 turns the A signal Sa from OFF to ON, and transmits the ON A signal Sa to the detection device 2 through the signal line 31.

検出装置2の通信制御部23は、入力信号S1の識別情報をパラレルバス30で受信し、設定されたカウント処理方式をパラレルバス33で受信する。検出部21は、通信制御部23で受信した入力信号S1のカウント処理方式を取得し、その後、割込禁止とする。その後、検出部21は、これまでの入力信号S1のカウント処理方式を、取得した入力信号S1のカウント処理方式に変更する。その後、検出部21は割込を許可し、B信号Sbをオフからオンにし、信号線32を介してオンのB信号Sbを中央処理装置1に送信する。   The communication control unit 23 of the detection device 2 receives the identification information of the input signal S1 via the parallel bus 30 and receives the set count processing method via the parallel bus 33. The detection unit 21 acquires the count processing method of the input signal S1 received by the communication control unit 23, and thereafter disables interrupts. Thereafter, the detection unit 21 changes the count processing method of the input signal S1 so far to the count processing method of the acquired input signal S1. Thereafter, the detection unit 21 permits interruption, turns the B signal Sb from OFF to ON, and transmits the ON B signal Sb to the central processing unit 1 via the signal line 32.

中央処理装置1の通信制御部11は、オンのB信号Sbを受信すると、A信号Saをオンからオフにし、信号線31を介してオフのA信号Saを検出装置2に送信する。   When receiving the ON B signal Sb, the communication control unit 11 of the central processing unit 1 switches the A signal Sa from ON to OFF and transmits the OFF A signal Sa to the detection device 2 via the signal line 31.

その後、検出装置2の通信制御部23は、オフのA信号Saを受信すると、B信号Sbをオンからオフにし、信号線32を介してオフのB信号Sbを中央処理装置1に送信する。   After that, when receiving the OFF A signal Sa, the communication control unit 23 of the detection device 2 turns the B signal Sb from ON to OFF, and transmits the OFF B signal Sb to the central processing unit 1 via the signal line 32.

その後、中央制御装置1の通信制御部11は、オフのB信号Sbを受信する。   Thereafter, the communication control unit 11 of the central controller 1 receives the OFF B signal Sb.

以上、本実施形態によれば、ユーザが設定部13を操作することによって、各入力信号S1〜Snのカウント処理方式を任意に設定することができる。また、本実施形態では、設定部13が中央処理装置1に備えられるので、ユーザが、中央処理装置1を介して各入力信号S1〜Snのカウント処理方式を容易に設定することができる。   As described above, according to the present embodiment, the user can arbitrarily set the count processing method of the input signals S1 to Sn by operating the setting unit 13. In the present embodiment, since the setting unit 13 is provided in the central processing unit 1, the user can easily set the count processing method of the input signals S <b> 1 to Sn via the central processing unit 1.

(実施形態4)
実施形態4のカウンタシステムは、図5に示す設定部(設定手段)13が、カウント処理方式を設定するためのものではなく、入力時定数を設定するためのものである点で、実施形態3のカウンタシステムと相違する。なお、実施形態3と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 4)
The counter system of the fourth embodiment is that the setting unit (setting means) 13 shown in FIG. 5 is not for setting the count processing method, but for setting an input time constant. It is different from the counter system. In addition, about the component similar to Embodiment 3, the same code | symbol is attached | subjected and description is abbreviate | omitted.

入力時定数とは、検出部21が入力信号S1〜Snのエッジを検出してから一定レベルを継続してエッジを有効エッジとして取り込むまでの時間をいう。つまり、検出部21において入力信号S1〜Snのエッジに対する検出タイミングの目安を与える定数をいう。例えば、入力時定数を5ミリ秒とした場合、入力信号S1〜Snがレベル変化したときに、変化後のレベルが5ミリ秒継続すると、検出装置2の検出部21が入力信号S1〜Snのエッジを有効エッジとして検出する。これにより、入力信号S1〜Snに散発的に発生するノイズの影響を低減することができる。   The input time constant refers to the time from when the detection unit 21 detects the edges of the input signals S1 to Sn until the edge is taken in as a valid edge by continuing a certain level. That is, it is a constant that gives an indication of the detection timing for the edges of the input signals S1 to Sn in the detection unit 21. For example, when the input time constant is set to 5 milliseconds, when the level of the input signals S1 to Sn changes and the level after the change continues for 5 milliseconds, the detection unit 21 of the detection device 2 detects the input signals S1 to Sn. Edges are detected as valid edges. Thereby, the influence of the noise which occurs sporadically in the input signals S1 to Sn can be reduced.

本実施形態の通信制御部11は、設定部13で設定された入力時定数を検出装置2に送信する。   The communication control unit 11 according to the present embodiment transmits the input time constant set by the setting unit 13 to the detection device 2.

本実施形態の通信制御部23は、設定部13で設定された入力時定数を中央処理装置1から受信する。また、本実施形態の検出部21は、通信制御部23で受信された入力時定数が経過した後、入力信号S1〜Snの有効エッジを検出する。   The communication control unit 23 according to the present embodiment receives the input time constant set by the setting unit 13 from the central processing unit 1. Moreover, the detection part 21 of this embodiment detects the effective edge of the input signals S1-Sn after the input time constant received by the communication control part 23 passes.

なお、本実施形態のカウンタシステムにおける入力時定数の設定動作は、実施形態5において、図6の設定内容としてカウント処理方式を入力時定数とした場合と同様である。   The setting operation of the input time constant in the counter system of the present embodiment is the same as that in the fifth embodiment when the count processing method is the input time constant as the setting contents of FIG.

以上、本実施形態によれば、ユーザが設定部13を操作することによって、入力時定数を任意に設定することができる。また、本実施形態では、設定部13が中央処理装置1に備えられるので、ユーザが、中央処理装置1を介して入力時定数を容易に設定することができる。   As described above, according to the present embodiment, the user can arbitrarily set the input time constant by operating the setting unit 13. In this embodiment, since the setting unit 13 is provided in the central processing unit 1, the user can easily set the input time constant via the central processing unit 1.

(実施形態5)
実施形態5のカウンタシステムは、図5に示す設定部(設定手段)13が、各入力信号S1〜Snのカウント値の初期値を設定するためのものである点で、実施形態3のカウンタシステムと相違する。なお、実施形態3と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 5)
The counter system of the fifth embodiment is that the setting unit (setting means) 13 shown in FIG. 5 is for setting initial values of the count values of the input signals S1 to Sn. Is different. In addition, about the component similar to Embodiment 3, the same code | symbol is attached | subjected and description is abbreviate | omitted.

本実施形態のカウント部12は、設定部13で設定されたカウント値の初期値からカウント処理を開始する。   The count unit 12 of this embodiment starts the count process from the initial value of the count value set by the setting unit 13.

以上、本実施形態によれば、ユーザが設定部13を操作することによって、各入力信号S1〜Snのカウント値の初期値を任意に設定することができる。また、本実施形態では、設定部13が中央処理装置1に備えられるので、ユーザが、中央処理装置1を介してカウント値の初期値を容易に設定することができる。   As described above, according to the present embodiment, the user can arbitrarily set the initial values of the count values of the input signals S1 to Sn by operating the setting unit 13. In the present embodiment, since the setting unit 13 is provided in the central processing unit 1, the user can easily set the initial value of the count value via the central processing unit 1.

(実施形態6)
実施形態6のカウンタシステムは、図5に示す設定部(設定手段)13が、各カウント値の終了値であるカウンタ目標値を設定するためのものである点で、実施形態3のカウンタシステムと相違する。なお、実施形態3と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 6)
The counter system of the sixth embodiment is different from the counter system of the third embodiment in that the setting unit (setting means) 13 shown in FIG. 5 is for setting a counter target value that is an end value of each count value. Is different. In addition, about the component similar to Embodiment 3, the same code | symbol is attached | subjected and description is abbreviate | omitted.

本実施形態のカウント部12は、カウント値が、設定部13で設定されたカウンタ目標値に達するまでカウント処理を行う。   The count unit 12 of the present embodiment performs a count process until the count value reaches the counter target value set by the setting unit 13.

以上、本実施形態によれば、ユーザが設定部13を操作することによって、各カウント値のカウンタ目標値を任意に設定することができる。また、本実施形態では、設定部13が中央処理装置1に備えられるので、ユーザが、中央処理装置1を介してカウンタ目標値を容易に設定することができる。   As described above, according to the present embodiment, the user can arbitrarily set the counter target value of each count value by operating the setting unit 13. In the present embodiment, since the setting unit 13 is provided in the central processing unit 1, the user can easily set the counter target value via the central processing unit 1.

なお、実施形態3〜6では、中央処理装置1と検出装置2とがパラレルバス30で接続される場合について説明したが、実施形態2のように中央処理装置1と検出装置2とがシリアルバス40(図3参照)で接続される場合においても、実施形態3〜6の設定部13を備えてもよい。このような構成においても、実施形態3〜6と同様に、ユーザが設定部13を操作することによって、中央処理装置1を介して設定内容を設定することができる。   In the third to sixth embodiments, the case where the central processing unit 1 and the detection device 2 are connected by the parallel bus 30 has been described. However, as in the second embodiment, the central processing unit 1 and the detection device 2 are serial buses. Even when connected by 40 (refer FIG. 3), you may provide the setting part 13 of Embodiment 3-6. Even in such a configuration, the setting content can be set via the central processing unit 1 by the user operating the setting unit 13 as in the third to sixth embodiments.

(実施形態7)
実施形態7のカウンタシステムは、図7に示すように、検出装置2がカウント部24を備え、通信制御部23が通知手段としての機能を有する点で、実施形態6のカウンタシステム(図5参照)と相違する。なお、実施形態6と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 7)
As shown in FIG. 7, the counter system of the seventh embodiment includes the counter unit of the sixth embodiment (see FIG. 5) in that the detection device 2 includes a count unit 24 and the communication control unit 23 has a function as a notification unit. ) Is different. In addition, about the component similar to Embodiment 6, the same code | symbol is attached | subjected and description is abbreviate | omitted.

通信制御部23は、カウント部24で各入力信号S1〜Snのカウント値がカウンタ目標値に達したことを中央処理装置1に通知する。   The communication control unit 23 notifies the central processing unit 1 that the count value of each of the input signals S1 to Sn has reached the counter target value by the count unit 24.

次に、本実施形態のカウンタシステムにおける通知動作について図2を援用して説明する。ここでは、入力信号S1を代表して説明するが、他の入力信号S2〜Snについても同様である。   Next, the notification operation in the counter system of this embodiment will be described with reference to FIG. Here, the input signal S1 will be described as a representative, but the same applies to the other input signals S2 to Sn.

まず、検出装置2において、検出部21が有効エッジを検出し、カウント部24が有効エッジに基づいて、各入力信号S1〜Snのカウント値を更新する。ここで、カウント値がカウンタ目標値に達したとき、通信制御部23は、入力信号S1〜Snの識別情報をパラレルバス30で中央処理装置1に送信する。このとき、通信制御部23は、A信号Saをオフからオンにし、信号線31を介してオンのA信号Saを中央処理装置1に送信する。   First, in the detection device 2, the detection unit 21 detects a valid edge, and the count unit 24 updates the count values of the input signals S1 to Sn based on the valid edge. Here, when the count value reaches the counter target value, the communication control unit 23 transmits the identification information of the input signals S <b> 1 to Sn to the central processing unit 1 through the parallel bus 30. At this time, the communication control unit 23 turns the A signal Sa on from off, and transmits the on A signal Sa to the central processing unit 1 via the signal line 31.

中央処理装置1の通信制御部11は、カウント値がカウンタ目標値に達した入力信号S1〜Snの識別情報を受信する。その後、通信制御部11は、B信号Sbをオフからオンにし、信号線32を介してオンのB信号Sbを検出装置2に送信する。   The communication control unit 11 of the central processing unit 1 receives the identification information of the input signals S1 to Sn whose count value has reached the counter target value. Thereafter, the communication control unit 11 turns the B signal Sb from OFF to ON, and transmits the ON B signal Sb to the detection device 2 via the signal line 32.

検出装置2の通信制御部23は、オンのB信号Sbを受信すると、A信号Saをオンからオフにし、信号線31を介してオフのA信号Saを中央処理装置1に送信する。   When receiving the ON B signal Sb, the communication control unit 23 of the detection device 2 turns the A signal Sa from ON to OFF, and transmits the OFF A signal Sa to the central processing unit 1 via the signal line 31.

中央処理装置1の通信制御部11は、オフのA信号Saを受信すると、B信号Sbをオンからオフにし、信号線32を介してオフのB信号Sbを検出装置2に送信する。   When the communication control unit 11 of the central processing unit 1 receives the OFF A signal Sa, the communication control unit 11 switches the B signal Sb from ON to OFF, and transmits the OFF B signal Sb to the detection device 2 via the signal line 32.

その後、検出装置2の通信制御部23は、オフのB信号Sbを受信する。   Thereafter, the communication control unit 23 of the detection device 2 receives the OFF B signal Sb.

以上、本実施形態によれば、入力信号S1〜Snごとにカウント値がカウンタ目標値に達したことを通信制御部23が通知することによって、ユーザが、入力信号S1〜Snごとにカウント値がカウンタ目標値に達したことを知ることができる。特に本実施形態では、ユーザは、入力信号S1〜Snごとにカウント値がカウンタ目標値に達したことを、中央処理装置1を通して容易に知ることができる。   As described above, according to the present embodiment, when the communication control unit 23 notifies that the count value has reached the counter target value for each of the input signals S1 to Sn, the user can obtain the count value for each of the input signals S1 to Sn. It is possible to know that the counter target value has been reached. In particular, in the present embodiment, the user can easily know through the central processing unit 1 that the count value has reached the counter target value for each of the input signals S1 to Sn.

なお、実施形態7では、中央処理装置1と検出装置2とがパラレルバス30で接続される場合について説明したが、実施形態2のように中央処理装置1と検出装置2とがシリアルバス40(図3参照)で接続される場合においても、実施形態3〜6と同様に、入力信号S1〜Snごとにカウント値がカウンタ目標値に達したことを通信制御部23が通知することによって、ユーザが、入力信号S1〜Snごとにカウント値がカウンタ目標値に達したことを知ることができる。特に本実施形態では、ユーザは、入力信号S1〜Snごとにカウント値がカウンタ目標値に達したことを、中央処理装置1を通して容易に知ることができる。   In the seventh embodiment, the case where the central processing unit 1 and the detection device 2 are connected via the parallel bus 30 has been described. However, as in the second embodiment, the central processing unit 1 and the detection device 2 are connected to the serial bus 40 ( Even in the case of connection in FIG. 3, the communication control unit 23 notifies the user that the count value has reached the counter target value for each of the input signals S1 to Sn, as in the third to sixth embodiments. However, it can be known that the count value has reached the counter target value for each of the input signals S1 to Sn. In particular, in the present embodiment, the user can easily know through the central processing unit 1 that the count value has reached the counter target value for each of the input signals S1 to Sn.

(実施形態8)
実施形態8のカウンタシステムは、図8に示すように、検出装置2に接続される外部機器5を備える点で、実施形態7のカウンタシステム(図7参照)と相違する。なお、実施形態7と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 8)
As shown in FIG. 8, the counter system of the eighth embodiment is different from the counter system of the seventh embodiment (see FIG. 7) in that it includes an external device 5 connected to the detection device 2. In addition, about the component similar to Embodiment 7, the same code | symbol is attached | subjected and description is abbreviate | omitted.

外部機器5は、検出装置2との情報伝達に用いられる入出力インタフェース50と、検出装置2との間で通信を行う通信制御部51と、カウント値がカウンタ目標値に達した入力信号S1〜Snを報知する報知部52とを備えている。   The external device 5 includes an input / output interface 50 used for information transmission with the detection device 2, a communication control unit 51 that performs communication with the detection device 2, and input signals S1 to S1 that have reached a counter target value. And an informing unit 52 for informing Sn.

本実施形態の通信制御部23は、中央処理装置1との情報伝達を制御するとともに、外部機器5との情報伝達も制御する。通信制御部23は、カウント部24で入力信号S1〜Snごとにカウント値がカウンタ目標値に達したことを外部機器5に通知する。   The communication control unit 23 of the present embodiment controls information transmission with the central processing unit 1 and also controls information transmission with the external device 5. The communication control unit 23 notifies the external device 5 that the count unit 24 has reached the counter target value for each of the input signals S1 to Sn.

次に、本実施形態のカウンタシステムにおける通知動作について説明する。ここでは、入力信号S1を代表して説明するが、他の入力信号S2〜Snについても同様である。   Next, the notification operation in the counter system of this embodiment will be described. Here, the input signal S1 will be described as a representative, but the same applies to the other input signals S2 to Sn.

まず、検出装置2において、検出部21が有効エッジを検出し、カウント部24が有効エッジに基づいて、各入力信号S1〜Snのカウント値を更新する。ここで、カウント値がカウンタ目標値に達したとき、通信制御部23は、入力信号S1〜Snの識別情報をパラレルバス30で外部機器5に送信する。このとき、通信制御部23は、A信号Saをオフからオンにし、信号線31を介してオンのA信号Saを外部機器5に送信する。   First, in the detection device 2, the detection unit 21 detects a valid edge, and the count unit 24 updates the count values of the input signals S1 to Sn based on the valid edge. Here, when the count value reaches the counter target value, the communication control unit 23 transmits the identification information of the input signals S <b> 1 to Sn to the external device 5 through the parallel bus 30. At this time, the communication control unit 23 turns the A signal Sa from OFF to ON, and transmits the ON A signal Sa to the external device 5 through the signal line 31.

外部機器5の通信制御部51は、カウント値がカウンタ目標値に達した入力信号S1〜Snの識別情報を受信する。その後、通信制御部51は、B信号Sbをオフからオンにし、信号線32を介してオンのB信号Sbを検出装置2に送信する。   The communication control unit 51 of the external device 5 receives the identification information of the input signals S1 to Sn whose count value has reached the counter target value. Thereafter, the communication control unit 51 turns the B signal Sb from OFF to ON, and transmits the ON B signal Sb to the detection device 2 via the signal line 32.

検出装置2の通信制御部23は、オンのB信号Sbを受信すると、A信号Saをオンからオフにし、信号線31を介してオフのA信号Saを外部機器5に送信する。   When the communication control unit 23 of the detection device 2 receives the ON B signal Sb, the communication control unit 23 turns the A signal Sa from ON to OFF, and transmits the OFF A signal Sa to the external device 5 through the signal line 31.

外部機器5の通信制御部51は、オフのA信号Saを受信すると、B信号Sbをオンからオフにし、信号線32を介してオフのB信号Sbを検出装置2に送信する。   When receiving the off A signal Sa, the communication control unit 51 of the external device 5 turns the B signal Sb from on to off, and transmits the off B signal Sb to the detection device 2 via the signal line 32.

その後、検出装置2の通信制御部23は、オフのB信号Sbを受信する。   Thereafter, the communication control unit 23 of the detection device 2 receives the OFF B signal Sb.

以上、本実施形態によれば、ユーザは、入力信号S1〜Snごとにカウント値がカウンタ目標値に達したことを、外部機器5を通して知ることができる。   As described above, according to the present embodiment, the user can know through the external device 5 that the count value has reached the counter target value for each of the input signals S1 to Sn.

なお、実施形態8では、外部機器5と検出装置2とがパラレルバス30で接続される場合について説明したが、図9に示すように、外部機器5と検出装置2とがシリアルバス40(図3参照)で接続される場合においても、実施形態8と同様に、ユーザは、入力信号S1〜Snごとにカウント値がカウンタ目標値に達したことを、外部機器5を通して容易に知ることができる。   In the eighth embodiment, the case where the external device 5 and the detection device 2 are connected via the parallel bus 30 has been described. However, as shown in FIG. 9, the external device 5 and the detection device 2 are connected to the serial bus 40 (see FIG. 9). 3), the user can easily know through the external device 5 that the count value has reached the counter target value for each of the input signals S1 to Sn, as in the eighth embodiment. .

(実施形態9)
実施形態9のカウンタシステムは、図9に示すように、検出装置2にパラレルバス30で接続されるスイッチ6を備え、検出装置2がカウント部24を備える点で、実施形態1のカウンタシステム(図1参照)と相違する。なお、実施形態1と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 9)
As shown in FIG. 9, the counter system of the ninth embodiment includes a switch 6 connected to the detection device 2 via a parallel bus 30, and the detection device 2 includes a count unit 24. (See FIG. 1). In addition, about the component similar to Embodiment 1, the same code | symbol is attached | subjected and description is abbreviate | omitted.

スイッチ6は、ディップスイッチであり、各入力信号S1〜Snのカウント処理方式を設定するための設定部(設定手段)60と、検出装置2との情報伝達に用いられる入出力インタフェース61と、検出装置2との間で通信を行う通信制御部62とを備えている。   The switch 6 is a dip switch, and a setting unit (setting means) 60 for setting the count processing method of each of the input signals S1 to Sn, an input / output interface 61 used for information transmission with the detection device 2, and detection And a communication control unit 62 that performs communication with the apparatus 2.

本実施形態の通信制御部23は、設定部60で設定されたカウント処理方式をスイッチ6から受信する受信手段である。また、本実施形態の検出部21は、通信制御部23で受信されたカウント処理方式にしたがって入力信号S1〜Snの有効エッジを検出する。さらに、本実施形態のカウント部24は、通信制御部23で受信されたカウント処理方式にしたがってカウント処理を行う。   The communication control unit 23 according to the present embodiment is a receiving unit that receives the count processing method set by the setting unit 60 from the switch 6. Further, the detection unit 21 of the present embodiment detects the valid edges of the input signals S1 to Sn according to the count processing method received by the communication control unit 23. Furthermore, the count unit 24 of the present embodiment performs count processing according to the count processing method received by the communication control unit 23.

以上、本実施形態によれば、ユーザが、スイッチ6を介して各入力信号S1〜Snのカウント処理方式を容易に設定することができる。   As described above, according to the present embodiment, the user can easily set the count processing method of the input signals S1 to Sn via the switch 6.

なお、実施形態9の変形例として、スイッチ6の設定内容を各入力信号S1〜Snのカウント処理方式に代えて、入力時定数、各入力信号S1〜Snのカウント値の初期値又は各カウント値のカウンタ目標値の何れかにしてもよい。このような場合であっても、ユーザが、スイッチ6を介して設定内容を容易に設定することができる。   As a modification of the ninth embodiment, the setting content of the switch 6 is changed to the count processing method of the input signals S1 to Sn, the input time constant, the initial value of the count values of the input signals S1 to Sn, or the count values. Any of the counter target values may be used. Even in such a case, the user can easily set the setting content via the switch 6.

また、実施形態9では、スイッチ6と検出装置2とがパラレルバス30で接続される場合について説明したが、図10に示すように、スイッチ6と検出装置2とがシリアルバス40で接続される場合においても、実施形態9と同様に、ユーザは、スイッチ6を介して設定内容を容易に設定することができる。   In the ninth embodiment, the case where the switch 6 and the detection device 2 are connected by the parallel bus 30 has been described. However, as shown in FIG. 10, the switch 6 and the detection device 2 are connected by the serial bus 40. Even in this case, as in the ninth embodiment, the user can easily set the setting content via the switch 6.

(実施形態10)
実施形態10のカウンタシステムは、図1に示すように、複数の入力ポート20のそれぞれが割込入力ポートである点で、実施形態1のカウンタシステムと相違する。なお、実施形態1と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 10)
As shown in FIG. 1, the counter system of the tenth embodiment is different from the counter system of the first embodiment in that each of the plurality of input ports 20 is an interrupt input port. In addition, about the component similar to Embodiment 1, the same code | symbol is attached | subjected and description is abbreviate | omitted.

以上、本実施形態によれば、検出装置2は、エッジが発生した入力信号S1〜Snを優先して取得することができるので、遅延なくエッジを検出することができ、その結果、複数の入力信号S1〜Snを用いたカウント処理をより正確に行うことができる。   As described above, according to the present embodiment, since the detection device 2 can preferentially acquire the input signals S1 to Sn in which the edge is generated, the edge can be detected without delay, and as a result, a plurality of inputs can be detected. Count processing using the signals S1 to Sn can be performed more accurately.

(実施形態11)
実施形態11のカウンタシステムは、図1に示すように、メイン側入出力インタフェース10に割込入力ポートを含む点で、実施形態1のカウンタシステムと相違する。つまり、中央処理装置1は、検出装置2からの情報を割込入力ポートから取得する。なお、実施形態1と同様の構成要素については、同一の符号を付して説明を省略する。
(Embodiment 11)
The counter system of the eleventh embodiment is different from the counter system of the first embodiment in that an interrupt input port is included in the main input / output interface 10 as shown in FIG. That is, the central processing unit 1 acquires information from the detection device 2 from the interrupt input port. In addition, about the component similar to Embodiment 1, the same code | symbol is attached | subjected and description is abbreviate | omitted.

以上、本実施形態によれば、中央処理装置1が他の処理を行っている場合であっても、検出装置2からの割込入力によって、中央処理装置1は、カウント処理を優先的に行うことができる。その結果、複数の入力信号S1〜Snを用いたカウント処理をより正確に行うことができる。   As described above, according to the present embodiment, even when the central processing unit 1 performs other processing, the central processing unit 1 preferentially performs the counting process by the interrupt input from the detection device 2. be able to. As a result, the counting process using the plurality of input signals S1 to Sn can be performed more accurately.

なお、実施形態10,11の変形例として、実施形態2〜9においても適用することができる。また、実施形態10のような割込入力ポートである入力ポート20と、実施形態11のような割込入力ポートを含むメイン側入出力インタフェース10とを併用したものであってもよい。   In addition, it can apply also in Embodiment 2-9 as a modification of Embodiment 10,11. Further, the input port 20 that is an interrupt input port as in the tenth embodiment and the main-side input / output interface 10 including the interrupt input port as in the eleventh embodiment may be used in combination.

実施形態1,10,11に係るカウンタシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the counter system which concerns on Embodiment 1,10,11. 実施形態1に係るカウンタシステムの動作を示す図である。It is a figure which shows operation | movement of the counter system which concerns on Embodiment 1. FIG. 実施形態2に係るカウンタシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the counter system which concerns on Embodiment 2. 同上に係るカウンタシステムの動作を示す図である。It is a figure which shows operation | movement of the counter system which concerns on the same as the above. 実施形態3〜6に係るカウンタシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the counter system which concerns on Embodiment 3-6. 同上に係るカウンタシステムの動作を示す図である。It is a figure which shows operation | movement of the counter system which concerns on the same as the above. 実施形態7に係るカウンタシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the counter system which concerns on Embodiment 7. FIG. 実施形態8に係るカウンタシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the counter system which concerns on Embodiment 8. FIG. 実施形態9に係るカウンタシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the counter system which concerns on Embodiment 9. FIG. 同上の変形例に係るカウンタシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the counter system which concerns on a modification same as the above. 従来のカウンタシステムの構成を示すブロック図である。It is a block diagram which shows the structure of the conventional counter system. カウント処理方式を示す図である。It is a figure which shows a count processing system.

符号の説明Explanation of symbols

1 中央処理装置
10 メイン側入出力インタフェース
11 通信制御部
12 カウント部
2 検出装置
20 入力ポート
21 検出部
22 サブ側入出力インタフェース
23 通信制御部
S1〜Sn 入力信号
DESCRIPTION OF SYMBOLS 1 Central processing unit 10 Main side input / output interface 11 Communication control part 12 Count part 2 Detection apparatus 20 Input port 21 Detection part 22 Sub side input / output interface 23 Communication control part S1-Sn Input signal

Claims (16)

2値信号の入力信号をカウント処理方式にしたがってカウント処理することによって得られたカウント値を利用した処理を行う中央処理装置を備えるとともに、
異なる2値信号の入力信号が送信される入力線がそれぞれに接続される複数の入力ポートと、前記複数の入力ポートを介して入力された入力信号ごとに当該入力信号の有効エッジを検出する検出手段と、前記中央処理装置との間で通信を行う第1の通信制御手段とを有する検出装置を備え、
前記中央処理装置は、前記検出装置との間で通信を行う第2の通信制御手段を有し、
前記中央処理装置又は前記検出装置の何れかには、前記入力信号ごとに予め設定されたカウント処理方式に応じた前記有効エッジの情報を取得し、前記予め設定されたカウント処理方式にしたがってカウント処理を行ってカウント値を更新するカウント手段が設けられる
ことを特徴とするカウンタシステム。
A central processing unit that performs processing using the count value obtained by counting the input signal of the binary signal according to the count processing method;
A plurality of input ports to which input lines to which input signals of different binary signals are transmitted are connected to each other, and detection for detecting an effective edge of the input signal for each input signal input through the plurality of input ports And a detection device having first communication control means for communicating with the central processing unit,
The central processing unit has a second communication control means for communicating with the detection device,
Either the central processing unit or the detection device acquires information on the valid edge according to a preset count processing method for each input signal, and performs count processing according to the preset count processing method. The counter system is provided with a counting means for updating the count value by performing.
複数種類のカウント処理方式から一のカウント処理方式を選択するための設定手段を備え、
前記カウント手段は、前記設定手段で設定されたカウンタ処理方式にしたがってカウント処理を行う
ことを特徴とする請求項1記載のカウンタシステム。
A setting means for selecting one count processing method from a plurality of types of count processing methods,
The counter system according to claim 1, wherein the counting unit performs a counting process according to a counter processing method set by the setting unit.
前記検出手段が前記入力信号のエッジを検出してから一定レベルを継続して前記エッジを前記有効エッジとして取り込むまでの時間である入力時定数を設定するための設定手段を備えることを特徴とする請求項1記載のカウンタシステム。   It further comprises setting means for setting an input time constant that is a time from when the detecting means detects an edge of the input signal until a certain level is continued and the edge is taken as the effective edge. The counter system according to claim 1. 前記カウント値の開始値を設定するための設定手段を備え、
前記カウント手段は、前記設定手段で設定されたカウント値の開始値から前記カウント処理を開始する
ことを特徴とする請求項1記載のカウンタシステム。
Comprising setting means for setting a start value of the count value;
The counter system according to claim 1, wherein the counting unit starts the counting process from a start value of the count value set by the setting unit.
前記カウント値の終了値を設定するための設定手段を備え、
前記カウント手段は、前記設定手段で設定されたカウント値が前記終了値に達するまで前記カウント処理を行う
ことを特徴とする請求項1記載のカウンタシステム。
Setting means for setting an end value of the count value;
The counter system according to claim 1, wherein the counting unit performs the counting process until the count value set by the setting unit reaches the end value.
前記設定手段は前記中央処理装置に設けられることを特徴とする請求項2乃至5の何れか1項に記載のカウンタシステム。   The counter system according to claim 2, wherein the setting unit is provided in the central processing unit. 前記設定手段を有し前記検出装置に接続されるスイッチを備え、
前記検出装置は、前記設定手段で設定された設定内容を前記スイッチから受信する
ことを特徴とする請求項2乃至5の何れか1項に記載のカウンタシステム。
A switch having the setting means and connected to the detection device;
The counter system according to any one of claims 2 to 5, wherein the detection device receives the setting content set by the setting unit from the switch.
前記カウント手段で前記カウント値が前記終了値に達したときにその旨を他の機器に通知する通知手段を備えることを特徴とする請求項5記載のカウンタシステム。   6. The counter system according to claim 5, further comprising notification means for notifying other devices when the count value reaches the end value by the counting means. 前記検出装置は、前記カウント手段と、前記通知手段とを有し、
前記通知手段は、前記中央処理装置に通知する
ことを特徴とする請求項8記載のカウンタシステム。
The detection device includes the counting unit and the notification unit,
The counter system according to claim 8, wherein the notification unit notifies the central processing unit.
前記検出装置に接続される外部機器を備え、
前記検出装置は、前記カウント手段と、前記通知手段とを有し、
前記通知手段は、前記外部機器に通知する
ことを特徴とする請求項8記載のカウンタシステム。
An external device connected to the detection device;
The detection device includes the counting unit and the notification unit,
The counter system according to claim 8, wherein the notification unit notifies the external device.
前記カウント手段は前記中央処理装置に設けられ、
前記検出装置は、前記検出手段で前記有効エッジが検出されたときに、前記有効エッジが検出された入力信号を識別するビットの情報を前記有効エッジの情報として前記中央処理装置に送信する
ことを特徴とする請求項1乃至8の何れか1項に記載のカウンタシステム。
The counting means is provided in the central processing unit,
When the detection means detects the valid edge, the detection device transmits bit information identifying the input signal from which the valid edge is detected to the central processing unit as the valid edge information. The counter system according to any one of claims 1 to 8, characterized in that:
前記複数の入力ポートのそれぞれは割込入力ポートであることを特徴とする請求項1乃至11の何れか1項に記載のカウンタシステム。   The counter system according to any one of claims 1 to 11, wherein each of the plurality of input ports is an interrupt input port. 前記中央処理装置は、割込入力ポートを有し、前記検出装置からの情報を前記割込入力ポートから取得することを特徴とする請求項1乃至12の何れか1項に記載のカウンタシステム。   The counter system according to any one of claims 1 to 12, wherein the central processing unit has an interrupt input port, and acquires information from the detection device from the interrupt input port. 前記中央処理装置と前記検出装置とがパラレルバスで接続されることを特徴とする請求項1乃至13の何れか1項に記載のカウンタシステム。   The counter system according to claim 1, wherein the central processing unit and the detection device are connected by a parallel bus. 前記中央処理装置と前記検出装置とがシリアルバスで接続されることを特徴とする請求項1乃至13の何れか1項に記載のカウンタシステム。   The counter system according to any one of claims 1 to 13, wherein the central processing unit and the detection device are connected by a serial bus. 前記中央処理装置と前記検出装置とがマスタ・スレーブ通信によって通信が行われることを特徴とする請求項1乃至15の何れか1項に記載のカウンタシステム。   16. The counter system according to claim 1, wherein the central processing unit and the detection device communicate with each other by master / slave communication.
JP2008078816A 2008-03-25 2008-03-25 Counter system Withdrawn JP2009230722A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008078816A JP2009230722A (en) 2008-03-25 2008-03-25 Counter system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008078816A JP2009230722A (en) 2008-03-25 2008-03-25 Counter system

Publications (1)

Publication Number Publication Date
JP2009230722A true JP2009230722A (en) 2009-10-08

Family

ID=41245977

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008078816A Withdrawn JP2009230722A (en) 2008-03-25 2008-03-25 Counter system

Country Status (1)

Country Link
JP (1) JP2009230722A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107942894A (en) * 2016-10-13 2018-04-20 中国石油天然气集团公司 Primary input output sub-module and its diagnostic method, programmable logic controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107942894A (en) * 2016-10-13 2018-04-20 中国石油天然气集团公司 Primary input output sub-module and its diagnostic method, programmable logic controller
CN107942894B (en) * 2016-10-13 2019-12-10 中国石油天然气集团公司 Main input/output submodule, diagnosis method thereof and editable logic controller

Similar Documents

Publication Publication Date Title
JP2009272704A5 (en)
JP5177297B2 (en) Interface circuit, inverter device, inverter system, and transmission / reception method
JP2009230722A (en) Counter system
CN116737642A (en) SPI (serial peripheral interface) master device, interrupt method and system
US9791850B2 (en) Numerical control system
JP2017513283A (en) TX / RX mode control in a serial half-duplex transceiver away from the communicating host
JP2011123569A (en) Processor
JP2007228338A (en) Electronic control unit and transmitting method of electronic control unit
JPH109894A (en) Method for detecting abnormality of encoder signal in motor control device
JP6511457B2 (en) Multiple communication device
US9361788B2 (en) Receiver of remote control device
EP1520760A2 (en) Rotation detecting device
CN112923957B (en) Signal processing method and device for servo driver and encoder
KR20160108654A (en) High speed counter
JP6918849B2 (en) system
CN109753020B (en) Motor control device, control system, and motor control method
CN109768738A (en) Control device of electric motor, control system and method for motor control
KR101565584B1 (en) Method and Apparatus for Transmitting Data Based on SPI Communication
JP2019071554A (en) Electronic control device
JP4507888B2 (en) Microcomputer
JP2005275452A (en) Data transfer control system
KR20130055962A (en) System and method for controlling roof for vehicle
JP4463533B2 (en) Rotary encoder detection device
JP6428474B2 (en) Relay device
JP2010140244A (en) Control system

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20100811

A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20110607