JPS58184555A - Pulse counter - Google Patents

Pulse counter

Info

Publication number
JPS58184555A
JPS58184555A JP57069024A JP6902482A JPS58184555A JP S58184555 A JPS58184555 A JP S58184555A JP 57069024 A JP57069024 A JP 57069024A JP 6902482 A JP6902482 A JP 6902482A JP S58184555 A JPS58184555 A JP S58184555A
Authority
JP
Japan
Prior art keywords
memory
pulse
logic
power failure
recovery
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
JP57069024A
Other languages
Japanese (ja)
Other versions
JPH0378586B2 (en
Inventor
Hirohisa Mizuhara
博久 水原
Hidetaka Watanabe
渡辺 秀隆
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP57069024A priority Critical patent/JPS58184555A/en
Publication of JPS58184555A publication Critical patent/JPS58184555A/en
Publication of JPH0378586B2 publication Critical patent/JPH0378586B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R21/00Arrangements for measuring electric power or power factor
    • G01R21/133Arrangements for measuring electric power or power factor by using digital technique

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measurement Of Current Or Voltage (AREA)

Abstract

PURPOSE:To prevent possible pulse counting errors between the generation and recovery of power failure by inputting only a logic of an input signal direct into the preceding memory as sampled by the initial sampling pulse following the recovery of the power failure. CONSTITUTION:A microcomputer 7 handles a power failure detection circuit 21 and the processing for the generation and recovery of power failure. Steps 41-44 are executed in the operation other than the recovery of the power failure and when YES is given at the step 40, a logic of the input signal sampled by a sampling pulse at the moment is inputted direct into the preceding memory. When the power failure is recovered at the time 51e, the output logic of a flip-flop 20 at the pulse sampling time immediately after the time 51e is inputted into a preceding memory irrelevant to the contents of the preceding memory and the output logic of the flip-flop 20 at the pulse sampling time is inputted into the current memory. This eliminates counting errors free from the setting of the output logic of the flip-flop 20 with the recovery of the power failure.

Description

【発明の詳細な説明】 この発明tfr)IJ及びrLJで表される2値の電圧
レベルを有する信号が、レベル「H」からレベルrLJ
となる(以下立下りという〕回数、又はレベル「L」か
らレベルrHJとなる(以下立上りという)回数を計数
するパルス計数装置に関し、特に入力2値信号の波形が
幅の狭いパルス状である場合の処理に関するものである
DETAILED DESCRIPTION OF THE INVENTION This invention tfr) A signal having two voltage levels represented by IJ and rLJ varies from level "H" to level rLJ.
Regarding a pulse counting device that counts the number of times the level changes from level "L" to level rHJ (hereinafter referred to as "rising"), especially when the waveform of the input binary signal is a narrow pulse shape. This is related to the processing of

21図はマイクロコンピュータを用いて構成したパルス
計数装置の一例を示すブロック図で、fi+ 。
FIG. 21 is a block diagram showing an example of a pulse counting device configured using a microcomputer.

+21は信号入力端子、13+はホトカプラ、+41 
、 +51は抵抗、(6)は2値化機能を有するインバ
ータ、(7)はマイクロコンピュータ、(7a)は−人
出力部(以下I10と略記する)、(7b)はプロセッ
サ部(以下CPUと略記する)、(7c)はメモリであ
る。
+21 is a signal input terminal, 13+ is a photocoupler, +41
, +51 is a resistor, (6) is an inverter with a binarization function, (7) is a microcomputer, (7a) is a negative output unit (hereinafter abbreviated as I10), and (7b) is a processor unit (hereinafter referred to as CPU). (abbreviated) and (7c) are memories.

