Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH081561B2 - Programmable controller - Google Patents
[go: Go Back, main page]

JPH081561B2 - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JPH081561B2
JPH081561B2 JP63306495A JP30649588A JPH081561B2 JP H081561 B2 JPH081561 B2 JP H081561B2 JP 63306495 A JP63306495 A JP 63306495A JP 30649588 A JP30649588 A JP 30649588A JP H081561 B2 JPH081561 B2 JP H081561B2
Authority
JP
Japan
Prior art keywords
output
input
counter
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.)
Expired - Fee Related
Application number
JP63306495A
Other languages
Japanese (ja)
Other versions
JPH02151905A (en
Inventor
昌彦 福田
健五 植木
利彦 浅井
泰治 九鬼
重明 谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Keyence Corp
Original Assignee
Keyence Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Keyence Corp filed Critical Keyence Corp
Priority to 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)

Description

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

〔従来の技術〕[Conventional technology]

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

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

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

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

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

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

〔課題を解決するための手段〕[Means for solving the problem]

本発明は、上記目的を達成するために、制御プログラ
ム等を格納するROMと、ユーザプログラム、入出力デー
タ等が格納されるRAMと、ユーザプログラムの実行手段
を有し、データの入力、ユーザプラグラムの実行、出力
をサイクリックに行うプログラマブルコントローラにお
いて、外部からのデータ入力手段と、該データ入力手段
からの入力クロックを計数するカウンタと、該カウンタ
の現在値を設定値と比較して結果を出力する比較手段
と、該比較手段の出力をユーザプラグラムから制御する
比較出力制御手段と、該比較出力制御手段からの出力に
より駆動される出力手段と、を有するプログラマブルコ
ントローラを構成するものである。
In order to achieve the above-mentioned object, the present invention has a ROM for storing a control program and the like, a RAM for storing a user program, input / output data and the like, and a user program execution means for inputting data and a user program. In a programmable controller that cyclically executes and outputs, a data input unit from the outside, a counter that counts an input clock from the data input unit, and a current value of the counter is compared with a set value and a result is output. And 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.

〔作用〕[Action]

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

〔実施例〕〔Example〕

本発明の詳細を図示した実施例に基づいて説明する。 The details of the present invention will be described 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, reference numeral 1 denotes a central processing procedure (hereinafter referred to as CPU) for executing a user program and controlling data input / output.

2は制御用プログラムその他を格納するROM、3はユ
ーザプログラム、入出力データ等が格納されるRAMであ
る。
Reference numeral 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は出力リレー等
が設けられてなる出力手段である。
Reference numeral 4 is data input means from the outside, and 5 is output means provided with an output relay and the like.

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

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

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

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

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

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

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

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

そして、出力はカウントアップした次の1スキャンの
みONする。
Then, the output turns on only for the next one scan that has been counted up.

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

また、本発明のプログラマブルコントローラは、高速
カウンタの現在値を設定値と比較する命令CTR88〜95を
有しており、OVE入力がONで、設定値≦現在値の時、ア
ドレスNo.0500〜0507の接点の内の1つを出力ONし、OLE
入力がONで、設定値≦現在値<次のNoのカウンタの設定
値の時、No.0500〜0507の接点のうちの1つを出力させ
るものである。
Further, the programmable controller of the present invention has instructions CTR88 to 95 for comparing the current value of the high speed counter with the set value. When the OVE input is ON and the set value is equal to or less than the current value, the address No. 0500 to 0507 is set. Output of one of the contacts of
When the input is ON and the set value ≤ the current value <the set value of the next No counter, one of the contacts No. 0500 to 0507 is output.

第3図において、CTR88はOVE入力がONで、OLE入力がO
FFであり、カウンタCTR86のカウンタ値が6になった
時、出力リレーNo.0500に出力をするものである。
In Figure 3, CTR88 has OVE input ON and OLE input O
It is FF, and when the counter value of the counter CTR86 reaches 6, it outputs to the output relay No. 0500.

第2図に示すようにデータ選択手段14のデータ選択器
11によって選択されたCTR86のカウント値の現在値は、
比較手段8の比較器12の入力Aに入力される。
As shown in FIG. 2, the data selector of the data selecting means 14
The current value of the count value of CTR86 selected by 11 is
It 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 and the current value of the counter CTR86 immediately, and when the coincidence or the count value is larger, the comparator 12 causes the comparison output control means. Generate output to 9.

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

