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
JP2875136B2 - Programmable controller and counter END processing method thereof - Google Patents
[go: Go Back, main page]

JP2875136B2 - Programmable controller and counter END processing method thereof - Google Patents

Programmable controller and counter END processing method thereof

Info

Publication number
JP2875136B2
JP2875136B2 JP16279993A JP16279993A JP2875136B2 JP 2875136 B2 JP2875136 B2 JP 2875136B2 JP 16279993 A JP16279993 A JP 16279993A JP 16279993 A JP16279993 A JP 16279993A JP 2875136 B2 JP2875136 B2 JP 2875136B2
Authority
JP
Japan
Prior art keywords
set value
counter
value
programmable controller
contact
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 - Lifetime
Application number
JP16279993A
Other languages
Japanese (ja)
Other versions
JPH0778009A (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.)
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 JP16279993A priority Critical patent/JP2875136B2/en
Publication of JPH0778009A publication Critical patent/JPH0778009A/en
Application granted granted Critical
Publication of JP2875136B2 publication Critical patent/JP2875136B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】この発明は、プログラマブルコン
トローラおよびそのカウンタEND処理方法に関し、特
に、プログラマブルコントローラのカウンタ機能命令に
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a programmable controller and a counter END processing method thereof, and more particularly to a counter function instruction of the programmable controller.

【0002】[0002]

【従来の技術】図13は、従来技術におけるプログラマ
ブルコントローラのシステム構成を示すブロック図であ
り、1はプログラマブルコントローラ本体、2はプログ
ラマブルコントローラ1全体を制御するCPUであり、
システムROM3に格納されたプログラムの内容にした
がって動作する。また、5はシステムRAMであり、カ
ウンタに関するEND処理において使用するC前コイル
ワークとC現コイルワークが格納されている。
2. Description of the Related Art FIG. 13 is a block diagram showing a system configuration of a programmable controller according to the prior art, wherein 1 is a main body of the programmable controller, 2 is a CPU for controlling the entire programmable controller 1, and
It operates according to the contents of the program stored in the system ROM 3. Reference numeral 5 denotes a system RAM, which stores a C-previous coil work and a C-current coil work used in the END processing for the counter.

【0003】また、6はユーザがシーケンス命令によっ
てアクセス可能なデバイスメモリ、7はシーケンスプロ
グラムなどをプログラマブルコントローラ1内における
シーケンスRAM10に書き込む周辺装置、8は外部か
らの入力情報をプログラマブルコントローラ1内に取り
込む外部入力インタフェース、9は出力情報を外部へ出
力する外部出力インタフェース、10はシーケンスRA
Mであり、ユーザが周辺装置7により作成したシーケン
スプログラムを書き込む。さらに、11はシステムバス
である。
Further, reference numeral 6 denotes a device memory accessible by a user by a sequence command, 7 a peripheral device for writing a sequence program or the like to a sequence RAM 10 in the programmable controller 1, and 8 an external input information to the programmable controller 1. An external input interface, 9 is an external output interface for outputting output information to the outside, and 10 is a sequence RA.
M, and writes a sequence program created by the user with the peripheral device 7. Reference numeral 11 denotes a system bus.

【0004】次に、動作について説明する。図14は、
プログラマブルコントローラの概略的な処理動作を示す
フローチャートである。最初に、初期処理を実行する
(S301)。該初期処理においては、プログラマブル
コントローラ1として動作するために必要不可欠な処
理、例えば、システムRAMの初期化を実行する。次
に、フラグがRUNフラグか、あるいはSTOPフラグ
かを判断する(S302)。ここで、RUN/STOP
フラグがSTOPであると判断した場合には、カウンタ
に関するEND処理を実行する(S304)。反対に、
RUN/STOPフラグがRUNであると判断した場合
には、シーケンスプログラムを0ステップからENDス
テップまで実行後、END命令を実行する(S30
3)。
Next, the operation will be described. FIG.
6 is a flowchart illustrating a schematic processing operation of the programmable controller. First, an initial process is executed (S301). In the initial processing, processing indispensable for operating as the programmable controller 1, for example, initialization of a system RAM is executed. Next, it is determined whether the flag is a RUN flag or a STOP flag (S302). Here, RUN / STOP
If it is determined that the flag is STOP, an END process for the counter is executed (S304). Conversely,
If it is determined that the RUN / STOP flag is RUN, the END instruction is executed after executing the sequence program from step 0 to END step (S30).
3).

【0005】例えば、図16において、X1がOFFか
らONになるとC現コイルワークをON/OFFするE
ND処理として、最初に上記ステップS304に示すカ
ウンタに関するEND処理のサブルーチンをコールす
る。上記ステップS304の処理終了後、周辺装置7と
の交信等を実行するため、カウンタに関するEND処理
以外のEND処理をサブルーチンコールし(S30
5)、上記ステップS305の処理終了後、再度上記ス
テップS302のRUN/STOPフラグの判断処理を
実行する。
For example, in FIG. 16, when X1 changes from OFF to ON, C turns the current coil work ON / OFF.
As the ND processing, first, a subroutine of the END processing for the counter shown in step S304 is called. After the process of step S304 is completed, an END process other than the END process related to the counter is called as a subroutine in order to execute communication with the peripheral device 7 (S30).
5) After the processing in step S305 is completed, the RUN / STOP flag determination processing in step S302 is performed again.

