[go: up one dir, main page]

JP2001249708A - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JP2001249708A
JP2001249708A JP2000065713A JP2000065713A JP2001249708A JP 2001249708 A JP2001249708 A JP 2001249708A JP 2000065713 A JP2000065713 A JP 2000065713A JP 2000065713 A JP2000065713 A JP 2000065713A JP 2001249708 A JP2001249708 A JP 2001249708A
Authority
JP
Japan
Prior art keywords
unit
programmable controller
count
cycle
processing
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.)
Pending
Application number
JP2000065713A
Other languages
Japanese (ja)
Inventor
Ryoichi Uchiyama
良一 内山
Tomohiro Kojima
智浩 小島
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2000065713A priority Critical patent/JP2001249708A/en
Publication of JP2001249708A publication Critical patent/JP2001249708A/en
Pending legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

(57)【要約】 【課題】 カウンタモジュールによる高機能化を実現し
て、コストアップすることなく、高機能のプログラマブ
ルコントローラを提供する。 【解決手段】 CPUモジュール6と、パルス信号13
をカウントする高機能モジュールであるカウンタモジュ
ール1を備えた高機能化プログラマブルコントローラ4
において、カウンタモジュールは、パルス信号による割
り込みによりカウントする割り込み処理部12と、パル
ス信号の周期を測定する周期測定部19と、切り替え部
23とを備え、さらに、割り込み処理部は、複数の異な
る周波数(1KHz、5KHz、10KHz、20KH
z)でパルス信号をカウントするカウント処理実行部1
5、16、17,18を有しており、周期測定部19に
より測定されたパルス信号の周期に基づいてカウント処
理実行部を選択して切り替えて、処理時間の異なる他の
処理を実行する。
(57) [Summary] [PROBLEMS] To provide a high-function programmable controller that realizes high functionality by a counter module and does not increase the cost. SOLUTION: A CPU module 6 and a pulse signal 13 are provided.
Function programmable controller 4 provided with a counter module 1 which is a high function module for counting
, The counter module includes an interrupt processing unit 12 that counts by an interrupt due to a pulse signal, a cycle measurement unit 19 that measures the cycle of the pulse signal, and a switching unit 23. Further, the interrupt processing unit includes a plurality of different frequencies. (1KHz, 5KHz, 10KHz, 20KH
count processing execution unit 1 for counting pulse signals in z)
5, 16, 17 and 18, and selects and switches the count processing execution section based on the cycle of the pulse signal measured by the cycle measurement section 19, and executes another processing having a different processing time.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、例えば位置決め制
御を初めとする種々の制御において用いられ、そのプロ
グラムを変更することにより制御内容を変更可能なプロ
グラマブルコントローラに関し、特に、低価格でありな
がら高機能を達成することの出来るプログラマブルコン
トローラに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a programmable controller which is used in various kinds of control such as positioning control and can change the contents of control by changing a program thereof. The present invention relates to a programmable controller capable of achieving functions.

【0002】[0002]

【従来の技術】制御内容が変更可能なプログラマブルコ
ントローラは、既に、広く制御装置に利用されており、
かかる従来のプログラマブルコントローラのうち、モジ
ュールタイプ方式のプログラマブルコントローラについ
て、添付の図6〜8を参照しながら説明する。
2. Description of the Related Art Programmable controllers whose control contents can be changed are already widely used in control devices.
Among such conventional programmable controllers, a module type programmable controller will be described with reference to FIGS.

【0003】図6には、プログラマブルコントローラを
利用した位置決め制御装置の一構成例が示されており、
図からも明らかなように、上記モジュールタイプのプロ
グラマブルコントローラ4は、基本的には、電源モジュ
ール5、演算制御を行うCPUモジュール6を備えてお
り、さらに、その必要に応じて、例えば、入出力モジュ
ール、高機能モジュール等によって構成される。なお、
この高機能モジュールとは、外部の特殊機器と接続する
ためのモジュールであり、プログラマブルコントローラ
に対して高機能が要求される場合に設けられる。そし
て、かかる高機能モジュールの一つには、所謂、カウン
タモジュール1がある。
FIG. 6 shows an example of a configuration of a positioning control device using a programmable controller.
As is clear from the figure, the module type programmable controller 4 basically includes a power supply module 5 and a CPU module 6 for performing arithmetic control. It is composed of modules, high-performance modules and the like. In addition,
The high function module is a module for connecting to an external special device, and is provided when a high function is required for the programmable controller. As one of such high-performance modules, there is a so-called counter module 1.

【0004】このカウンタモジュール1は、上記プログ
ラマブルコントローラ4が応用されている制御装置にお
いて、その制御対象3の位置決め制御を司るものであ
る。
The counter module 1 controls the positioning of the control target 3 in a control device to which the programmable controller 4 is applied.