CTR88の接点は、ユーザプログラムのソフト上のもの
であるため、プログラマブルコントロールのスキャンタ
イムの中に取り込まれてONし、この為実際の比較一致時
より遅れが生じて、従来例と同様に計測誤差を生じるも
のである。
Since the contact of CTR88 is on the software of the user program, it is turned on by being taken in during the scan time of the programmable control, which causes a delay from the time when the actual comparison coincides and the measurement error similar to the conventional example. Is caused.

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

ここで、CTR88のOVE入力ON、OLE入力OFFで用いたが、
これを変更すれば、同一の比較器を用いて出力を変更す
ることができる。
I used it with OVE input ON and OLE input OFF of CTR88,
If this is changed, the output can be changed using the same comparator.

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

〔発明の効果〕〔The invention's effect〕

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

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

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

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

第1図は本発明に係るプログラマブルコントローラの実
施例の簡略ブロック図、第2図は本発明の要部説明用回
路図、第3図は本発明で使用するユーザプログラムの一
例を示すラダーチャートである。 1:CPU、2:ROM、 3:RAM、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 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. is there. 1: CPU, 2: ROM, 3: RAM, 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.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 九鬼 泰治 大阪府高槻市明田町2番13号 株式会社キ ーエンス内 (72)発明者 谷 重明 大阪府高槻市明田町2番13号 株式会社キ ーエンス内 (56)参考文献 特開 昭62−256102(JP,A) 特開 昭63−116210(JP,A) 特開 昭61−161507(JP,A) ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Taiji Kuki 2-13, Akedacho, Takatsuki-shi, Osaka, inside Keyence Co., Ltd. (72) Inventor Shigeaki Tani, 2-13 Akedacho, Takatsuki-shi, Osaka Keyence, Inc. (56) References JP-A-62-256102 (JP, A) JP-A-63-116210 (JP, A) JP-A-61-161507 (JP, A)

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】制御プログラム等を格納するROMと、ユー
ザプログラム、入出力データ等が格納されるRAMと、ユ
ーザプログラムの実行手段を有し、データの入力、ユー
ザプログラムの実行、出力をサイクリックに行うプログ
ラマブルコントローラにおいて、 外部からのデータ入力手段と、 該データ入力手段からの入力クロックを計数するカウン
タと、 該カウンタの現在値を設定値と比較して結果を出力する
比較手段と、 該比較手段の出力をユーザプログラムから制御する比較
出力制御手段と、 該比較出力制御手段からの出力により駆動される出力手
段と、 を有するプログラマブルコントローラ。
1. A ROM for storing a control program and the like, a RAM for storing a user program, input / output data and the like, and a user program execution means for cyclically inputting data, executing the user program and outputting the data. In the programmable controller, the external data input means, a counter for counting the input clock from the data input means, a comparison means for comparing the current value of the counter with a set value and outputting the result, A programmable controller comprising: comparison output control means for controlling the output of the means from a user program; and 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 JPH02151905A (en) 1990-06-11
JPH081561B2 true 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)

Family Cites Families (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
JPH0731526B2 (en) * 1986-04-30 1995-04-10 オムロン株式会社 Programmable controller
JPH0638210B2 (en) * 1986-11-05 1994-05-18 三菱電機株式会社 Sequence controller input / output control system

Also Published As

Publication number Publication date
JPH02151905A (en) 1990-06-11

Similar Documents

Publication Publication Date Title
US5367550A (en) Break address detecting circuit
JP2003513249A (en) Apparatus for measuring the spacing between signal edges
JPH081561B2 (en) Programmable controller
JPH08139575A (en) Pulse output circuit
JP2773546B2 (en) Pulse generation circuit
JPH11305812A (en) Synchronization method for distributed CPU system
JP3990331B2 (en) Time correction control circuit, time correction control method, and time correction control program
JPH0875876A (en) Time a/d converting apparatus
JP4345200B2 (en) Programmable controller I/O unit
US5325514A (en) Program executive timing apparatus for ensuring that state changes of a reference clock signal used to time the execution of the program are not missed
JP2906254B2 (en) Programmable controller
JP3694225B2 (en) Computer system and system time adjustment method
JP2631541B2 (en) Programmable controller
JPS5842991A (en) Time device
JPH0278967A (en) Period measuring circuit
WO1990012456A1 (en) Frequency multiplier circuitry and method
JP3424585B2 (en) Timing pulse generation circuit and timing pulse generation method
JPH01263740A (en) Micro-computer
JPH04254764A (en) Trigger generator for measuring pri
JPH05188066A (en) Servo motor speed detecting device
KR940000220B1 (en) Command word process system of program logic controller
JPS60122436A (en) Programmable watchdog timer
JPH07120166B2 (en) Sequence control device
JP2002183110A (en) Microcomputer and count processing method
JPH03100473A (en) Pulse train input processor

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