第2図は第1図の装着の動作を示すフロー図で、信号の
立下り点(レベル「H」からレベル「L」への変化点)
の数を計数する場合の各ステップを示す。インバータ(
61の出力信号のパルス幅に比して短い繰返し筒期を有
するサンプリングパルスを用いそのサンプリングパルス
ごとにCPU(7b) においてそのサンプリングパル
ス時点の入力信号のレベルを測定し今回メモリへ書込む
(ステップ(9))。
Figure 2 is a flowchart showing the mounting operation in Figure 1, and shows the falling point of the signal (the point of change from level "H" to level "L").
The following shows each step when counting the number of . Inverter (
For each sampling pulse, the CPU (7b) measures the level of the input signal at the time of the sampling pulse and writes it to the memory (step 61). (9)).

次に今回メモリの内容と前回メ゛モリ(後で説明する)
の内容とを比較しくステップ11(1) 、一致してお
ればステップa4に移シ今回メモリの内容を前回メモリ
へ書込む。初期状態においてはステップ回で常にYFS
となるように制御することが必蒙である。すなわち前回
メモリは1サンプリングパルス前の今回メモリの内容を
保持す□・るレジスタである。
Next, the contents of this memory and the previous memory (explained later)
Step 11(1): If they match, the process moves to step a4, where the contents of the current memory are written to the previous memory. In the initial state, it is always YFS in step times.
It is essential to control so that That is, the previous memory is a register that holds the contents of the current memory one sampling pulse ago.

ステツブ叫がNOで、かつステップaυで今回メモ1ノ
の内容がレベルrLJt示すとき柱入力信号がrHJか
らrLJに立下ったことを示すので、計数メモリに数値
lを加え(ステップ(2))、かつステップfi1の処
理を行う。W  と畳いである所では次のサンプリング
パルスの到来を待ち、次のサンプリングパルスが来ると
ステップ(9)から開始する。また、ステップ(111
でNOなら立上り点を示すのでステップα1を経てNE
XTにうつる。
When the step response is NO and the content of memo 1 shows the level rLJt at step aυ, it means that the column input signal has fallen from rHJ to rLJ, so add the value l to the counting memory (step (2)) , and performs the process of step fi1. At the point where W is folded, the next sampling pulse is waited for, and when the next sampling pulse arrives, the process starts from step (9). Also, step (111
If NO, it indicates the rising point, so go through step α1 and go to NE.
Transfer to XT.

第3図は入力信号とサンプリングパルスとの関係を示す
波形図で、23図(a) 、 (C)はそれぞれ入力信
号、同図(b)4サンプリングパルス、同図(d) 1
11mJ図(c)に示す入力信号の立下り点(31b)
、 (31a) 。
Figure 3 is a waveform diagram showing the relationship between the input signal and the sampling pulse. Figure 23 (a) and (C) are the input signal, Figure 23 (b) 4 sampling pulses, Figure 23 (d) 1.
Falling point (31b) of the input signal shown in 11mJ diagram (c)
, (31a).

(31f)、 (31h)  でトリガされて論理が反
転するフリップフロップの出力論理を示す。第3図(&
)に示す入力信号に対して扛サンプリングパルス(30
a )。
(31f) and (31h) show the output logic of a flip-flop whose logic is inverted when triggered by. Figure 3 (&
) for the input signal shown in
a).

(aob)の間、(30e)、(30d)の間、(30
e)、(3Of)の間で第2図ステップ叫で(資)、 
ステップaυでYESとなりステップ(6)で立下シ点
が計数されるが、オニ:・、j□1: 3図伽)に示す入力信号に対して扛サンプリングパルス
の埼期が入力信号のパルス幅より長いために、サンプリ
ングパルスが入力信号のパルス幅内に1本も存在せずし
たがって立下り点(31b)、(31d)。
(aob), (30e), (30d), (30
Between e) and (3Of), step shout in Figure 2 (equipment),
YES in step aυ, and falling points are counted in step (6), but the peak of the sampling pulse for the input signal shown in Figure 3) is the pulse of the input signal. Since the sampling pulse is longer than the width, there is no sampling pulse within the pulse width of the input signal, so the falling points (31b), (31d).

(31f)、(31h)のうち計数もれとなるものが生
ずる。
Among (31f) and (31h), some count omissions occur.

このような場合は第3図(00波形から第3図(d)の
波形を発生し、(32b)、 (32d) 、 (32
f) 、 (32h)を計数すればよい。
In such a case, the waveform shown in Fig. 3(d) is generated from the Fig. 3 (00 waveform), and (32b), (32d), (32
f) , (32h) can be counted.

第4図社従来の装置の他の例を示すブロック図で、;l
?1図と同一符号は同一部分を示し■はT形フリツ17
0ツブである。インバータ+61の出力が第3図(c)
に示すものであるとき、フリップフロップ■の出力端子
Qの論理は第3図(d)のようになり、これを入力し第
2図のステップant省略すれば(32b)、(32d
)、(32f)、(32h)の点を検出できることは明
らかである。
Figure 4 is a block diagram showing another example of the conventional device;
? The same symbols as in Figure 1 indicate the same parts, and ■ indicates the T-type fritz 17.
It is 0. The output of inverter +61 is shown in Figure 3(c).
, the logic of the output terminal Q of the flip-flop ■ becomes as shown in FIG. 3(d), and if this is input and step ant in FIG.
), (32f), and (32h) can be detected.

