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
JPS5951002B2 - Sequence controller with counter function - Google Patents
[go: Go Back, main page]

JPS5951002B2 - Sequence controller with counter function - Google Patents

Sequence controller with counter function

Info

Publication number
JPS5951002B2
JPS5951002B2 JP4483476A JP4483476A JPS5951002B2 JP S5951002 B2 JPS5951002 B2 JP S5951002B2 JP 4483476 A JP4483476 A JP 4483476A JP 4483476 A JP4483476 A JP 4483476A JP S5951002 B2 JPS5951002 B2 JP S5951002B2
Authority
JP
Japan
Prior art keywords
signal
register
count
input
control circuit
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
Application number
JP4483476A
Other languages
Japanese (ja)
Other versions
JPS52127574A (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.)
Toyoda Koki KK
Original Assignee
Toyoda Koki KK
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 Toyoda Koki KK filed Critical Toyoda Koki KK
Priority to JP4483476A priority Critical patent/JPS5951002B2/en
Publication of JPS52127574A publication Critical patent/JPS52127574A/en
Publication of JPS5951002B2 publication Critical patent/JPS5951002B2/en
Expired legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Description

【発明の詳細な説明】 本発明はカウンタ機能を有するシーケンスコントローラ
に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a sequence controller having a counter function.

一般にシーケンスコントローラにおいては、シーケンス
制御情報がサイクリツクに読出されるようになつている
Generally, in a sequence controller, sequence control information is read out cyclically.

このためプログラムによつてカウンタ機能を与えるには
、カウントすべき入力信号の一演算サイクル前の論理値
に対する変化を検出し、その論理値変化の検出信号のみ
を各演算サイクル毎に読出されるカウンタ命令に基づき
計数し、カウント設定値と比較し一致した場合のみカウ
ントアップ信号を出力しなければならない。かかる入力
信号の論理値変化の計数値及びカウンタ設定値の記憶は
、一般にカウンタ用に用いられた専用のレジスタに記憶
されるようになつており、このレジスタの容量によつて
使用できるカウンタの最大数は制約されることになる。
従つてシーケンス制御対象によつてはカウンタを多数必
要とする場合があるが、想定されるカウンタの最大数を
満足すべ<大容量のレジスタを設けておくことは不経済
である。さりとてレジスタの容量を小さくしておけば必
要とするカウンタ数が確保できない場合もあリプログラ
ム作成上支障をきたすことになる。又かかる専用レジス
タに計数値及び設定値を記憶するものにおいては、カウ
ンタ用の指定アドレスが特定のアドレスとなり、一般の
シーケンス制御用の入力、出力機器アドレスとかけはな
れたものとなる。
Therefore, in order to provide a counter function by a program, it is necessary to detect a change in the logic value of the input signal to be counted from one operation cycle before, and then create a counter that reads only the detection signal of the change in logic value at each operation cycle. It counts based on the command, compares it with the count setting value, and outputs a count-up signal only when they match. The count value of the logical value change of the input signal and the counter setting value are generally stored in a dedicated register used for the counter, and the maximum number of usable counters depends on the capacity of this register. The number will be limited.
Therefore, depending on the sequence control object, a large number of counters may be required, but it is uneconomical to provide a large capacity register to satisfy the expected maximum number of counters. However, if the capacity of the register is made small, it may not be possible to secure the required number of counters, which may cause problems in reprogramming. In addition, in the case where count values and set values are stored in such a dedicated register, the designated address for the counter is a specific address, which is different from the input and output device addresses for general sequence control.

よつて関連するシーケンス制御系には系統的な入力、出
力アドレスを割当てた方が保守上有利であるが、カウン
タに対しては系統的なアドレスを割当てることは不可能
であつた。本発明はかかる従来の欠点をなくすべく、必
要とするカウンタ数を任意に増減できるようにするため
に、計数値及び設定値はシーケンスプログラムメモリ内
に記憶させ、カウンタに対しても制御系統に関連した任
意のアドレスの割り当てができるようにカウントすべき
入力信号状態及びカウントアツプ信号等は入力、出力機
器と同様にアドレス指定できる外部の記憶要素に記憶保
持させるようにしたものである。
Therefore, it is more advantageous in terms of maintenance to allocate systematic input and output addresses to related sequence control systems, but it has been impossible to allocate systematic addresses to counters. In order to eliminate such conventional drawbacks, the present invention stores count values and set values in a sequence program memory, so that the number of required counters can be increased or decreased arbitrarily, and the counters are also related to the control system. Input signal states to be counted, count-up signals, etc. are stored and held in external storage elements that can be addressed in the same way as input and output devices so that arbitrary addresses can be assigned.

以下本発明の実施例により説明する。The present invention will be explained below using examples.

第1図において、シーケンスコントローラ100の概略
構成を示す。10はシーケンス制御情報の記憶されるメ
モリ、11はメモリ10のアドレスを指定するプログラ
ムカウンタ、12はメモリゲート、13は命令コードが
プリセツトされる命令語レジス夕、14はアドレスデー
タがプリセツトされるアドレスレジスタ、15は命令コ
ードをデコードするデコーダ、16は演算制御回路、1
7はデータバス、18はリミツトスイツチ、押釦スイツ
チ等の入力機器18aが接続される入力回路、19は出
力リレー、ソレノイド等の出力機器19aが接続される
出力回路である。
In FIG. 1, a schematic configuration of a sequence controller 100 is shown. 10 is a memory in which sequence control information is stored, 11 is a program counter that specifies the address of the memory 10, 12 is a memory gate, 13 is an instruction word register in which an instruction code is preset, and 14 is an address in which address data is preset. 1 is a register, 15 is a decoder for decoding the instruction code, 16 is an arithmetic control circuit, 1
7 is a data bus, 18 is an input circuit to which input devices 18a such as limit switches and push button switches are connected, and 19 is an output circuit to which output devices 19a such as output relays and solenoids are connected.

