JPH02151905A - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JPH02151905A
JPH02151905A JP30649588A JP30649588A JPH02151905A JP H02151905 A JPH02151905 A JP H02151905A JP 30649588 A JP30649588 A JP 30649588A JP 30649588 A JP30649588 A JP 30649588A JP H02151905 A JPH02151905 A JP H02151905A
Authority
JP
Japan
Prior art keywords
output
counter
input
user program
programmable controller
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
JP30649588A
Other languages
Japanese (ja)
Other versions
JPH081561B2 (en
Inventor
Masahiko Fukuda
昌彦 福田
Kengo Ueki
植木 健五
Toshihiko Asai
浅井 利彦
Taiji Kuki
九鬼 泰治
Shigeaki Tani
谷 重明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Keyence Corp
Original Assignee
Keyence Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Keyence Corp filed Critical Keyence Corp
Priority to JP63306495A priority Critical patent/JPH081561B2/en
Publication of JPH02151905A publication Critical patent/JPH02151905A/en
Publication of JPH081561B2 publication Critical patent/JPH081561B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

PURPOSE:To prevent the generation of an error and to attain accurate measurement by comparing the output value of a counter with a set value, and at the time of coincidence of both the values, generating an output to remove the deviation of the count values. CONSTITUTION:For instance, a programmable controller is constituted of a CPU 1, a ROM 2, a RAM 3, an input means 4, an output means 5, a counter input control means 6, a counter 7, a comparing means 8, a compared output control means 9, a chip select circuit 10, and a data selecting means 14. When a count value counted by the counter 7 coincides with the set value, a compared output control means 9 is controlled from a user program to drive the output means 5. Consequently, an output error is removed and accurate measurement can be attained.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、外部からの入力クロックを計数するカウンタ
を内蔵し、入力、ユーザプログラムの実行、出力をサイ
クリックに行うプログラマブルコントローラに関するも
のである。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a programmable controller that includes a built-in counter that counts externally input clocks and performs input, user program execution, and output cyclically. .

〔従来の技術〕[Conventional technology]

外部からのクロック人力を取り込んでこれを計数するカ
ウンタを有するプログラマブルコン1−ローラにおいて
、カウンタの現在値を設定値と比較して出力する方法は
、従来はソフトウェア上で行っていた。
In a programmable controller having a counter that takes in clock input from the outside and counts it, the method of comparing the current value of the counter with a set value and outputting the result has conventionally been performed on software.

この為、入力、ユーザプログラムの実行、出力を1サイ
クルとしてスキャンする場合には、このスキャンタイム
に依存して出力されるので、カウンタの現在値が設定値
に達した時と出力時との間に、カウントクロック数ケ分
のずれが生じるものである。
Therefore, when scanning input, user program execution, and output as one cycle, the output depends on this scan time, so there is a gap between when the current value of the counter reaches the set value and when it is output. In this case, a shift of several count clocks occurs.

このようなプログラマブルコントローラのカウンタを、
例えば、一定の長さを計測するような場合に用いると、
比較出力の遅れが原因となって、計測に誤差を生じるこ
ととなる。
The counter of such a programmable controller is
For example, when used to measure a certain length,
The delay in comparison output causes measurement errors.

このことは、カウンタが高速になる程、出力時のカウン
ト値のずれは大きく、計測の誤差が大きくなるものであ
る。
This means that the higher the speed of the counter, the greater the deviation in the count value at the time of output, and the greater the measurement error.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

本発明は、上記問題点に鑑みて、クロック人力を計数す
るカウンタを有するプログラマブルコントローラにおい
て、カウンタのカウント値を設定値と比較して、これが
一致した時、出力を発生して、カウント値のずれをなく
し、誤差の発生を防止して正確な計測を行うことができ
るプログラマブルコントローラの提供を目的とするもの
である。
In view of the above-mentioned problems, the present invention provides a programmable controller having a counter that counts human clock power, which compares the count value of the counter with a set value, and when they match, generates an output and corrects the deviation of the count value. The object of the present invention is to provide a programmable controller that can perform accurate measurements by eliminating errors and preventing the occurrence of errors.

〔課題を解決する〆めの手段〕[Final means to solve the problem]

本発明は、上記目的を達成するために、制御プログラム
等を格納するROMと、ユーザプログラム、入出力デー
タ等が格納されるRAMと、ユーザプログラムの実行手
段を有し、データの入力、ユーザプログラムの実行、出
力をサイクリックに行つプログラマブルコントローラに
おいて、外部からのデータ入力手段と、該データ入力手
段からの入力クロックを計数するカウンタと、該カウン
タの現在値を設定値と比較して結果を出力する比較手段
と、該比較手段の出力をユーザプログラムから制御する
比較出力制御手段と、該比較出力制御手段からの出力に
より駆動される出力手段と、を有するプログラマブルコ
ントローラを構成するものである。
In order to achieve the above object, the present invention has a ROM for storing a control program, etc., a RAM for storing a user program, input/output data, etc., and a means for executing a user program. A programmable controller that cyclically performs execution and output, includes an external data input means, a counter that counts input clocks from the data input means, and a result by comparing the current value of the counter with a set value. The programmable controller includes a comparison means for outputting an output, a comparison output control means for controlling the output of the comparison means from a user program, and an output means driven by the output from the comparison output control means.

〔作用〕[Effect]

本発明に係るプログラマブルコントローラは上述のよう
な構成でなり、カウンタが計数するカウント値と設定値
が一致した時、比較出力制御手段をユーザプログラムか
ら制御して出力手段を駆動し、出力の誤差をなくし、正
確な計測を行うものである。
The programmable controller according to the present invention has the above-described configuration, and when the count value counted by the counter matches the set value, the comparison output control means is controlled from the user program to drive the output means, thereby eliminating the error in the output. This is to ensure accurate measurements.

〔実施例〕〔Example〕

本発明の詳細を図示した実施例に基づいて説明する。 The details of the present invention will be explained based on illustrated embodiments.

第1図は、本発明に係るプログラマブルコントローラの
実施例の簡略ブロック図である。
FIG. 1 is a simplified block diagram of an embodiment of a programmable controller according to the present invention.

図中1は、ユーザプログラムの実行を行い、データの人
出力を制御する中央処理処置(以下CPUと称す)であ
る。
In the figure, 1 is a central processing unit (hereinafter referred to as CPU) that executes a user program and controls human output of data.

2は制御用プログラムその他を格納するROM、3はユ
ーザプログラム、入出力データ等が格納されるRAMで
ある。
2 is a ROM that stores control programs and the like, and 3 is a RAM that stores user programs, input/output data, and the like.

4は、外部からのデータ入力手段、5は出力リレー等が
設けられてなる出力手段である。
4 is an external data input means, and 5 is an output means provided with an output relay and the like.

7は、入力手段4から入力されるデータを計数するカウ
ンタであり、カウンタ制御回路6によって入力されるク
ロック人力、リセット信号によって制御される。
A counter 7 counts data input from the input means 4, and is controlled by a clock input and a reset signal input by the counter control circuit 6.

8は、カウンタ7から入力されるカウンタの現在値を設
定値と比較してその結果を比較出力制御手段9に出力す
る比較手段である。
Comparing means 8 compares the current value of the counter inputted from the counter 7 with a set value and outputs the result to the comparison output control means 9.

比較出力制御手段9は、比較手段8の比較結果をCPU
Iが処理するユーザプログラムより制御して出力手段5
に出力するものである。
The comparison output control means 9 outputs the comparison result of the comparison means 8 to the CPU.
The output means 5 is controlled by the user program processed by I.
This is what is output to.

10は、セレクト信号を発生するチップセレクト回路で
ある。
10 is a chip select circuit that generates a select signal.

第2図は、本発明の要部説明用回路図、第3図は本発明
で使用するユーザプログラムの一例を示すラダーチャー
トである。
FIG. 2 is a circuit diagram for explaining essential parts of the present invention, and FIG. 3 is a ladder chart showing an example of a user program used in the present invention.

本発明のプログラマブルコントローラでは、CTR86
、CTR87の2つのカウンタを有しており、データ選
択手段14のデータ選択器11によって2つのカウンタ
の現在値データが選択される。
In the programmable controller of the present invention, CTR86
, CTR87, and the data selector 11 of the data selection means 14 selects the current value data of the two counters.

このカウンタCTR86,87は、ユーザプログラム中
で設定されるもので、lから設定値までのオートリセッ
トアップカウンタの動作をする命令であり、固定された
クロック入力、リセット入力を有し、ユーザプログラム
より入力可能なENB入力、リセット入力を有するもの
である。
These counters CTR86 and 87 are set in the user program, and are instructions for operating an auto-reset counter from l to a set value, and have fixed clock inputs and reset inputs, and are input from the user program. It has possible ENB input and reset input.

このカウンタは、ENB入力がONであり、クロック入
力がOFF→ONになった時、カウント値が+1加算さ
れ、また、ハード、ソフトの両リセットのいずれかがO
Nするとカウント値は0になる。
This counter is incremented by +1 when the ENB input is ON and the clock input is turned from OFF to ON, and when either the hardware or software reset is turned ON.
When N is reached, the count value becomes 0.

そして、出力はカウントアツプした次の1スキヤンのみ
ONする。
Then, the output is turned ON only for the next scan after counting up.

例えば、第3図に示すCTR86は、ENB入力ONで
、カウント値20までクロックを計数すると自動的にリ
セットされる。
For example, the CTR 86 shown in FIG. 3 is automatically reset when the ENB input is ON and the clocks are counted up to a count value of 20.

また、本発明のプログラマブルコントローラは、高速カ
ウンタの現在値を設定値と比較する命令CTR88〜9
5を有しており、OVE入力がONで、設定値≦現在値
の時、アドレスNo、0500〜0507の接点の内の
1つをダイレクト出力ONL、OLE人力がONで、設
定値≦現在値〈次のNoのカウンタの設定値の時、No
、0500〜0507の接点のうちの1つをダイレクト
出力させるものである。
The programmable controller of the present invention also uses instructions CTR88 to CTR9 to compare the current value of the high-speed counter with a set value.
5, when the OVE input is ON and the set value ≦ the current value, one of the contacts at address No. 0500 to 0507 is directly output ONL, and when the OLE input is ON, the set value ≦ the current value <At the time of the next No counter setting value, No.
, 0500 to 0507, one of the contacts is directly output.

第3図において、CTR88はOVE入力がONで、O
LE入力がOFFであり、カウンタCTR86のカウン
ト1直が6になった時、出力リレーNo、0500にダ
イレクト出力をするものである。
In Figure 3, the OVE input of CTR88 is ON, and the OVE input is ON.
When the LE input is OFF and the count 1 of the counter CTR86 reaches 6, a direct output is made to the output relay No. 0500.

第2図に示すようにデータ選択手段14のデータ選択器
11によって選択されたCTR86のカウント値の現在
値は、比較手段8の比較器12の入力Aに入力される。
As shown in FIG. 2, the current count value of the CTR 86 selected by the data selector 11 of the data selection means 14 is input to the input A of the comparator 12 of the comparison means 8.

ここで、CTR88の設定値が与えられるBと前述の入
力A、即ちカウンタCTR86の現在値とが比較され、
一致またはカウント値の方が大の時は、比較器12は、
比較出力制御手段9に出力を発生する。
Here, B to which the set value of CTR88 is given is compared with the above-mentioned input A, that is, the current value of counter CTR86,
When the match or the count value is greater, the comparator 12
An output is generated in the comparison output control means 9.

比較出力制御手段9の出方制御回路13は、この比較器
12の出力に基づいて駆動されるが、CTR8817)
OVE入力がON、OLE入力がOFFである為、出力
制御回路13はCTR88の接点及び出力リレーNo、
0500をONさせる。
The output control circuit 13 of the comparison output control means 9 is driven based on the output of this comparator 12, and CTR8817)
Since the OVE input is ON and the OLE input is OFF, the output control circuit 13 connects the CTR88 contact and output relay No.
Turn on 0500.