【0006】図15は、上記ステップS304に示した
カウンタに関するEND処理の詳細を示すフローチャー
トである。最初に、C接点デバイスのON/OFFを判
断し(S401)、ここで、C接点デバイスがONであ
ると判断した場合には、ステップS407の処理を実行
する。反対に、C接点デバイスがOFFであると判断し
た場合には、C現コイルワークのON/OFFを判断し
(S402)、ここで、C現コイルワークがOFFであ
ると判断した場合には、ステップS407の処理を実行
する。反対に、C現コイルワークがONであると判断し
た場合には、C前コイルワークのON/OFFを判断し
(S403)、ここで、C前コイルワークがONである
と判断した場合には、ステップS407の処理を実行す
る。反対に、C前コイルワークがOFFであると判断し
た場合には、C現在値に1を加算する(S404)。
FIG. 15 is a flowchart showing the details of the END processing for the counter shown in step S304. First, ON / OFF of the C contact device is determined (S401). If it is determined that the C contact device is ON, the process of step S407 is executed. Conversely, if it is determined that the C contact device is OFF, it is determined whether the C current coil work is ON / OFF (S402). If it is determined that the C current coil work is OFF, The processing of step S407 is performed. On the other hand, when it is determined that the C-current coil work is ON, ON / OFF of the C-previous coil work is determined (S403). , The processing of step S407 is executed. Conversely, when it is determined that the coil work before C is OFF, 1 is added to the current C value (S404).