入力回路18は信号変換回路20と選択回路21で構成
され、前記入力機器18aの信号状態を信号変換回路2
0でレべル変換し、選択回路21がアドレスデータにて
指定される1つの信号を選択し、演算制御回路16に信
号ライン22を通じて与える。出力回路19は信号保持
変換回路23とデコード回路24と選択回路25で構成
され、前記出力機器19aの作動状態は信号保持変換回
路23にて記憶保持され、この記憶保持要素をデコード
回路24がアドレスデータにより指定し、演算制御回路
16から与えられる出力信号SON,SOFによりセツ
ト状態またはリセツト状態に設定される。かかる信号保
持変換回路23が前記外部記憶要素をなしている。又選
択回路25は信号保持要素の1つを選択しその信号状態
を信号ライン22に出力する。ここにメモl川0に記憶
されるシーケンス制御情報は第2図に示すように命令コ
ードとアドレスコードにて一語を成している。命令コー
ドは演算の内容を指定し、アドレスコードは演算すべき
入力機器18a又は出力機器19aを指定するものであ
る。命令コードにはテスト命令(TNA.TFA、TN
O.TFO.TNE.TFE)と出力命令(YON)と
カウンタ命令(CTR)があり、各命令コードはデコー
ダ15にて判別され、演算制御装置16の演算内容を制
御する。
The input circuit 18 is composed of a signal conversion circuit 20 and a selection circuit 21, and converts the signal state of the input device 18a into the signal conversion circuit 20.
0, the selection circuit 21 selects one signal specified by the address data, and supplies it to the arithmetic control circuit 16 through the signal line 22. The output circuit 19 is composed of a signal holding/converting circuit 23, a decoding circuit 24, and a selection circuit 25. The operating state of the output device 19a is stored and held in the signal holding/converting circuit 23, and the decoding circuit 24 addresses this memory holding element. It is specified by data and set to a set state or a reset state by output signals SON and SOF given from the arithmetic control circuit 16. This signal holding conversion circuit 23 constitutes the external storage element. Further, the selection circuit 25 selects one of the signal holding elements and outputs its signal state to the signal line 22. As shown in FIG. 2, the sequence control information stored in the memory 0 consists of an instruction code and an address code. The instruction code specifies the content of the operation, and the address code specifies the input device 18a or output device 19a to perform the operation. The instruction code includes test instructions (TNA.TFA, TN
O. TFO. TNE. TFE), an output command (YON), and a counter command (CTR), and each command code is discriminated by a decoder 15 and controls the calculation contents of the calculation control unit 16.

26はクロツタ制御回路で、後述する演算を遂行するた
めのタイミングパルスを発生する。
26 is a crotter control circuit that generates timing pulses for performing calculations to be described later.

一演算サイタルは第3図に示すようにクロツクCL1〜
CL6によつて制御される。CL1によつてメモリ10
の読出しが行われ、CL3で命令レジスタ13及びアド
レスレジスタ14に読出されたデ一夕がプリセツトされ
る。命令コードがテスト命令である場合にはCL5で信
号ライン22を通じて与えられる信号状態(アドレスデ
ータにて指定された入力機器]8aの信号状態)を演算
制御回路16にて論理演算し、その演算結果を後述する
テストフラツグに記憶する。又、命令コードが出力命令
である場合にはCL5で、演算結果に応じた出力信号S
ON,SOFを出力回路19に与え、アドレスデ一夕に
て指定された出力機器19aを付勢又は無勢する。とこ
ろで前記命令コードがカウンタ命令 (CTR)であるとタロツク制御回路26はタロツクC
L6に続いてCL「〜CL6″を発生し、この一連のタ
ロックCL1〜CL6,CL「〜CL6″で一演算サイ
クルが行われる。
As shown in FIG.
Controlled by CL6. Memory 10 by CL1
is read out, and the data read out to the instruction register 13 and address register 14 are preset at CL3. If the instruction code is a test command, the signal state (the signal state of the input device specified by the address data) 8a given through the signal line 22 at CL5 is logically operated by the arithmetic control circuit 16, and the operation result is is stored in a test flag, which will be described later. If the instruction code is an output instruction, CL5 outputs an output signal S according to the operation result.
ON and SOF are applied to the output circuit 19 to energize or de-energize the output device 19a specified by the address data. By the way, if the instruction code is a counter instruction (CTR), the tally control circuit 26
Following L6, CL "~CL6" is generated, and one calculation cycle is performed with this series of taroks CL1 to CL6 and CL "~CL6".

そしてCL1″で再びメモ1川0の読出しが行われ、C
L3″で読出されたデータは第1図に示すAレジスタ2
7及びBレジスタ28にプリセツトされる。Aレジスタ
27はカウント設定値がプリセツトされ、Bレジスタ2
8はカウント現在値がプリセツトされ、両レジスタ27
, 28の内容は比較器29にて比較され、カウントア
ツプの検出が行われる。Bレジス夕28は後述する演算
制御回路16にてカウントすべき入力信号の論理値変化
を検出する度にカウント信号が与えられクロツクCL4
″のタイミングで現在値をカウントアツプしていく。ま
たクロツクCL5″ではBレジスタ28の内容がメモリ
10に書込まれ、1スキヤニングの後再び功ウンタ命令
が読出されるまで格納される。カウンタ機能は第4図の
ように通常図示される。
Then, reading of memo 1 river 0 is performed again at CL1'', and C
The data read at L3'' is stored in A register 2 shown in FIG.
7 and B register 28. The A register 27 has a preset count value, and the B register 2
8 is preset with the current count value, and both registers 27
, 28 are compared by a comparator 29, and a count-up is detected. The B register 28 receives a count signal every time the arithmetic control circuit 16, which will be described later, detects a change in the logical value of an input signal to be counted.
At clock CL5'', the current value is counted up. Also, at clock CL5'', the contents of the B register 28 are written into the memory 10, and stored there until the counter instruction is read out again after one scan. The counter function is typically illustrated as in FIG.

これをプログラムすると第1表のようになる。暴蟲 」
曙 −V 〜H′〜.′1ζ1−?′
〜 ノu卜J−I?′又、このカウンタのカウント
アツプにより制御される回路は第5図のように図示され
、これをプログラムすると第2表のようになる。
If you program this, it will look like Table 1. Violent insects”
Akebono -V ~H'~. '1ζ1-? ′
~ Nou Boku J-I? 'Furthermore, the circuit controlled by the count-up of this counter is shown in FIG. 5, and when programmed, it becomes as shown in Table 2.