CTR88の接点は、ユーザプログラムのソフト上のも
のであるため、プログラマブルコントローラのスキャン
タイムの中に取り込まれてONL、この為実際の比較一
致時より遅れが生して、従来例と同様に計測誤差を生じ
るものである。
Since the CTR88 contacts are in the software of the user program, they are incorporated into the programmable controller's scan time and ONL, resulting in a delay from the actual comparison match, resulting in measurement errors as in the conventional example. It is something that causes

ここで、出力リレーNo、0500は、外部端子に接続
されており、比較器12がONした時点で出力制御回路
13によって駆動されて出力するので、スキャンタイム
に依存して遅れを生じることがないものである。
Here, the output relay No. 0500 is connected to an external terminal and is driven by the output control circuit 13 and outputs when the comparator 12 is turned on, so there is no delay depending on the scan time. It is something.

ここで、CTR88のOVE入力ON、OLE入力OF
Fで用いたが、これを変更すれば、同一の比較器を用い
て出力を変更することができ゛る。
Here, CTR88 OVE input ON, OLE input OF
Although it was used in F, if this is changed, the output can be changed using the same comparator.

また、比較器としてCTR8B〜95を有しており、出
力制御回路13を変更することによって出力の方法を変
更することが可能であり、更に複雑な出方の方法も可能
となるものである。
Furthermore, CTRs 8B to 95 are provided as comparators, and by changing the output control circuit 13, the output method can be changed, and more complicated output methods are also possible.

〔発明の効果〕〔Effect of the invention〕

本発明に係るプログラマブルコントローラは、上述のよ
うにしてなり、カウンタが計数するカウント値を設定値
と比較して出力する比較出力制御手段をユーザプログラ
ムがら制御して出力をさせる、出力の時間的な誤差をな
くすものである。
The programmable controller according to the present invention is configured as described above, and the comparison output control means that compares the count value counted by the counter with a set value and outputs the result is controlled by a user program to cause the output to be output in a temporal manner. This eliminates errors.

このことにより、スキャンによる出力の遅れがなくなる
ので、正確な計測を行うことが可能となるものである。
This eliminates the delay in output due to scanning, making it possible to perform accurate measurements.

また、内蔵するカウンタを高速にしても、正確に出力す
ることが可能となるものである。
Furthermore, even if the built-in counter is set to high speed, it is possible to output accurately.

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

第1図は本発明に係るプログラマブルコントローラの実
施例の簡略ブロック図、第2図は本発明の要部説明用回
路図、第3図は本発明で使用するユーザプログラムの一
例を示すラダーチャートである。 t:cpu、        2:ROM、3 : R
AM、        4 :入力手段、5:出力手段
、 6:カウンタ入力制御手段、 7:カウンタ、     8:比較手段、9:比較出力
制御手段、 10:チップセレクト回路、11:データ選択器、12
:比較器、      13:出力制御回路、14:デ
ータ選択手段。
FIG. 1 is a simplified block diagram of an embodiment of a programmable controller according to the present invention, FIG. 2 is a circuit diagram for explaining the main parts of the present invention, and FIG. 3 is a ladder chart showing an example of a user program used in the present invention. be. t: CPU, 2: ROM, 3: R
AM, 4: Input means, 5: Output means, 6: Counter input control means, 7: Counter, 8: Comparison means, 9: Comparison output control means, 10: Chip select circuit, 11: Data selector, 12
: Comparator, 13: Output control circuit, 14: Data selection means.

Claims (1)

【特許請求の範囲】 1)制御プログラム等を格納するROMと、ユーザプロ
グラム、入出力データ等が格納されるRAMと、ユーザ
プログラムの実行手段を有し、データの入力、ユーザプ
ログラムの実行、出力をサイクリックに行うプログラマ
ブルコントローラにおいて、 外部からのデータ入力手段と、 該データ入力手段からの入力クロックを計数するカウン
タと、 該カウンタの現在値を設定値と比較して結果を出力する
比較手段と、 該比較手段の出力をユーザプログラムから制御する比較
出力制御手段と、 該比較出力制御手段からの出力により駆動される出力手
段と、 を有するプログラマブルコントローラ。
[Scope of Claims] 1) A ROM that stores a control program, etc., a RAM that stores a user program, input/output data, etc., and a user program execution means, which is capable of inputting data, executing the user program, and outputting the user program. A programmable controller that cyclically performs the following: a data input means from the outside, a counter that counts input clocks from the data input means, and a comparison means that compares the current value of the counter with a set value and outputs the result. A programmable controller comprising: a comparison output control means for controlling the output of the comparison means from a user program; and an output means driven by the output from the comparison output control means.
JP63306495A 1988-12-02 1988-12-02 Programmable controller Expired - Fee Related JPH081561B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63306495A JPH081561B2 (en) 1988-12-02 1988-12-02 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63306495A JPH081561B2 (en) 1988-12-02 1988-12-02 Programmable controller

Publications (2)

Publication Number Publication Date
JPH02151905A true JPH02151905A (en) 1990-06-11
JPH081561B2 JPH081561B2 (en) 1996-01-10

Family

ID=17957710

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63306495A Expired - Fee Related JPH081561B2 (en) 1988-12-02 1988-12-02 Programmable controller

Country Status (1)

Country Link
JP (1) JPH081561B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61161507A (en) * 1985-01-11 1986-07-22 Toshiba Mach Co Ltd Direct input/output system of programmable controller
JPS62256102A (en) * 1986-04-30 1987-11-07 Omron Tateisi Electronics Co Programmable controller
JPS63116210A (en) * 1986-11-05 1988-05-20 Mitsubishi Electric Corp Input/output control system for sequence controller

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61161507A (en) * 1985-01-11 1986-07-22 Toshiba Mach Co Ltd Direct input/output system of programmable controller
JPS62256102A (en) * 1986-04-30 1987-11-07 Omron Tateisi Electronics Co Programmable controller
JPS63116210A (en) * 1986-11-05 1988-05-20 Mitsubishi Electric Corp Input/output control system for sequence controller

Also Published As

Publication number Publication date
JPH081561B2 (en) 1996-01-10

Similar Documents

Publication Publication Date Title
JPH02151905A (en) Programmable controller
JPH08139575A (en) Pulse output circuit
US10180661B2 (en) Frequency division circuit, method of controlling frequency division circuit, and analog electronic timepiece
US4941160A (en) Frequency multiplier circuitry and method
JP3538358B2 (en) Programmable controller
US11803208B2 (en) Timer calibration method and electronic device
JPS63200918A (en) Electric discharge machine
JPH0712861A (en) Method and apparatus for measuring pulse frequency
JPS62289012A (en) Duty control pulse generating circuit
JPH0278967A (en) Period measuring circuit
JPH01263740A (en) Micro-computer
JPH0392904A (en) Programmable controller
JPS59154818A (en) Pulse period check circuit
JPH01147644A (en) Programmable controller
JPH04254764A (en) Trigger generator for measuring pri
JPH0410726A (en) Instrument for counting delay time of network
JPS61297025A (en) Wire electric discharge machine
JPH0648912B2 (en) Motor control device
JPH07281650A (en) Horizontal frequency detection circuit
JPS63313014A (en) Reoutput pulse generating device
JP2003244281A (en) Ring frequency detecting circuit and dial pulse generating circuit
JPS6298265A (en) Speed detecting device
JP2003329412A (en) Method and device for outputting acceptance/rejection of measuring instrument
JPH0221302A (en) Output method for pulse width modulation signal
JPH03113376A (en) Driving method for indicating instrument

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees