JP2002014706A - I/o unit and programmable controller - Google Patents

I/o unit and programmable controller

Info

Publication number
JP2002014706A
JP2002014706A JP2000194707A JP2000194707A JP2002014706A JP 2002014706 A JP2002014706 A JP 2002014706A JP 2000194707 A JP2000194707 A JP 2000194707A JP 2000194707 A JP2000194707 A JP 2000194707A JP 2002014706 A JP2002014706 A JP 2002014706A
Authority
JP
Japan
Prior art keywords
output
timer
user program
unit
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2000194707A
Other languages
Japanese (ja)
Other versions
JP4345200B2 (en
Inventor
Shuji Otani
修史 大谷
Kazuya Takeuchi
和也 武内
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2000194707A priority Critical patent/JP4345200B2/en
Publication of JP2002014706A publication Critical patent/JP2002014706A/en
Application granted granted Critical
Publication of JP4345200B2 publication Critical patent/JP4345200B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an I/O unit and a programmable controller which permit timer output by a user under arbitrary conditions and in arbitrary timing without fixedly providing any specific operation mode nor mounting a programming function on a unit. SOLUTION: At the start of a timer output instruction, a CPU 25 sets the clock frequency of a pulse generator 33 and presets the clock count number of a hardware counter 35, and also starts outputting a general signal from a general port 25a to an AND circuit 36 at the same time. Consequently, the AND circuit 36 remains ON at the timer output instruction start until the output of the general signal from the CPU 25 and a count-up signal from the hardware counter 35 to the AND circuit 36 is turned OFF.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、プログラマブル
コントローラのI/Oユニット及びプログラマブルコン
トローラに関し、詳しくは、I/Oユニットまたはプロ
グラマブルコントローラにプログラミング機能を搭載す
ることにより、高精度なタイマ出力機能を具備するよう
にしたI/Oユニット及びプログラマブルコントローラ
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an I / O unit and a programmable controller of a programmable controller, and more particularly, to a high-precision timer output function by mounting a programming function on the I / O unit or the programmable controller. The present invention relates to an I / O unit and a programmable controller.

【0002】[0002]

【従来の技術】従来、プログラマブルコントローラ(プ
ログラマブルロジックコントローラ)システムにおいて
は、CPUユニット、I/Oユニット(入出力ユニッ
ト)等のユニットがビルディングブロックタイプに配列
されてシステムが構築されている(いわゆる集合ユニッ
ト型)。
2. Description of the Related Art Conventionally, in a programmable controller (programmable logic controller) system, units such as a CPU unit and an I / O unit (input / output unit) are arranged in a building block type to form a system (a so-called set). Unit type).

【0003】CPUユニットは、I/Oユニット等から
の入力信号(接点情報)に基づいてユーザプログラムの
演算実行を行ない、実行結果をI/Oユニットに出力す
る等の処理を行なうとともにプログラマブルコントロー
ラシステム全体を統括制御する。
A CPU unit executes a calculation of a user program based on an input signal (contact information) from an I / O unit or the like, performs processing such as outputting an execution result to the I / O unit, and performs processing such as a programmable controller system. Overall control of the whole.

【0004】また、I/Oユニットは直接プログラマブ
ルコントローラシステムにおける制御対象機器が接続さ
れるユニットで、制御対象機器からの入力信号をCPU
ユニットに送出するとともに、CPUユニットからの出
力信号を受信して制御対象機器に送出する。
[0004] An I / O unit is a unit to which a device to be controlled in a programmable controller system is directly connected.
In addition to sending the signal to the unit, the output signal from the CPU unit is received and sent to the device to be controlled.

【0005】ここで、プログラマブルコントローラシス
テムにおいてタイマ機能を実現する場合、以下の実現方
法がある。 (a)CPUユニットにおいて、ラダープログラムでタ
イマ命令とOUT命令にてプログラムで実現する方法。 (b)I/Oユニット(高機能I/Oユニット)におい
て、タイマ機能を動作モードとして組み込み、所定条件
の下でI/Oユニットにより指定された時間だけ出力す
る方法。
Here, there are the following realization methods for realizing the timer function in the programmable controller system. (A) In a CPU unit, a method of implementing a program by a timer instruction and an OUT instruction by a ladder program. (B) A method in which a timer function is incorporated in an I / O unit (high-performance I / O unit) as an operation mode and output is performed for a time specified by the I / O unit under predetermined conditions.

【0006】なお、高機能I/Oユニットというのは、
CPUユニットの負荷軽減、スキャンタイムの短縮等を
目的として従来のI/Oユニットに新機能を付加したI
/Oユニットである。
The high-performance I / O unit is
An I / O unit with new functions added to the existing I / O unit for the purpose of reducing the load on the CPU unit, shortening the scan time, etc.
/ O unit.

【0007】ここで、上記(a)のCPUユニットのラ
ダープログラムによるタイマ機能を図11を参照しなが
ら説明すると、(1)のサイクリック処理における出力
開始の条件成立よりタイマ命令を起動し、これによって
(2)でタイマをセットし、(3)で出力開始条件成立
より出力命令が実行され、IORF(IOリフレッシ
ュ)命令にて外部に出力される。
Here, the timer function of the CPU unit (a) based on the ladder program will be described with reference to FIG. 11. A timer instruction is started when the output start condition in the cyclic processing (1) is satisfied. Thus, the timer is set in (2), the output instruction is executed when the output start condition is satisfied in (3), and the output is executed to the outside by the IORF (IO refresh) instruction.

【0008】次に、(4)でサイクリック処理において
タイムアップが検出されると、リセット命令を実行し、
(5)で該実行結果をIORF(IOリフレッシュ)命
令にて外部に出力する((4)でタイムアップが検出さ
れると続いて外部に出力する。すなわち、ユーザプログ
ラムの一巡実行の後のENDリフレッシュ時に外部出力
するのではない。)。
Next, when a time-up is detected in the cyclic processing in (4), a reset instruction is executed,
The execution result is output to the outside by an IORF (IO refresh) instruction in (5), and is output to the outside if a time-up is detected in (4), that is, END after one round of execution of the user program. It is not output externally during refresh.)

【0009】図12は、上記図11の処理をタイムチャ
ートで表したもので、(1)で出力開始指令が時刻t1
にあると、(2)でタイマが時刻t2にカウント割込み
を開始し、以後は、割込み、サイクリックセンスなどで
出力がOFFになる時刻t4までカウント割込みを行
い、(3)の外部出力は、時刻t3より開始されて、時
刻t5に出力OFFとなる。
FIG. 12 is a time chart showing the processing of FIG. 11 described above. In FIG.
In (2), the timer starts a count interrupt at time t2, and thereafter, a count interrupt is performed until time t4 when the output is turned off by an interrupt, cyclic sense, or the like, and the external output of (3) is Starting at time t3, the output is turned off at time t5.

【0010】なお、図12において、出力開始指令時刻
t1に対する外部出力開始時刻t3の遅れ時間D1は外
部出力するまでのオーバーヘッドであり、タイマ割込み
のOFF時刻t4に対する外部出力OFF時刻t5の遅
れ時間D2は出力OFFするまでのオーバーヘッドであ
る。
In FIG. 12, the delay time D1 of the external output start time t3 with respect to the output start command time t1 is an overhead until external output, and the delay time D2 of the external output OFF time t5 with respect to the timer interrupt OFF time t4. Is the overhead until the output is turned off.

【0011】なお、出力開始指令時刻t1に対する外部
出力開始時刻t3の遅れ時間D1は、図11における
(1)の出力開始指令がサイクリック処理にて行われる
こと、及び図11における(3)の外部出力までに
(1)、(2)の2命令が挿入されていることに起因す
る。
The delay time D1 of the external output start time t3 with respect to the output start instruction time t1 is based on the fact that the output start instruction of (1) in FIG. This is because two instructions (1) and (2) are inserted before the external output.

【0012】また、タイマ割込みのOFF時刻t4に対
する外部出力OFF時刻t5の遅れ時間D2は、タイム
アップがサイクリック処理にて検出されること等に起因
する。
Further, the delay time D2 of the external output OFF time t5 with respect to the timer interrupt OFF time t4 is due to the fact that the time-up is detected in the cyclic processing.

【0013】[0013]

【発明が解決しようとする課題】しかしながら、上記の
如き従来のCPUユニット及びI/Oユニット(高機能
I/Oユニット)のタイマ機能には、以下の問題点があ
った。
However, the timer functions of the conventional CPU unit and I / O unit (high-performance I / O unit) as described above have the following problems.

【0014】まず、上記(a)のCPUユニットでタイ
マ機能を実現する場合。
First, the case where the timer function is realized by the CPU unit (a).

【0015】(イ)タイマ命令自体がラダープログラム
におけるサイクリック処理の中で、カウント、カウント
アップされるため、サイクルタイムの変動などによりバ
ラツキが生じ、指定時間に対する誤差が大きい。
(A) Since the timer instruction itself is counted and counted up during the cyclic processing in the ladder program, variations occur due to variations in cycle time and the like, and the error with respect to the designated time is large.

【0016】図11では、(1)のサイクリック処理で
タイマ命令が起動され、(4)のサイクリック処理でタ
イムアップが検出されている。このように、サイクリッ
クに命令内でカウント動作されるため時間精度としては
よくない。
In FIG. 11, a timer instruction is started in the cyclic process (1), and time-up is detected in the cyclic process (4). As described above, since the count operation is performed cyclically in the instruction, the time accuracy is not good.

【0017】(ロ)また、図11では、(3)で出力開
始条件成立より出力命令が実行され、IORF(IOリ
フレッシュ)命令にて外部に出力されるが、その前の
(1),(2)の2命令処理分のオーバーヘッドが出力
開始までに発生する。また、IORF(IOリフレッシ
ュ)命令を使用しないと、ENDRF(ENDリフレッ
シュ)にて外部出力となるため、さらにオーバーヘッド
は大きくなる。
(B) In FIG. 11, the output instruction is executed when the output start condition is satisfied in (3) and output to the outside by an IORF (IO refresh) instruction. 2) The overhead for processing two instructions occurs before output starts. If the IORF (IO refresh) instruction is not used, the overhead is further increased because the external output is provided by the ENDRF (END refresh).

【0018】このように、タイマ命令とOUT命令が別
々に動作するため、出力操作するまでのオーバーヘッド
時間が大きい。
As described above, since the timer instruction and the OUT instruction operate separately, the overhead time until the output operation is performed is long.

【0019】(ハ)また、タイマ精度を上げるために、
カウント、カウントアップ処理を割込みで実施した場
合、システムとして割込みが発生するため、あまり短い
時間間隔での割込みは利用できず、そのため精度も上げ
られない。
(C) In order to increase the timer accuracy,
When the count and count-up processes are performed by interrupts, an interrupt occurs as a system, so that interrupts at very short time intervals cannot be used, and therefore, accuracy cannot be improved.

【0020】次に、上記(b)のI/Oユニットでタイ
マ機能を実現する場合。
Next, a case where the timer function is realized by the I / O unit (b).