轟見f轟d6V−暴ν 更に、このカウンタをクリヤする回路は第6図のように
図示され、これをプログラムすると第3表のようになる
Todoroki f Todoro d6V-Vitov Furthermore, a circuit for clearing this counter is shown in FIG. 6, and when programmed, it becomes as shown in Table 3.

これらのプログラム例からもわかるように、1つのカウ
ンタ機能に対しY1とY1+1とY1+2の3つのアド
レスが使用され、カウンタ命令CTRとと・もに与えら
れるアドレスY1にはカウントすべき入力信号を記憶し
、Y1+1にはカウンタをクリヤする信号を記憶し、こ
れらは外部の記憶要素として設けられている。
As can be seen from these program examples, three addresses, Y1, Y1+1, and Y1+2, are used for one counter function, and the input signal to be counted is stored in the address Y1 given with the counter instruction CTR. However, a signal for clearing the counter is stored in Y1+1, and these are provided as external storage elements.

これによつてカウンタ命令とともにカウントアツプ及び
カウンタクリヤのアド″レスを制御系統と関連した任意
のアドレスに割り当てることがで゛きることになる。第
1表に示すプログラムによる作用を簡単に述べると、n
番地より読出されるプログラムTNAX1は入力信号X
1がオンかどうかを論理演算する命令であり、演算制御
回路16がこの演算を行い、演算結果をテストフラツグ
に記憶する。
This makes it possible to assign the counter instruction as well as the count up and counter clear addresses to any address related to the control system.The operation of the program shown in Table 1 can be briefly described as follows. n
The program TNAX1 read from the address is the input signal
This is an instruction for logically calculating whether or not 1 is on. The calculation control circuit 16 performs this calculation and stores the calculation result in the test flag.

n+1番地のCTRY1命令はカウンタ命令であり、テ
ストフラツグに記憶された入力信号X1の演算結果に応
じてクロツクCL5のタイミングで出力機器Y1が制御
される。すなわち入力信号X1がオンであればY1もオ
ンに、X1がオフであればY1もオフに制御される。一
方演算制御回路16はオンまたはオフ状態に変化する前
のY1の信号状態を取込み、この取込んだY1の信号と
入力信号X1との論理積を演算して論理値変化(オフか
らオンへの変化)を検出し、テストフラツグに記憶する
。力ウント命令の場合はクロツタCL1〜CL6に続い
てクロツクCL「〜CL6″も発生されるようになり、
クロツクCL『によりn+2番地の読出しが行われる。
このメモリ番地にはカウント設定値10と現在値(初期
値は0)が記憶されており、これらの値は読出され、ク
ロツクCL3″により設定値はAレジスタ27に、現在
値はBレジスタ28にプリセツトされる。そしてテスト
フラツグに記憶された「0」→「1」への論理値変化検
出信号があればBレジスタ28にカウント信号を与えて
現在値を+1する。また論理値変化検出信号がなければ
カウント信号は与えられない。両レジスタ27と28の
内容は比較器29で比較されているので一致信号が出れ
ば後述するようにアドレスレジスタ14に与えられるク
ロツクCL1″,CL3″により最初の指定アドレスY
1を+2加算した出力機器Y1+2をオンにセツトしカ
ウントアツプ信号を保持させる。これと同時にA.Bレ
ジスタ27,28の内容はメモ1川0に書込まれる。し
たがつて一致信号が出ない場合には出力機器Y1+2は
オンにならずA.B両レジスタ27, 28の内容の書
込みだけが行われる。前記アドレスレジスタ14にはク
ロツクCL1″によつて指定アドレスY1が+1された
段階ではY1+1を指定する。
The CTRY1 instruction at address n+1 is a counter instruction, and the output device Y1 is controlled at the timing of the clock CL5 in accordance with the calculation result of the input signal X1 stored in the test flag. That is, if the input signal X1 is on, Y1 is also controlled to be on, and if X1 is off, Y1 is also controlled to be off. On the other hand, the arithmetic control circuit 16 takes in the signal state of Y1 before changing to the on or off state, calculates the logical product of the taken-in signal of Y1 and the input signal X1, and changes the logical value (from off to on). change) is detected and stored in the test flag. In the case of a power count command, a clock CL "~CL6" is also generated following the clocks CL1 to CL6.
Reading of address n+2 is performed by clock CL'.
The count setting value 10 and the current value (initial value is 0) are stored in this memory address, and these values are read out and the setting value is transferred to the A register 27 and the current value to the B register 28 by the clock CL3''. If there is a logic value change detection signal from "0" to "1" stored in the test flag, a count signal is given to the B register 28 to increment the current value by one. Further, if there is no logic value change detection signal, no count signal is given. The contents of both registers 27 and 28 are compared by the comparator 29, so if a match signal is output, the first designated address Y is determined by the clocks CL1'' and CL3'' given to the address register 14, as will be described later.
The output device Y1+2, which has added 1 to +2, is set on to hold the count-up signal. At the same time, A. The contents of B registers 27 and 28 are written to memo 1 and 0. Therefore, if a matching signal is not output, output device Y1+2 will not be turned on and A. Only the contents of the B registers 27 and 28 are written. When the specified address Y1 is incremented by 1 by the clock CL1'', Y1+1 is specified in the address register 14.