【0005】かかる制御装置において、上記位置決め制
御を実行するためには、通常、CPUモジュール6に
て、上記制御対象3の位置を検出して把握する必要があ
る。かかる目的を達成する場合、一般的には、制御対象
3の移動に伴って回転するエンコーダ2を備え付け、こ
のエンコーダ2によおて回転数に応じたパルスを出力さ
せる。すなわち、このエンコーダ2からのパルス出力の
カウント値が、上記制御対象3の位置を示すデータとな
る。そして、上記プログラマブルコントローラ4は、こ
の位置検出データを基にすることにより、上記制御対象
3の位置を、その位置を検出して把握しながら、制御す
ることが可能となる。
In such a control device, in order to execute the positioning control, it is usually necessary for the CPU module 6 to detect and grasp the position of the control target 3. In order to achieve this object, generally, an encoder 2 that rotates with the movement of the control target 3 is provided, and the encoder 2 outputs a pulse corresponding to the number of rotations. That is, the count value of the pulse output from the encoder 2 becomes data indicating the position of the control target 3. Then, based on the position detection data, the programmable controller 4 can control the position of the control target 3 while detecting and grasping the position.

【0006】このように、プログラマブルコントローラ
4における上記カウンタモジュール1の基本機能は、上
記エンコーダ2からのパルス7をカウントし、コントロ
ーラの基本部分を構成するCPUモジュール6にこの情
報(カウント値)を渡すことである。
As described above, the basic function of the counter module 1 in the programmable controller 4 is to count the pulses 7 from the encoder 2 and pass this information (count value) to the CPU module 6 constituting the basic part of the controller. That is.

【0007】しかしながら、上記カウンタモジュール1
の機能は、必ずしも、上記基本機能だけに限られるもの
ではなく、例えば、外部からのデータ入力に応答し、そ
の度毎に上記CPUモジュール6にデータを渡して演算
して制御するのでは、その応答速度において遅過ぎるよ
うな場合、かかる演算機能をカウンタモジュール1に担
当させて対処することも出来る。かかる場合、上記カウ
ンタモジュール1は、上記高速応答制御ができるような
高機能を備えている必要があり、そこで、従来は、マイ
クロコンピュータを採用することによってその低価格化
を図っていた。
However, the above counter module 1
Is not necessarily limited to the basic function described above. For example, if the function is responded to an external data input, and the data is transferred to the CPU module 6 every time to perform the calculation and control, If the response speed is too slow, such a calculation function can be handled by the counter module 1. In such a case, the counter module 1 needs to have a high function capable of performing the high-speed response control. Therefore, conventionally, the price has been reduced by employing a microcomputer.

【0008】図7には、上記従来技術になるプログラマ
ブルコントローラにおいて上記カウンタモジュール1と
して使用され、かつ、マイクロコンピュータ11を採用
して構成された高機能モジュールの例が示されている。
FIG. 7 shows an example of a high-performance module that is used as the counter module 1 in the programmable controller according to the related art and that is configured by employing the microcomputer 11.

【0009】かかるマイクロコンピュータ11を備えた
高機能モジュールでは、入力されたカウントパルス13
は、そのマイクロコンピュータ11に入力され、割り込
みという形で、その処理12が起動され、そして、所定
のカウント処理15を実行するのが一般的であった。
In the high-performance module having the microcomputer 11, the input count pulse 13
Is input to the microcomputer 11, the process 12 is started in the form of an interrupt, and a predetermined count process 15 is generally executed.

【0010】しかしながら、かかる構成では、かかる割
り込み処理を、カウントパルス13の周波数において予
想される最大限に設定しなければならない(例えば、2
0KHz)。
However, in such a configuration, such interrupt processing must be set to the maximum expected at the frequency of the count pulse 13 (for example, 2
0 kHz).

【0011】これを、上記マイクロコンピュータにより
構成されるカウンタモジュール1における、特に、カウ
ント処理のタイミングを示す図8により説明すると、図
において、カウントパルス13の立ち上がりエッジが入
力される度に、マイクロコンピュータには割り込みがか
かり、もって、カウント処理を実行する。なお、このカ
ウント処理は、1を加算、あるいは、1を減算する処理
を、割り込み処理に応じて実行することにより実現され
ている。
This will be described with reference to FIG. 8 showing the timing of the counting process in the counter module 1 constituted by the microcomputer. In FIG. 8, every time the rising edge of the count pulse 13 is input, the microcomputer Is interrupted, and the counting process is executed. Note that this counting process is realized by executing a process of adding 1 or subtracting 1 in accordance with an interrupt process.

【0012】そして、この図からも明らかなように、例
えば制御対象3の移動速度が加速した場合等、当然、カ
ウントパルス13の周波数が高くなり、現パルスと次の
パルスとの間の期間が短くなる。そのため、例えば、こ
のパルスと間の期間が、上記割り込み処理の時間より短
くなると、カウントパルス13の一部がカウントから取
りこぼされてしまう(図中の符号10を参照)という不
具合が発生する。
As is apparent from this figure, for example, when the moving speed of the control target 3 is accelerated, the frequency of the count pulse 13 naturally increases, and the period between the current pulse and the next pulse is increased. Be shorter. Therefore, for example, if the period between the pulses is shorter than the time of the interrupt processing, a problem that a part of the count pulse 13 is omitted from the count (see reference numeral 10 in the drawing) occurs.

【0013】そのため、上記従来技術になるプログラマ
ブルコントローラにおいて、マイクロコンピュータから
構成されるカウンタモジュール1は、その能力にもかか
わらず、ウンタ処理に係わるカウント周波数を最大限に
設定(例えば、20KHz)しなければならず、その
分、他の処理を実行するための機能が制限を受けてい
た。
Therefore, in the above-described conventional programmable controller, the counter module 1 composed of a microcomputer must set the count frequency related to the counter processing to the maximum (for example, 20 KHz) despite its capability. Therefore, the function for executing other processing is limited accordingly.