【0021】(イ)ハードウェアにてタイマ出力精度を
確保したとしても、従来の高機能I/Oユニットでは、
タイマ出力は特定動作を想定した動作モードとして組み
込んであるため、動作モードに自由度がなく、設定した
用途以外には利用できない。つまり、I/Oユニットに
はじめから内蔵されているものである。
(A) Even if the timer output accuracy is secured by hardware, the conventional high-performance I / O unit
Since the timer output is incorporated as an operation mode assuming a specific operation, the operation mode has no flexibility and cannot be used for purposes other than the set use. That is, it is built in the I / O unit from the beginning.

【0022】また、ハードウェアのみの構成とすると、
時間設定の自由度も低い。
When the configuration is made up of only hardware,
The flexibility of time setting is low.

【0023】(ロ)特定の出力開始指令に基づいてタイ
マのカウント割込みを開始し、外部出力を得るので、タ
イマ動作と出力動作が結合し、上記CPUユニットに比
べて精度は上がる。しかし、内部タイマの割込みを使用
するためソフト処理となり、割込み禁止処理などと競合
した場合、精度が保てないケースが生じる。
(B) A timer count interrupt is started based on a specific output start command and an external output is obtained, so that the timer operation and the output operation are combined, and the accuracy is improved as compared with the CPU unit. However, since an interrupt of the internal timer is used, the process becomes a software process, and in the case of competing with an interrupt prohibiting process, a case where accuracy cannot be maintained occurs.

【0024】そこで、この発明は、特定の動作モードを
固定的に持たせることなく、タイマ出力命令とタイマ出
力専用のハードウェアを組み合わせることにより、ユー
ザにおいて任意の条件、タイミングでタイマ出力できる
ようにしたI/Oユニット及びプログラマブルコントロ
ーラを提供することを目的とする。
Therefore, the present invention allows a user to output a timer under arbitrary conditions and timing by combining a timer output instruction and hardware dedicated to timer output without a fixed operation mode. It is an object to provide an I / O unit and a programmable controller which are provided.

【0025】[0025]

【課題を解決するための手段】上記目的を達成するため
に、この発明に係わるプログラマブルコントローラのI
/Oユニットは、外部で組まれたユーザプログラムの入
出力部と、上記入出力部から取り込んだユーザプログラ
ムが格納される書き換え可能なメモリと、上記メモリに
格納されたユーザプログラムを実行するユーザプログラ
ム実行手段と、上記ユーザプログラムにおけるタイマ出
力命令によって所定周波数のパルスを出力するパルスジ
ェネレータと、上記パルスジェネレータの出力パルス数
をカウントするハードカウンタと、を有し、上記プログ
ラミングされたユーザプログラムにおけるタイマ出力命
令によって任意の条件またはタイミングでタイマ出力命
令を実行することを特徴とする。
In order to achieve the above object, the present invention relates to a programmable controller according to the present invention.
The / O unit includes an input / output unit for a user program externally assembled, a rewritable memory for storing the user program fetched from the input / output unit, and a user program for executing the user program stored in the memory. Executing means, a pulse generator for outputting a pulse of a predetermined frequency in accordance with a timer output instruction in the user program, and a hard counter for counting the number of output pulses of the pulse generator, wherein a timer output in the programmed user program is provided. It is characterized in that a timer output instruction is executed under an arbitrary condition or timing by the instruction.

【0026】ここで、プログラマブルコントローラのI
/Oユニットとはプログラマブルコントローラシステム
を構成するユニットの1つであり、多数の制御対象機器
が接続されるものであるが、この発明では、I/Oユニ
ットはタイマ出力命令を実行し、高精度で自由度の高い
タイマ機能を実現する。
Here, the programmable controller I
The I / O unit is one of the units that constitute the programmable controller system, and is a unit to which a number of control target devices are connected. In the present invention, the I / O unit executes a timer output instruction and performs high precision Realizes a highly flexible timer function.

【0027】次に、ユーザプログラムの入出力部とは、
ツールとの通信を行う部分で、実施形態では図1に示し
たプログラム入出力部21である。図1において、プロ
グラム入出力部21はI/Oユニット20の正面に設け
られているが、取り付け位置や形態は実施形態に限定さ
れない。この入出力部によって、ユーザがプログラミン
グするときに用いるプログラム開発用ツールと直接接続
でき、プログラムをツールへアップロード、ツールから
ダウンロードすることができる。
Next, the input / output section of the user program
This is a portion that communicates with the tool, and in the embodiment is the program input / output unit 21 shown in FIG. In FIG. 1, the program input / output unit 21 is provided on the front of the I / O unit 20, but the mounting position and form are not limited to the embodiment. This input / output unit allows direct connection with a program development tool used when the user performs programming, and allows the program to be uploaded to the tool and downloaded from the tool.

【0028】また、上記入出力部から取り込んだユーザ
プログラムが格納される書き換え可能なメモリとは、実
施形態では、図2に示すPRGメモリ27である。書き
換え可能なメモリである。なお、このメモリは実施形態
のように独立した専用のメモリを設けても良いが、他の
メモリと兼用してもよい。
In the embodiment, the rewritable memory for storing the user program fetched from the input / output unit is the PRG memory 27 shown in FIG. It is a rewritable memory. Note that this memory may be provided as an independent dedicated memory as in the embodiment, but may also be used as another memory.

【0029】なお、I/Oユニットのプログラムを変更
するときは、ツールからプログラムを全て上記入出力部
を介して再びダウンロードしてPRGメモリ27の任意
のエリアに格納すればよい。また、上書き保存してもよ
い。
When the program of the I / O unit is changed, all the programs from the tool may be downloaded again via the input / output unit and stored in an arbitrary area of the PRG memory 27. Alternatively, the data may be overwritten and saved.

【0030】また、オンラインエディットで一部を変更
するときなどは、PRGメモリ27から一部をツールに
アップロードし、ツールにて表示し(例えば)、ユーザ
がツールで一部変更してから再度PRGメモリ27に送
るようにすればよい。
When a part is to be changed by online editing, a part is uploaded from the PRG memory 27 to the tool, displayed by the tool (for example), the user changes the part by the tool, and then the PRG is changed again. What is necessary is just to send to the memory 27.

【0031】また、上記メモリに格納されたユーザプロ
グラムを実行するユーザプログラム実行手段とは、図2
及び図3に示すCPU25である。
Further, the user program executing means for executing the user program stored in the memory is a user program executing means as shown in FIG.
And the CPU 25 shown in FIG.

【0032】こうして、本発明では、ユーザはI/Oユ
ニットに後付けでプログラミングされたユーザプログラ
ムを組み込むことができる。
As described above, according to the present invention, the user can incorporate a user program programmed later into the I / O unit.

【0033】すなわち、I/Oユニットに取り込まれ実
行されるプログラムは、ユーザがI/Oユニットで実行
させたいプログラムでユーザが別途作成するカスタマイ
ズされたプログラムである。このプログラムは、プログ
ラマブルコントローラシステムのCPUユニットでなさ
れる処理プログラム(システムプログラムやユーザプロ
グラム)とは独立した別のもので、I/Oユニット向け
で独自のI/O制御ロジックや任意の演算処理などを行
うプログラムである。外部ツールを用いて作成されるプ
ログラムで、ユーザが新規作成、又は書き換え(変更又
は追加)でき、ユーザが自由にプログラミングできるも
のである。
That is, the program which is taken in and executed by the I / O unit is a program which the user wants to execute on the I / O unit and which is a customized program separately created by the user. This program is independent of the processing program (system program or user program) executed by the CPU unit of the programmable controller system, and is unique to the I / O unit, such as an I / O control logic and arbitrary arithmetic processing. Is a program that performs A program created by using an external tool, which can be newly created or rewritten (changed or added) by the user, and can be freely programmed by the user.

【0034】また、上記ユーザプログラムにおけるタイ
マ出力命令によって所定周波数のパルスを出力するパル
スジェネレータとは、実施形態では図3に示すパルスジ
ェネレータ33である。パルスジェネレータは、上記タ
イマ出力命令によって出力パルスの周波数を可変設定で
きる。パルス周波数を大きくするとタイマ精度が上昇
し、パルス周波数を小さくするとタイマ時間を長くする
ことができる。
In the embodiment, the pulse generator which outputs a pulse having a predetermined frequency in response to a timer output instruction in the user program is the pulse generator 33 shown in FIG. The pulse generator can variably set the frequency of the output pulse according to the timer output command. Increasing the pulse frequency increases the timer accuracy, while decreasing the pulse frequency can increase the timer time.

【0035】従って、タイマ出力目的によってパルス周
波数を可変設定でき、自由度の高いタイマ出力を実現で
きる。
Therefore, the pulse frequency can be variably set according to the purpose of the timer output, and a timer output with a high degree of freedom can be realized.

【0036】また、タイマ出力命令によって出力パルス
の周波数を可変設定できるので、ユーザは簡単に出力パ
ルスの周波数を可変設定できる。
Further, since the frequency of the output pulse can be variably set by the timer output command, the user can easily variably set the frequency of the output pulse.

【0037】また、上記パルスジェネレータの出力パル
ス数をカウントするハードカウンタとは、実施形態で
は、図3に示すハードカウンタ35である。
The hard counter for counting the number of output pulses of the pulse generator is, in the embodiment, a hard counter 35 shown in FIG.

【0038】ハードカウンタは、上記タイマ出力命令に
よって上記出力パルス数を可変設定できる。
The hard counter can variably set the number of output pulses according to the timer output command.

【0039】従って、タイマ出力目的によって出力パル
ス数を可変設定でき、しかも、タイマ出力命令によって
出力パルス数を可変設定できるので、ユーザは簡単にタ
イマ値を可変設定できる。
Therefore, the number of output pulses can be variably set according to the purpose of timer output, and the number of output pulses can be variably set according to the timer output command, so that the user can easily set the timer value variably.

【0040】なお、タイマ出力命令とは、実施形態では
図5に示す時間指定付き出力命令70がタイマ出力命令
であり、時間生成の元となる上記パルスジェネレータ3
3にクロック周波数72を設定することによって出力パ
ルスの周波数を可変設定でき、ハードカウンタ35にク
ロックカウント数73を設定することによってタイマ値
を可変設定できる。
In the embodiment, the timer output instruction is an output instruction with time designation 70 shown in FIG. 5 which is a timer output instruction.
By setting the clock frequency 72 to 3, the frequency of the output pulse can be variably set, and by setting the clock count 73 to the hard counter 35, the timer value can be variably set.

【0041】なお、実施形態では、図3に示す如く、パ
ルスジェネレータ33とハードカウンタ35はタイマ出
力回路31を構成し、図2に示す如く、複数のタイマ出
力回路31はタイマ出力回路部(ボード部)23に搭載
されている。
In the embodiment, as shown in FIG. 3, the pulse generator 33 and the hard counter 35 constitute a timer output circuit 31, and as shown in FIG. ) 23.

【0042】従って、I/Oユニットはユニット本体内
のソフトウェア機能とボード部のハードウェア機能の組
み合わせによって任意の条件、タイミングでタイマ出力
命令を実行でき、自由度の高いタイマ機能を実現でき
る。
Accordingly, the I / O unit can execute a timer output instruction under arbitrary conditions and timing by a combination of the software function in the unit body and the hardware function of the board unit, and can realize a timer function with a high degree of freedom.