【0007】続いて、C現在値デバイスとC設定値との
比較判断を実行し(S405)、ここで、C現在値デバ
イスよりC設定値の方が大きいと判断した場合(C現在
値デバイス<C設定値)には、まだC現在値デバイスが
C設定値まで到達していない状態であり、ステップS4
07の処理を実行する。反対に、C現在値デバイスの方
が大きいあるいはイコールであると判断した場合(C現
在値デバイス≧C設定値)には、カウントアップ状態と
なり、C接点デバイスをONする(S406)。その
後、C現コイルワークをC前コイルワークに転送し(S
407)、次回の本サブルーチンをコールするための準
備を実行する。
Subsequently, a comparison is made between the C current value device and the C set value (S405). If it is determined that the C set value is larger than the C current value device (C current value device < (C setting value) is a state where the C current value device has not yet reached the C setting value.
07 is executed. Conversely, when it is determined that the C current value device is larger or equal (C current value device ≧ C set value), the count-up state is set and the C contact device is turned on (S406). Thereafter, the C current coil work is transferred to the C previous coil work (S
407), preparations for calling the next subroutine are executed.

【0008】したがって、周辺装置より図16に示した
ようなシーケンスプログラムがシーケンスRAM10に
格納されていたならば、図17に示すようにX1が6回
ON/OFFしたらC1接点デバイスがONし、そのC
設定デバイスをOFFさせるにはX1をONし、〔RS
T C〕命令を実行させなければならない。
Therefore, if the sequence program as shown in FIG. 16 is stored in the sequence RAM 10 from the peripheral device, the C1 contact device is turned on when X1 is turned on / off six times as shown in FIG. C
To turn off the setting device, turn on X1 and select [RS
TC] instruction must be executed.

【0009】また、図18は、カウンタ命令に関連する
デバイスを示し、また、図19は、カウンタ命令に関連
するワークRAMを示している。なお、図20に示すよ
うに、本文中のC現コイルワークはシーケンスプログラ
ム実行中のカウンタ命令によりセットされるものであ
る。したがって、カウンタ機能命令に関するEND処理
では、この現コイルワークがONであり、かつ、前回に
実行したときの前コイルワークがOFFのときのみ、C
現在値デバイスがカウントされる。
FIG. 18 shows a device related to the counter instruction, and FIG. 19 shows a work RAM related to the counter instruction. As shown in FIG. 20, the C current coil work in the text is set by a counter instruction during execution of a sequence program. Therefore, in the END processing relating to the counter function command, only when the current coil work is ON and the previous coil work executed last time is OFF, C
The current value device is counted.

【0010】[0010]

【発明が解決しようとする課題】従来におけるプログラ
マブルコントローラは、上記のように構成されているた
め、カウンタ機能命令において、一定回数のカウンタを
繰り返し実行するときにはカウンタリセット命令などを
使用しなければならず、シーケンスプログラムが複雑と
なり、プログラム容量が拡大していくため、ユーザにお
いて作成したシーケンスプログラムのデバッグに多大な
時間を要することになり、作業効率が悪いという問題点
があった。
Since the conventional programmable controller is configured as described above, it is necessary to use a counter reset instruction or the like when repeatedly executing a counter a fixed number of times in a counter function instruction. However, since the sequence program becomes complicated and the program capacity is increased, a large amount of time is required for debugging the sequence program created by the user, and there is a problem that work efficiency is poor.

【0011】また、ワークの位置決めを正確に、かつ、
高速に実行する際、指定位置付近までは高速にワークを
動作させ、指定位置付近に到達するとワークを低速に動
作させることにより位置決めを完了させるときに、指定
位置付近に設定するカウンタと、ワーク位置決め完了位
置に設定するカウンタとの2つのカウンタを設定しなけ
ればならず、システムの拡大化にともないデバイスメモ
リの使用数も同様に増加していくため、デバイスメモリ
が不足してしまうという問題点があった。
In addition, the positioning of the workpiece can be performed accurately and
When executing at high speed, the work is operated at high speed up to near the specified position, and when reaching the specified position, the work is operated at low speed. Two counters must be set with the counter set at the completion position, and the number of device memories used also increases with the enlargement of the system, resulting in a shortage of device memory. there were.

【0012】この発明は、上記の問題点を解決するため
になされたもので、プログラマブルコントローラにおけ
るカウンタ機能命令の高機能化を図り、シーケンスプロ
グラムを縮小化して、作業効率を向上させるプログラマ
ブルコントローラおよびそのカウンタEND処理方法を
得ることを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems. A programmable controller and a programmable controller that improve the efficiency of counter function instructions in a programmable controller, reduce the size of a sequence program, and improve the work efficiency. It is an object to obtain a counter END processing method.

【0013】[0013]

【課題を解決するための手段】この発明に係るプログラ
マブルコントローラは、プログラマブルコントローラの
内部命令において外部接点ON/OFF回数をカウン
トするカウント手段と、該カウント手段によりカウント
されたカウント値とカウンタ機能命令内に設定される設
定値とが等しく(カウントアップ状態に)なるとONす
る接点デバイスを有するプログラマブルコントローラに
おいて、カウンタアップ状態になったとき、前記接点デ
バイスをONすると同時に、前記カウント手段をリセッ
トし、次に、前記外部接点がONしたとき、前記接点デ
バイスをOFFする処理手段を具備するものである。
According to the present invention, there is provided a programmable controller comprising: a counting means for counting the number of ON / OFF of an external contact in an internal command of the programmable controller; a count value counted by the counting means; In a programmable controller having a contact device that is turned on when a set value set in the counter becomes equal (to a count-up state), when the counter-up state is reached, the contact device is turned on, and at the same time, the counting means is reset; Next, there is provided processing means for turning off the contact device when the external contact is turned on.

【0014】また、この発明に係るプログラマブルコン
トローラのカウンタEND処理方法は、プログラマブル
コントローラの内部命令において外部接点ON/OF
F回数をカウントし、カウントされたカウント値とカウ
ンタ機能命令内に設定される設定値とが等しく(カウン
トアップ状態に)なったとき、接点デバイスをONする
と同時に、カウント値をリセットし、次に、前記外部接
点がONしたとき、前記接点デバイスをOFFするもの
である。
Further, according to the method of processing the counter END of the programmable controller according to the present invention, the ON / OF of the external contact is controlled by the internal command of the programmable controller.
F is counted, and when the counted value is equal to the set value set in the counter function instruction (into the count-up state), the contact device is turned on, and at the same time, the count value is reset. , When the external contact is turned on, the contact device is turned off.

【0015】また、この発明に係るプログラマブルコン
トローラは、プログラマブルコントローラの内部命令に
おいて外部接点ON/OFF回数をカウントするカウ
ント手段と、カウンタ機能命令内に第1の設定値と、該
第1の設定値よりも大きい第2の設定値とを備え、前記
カウント手段によりカウントされたカウント値が前記第
1の設定値より小さいときに第1の接点デバイスをON
し、前記カウント手段によりカウントされたカウント値
が前記第1の設定値と等しくなったときに第2の接点デ
バイスをONし、前記カウント手段によりカウントされ
たカウント値が前記第1の設定値より大きく、かつ、前
記第2の設定値より小さいときに第3の接点デバイスを
ONする処理手段を具備するものである。
Further, the programmable controller according to the present invention includes a counting means for counting the number of times the external contact is turned on / off in an internal command of the programmable controller; a first set value in the counter function command; A second set value larger than the first set value, and when the count value counted by the counting means is smaller than the first set value, the first contact device is turned on.
Then, when the count value counted by the counting means becomes equal to the first set value, the second contact device is turned on, and the count value counted by the counting means becomes larger than the first set value. A processing means for turning on the third contact device when it is larger and smaller than the second set value is provided.

【0016】また、この発明に係るプログラマブルコン
トローラのカウンタEND処理方法は、プログラマブル
コントローラの内部命令において外部接点ON/OF
F回数をカウントし、カウンタ機能命令内に第1の設定
値と、該第1の設定値よりも大きい第2の設定値を備
え、カウント値が第1の設定値より小さいときに第1の
接点デバイスをONし、カウント値が第1の設定値と等
しくなったときに第2の接点デバイスをONし、カウン
ト値が第1の設定値より大きく、かつ、第2の設定値よ
り小さいときに第3の接点デバイスをONするものであ
る。
Further, according to the counter END processing method of the programmable controller according to the present invention, the ON / OF of the external contact is controlled by the internal command of the programmable controller.
F is counted, and a first set value and a second set value larger than the first set value are provided in the counter function instruction, and the first set value is set when the count value is smaller than the first set value. When the contact device is turned on and the count value becomes equal to the first set value, the second contact device is turned on and when the count value is larger than the first set value and smaller than the second set value Then, the third contact device is turned on.

【0017】[0017]

【作用】この発明に係るプログラマブルコントローラお
よびそのカウンタEND処理方法は、プログラマブルコ
ントローラにリング動作(外部入力回数が設定回数に到
達すると現在値が自動的にクリアされ、次回の外部入力
があったとき、再度1からカウントを開始する動作)を
するカウンタ機能命令を備え、カウンタ現在値がカウン
タ設定値に到達すると、カウンタ接点をONすると同時
にカウンタ現在値を0クリアし、カウンタ現在値が、次
に、0から1となるときにカウンタ接点をOFFする。
According to the programmable controller and the counter END processing method of the present invention, a ring operation is performed on the programmable controller (the current value is automatically cleared when the number of external inputs reaches a set number, and when the next external input is performed, When the current counter value reaches the counter set value, the counter contact is turned ON and the counter current value is cleared to 0 at the same time. When the value changes from 0 to 1, the counter contact is turned off.

【0018】また、プログラマブルコントローラの内部
命令において外部接点などのON/OFF回数をカウン
トし、カウンタ機能命令内に第1の設定値と、該第1の
設定値よりも小さい第2の設定値を備え、カウント値が
第1の設定値より小さいときに第1の接点デバイスをO
Nし、カウント値が第1の設定値と等しくなったときに
第2の接点デバイスをONし、カウント値が第1の設定
値より大きく、かつ、第2の設定値より小さいときに第
3の接点デバイスをONする。
Also, the number of ON / OFF of external contacts and the like is counted by an internal command of the programmable controller, and a first set value and a second set value smaller than the first set value are stored in a counter function command. When the count value is smaller than the first set value, the first contact device is turned on.
N, the second contact device is turned on when the count value becomes equal to the first set value, and the third contact device is turned on when the count value is larger than the first set value and smaller than the second set value. Is turned on.

【0019】[0019]

【実施例】【Example】

〔実施例1〕以下、この発明に係るプログラマブルコン
トローラの実施例を図面に基づいて説明する。図1は、
第1の実施例に係るプログラマブルコントローラのシス
テム構成を示すブロック図であり、従来例の図13に示
したシステムとほぼ同様の構成を有し、相違点はシステ
ムROM3内にカウンタEND処理部4の処理内容が格
納されていることである。
Embodiment 1 Hereinafter, an embodiment of a programmable controller according to the present invention will be described with reference to the drawings. FIG.
FIG. 14 is a block diagram showing a system configuration of a programmable controller according to the first embodiment, which has substantially the same configuration as the system shown in FIG. 13 of the conventional example, except for the counter END processing unit 4 in the system ROM 3. That is, the processing content is stored.

【0020】次に、動作について説明する。プログラマ
ブルコントローラ1の概略処理は図14に示されるとお
りであり、従来技術とほぼ同様である。相違点は、シー
ケンスプログラム実行後にコールされるサブルーチン、
すなわち、カウンタに関するEND処理の内容である。
Next, the operation will be described. The schematic processing of the programmable controller 1 is as shown in FIG. 14, which is almost the same as the conventional technique. The difference is the subroutine called after executing the sequence program,
That is, the content of the END process for the counter.

【0021】図2は、第1の実施例に係るカウンタに関
するEND処理の動作を示すフローチャートである。最
初に、シーケンスプログラム実行中に変化するリングカ
ウンタ(以下、RCという)現コイルのON/OFFを
判断し(S101)、ここで、RC現コイルワークがO
FFであると判断した場合には、ステップS107の処
理を実行する。反対に、RC現コイルワークがONであ
ると判断した場合には、前スキャンにおけるシーケンス
プログラム実行中に変化したRC前コイルワークのON
/OFFを判断する(S102)。ここで、RC前コイ
ルワークがONであると判断した場合には、ステップS
107の処理を実行し、反対に、RC前コイルワークが
OFFであると判断した場合には、RC現在値デバイス
に1を加算する(S103)。
FIG. 2 is a flowchart showing the operation of the END processing for the counter according to the first embodiment. First, the ON / OFF of a ring counter (hereinafter referred to as RC) current coil that changes during execution of a sequence program is determined (S101).
If it is determined that it is FF, the processing of step S107 is executed. On the other hand, when it is determined that the RC current coil work is ON, the ON of the RC previous coil work changed during execution of the sequence program in the previous scan is performed.
/ OFF is determined (S102). If it is determined that the pre-RC coil work is ON, the process proceeds to step S
If the process of step 107 is executed and, on the other hand, it is determined that the pre-RC coil work is OFF, 1 is added to the RC current value device (S103).

【0022】次に、RC現在値デバイスとRC設定値と
の比較を実行し(S104)、RC設定値の方が大きい
と判断した場合(RC現在値デバイス<RC設定値)に
は、まだRC現在値デバイスがRC設定値まで到達して
いない状態、あるいは、RC現在値がRC設定値まで到
達した直後であるため、RC接点をOFFし(S10
8)、ステップS107の処理を実行する。反対に、R
C現在値デバイスの方が大きいあるいはイコールである
と判断した場合(RC現在値デバイス≧RC設定値)に
は、カウントアップ状態であるため、RC接点をONし
(S105)、RC現在値デバイスの0クリア処理を実
行する(S106)。次に、RC現コイルワークをRC
前コイルワークに転送し(S107)、次回本サブルー
チンをコールするための準備を実行する。
Next, a comparison is made between the RC current value device and the RC set value (S104). If it is determined that the RC set value is larger (RC current value device <RC set value), the RC current value device is still RC set. Since the current value device has not reached the RC set value or immediately after the RC current value has reached the RC set value, the RC contact is turned off (S10).
8) The process in step S107 is executed. Conversely, R
When it is determined that the C current value device is larger or equal (RC current value device ≧ RC set value), the RC contact is turned ON (S105) because the count-up state is established, and the RC current value device is turned off. A 0 clear process is executed (S106). Next, RC current coil work
It is transferred to the previous coil work (S107), and preparations are made for calling the present subroutine next time.

【0023】図3は、第1の実施例に係るシーケンスプ
ログラム例であり、外部接点X1のON/OFF回数を
命令(<RC1>)によりカウントし、RCの設定値
(K6回)にX1のON/OFF回数が到達するとRC
接点がONするように設定されている。ユーザが、図3
に示したようなシーケンスプログラムを周辺装置7にお
いて作成し、プログラマブルコントローラ1内における
シーケンスRAMに書き込まれた場合における、X1に
対するRCの現在値および接点の動作タイミングを図4
に示す。図4において、X1の6回目のON時にRC現
在値が0となり、それと同時にRC接点がONし、X1
の7回目のON時にRC現在値が1となり、それと同時
にRC接点がOFFする。
FIG. 3 shows an example of a sequence program according to the first embodiment, in which the number of ON / OFF operations of the external contact X1 is counted by a command (<RC1>), and the set value of RC (K6 times) is set to X1. RC when ON / OFF count reaches
The contacts are set to turn on. If the user sees FIG.
FIG. 4 shows the current value of RC and the operation timing of the contacts with respect to X1 when the sequence program shown in FIG. 4 is created in the peripheral device 7 and written into the sequence RAM in the programmable controller 1.
Shown in In FIG. 4, when the X1 is turned on for the sixth time, the RC current value becomes 0, and at the same time, the RC contact is turned on, and the X1 is turned on.
At the time of the seventh ON, the RC current value becomes 1, and at the same time, the RC contact turns OFF.

【0024】なお、図5は、第1の実施例に係るカウン
タ命令に関連するデバイスを示し、図6は、カウンタ命
令に関連するワークRAMを示している。
FIG. 5 shows a device relating to the counter instruction according to the first embodiment, and FIG. 6 shows a work RAM relating to the counter instruction.

【0025】〔実施例2〕次に、第2の実施例について
説明する。図7は、第2の実施例に係るシステム構成を
示すブロック図である。図7に示したシステム構成は、
従来例の図13に示したシステム構成とほぼ同様であ
り、相違点はシステムROM3内にカウンタEND処理
部12の処理内容が格納されている点と、デバイスRA
M6内にカウンタ関連デバイス13を具備したことであ
る。
Embodiment 2 Next, a second embodiment will be described. FIG. 7 is a block diagram illustrating a system configuration according to the second embodiment. The system configuration shown in FIG.
This is almost the same as the system configuration shown in FIG. 13 of the conventional example. The difference is that the processing contents of the counter END processing unit 12 are stored in the system ROM 3 and the device RA
That is, a counter-related device 13 is provided in M6.

【0026】次に、動作について説明する。プログラマ
ブルコントローラ1の概略処理は、従来例の図14に示
したものとほぼ同様である。ここで、相違点は、シーケ
ンスプログラム実行後にコールされるカウンタに関する
END処理である。この処理について図8を用いて説明
する。
Next, the operation will be described. The schematic processing of the programmable controller 1 is almost the same as that of the conventional example shown in FIG. Here, the difference is the END processing for the counter called after the execution of the sequence program. This processing will be described with reference to FIG.

【0027】最初に、RC現コイルのON/OFFを判
断し(S201)、ここで、RC現コイルワークがOF
Fであると判断した場合には、ステップS213の処理
を実行する。RC現コイルワークがONであると判断し
た場合には、RC前コイルワークのON/OFFを判断
する(S202)。ここで、RC前コイルワークがON
であると判断した場合には、ステップS213の処理を
実行する。RC前コイルワークがOFFであると判断し
た場合には、RC現在値デバイスに1を加算する(S2
03)。
First, it is determined whether the RC current coil is ON / OFF (S201).
If it is determined to be F, the process of step S213 is executed. If it is determined that the RC current coil work is ON, ON / OFF of the pre-RC coil work is determined (S202). Here, the coil work before RC is ON
If it is determined that is, the process of step S213 is executed. If it is determined that the pre-RC coil work is OFF, 1 is added to the RC current value device (S2).
03).