【0014】[0014]

【発明が解決しようとする課題】すなわち、カウンタモ
ジュールの機能は、そのカウント可能なパルスの周波数
を最大限に設定してカウント機能のみを実行しており、
その他の機能は、その分だけ抑制された、制限された機
能として固定的に設定されていた。
That is, the function of the counter module is to execute only the count function by setting the countable pulse frequency to the maximum.
Other functions were fixedly set as restricted functions, which were suppressed accordingly.

【0015】そのため、上記従来技術になる高機能(カ
ウンタ)モジュールを備えたプログラマブルコントロー
ラでは、上記のようにカウント可能周波数最大限に設定
したカウンタモジュールの機能を更に向上させるために
は、更に、カウント部のハードウエアの追加し、あるい
は、高速のマイクロコンピュータを採用する等によって
対処しなければならず、そのため、更なるコストアップ
を伴うことなしには、これを実現できないという問題が
あった。
Therefore, in the programmable controller having the high-performance (counter) module according to the prior art, in order to further improve the function of the counter module in which the countable frequency is set to the maximum as described above, the count is further increased. This has to be dealt with by adding hardware of the unit or by adopting a high-speed microcomputer. Therefore, there is a problem that this cannot be realized without further increasing the cost.

【0016】そこで、本発明の目的は、上記従来技術に
おける問題点に鑑み、ハードウエアの追加や高速のマイ
クロコンピュータの採用等、更なるコストアップを伴う
ことなく、既に設けられた高機能モジュールであるカウ
ンタモジュールの高機能化を実現可能な、新規なプログ
ラマブルコントローラを提供することにある。
Accordingly, an object of the present invention is to provide a high-performance module that has already been provided without additional cost, such as adding hardware or employing a high-speed microcomputer, in view of the above-mentioned problems in the prior art. It is an object of the present invention to provide a novel programmable controller capable of realizing a high function of a certain counter module.

【0017】[0017]

【課題を解決するための手段】上記目的を達成するた
め、本発明によれば、外部からの入力信号を演算処理す
る演算処理部を備え、さらに、前記外部からの入力信号
のうちのパルス信号をカウントするため、第2の演算処
理部から構成される高機能モジュールを備えたプログラ
マブルコントローラにおいて、前記第2の演算処理部
は、前記外部からのパルス信号による割り込みによりパ
ルス信号をカウントする割り込み処理部と、前記外部か
らのパルス信号の周期を測定する周期測定部と、切り替
え部とを備え、さらに、前記割り込み処理部は、複数の
異なる周波数でパルス信号をカウントするカウント処理
実行部を有しており、もって、前記周期測定部により測
定されたパルス信号の周期に基づいて、前記割り込み処
理部の複数のカウント処理実行部から一のカウント処理
実行部を選択して切り替え、前記複数のカウント処理実
行部に対応した処理時間の異なる他の処理が実行される
ように構成されたプログラマブルコントローラが提供さ
れる。
According to the present invention, there is provided, in accordance with the present invention, an arithmetic processing unit for arithmetically processing an external input signal, and further comprising a pulse signal of the external input signal. In a programmable controller provided with a high-performance module comprising a second arithmetic processing unit, the second arithmetic processing unit may perform an interrupt process for counting a pulse signal by an interrupt from the external pulse signal. Unit, a period measuring unit that measures the period of the external pulse signal, and a switching unit, further, the interrupt processing unit has a count processing execution unit that counts the pulse signal at a plurality of different frequencies Thus, a plurality of counts of the interrupt processing unit are performed based on the cycle of the pulse signal measured by the cycle measuring unit. Switching from management execution unit selects one of the count processing execution unit, a programmable controller configured to different from the process is performed with the processing time corresponding to the plurality of count processing execution section is provided.

【0018】また、本発明によれば、前記第2の演算処
理部は、さらに、前記周期測定部により測定して算出し
た前記外部からのパルス信号の周波数を前記演算処理部
へ転送する手段を備え、あるいは、前記切り替え部の選
択を前記周期測定部の測定信号によって自動的に行うよ
うに構成し、あるいは、前記切り替え部の選択を手動に
より行うように構成される。
According to the present invention, the second arithmetic processing unit further includes means for transferring the frequency of the external pulse signal measured and calculated by the cycle measuring unit to the arithmetic processing unit. It is configured such that the selection of the switching unit is automatically performed by the measurement signal of the period measurement unit, or the selection of the switching unit is manually performed.

【0019】[0019]

【発明の実施の形態】以下、本発明の実施の形態につい
て、添付の図面を参照しながら詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the accompanying drawings.