【0043】また、パルスジェネレータとハードカウン
タはいずれもハードウェアである。
The pulse generator and the hardware counter are both hardware.

【0044】従って、タイマ出力命令があると、以後は
ソフトウェア処理を介することなくハードウェア処理だ
けで出力制御ができ、従来のようにI/Oユニットに割
込みによる影響を与えることなく、高精度のタイマ機能
を実現できる。
Therefore, if there is a timer output instruction, the output can be controlled only by hardware processing without going through software processing. A timer function can be realized.

【0045】また、この発明に係わるプログラマブルコ
ントローラのI/Oユニットは、外部で組まれたユーザ
プログラムの入出力部と、上記入出力部から取り込んだ
ユーザプログラムが格納される書き換え可能なメモリ
と、上記メモリに格納されたユーザプログラムを実行す
るユーザプログラム実行手段と、上記ユーザプログラム
におけるタイマ出力命令によって所定周波数のパルスを
出力するパルスジェネレータと、上記タイマ出力命令に
よって所定の出力時間が設定され、且つこの設定された
出力時間に基づいて上記パルスジェネレータから出力さ
れたパルスをカウントするハードカウンタと、上記タイ
マ出力命令の起動出力と上記ハードカウンタのカウント
アップ信号が入力されると外部にタイマ出力するAND
回路と、を有し、上記プログラミングされたユーザプロ
グラムにおけるタイマ出力命令によって任意の条件また
はタイミングでタイマ出力することを特徴とする。
Further, the I / O unit of the programmable controller according to the present invention comprises: an input / output unit for an externally assembled user program; a rewritable memory for storing the user program fetched from the input / output unit; A user program executing means for executing a user program stored in the memory, a pulse generator for outputting a pulse of a predetermined frequency according to a timer output instruction in the user program, a predetermined output time set by the timer output instruction, and A hard counter that counts the pulses output from the pulse generator based on the set output time; and an AND that outputs a timer to the outside when a start output of the timer output instruction and a count-up signal of the hard counter are input.
And outputting a timer under an arbitrary condition or timing according to a timer output instruction in the programmed user program.

【0046】ここで、上記タイマ出力命令によって所定
の出力時間が設定され、且つこの設定された出力時間に
基づいて上記パルスジェネレータから出力されたパルス
をカウントするとは、タイマ出力命令(図5に示す時間
指定付き出力命令70)のクロックカウント数73が出
力時間で設定されている場合、ハードカウンタは、パル
スジェネレータ33に設定されたクロック周波数72に
基づいてクロックカウント数73に設定された出力時間
だけカウントアップすることをいう。
Here, a predetermined output time is set by the timer output command, and counting the pulses output from the pulse generator based on the set output time means a timer output command (shown in FIG. 5). When the clock count number 73 of the output instruction with time designation 70) is set by the output time, the hard counter outputs only the output time set in the clock count number 73 based on the clock frequency 72 set in the pulse generator 33. To count up.

【0047】また、上記タイマ出力命令の起動出力と上
記ハードカウンタのカウントアップ信号が入力されると
外部にタイマ出力するAND回路とは、実施形態では図
3に示すAND回路36であり、AND回路36はタイ
マ出力命令の起動出力であるCPU25の汎用出力25
aと上記ハードカウンタ35のカウントアップ信号が入
力されると外部にタイマ出力する。
The AND circuit that outputs a timer to the outside when the start output of the timer output instruction and the count-up signal of the hard counter are input is, in the embodiment, an AND circuit 36 shown in FIG. 36 is a general-purpose output 25 of the CPU 25 which is a start output of the timer output instruction.
When "a" and the count-up signal of the hard counter 35 are input, a timer is output to the outside.

【0048】これによって、本発明では、任意の条件、
タイミングでタイマ起動命令を実行でき、自由度の高い
タイマ機能を実現できる。
Thus, in the present invention, any conditions,
A timer start instruction can be executed at a timing, and a timer function with a high degree of freedom can be realized.

【0049】また、パルスジェネレータ、ハードカウン
タ及びAND回路はいずれもハードウェアである。
The pulse generator, the hard counter and the AND circuit are all hardware.

【0050】従って、タイマ出力命令があると、以後は
ソフトウェア処理を介することなくハードウェア処理だ
けで出力制御ができ、従来のようにI/Oユニットに割
込みによる影響を与えることなく、高精度のタイマ機能
を実現できる。
Therefore, when there is a timer output instruction, the output can be controlled only by hardware processing without going through software processing, and high-precision processing can be performed without affecting the I / O unit due to interruption as in the prior art. A timer function can be realized.

【0051】また、この発明に係わるプログラマブルコ
ントローラのI/Oユニットは、外部で組まれたユーザ
プログラムの入出力部と、上記入出力部から取り込んだ
ユーザプログラムが格納される書き換え可能なメモリ
と、上記メモリに格納されたユーザプログラムを実行す
るユーザプログラム実行手段と、上記ユーザプログラム
におけるタイマ出力命令によって所定周波数のパルスを
出力するパルスジェネレータと、上記タイマ出力命令に
よって所定のカウントアップ値が設定され、且つ上記パ
ルスジェネレータから出力されたパルスをカウントする
ハードカウンタと、上記タイマ出力命令の起動出力と上
記ハードカウンタのカウントアップ信号が入力されると
外部にタイマ出力するAND回路と、を有し、上記プロ
グラミングされたユーザプログラムにおけるタイマ出力
命令によって任意の条件またはタイミングでタイマ出力
することを特徴とする。
Further, the I / O unit of the programmable controller according to the present invention comprises: an input / output unit for an externally assembled user program; a rewritable memory for storing the user program fetched from the input / output unit; A user program executing means for executing a user program stored in the memory, a pulse generator for outputting a pulse of a predetermined frequency according to a timer output instruction in the user program, and a predetermined count-up value set by the timer output instruction; A hard counter that counts pulses output from the pulse generator; and an AND circuit that outputs a timer to the outside when a start output of the timer output instruction and a count-up signal of the hard counter are input. Programmed Characterized by timer output at any conditions or timing by a timer output instruction in THE program.

【0052】ここで、上記タイマ出力命令によって所定
のカウントアップ値が設定され、且つ上記パルスジェネ
レータから出力されたパルスをカウントするとは、タイ
マ出力命令(図5に示す時間指定付き出力命令70)の
クロックカウント数73がパルスのカウントアップ値で
設定されている場合であり、この場合はパルスジェネレ
ータ33に設定されたクロック周波数72でクロックカ
ウント数73に設定されたカウントアップ値だけカウン
トする。
Here, the predetermined count-up value is set by the timer output command, and the counting of the pulses output from the pulse generator means that the timer output command (output command 70 with time designation shown in FIG. 5) is used. In this case, the clock count number 73 is set by the count-up value of the pulse. In this case, the count is performed by the count-up value set in the clock count number 73 at the clock frequency 72 set in the pulse generator 33.

【0053】また、上記タイマ出力命令の起動出力と上
記ハードカウンタのカウントアップ信号が入力されると
外部にタイマ出力するAND回路とは、実施形態では図
3に示すAND回路36であり、AND回路36はタイ
マ出力命令の起動出力であるCPU25の汎用出力25
aと上記ハードカウンタ35のカウントアップ信号が入
力されると外部にタイマ出力する。
In the embodiment, the AND circuit 36 for outputting a timer to the outside when the start output of the timer output instruction and the count-up signal of the hard counter are input is the AND circuit 36 shown in FIG. 36 is a general-purpose output 25 of the CPU 25 which is a start output of the timer output instruction.
When "a" and the count-up signal of the hard counter 35 are input, a timer is output to the outside.

【0054】これによって、本発明では、任意の条件、
タイミングでタイマ起動命令を実行でき、自由度の高い
タイマ機能を実現できる。
Thus, according to the present invention, any conditions,
A timer start instruction can be executed at a timing, and a timer function with a high degree of freedom can be realized.

【0055】また、パルスジェネレータ、ハードカウン
タ及びAND回路はいずれもハードウェアである。
The pulse generator, the hard counter and the AND circuit are all hardware.

【0056】従って、タイマ出力命令があると、以後は
ソフトウェア処理を介することなくハードウェア処理だ
けで出力制御ができ、従来のようにI/Oユニットに割
込みによる影響を与えることなく、高精度のタイマ機能
を実現できる。
Therefore, if there is a timer output instruction, the output can be controlled only by hardware processing without going through software processing. A timer function can be realized.

【0057】また、この発明に係わるプログラマブルコ
ントローラのI/Oユニットは、外部で組まれたユーザ
プログラムの入出力部と、上記入出力部から取り込んだ
ユーザプログラムが格納される書き換え可能なメモリ
と、上記メモリに格納されたユーザプログラムを実行す
るユーザプログラム実行手段と、上記ユーザプログラム
におけるタイマ起動命令によって所定周波数のパルスを
出力するパルスジェネレータと、上記タイマ起動命令に
よって上記パルスジェネレータから出力されたパルスを
カウントして外部出力し、タイマ停止命令によって外部
出力を停止するハードカウンタと、を有し、上記ハード
カウンタは上記プログラミングされたユーザプログラム
におけるタイマ起動命令または停止命令によって任意の
条件またはタイミングでタイマ動作することを特徴とす
る。
Further, the I / O unit of the programmable controller according to the present invention comprises: an input / output unit for an externally assembled user program; a rewritable memory for storing the user program fetched from the input / output unit; A user program executing means for executing a user program stored in the memory; a pulse generator for outputting a pulse of a predetermined frequency according to a timer start instruction in the user program; and a pulse output from the pulse generator according to the timer start instruction. A hard counter that counts and outputs externally and stops external output by a timer stop instruction, wherein the hard counter is capable of receiving any condition or timing by a timer start instruction or a stop instruction in the programmed user program. In characterized by timer operation.

【0058】ここで、上記タイマ起動命令によって上記
パルスジェネレータから出力されたパルスをカウントし
て外部出力し、タイマ停止命令によって外部出力を停止
するとは、実施形態では、図6に示すタイマ起動/停止
命令80において、例えば所定の入力条件がタイマ動作
の開始を指示するものであると(動作指令83が起動の
場合)、タイマ動作を開始し、入力条件がタイマ動作の
停止を指示するものであると(動作指令83が停止の場
合)、タイマ動作を停止することをいう。
Here, the pulse output from the pulse generator is counted and outputted externally by the timer start command, and the external output is stopped by the timer stop command. In the embodiment, the timer start / stop shown in FIG. In the instruction 80, for example, if the predetermined input condition is to instruct the start of the timer operation (when the operation command 83 is activated), the timer operation is started, and the input condition is to instruct the stop of the timer operation. (When the operation command 83 is stopped) means stopping the timer operation.

【0059】これによって、本発明では、ユーザが簡単
にタイマ動作を指定してタイマの起動、停止を設定でき
る。
Thus, according to the present invention, the user can easily specify the timer operation and set the start and stop of the timer.