このY1+1の出力機器は第3表に示すプログラムによ
つてカウンタをクリヤすベき条件が成立した場合にオン
にセツトされる。このY1+1の信号状態を演算制御回
路16はクロツクCL3″の時点で演算し、その演算結
果によりクロツクCL4″の時点でBレジスタ28の内
容をクリヤすべきかしないかを制御する。更にアドレス
レジスタ14はCL4″によつて指定アドレスY1+1
が+1されY1+2を指定する。この指定アドレスY1
+2に上記のように比較器29から一致信号が出ればカ
ウントアツプ信号が記憶される。したがつてカウントア
ツプにより制御されるシ.ーケンスは第2表のm番地に
示すようにY1+2をアドレス指定して、カウントアツ
プ信号がオンかどうかをテストするようにしなければな
らない。次に演算制御回路14の具体的構成を第7図に
より説明する。この演算制御回路14は前述したlよう
にテスト命令TNA.TFA.TNO.TFO、TNE
.TFEに基づき入力信号の論理積演算及び論理和演算
を行うとともにカウントすべき入力信号の論理値変化を
検出する論理積演算器30,31並びに論理和演算器3
2, 33と、この演算器1の出力によつて出力信号S
ON,SOFを出力する回路34、カウント信号を出力
する回路35、カウント現在値をクリヤする信号を出力
する回路37とから構成され前記論理値変化の検出はこ
れらの回路によつて行われる。
ジ論理積演算器論理積演算器30, 31はDフリツ
プフロツプ40, 41とナンドゲート42, 43に
よつて主に構成される。
This output device Y1+1 is set to ON when a condition for clearing the counter is satisfied by the program shown in Table 3. The arithmetic control circuit 16 calculates the signal state of Y1+1 at the clock CL3'', and controls whether or not to clear the contents of the B register 28 at the clock CL4'' based on the calculation result. Furthermore, the address register 14 is set to the specified address Y1+1 by CL4''.
is +1 and designates Y1+2. This specified address Y1
If a match signal is output from the comparator 29 at +2 as described above, a count-up signal is stored. Therefore, the system controlled by count-up. The sequence must address Y1+2 as shown at address m in Table 2 to test whether the count up signal is on. Next, the specific configuration of the arithmetic control circuit 14 will be explained with reference to FIG. This arithmetic control circuit 14 receives the test command TNA. T.F.A. TNO. TFO, TNE
.. AND operators 30, 31 and OR operator 3 that perform AND operations and OR operations on input signals based on TFE, and detect changes in logical values of input signals to be counted.
2, 33, and the output of this arithmetic unit 1, the output signal S
It is composed of a circuit 34 that outputs ON and SOF, a circuit 35 that outputs a count signal, and a circuit 37 that outputs a signal that clears the current count value, and the detection of the logical value change is performed by these circuits.
The logical product operators 30 and 31 are mainly composed of D flip-flops 40 and 41 and NAND gates 42 and 43.

信号ライン22と接続された端子39に与えられる入力
信号は、アンドゲート4,4、オアゲート45を介して
ナンドゲート42に与えられ、演算結果を記憶するDフ
リツプフロツプ40の信号と論理積の演算が行われ、そ
の結果はテスト命令TNAが与えられた場合のみクロツ
クCL5によりトリガされて再びDフリツプフロツプ4
0に記憶される。また前記入力信号はインバータ46を
介してナンドゲート43に与えられ、演算結果を記憶す
るDフリツプフロツプ41の信号と論理積の演算が行わ
れ、その結果はテス卜命令TFAが与えられている場合
のみクロツクCL5によりトリガされて再びDフリツプ
フロツプ41に記憶される。入力信号がオンの場合には
、前記ナンドゲート42に論理値「1」の信号(以下単
に信号「1」と呼ぶ)がそのまま入力されることにより
Dフリツプフロツプ40のD端子に論理値「0」の信号
(以下単に信号「0」と呼ぶ)が与えられ、テスト命令
によりこのフリツプフロツプがトリガされてもリセツト
状態が保たれ、論理積成立を記憶する。入力信号がオフ
であればD端子に信号「1」が与えられDフリツプフロ
ツプ40はセツトされ論理積不成立を記憶する。また入
力信号がオフの場合には、ナンドゲート43にインバー
タ46で反転された信号「1」が入力されることにより
Dフリツプフロツプ41のD端子には信号「0」が与え
られ、リセツト状態が保持され論理積成立を記憶する。
入力信号がオンであればD端子に信号「1」が与えられ
Dフリツプフロツプ41はセツトされ論理積不成立が記
憶される。即ち論理積演算器30は入力信号がオンであ
るかどうかを演算し、論理積演算器31は入力信号がオ
フであるかどうかを演算し、両演算器30,31の演算
結果はアンドゲート47より出力される。論理和演算器 論理和演算器32, 33はDフリツプフロツプ50,
51とオアゲート52, 53にて主に構成される。
The input signal applied to the terminal 39 connected to the signal line 22 is applied to the NAND gate 42 via the AND gates 4, 4 and the OR gate 45, and is ANDed with the signal of the D flip-flop 40 that stores the operation result. The result is triggered by the clock CL5 and sent to the D flip-flop 4 again only when the test command TNA is given.
Stored as 0. Further, the input signal is applied to the NAND gate 43 via the inverter 46, and is ANDed with the signal of the D flip-flop 41 that stores the operation result, and the result is used as the clock signal only when the test instruction TFA is applied. It is triggered by CL5 and stored in the D flip-flop 41 again. When the input signal is on, a signal with a logic value of "1" (hereinafter simply referred to as "signal") is input as is to the NAND gate 42, so that a logic value of "0" is input to the D terminal of the D flip-flop 40. Even if a signal (hereinafter simply referred to as signal "0") is applied and this flip-flop is triggered by a test command, the reset state is maintained and the establishment of the logical product is stored. If the input signal is off, a signal "1" is applied to the D terminal, and the D flip-flop 40 is set to store that the logical product does not hold. Further, when the input signal is off, the signal "1" inverted by the inverter 46 is input to the NAND gate 43, so that the signal "0" is given to the D terminal of the D flip-flop 41, and the reset state is maintained. Memorize logical product establishment.
If the input signal is on, a signal "1" is applied to the D terminal, the D flip-flop 41 is set, and the logical product failure is stored. That is, the AND operator 30 calculates whether the input signal is on, the AND operator 31 calculates whether the input signal is off, and the operation results of both the operators 30 and 31 are sent to the AND gate 47. It is output from OR operator The OR operators 32 and 33 are D flip-flops 50,
It mainly consists of 51 and OR Gates 52 and 53.