【0020】再び、図6には、本発明の実施の形態にな
るプログラマブルコントローラ4を採用した、特に、制
御対象3の位置を制御する、いわゆる、位置決め制御装
置が示されている。すなわち、上記制御対象3の位置
は、エンコーダ2によってパルス信号7に変換されてプ
ログラマブルコントローラ4に入力されており、もっ
て、プログラマブルコントローラ4は、この制御対象3
の位置を検出して把握しながら、その位置を高精度に制
御することが可能になる。
FIG. 6 again shows a so-called positioning control device that employs the programmable controller 4 according to the embodiment of the present invention, and in particular controls the position of the control target 3. That is, the position of the control target 3 is converted into a pulse signal 7 by the encoder 2 and input to the programmable controller 4, so that the programmable controller 4
While detecting and grasping the position, the position can be controlled with high accuracy.

【0021】なお、この本発明になるプログラマブルコ
ントローラ4においても、図6からも明らかなように、
上記従来技術と同様、電源モジュール5や演算制御を行
うCPUモジュール6を備えると共に、さらに、上記エ
ンコーダ2からのパルス信号7をカウントし、コントロ
ーラの基本部分を構成するCPUモジュール6にこの情
報(カウント値)を渡す機能を達成するための高機能モ
ジュールとして、所謂、カウンタモジュール1が設けら
れている。
In the programmable controller 4 according to the present invention, as is apparent from FIG.
Similarly to the above-mentioned conventional technology, the power supply module 5 and the CPU module 6 for performing arithmetic control are provided, and the pulse signal 7 from the encoder 2 is counted. A so-called counter module 1 is provided as a high-performance module for achieving the function of passing a value).

【0022】図1には、上記高機能モジュールとしての
カウンタモジュール1を構成するマイクロコンピュータ
11と共に、上記エンコーダ2からのカウント入力パル
ス13が示され、さらに、このマイクロコンピュータ1
1の詳細が、その機能ブロックにより示されている。な
お、この図中、符号12は割り込みルーチン(割り込み
処理部)を示し、符号15、16、17、18は、上記
割り込み処理部12内に設けられた、入力カウントパル
スの周波数帯別に区分された4種のモード(1KHz、
5KHz、10KHz,20KHz)を、符号19は周
期測定部を、符号20はレジスタ部を、符号21は最大
ピーク周波数レジスタ部を、符号22はモードマニュア
ル操作部を、そして、符号23は切り替え部を示してい
る。
FIG. 1 shows a microcomputer 11 constituting the counter module 1 as a high-performance module, together with a count input pulse 13 from the encoder 2.
Details of 1 are indicated by its functional blocks. In this figure, reference numeral 12 indicates an interrupt routine (interrupt processing unit), and reference numerals 15, 16, 17, and 18 are provided in the interrupt processing unit 12 and classified according to frequency bands of input count pulses. Four modes (1KHz,
5 KHz, 10 KHz, 20 KHz), reference numeral 19 denotes a period measuring unit, reference numeral 20 denotes a register unit, reference numeral 21 denotes a maximum peak frequency register unit, reference numeral 22 denotes a mode manual operation unit, and reference numeral 23 denotes a switching unit. Is shown.

【0023】かかる構成のカウンタモジュール1を構成
するマイクロコンピュータ11において、上記エンコー
ダ2からのカウントパルス13が入力されると、マイク
ロコンピュータ11に入力され、これにより、割り込み
処理ルーチン12に入る。
When the count pulse 13 from the encoder 2 is input to the microcomputer 11 constituting the counter module 1 having such a configuration, the count pulse 13 is input to the microcomputer 11, thereby entering an interrupt processing routine 12.

【0024】マイクロコンピュータ11は、この割り込
み処理と同時に、入力されたカウントパルス13の周期
を、その周期測定部19にて、測定する。なお、先程述
べた起動がかかった割り込みルーチン12の中には、カ
ウントパルス13の周波数別に処理可能な、異なる複数
種のモード(この例では4種)が用意されている。そこ
で、マイクロコンピュータ11は、上記周期測定部で測
定したデータに基づいてその周波数を求め(周波数=1
/周期)、そして、このデータを基にして、どのモード
機能を選択するかが決定され、切り替え部23にて切り
替えられる。
At the same time as the interrupt processing, the microcomputer 11 measures the cycle of the input count pulse 13 by the cycle measuring unit 19. In the interrupt routine 12 that has been activated as described above, a plurality of different modes (four in this example) that can be processed for each frequency of the count pulse 13 are prepared. Therefore, the microcomputer 11 obtains the frequency based on the data measured by the period measuring unit (frequency = 1).
/ Cycle), and based on this data, which mode function is to be selected is determined, and is switched by the switching unit 23.

【0025】なお、上記の実施の形態では、さらに、マ
ニュアル操作部22が設けられており、これにより、上
記切り替え部23の切替は、上述のようにマイクロコン
ピュータ11により自動的に行われると共に、上記マニ
ュアル操作部22にて、操作者が手動で行うことも可能
となっている。
In the above-described embodiment, the manual operation unit 22 is further provided, whereby the switching of the switching unit 23 is automatically performed by the microcomputer 11 as described above, and The manual operation unit 22 allows the operator to perform the operation manually.