【0060】また、この発明に係わるプログラマブルコ
ントローラのI/Oユニットは、外部で組まれたユーザ
プログラムの入出力部と、上記入出力部から取り込んだ
ユーザプログラムが格納される書き換え可能なメモリ
と、上記メモリに格納されたユーザプログラムを実行す
るユーザプログラム実行手段と、上記ユーザプログラム
におけるタイマ起動命令によって所定周波数のパルスを
出力するパルスジェネレータと、上記タイマ起動命令に
よって上記パルスジェネレータから出力されたパルスを
カウントして外部出力し、タイマ停止命令によって外部
出力を停止するハードカウンタと、上記ハードカウンタ
のタイマ起動時から停止時までのタイマ時間を計測する
タイマ時間計測手段と、を有することを特徴とする。
Further, the I / O unit of the programmable controller according to the present invention comprises: an input / output unit for an externally assembled user program; a rewritable memory for storing the user program fetched from the input / output unit; A user program executing means for executing a user program stored in the memory; a pulse generator for outputting a pulse of a predetermined frequency according to a timer start instruction in the user program; and a pulse output from the pulse generator according to the timer start instruction. A hard counter that counts and outputs externally, and stops external output by a timer stop instruction; and a timer time measuring unit that measures a timer time from a time when the timer of the hard counter is started to a time when the timer is stopped. .

【0061】ここで、上記ハードカウンタのタイマ起動
時から停止時までのタイマ時間を計測するタイマ時間計
測手段とは、ハードカウンタのON時間を計測する構成
をいう。実施形態では、図7においては、時刻t1に起
動入力があり、時刻t2に停止入力がある。この場合、
ハードカウンタ35は時刻t1にタイマ起動命令により
タイマ起動され、時刻t2にタイマ停止命令により停止
されている。従って、タイマ時間計測手段は、外部出力
がONとなっている時刻t1〜t2までの時間を計測す
る。この値は現在値として保持される。
Here, the timer time measuring means for measuring the timer time from the start of the timer to the stop of the timer of the hard counter means a configuration for measuring the ON time of the hard counter. In the embodiment, in FIG. 7, there is a start input at time t1 and a stop input at time t2. in this case,
The hard counter 35 is started at a time t1 by a timer start command, and is stopped at a time t2 by a timer stop command. Therefore, the timer time measuring means measures the time from time t1 to time t2 when the external output is ON. This value is retained as the current value.

【0062】これにより、ユーザは、簡単にタイマの動
作時間を計測できることになる。
Thus, the user can easily measure the operation time of the timer.

【0063】また、この発明に係わるプログラマブルコ
ントローラのI/Oユニットは、外部で組まれたユーザ
プログラムの入出力部と、上記入出力部から取り込んだ
ユーザプログラムが格納される書き換え可能なメモリ
と、上記メモリに格納されたユーザプログラムを実行す
るユーザプログラム実行手段と、上記ユーザプログラム
におけるタイマ起動命令によって所定周波数のパルスを
出力するパルスジェネレータと、上記タイマ起動命令に
よって上記パルスジェネレータから出力されたパルスを
カウントするハードカウンタと、上記ハードカウンタの
タイマ現在値を検出するタイマ現在値検出手段と、上記
タイマ起動中における所定の経過時間帯域に所定の出力
領域を設定する出力領域設定手段と、上記タイマ現在値
検出手段によって検出されたタイマ現在値に基づいて現
在値が上記出力領域設定手段で設定された所定の出力領
域の経過時間帯域にあるか否か判別する判別手段と、を
有することを特徴とする。
Further, the I / O unit of the programmable controller according to the present invention comprises: an input / output unit for a user program externally assembled; a rewritable memory for storing the user program fetched from the input / output unit; A user program executing means for executing a user program stored in the memory; a pulse generator for outputting a pulse of a predetermined frequency according to a timer start instruction in the user program; and a pulse output from the pulse generator according to the timer start instruction. A hard counter for counting, timer current value detecting means for detecting a timer current value of the hard counter, output area setting means for setting a predetermined output area in a predetermined elapsed time band during activation of the timer, Value Current value based timer on the current values is characterized by having a, a determination unit that determines whether or not there is the elapsed time band of a predetermined output area set by the output area setting means.

【0064】ここで、上記ハードカウンタのタイマ現在
値を検出するタイマ現在値検出手段とは、図8に示すタ
イマ現在値を検出する構成をいう。
Here, the timer current value detecting means for detecting the current timer value of the hard counter has a configuration for detecting the current timer value shown in FIG.

【0065】図8において、タイマ現在値は、時刻0
(00000000)からFFFFFFFFまで8桁の
現在値として検出されている。
In FIG. 8, the current value of the timer is 0
It is detected as an 8-digit current value from (00000000) to FFFFFFFF.

【0066】また、上記タイマ起動中における所定の経
過時間帯域に所定の出力領域を設定する出力領域設定手
段とは、図8において、時刻0(00000000)か
らFFFFFFFFまでのタイマ動作中に、所定の経過
時間帯域で出力領域を設定することをいう。図8では、
所定の経過時間帯域で設定値1〜設定値5までが出力領
域として設定されている。
The output area setting means for setting a predetermined output area in a predetermined elapsed time band during the activation of the timer includes a predetermined output area during a timer operation from time 0 (00000000) to FFFFFFFF in FIG. This means setting an output area in the elapsed time band. In FIG.
The set values 1 to 5 are set as output areas in a predetermined elapsed time band.

【0067】従って、上記タイマ現在値検出手段によっ
て検出されたタイマ現在値に基づいて現在値が上記出力
領域設定手段で設定された所定の出力領域の経過時間帯
域にあるか否か判別する判別手段とは、タイマ現在値が
いずれかの設定値内にあるか否か判別することをいう。
Accordingly, based on the timer current value detected by the timer current value detecting means, a judging means for judging whether or not the current value is within the elapsed time band of the predetermined output area set by the output area setting means. Means determining whether the current timer value is within any of the set values.

【0068】これによって、本発明では、タイマ動作中
の所定時間帯域に設定してある出力領域を簡単に検出で
きることになる。
Thus, according to the present invention, it is possible to easily detect the output area set in the predetermined time band during the timer operation.

【0069】また、この発明に係わるプログラマブルコ
ントローラは、外部で組まれたユーザプログラムの入出
力部と、上記入出力部から取り込んだユーザプログラム
が格納される書き換え可能なメモリと、上記メモリに格
納されたユーザプログラムを実行するユーザプログラム
実行手段と、上記ユーザプログラムにおけるタイマ出力
命令によって所定周波数のパルスを出力するパルスジェ
ネレータと、上記タイマ出力命令によって上記パルスジ
ェネレータの出力パルス数をカウントするハードカウン
タと、を有し、上記プログラミングされたユーザプログ
ラムにおけるタイマ出力命令によって任意の条件または
タイミングでタイマ出力命令を実行することを特徴とす
る。
A programmable controller according to the present invention includes an input / output unit for a user program externally assembled, a rewritable memory for storing the user program fetched from the input / output unit, and a rewritable memory for storing the user program. A user program executing means for executing the user program, a pulse generator for outputting a pulse of a predetermined frequency according to a timer output command in the user program, a hard counter for counting the number of output pulses of the pulse generator according to the timer output command, And executing the timer output instruction under an arbitrary condition or timing by a timer output instruction in the programmed user program.

【0070】以上の説明では、I/Oユニットにタイマ
機能を実現するボードを設けるようにしたが、1つのプ
ログラマブルコントローラユニットでCPU機能とI/
O機能を実現する場合はそのプログラマブルコントロー
ラユニットにタイマ機能を実現するボードを設けること
ができる。この場合は、I/Oユニットに代えてプログ
ラマブルコントローラユニットにパソコン10で開発さ
れたプログラムがダウンロードされる。
In the above description, the board for realizing the timer function is provided in the I / O unit.
When realizing the O function, a board for realizing the timer function can be provided in the programmable controller unit. In this case, the program developed by the personal computer 10 is downloaded to the programmable controller unit instead of the I / O unit.

【0071】[0071]

【発明の実施の形態】以下、この発明に係わるプログラ
マブルコントローラのI/Oユニット及びプログラマブ
ルコントローラの実施の形態を添付図面を参照して詳細
に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments of an I / O unit of a programmable controller and a programmable controller according to the present invention will be described below in detail with reference to the accompanying drawings.

【0072】図1は、本実施形態に係わるI/Oユニッ
トに搭載されるユニットプログラムの開発環境の概要を
示す概略ブロック図である。
FIG. 1 is a schematic block diagram showing an outline of a development environment for unit programs mounted on an I / O unit according to this embodiment.

【0073】図1において、10はI/Oユニット(高
機能I/Oユニット)20に搭載されるユニットプログ
ラムの開発ツールとしてのパソコンで、オンライン、オ
フラインでプログラムを開発する。
In FIG. 1, reference numeral 10 denotes a personal computer as a unit program development tool mounted on an I / O unit (high-performance I / O unit) 20 for developing programs online and offline.

【0074】パソコン10で開発されたプログラムはシ
リアルI/Fを使ってI/Oユニット20にダウンロー
ドされるが、そのために、I/Oユニット20はダウン
ロード用のプログラム入出力部21を有し、パソコン1
0で開発されたプログラムはプログラム入出力部21を
介してI/Oユニット20にダウンロードされる。
The program developed on the personal computer 10 is downloaded to the I / O unit 20 using a serial I / F. For this purpose, the I / O unit 20 has a program input / output unit 21 for downloading. PC 1
0 is downloaded to the I / O unit 20 via the program input / output unit 21.

【0075】なお、I/Oユニット20の表面には、プ
ログラム入出力部21の他に、制御対象となる入出力機
器が接続される汎用デジタル入出力部22と、タイマ機
能を実現するために内部に実装されたボード(図示せ
ず)の制御対象となる入出力機器が接続される入出力部
23aが設けられている。
On the surface of the I / O unit 20, in addition to the program input / output unit 21, a general-purpose digital input / output unit 22 to which an input / output device to be controlled is connected, and a timer function for realizing a timer function. An input / output unit 23a to which an input / output device to be controlled by a board (not shown) mounted therein is connected is provided.

【0076】なお、図1において、60はビルディング
ブロックタイプのプログラマブルコントローラシステム
で、CPUユニット40と2つのI/Oユニット20−
1,20−2を具備している。そこで、パソコン10で
開発されたプログラムはCPUユニット40を介してI
/Oユニット20−1(I/Oユニット20)に転送す
るよう構成することもできる。この場合、パソコン10
で開発されたプログラムは、CPUユニット40の通信
ポート41,プログラマブルコントローラシステムの専
用バス61を介してI/Oユニット20−1にダウンロ
ードされる。
In FIG. 1, reference numeral 60 denotes a building block type programmable controller system, which includes a CPU unit 40 and two I / O units 20-.
1, 20-2. Therefore, the program developed on the personal computer 10 is transmitted to the CPU 10 via the CPU unit 40.
It may be configured to transfer the data to the / O unit 20-1 (I / O unit 20). In this case, the personal computer 10
Are downloaded to the I / O unit 20-1 via the communication port 41 of the CPU unit 40 and the dedicated bus 61 of the programmable controller system.