しかし、24図に示す(ロ)路でまたん停電が発生し次
に停電が復旧したと仮定し、マイクロコンピュータ(7
)の中では停電対策が施されていて、たとえば停電直前
のデータを不揮発性メモリに退避しておいて停電復旧後
に退避したデータをもとのレジスタへ戻すのであるが、
フリップフロップ(2)の出力論理がどうなるか4不定
であるので、第4図の回路によると7リツプフロツプ■
の状態によってパルス1個分の計数誤差を生ずることが
あるという欠点であった。
However, assuming that a power outage occurs again on road (b) shown in Figure 24 and then the power outage is restored, the microcomputer (7
) has measures against power outages, such as saving the data immediately before the power outage to non-volatile memory and returning the saved data to the original register after the power outage is restored.
Since the output logic of the flip-flop (2) is uncertain, according to the circuit shown in Figure 4, the output logic of the flip-flop (2) is 7.
This has the disadvantage that a counting error of one pulse may occur depending on the state of the pulse.

この発明社従来の装置における。上述の欠点を除去する
ためになされたもので、停電発生と停電後出との間にパ
ルス計数誤差が発生することのないパルス計数装置を提
供することを目的としている。
In the conventional device of this inventor. The present invention has been made in order to eliminate the above-mentioned drawbacks, and it is an object of the present invention to provide a pulse counting device in which a pulse counting error does not occur between the occurrence of a power outage and the exit after a power outage.

以下、図面によってこの発明の詳細な説明する。第5図
に停電及び停電復旧金倉む信号波形を示す波形図で、第
5図(励は入力信号波形、第5図(ト))は入力信号波
形の立下り点(50a)、(50b)、(50c)。
Hereinafter, the present invention will be explained in detail with reference to the drawings. Fig. 5 is a waveform diagram showing signal waveforms during power outage and power outage recovery. , (50c).