【0026】また、上記の4種のモード15、16、1
7、18は、入力されるカウントパルス13の周波数帯
別に区分されている。そして、かかる区分によれば、周
波数が高いモード15(20KHz)では、カウント処
理時間は短くなり、従って、このカウント処理時間では
他の多くの処理を実行することは不可能となり、そのた
め、その機能は小さくなる。これに対して、その周波数
が低いモード18(1KHz)では、カウント処理時間
が長くなり、このカウント処理期間においては、その
分、他の多くの処理が実行可能であり、その機能を上げ
ることが可能となる。
The above four modes 15, 16, 1
7 and 18 are classified according to the frequency band of the input count pulse 13. According to this classification, in the high frequency mode 15 (20 KHz), the count processing time is short, and therefore, it is impossible to execute many other processings in the count processing time. Becomes smaller. On the other hand, in the mode 18 (1 KHz) whose frequency is low, the count processing time is long, and in this count processing period, many other processes can be executed correspondingly, and the function can be improved. It becomes possible.

【0027】一方、入力されたカウントパルス13の周
期を測定する周期測定部19は、上記の割り込み処理モ
ード15、16、17、18の切り替えを行うだけでな
く、求めた周波数データを、レジスタ20を介して上記
CPUモジュール6に送付し、これにより、上記CPU
モジュール6は現状でどれくらいの周波数でカウントパ
ルス13をカウントしているのかがモニター出来るだけ
でなく、さらには、その最大周波数のピーク値を保持す
るために設けられた上記最大ピーク周波数レジスタ部2
1に格納することにより、上記カウントパルス13の取
りこぼしが無かったのかどうかを判定することができ
る。
On the other hand, the cycle measuring section 19 for measuring the cycle of the input count pulse 13 not only switches the interrupt processing modes 15, 16, 17, and 18 but also stores the obtained frequency data in the register 20. To the CPU module 6 via the
The module 6 can monitor not only the frequency at which the count pulse 13 is currently counted, but also the maximum peak frequency register 2 provided to hold the peak value of the maximum frequency.
By storing it in 1, it can be determined whether or not the count pulse 13 has not been missed.

【0028】次に、図2には、上記に説明した各処理モ
ード15、16、17、18への切り替え部23に関す
る具体的な方法を示す。なお、この例での各モードのカ
ウント処理部15、16、17、18は、それぞれ、処
理しようとする各プログラムがメモリに格納されてお
り、かつ、それぞれの先頭番地をもっている。
Next, FIG. 2 shows a specific method for the switching unit 23 for switching to each of the processing modes 15, 16, 17, and 18 described above. The count processing units 15, 16, 17, and 18 in each mode in this example each store a program to be processed in a memory and have a respective start address.

【0029】今、カウントパルス13が入力され、これ
により割り込み処理がスタートすると、予め決められた
番地25にジャンプされ、この番地に格納された命令が
実行される。なお、この番地25に格納される命令は、
更に他の番地26へジャンプする命令を含んでおり、そ
して、この番地26にはジャンプ先の番地が入力されて
いる。例えば、この例では、「IJKL」番地にジャン
プし、そこに格納された処理モード17を実行すること
になる。あるいは、この番地26に入力されるジャンプ
先番地を上記の「IJKL」番地に代えて、例えば「A
BCD」、「EFGH」または「MNOP」に予め設定
しておけば、他のモードへ切り替えて実行することがが
可能である。
Now, when the count pulse 13 is input and the interrupt processing is started by this, a jump is made to a predetermined address 25, and the instruction stored at this address is executed. The instruction stored at address 25 is
It further includes a command to jump to another address 26, and the address to which the jump is made is input to this address 26. For example, in this example, the CPU jumps to the address "IJKL" and executes the processing mode 17 stored therein. Alternatively, the jump destination address input to the address 26 is replaced with the above-mentioned “IJKL” address, for example, “AJL”.
If preset to "BCD", "EFGH" or "MNOP", it is possible to switch to another mode and execute.

【0030】つまり、上記周期測定部19にて判定した
モードに対応して番地26を適宜設定することにより、
あたかも鉄道線路のポインタのように、入力されるカウ
ントパルス13の周波数に応じて実行したいモードへ導
くことが可能となる。
That is, by appropriately setting the address 26 corresponding to the mode determined by the cycle measuring unit 19,
It is possible to lead to a mode to be executed in accordance with the frequency of the input count pulse 13 like a pointer on a railway line.

【0031】続いて、上記に述べてきた、カウント処理
内における実行機能の例について、添付の図3を参照し
ながらその一例を示す。この図3において、その縦方向
にはカウント経過値が、そして、横方向には時間が示さ
れている。そして、図からも明きらかなように、4つの
設定値28(1KHz)、29(5KHz)、30(1
0KHz)、31(20KHz)が設定されている。
Next, an example of the execution function in the counting process described above will be described with reference to FIG. In FIG. 3, the count elapsed value is shown in the vertical direction, and the time is shown in the horizontal direction. Then, as apparent from the figure, the four set values 28 (1 KHz), 29 (5 KHz), 30 (1 KHz)
0 KHz) and 31 (20 KHz) are set.