【0077】なお、図1では、I/Oユニット20にタ
イマ機能を実現するボードを設けるようにしたが、1つ
のプログラマブルコントローラユニットでCPU機能と
I/O機能を実現する場合はそのプログラマブルコント
ローラユニットにタイマ機能を実現するボードを設ける
ことができる。この場合は、I/Oユニット20に代え
てプログラマブルコントローラユニットにパソコン10
で開発されたプログラムがダウンロードされる。
In FIG. 1, a board for realizing the timer function is provided in the I / O unit 20. However, when the CPU function and the I / O function are realized by one programmable controller unit, the programmable controller unit is used. Can be provided with a board for realizing a timer function. In this case, the personal computer 10 is connected to the programmable controller unit in place of the I / O unit 20.
The program developed in is downloaded.

【0078】なお、以下の説明では、I/Oユニット2
0にタイマ機能を実現するボードを設ける場合について
説明する。
In the following description, the I / O unit 2
A case where a board that realizes the timer function is provided at 0 will be described.

【0079】図2は、図1に示したI/Oユニット20
の電気的な構成を示すブロック図である。
FIG. 2 shows the I / O unit 20 shown in FIG.
FIG. 2 is a block diagram showing an electrical configuration of the embodiment.

【0080】図2において、I/Oユニット20は、プ
ログラム実行部30とタイマ出力回路部(ボード部)2
3より構成され、プログラム実行部30は汎用デジタル
入出力部22、バスI/F用デバイス24、CPU2
5、ROM26、PRGメモリ27、変数メモリ28を
具備し、タイマ出力回路部23は複数のタイマ出力回路
31−1、31−2、……、31−nを具備している。
In FIG. 2, an I / O unit 20 includes a program execution unit 30 and a timer output circuit unit (board unit) 2.
The program execution unit 30 includes a general-purpose digital input / output unit 22, a bus I / F device 24, a CPU 2
5, a ROM 26, a PRG memory 27, and a variable memory 28, and the timer output circuit unit 23 includes a plurality of timer output circuits 31-1, 31-2,..., 31-n.

【0081】ここで、汎用デジタル入出力部22は、プ
ログラマブルコントローラシステムにおける制御対象機
器が接続されるもので、複数の入力接点、出力接点より
構成されている。
The general-purpose digital input / output unit 22 is connected to a device to be controlled in the programmable controller system, and is composed of a plurality of input contacts and output contacts.

【0082】バスI/F用デバイス24は、プログラマ
ブルコントローラシステム60の専用バス61に接続さ
れ、バス61とのインタフェースをとるものである。
The bus I / F device 24 is connected to the dedicated bus 61 of the programmable controller system 60, and interfaces with the bus 61.

【0083】CPU25は、I/Oユニット20全体を
統括制御するとともに、本実施形態では特に、図1に示
したパソコン10でプログラミングされたユーザプログ
ラムに基づいて、タイマ出力回路部23に搭載されたタ
イマ出力回路31−1、31−2、……、31−nの制
御を行う。
The CPU 25 controls the entire I / O unit 20. In the present embodiment, the CPU 25 is mounted on the timer output circuit 23 based on a user program programmed by the personal computer 10 shown in FIG. Controls the timer output circuits 31-1, 31-2,..., 31-n.

【0084】ROM26は、CPU25で実行されるシ
ステムプログラムが格納されるものである。
The ROM 26 stores a system program executed by the CPU 25.

【0085】PRG(プログラム)メモリ27は、パソ
コン10でプログラミングされたユーザプログラムがダ
ウンロードされるメモリである。
The PRG (program) memory 27 is a memory in which a user program programmed by the personal computer 10 is downloaded.

【0086】変数メモリ28は、CPU25によってタ
イマ出力回路31−1、31−2、……、31−nの制
御が行われる場合、さまざまな制御データが格納される
ものである。
The variable memory 28 stores various control data when the CPU 25 controls the timer output circuits 31-1, 31-2,..., 31-n.

【0087】タイマ出力回路部23はタイマ機能が実現
されるボードで、本実施形態では、複数のタイマ出力回
路31−1、31−2、……、31−nを具備し、それ
ぞれの回路から任意の条件、タイミングで高精度のタイ
マ出力を外部に出力できるよう構成されている。
The timer output circuit unit 23 is a board on which a timer function is realized. In this embodiment, the timer output circuit unit 23 includes a plurality of timer output circuits 31-1, 31-2,..., 31-n. It is configured such that a high-precision timer output can be output to the outside under arbitrary conditions and timing.

【0088】図3は、図2に示したタイマ出力回路31
(タイマ出力回路31−1、31−2、……、31−n
をタイマ出力回路31で代表する)の1つとCPU25
の詳細を示すブロック図である。
FIG. 3 shows the timer output circuit 31 shown in FIG.
(Timer output circuits 31-1, 31-2,..., 31-n
Is represented by a timer output circuit 31) and the CPU 25
FIG. 4 is a block diagram showing the details of.

【0089】図3において、タイマ出力回路31は、ク
ロック発生器32、パルスジェネレータ33、ハードカ
ウンタ35、AND回路36より構成されている。
In FIG. 3, the timer output circuit 31 includes a clock generator 32, a pulse generator 33, a hard counter 35, and an AND circuit 36.

【0090】ここで、クロック発生器32は、正確にタ
イミングをとったクロックを発生するものである。
Here, the clock generator 32 is for generating a clock with an accurate timing.

【0091】パルスジェネレータ33は、クロック発生
器32の出力に基づいて時間を生成するための元となる
クロックを発振するもので、発振クロックの周波数(ク
ロックレート)は任意に設定できるよう構成されてい
る。
The pulse generator 33 oscillates a clock serving as a source for generating time based on the output of the clock generator 32. The frequency (clock rate) of the oscillation clock can be set arbitrarily. I have.

【0092】ハードカウンタ35は、パルスジェネレー
タ33から出力されるパルスを計数するもので、後述す
るようにタイマ出力命令起動時にタイマ時間がプリセッ
トされ、同時にハードカウンタ35からはAND回路3
6をONするためのカウントアップ信号がAND回路3
6に対して出力される。
The hard counter 35 counts the pulses output from the pulse generator 33. As will be described later, a timer time is preset when the timer output command is activated, and at the same time, the AND circuit 3
6 is turned on by the AND circuit 3
6 is output.

【0093】なお、後述するように、ハードカウンタ3
5は一定時間を計測するタイマ機能だけでなく、タイマ
ONからの経過時間を計測する計測モードでの使用もで
きる。
As described later, the hard counter 3
Reference numeral 5 can be used not only in a timer function for measuring a fixed time, but also in a measurement mode for measuring the time elapsed since the timer was turned on.

【0094】AND回路36はハードカウンタ35から
のカウントアップ信号とCPU25からの汎用出力があ
るとONされる出力ゲート回路である。
The AND circuit 36 is an output gate circuit that is turned on when there is a count-up signal from the hard counter 35 and a general-purpose output from the CPU 25.

【0095】CPU25は、タイマ出力命令起動時に、
パルスジェネレータ33におけるクロック周波数の設定
と、ハードカウンタ35におけるクロックカウント数の
プリセットを行い、同時に、汎用ポート25aからAN
D回路36に対する汎用信号の出力を開始する。これに
よって、タイマ出力命令起動時、AND回路36に対し
てCPU25からは汎用信号、ハードカウンタ35から
はカウントアップ信号が出力されるので、AND回路3
6はONとなる。
The CPU 25 activates the timer output instruction
The setting of the clock frequency in the pulse generator 33 and the presetting of the clock count number in the hard counter 35 are performed.
The output of the general-purpose signal to the D circuit 36 is started. Thus, when the timer output instruction is activated, a general-purpose signal is output from the CPU 25 to the AND circuit 36, and a count-up signal is output from the hard counter 35.
6 turns ON.

【0096】図4は、図3に示したハードカウンタ3
5、AND回路36とCPU25の動作を示すタイムチ
ャートである。
FIG. 4 is a block diagram of the hard counter 3 shown in FIG.
5 is a time chart showing the operation of the AND circuit 36 and the CPU 25.

【0097】図4において、時刻t1にタイマ命令が起
動されると、(1)に示す如く、ハードカウンタ35に
プリセット値、すなわちタイマ時間Tが設定される。
In FIG. 4, when a timer command is started at time t1, a preset value, that is, a timer time T is set in the hard counter 35 as shown in (1).

【0098】これによって、ハードカウンタ35は
(2)に示す如く、タイマとして起動され、同時に
(3)に示す如く、AND回路36に対してタイマ時間
Tの間カウントアップ信号を出力する。
Thus, the hard counter 35 is started up as a timer as shown in (2), and simultaneously outputs a count-up signal to the AND circuit 36 for the timer time T as shown in (3).

【0099】また、同時に、(4)に示す如く、CPU
25の汎用ポート25aからは、AND回路36に対し
て汎用信号を出力する。
At the same time, as shown in (4), the CPU
The 25 general-purpose ports 25a output general-purpose signals to the AND circuit 36.

【0100】これによって、(5)に示す如く、AND
回路36では、ハードカウンタ35からのカウントアッ
プ信号とCPU25からの汎用信号のANDがとられ、
タイマ時間Tが終了する時刻t2までAND回路36は
ONとなる。
As a result, as shown in (5), AND
In the circuit 36, the count-up signal from the hard counter 35 and the general-purpose signal from the CPU 25 are ANDed.
The AND circuit 36 is turned on until the time t2 when the timer time T ends.

【0101】図5には、図3及び図4でCPU25で実
行された時間指定付き出力命令(タイマ出力命令)が示
されている。図5に示した時間指定付き出力命令70
は、所定の出力開始の条件成立で起動される応用命令
で、図3に示したAND回路36(図2に示す如く、タ
イマ出力回路31は複数あるのでAND回路36も複数
ある)の出力先端子番号71、時間生成の元となるパル
スジェネレータ33に設定されるクロック周波数72、
出力時間を決定するためのハードカウンタ35に設定さ
れるクロックカウント数73がそれぞれ設定される。
FIG. 5 shows an output instruction with a time designation (timer output instruction) executed by the CPU 25 in FIGS. 3 and 4. Output instruction with time designation 70 shown in FIG.
Is an application instruction that is activated when a predetermined output start condition is satisfied. The output destination of the AND circuit 36 shown in FIG. 3 (there is a plurality of timer output circuits 31 and a plurality of AND circuits 36 as shown in FIG. 2). A terminal number 71, a clock frequency 72 set in the pulse generator 33 which is a source of time generation,
The clock count 73 set in the hard counter 35 for determining the output time is set.

【0102】これによって、各タイマ出力回路31から
は、設定された出力先に、設定されたクロック周波数
で、設定されたカウント数のタイマ出力が行われること
になる。
As a result, the timer output circuit 31 outputs a timer of the set count number to the set output destination at the set clock frequency.

【0103】なお、上記パルスジェネレータ33に設定
されるクロック周波数72は固定とし、上記クロックカ
ウント数73の代わりに出力時間を設定することもでき
る。
The clock frequency 72 set in the pulse generator 33 can be fixed, and the output time can be set instead of the clock count number 73.