【0028】続いて、RC現在値デバイスとRC設定値
1の比較を実行し(S204)、RC1設定値1の方が
大きいと判断した場合(RC現在値デバイス<RC設定
値1)には、RC現在値デバイスがRC設定値1まで到
達していない状態であるため、RC−LT接点をON、
RC−EQ接点をOFF、RC−GT接点をOFFにし
(S205)、RC接点をOFFした(S206)後、
ステップS213の処理を実行する。
Subsequently, the RC current value device is compared with the RC set value 1 (S204). If it is determined that the RC1 set value 1 is larger (RC present value device <RC set value 1), Since the RC current value device has not reached the RC set value 1, the RC-LT contact is turned ON,
After turning off the RC-EQ contact, turning off the RC-GT contact (S205), and turning off the RC contact (S206),
The process of step S213 is performed.

【0029】また、上記ステップS204の判断におい
て、RC現在値デバイスがRC設定値1と等しいと判断
した場合(RC現在値デバイス=RC設定値1)には、
RC−LT接点をOFF、RC−EQ接点をON、RC
−GT接点をOFFした(S207)後、ステップS2
13の処理を実行する。
If it is determined in step S204 that the RC current value device is equal to the RC set value 1 (RC current value device = RC set value 1),
RC-LT contact OFF, RC-EQ contact ON, RC
After turning off the GT contact (S207), step S2
13 is executed.

【0030】さらに、ステップS204の判断におい
て、RC1現在値デバイスよりRC1設定値の方が大き
いと判断した場合(RC現在値デバイス>RC設定値
1)には、次に、RC1現在値とRC設定値2との比較
を実行する(S208)。その結果、RC現在値の方が
小さいと判断した場合(RC現在値デバイス<RC設定
値2)には、RC−LT接点をOFF、RC−EQ接点
をOFF、RC−GT接点をONした(S209)後、
ステップS213の処理を実行する。
If it is determined in step S204 that the RC1 set value is larger than the RC1 current value device (RC present value device> RC set value 1), then the RC1 current value and the RC set value are set. A comparison with the value 2 is executed (S208). As a result, when it is determined that the RC current value is smaller (RC current value device <RC set value 2), the RC-LT contact is turned off, the RC-EQ contact is turned off, and the RC-GT contact is turned on ( After S209),
The process of step S213 is performed.

【0031】また、上記ステップS208の判断におい
て、RC現在値デバイスがRC設定値2と等しい、ある
いは大きいと判断した場合(RC現在値デバイス≧RC
設定値2)には、RC−LT接点をON、RC−EQ接
点をOFF、RC−GT接点をOFFした(S210)
後、RC接点をONさせる(S211)と同時にRC現
在値を0クリアし(S212)、ステップS213の処
理を実行する。上記ステップS213においては、RC
の現コイルをRCの前コイルに転送し、次回本サブルー
チンをコールするための準備を行う。
If it is determined in step S208 that the RC current value device is equal to or larger than the RC set value 2 (RC current value device ≧ RC
For the set value 2), the RC-LT contact was turned on, the RC-EQ contact was turned off, and the RC-GT contact was turned off (S210).
Thereafter, the RC contact value is cleared to 0 at the same time when the RC contact is turned ON (S211) (S212), and the process of step S213 is executed. In the above step S213, RC
Is transferred to the previous coil of the RC, and preparations are made for calling this subroutine next time.

【0032】図9は、第2の実施例に係るプログラマブ
ルコントローラのシーケンスプログラム例であり、外部
接点X1のON/OFF回数をカウンタ機能命令(<R
C>)によりカウントし、RCの小さい方の設定値(K
3)にX1のON/OFF回数が到達するとRC−LT
接点がOFF、RC−EQ接点がONし、大きい方の設
定値(K6)にX1のON/OFF回数が到達すると、
RC−LT接点がON、RC−GT接点がOFF、RC
−接点がON、RC現在値が0となり、次回X1がON
するとRC現在値が1となり、RC接点がOFFするこ
とになる。また、図10は、上記図9に示したシーケン
スプログラム例におけるカウンタの動作を示すタイミン
グチャートである。
FIG. 9 is an example of a sequence program of the programmable controller according to the second embodiment. The ON / OFF count of the external contact X1 is determined by a counter function command (<R
C>), and the smaller set value of RC (K
When the number of ON / OFF of X1 reaches 3), RC-LT
When the contact is turned off, the RC-EQ contact is turned on, and the ON / OFF count of X1 reaches the larger set value (K6),
RC-LT contact is ON, RC-GT contact is OFF, RC
-Contact is ON, RC current value is 0, next time X1 is ON
Then, the current RC value becomes 1, and the RC contact is turned off. FIG. 10 is a timing chart showing the operation of the counter in the example of the sequence program shown in FIG.

【0033】なお、図11は、第2の実施例に係るカウ
ンタ命令に関連するデバイスを示し、図12は、カウン
タ命令に関連するワークRAMを示している。
FIG. 11 shows a device relating to the counter instruction according to the second embodiment, and FIG. 12 shows a work RAM relating to the counter instruction.

【0034】[0034]

【発明の効果】以上のように、この発明に係るプログラ
マブルコントローラおよびカウンタEND処理方法によ
れば、ユーザはシーケンスRAMにカウンタリセット命
令を書込むことなく、カウンタの現在値がカウンタの設
定値に到達すると自動的にカウンタの接点および現在値
をリセットさせることができるので、ユーザのシーケン
スプログラムを縮小させ、デバッグ作業を短縮させるこ
とができる。
As described above, according to the programmable controller and the counter END processing method of the present invention, the current value of the counter reaches the set value of the counter without the user writing the counter reset command to the sequence RAM. Then, since the contacts and the current value of the counter can be automatically reset, the sequence program of the user can be reduced, and the debugging work can be reduced.

【0035】また、カウンタ命令内にカウンタ設定値を
2つ備え、小さい方のカウンタ設定値に対するカウンタ
現在値の大小比較情報をプログラマブルコントローラ内
のデバイスメモリに備えたことにより、ワークの位置決
めを正確に、かつ、高速に行う際、指定位置付近までは
高速にワークを動作させ、指定位置付近に到達するとワ
ークを低速に動作させ、位置決めを完了させる。この場
合、カウンタ設定値1を指定位置付近に設定しておき、
カウンタ設定値2を位置決め完了位置に設定することに
より、1つのカウンタデバイスで対応できるため、ユー
ザは作成されたシーケンスプログラムを理解する時間を
短縮させることができる。
In addition, by providing two counter setting values in the counter instruction and providing the device memory in the programmable controller with information on the magnitude comparison of the counter current value with respect to the smaller counter setting value, accurate positioning of the work can be achieved. In addition, when performing at high speed, the work is operated at high speed up to the vicinity of the designated position, and at the vicinity of the designated position, the work is operated at low speed to complete the positioning. In this case, set the counter setting value 1 near the specified position,
By setting the counter set value 2 to the position where the positioning is completed, one counter device can be used, so that the user can reduce the time to understand the created sequence program.

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

【図1】この発明に係るプログラマブルコントローラの
システム構成(実施例1)を示すブロック図である。
FIG. 1 is a block diagram showing a system configuration (first embodiment) of a programmable controller according to the present invention.

【図2】この発明に係るプログラマブルコントローラの
カウンタ機能命令に関するEND処理の動作を示すフロ
ーチャートである。
FIG. 2 is a flowchart showing an operation of an END process for a counter function instruction of the programmable controller according to the present invention.

【図3】この発明に係るプログラマブルコントローラの
周辺装置により作成されたカウンタ機能命令のシーケン
スプログラム例を示す説明図である。
FIG. 3 is an explanatory diagram showing an example of a sequence program of a counter function instruction created by a peripheral device of the programmable controller according to the present invention.

【図4】この発明に係るプログラマブルコントローラに
おけるカウンタ機能命令の動作を示すタイミングチャー
トである。
FIG. 4 is a timing chart showing an operation of a counter function instruction in the programmable controller according to the present invention.

【図5】この発明に係るプログラマブルコントローラの
カウンタ命令に関連するデバイスを示す説明図である。
FIG. 5 is an explanatory diagram showing devices related to a counter instruction of the programmable controller according to the present invention.

【図6】この発明に係るプログラマブルコントローラの
カウンタ命令に関連するワークRAMを示す説明図であ
る。
FIG. 6 is an explanatory diagram showing a work RAM related to a counter instruction of the programmable controller according to the present invention.

【図7】この発明に係るプログラマブルコントローラの
システム構成(実施例2)を示すブロック図である。
FIG. 7 is a block diagram showing a system configuration (Example 2) of a programmable controller according to the present invention.

【図8】この発明に係るプログラマブルコントローラの
カウンタ機能命令に関するEND処理の動作を示すフロ
ーチャートである。
FIG. 8 is a flowchart showing an operation of an END process for a counter function instruction of the programmable controller according to the present invention.

【図9】この発明に係るプログラマブルコントローラの
周辺装置により作成されたカウンタ機能命令のシーケン
スプログラム例を示す説明図である。
FIG. 9 is an explanatory diagram showing an example of a sequence program of a counter function instruction created by a peripheral device of the programmable controller according to the present invention.

【図10】この発明に係るプログラマブルコントローラ
におけるカウンタ機能命令の動作を示すタイミングチャ
ートである。
FIG. 10 is a timing chart showing the operation of a counter function instruction in the programmable controller according to the present invention.

【図11】この発明に係るプログラマブルコントローラ
のカウンタ命令に関連するデバイスを示す説明図であ
る。
FIG. 11 is an explanatory diagram showing devices related to the counter instruction of the programmable controller according to the present invention.

【図12】この発明に係るプログラマブルコントローラ
のカウンタ命令に関連するワークRAMを示す説明図で
ある。
FIG. 12 is an explanatory diagram showing a work RAM related to a counter instruction of the programmable controller according to the present invention.

【図13】従来におけるプログラマブルコントローラの
システム構成を示すブロック図である。
FIG. 13 is a block diagram showing a system configuration of a conventional programmable controller.

【図14】プログラマブルコントローラの概略処理の動
作を示すフローチャートである。
FIG. 14 is a flowchart illustrating an operation of a schematic process of a programmable controller.

【図15】従来におけるプログラマブルコントローラの
カウンタ機能命令に関するEND処理の動作を示すフロ
ーチャートである。
FIG. 15 is a flowchart showing an operation of an END process relating to a counter function instruction of a conventional programmable controller.

【図16】従来における周辺装置により作成されたカウ
ンタ機能命令のシーケンスプログラム例を示す説明図で
ある。
FIG. 16 is an explanatory diagram showing a sequence program example of a counter function instruction created by a conventional peripheral device.

【図17】従来におけるカウンタ命令の動作を示すタイ
ミングチャートである。
FIG. 17 is a timing chart showing the operation of a conventional counter instruction.

【図18】従来におけるカウンタ命令に関連するデバイ
スを示す説明図である。
FIG. 18 is an explanatory diagram showing a device related to a counter instruction in the related art.

【図19】従来におけるカウンタ命令に関連するワーク
RAMを示す説明図である。
FIG. 19 is an explanatory diagram showing a work RAM related to a conventional counter instruction.

【図20】カウンタ処理における一連の処理動作を示す
フローチャートである。
FIG. 20 is a flowchart showing a series of processing operations in the counter processing.

【符号の説明】[Explanation of symbols]

1 プログラマブルコントローラ 2 CPU 3 システムROM 4 カウンタEND処理部 5 システムRAM 6 デバイスRAM 7 周辺装置 8 外部入力インタフェース 9 外部出力インタフェース 10 シーケンスRAM 11 システムバス 12 カウンタEND処理部 13 カウンタ関連デバイス DESCRIPTION OF SYMBOLS 1 Programmable controller 2 CPU 3 System ROM 4 Counter END processing part 5 System RAM 6 Device RAM 7 Peripheral device 8 External input interface 9 External output interface 10 Sequence RAM 11 System bus 12 Counter END processing part 13 Counter related device

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 プログラマブルコントローラの内部命令
において外部接点ON/OFF回数をカウントするカ
ウント手段と、該カウント手段によりカウントされたカ
ウント値とカウンタ機能命令内に設定される設定値とが
等しく(カウントアップ状態に)なるとONする接点デ
バイスを有するプログラマブルコントローラにおいて、 カウンタアップ状態になったとき、前記接点デバイスを
ONすると同時に、前記カウント手段をリセットし、次
に、前記外部接点がONしたとき、前記接点デバイスを
OFFする処理手段を具備することを特徴とするプログ
ラマブルコントローラ。
A count means for counting the number of ON / OFF of an external contact in an internal command of a programmable controller, and a count value counted by the count means is equal to a set value set in a counter function command (count function). In a programmable controller having a contact device that is turned on when the external contact is turned on, the counter device is reset when the counter device is turned on. A programmable controller comprising processing means for turning off a contact device.
【請求項2】 プログラマブルコントローラの内部命令
において外部接点ON/OFF回数をカウントし、カ
ウントされたカウント値とカウンタ機能命令内に設定さ
れる設定値とが等しく(カウントアップ状態に)なった
とき、接点デバイスをONすると同時に、カウント値を
リセットし、次に、前記外部接点がONしたとき、前記
接点デバイスをOFFすることを特徴とするプログラマ
ブルコントローラのカウンタEND処理方法。
2. When the number of ON / OFF of the external contact is counted by an internal command of the programmable controller, and when the counted value is equal to the set value set in the counter function command (into a count-up state). And resetting the count value at the same time as turning on the contact device, and then turning off the contact device when the external contact is turned on.
【請求項3】 プログラマブルコントローラの内部命令
において外部接点ON/OFF回数をカウントするカ
ウント手段と、カウンタ機能命令内に第1の設定値と、
該第1の設定値よりも大きい第2の設定値とを備え、 前記カウント手段によりカウントされたカウント値が前
記第1の設定値より小さいときに第1の接点デバイスを
ONし、前記カウント手段によりカウントされたカウン
ト値が前記第1の設定値と等しくなったときに第2の接
点デバイスをONし、前記カウント手段によりカウント
されたカウント値が前記第1の設定値より大きく、か
つ、前記第2の設定値より小さいときに第3の接点デバ
イスをONする処理手段を具備することを特徴とするプ
ログラマブルコントローラ。
3. A count means for counting the number of ON / OFF of an external contact in an internal command of a programmable controller, a first set value in a counter function command,
A second set value that is larger than the first set value, and when the count value counted by the count means is smaller than the first set value, turns on the first contact device; The second contact device is turned on when the count value counted by the above becomes equal to the first set value, and the count value counted by the counting means is larger than the first set value, and A programmable controller comprising processing means for turning on a third contact device when the value is smaller than a second set value.
【請求項4】 プログラマブルコントローラの内部命令
において外部接点ON/OFF回数をカウントし、カ
ウンタ機能命令内に第1の設定値と、該第1の設定値よ
りも大きい第2の設定値を備え、 カウント値が第1の設定値より小さいときに第1の接点
デバイスをONし、カウント値が第1の設定値と等しく
なったときに第2の接点デバイスをONし、カウント値
が第1の設定値より大きく、かつ、第2の設定値より小
さいときに第3の接点デバイスをONすることを特徴と
するプログラマブルコントローラのカウンタEND処理
方法。
4. A counting ON / OFF times of the external contact in internal instruction of the programmable controller comprises a first set value to the counter function in the instruction, the second set value larger than the first set value When the count value is smaller than the first set value, the first contact device is turned on. When the count value becomes equal to the first set value, the second contact device is turned on. And turning on the third contact device when the value is larger than the set value and smaller than the second set value.
JP16279993A 1993-06-30 1993-06-30 Programmable controller and counter END processing method thereof Expired - Lifetime JP2875136B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16279993A JP2875136B2 (en) 1993-06-30 1993-06-30 Programmable controller and counter END processing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16279993A JP2875136B2 (en) 1993-06-30 1993-06-30 Programmable controller and counter END processing method thereof

Publications (2)

Publication Number Publication Date
JPH0778009A JPH0778009A (en) 1995-03-20
JP2875136B2 true JP2875136B2 (en) 1999-03-24

Family

ID=15761439

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16279993A Expired - Lifetime JP2875136B2 (en) 1993-06-30 1993-06-30 Programmable controller and counter END processing method thereof

Country Status (1)

Country Link
JP (1) JP2875136B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009293173A (en) * 2008-06-05 2009-12-17 Koji Uchida Slime control and pitch control method in paper and pulp production process

Also Published As

Publication number Publication date
JPH0778009A (en) 1995-03-20

Similar Documents

Publication Publication Date Title
JP2875136B2 (en) Programmable controller and counter END processing method thereof
US8650336B2 (en) Direct memory access (DMA) device with event mover that moves event from event calendar to expired event queue without management of central processing unit
US4807178A (en) Programmable sequence controller having indirect and direct input/output apparatus
WO2018112852A1 (en) Ladderlogic programming language-based numerical control apparatus, numerical control system, and debugging method therefor
EP0614148A1 (en) Data processing apparatus
JP2002297209A (en) Sequence program storage method in sequence control device
JPH03288906A (en) Instruction executing system for pc
JPH03105503A (en) Programmable controller
JPS59144955A (en) Information processor
JPS6398704A (en) Programmable controller
JPH0731526B2 (en) Programmable controller
JPH04209007A (en) User program editing system for programmable controller
JPS60241104A (en) Arithmetic method of digital controller
JPH01288904A (en) Sequence program switching device
JP3348177B2 (en) Programmable controller
JP3013619B2 (en) Programmable controller
JPS6273335A (en) Stack control system
JPH09160786A (en) Microprocessor
JPH0368025A (en) Device and method for processing data
CN111371820A (en) Communication method, system and communication equipment based on timer triggering
JPH0651812A (en) Programmable controller
JPH10171654A (en) High-speed data processing unit
JPH04111132A (en) Method and device for control of multi-pointer
JPH08286912A (en) Program controller
JPH04243406A (en) Software configulation system