端子39に与えられる入力信号は、オアゲート52に与
えられ、演算結果を記憶するDフリツプフロツプ50の
信号と論理和の演算が行われ、その結果はテスト命令T
NO.TNEが与えられた場合にDフリツプフロツプ5
0に記憶される。また前記入力信号はインバータ46を
介してオアゲート53に与えられ、演算結果を記憶する
Dフリツプフロツプ51の信号と論理和の演算が行われ
、その結果はテスト命令TFO.TFEが与えられた場
合にDフリツプフロツプ51に記憶される。前記オアゲ
ート52には入力信号がオンの場合信号「1」がそのま
ま入力され、Dフリツプフロツプ50のD端子にアンド
ゲート54を介して信号「1」を与え、テスト命令TN
O又はTNEによりトリガされることによりDフリツプ
フロツプ50はセツトされ論理和成立を記憶する。入力
信号がオフであればD端子に信号「0」が与えられDフ
リツプフロツプ50はリセツト状態を保ち論理和不成立
を記憶する。またオアゲート53には入力信号がオフの
場合インバータ46で反転された信号「1」が入力され
、Dフリツプフロツプ51のD端子にアンドゲート55
を介して信号フ「1」を与え、テスト命令TFOまたは
TFEによりトリガされることによりDフリツプフロツ
プ51はセツトされ論理和成立を記憶する。入力信号が
オンであればD端子に信号「0」が与えられ、Dフリツ
プフロツプ51はリセツト状態を保ち論理和不成立を記
憶する。即ち、論理和演算器32に入力信号がオンであ
るかどうかを演算し、論理和演算器33は入力信号がオ
フであるかを演算し、両演算器32,33の演算結果は
オアゲート56より出力され、後述する論理移送回路6
0に与えられる。論理移送回路 論理移送回路60はアンドゲート61.オアゲート45
により主に構成され、論理移送指令SIFTが与えられ
ると、インバータ62にて反転された信号「0」がアン
ドゲート44に入力されて端子39より与えられる信号
をブロツクし、アンドゲート61には信号「1」が入力
され、前記論理和演算器32, 33の演算結果の信号
をオアゲート45を介してアンドゲート42に入力する
The input signal applied to the terminal 39 is applied to the OR gate 52, where it is logically ORed with the signal of the D flip-flop 50 that stores the operation result, and the result is used as the test instruction T.
No. D flip-flop 5 given TNE
Stored as 0. The input signal is also applied to the OR gate 53 via the inverter 46, where it is logically ORed with the signal of the D flip-flop 51 that stores the operation result, and the result is used as the test instruction TFO. If TFE is given, it is stored in the D flip-flop 51. When the input signal is on, the signal "1" is input as is to the OR gate 52, and the signal "1" is applied to the D terminal of the D flip-flop 50 via the AND gate 54, thereby issuing the test command TN.
When triggered by O or TNE, the D flip-flop 50 is set and stores the establishment of the OR. If the input signal is OFF, a signal "0" is applied to the D terminal, and the D flip-flop 50 maintains the reset state and stores that the logical OR is not established. Further, when the input signal is off, a signal "1" inverted by the inverter 46 is input to the OR gate 53, and the AND gate 55 is input to the D terminal of the D flip-flop 51.
The D flip-flop 51 is set by applying a signal flip ``1'' via the test command TFO or TFE, and stores the establishment of the logical sum. If the input signal is on, a signal "0" is applied to the D terminal, and the D flip-flop 51 maintains the reset state and stores that the logical OR is not established. That is, the OR operator 32 calculates whether the input signal is on, the OR operator 33 calculates whether the input signal is OFF, and the operation results of both the operators 32 and 33 are sent to the OR gate 56. The logic transfer circuit 6 which will be output and will be described later
given to 0. Logic Transfer Circuit Logic transfer circuit 60 includes AND gates 61 . or gate 45
When the logic transfer command SIFT is given, the signal "0" inverted by the inverter 62 is input to the AND gate 44 to block the signal given from the terminal 39, and the AND gate 61 receives the signal. "1" is input, and the signal of the operation result of the logical sum operators 32 and 33 is input to the AND gate 42 via the OR gate 45.

これによつてDフリツプフロツプ40に記憶された論理
積演算結果と論理和演算結果の論理積が演算され、Dフ
リツプフロツプ40に記憶される。かかる論理移送はク
ロツクCL6の時点で行われ、Dフリツプフロツプ40
のT端子にはアンドゲート63、オアゲート64を介し
てトリガパルスが与えられ、Dフリツプフロツプ50,
51のT端子にはアンドゲート65、オアゲート66
を介して、またアンドゲート67、オアゲート68,6
9を介してトリガパルスが与えられる。
As a result, the AND operation result stored in the D flip-flop 40 and the logical sum operation result are computed and stored in the D flip-flop 40. Such logical transfer occurs at clock CL6, and D flip-flop 40
A trigger pulse is applied to the T terminal of the D flip-flop 50, through an AND gate 63 and an OR gate 64.
The T terminal of 51 has an AND gate 65 and an OR gate 66.
via and gate 67, or gate 68,6
A trigger pulse is provided via 9.

そしてDフリツプフロツプ50, 5]のD端子には、
論理移送指令SIFT′が与えられることによりアンド
ゲート70、インバータ71を介して信号「0」が入力
されるアンドゲート54, 55より信号「0」が与え
られるため両フリツプフロツプ50.51はともにリセ
ツトされる。これによつて論理和成立の場合の論理移送
はDフリツプフロツプ40をリセツト状態に保ち論理積
成立を記憶し、Dフリツプフロツプ50, 51がリセ
ツトされる。また論理和不成立の場合の論理移送はDフ
リツプフロツプ40をセツト状態に変化させて論理積不
成立を記憶し、Dフリツプフロツプ50,51をリセツ
トする。出力判定回路 出力判定回路34は演算結果を出力するアンドゲート4
7の出力信号FTと出力命令YONとカウンタ命令CT
Rを入力し、この信号FTに応じて出力制御信号SON
またはSOFを出力するもので、オアゲート71, 7
4, 75、アンドゲート72, 73, 81,82
、インバータ76より構成され、信号FTが「1」の場
合即ち論理成立の場合には信号SONが出力され、信号
FTが「0」の場合即ち論理不成立の場合には信号SO
Fが出力されるようになつている。
And at the D terminal of the D flip-flop 50, 5],
When the logic transfer command SIFT' is applied, the signal ``0'' is inputted through the AND gate 70 and the inverter 71. Since the signal ``0'' is applied from the AND gates 54 and 55, both flip-flops 50 and 51 are reset. Ru. As a result, when the logic is transferred when the logical sum is established, the D flip-flop 40 is kept in a reset state and the fact that the logical sum is satisfied is stored, and the D flip-flops 50 and 51 are reset. Further, in the logic transfer when the logical sum does not hold, the D flip-flop 40 is changed to the set state to store the logical AND failure, and the D flip-flops 50 and 51 are reset. Output determination circuit The output determination circuit 34 is an AND gate 4 that outputs the calculation result.
7 output signal FT, output command YON, and counter command CT
R is input, and the output control signal SON is output according to this signal FT.
Or output SOF, OR gate 71, 7
4, 75, and gate 72, 73, 81, 82
, an inverter 76, when the signal FT is "1", that is, the logic is established, the signal SON is output, and when the signal FT is "0", that is, the logic is not established, the signal SO is output.
F is now output.