【0032】これによれば、上記マイクロコンピュータ
11は、上記カウント経過値27が4つの設定値28、
29、30、31に対して、それぞれ、イコール(=)
か、あるいは、より大きい、または、小さい(>、<)
の情報を、常に、上記CPU6へ伝達すると共に、必要
であれば、外部へ出力信号として出力し、この出力信号
を基にして外部のモータ等の負荷を停止させることなど
が出来ることとなる。そして、これらの設定値とカウン
ト経過値とを比較する処理には時間が必要であり、その
ための処理時間はその設定値の数に比例することとな
る。すなわち、高度な処理には、より長い処理時間が必
要となる。
According to this, the microcomputer 11 determines that the count elapsed value 27 has four set values 28,
Equal (=) for 29, 30, and 31, respectively
Is greater than or less than (>, <)
Is always transmitted to the CPU 6 and, if necessary, output to the outside as an output signal, and based on this output signal, the load of an external motor or the like can be stopped. Processing for comparing these set values with the elapsed count value requires time, and the processing time for that is proportional to the number of the set values. That is, advanced processing requires a longer processing time.

【0033】そこで、本発明においては、例えば、上記
図2に示した4種類の処理モード15、16、17、1
8に対して、その処理内容を以下のうように設定する。
Therefore, in the present invention, for example, the four types of processing modes 15, 16, 17, 1 shown in FIG.
8, the processing contents are set as follows.

【0034】すなわち、処理モード18では、4個の設
定値に対するカウント経過値の比較処理を実行させ、処
理モード17では、2個の設定値に対するカウント経過
値の比較処理を実行させ、処理モード16では、1個の
設定値に対するカウント経過値の比較処理を実行させ、
そして、処理モード15では、上記の比較処理は行わな
いように設定する。すなわち、各処理モードに対して、
その処理時間の異なる処理内容が割り当てられており、
そして、その処理内容によってその機能が異なるものと
なっている。換言すれば、処理時間の長い処理内容ほど
高度な機能となり、他方、短いほど低い機能となってお
り、これが機能の差となる。なお、ここで説明した機能
の高度化はその一例であり、その他の機能であっても構
わないことは言うまでもなかろう。
That is, in the processing mode 18, the comparison processing of the count elapsed value with respect to the four set values is executed, and in the processing mode 17, the comparison processing of the count elapsed value with the two set values is executed. Then, the comparison process of the count elapsed value with respect to one set value is executed,
Then, in the processing mode 15, it is set so that the above-described comparison processing is not performed. That is, for each processing mode,
Processing contents with different processing times are assigned,
The function differs depending on the processing content. In other words, the longer the processing time, the higher the function, while the shorter the processing time, the lower the function, which is the difference between the functions. Note that the enhancement of the functions described here is one example, and it goes without saying that other functions may be used.

【0035】なお、上記の選択されている処理モード1
5、16、17、18は、常に、上記CPU6へ送られ
ており、そのため、上記マイクロコンピュータ11は、
上記処理内容の内のどの情報が無効になっているかを常
に判定すすことができるようになっている。
The selected processing mode 1
5, 16, 17, and 18 are always sent to the CPU 6, so that the microcomputer 11
It is possible to always determine which information in the above processing contents is invalid.

【0036】次に、上記図1のカウントパルスの周期検
出部19における、周期測定方法の一例を、添付の図4
及び図5に示す。一般に、汎用のマイクロコンピュータ
の中には、図4に示すように、マイクロコンピュータが
動作するに必要なシステムクロックを常にカウントする
ためのフリーランニングカウンタ32が備えられてい
る。このカウンタ値からは、これにクロックの周期を乗
算すれば、時間に変換することができる。
Next, an example of a period measuring method in the period detecting section 19 of the count pulse of FIG. 1 will be described with reference to FIG.
And FIG. Generally, as shown in FIG. 4, a general-purpose microcomputer is provided with a free-running counter 32 for constantly counting a system clock required for the operation of the microcomputer. This counter value can be converted into time by multiplying it by the clock cycle.

【0037】そこで、上記マイクロコンピュータ11で
は、上記カウントパルス13が入力される度に、割り込
み処理を実行する。従って、上記カウントパルス13の
周期は、前回のカウントパルス13で割り込みが起動し
てから、今回のカウントパルス13で割り込みが起動す
るまでの間の時間ということになる。そこで、この割り
込み処理では、図5に示すように、その割り込み処理の
中に、周期測定処理34において下記の計算を実行す
る。
Therefore, the microcomputer 11 executes an interrupt process every time the count pulse 13 is input. Therefore, the cycle of the count pulse 13 is the time from the start of the interrupt by the previous count pulse 13 to the start of the interrupt by the current count pulse 13. Therefore, in this interrupt processing, the following calculation is executed in the cycle measurement processing 34 during the interrupt processing as shown in FIG.

【0038】(周期)=(前回のフリーランニングカウ
ンタ値)−(今回のフリーランニングカウンタ値)
(Cycle) = (previous free running counter value) − (current free running counter value)

【0039】そして、この得られた周期に既知のクロッ
クの周期を乗算することにより、カウント入力パルスの
周期時間が得られ、さらに、その逆数から周波数を計算
することができることとなる。
By multiplying the obtained cycle by the known clock cycle, the cycle time of the count input pulse is obtained, and the frequency can be calculated from its reciprocal.

【0040】以上に説明したように、本発明になるプロ
グラマブルコントローラ4の一部を構成する高機能モジ
ュール(カウンタモジュール)であるマイクロコンピュ
ータ11によれば、上記した従来技術のように、カウン
ト部のハードウエアの追加し、あるいは、高速のマイク
ロコンピュータを採用する等によってコストアップを伴
うことなしに、すなわち、外部から入力されるカウント
パルス13が低速になればなる程、カウントパルス13
をカウント処理するためのカウントパルス(割り込み)
周期が大きくすることにより、この間において、その他
の多くのカウント処理を実行可能とし、これにより、そ
の機能を上げることが可能となる。
As described above, according to the microcomputer 11 which is a high-performance module (counter module) which constitutes a part of the programmable controller 4 according to the present invention, as in the above-described prior art, Without increasing the cost by adding hardware or employing a high-speed microcomputer, that is, the lower the count pulse 13 input from the outside, the lower the count pulse 13
Count pulse (interrupt) for counting data
By increasing the period, many other counting processes can be executed during this period, and the function can be improved.

【0041】従って、現在入力しているカウントパルス
の周期を測定し、この測定データに見合ったモードの機
能に自動的に切り替え、カウントパルスが低速時に最大
限の機能が引き出せることが可能となる。
Accordingly, the cycle of the currently input count pulse is measured, and the mode is automatically switched to a function of a mode corresponding to the measured data, so that the maximum function can be obtained when the count pulse is at a low speed.

【0042】[0042]

【発明の効果】以上の詳細な説明からも明らかなよう
に、本発明によれば、カウント可能周波数最大限に設定
したカウンタモジュールによる他の機能の高機能化を実
現することにより、コストアップすることなく、プログ
ラマブルコントローラの更なる高機能化を実現すること
が可能になるという優れた効果を発揮することとなる。
As is clear from the above detailed description, according to the present invention, the cost is increased by realizing other functions with the counter module set to the maximum countable frequency. Without this, an excellent effect that it is possible to realize a more advanced function of the programmable controller is exhibited.

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

【図1】本発明のプログラマブルコントローラの特徴で
あるカウンタモジュールの詳細を説明する機能ブロック
図である。
FIG. 1 is a functional block diagram illustrating details of a counter module which is a feature of a programmable controller according to the present invention.

【図2】上記カウンタモジュールにおける各処理モード
への切り替え部の具体的な方法を示す図である。
FIG. 2 is a diagram showing a specific method of a switching unit for switching to each processing mode in the counter module.

【図3】上記カウンタモジュールにおけるカウント処理
内における実行機能の一例を示す説明図である。
FIG. 3 is an explanatory diagram showing an example of an execution function in a count process in the counter module.

【図4】上記カウントパルスの周期検出部における周期
測定方法の一例を示す図である。
FIG. 4 is a diagram showing an example of a period measuring method in the period detecting section of the count pulse.

【図5】やはり、上記カウントパルスの周期検出部にお
ける周期測定方法の一例を示すフローチャート図であ
る。
FIG. 5 is also a flowchart showing an example of a cycle measuring method in the count pulse cycle detector.

【図6】本発明又は従来技術になるプログラマブルコン
トローラを適用した位置決め制御装置の概略構成を示す
ブロック図である。
FIG. 6 is a block diagram showing a schematic configuration of a positioning control device to which a programmable controller according to the present invention or the prior art is applied.

【図7】上記従来技術になるプログラマブルコントロー
ラのカウンタモジュールの詳細を説明する機能ブロック
図である。
FIG. 7 is a functional block diagram illustrating details of a counter module of a programmable controller according to the related art.

【図8】上記従来技術におけるカウンタモジュールでの
カウント処理のタイミングを示す図である。
FIG. 8 is a diagram showing the timing of a count process in the counter module according to the conventional technique.

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

1 カウンタモジュール 2 エンコーダ 3 制御対象 4 プログラマブルコントローラ 6 CPUモジュール 13 カウントパルス 11 マイクロコンピュータ(カウンタモジュール) 12 割り込み処理部 15、16、17、18 カウント処理 19 周期検出部 20 カウントパルス周波数レジスタ部 21 最大ピーク周波数保持レジスタ部 22 モードマニュアル設定部 23 機能モード切り替えスイッチ部 DESCRIPTION OF SYMBOLS 1 Counter module 2 Encoder 3 Control object 4 Programmable controller 6 CPU module 13 Count pulse 11 Microcomputer (counter module) 12 Interrupt processing part 15, 16, 17, 18 Count processing 19 Period detection part 20 Count pulse frequency register part 21 Maximum peak Frequency holding register section 22 Mode manual setting section 23 Function mode changeover switch section

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5B098 AA05 BA06 BB11 EE01 EE06 GA01 5H220 BB03 CC03 CX03 CX05 EE09 EE12 EE13 JJ02 JJ16 JJ59 9A001 BB01 BB02  ──────────────────────────────────────────────────続 き Continued on the front page F term (reference) 5B098 AA05 BA06 BB11 EE01 EE06 GA01 5H220 BB03 CC03 CX03 CX05 EE09 EE12 EE13 JJ02 JJ16 JJ59 9A001 BB01 BB02

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 外部からの入力信号を演算処理する演算
処理部を備え、さらに、前記外部からの入力信号のうち
のパルス信号をカウントするため、第2の演算処理部か
ら構成される高機能モジュールを備えたプログラマブル
コントローラにおいて、前記第2の演算処理部は、前記
外部からのパルス信号による割り込みによりパルス信号
をカウントする割り込み処理部と、前記外部からのパル
ス信号の周期を測定する周期測定部と、切り替え部とを
備え、さらに、前記割り込み処理部は、複数の異なる周
波数でパルス信号をカウントするカウント処理実行部を
有しており、もって、前記周期測定部により測定された
パルス信号の周期に基づいて、前記割り込み処理部の複
数のカウント処理実行部から一のカウント処理実行部を
選択して切り替え、前記複数のカウント処理実行部に対
応した処理時間の異なる他の処理が実行されるように構
成されたことを特徴とするプログラマブルコントロー
ラ。
A high-performance processing unit comprising an arithmetic processing unit for arithmetically processing an external input signal, and further comprising a second arithmetic processing unit for counting a pulse signal of the external input signal. In a programmable controller including a module, the second arithmetic processing unit includes an interrupt processing unit that counts a pulse signal by an interrupt due to the external pulse signal, and a cycle measuring unit that measures a cycle of the external pulse signal. And a switching unit, and the interrupt processing unit further includes a count processing execution unit that counts pulse signals at a plurality of different frequencies, and thus the cycle of the pulse signal measured by the cycle measurement unit. Based on, select and switch one count processing execution unit from the plurality of count processing execution units of the interrupt processing unit, A programmable controller characterized in that another processing with a different processing time corresponding to the plurality of count processing execution units is executed.
【請求項2】 前記請求項1に記載したプログラマブル
コントローラにおいて、前記第2の演算処理部は、さら
に、前記周期測定部により測定して算出した前記外部か
らのパルス信号の周波数を前記演算処理部へ転送する手
段を備えていることを特徴とするプログラマブルコント
ローラ。
2. The programmable controller according to claim 1, wherein the second arithmetic processing unit further calculates a frequency of the external pulse signal measured and calculated by the cycle measuring unit. A programmable controller, comprising: means for transferring data to a programmable controller.
【請求項3】 前記請求項1に記載したプログラマブル
コントローラにおいて、前記第2の演算処理部は、前記
切り替え部の選択を前記周期測定部の測定信号によって
自動的に行うように構成したことを特徴とするプログラ
マブルコントローラ。
3. The programmable controller according to claim 1, wherein the second arithmetic processing unit is configured to automatically select the switching unit based on a measurement signal of the cycle measuring unit. And a programmable controller.
【請求項4】 前記請求項1に記載したプログラマブル
コントローラにおいて、前記第2の演算処理部は、前記
切り替え部の選択を手動により行うように構成したこと
を特徴とするプログラマブルコントローラ。
4. The programmable controller according to claim 1, wherein the second arithmetic processing unit is configured to manually select the switching unit.
JP2000065713A 2000-03-06 2000-03-06 Programmable controller Pending JP2001249708A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000065713A JP2001249708A (en) 2000-03-06 2000-03-06 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000065713A JP2001249708A (en) 2000-03-06 2000-03-06 Programmable controller

Publications (1)

Publication Number Publication Date
JP2001249708A true JP2001249708A (en) 2001-09-14

Family

ID=18585197

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000065713A Pending JP2001249708A (en) 2000-03-06 2000-03-06 Programmable controller

Country Status (1)

Country Link
JP (1) JP2001249708A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102213953A (en) * 2010-04-09 2011-10-12 Ls产电株式会社 Input module of plc

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102213953A (en) * 2010-04-09 2011-10-12 Ls产电株式会社 Input module of plc
JP2011222019A (en) * 2010-04-09 2011-11-04 Lsis Co Ltd Input module for plc
CN102213953B (en) * 2010-04-09 2013-09-18 Ls产电株式会社 Input module of plc
US8594214B2 (en) 2010-04-09 2013-11-26 Lsis Co., Ltd. Input module of PLC

Similar Documents

Publication Publication Date Title
JP2001249708A (en) Programmable controller
JP2001318807A (en) Method and device for controlling task switching
JP2016080547A (en) Position control device
JPS6118763B2 (en)
KR0120577B1 (en) The fault detecting device of servo motor and encoder
US5500809A (en) Microcomputer system provided with mechanism for controlling operation of program
JP2880658B2 (en) Runaway detection device for multitask program
JP2954846B2 (en) Hand movement control method
JPH0251749A (en) Circuit for measuring processor application rate
JP3068317B2 (en) Microcomputer
JP2990111B2 (en) Timer circuit
JP3985588B2 (en) Counting device and counting system
KR890003638B1 (en) Position detection and revision method
JPH0839298A (en) Slide stop time measuring instrument of press machine
KR950020192A (en) DMA controller and control method
JPH07260845A (en) Pulse period measurement circuit
JPS63193213A (en) Speed controller for digital servo system with pulse encoder
JPS6120139A (en) Interruption control system
JPH0353080B2 (en)
JPH0382387A (en) Constant-speed control system for dc servo motor
JPH02300947A (en) Circuit for measuring using rate of processor
JPS6227835A (en) Measuring method for load of microprogram controller
JPS6340700A (en) Digital rotary cam switch
JPS625447A (en) Information history memory system
JPH0474231A (en) Interruption control circuit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040203

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20040203

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20040203

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060308

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060314

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060512

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20060512

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060711