【0104】このように、本実施形態では、(1)パソ
コン10からI/Oユニット20に対して、ユーザがI
/O制御ロジック、演算処理のためのプログラムを入力
する機能と、(2)特定の出力先を指定して任意の出力
時間を指定できる時間指定付き出力命令70と、(3)
周波数が変更可能なパルスジェネレータ33と、(4)
CPU25からのタイマ出力命令に基づいてタイマ時間
が設定され、且つAND回路36に対してカウントアッ
プ信号を出力するハードカウンタ35と、(5)ハード
カウンタ35からのカウントアップ出力とCPU25か
らの汎用出力があると、所定の外部端子にタイマ出力す
るAND回路36と、を具備するようにしたので、以下
の効果を奏する。
As described above, in the present embodiment, (1) the user sends an I / O unit
/ O control logic, a function of inputting a program for arithmetic processing, (2) an output instruction 70 with a time designation that can designate an arbitrary output time by designating a specific output destination, and (3)
A pulse generator 33 whose frequency can be changed, (4)
A hard counter 35 that sets a timer time based on a timer output command from the CPU 25 and outputs a count-up signal to the AND circuit 36; (5) a count-up output from the hard counter 35 and a general-purpose output from the CPU 25 And an AND circuit 36 that outputs a timer to a predetermined external terminal, so that the following effects can be obtained.

【0105】(1)I/Oユニット20のプログラミン
グ機能を利用し、任意の条件、タイミングでタイマ出力
命令を実行できるので、高精度且つ自由度の高いタイマ
出力を得ることができる。 (2)タイマ機能として、周波数が変更可能なパルスジ
ェネレータ33を利用するため、実現できる時間範囲、
精度範囲が広い。 (3)指定時間の計測はタイマ出力命令実行後はパルス
ジェネレータ33、ハードカウンタ35及びAND回路
36で行い、いずれもハードウェアにて行う。つまり、
タイマ出力命令実行後はソフトウェア処理を介さない。
従って、I/Oユニツト20に対して割込みによる影響
を与えることなく、高精度なタイマ制御を実行できる。
(1) Since the timer output instruction can be executed under arbitrary conditions and timing using the programming function of the I / O unit 20, a timer output with high accuracy and high flexibility can be obtained. (2) The time range that can be realized because the pulse generator 33 whose frequency can be changed is used as the timer function.
Wide accuracy range. (3) The specified time is measured by the pulse generator 33, the hardware counter 35, and the AND circuit 36 after execution of the timer output instruction, and all of them are performed by hardware. That is,
After execution of the timer output instruction, no software processing is performed.
Accordingly, high-precision timer control can be performed without affecting the I / O unit 20 due to the interruption.

【0106】ところで、図5では、時間指定付き出力命
令(タイマ出力命令)70で所定時間の計測をするよう
にしたが、次に、ハードカウンタ35を利用してタイマ
の起動及び停止を実現する場合について図6を参照して
説明する。
In FIG. 5, the predetermined time is measured by the output instruction with time designation (timer output instruction) 70. Next, the start and stop of the timer are realized by using the hard counter 35. The case will be described with reference to FIG.

【0107】図6に示したタイマ起動/停止命令(タイ
マ起動命令)80は、所定の起動または停止の条件成立
で起動される応用命令で、タイマ番号(ハードカウンタ
35の番号)81、時間生成の元となるパルスジェネレ
ータ33に設定されるクロック周波数82、起動または
停止の動作指令83が設定される。
The timer start / stop instruction (timer start instruction) 80 shown in FIG. 6 is an application instruction that is started when a predetermined start or stop condition is satisfied, and includes a timer number (number of the hard counter 35) 81 and a time generation , A clock frequency 82 set in the pulse generator 33 and a start or stop operation command 83 are set.

【0108】これによって、タイマ番号81で設定され
たハードカウンタ35からは、クロック周波数82で設
定されたクロック周波数で、動作指令83で設定された
動作モードでタイマ動作が行われることになる。
Accordingly, the timer operation is performed from the hard counter 35 set by the timer number 81 at the clock frequency set by the clock frequency 82 in the operation mode set by the operation command 83.

【0109】例えば、所定の入力条件がタイマ動作の開
始を指示するものであると(動作指令83が起動の場
合)、タイマ動作を開始し、入力条件がタイマ動作の停
止を指示するものであると(動作指令83が停止の場
合)、タイマ動作を停止する。
For example, if the predetermined input condition instructs the start of the timer operation (when the operation command 83 is activated), the timer operation starts, and the input condition instructs the stop of the timer operation. (When the operation command 83 is stopped), the timer operation is stopped.

【0110】これによって、本発明では、タイマ起動/
停止命令によってタイマ起動、タイマ停止を実行でき、
ユーザが簡単にタイマの起動、停止を設定できる。
As a result, in the present invention, the timer activation /
Timer start and timer stop can be executed by the stop instruction.
The user can easily start and stop the timer.

【0111】ところで、図6では、タイマ起動/停止命
令(タイマ起動命令)80によってハードカウンタ35
からタイマ起動またはタイマ停止を得られるようにした
が、次に、このタイマ起動/停止命令80によって、ハ
ードカウンタ35が起動してから停止するまでの時間を
計測できるようにした場合について、図7を参照しなが
ら説明する。
In FIG. 6, a timer start / stop command (timer start command) 80 causes a hard counter 35 to operate.
FIG. 7 shows a case where the time from when the hard counter 35 starts to when the hard counter 35 stops can be measured by the timer start / stop instruction 80. This will be described with reference to FIG.

【0112】図7は、(1)の起動入力が時刻t1にあ
り、(2)の停止入力が時刻t2にあった場合である。
FIG. 7 shows a case where the start input of (1) is at time t1 and the stop input of (2) is at time t2.

【0113】この場合、(3)において、ハードカウン
タ35は時刻t1にタイマ起動され、時刻t2に停止さ
れている。
In this case, in (3), the hardware of the hard counter 35 is started at time t1 and stopped at time t2.

【0114】これによって、(4)において、タイマ
(ハードカウンタ)は時刻t1〜t2まで計測中とさ
れ、タイマ停止後は起動から停止までの時間(現在値)
を保持することができる。
As a result, in (4), the timer (hard counter) is determined to be measuring from time t1 to t2, and the time from start to stop (current value) after the timer is stopped.
Can be held.

【0115】このように、図7では、あるカウンタ(タ
イマ出力回路31)の起動してから停止するまでの時間
を計測することができる。しかも、この場合、図6に示
す如く、パルスジェネレータ33に設定されるクロック
周波数82を可変設定することができる。従って、精度
の高い時間計測や計測時間幅を用途に応じて設定するこ
とができる。
As described above, in FIG. 7, the time from when a certain counter (timer output circuit 31) starts to when it stops can be measured. Moreover, in this case, as shown in FIG. 6, the clock frequency 82 set in the pulse generator 33 can be variably set. Therefore, highly accurate time measurement and measurement time width can be set according to the application.

【0116】また、(4)で計測中のハードカウンタ3
5の値は変数メモリ28に常時反映させ、モニタするこ
ともできる。
The hard counter 3 being measured in (4)
The value of 5 can be constantly reflected in the variable memory 28 and monitored.

【0117】次に、ハードカウンタ35を計測モードで
使用した場合の他の例を図8を参照しながら説明する。
Next, another example in which the hard counter 35 is used in the measurement mode will be described with reference to FIG.

【0118】図8で、ハードカウンタ35は時刻0(0
0000000)から時刻FFFFFFFFまでフリー
ランカウンタとしてタイマ動作をしている。
In FIG. 8, the hard counter 35 indicates the time 0 (0
From 000000) to time FFFFFFFF, a timer operation is performed as a free-run counter.

【0119】ここで、ユーザはフリーランカウンタとし
て動作しているタイマに対してプログラムにて任意の経
過時間帯域を出力領域として設定することができる。例
えば図8では、任意の経過時間帯域で設定値1から設定
値5までの出力領域が設定されている。ここで、本実施
形態では、現在のタイマ値はどの出力領域の経過時間帯
域にあるかを検出できるようにする。
Here, the user can set an arbitrary elapsed time band as an output area by a program for a timer operating as a free-run counter. For example, in FIG. 8, an output area from a set value 1 to a set value 5 is set in an arbitrary elapsed time band. Here, in the present embodiment, it is possible to detect which output area is in the elapsed time band of the current timer value.

【0120】例えば、タイマ現在値がt1〜t2の間に
あるときは、タイマ現在値は設定値1と設定値4の経過
時間帯域にある。従って、ハードカウンタ35のタイマ
現在値がt1〜t2の間にあるとき、本実施形態では、
経過時間が設定値1と設定値4の出力領域にあることが
わかる。
For example, when the current timer value is between t1 and t2, the current timer value is in the elapsed time band between the set value 1 and the set value 4. Therefore, when the current timer value of the hard counter 35 is between t1 and t2, in the present embodiment,
It can be seen that the elapsed time is in the output area of the set value 1 and the set value 4.

【0121】図9は、上記の如き出力領域を検出するた
めのテーブル比較命令である。テーブル比較命令90
は、図8に示した各出力領域を登録する応用命令で、タ
イマ番号(ハードカウンタ35の番号)91、指定動作
モード92、比較テーブルアドレス93より構成されて
いる。
FIG. 9 shows a table comparison instruction for detecting the output area as described above. Table comparison instruction 90
Is an application instruction for registering each output area shown in FIG. 8, and is composed of a timer number (number of the hard counter 35) 91, a designated operation mode 92, and a comparison table address 93.

【0122】ここで、タイマ番号(ハードカウンタ35
の番号)91は、現在値をカウントするハードカウンタ
35の番号である。
Here, the timer number (hard counter 35
The number 91) is the number of the hard counter 35 that counts the current value.

【0123】指定動作モード92は、テーブル比較命令
の動作モードで、例えば、図8に示すように、出力領域
がある幅をもって設定されたときはその旨、また出力領
域が点で設定されたときはその旨の動作モードが指定さ
れる。
The designated operation mode 92 is an operation mode of the table comparison instruction. For example, as shown in FIG. 8, when the output area is set with a certain width, this is indicated, and when the output area is set with dots. Indicates the operation mode to that effect.

【0124】比較テーブルアドレス93は、図10に示
す比較デーブル100における各設定値の設定アドレス
である。
The comparison table address 93 is a setting address of each set value in the comparison table 100 shown in FIG.

【0125】図10には、上記比較テーブル100が示
されている。図10では、16の出力領域について、出
力領域検出のための比較値が登録されている。
FIG. 10 shows the comparison table 100. In FIG. 10, comparison values for output area detection are registered for 16 output areas.

【0126】なお、図8に示した各出力領域は、その下
限値(開始時刻)及び上限値(終了時刻)で定義されて
おり、それぞれの値は8桁で登録される。
Each output area shown in FIG. 8 is defined by its lower limit (start time) and upper limit (end time), and each value is registered with eight digits.

【0127】そこで、比較テーブル100には、比較の
個数欄101(本実施形態では16)と、各出力領域を
特定するための (1)下限値下位4桁と上位4桁(これによって下限値
の8桁が特定できる) (2)上限値下位4桁と上位4桁(これによって上限値
の8桁が特定できる) (3)出力領域の出力パターン が登録される。
Therefore, in the comparison table 100, the number column 101 for comparison (16 in this embodiment) and (1) the lower 4 digits and the upper 4 digits for specifying each output area (the lower 4 digits and the lower 4 digits, respectively) (2) Lower 4 digits and upper 4 digits of upper limit value (8 digits of upper limit can be specified thereby) (3) Output pattern of output area is registered.