論理値変化検出作用 次にカウントすべき前記入力信号X1の論理値変化を検
出する作用について説明する。
Logic value change detection operation Next, the operation of detecting a logic value change of the input signal X1 to be counted will be explained.

第8図に示すように入力信号X1のオン、オフ時間に対
しメモリ10をースキヤニングするスキヤニングサイク
ルははるかに短いため、入力信号X1の立上りにおいて
のみカウント信号を発生させ、この信号を計数しなけれ
ばならない。かかるカウント信号を発するための条件と
してt1時点でオフ、t2時点でオンになつていること
を前記論理演算器40,51で演算し検出する。即ちt
1時点における前記n番地のテスト命令TNAX1の実
行においては、入力信号X1がオフとなつているため第
7図の端子39を介してナンドゲート42に信号「O」
が与えられ、Dフリツプフロツプ40のD端子に信号「
1」が与えられこれがセツトされ信号FTは「O」とな
る。1続いてn+1番地のカウンタ命令CTRY1の実
行においてはインバータ76にて信号FTは反転されア
ンドゲート73に信号「1」が入力され、オアゲート7
5を介して出力信号SOFが出力され、出力回路19の
Y1は無勢される。
As shown in FIG. 8, the scanning cycle for scanning the memory 10 is much shorter than the on/off time of the input signal X1, so it is necessary to generate a count signal only at the rising edge of the input signal X1 and count this signal. Must be. The logical operators 40 and 51 calculate and detect that the count signal is turned off at time t1 and turned on at time t2 as a condition for issuing such a count signal. That is, t
When the test instruction TNAX1 at address n is executed at one point in time, since the input signal X1 is off, the signal "O" is sent to the NAND gate 42 via the terminal 39 in FIG.
is given to the D terminal of the D flip-flop 40.
1" is applied and set, and the signal FT becomes "O". 1 Subsequently, when the counter instruction CTRY1 at address n+1 is executed, the signal FT is inverted by the inverter 76, and the signal "1" is input to the AND gate 73, and the OR gate 7
The output signal SOF is outputted through the output circuit 5, and Y1 of the output circuit 19 is inactivated.

このY1が無勢される直前におけるY1はt。時点にお
ける入力信号X1の状態を記憶していることになり、こ
の信号はインバータ46を介してオアゲート53に信号
「1」を入力する。そしてDフリツプフロツプ5]はセ
ツトされ、セツト側出力端子Qからオアゲート56、ア
ンドゲート61.オアゲート45を介してナンドゲート
42に信号「1」が入力される。尚、アンドゲート61
に与えられる移送指令SIFTはカウンタ命令CTR及
びテスト命令TNE.TFEが与えられた場合に信号「
1」となる。ここにDフリツプフロツプ40はn番地実
行時点において既にリセツトさ1れているためナンドゲ
ート42は信号「1」を出力し、Dフリツプフロツプ4
0はセツト状態を保つ。即ちt。時点の入力信号とt1
時点の入力信号の論理積が演算され論理不成立と判定さ
れたことになる。したがつて信号FTは「0」となり、
アンドゲート77は開かないためカウント信号を発生す
る回路35からカウント信号は出力されない。ところが
1スキヤニングの後のt2時点では入力信号X1がオン
になつているため、Dフリツプフロツプ40のD端子に
は信号「0」が与えられリセツト状態を保つため信号F
Tは「1」となり、出力回路19のY1を付勢する。こ
の付勢される直前のY1は無勢されているから信号「0
」が端子39に与えられ、インバータ46にて反転され
た信号11」がオアゲート53に入力され、Dフリツプ
フロツプ51のD端子に信号「1」を与えこれをセツト
する。そしてオアゲート56を介して論理移送回路60
のアンドゲート61.オアゲート45を介してナンドゲ
ート42に信号「1」を入力する。Dフリツプフロツプ
40はリセツト状態にあるから論理移送回路60を通じ
て与えられる信号によつてもリセツト状態を保ち論理成
立となる。これによつて信号FTは「1」となり、アン
ドゲート77を介してアンドゲート79に信号「1」を
与え、このアンドゲート79は、一致信号A≦Bの反転
信号とクロツタCL4″が入力されるアンドゲート78
が信号「1」を出力するとカウント信号を出力し、オア
ゲート80を介してBレジスタ28のカウント端子に与
えられ計数される。このようにして以後t3〜t11の
スキヤニングサイクルにおいてはいずれもカウント信号
は出力されず、t12時点においてのみ再び出力される
ことになる。クリヤ信号の発生作用 前記アドレスレジスタ14がクロツクCL「にて+1さ
れることにより指定される記憶要素Y1+1がオンにな
つている場合にクリヤ信号が回路37のアンドゲート8
7より出力される。
Y1 immediately before this Y1 is deenergized is t. This means that the state of the input signal X1 at the time is stored, and this signal is inputted as a signal "1" to the OR gate 53 via the inverter 46. Then, the D flip-flop 5] is set, and the output terminal Q on the set side is connected to an OR gate 56, an AND gate 61 . A signal “1” is input to the NAND gate 42 via the OR gate 45. In addition, and gate 61
The transfer command SIFT given to the counter command CTR and the test command TNE. If TFE is given, the signal “
1”. Since the D flip-flop 40 has already been reset to 1 at the time of execution of the n address, the NAND gate 42 outputs a signal "1", and the D flip-flop 40 outputs a signal "1".
0 keeps the set state. That is, t. Input signal at time and t1
This means that the logical product of the input signals at the time is calculated and it is determined that the logic does not hold. Therefore, the signal FT becomes "0",
Since the AND gate 77 is not opened, no count signal is output from the circuit 35 that generates the count signal. However, at time t2 after one scanning, the input signal
T becomes "1" and Y1 of the output circuit 19 is energized. Since Y1 immediately before being energized is deenergized, the signal "0"
'' is applied to the terminal 39, and the signal 11'', which is inverted by the inverter 46, is input to the OR gate 53, and the signal ``1'' is applied to the D terminal of the D flip-flop 51 to set it. and logic transfer circuit 60 via OR gate 56.
And Gate 61. A signal “1” is input to the NAND gate 42 via the OR gate 45. Since the D flip-flop 40 is in the reset state, the signal applied through the logic transfer circuit 60 also maintains the reset state and the logic is established. As a result, the signal FT becomes "1", and the signal "1" is applied to the AND gate 79 via the AND gate 77, and this AND gate 79 receives the inverted signal of the coincidence signal A≦B and the clock signal CL4''. Ruand Gate 78
When outputs the signal "1", it outputs a count signal, which is applied to the count terminal of the B register 28 via the OR gate 80 and counted. In this way, the count signal will not be output in any subsequent scanning cycles from t3 to t11, and will be output again only at time t12. Generation of clear signal When the memory element Y1+1 designated by the address register 14 being incremented by 1 by the clock CL is turned on, the clear signal is generated by the AND gate 8 of the circuit 37.
It is output from 7.

かかるY1+1がオンになつているかどうかは、カウン
夕命令の演算サイクルCL3″において行われる。即ち
Y1+1の信号状態は信号ライン22、端子39、イン
バータ46を介してオアゲート53に与えられ、オンの
場合にはDフリツプフロツプ51のD端子に信号「0」
が与えられ、クロツクCL3″でこれがトリガされても
リセツト状態を保つ。したがつて出力端子Qより信号「
1」が出力され、クロツクCL4″が与えられるとアン
ドゲート87を通じて信号「1」がBレジスタ28のク
リヤ端子に与えられる。Y1+1がオフであればDフリ
ツプフロツプ51はセツトされるため出力端子Qは信号
「0」となるためBレジスタ28のクリヤは行われない
。以上詳細に説明したように、本発明においてはカウン
トすべき入力信号の論理値変化を検出して計数し、この
計数値を設定値と比較し、一致した場合のみカウントア
ツプ信号を出力するようになつているが、前記計数値及
び設定値をシーケンスメモリに記憶するようにしている
ので、メモリの残リエリアの範囲内でカウンタの数は任
意にとり得ることになり、ハード構成によつてカウンタ
の最大数が制約されることもない。
Whether or not Y1+1 is on is determined in the calculation cycle CL3'' of the counter instruction. That is, the signal state of Y1+1 is given to the OR gate 53 via the signal line 22, the terminal 39, and the inverter 46, and if it is on, In this case, a signal “0” is applied to the D terminal of the D flip-flop 51.
is given, and even if it is triggered by clock CL3'', it remains in the reset state. Therefore, the signal ``is output from output terminal Q''.
When the clock CL4'' is applied, the signal ``1'' is applied to the clear terminal of the B register 28 through the AND gate 87. If Y1+1 is off, the D flip-flop 51 is set and the output terminal Q becomes a signal "0", so the B register 28 is not cleared. As explained in detail above, in the present invention, changes in the logical value of the input signal to be counted are detected and counted, this counted value is compared with a set value, and a count up signal is output only when they match. However, since the count value and set value are stored in the sequence memory, the number of counters can be set arbitrarily within the remaining area of the memory, and the maximum number of counters can be set depending on the hardware configuration. There are no restrictions on the number.

又、計数すべき入力信号のオン・オフ状態とかカウンタ
リセツト信号、カウントアツプ信号は外部の記憶要素に
記憶させているので、カウンタ制御においては外部記憶
要素の任意のアドレスに割り当てることができるので、
制御系統に応じてアドレスを統一できるので、保守面で
の有利性が高められる効果がある。
In addition, since the on/off state of the input signal to be counted, the counter reset signal, and the count up signal are stored in an external storage element, they can be assigned to any address of the external storage element during counter control.
Since the addresses can be unified according to the control system, there is an effect of increasing the advantage in terms of maintenance.

また、カウンタリセツトの信号及びカウントアツプの信
号も出力回路19の特定アドレスがそれぞれ指定され記
憶されるため、カウンタリセツトのプログラムとかカウ
ントアツプに基づくプログラムはカウンタ命令とは全く
分離してプログラムできる利点がある。
Further, since the counter reset signal and count up signal are each designated and stored at a specific address of the output circuit 19, there is an advantage that a counter reset program or a program based on count up can be programmed completely separately from the counter instruction. be.

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

図面は本発明の実施例を示すもので、第1図はシーケン
スコントローラの概略構成を示すブロツク線図、第2図
はメモリに記憶される命令語のスタイルを示す図、第3
図は演算サイクル、カウンタサイクルのタイムチヤート
を示す図、第4図、第5図、第6図はリレー回路で示し
たカウンタ機能の図、第7図は演算制御回路の具体的構
成を示す回路図、第8図は入力信号とカウント信号の関
係を示すタイムチヤート図である。 10・・・・・・メモリ、11・・・・・・プログラム
カウン夕、13・・・・・・命令レジスタ、14・・・
・・・アドレスレジスタ、16・・・・・・演算制御回
路、18・・・・・・入力回路、19・・・・・・出力
回路、27・・・・・・Aレジスタ、28・・・・・・
Bレジスタ、29・・・・・・比較器、30, 31・
・・・・・論理積演算器、32, 33・・・・・・論
理和演算器、34・・・・・・出力判定回路、35・・
・・・・カウント信号出力回路、36・・・・・・クリ
ヤ信号出力回路。
The drawings show an embodiment of the present invention, and FIG. 1 is a block diagram showing a schematic configuration of a sequence controller, FIG. 2 is a diagram showing the style of instruction words stored in memory, and FIG.
The figure shows a time chart of the calculation cycle and counter cycle. Figures 4, 5, and 6 are diagrams of the counter function shown by a relay circuit. Figure 7 is a circuit showing the specific configuration of the calculation control circuit. FIG. 8 is a time chart showing the relationship between the input signal and the count signal. 10...Memory, 11...Program counter, 13...Instruction register, 14...
... Address register, 16 ... Arithmetic control circuit, 18 ... Input circuit, 19 ... Output circuit, 27 ... A register, 28 ...・・・・・・
B register, 29... Comparator, 30, 31.
...Logic product operator, 32, 33...Logic sum operator, 34...Output judgment circuit, 35...
. . . Count signal output circuit, 36 . . . Clear signal output circuit.

Claims (1)

【特許請求の範囲】 1 予めプログラムされたシーケンス制御情報をメモリ
10からサイクリツクに読出して被制御対象のシーケン
ス制御を行わせるシーケンスコントローラにおいて、前
記シーケンス制御情報内に与えられたカウンタ命令(C
RT)の実行初期段階にて前記メモリに記憶されたカウ
ント設定値を第1レジスタ27にプリセットするととも
に前記メモリ10に記憶された計数値を第2レジスタ2
8にプリセットする第1手段と、前記カウンタ命令の実
行終期段階にて第2レジスタ28の計数値を前記メモリ
にストアする第2手段と、前記両レジスタの値を比較す
る比較器29と、前記カウンタ命令により指定可能であ
りカウントすべき入力信号の論理状態を記憶する外部の
第1記憶要素(Y_1)と、この第1記憶要素(Y_1
)の論理値に対するカウントすべき入力信号の論理値変
化を検出して前記第2レジスタの計数値を+1する論理
値変化検出回路40,51,60と、前記比較器29の
一致信号によりカウントアップ信号がセットされる外部
の第2記憶要素(Y_1_+_2)とを備えたカウンタ
機能付シーケンスコントローラ。 2 前記論理値変化検出回路は、カウントすべき前記入
力信号の論理状態を一次記憶する第1の制御回路40と
、この第1の制御回路40により前記第1記憶要素の論
理値が反転する直前の信号を入力して一時記憶する第2
の制御回路51と、この第2の制御回路51に入力した
論理値を前記入力信号と論理演算しその結果を第1の制
御回路40に記憶させる第3の制御回路60と、前記第
1の制御回路40に記憶された演算結果を判定して前記
第2レジスタの計数値を+1する第4の制御回路35と
を有する特許請求の範囲第1項記載のカウンタ機能付シ
ーケンスコントローラ。
[Scope of Claims] 1. In a sequence controller that performs sequence control of a controlled object by cyclically reading out preprogrammed sequence control information from a memory 10, a counter command (C
At the initial stage of execution of RT), the count setting value stored in the memory is preset in the first register 27, and the count value stored in the memory 10 is preset in the second register 2.
8; second means for storing the count value of the second register 28 in the memory at the final stage of execution of the counter instruction; a comparator 29 for comparing the values of both registers; an external first storage element (Y_1) that stores the logic state of the input signal that can be specified by the counter instruction and is to be counted;
) detects a change in the logic value of the input signal to be counted and increases the count value of the second register by 1, and the count is increased by the match signal from the comparator 29. A sequence controller with a counter function and an external second storage element (Y_1_+_2) in which a signal is set. 2. The logic value change detection circuit includes a first control circuit 40 that temporarily stores the logic state of the input signal to be counted, and a logic value of the first storage element immediately before the logic value of the first storage element is inverted by the first control circuit 40. A second signal is input and temporarily stored.
a third control circuit 60 that performs a logical operation on the logic value input to the second control circuit 51 with the input signal and stores the result in the first control circuit 40; 2. The sequence controller with a counter function according to claim 1, further comprising a fourth control circuit (35) that determines the calculation result stored in the control circuit (40) and adds one to the count value of the second register.
JP4483476A 1976-04-19 1976-04-19 Sequence controller with counter function Expired JPS5951002B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4483476A JPS5951002B2 (en) 1976-04-19 1976-04-19 Sequence controller with counter function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4483476A JPS5951002B2 (en) 1976-04-19 1976-04-19 Sequence controller with counter function

Publications (2)

Publication Number Publication Date
JPS52127574A JPS52127574A (en) 1977-10-26
JPS5951002B2 true JPS5951002B2 (en) 1984-12-12

Family

ID=12702486

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4483476A Expired JPS5951002B2 (en) 1976-04-19 1976-04-19 Sequence controller with counter function

Country Status (1)

Country Link
JP (1) JPS5951002B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5520518A (en) * 1978-07-28 1980-02-14 Fuji Xerox Co Ltd Sequence control system by microcomputer

Also Published As

Publication number Publication date
JPS52127574A (en) 1977-10-26

Similar Documents

Publication Publication Date Title
US4058711A (en) Asynchronous dual function multiprocessor machine control
US3470542A (en) Modular system design
JPH0635993B2 (en) Data acquisition device
US5428756A (en) Pipelined computer with control of instruction advance
JPH08227326A (en) Microcomputer
JPS5951002B2 (en) Sequence controller with counter function
JPH05324452A (en) External memory interface circuit
CA1195777A (en) Write-only sequence controller
US4048622A (en) Programmable sequence controller
US3555519A (en) Digital programming converter,register and control system
US5630108A (en) Frequency independent PCMCIA control signal timing
JPS59183434A (en) Prefetch control system of instruction
SU1089550A1 (en) Sampling control device
RU2071117C1 (en) Device for determining optimal maintenance intervals
SU1275436A1 (en) Random number generator
SU1168939A1 (en) Microprogram control unit
JPS61160144A (en) Emulation system
SU1659987A1 (en) Device for object operability testing
JPH10240571A (en) Address tracing circuit
SU1681320A1 (en) Training program set up device
SU1314350A1 (en) Device for simulating petri graphs
JPH03161883A (en) microprocessor
SU1711166A1 (en) Computer system throughput evaluator
SU1665339A1 (en) Associative control device
KR100247218B1 (en) Signal generating circuit