(sOf)、(5cg)、でトリガされて出力論理が反
転する7 1Jツブ70ツブの出力を示し、(50d)
、(51d)が停電発生、(sow)、(ste)が停
電復旧点を示す。第6図はこの発明の一実施例を示すブ
ロック図で、第4図と同一符号は同一部分を示し、(2
りは停電検出回路である。停電検出回路(21)と停電
時及び停電復旧時の処理については一般に知られている
ので説明を省略するが、マイクロコンピュータ(71は
このような処理装置を備えているものとする。
(sOf), (5cg), shows the output of 7 1J tube 70 tube whose output logic is inverted by triggering, (50d)
, (51d) indicate the occurrence of a power outage, and (sow) and (ste) indicate the power outage recovery point. FIG. 6 is a block diagram showing an embodiment of the present invention, in which the same reference numerals as in FIG. 4 indicate the same parts, and (2
This is a power outage detection circuit. Since the power failure detection circuit (21) and the processing at the time of power failure and power failure recovery are generally known, their explanation will be omitted, but it is assumed that the microcomputer (71) is equipped with such a processing device.

オフ図は第6図の動作を示すフロー図で、(”)〜(4
5)  t!それぞれプログラムステップを示し、第2
図と比較しく9)と(41) 、Q(l ト(42) 
、62 ト(43)、α鳥と(44〕が対応しステップ
quit省略されステップ(40)と(45〕が付加さ
れている。したがって停電の復旧以外は第4図の回路と
同様にステップ(41)〜(44)が実行されるが、ス
テップ(4りでYESとなるとその時点のサンプリング
パルスによってサンプルされた入力信号の論理を直接前
回メモリへ入力する。すなわち(51e)で停電が復旧
したときは前回メモリの内容がどうなっていても(51
e)時点の直後のサンプリングパルス時点の7リツプフ
ロツブ■の出力論理を前回メモリに入力しくステップ(
45) ) %  その次のサンプリングパルス時点の
7リツプ70ツブ(4)の出力°論理を今回メモリに入
力する(ステップ(41))ので、停電復旧によって7
リツプフロツプ□□□の出力論理がどう設定さ:111
・ れようとも計数誤差を発生することはない。
The off-line diagram is a flowchart showing the operation of Figure 6, and shows the steps from ('') to (4).
5) T! Each shows a program step, and the second
Comparing with the figure, 9) and (41), Q(l and (42)
, 62 (43), α (44) correspond, and the step (quit) is omitted and steps (40) and (45) are added. Therefore, except for the recovery from a power outage, the steps ( 41) to (44) are executed, but if YES in step 4, the logic of the input signal sampled by the sampling pulse at that time is directly input into the previous memory. In other words, in (51e) the power outage is restored. At that time, no matter what the contents of the memory were last time (51
e) Step (
45) ) % Since the output degree logic of 7 rip 70 tube (4) at the time of the next sampling pulse is entered into the memory this time (step (41)), the 7
How is the output logic of the lipflop □□□ set: 111
・No matter what happens, no counting error will occur.

なお上記実施例では入力信号回路は1回路の場合につい
て説明したが、複数の入力信号回路の場合も同様の手順
を各回路について行えばよい。更にl10(7a)  
に入力される信号波形にノイズが重畳しているような場
合、複数個のサンプリングパルスに対して同一の論理が
連続しているときにはじめて入力信号が当該論理にある
として処理することがあるが、このような場合において
もこの発明を利用することができる。
In the above embodiment, the case where there is one input signal circuit has been described, but in the case of a plurality of input signal circuits, the same procedure may be performed for each circuit. Furthermore l10 (7a)
When noise is superimposed on the signal waveform input to the input signal, the input signal may be processed as having the same logic only when the same logic continues for multiple sampling pulses. , the present invention can be utilized even in such cases.

なお、第6図はマイクロコンピュータ171 t−使用
する実施例を示したが、オフ図の動作を実行する専用の
回路を構成することも容易である。
Although FIG. 6 shows an embodiment using the microcomputer 171t, it is also easy to construct a dedicated circuit for executing the operations shown in the off-line diagram.

以上のようにこの発明によれば、幅の狭いパルス状の2
値信号においてパルスを計数する場合においても、停電
と停電復旧によりv4計数を発生することのないパルス
計数装置を提供することができる。
As described above, according to the present invention, narrow pulse-like two
Even when counting pulses in a value signal, it is possible to provide a pulse counting device that does not generate v4 counting due to power outage and power outage recovery.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図はマイクロコンピュータを用いて構成した従来の
パルス計数装置の一例を示すブロック図、第2図Fi才
1図の装置の動作を示すフロー図、第3図は入力信号と
サンプリングパルスとの関係を示す波形図、第4図は従
来の装置の他の例を示すブロック図、第5図は停電及び
停電復旧を含む信号波形を示す波形図、第6図はこの発
明の一実施例を示すブロック図、オフ図は第6図の動作
を示すフロー図である。 !11 、 +21・・・信号入力端子、(3;・・・
ホトカブラ、(61・・・インバータ、(7)・・・マ
イクロコンピユー1、(7a)・・・Ilo 1(7b
) −CPLT 、  (7c) −・−1−E 17
、(20)−T 形フリップフロップ、(21)・・・
停電検出回路。 なお、図中同一符号は同−又は相当部分を示す。 代理人 葛 野 信 − 第5図 第6図 第7図 NEX’r 特許庁長官殿               6.1(
1)Il 1、  ’INi□    、、□g 57−0690
24号         (2、発明の名称 パルス針数装置 3、補正をする者 代表者片山仁へ部 4、代理人 の対象 の発明の詳細な説I!Aos+ 1正O内容 qait書第3頁第16行目「常KYFSJとあるヒ「
常にYES Jと訂正する。 以上
Fig. 1 is a block diagram showing an example of a conventional pulse counting device configured using a microcomputer, Fig. 2 is a flow diagram showing the operation of the device shown in Fig. 1, and Fig. 3 is a block diagram showing an example of a conventional pulse counting device configured using a microcomputer. 4 is a block diagram showing another example of a conventional device, FIG. 5 is a waveform diagram showing signal waveforms including power outage and power restoration, and FIG. 6 is a waveform diagram showing an example of the present invention. The block diagram and off-line diagram shown are flowcharts showing the operation of FIG. 6. ! 11, +21...signal input terminal, (3;...
Photocoupler, (61... Inverter, (7)... Microcomputer 1, (7a)... Ilo 1 (7b
) -CPLT, (7c) -・-1-E 17
, (20)-T type flip-flop, (21)...
Power failure detection circuit. Note that the same reference numerals in the figures indicate the same or equivalent parts. Agent Makoto Kuzuno - Figure 5 Figure 6 Figure 7 NEX'r Commissioner of the Japan Patent Office 6.1 (
1) Il 1, 'INi□,,□g 57-0690
No. 24 (2, Name of the invention Pulse stitch count device 3, Person making the amendment Representative Hitoshi Katayama Part 4, Detailed explanation of the invention that is the object of the agent I! Aos+ 1 Positive O Contents Qait Book Page 3, No. 16 Line ``Tokyo KYFSJ and Aruhi''
Always correct with YES J. that's all

Claims (1)

【特許請求の範囲】[Claims] 2値の電圧レベルを有する信号が電圧レベルを反転して
所定の電圧レベルとなる回数を計数するパルス計数装置
において、上記信号を入力しその電圧レベルが反転して
上記所定の電圧レベルとなる時点の信号変化によってト
リガされて出力論理が反転するフリップフロップと、所
定の周期を有するサンプリングパルスにより上記フリッ
プフロップの出力論理をサンプリングしその最も新しい
サンプリング点の論理を記憶する今回メモリと、この今
回メモリの内容が今回メモリに入力された時点から1サ
ンプリング周期遅れ九時点で入力される前回メモリと、
上記今回メモリの内容が上記前回メモリの内容と異る論
理となるごとに数値lが加算されるカウンタと、上記今
回メモリ、上記前回メモリ及び上記カウンタの内容を装
置の停電時に不揮発性メモリに退避し停電復旧時に上記
不揮発性メモリからそれぞれ上記今回メモリ、上記前回
メモリ及び上記カウンタに設定する手段と、上記停電復
旧後の最初のサンプリングパルスによりサンプリングし
た上記入力信号の論理に限り直接上記前回メモリに入力
する手段とを備えたことを特徴とするパルス計数装置。
In a pulse counting device that counts the number of times a signal having a binary voltage level inverts its voltage level to reach a predetermined voltage level, the point at which the signal is input and its voltage level inverts to reach the predetermined voltage level. a flip-flop whose output logic is inverted when triggered by a signal change; a current memory that samples the output logic of the flip-flop using a sampling pulse having a predetermined period and stores the logic at the latest sampling point; The previous memory is input at a time point nine sampling cycles later than the time when the contents were input to the memory this time,
A counter to which a value l is added each time the contents of the current memory have a different logic from the contents of the previous memory, and the contents of the current memory, the previous memory, and the counter are saved to nonvolatile memory in the event of a power outage of the device. and a means for setting the current memory, the previous memory, and the counter from the nonvolatile memory, respectively, when the power is restored, and a means for setting the logic of the input signal sampled by the first sampling pulse after the power is restored directly to the previous memory. A pulse counting device comprising: means for inputting information.
JP57069024A 1982-04-22 1982-04-22 Pulse counter Granted JPS58184555A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP57069024A JPS58184555A (en) 1982-04-22 1982-04-22 Pulse counter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP57069024A JPS58184555A (en) 1982-04-22 1982-04-22 Pulse counter

Publications (2)

Publication Number Publication Date
JPS58184555A true JPS58184555A (en) 1983-10-28
JPH0378586B2 JPH0378586B2 (en) 1991-12-16

Family

ID=13390595

Family Applications (1)

Application Number Title Priority Date Filing Date
JP57069024A Granted JPS58184555A (en) 1982-04-22 1982-04-22 Pulse counter

Country Status (1)

Country Link
JP (1) JPS58184555A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0268527U (en) * 1988-11-14 1990-05-24

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0268527U (en) * 1988-11-14 1990-05-24

Also Published As

Publication number Publication date
JPH0378586B2 (en) 1991-12-16

Similar Documents

Publication Publication Date Title
JPH0743653B2 (en) Interrupt controller
JP2595314B2 (en) IC card with erroneous writing prevention function
WO1981000481A1 (en) Information processing system for error processing,and error processing method
JPH0129093B2 (en)
JPS58184555A (en) Pulse counter
US4096471A (en) Method and apparatus for transfer of asynchronously changing data words
JPH0133052B2 (en)
JPS5827247A (en) Logical device
SU408376A1 (en) DEVICE FOR THE CONTROL OF DISCHARGE CURRENTS IN THE DRIVE OF INFORMATION
JP3609601B2 (en) Timer circuit with self-diagnosis function
SU572846A1 (en) Memory control block
JPH0635998B2 (en) Capture device
JPS58197535A (en) Data transfer circuit
RU2122282C1 (en) Redundant pulse counter
SU1672527A1 (en) Buffer memory
JP3963135B2 (en) Nonvolatile memory test control method
SU1101827A1 (en) Redundant system
SU797078A1 (en) Pulse counting device
JPH06103469B2 (en) Memory control circuit
JPS6111771Y2 (en)
JP2020177667A (en) Electronic circuit
SU1487050A1 (en) Branch monitoring unit
KR100207481B1 (en) Detecting time adjustment equipment to detect data during desire period
RU2103815C1 (en) Redundant counter
JPS63306716A (en) Pulse count system