【0128】従って、比較テーブル100では、設定値
1を登録するために、(1)設定値1下限値下位4桁1
10−1aと、(2)設定値1下限値上位4桁110−
1bと、(3)設定値1上限値下位4桁110−1c
と、(4)設定値1上限値上位4桁110−1dと、
(5)設定値1出力パターン110−1eと、が登録さ
れる。
Therefore, in the comparison table 100, in order to register the set value 1, (1) set value 1 lower limit lower 4 digits 1
10-1a and (2) Upper 4 digits of setting value 1 lower limit value 110-
1b, and (3) set value 1 upper limit lower 4 digits 110-1c
And (4) setting value 1 upper limit upper 4 digits 110-1d,
(5) The set value 1 output pattern 110-1e is registered.

【0129】設定値2以下も同様であり、設定値16を
登録するために、(1)設定値16下限値下位4桁11
0−16aと、(2)設定値16下限値上位4桁110
−16bと、(3)設定値16上限値下位4桁110−
16cと、(4)設定値16上限値上位4桁110−1
6dと、(5)設定値16出力パターン110−16e
と、が登録される。
The same applies to the setting value 2 and below. To register the setting value 16, (1) setting value 16
0-16a and (2) set value 16 lower limit upper 4 digits 110
-16b and (3) lower limit 4 digits 110 of set value 16 upper limit value 110-
16c and (4) Set value 16 Upper limit upper 4 digits 110-1
6d and (5) set value 16 output pattern 110-16e
Is registered.

【0130】ここで、図9に示すテーブル比較命令90
が実行されると、 (1)タイマ番号(ハードカウンタ35の番号)91で
指定されるハードカウンタ35のタイマ現在値 (2)図10の比較テーブル100に設定された各出力
領域の設定情報 に基づいて、現在のタイマ値が検索対象となった出力領
域にあるか否か判別される。
Here, the table comparison instruction 90 shown in FIG.
Is executed, (1) the current timer value of the hard counter 35 specified by the timer number (number of the hard counter 35) 91 (2) the setting information of each output area set in the comparison table 100 of FIG. Based on this, it is determined whether or not the current timer value is in the search target output area.

【0131】比較結果は、変数メモリ28に命令実行毎
に出力される。
The comparison result is output to the variable memory 28 every time the instruction is executed.

【0132】ここで、現在のタイマ値が検索対象となっ
た出力領域にあると判別された場合は、その出力領域の
出力パターンが出力される。例えば、各出力領域の出力
パターンが特定のビットパターンで出力されるとする
と、検出された出力領域のビットパターンが出力され
る。
If it is determined that the current timer value is in the search target output area, the output pattern of the output area is output. For example, assuming that the output pattern of each output area is output in a specific bit pattern, the detected bit pattern of the output area is output.

【0133】[0133]

【発明の効果】以上説明したように、この発明によれ
ば、外部で組まれたユーザプログラムの入出力部と、上
記入出力部から取り込んだユーザプログラムが格納され
る書き換え可能なメモリと、上記メモリに格納されたユ
ーザプログラムを実行するユーザプログラム実行手段
と、上記ユーザプログラムにおけるタイマ出力命令によ
って所定周波数のパルスを出力するパルスジェネレータ
と、上記パルスジェネレータの出力パルス数をカウント
するハードカウンタと、を有し、上記プログラミングさ
れたユーザプログラムにおけるタイマ出力命令によって
任意の条件またはタイミングでタイマ出力命令を実行す
るようにした。
As described above, according to the present invention, an input / output section of a user program externally assembled, a rewritable memory for storing a user program fetched from the input / output section, User program execution means for executing a user program stored in a memory, a pulse generator for outputting a pulse of a predetermined frequency according to a timer output instruction in the user program, and a hard counter for counting the number of output pulses of the pulse generator. And the timer output instruction is executed under an arbitrary condition or timing according to the timer output instruction in the programmed user program.

【0134】従って、本発明では以下の効果を奏する。 (1)タイマ出力目的によってパルス周波数を可変設定
でき、自由度の高いタイマ出力を実現できる。また、タ
イマ出力命令によって出力パルスの周波数を可変設定で
きるので、ユーザは簡単に出力パルスの周波数を可変設
定できる。 (2)タイマ出力目的によって出力パルス数を可変設定
でき、しかも、タイマ出力命令によって出力パルス数を
可変設定できるので、ユーザは簡単にタイマ値を可変設
定できる。 (3)パルスジェネレータとハードカウンタはいずれも
ハードウェアである。従って、タイマ出力命令がある
と、以後はソフトウェア処理を介することなくハードウ
ェア処理だけで出力制御ができ、従来のようにI/Oユ
ニットに割込みによる影響を与えることなく、高精度の
タイマ機能を実現できる。
Therefore, the present invention has the following effects. (1) The pulse frequency can be variably set depending on the purpose of timer output, and timer output with a high degree of freedom can be realized. Further, since the frequency of the output pulse can be variably set by the timer output command, the user can easily variably set the frequency of the output pulse. (2) The number of output pulses can be variably set according to the purpose of timer output, and the number of output pulses can be variably set according to a timer output instruction. (3) Both the pulse generator and the hardware counter are hardware. Therefore, if there is a timer output instruction, the output can be controlled only by hardware processing without going through software processing, and a high-precision timer function can be provided without affecting the I / O unit by interruption as in the past. realizable.

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

【図1】この発明が適用されたI/Oユニットに搭載さ
れるユニットプログラムの開発環境の概要を示す概略ブ
ロック図。
FIG. 1 is a schematic block diagram showing an outline of a development environment of a unit program mounted on an I / O unit to which the present invention is applied.

【図2】図2に示したI/Oユニット20の詳細を示す
ブロック図。
FIG. 2 is a block diagram showing details of an I / O unit 20 shown in FIG. 2;

【図3】図2に示したタイマ出力回路31とCPU25
の詳細を示すブロック図。
3 shows a timer output circuit 31 and a CPU 25 shown in FIG.
FIG.

【図4】図3に示したハードカウンタ35、AND回路
36及びCPU25の動作を示すタイムチャート。
FIG. 4 is a time chart showing operations of a hard counter 35, an AND circuit 36, and a CPU 25 shown in FIG.

【図5】図3及び図4でCPU25で実行された時間指
定付き出力命令の説明図。
FIG. 5 is an explanatory diagram of a time-specified output instruction executed by the CPU 25 in FIGS. 3 and 4;

【図6】ハードカウンタ35を利用してタイマの起動及
び停止を実現する場合の説明図。
FIG. 6 is an explanatory diagram in the case of realizing start and stop of a timer using a hard counter 35;

【図7】タイマ起動/停止命令によって、ハードカウン
タ35が起動してから停止するまでの時間を計測できる
ようにした場合の説明図。
FIG. 7 is an explanatory diagram of a case where the time from when the hard counter 35 is started to when it is stopped can be measured by a timer start / stop instruction.

【図8】ハードカウンタ35を計測モードで使用した場
合の他の例を示す説明図。
FIG. 8 is an explanatory diagram showing another example when the hard counter 35 is used in the measurement mode.

【図9】現在のタイマ値はどの設定値の設定範囲にある
かを検出できるようにするためのテーブル比較命令の説
明図。
FIG. 9 is an explanatory diagram of a table comparison instruction for enabling detection of a set range of a current timer value.

【図10】図9のテーブル比較命令で使用される比較テ
ーブルの説明図。
FIG. 10 is an explanatory diagram of a comparison table used in the table comparison instruction of FIG. 9;

【図11】従来のプログラマブルコントローラシステム
で、CPUユニットにおいて、ラダープログラムでタイ
マ命令とOUT命令にてタイマ命令を実現する場合の説
明図。
FIG. 11 is an explanatory diagram of a case where a timer instruction is implemented by a ladder program and an OUT instruction in a CPU unit in a conventional programmable controller system.

【図12】図11の処理手順を示すタイムチャート。FIG. 12 is a time chart showing the processing procedure of FIG. 11;

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

10 パソコン 20、20−1、20−2 I/Oユニット(高機能I
/Oユニット) 21 プログラム入出力部 22 汎用デジタル入出力部 23a ボード挿入口 23 タイマ出力回路部 24 バスI/F用デバイス(共有メモリ) 25 CPU 26 ROM 27 PRGメモリ 30 プログラム実行部 31 タイマ出力回路 60 プログラマブルコントローラシステム 61 専用バス 70 時間指定付き出力命令 71 出力先端子番号 72 クロック周波数 73 クロックカウント数 80 タイマ起動/停止命令 81 タイマ番号 82 クロック周波数 83 起動または停止の動作指令 90 比較命令 91 タイマ番号 92 指定動作モード 93 比較テーブルアドレス
10 PC 20, 20-1, 20-2 I / O unit (high-performance I
/ O unit) 21 Program input / output unit 22 General-purpose digital input / output unit 23a Board insertion port 23 Timer output circuit unit 24 Bus I / F device (shared memory) 25 CPU 26 ROM 27 PRG memory 30 Program execution unit 31 Timer output circuit 60 Programmable controller system 61 Dedicated bus 70 Output instruction with time designation 71 Output destination terminal number 72 Clock frequency 73 Clock count number 80 Timer start / stop instruction 81 Timer number 82 Clock frequency 83 Start or stop operation instruction 90 Comparison instruction 91 Timer number 92 Specified operation mode 93 Comparison table address

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5H220 BB07 BB11 CC03 CC08 CX01 CX05 EE09 EE12 JJ17 JJ34 JJ42  ──────────────────────────────────────────────────続 き Continued on the front page F term (reference) 5H220 BB07 BB11 CC03 CC08 CX01 CX05 EE09 EE12 JJ17 JJ34 JJ42

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 外部で組まれたユーザプログラムの入出
力部と、 上記入出力部から取り込んだユーザプログラムが格納さ
れる書き換え可能なメモリと、 上記メモリに格納されたユーザプログラムを実行するユ
ーザプログラム実行手段と、 上記ユーザプログラムにおけるタイマ出力命令によって
所定周波数のパルスを出力するパルスジェネレータと、 上記パルスジェネレータの出力パルス数をカウントする
ハードカウンタと、 を有し、 上記プログラミングされたユーザプログラムにおけるタ
イマ出力命令によって任意の条件またはタイミングでタ
イマ出力命令を実行することを特徴とするプログラマブ
ルコントローラのI/Oユニット。
1. An input / output unit for a user program externally assembled, a rewritable memory for storing a user program fetched from the input / output unit, and a user program for executing the user program stored in the memory Execution means; a pulse generator for outputting a pulse of a predetermined frequency in response to a timer output instruction in the user program; and a hard counter for counting the number of output pulses of the pulse generator. The timer output in the programmed user program An I / O unit of a programmable controller, which executes a timer output instruction under an arbitrary condition or timing by an instruction.
【請求項2】 外部で組まれたユーザプログラムの入出
力部と、 上記入出力部から取り込んだユーザプログラムが格納さ
れる書き換え可能なメモリと、 上記メモリに格納されたユーザプログラムを実行するユ
ーザプログラム実行手段と、 上記ユーザプログラムにおけるタイマ出力命令によって
所定周波数のパルスを出力するパルスジェネレータと、 上記タイマ出力命令によって所定の出力時間が設定さ
れ、且つこの設定された出力時間に基づいて上記パルス
ジェネレータから出力されたパルスをカウントするハー
ドカウンタと、 上記タイマ出力命令の起動出力と上記ハードカウンタの
カウントアップ信号が入力されると外部にタイマ出力す
るAND回路と、 を有し、 上記プログラミングされたユーザプログラムにおけるタ
イマ出力命令によって任意の条件またはタイミングでタ
イマ出力することを特徴とするプログラマブルコントロ
ーラのI/Oユニット。
2. An input / output unit for a user program externally assembled, a rewritable memory for storing a user program fetched from the input / output unit, and a user program for executing the user program stored in the memory Executing means, a pulse generator for outputting a pulse of a predetermined frequency according to a timer output instruction in the user program, and a predetermined output time set by the timer output instruction, and from the pulse generator based on the set output time. A hard counter that counts the output pulses; and an AND circuit that outputs a timer to the outside when a start output of the timer output instruction and a count-up signal of the hard counter are input, and the programmed user program is provided. Timer output instruction in Programmable controller I / O unit, characterized in that the timer output in any conditions or timing I.
【請求項3】 外部で組まれたユーザプログラムの入出
力部と、 上記入出力部から取り込んだユーザプログラムが格納さ
れる書き換え可能なメモリと、 上記メモリに格納されたユーザプログラムを実行するユ
ーザプログラム実行手段と、 上記ユーザプログラムにおけるタイマ出力命令によって
所定周波数のパルスを出力するパルスジェネレータと、 上記タイマ出力命令によって所定のカウントアップ値が
設定され、且つ上記パルスジェネレータから出力された
パルスをカウントするハードカウンタと、 上記タイマ出力命令の起動出力と上記ハードカウンタの
カウントアップ信号が入力されると外部にタイマ出力す
るAND回路と、 を有し、 上記プログラミングされたユーザプログラムにおけるタ
イマ出力命令によって任意の条件またはタイミングでタ
イマ出力することを特徴とするプログラマブルコントロ
ーラのI/Oユニット。
3. An input / output unit for a user program externally assembled, a rewritable memory for storing a user program fetched from the input / output unit, and a user program for executing the user program stored in the memory Executing means, a pulse generator for outputting a pulse of a predetermined frequency according to a timer output command in the user program, and a hardware for setting a predetermined count-up value by the timer output command and counting pulses output from the pulse generator A starter output of the timer output instruction and an AND circuit that outputs a timer to the outside when the count-up signal of the hard counter is input, and an arbitrary condition is set by the timer output instruction in the programmed user program. Or ta Programmable controller I / O unit, characterized in that the timer output timing.
【請求項4】 外部で組まれたユーザプログラムの入出
力部と、 上記入出力部から取り込んだユーザプログラムが格納さ
れる書き換え可能なメモリと、 上記メモリに格納されたユーザプログラムを実行するユ
ーザプログラム実行手段と、 上記ユーザプログラムにおけるタイマ起動命令によって
所定周波数のパルスを出力するパルスジェネレータと、 上記タイマ起動命令によって上記パルスジェネレータか
ら出力されたパルスをカウントして外部出力し、タイマ
停止命令によって外部出力を停止するハードカウンタ
と、 を有し、 上記ハードカウンタは上記プログラミングされたユーザ
プログラムにおけるタイマ起動命令または停止命令によ
って任意の条件またはタイミングでタイマ動作すること
を特徴とするプログラマブルコントローラのI/Oユニ
ット。
4. An input / output unit for a user program externally assembled, a rewritable memory for storing a user program fetched from the input / output unit, and a user program for executing the user program stored in the memory An execution means, a pulse generator for outputting a pulse of a predetermined frequency according to a timer start instruction in the user program, a pulse output from the pulse generator according to the timer start instruction, external output, and an external output according to a timer stop instruction And a hard counter for stopping the timer. The hard counter operates the timer under an arbitrary condition or timing according to a timer start instruction or a stop instruction in the programmed user program. / O unit.
【請求項5】 外部で組まれたユーザプログラムの入出
力部と、 上記入出力部から取り込んだユーザプログラムが格納さ
れる書き換え可能なメモリと、 上記メモリに格納されたユーザプログラムを実行するユ
ーザプログラム実行手段と、 上記ユーザプログラムにおけるタイマ起動命令によって
所定周波数のパルスを出力するパルスジェネレータと、 上記タイマ起動命令によって上記パルスジェネレータか
ら出力されたパルスをカウントして外部出力し、タイマ
停止命令によって外部出力を停止するハードカウンタ
と、 上記ハードカウンタのタイマ起動時から停止時までのタ
イマ時間を計測するタイマ時間計測手段と、 を有することを特徴とするプログラマブルコントローラ
のI/Oユニット。
5. An input / output unit for a user program externally assembled, a rewritable memory for storing a user program fetched from the input / output unit, and a user program for executing the user program stored in the memory An execution means, a pulse generator for outputting a pulse of a predetermined frequency according to a timer start instruction in the user program, a pulse output from the pulse generator according to the timer start instruction, external output, and an external output according to a timer stop instruction And a timer counter for measuring a timer time from when the timer of the hard counter is started to when the timer is stopped. An I / O unit for a programmable controller, comprising:
【請求項6】 外部で組まれたユーザプログラムの入出
力部と、 上記入出力部から取り込んだユーザプログラムが格納さ
れる書き換え可能なメモリと、 上記メモリに格納されたユーザプログラムを実行するユ
ーザプログラム実行手段と、 上記ユーザプログラムにおけるタイマ起動命令によって
所定周波数のパルスを出力するパルスジェネレータと、 上記タイマ起動命令によって上記パルスジェネレータか
ら出力されたパルスをカウントするハードカウンタと、 上記ハードカウンタのタイマ現在値を検出するタイマ現
在値検出手段と、 上記タイマ起動中における所定の経過時間帯域に所定の
出力領域を設定する出力領域設定手段と、 上記タイマ現在値検出手段によって検出されたタイマ現
在値に基づいて現在値が上記出力領域設定手段で設定さ
れた所定の出力領域の経過時間帯域にあるか否か判別す
る判別手段と、 を有することを特徴とするプログラマブルコントローラ
のI/Oユニット。
6. An input / output unit for a user program externally assembled, a rewritable memory for storing a user program fetched from the input / output unit, and a user program for executing the user program stored in the memory Executing means, a pulse generator for outputting a pulse of a predetermined frequency according to a timer start instruction in the user program, a hard counter for counting pulses output from the pulse generator according to the timer start instruction, and a timer current value of the hard counter Current value detecting means for detecting a current value, an output area setting means for setting a predetermined output area in a predetermined elapsed time band during activation of the timer, and a timer current value detected by the timer current value detecting means. The current value is set by the output area setting means. Programmable controller I / O unit, characterized in that it has a, a determination unit that determines whether or not there is the elapsed time band of a predetermined output area that is.
【請求項7】 上記ハードカウンタは、上記タイマ出力
命令で指定されたI/Oにタイマ出力することを特徴と
する請求項1に記載のプログラマブルコントローラのI
/Oユニット。
7. The programmable controller according to claim 1, wherein said hard counter outputs a timer to an I / O designated by said timer output instruction.
/ O unit.
【請求項8】 外部で組まれたユーザプログラムの入出
力部と、 上記入出力部から取り込んだユーザプログラムが格納さ
れる書き換え可能なメモリと、 上記メモリに格納されたユーザプログラムを実行するユ
ーザプログラム実行手段と、 上記ユーザプログラムにおけるタイマ出力命令によって
所定周波数のパルスを出力するパルスジェネレータと、 上記タイマ出力命令によって上記パルスジェネレータの
出力パルス数をカウントするハードカウンタと、 を有し、 上記プログラミングされたユーザプログラムにおけるタ
イマ出力命令によって任意の条件またはタイミングでタ
イマ出力命令を実行することを特徴とするプログラマブ
ルコントローラ。
8. An input / output unit for a user program externally assembled, a rewritable memory for storing a user program fetched from the input / output unit, and a user program for executing the user program stored in the memory Executing means, a pulse generator for outputting a pulse of a predetermined frequency in accordance with a timer output instruction in the user program, and a hard counter for counting the number of output pulses of the pulse generator in accordance with the timer output instruction. A programmable controller that executes a timer output instruction under an arbitrary condition or timing by a timer output instruction in a user program.
JP2000194707A 2000-06-28 2000-06-28 Programmable controller I / O unit Expired - Fee Related JP4345200B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000194707A JP4345200B2 (en) 2000-06-28 2000-06-28 Programmable controller I / O unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000194707A JP4345200B2 (en) 2000-06-28 2000-06-28 Programmable controller I / O unit

Publications (2)

Publication Number Publication Date
JP2002014706A true JP2002014706A (en) 2002-01-18
JP4345200B2 JP4345200B2 (en) 2009-10-14

Family

ID=18693489

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000194707A Expired - Fee Related JP4345200B2 (en) 2000-06-28 2000-06-28 Programmable controller I / O unit

Country Status (1)

Country Link
JP (1) JP4345200B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10088835B2 (en) 2014-01-06 2018-10-02 Mitsubishi Electric Corporation FA-device-configuration-design supporting apparatus and program

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106255930B (en) 2015-04-06 2019-03-01 三菱电机株式会社 Programable controller system, programmable controller and display device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10088835B2 (en) 2014-01-06 2018-10-02 Mitsubishi Electric Corporation FA-device-configuration-design supporting apparatus and program

Also Published As

Publication number Publication date
JP4345200B2 (en) 2009-10-14

Similar Documents

Publication Publication Date Title
JP3322893B2 (en) Microcomputer
JP2002014706A (en) I/o unit and programmable controller
KR960032138A (en) Microcomputer
US5832255A (en) System and method for selecting a signal source to trigger a microprocessor counter/timer macro cell
JPH035801A (en) Programmable controller
JPH08139575A (en) Pulse output circuit
JP2770314B2 (en) Microcomputer
JPS61267858A (en) Microcomputer
US5500809A (en) Microcomputer system provided with mechanism for controlling operation of program
JP3158425B2 (en) Microcomputer
JP2906254B2 (en) Programmable controller
JPH05100867A (en) Micro controller
JP2522401B2 (en) Programmable controller
KR950013602B1 (en) Frequency measuring device
JP2598088B2 (en) Simple evaluation device for processing equipment
JP2631541B2 (en) Programmable controller
JPH0138692Y2 (en)
JP3985588B2 (en) Counting device and counting system
JP2553350B2 (en) Pulse count circuit
JPH05333956A (en) Timer circuit
JPH0619752A (en) Microcomputer
JPS60252933A (en) Lsi initialization circuit
JPH0221302A (en) Output method for pulse width modulation signal
JP2002278645A (en) Integrated circuit
JPH04170687A (en) Microcomputer

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050304

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071205

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080328

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080527

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090313

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090430

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090623

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090706

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120724

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130724

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees