JP2542465B2 - Sequence control method - Google Patents
Sequence control methodInfo
- Publication number
- JP2542465B2 JP2542465B2 JP3286221A JP28622191A JP2542465B2 JP 2542465 B2 JP2542465 B2 JP 2542465B2 JP 3286221 A JP3286221 A JP 3286221A JP 28622191 A JP28622191 A JP 28622191A JP 2542465 B2 JP2542465 B2 JP 2542465B2
- Authority
- JP
- Japan
- Prior art keywords
- special function
- unit
- instruction
- function unit
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Landscapes
- Programmable Controllers (AREA)
Description
【0001】[0001]
【発明の属する技術分野】この発明は、D/A変換等の
特殊処理を行なう特殊機能ユニットを備えたシーケンス
制御装置におけるシーケンス制御方法に関するものであ
る。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a sequence control method in a sequence control device equipped with a special function unit for performing special processing such as D / A conversion.
【0002】[0002]
【従来の技術】シーケンス制御装置としてのプログラマ
ブルコントローラは単なるリレー盤の機能をCPUとメ
モリを使用して処理するようにしたものであったが、所
望の機能を実現したり既存の機能を変更したりするに当
たり単にプログラムを作成または変更すれば目的を達成
できるという使い易さとフレキシブル性とにより、さら
に、プログラマブルコントローラ自体の高機能化が進ん
だ事により、その適応分野は飛躍的に拡大し、シーケン
ス制御だけでなく、アナログ処理、位置決め処理、通信
処理、モニタ表示等をプログラマブルコントローラで行
なうようになってきている。シーケンス制御は主として
プログラマブルコントローラの構成ユニットの一つであ
るCPUユニットが行い、シーケンス制御以外の種々の
処理は、主として特殊機能ユニットが行うようにしてい
る。すなわち、CPUユニットは特殊機能ユニットに対
し指示データの書き込みや結果データの読み出しを行な
うことにより全体を統括制御するようになり、制御シス
テムが大規模複雑化するにつれ特殊機能ユニットは不可
欠になってきている。2. Description of the Related Art A programmable controller as a sequence control device is one in which the function of a simple relay board is processed by using a CPU and a memory, but a desired function is realized or an existing function is changed. In addition to the ease and flexibility of achieving the purpose by simply creating or changing a program, the applicable areas of the programmable controller have expanded dramatically due to the advanced functionality of the programmable controller itself. In addition to control, programmable controllers are now performing analog processing, positioning processing, communication processing, monitor display, and the like. The sequence control is mainly performed by the CPU unit, which is one of the constituent units of the programmable controller, and various processes other than the sequence control are mainly performed by the special function unit. That is, the CPU unit controls the whole by writing instruction data and reading result data to the special function unit, and the special function unit becomes indispensable as the control system becomes large-scale and complicated. There is.
【0003】次に、特殊機能ユニットからのデータの読
み出し、特殊機能ユニットへのデータの書き込みについ
て説明する。図7はプログラマブルコントローラのシス
テム構成図である。図において、1はプログラマブルコ
ントローラ全体を制御するCPUユニットであり、この
CPUユニット1はシーケンスプログラムが格納される
プログラムメモリ11、制御対象に設けられたリミット
スイッチ等からの入力情報、上記制御対象に設けられた
コイル等を制御する出力情報、および、内部情報を記憶
するデバイスメモリ12を備えている。2はプログラム
メモリ11に格納されるシーケンスプログラムを作成す
るためのプログラム装置、3はCPUユニット1とプロ
グラム装置2を接続する通信ケーブル、4は入出力ユニ
ットである。4Aは特殊機能ユニットであり、この特殊
機能ユニット4Aは特殊機能ユニット4A内からもCP
Uユニット1からもデータの読み書きができる双方向ア
クセス記憶手段、例えば、2ポートメモリ41を備えて
いる。Next, reading of data from the special function unit and writing of data to the special function unit will be described. FIG. 7 is a system configuration diagram of the programmable controller. In the figure, 1 is a CPU unit that controls the entire programmable controller, and this CPU unit 1 is a program memory 11 in which a sequence program is stored, input information from a limit switch or the like provided for a control target, and the above-mentioned control target. The device memory 12 stores output information for controlling the generated coil and the like and internal information. 2 is a program device for creating a sequence program stored in the program memory 11, 3 is a communication cable for connecting the CPU unit 1 and the program device 2, and 4 is an input / output unit. 4A is a special function unit, and this special function unit 4A is also a CP from within the special function unit 4A.
The U unit 1 is provided with a bidirectional access storage means capable of reading and writing data, for example, a 2-port memory 41.
【0004】図21a〜cは2ポートメモリ41の記憶
内容の一例を示す図であり、それぞれ2CH・D/Aユ
ニットの2ポートメモリ41A、8CH・D/Aユニッ
トの2ポートメモリ41B、表示ユニットの2ポートメ
モリ41Cの記憶内容の一例を示している。FIGS. 21a to 21c are diagrams showing an example of the stored contents of the 2-port memory 41. The 2-port memory 41A of the 2CH • D / A unit, the 2-port memory 41B of the 8CH • D / A unit, and the display unit, respectively. 2 shows an example of the stored contents of the 2-port memory 41C.
【0005】図22は、CPUユニット1が特殊機能ユ
ニットからデータの読み出しを行なう命令の形式、およ
び、CPUユニット1が特殊機能ユニットに対しデータ
の書き込みを行なう命令の形式を示す図である。図にお
いて、5はCPUユニット1が特殊機能ユニット4Aか
らデータを読み出す命令であり、この命令5は特殊機能
ユニット4Aの装着位置に対応する入出力番号51、特
殊機能ユニットの2ポートメモリ41におけるデータを
読み出す際の先頭アドレス52、読み出されたデータを
格納するデバイスメモリ12の先頭デバイス53および
転送するデータの点数54から構成される。なお、デバ
イスメモリ12の先頭デバイス53はデバイスメモリ1
2のアドレスを指定する。6はCPUユニット1が特殊
機能ユニット4Aにデータを書き込む命令であり、この
命令6は特殊機能ユニット4Aの装着位置に対応する入
出力番号61、特殊機能ユニット4Aの2ポートメモリ
41にデータを書き込む際における2ポートメモリ41
の先頭アドレス62、2ポートメモリ41に書き込むデ
ータが格納されているデバイスメモリ12の先頭デバイ
ス63、および、転送するデータの点数64から構成さ
れる。なお、命令5に記述されている”FROM”はC
PUユニットが外部(この場合は特殊機能ユニット)か
らデータを取り込むことを意味し、命令6に記述されて
いる”TO”はCPUユニットが外部(この場合は特殊
機能ユニット)へデータを出力することを意味してい
る。すなわち、”FROM”および”TO”は入力/出
力命令区分を示している。FIG. 22 is a diagram showing an instruction format for the CPU unit 1 to read data from the special function unit and an instruction format for the CPU unit 1 to write data to the special function unit. In the figure, 5 is an instruction for the CPU unit 1 to read data from the special function unit 4A. This instruction 5 is an input / output number 51 corresponding to the mounting position of the special function unit 4A, and data in the 2-port memory 41 of the special function unit. Is composed of a head address 52 for reading out, a head device 53 of the device memory 12 for storing the read data, and a score 54 of data to be transferred. The first device 53 of the device memory 12 is the device memory 1
Specify the address of 2. Reference numeral 6 is an instruction for the CPU unit 1 to write data to the special function unit 4A. This instruction 6 writes data to the input / output number 61 corresponding to the mounting position of the special function unit 4A and the 2-port memory 41 of the special function unit 4A. 2 port memory 41
Head address 62, a head device 63 of the device memory 12 in which data to be written in the 2-port memory 41 is stored, and a point 64 of data to be transferred. In addition, "FROM" described in the instruction 5 is C
This means that the PU unit fetches data from the outside (in this case, the special function unit), and "TO" described in instruction 6 means that the CPU unit outputs the data to the outside (in this case, the special function unit). Means That is, "FROM" and "TO" indicate input / output instruction classification.
【0006】図23は、CPUユニット1が特殊機能ユ
ニット4Aに対しデータの書き込みを行なう命令の具体
例を示す図である。図において、6Aは入出力番号50
の位置に装着されている特殊機能ユニット4Aの2ポー
トメモリ41のアドレス2にデバイスD0の内容を1点
分書き込む命令であり、6Bは入出力番号50の位置に
装着されている特殊機能ユニット4Aの2ポートメモリ
42のアドレス8にデバイスD0の内容を1点分書き込
む命令である。FIG. 23 is a diagram showing a specific example of an instruction for the CPU unit 1 to write data to the special function unit 4A. In the figure, 6A is input / output number 50.
Is a command for writing one point of the contents of the device D0 to the address 2 of the 2-port memory 41 of the special function unit 4A mounted at the position of 6A, and 6B is the special function unit 4A mounted at the position of the input / output number 50. This is an instruction to write the contents of the device D0 for one point at the address 8 of the 2-port memory 42.
【0007】次に、具体的な動作、例えば、入出力番号
50の位置に特殊機能ユニット4Aとして2CH・D/
Aユニット(デジタル/アナログ変換機能を2つ持つ特
殊機能ユニット)を装着し、1CH目にデバイスD0の
内容に対応したアナログ値を出力したい場合のプログラ
ムについて考える。この場合、図21aに示した2ポー
トメモリの記憶内容の例からわかるように2ポートメモ
リ41Aのアドレス2にデバイスD0の内容を書き込め
ばよい。つまり、図23におけるプログラム6Aとな
る。ユーザはプログラム装置2により、図23における
プログラム6Aを作成し、CPUユニット1のプログラ
ムメモリ11に通信ケーブル3を介してそのプログラム
6Aを書き込めばよい。Next, a specific operation, for example, 2CH.D / as the special function unit 4A at the position of the input / output number 50
Consider a program in which an A unit (special function unit having two digital / analog conversion functions) is mounted and an analog value corresponding to the contents of the device D0 is output on the 1st CH. In this case, as can be seen from the example of the stored contents of the 2-port memory shown in FIG. 21a, the contents of the device D0 may be written in address 2 of the 2-port memory 41A. That is, the program 6A in FIG. 23 is obtained. The user may create the program 6A in FIG. 23 by the programming device 2 and write the program 6A in the program memory 11 of the CPU unit 1 via the communication cable 3.
【0008】次に、実際にCPUユニット1がプログラ
ムメモリ11に書かれたプログラム6Aを実行する時
は、そのプログラムで指定された入出力番号50の位置
に装着されている2CH・D/Aユニットの2ポートメ
モリ41Aのアドレス2にデバイスメモリ12のデバイ
スD0の内容を書き込むようにし、2CH・D/Aユニ
ットは2ポートメモリ41Aのアドレス2の内容に応じ
たアナログ値を出力する。Next, when the CPU unit 1 actually executes the program 6A written in the program memory 11, the 2CH.D / A unit mounted at the position of the input / output number 50 designated by the program. The contents of the device D0 of the device memory 12 are written in the address 2 of the 2-port memory 41A of the above, and the 2CH D / A unit outputs the analog value according to the contents of the address 2 of the 2-port memory 41A.
【0009】次に、例えば、入出力番号50の位置に8
CH・D/Aユニット(デジタル/アナログ変換機能を
8つ持つ特殊機能ユニット)を装着し、1CH目にデバ
イスD0の内容に対応したアナログ値を出力したい場合
のプログラムについて考える。この場合、図21bの2
ポートメモリの記憶内容の例から明らかなように2ポー
トメモリ41Bのアドレス8にデバイスD0の内容を書
き込めばよい、つまり、図23におけるプログラム6B
となる。ユーザ゛はプログラム装置2により、図23に
おけるプログラム6Bを作成し、CPUユニット1のプ
ログラムメモリ11に通信ケーブル3を介してそのプロ
グラム6Bを書き込む。次に、実際にCPUユニット1
が、プログラムメモリ11に書かれたプログラム6Bを
実行する時は、そのプログラムで指定された入出力番号
50の位置に装着されている8CH・D/Aユニットに
おける2ポートメモリ41Bのアドレス8にデバイスメ
モリのデバスイD0の内容を書き込む。8CH・D/A
ユニットは2ポートメモリ41Bのアドレス8の内容に
応じたアナログ゛値を出力する。Next, for example, at the position of input / output number 50, 8
Consider a program in which a CH / D / A unit (special function unit having eight digital / analog conversion functions) is mounted and an analog value corresponding to the contents of the device D0 is output on the 1st CH. In this case, 2 in FIG.
As is clear from the example of the stored contents of the port memory, it suffices to write the contents of the device D0 to the address 8 of the 2-port memory 41B, that is, the program 6B in FIG.
Becomes The user's program 2 is used to create the program 6B shown in FIG. 23, and the user writes the program 6B in the program memory 11 of the CPU unit 1 via the communication cable 3. Next, actually the CPU unit 1
However, when executing the program 6B written in the program memory 11, the device is set to the address 8 of the 2-port memory 41B in the 8CH D / A unit mounted at the position of the input / output number 50 designated by the program. Write the contents of memory device D0. 8CH / D / A
The unit outputs an analog value according to the contents of address 8 of the 2-port memory 41B.
【0010】さらに、例えば、入出力番号50の位置に
表示機能を持つ表示ユニット、例えば、特殊機能ユニッ
ト4Aを装着し、1行3列目にデバイスD0の内容に対
応した文字を表示したい場合のプログラムについて考え
る。この場合、図21cの2ポートメモリの記憶内容の
例からわかるように2ポートメモリ41Cのアドレス2
にデバイスD0の内容を書き込めばよいく、図23にお
けるプログラム6Aのようになる。ユーザは、プログラ
ム装置2により、図23におけるプログラム6Aを作成
し、CPUユニット1のプログラムメモリ11に通信ケ
ーブル3を介してそのプログラム6Aを書き込み、実際
にCPUユニット1が、プログラムメモリ11に書かれ
たプログラム6Aを実行する時は、そのプログラム6A
で指定された入出力番号50の位置に装着されている表
示ユニットの2ポートメモリ41Cのアドレス2にデバ
イスメモリのデバイスD0の内容を書き込むようにす
る。その結果、表示ユニットは2ポートメモリ41Cの
アドレス2の内容に応じた文字を表示する。Further, for example, when a display unit having a display function, for example, a special function unit 4A is mounted at the position of the input / output number 50 and it is desired to display a character corresponding to the contents of the device D0 in the first row and third column. Think about the program. In this case, as can be seen from the example of the stored contents of the 2-port memory in FIG.
It suffices if the contents of the device D0 are written in, as shown in the program 6A in FIG. The user creates the program 6A in FIG. 23 by the programming device 2, writes the program 6A in the program memory 11 of the CPU unit 1 via the communication cable 3, and the CPU unit 1 is actually written in the program memory 11. When executing program 6A
The contents of the device D0 of the device memory are written to the address 2 of the 2-port memory 41C of the display unit mounted at the position of the input / output number 50 designated by. As a result, the display unit displays the character corresponding to the contents of address 2 of the 2-port memory 41C.
【0011】このように、従来は特殊機能ユニットに対
する命令がFROM、TO等の数種類しかなく、これら
の命令で全ての特殊機能ユニットに対する処理するよう
にしていたため、プログラム6Aは、ある時は1CH目
のアナログ出力命令になり、ある時は表示命令になり、
プログラムを見ただけでは命令の機能が分かりにくいと
いう問題点がある。また、D/Aユニットの1CH目に
アナログ出力を行う時、D/Aユニットのチャネル数の
相違によりプログラム6Aになったり、プログラム6B
になったりする(16CH・D/Aユニットであればま
た別のプログラムになる)。As described above, conventionally, there are only a few kinds of commands for the special function unit such as FROM and TO, and all the special function units are processed by these commands. It becomes an analog output command of, and sometimes it becomes a display command,
There is a problem that the function of the instruction is difficult to understand just by looking at the program. When analog output is performed on the 1st CH of the D / A unit, the program 6A or the program 6B may be generated due to the difference in the number of channels of the D / A unit.
(If it is a 16CH D / A unit, it will be another program).
【0012】[0012]
【発明が解決しようとする課題】従来のシーケンス制御
方法は以上のように特殊機能ユニットに対する命令の種
類が少なく、これらの少ない命令で特殊機能ユニットに
対する全ての処理が行なわれるので、同じ命令が全く別
の動作を指令し、また、同じ動作に対する命令の形式が
異なり、命令形式を見てその命令が指令する動作が全く
分からず、また、2ポートメモリのアドレスを意識して
プログラムを作成せねばならず、プログラムの作成が容
易でないなどの問題点があった。また、特殊機能ユニッ
トを新たに開発したり、機能に変更を加えた場合等にお
いて、システムプログラムの変更等の煩わしい作業が伴
う等の問題点があった。As described above, the conventional sequence control method has a small number of types of instructions for the special function unit, and all the processing for the special function unit is performed with these few instructions. If another command is issued and the command format for the same motion is different, the command command does not show the command command at all, and the program must be created in consideration of the address of the 2-port memory. However, there is a problem that it is not easy to create a program. Further, when a special function unit is newly developed or a function is changed, there is a problem that a complicated work such as changing a system program is involved.
【0013】この発明は上記のような問題点を解消する
ためになされたもので、特殊機能ユニットの2ポートメ
モリのアドレスを意識せずにプログラムが作成できると
ともに、その命令形式をみてその命令が行なう動作が容
易に分かりプログラムの可読性がよく、また、新たに開
発した特殊機能ユニットの使用や機能の変更等が容易に
できるシーケンス制御方法を得ることを目的とする。The present invention has been made in order to solve the above problems, and a program can be created without being aware of the address of the 2-port memory of the special function unit, and its instruction format It is an object of the present invention to obtain a sequence control method in which the operation to be performed is easy to understand, the readability of the program is good, and the newly developed special function unit can be used and the function can be changed easily.
【0014】[0014]
【課題を解決するための手段】この発明に係るシーケン
ス制御方法は、D/A変換ユニット等の特殊機能ユニッ
トの命令であることを示す第1コードと、特殊機能ユニ
ットの機能を示すとともに特殊機能ユニットに複数のチ
ャネルがあり使用するチャネルを指定する必要がある場
合にはさらにチャネル番号情報を有する第2コードと、
特殊機能ユニットの装着位置と、デバイスメモリのアド
レスや印刷位置情報等の作用情報と、が記述された特殊
機能命令を有するシーケンスプログラムをCPUユニッ
トが実行し、制御対象からの入力情報、制御対象に設け
られたコイル等の出力機器を制御する出力情報、およ
び、内部情報を記憶するデバイスメモリの記憶内容にも
とづき制御対象を制御するシーケンス制御方法であっ
て、特殊機能ユニットに設けられCPUユニットからア
クセス可能な第1記憶手段に、第2コード、特殊機能ユ
ニットの双方向アクセス記憶手段のアドレス、および、
転送点数等からなる固有情報が特殊機能ユニットにより
処理可能な所定数の特殊機能命令について予め格納され
る段階、シーケンスプログラムをCPUユニットが実行
し特殊機能命令が呼び出される段階、呼び出された特殊
機能命令に対応する固有情報が第1記憶手段に格納され
ているか否か第1記憶手段の記憶内容にもとづきCPU
ユニットが判定し、一致するものが格納されていればそ
の固有情報と特殊機能命令に記述されている情報とにも
とづき特殊機能命令に対応する入力/出力命令区分と特
殊機能ユニットの装着位置とデバイスメモリのアドレス
と双方向アクセス記憶手段のアドレスと転送点数とを有
するシーケンスプログラム命令をCPUユニットが実行
し特殊機能ユニットを介してこのシーケンスプログラム
命令にもとづく所定の処理を行う段階、を有するように
したものである。A sequence control method according to the present invention includes a first code indicating a command of a special function unit such as a D / A conversion unit, a function of the special function unit and a special function. If the unit has multiple channels and it is necessary to specify the channel to be used, a second code further having channel number information,
The CPU unit executes the sequence program having the special function command in which the mounting position of the special function unit and the action information such as the device memory address and the print position information are described, and the input information from the control target and the control target are set. A sequence control method for controlling a control target based on output information for controlling an output device such as an installed coil and stored contents of a device memory for storing internal information, which is accessed from a CPU unit provided in a special function unit. A possible first storage means, a second code, the address of the bidirectional access storage means of the special function unit, and
Specific information such as the number of transfer points is stored in advance for a predetermined number of special function instructions that can be processed by the special function unit, a step in which the CPU unit executes a sequence program to call the special function instruction, and a called special function instruction Whether or not the unique information corresponding to is stored in the first storage means based on the stored contents of the first storage means
If the unit judges and if a match is stored, the input / output command category corresponding to the special function command, the mounting position of the special function unit, and the device based on the unique information and the information described in the special function command. The CPU unit executes a sequence program instruction having an address of the memory, an address of the bidirectional access storage means, and the number of transfer points, and performs a predetermined process based on the sequence program instruction via the special function unit. It is a thing.
【0015】また、D/A変換ユニット等の特殊機能ユ
ニットの命令であることを示す第1コードと、特殊機能
ユニットの機能を示すとともに特殊機能ユニットに複数
のチャネルがあり使用するチャネルを指定する必要があ
る場合にはさらにチャネル番号情報を有する第2コード
と、特殊機能ユニットの装着位置と、デバイスメモリの
アドレスや印刷位置情報等の作用情報と、が記述された
特殊機能命令を有するシーケンスプログラムをCPUユ
ニットが実行し、制御対象からの入力情報、制御対象に
設けられたコイル等の出力機器を制御する出力情報、お
よび、内部情報を記憶するデバイスメモリの記憶内容に
もとづき制御対象を制御するシーケンス制御方法であっ
て、特殊機能ユニットに設けられCPUユニットからア
クセス可能な第1記憶手段に、第2コード、特殊機能ユ
ニットの双方向アクセス記憶手段のアドレス、および、
転送点数等からなる固有情報が特殊機能ユニットにより
処理可能な所定数の特殊機能命令について予め格納され
る段階、第1記憶手段の記憶内容がCPUユニットの第
2記憶手段に転送される段階、シーケンスプログラムを
CPUユニットが実行し特殊機能命令が呼び出される段
階、呼び出された特殊機能命令に対応する固有情報が第
2記憶手段に格納されているか否か第2記憶手段の記憶
内容にもとづきCPUユニットが判定し、一致するもの
が格納されていればその固有情報と特殊機能命令に記述
されている情報とにもとづき特殊機能命令に対応する入
力/出力命令区分と特殊機能ユニットの装着位置とデバ
イスメモリのアドレスと双方向アクセス記憶手段のアド
レスと転送点数とを有するシーケンスプログラム命令を
CPUユニットが実行し特殊機能ユニットを介してこの
シーケンスプログラム命令にもとづく所定の処理を行う
段階、を有するようにしたものである。Also, a first code indicating that it is an instruction of a special function unit such as a D / A conversion unit and the function of the special function unit, and the special function unit has a plurality of channels, and specifies a channel to be used. If necessary, a sequence program having a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information are described. Is executed by the CPU unit, and the controlled object is controlled based on the input information from the controlled object, the output information for controlling the output device such as the coil provided in the controlled object, and the stored contents of the device memory for storing the internal information. A first sequence control method provided in a special function unit and accessible from a CPU unit The 憶 means, second code, address of the bidirectional access memory means of the special function units, and,
A step in which unique information such as the number of transfer points is stored in advance for a predetermined number of special function commands that can be processed by the special function unit, a step in which the storage content of the first storage means is transferred to the second storage means of the CPU unit, a sequence When the CPU unit executes the program and the special function instruction is called, whether the unique information corresponding to the called special function instruction is stored in the second storage unit or not is determined based on the stored contents of the second storage unit. If a match is stored, the input / output command category corresponding to the special function command, the mounting position of the special function unit, and the device memory are determined based on the unique information and the information described in the special function command. The CPU unit issues a sequence program instruction having an address, an address of the bidirectional access storage means, and a transfer point. Line and through the special function module performing a predetermined processing based on the sequence program instructions, in which to have a.
【0016】また、D/A変換ユニット等の特殊機能ユ
ニットの命令であることを示す第1コードと、特殊機能
ユニットの機能を示すとともに特殊機能ユニットに複数
のチャネルがあり使用するチャネルを指定する必要があ
る場合にはさらにチャネル番号情報を有する第2コード
と、特殊機能ユニットの装着位置と、デバイスメモリの
アドレスや印刷位置情報等の作用情報と、が記述された
特殊機能命令を有するシーケンスプログラムをCPUユ
ニットが実行し、制御対象からの入力情報、制御対象に
設けられたコイル等の出力機器を制御する出力情報、お
よび、内部情報を記憶するデバイスメモリの記憶内容に
もとづき制御対象を制御するシーケンス制御方法であっ
て、特殊機能ユニットに設けられCPUユニットからア
クセス可能な第1記憶手段に、第2コードと、特殊機能
命令に対応する入力/出力命令区分と特殊機能ユニット
の装着位置とデバイスメモリのアドレスと特殊機能ユニ
ットに設けられた双方向アクセス記憶手段のアドレスと
転送点数とを有するシーケンスプログラム命令とが特殊
機能ユニットにより処理可能な所定数の特殊機能命令に
ついて予め格納される段階、シーケンスプログラムをC
PUユニットが実行し特殊機能命令が呼び出される段
階、呼び出された特殊機能命令に対応する第2コード
と、特殊機能命令に対応する所定数のシーケンスプログ
ラム命令とが第1記憶手段に格納されているか否か第1
記憶手段の記憶内容にもとづきCPUユニットが判定
し、一致するものが格納されていればその所定数のシー
ケンスプログラム命令をCPUユニットが実行し特殊機
能ユニットを介してこの所定数のシーケンスプログラム
命令にもとづく所定の処理を行う段階、を有するように
したものである。A first code indicating an instruction of a special function unit such as a D / A conversion unit and a function of the special function unit are shown, and the special function unit has a plurality of channels and specifies a channel to be used. If necessary, a sequence program having a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information are described. Is executed by the CPU unit, and the controlled object is controlled based on the input information from the controlled object, the output information for controlling the output device such as the coil provided in the controlled object, and the stored contents of the device memory for storing the internal information. A first sequence control method provided in a special function unit and accessible from a CPU unit The storage means includes the second code, the input / output instruction classification corresponding to the special function instruction, the mounting position of the special function unit, the address of the device memory, the address of the bidirectional access storage means provided in the special function unit, and the number of transfer points. And a sequence program instruction having a predetermined number of special function instructions that can be processed by the special function unit, the sequence program being C
When the PU unit executes and the special function instruction is called, whether the second code corresponding to the called special function instruction and the predetermined number of sequence program instructions corresponding to the special function instruction are stored in the first storage means. No 1
The CPU unit judges on the basis of the stored contents of the storage means, and if the coincident ones are stored, the CPU unit executes the predetermined number of sequence program instructions, and based on the predetermined number of sequence program instructions via the special function unit. And a step of performing a predetermined process.
【0017】また、D/A変換ユニット等の特殊機能ユ
ニットの命令であることを示す第1コードと、特殊機能
ユニットの機能を示すとともに特殊機能ユニットに複数
のチャネルがあり使用するチャネルを指定する必要があ
る場合にはさらにチャネル番号情報を有する第2コード
と、特殊機能ユニットの装着位置と、デバイスメモリの
アドレスや印刷位置情報等の作用情報と、が記述された
特殊機能命令を有するシーケンスプログラムをCPUユ
ニットが実行し、制御対象からの入力情報、制御対象に
設けられたコイル等の出力機器を制御する出力情報、お
よび、内部情報を記憶するデバイスメモリの記憶内容に
もとづき制御対象を制御するシーケンス制御方法であっ
て、特殊機能ユニットに設けられCPUユニットからア
クセス可能な第1記憶手段に、第2コードと、特殊機能
命令に対応する入力/出力命令区分と特殊機能ユニット
の装着位置とデバイスメモリのアドレスと特殊機能ユニ
ットに設けられた双方向アクセス記憶手段のアドレスと
転送点数とを有する所定数のシーケンスプログラム命令
とが特殊機能ユニットにより処理可能な所定数の特殊機
能命令について予め格納される段階、第1記憶手段の記
憶内容がCPUユニットの第2記憶手段に転送される段
階、シーケンスプログラムをCPUユニットが実行し特
殊機能命令が呼び出される段階、呼び出された特殊機能
命令に対応する第2コードと、特殊機能命令に対応する
所定数のシーケンスプログラム命令とが第2記憶手段に
格納されているか否か第2記憶手段の記憶内容にもとづ
きCPUユニットが判定し、一致するものが格納されて
いればその所定数のシーケンスプログラム命令をCPU
ユニットが実行し特殊機能ユニットを介してこの所定数
のシーケンスプログラム命令にもとづく所Further, a first code indicating a command of a special function unit such as a D / A conversion unit and a function of the special function unit are shown, and the special function unit has a plurality of channels and specifies a channel to be used. If necessary, a sequence program having a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information are described. Is executed by the CPU unit, and the controlled object is controlled based on the input information from the controlled object, the output information for controlling the output device such as the coil provided in the controlled object, and the stored contents of the device memory for storing the internal information. A first sequence control method provided in a special function unit and accessible from a CPU unit The storage means includes the second code, the input / output instruction classification corresponding to the special function instruction, the mounting position of the special function unit, the address of the device memory, the address of the bidirectional access storage means provided in the special function unit, and the number of transfer points. And a predetermined number of sequence program instructions having the following are stored in advance for a predetermined number of special function instructions that can be processed by the special function unit, the stored contents of the first storage means are transferred to the second storage means of the CPU unit. Second stage, a stage in which the CPU unit executes the sequence program and the special function command is called, a second code corresponding to the called special function command, and a predetermined number of sequence program commands corresponding to the special function command. Is stored in the CPU, the CPU unit determines based on the contents stored in the second storage means, and the CPU unit determines whether or not they match. The predetermined number of sequence program instructions CPU if stored ones
Where the unit executes and is based on this predetermined number of sequence program instructions via the special function unit.
【0018】また、シーケンスプログラム命令はマイコ
ンプログラム命令により構成されるようにしたものであ
る。The sequence program command is composed of a microcomputer program command.
【0019】また、第1メモリは双方向アクセス記憶手
段の所定のエリアであるようにしたものである。Also, the first memory is a predetermined area of the bidirectional access storage means.
【0020】[0020]
【発明の実施の形態】実施例1. 以下、この発明の一実施例を図について説明する。シー
ケンス制御装置としてのプログラマブルコントローラの
構成は従来例において説明した図7のものとほぼ同一な
ので説明を省略する。BEST MODE FOR CARRYING OUT THE INVENTION Embodiment 1. An embodiment of the present invention will be described below with reference to the drawings. The configuration of the programmable controller as the sequence control device is almost the same as that of the conventional example shown in FIG.
【0021】図1は、特殊機能ユニット対応命令7の形
式を示す図であり、Z_の後には任意の命令名を記述で
きることを示している。図において、71は特殊機能ユ
ニットの装着位置に対応する入出力番号、72は必要に
応じ記述する部分である。FIG. 1 is a diagram showing the format of the special function unit corresponding instruction 7, and shows that an arbitrary instruction name can be described after Z_. In the figure, 71 is an input / output number corresponding to the mounting position of the special function unit, and 72 is a portion described as necessary.
【0022】特殊機能ユニット対応命令7における命令
記号Z_・・・は特殊機能部対応命令であること及びそ
の種別を表わすものであり、特殊機能部対応命令である
ことを表わす第1コードであるZ_と、特殊機能種別を
表わす第2コードである・・・(例えば1CH目にアナ
ログ値を出力する命令であれば上記・・・の部分にAN
ALOG_1の記号が記載される)から構成されてい
る。The instruction symbol Z _... in the special function unit corresponding instruction 7 indicates the special function corresponding instruction and its type, and is the first code Z_ indicating the special function corresponding instruction. Is the second code indicating the special function type ... (For example, if the command is to output an analog value on the 1st CH, the above-mentioned ...
ALOG_1 symbol is described).
【0023】図2は、特殊機能ユニット対応命令の例を
示す図である。図において、7Aは入出力番号50の位
置に装着されているD/Aユニットの1CH目からデバ
イスD0の内容にもとづくアナログ信号を出力させる命
令であり、7Bは入出力番号50の位置に装着されてい
る表示ユニットの1行3列目にデバイスD0の内容を表
示させる命令である。FIG. 2 is a diagram showing an example of a special function unit corresponding instruction. In the figure, 7A is an instruction to output an analog signal based on the contents of the device D0 from the 1st CH of the D / A unit attached to the input / output number 50 position, and 7B is attached to the input / output number 50 position. Is a command to display the contents of the device D0 on the 1st row and 3rd column of the display unit.
【0024】図3a〜eは、CPUユニット1/特殊機
能ユニット4Aの両方からアクセスできる2ポートメモ
リ41の記憶内容の一例を示す図である。図において、
41AAは特殊機能ユニットの2ポートメモリ41の記
憶内容の一般例を示し、41BAは2CH・D/Aユニ
ットまたは8CH・D/Aユニットの1CH目にアナロ
グ出力を行なう場合において2CH・D/Aユニットの
2ポートメモリ41または8CH・D/Aユニットの2
ポートメモリ41の記憶内容の一例を示し、41CAは
表示ユニットの2ポートメモリ41に誤って2CH・D
/Aユニットや8CH・D/Aユニット用の指令を出力
したときの表示ユニットの2ポートメモリ41の記憶内
容の一例を示し、41DAは表示ユニットの表示位置を
変更した時の表示ユニットの2ポートメモリ41の記憶
内容の一例を示し、41EAはD0の内容を表示したと
きの表示ユニットの2ポートメモリ41の記憶内容の一
例を示している。3A to 3E are views showing an example of the stored contents of the 2-port memory 41 which can be accessed from both the CPU unit 1 / special function unit 4A. In the figure,
41AA indicates a general example of the stored contents of the 2-port memory 41 of the special function unit, and 41BA indicates the 2CH • D / A unit when analog output is performed on the 1CH of the 2CH • D / A unit or 8CH • D / A unit. 2 port memory 41 or 2 of 8CH D / A unit
An example of the stored contents of the port memory 41 is shown. 41CA is erroneously stored in the 2 port memory 41 of the display unit as 2CH.D.
Shows an example of the stored contents of the 2-port memory 41 of the display unit when a command for the / A unit or the 8CH / D / A unit is output. 41DA is the 2-port of the display unit when the display position of the display unit is changed. An example of the stored contents of the memory 41 is shown, and 41EA shows an example of the stored contents of the 2-port memory 41 of the display unit when the contents of D0 are displayed.
【0025】図4は図7に示したプログラマブルコント
ローラおよびプログラム装置の動作フローチャートであ
り、フローAはプログラム装置の2の、フローBはCP
Uユニット1の、フローCは特殊機能装置4Aの動作フ
ローをそれぞれ示している。FIG. 4 is an operation flow chart of the programmable controller and the program device shown in FIG. 7. Flow A is the program device 2 and flow B is the CP.
The flow C of the U unit 1 shows the operation flow of the special function device 4A.
【0026】次に、動作について図4に示したフローチ
ャートに従って説明する。プログラム装置2でプログラ
ム作成を行なう時に、命令ステップの命令名の入力の初
めにZ_と入力されると、その後は特殊機能部4で予め
定義され、解読可能な任意の命令名の入力を受け付け可
能としておく。フローAにおいて、ステップ101でプ
ログラム装置2により図1に示す形式のプログラムを作
成し、ステップ102にてCPUユニット1のプログラ
ムメモリ11に通信ケーブル3を介して上記プログラム
を転送する。次に、フローBにおいて、CPUユニット
1はステップ111にて転送されたシーケンスプログラ
ムをプログラムメモリ11に格納し、ステップ112で
最初のプログラムステップをアクセスして解読し、ステ
ップ113でその命令の命令名の先頭2文字がZ_であ
れば特殊機能ユニット対応命令であると判別する。特殊
機能ユニット対応の命令でなければステップ118にて
通常のシーケンス処理を行なう。Next, the operation will be described with reference to the flowchart shown in FIG. When a program is created by the programming device 2, if Z_ is entered at the beginning of the input of the instruction name of the instruction step, then the special function unit 4 can predefine and accept the input of any decipherable instruction name. I will keep it. In the flow A, in step 101, the program device 2 creates a program of the format shown in FIG. 1, and in step 102, the program is transferred to the program memory 11 of the CPU unit 1 via the communication cable 3. Next, in the flow B, the CPU unit 1 stores the sequence program transferred in step 111 in the program memory 11, accesses and decodes the first program step in step 112, and in step 113 the instruction name of the instruction. If the first two characters of Z are Z_, it is determined that the command is a special function unit corresponding command. If it is not an instruction corresponding to a special function unit, a normal sequence process is performed at step 118.
【0027】次に、CPUユニット1はステップ11
4、115で特殊機能ユニット対応命令であると判別し
た命令およびその命令で指定されたアドレスにおいてデ
バイスメモリ12にデータが格納されていればその内容
をその命令で指定された入出力番号の位置に装着された
特殊機能ユニット4A内の2ポートメモリ41に格納す
るとともに、ステップ116で特殊機能ユニット4Aに
実行指令としての割り込をかける。この割り込みをフロ
ーCにおけるステップ121にて特殊機能ユニット4A
が認識すると、特殊機能ユニット4Aはステップ122
で2ポートメモリ41に格納された上記特殊機能ユニッ
ト対応命令を読み込み、この命令内容が該特殊機能ユニ
ット4Aで定義された命令であるか調べ、そうでなけれ
ばエラーとし、ステップ127でエラー処理を行ない、
エラーでなければステップ124でその命令を解読し、
ステップ125で定められた処理を実行する。このとき
必要であれば、2ポートメモリ41に格納されたデバイ
スデータ内容を用いて実行する。Next, the CPU unit 1 executes step 11
If data is stored in the device memory 12 at the instruction determined to be the special function unit corresponding instruction at 4 and 115 and the address designated by the instruction, the content is stored in the position of the input / output number designated by the instruction. The data is stored in the two-port memory 41 in the mounted special function unit 4A, and in step 116, the special function unit 4A is interrupted as an execution command. This interrupt is sent to the special function unit 4A in step 121 of flow C.
When the special function unit 4A recognizes
Then, the instruction corresponding to the special function unit stored in the 2-port memory 41 is read, and it is checked whether or not the content of this instruction is the instruction defined by the special function unit 4A. If not, an error occurs, and error processing is performed in step 127. Done,
If there is no error, the instruction is decoded in step 124,
The process defined in step 125 is executed. At this time, if necessary, the device data contents stored in the 2-port memory 41 are used for execution.
【0028】次に、ステップ126で特殊機能ユニット
4Aは正常に実行したか/エラーであったか等の情報及
びCPUユニット1に返すべきデータがあればそのデー
タを2ポートメモリ41に格納し、CPUユニット1に
より実行結果をアクセス可能とする。フローBにおける
ステップ117で、CPUユニット1は実行結果に基づ
き定められ処理を行い、次ステップ処理、即ちステップ
112へ戻り、次の命令の実行に移る。Next, at step 126, the special function unit 4A stores information such as whether the special function unit 4A has executed normally / has an error, and if there is data to be returned to the CPU unit 1, the data is stored in the 2-port memory 41, and the CPU unit is stored. 1 makes the execution result accessible. At step 117 in the flow B, the CPU unit 1 performs a process determined based on the execution result, returns to the next step process, that is, step 112, and executes the next instruction.
【0029】定められた処理とは例えば、正常に実行し
た場合は無処理、エラーであった場合はエラー表示、C
PUユニット1に返すべきデータがあった場合は、デバ
イスメモリ12にそのデータを転送する等である。The predetermined processing includes, for example, no processing when executed normally, error display when there is an error, and C
When there is data to be returned to the PU unit 1, the data is transferred to the device memory 12 or the like.
【0030】特殊機能ユニット対応命令に記述されてい
る入出力番号の装着位置に装着されている特殊機能ユニ
ットが2CH・D/Aユニット(デジタル/アナログ変
換機能を2つ持つ特殊機能ユニット)の場合は、Z_A
NALOG_1は1CH目にアナログ値を出力する命令
であり、Z_ANALOG_2は2CH目にアナログ値
を出力する命令である。同様に、8CH・D/Aユニッ
ト(デジタル/アナログ変換機能を8つ持つ特殊機能ユ
ニット)の場合にも、Z_ANALOG_1は1CH目
にアナログ値を出力する命令であり、Z_ANALOG
_2は2CH目にアナログ値を出力する命令である。ま
た、表示ユニットの場合は、LOCATEが表示位置を
指定する命令、PRINTが表示する命令である。When the special function unit mounted at the mounting position of the input / output number described in the special function unit corresponding command is the 2CH • D / A unit (special function unit having two digital / analog conversion functions) Is Z_A
NALOG_1 is a command to output an analog value on 1CH, and Z_ANALOG_2 is a command to output an analog value on 2CH. Similarly, in the case of the 8CH D / A unit (special function unit having eight digital / analog conversion functions), Z_ANALOG_1 is an instruction to output an analog value on the 1st CH, and Z_ANALOG
_2 is an instruction to output an analog value on the 2nd CH. In the case of a display unit, LOCATE is an instruction to specify a display position and PRINT is an instruction to display.
【0031】次に、入出力番号50の位置に2CHD/
Aユニット(デジタル/アナログ変換機能を2つ持つ特
殊機能ユニット)を装着し、1CH目にデバイスD0の
内容に対応したアナログ値を出力したい場合のプログラ
ムについて考える。Next, at the position of input / output number 50, 2CHD /
Consider a program in which an A unit (special function unit having two digital / analog conversion functions) is mounted and an analog value corresponding to the contents of the device D0 is output on the 1st CH.
【0032】この場合、プログラムは図2に示したプロ
グラムステップ7Aとなる。ユーザは、プログラム装置
により、図2のプログラム7Aを作成し、CPUユニッ
ト1のプログラムメモリ11に通信ケーブル3を介して
プログラム7Aを書き込む。次に、実際にCPUユニッ
ト1がプログラムメモリ11に書かれたプログラム7A
を実行する時には、その命令の命令名の先頭2文字がZ
_であることを確認し、特殊機能ユニット対応命令であ
ると判別する。次に、CPUユニット1は、そのプログ
ラムおよびその命令で指定されたデバイスメモリ12の
D0の内容を、その命令で指定された入出力番号50の
位置に装着された2CH・D/Aユニット内の2ポート
メモリ41に格納すると共に2CHD/Aユニットに割
り込みをかける。この割り込みを2CH・D/Aユニッ
トが認識すると、2CH・D/Aユニットは、2ポート
メモリ41に格納された特殊機能ユニット対応命令が2
CH・D/Aユニットで定義された命令であるか調べ、
1CH目にデバイスメモリの内容をアナログ値として出
力する命令であると判断したら、2ポートメモリ41に
格納されたデバイスメモリ12のD0の内容に応じたア
ナログ値を1CHに出力する。In this case, the program is the program step 7A shown in FIG. The user creates the program 7A of FIG. 2 by the programming device and writes the program 7A in the program memory 11 of the CPU unit 1 via the communication cable 3. Next, the program 7A in which the CPU unit 1 is actually written in the program memory 11
, The first two characters of the instruction name of the instruction are Z
_ Is confirmed, and it is determined that the command is a special function unit compatible command. Next, the CPU unit 1 stores the program and the contents of D0 of the device memory 12 designated by the instruction in the 2CH.D / A unit mounted at the position of the input / output number 50 designated by the instruction. It stores it in the 2-port memory 41 and interrupts the 2CHD / A unit. When the 2CH • D / A unit recognizes this interrupt, the 2CH • D / A unit detects that the special function unit corresponding instruction stored in the 2-port memory 41 is 2
Check if it is an instruction defined in the CH / D / A unit,
If it is determined that the instruction is to output the content of the device memory as an analog value on the 1st CH, the analog value according to the content of D0 of the device memory 12 stored in the 2-port memory 41 is output to the 1CH.
【0033】次に、例えば、入出力番号50の位置に8
CH・D/Aユニット(デジタル/アナログ変換機能を
8つ持つ特殊機能ユニット)を装着し、1CH目にデバ
イスD0の内容に対応したアナログ値を出力したい場合
のプログラムについて考える。この場合も、上述の場合
と同様にプログラムは図2の命令7Aとなり命令の実行
動作も全く同様になる。Next, for example, 8 at the position of input / output number 50
Consider a program in which a CH / D / A unit (special function unit having eight digital / analog conversion functions) is mounted and an analog value corresponding to the contents of the device D0 is output on the 1st CH. Also in this case, the program becomes the instruction 7A in FIG. 2 as in the case described above, and the operation of executing the instruction is also the same.
【0034】このように、同様な機能を持つ特殊機能ユ
ニット対応命令はZ_ANALOG_1と言う同じ命令
名となり、また、命令名を見て1CH目にアナログ値を
出力する命令であることも容易に分かる。As described above, the special function unit corresponding command having the similar function has the same command name as Z_ANALOG_1, and it can be easily understood that the command name is output and the analog value is output to the first channel.
【0035】実施例2. 次に、この発明の他の実施例を図について説明する。な
お、プログラマブルコントローラの構成は、従来例およ
び実施例1で説明した図7のものとほぼ同一であり説明
を省略する。Example 2. Next, another embodiment of the present invention will be described with reference to the drawings. The configuration of the programmable controller is almost the same as that of FIG. 7 described in the conventional example and the first embodiment, and the description thereof will be omitted.
【0036】図5は、CPUユニット/特殊機能ユニッ
トの両方からアクセスできる2ポートメモリ41の記憶
内容(特殊機能ユニット対応命令情報の内容)の一例を
示す図である。図において、41ABは特殊機能ユニッ
トの一般例を示している。メモリはバイト単位であり、
すべての特殊機能ユニットにおける2ポートメモリ41
の記憶内容はこのような形式になっている。アドレス0
にはこのユニット定義されている特殊機能ユニット対応
命令の総数4120が格納され、以後に各特殊機能ユニ
ット対応命令の情報が格納される。アドレス1には一番
目に定義された特殊機能ユニット対応命令の命令名41
21aが文字コードで格納され、アドレス11にはこの
命令で定義されるデバイスメモリの数4121bが格納
され、アドレス12にはデバイスメモリ12の使用可能
な種類4121cがコードに変換されて格納される。ア
ドレス13には読み出し/書き込みの区分4121dが
格納され、アドレス14にはアクセスする2ポートメモ
リ41の先頭アドレス4121eが格納され、アドレス
15には2ポートメモリの先頭アドレスから読み出し/
書き込みを行う個数4121fが格納される。アドレス
16には読み出し/書き込みを行うときにCPUユニッ
トと特殊機能ユニット間でやりとりするハンドシェイク
信号とそのON/OFF状態4121gが格納され、ア
ドレス17には命令を実行できるか否かを示すフラグ4
121hが格納される。以上のように1つの命令の情報
は4121a〜4121hを一組とし、この1組を命令
情報4121とする。以下アドレス0に格納されている
特殊機能ユニット対応命令の総数分だけの命令のそれぞ
れについて対応する命令情報4122〜412nが格納
される。FIG. 5 is a diagram showing an example of stored contents (contents of special function unit corresponding command information) of the 2-port memory 41 which can be accessed from both the CPU unit / special function unit. In the figure, 41AB has shown the general example of a special function unit. Memory is in bytes,
2-port memory 41 in all special function units
The memory content of is in this format. Address 0
In this field, the total number of special function unit corresponding instructions 4120 defined in this unit is stored, and thereafter information of each special function unit corresponding instruction is stored. The instruction name 41 of the special function unit corresponding instruction defined first in the address 1
21a is stored as a character code, the address 11 stores the number of device memories 4121b defined by this instruction, and the address 12 stores the usable type 4121c of the device memory 12 after being converted into a code. The address 13 stores a read / write section 4121d, the address 14 stores the head address 4121e of the 2-port memory 41 to be accessed, and the address 15 reads / writes from the head address of the 2-port memory.
The number of writings 4121f is stored. The address 16 stores a handshake signal exchanged between the CPU unit and the special function unit at the time of reading / writing and its ON / OFF state 4121g, and the address 4 has a flag 4 indicating whether or not an instruction can be executed.
121h is stored. As described above, the information of one instruction is a set of 4121a to 4121h, and this one set is the instruction information 4121. Below, the instruction information 4122 to 412n corresponding to each of the instructions corresponding to the total number of the special function unit corresponding instructions stored at the address 0 is stored.
【0037】図5において、41BBは2CH・D/A
ユニットにおける2ポートメモリ41の記憶内容の一例
を示し、41CBは8CH・D/Aユニットにおける2
ポートメモリ41の記憶内容の一例を示し、41DBは
表示ユニットにおける2ポートメモリ41の記憶内容の
一例を示している。In FIG. 5, 41BB is 2CH.D / A.
An example of the storage contents of the 2-port memory 41 in the unit is shown, where 41CB is 2 in the 8CH D / A unit.
An example of the stored contents of the port memory 41 is shown, and 41DB shows an example of the stored contents of the 2-port memory 41 in the display unit.
【0038】図6は、特殊機能ユニット対応命令を実行
する時のCPUユニットの処理動作を示すフローチャー
トである。FIG. 6 is a flowchart showing the processing operation of the CPU unit when executing the special function unit corresponding instruction.
【0039】次に動作について説明する。図7に示した
プログラム装置2でプログラムを行う時、命令名の入力
の初めにZ_と入力されると、その後は任意の命令名の
入力を受け付け可能としておき、プログラム装置2によ
り図1に示すような形式のプログラムを作成し、CPU
ユニット1のプログラムメモリ11に通信ケーブル3を
介して前記プログラムを書き込む。次にCPUユニット
1はプログラムメモリ11に書かれたシーケンスプログ
ラムを実行するに際し、図6に示したフローチャートに
おけるステップ201でその命令の命令名の先頭2文字
がZ_であれば特殊機能ユニット対応命令であると判断
し、Z_以外の文字であればステップ2−8で通常の命
令の処理であるシーケンス処理を実行する。以上の動作
までは第1の発明の場合と同様である。Next, the operation will be described. When the program device 2 shown in FIG. 7 executes a program, if Z_ is entered at the beginning of the input of the command name, the input of any command name can be accepted thereafter, and the program device 2 shows the command name shown in FIG. Create a program of the form like
The program is written in the program memory 11 of the unit 1 via the communication cable 3. Next, when the CPU unit 1 executes the sequence program written in the program memory 11, if the first two characters of the instruction name of the instruction are Z_ in step 201 in the flowchart shown in FIG. If it is determined that there is a character other than Z_, a sequence process which is a normal instruction process is executed in step 2-8. The above operation is similar to that of the first invention.
【0040】次に、CPUユニット1は、ステップ20
3で特殊機能ユニット対応命令であると判別した命令が
その命令で指定されている入出力番号の位置に装着され
た特殊機能ユニット4内の2ポートメモリ41に格納さ
れている特殊機能ユニット対応命令情報からこのユニッ
トに定義された命令数4120を読み出し、その個数分
の特殊機能ユニット対応命令から文字コードが一致する
命令を検索し、ステップ203でこの命令がこの特殊機
能ユニットに定義されているかを調べる。一致する命令
が見つからなかった場合、この命令名が特殊機能ユニッ
ト側で定義されていないとしてエラーとしてステップ2
07でエラー処理を行ない、見つかった場合は定義され
ているものとして次の処理に移る。まず、ステップ20
4でその命令を実行するのに必要な情報が定義されてい
るか、つまり、命令の構成が正しいかを特殊機能ユニッ
ト対応命令情報に従って、例えばデバイスの数および種
類等を調べる。Next, the CPU unit 1 executes step 20.
The special function unit corresponding instruction stored in the 2-port memory 41 in the special function unit 4 attached to the position of the input / output number designated by the instruction is determined to be the special function unit corresponding instruction in 3 The number of instructions 4120 defined in this unit is read from the information, and the number of instructions corresponding to the special function unit is searched for an instruction having a matching character code. In step 203, it is determined whether this instruction is defined in this special function unit. Find out. If no matching instruction is found, it is judged as an error because this instruction name is not defined on the special function unit side, and step 2
Error processing is performed at 07, and if found, it is regarded as defined and the next processing is performed. First, step 20
According to the special function unit corresponding instruction information, for example, the number and type of devices are checked to see if the information necessary for executing the instruction is defined in 4, that is, whether the instruction configuration is correct.
【0041】デバイスの数はシーケンスプログラムの図
1の72で指定されるデバイスの数を、デバイスの種類
(例えば、1ビットのリレー情報、内部ワード情報、1
ビットのネットワークリレー情報、リンクレジスタ情報
等)はデバイスの数で指定したデバイスについてそれぞ
れ使用可能なデバイスの種類をF5H、F6H等、コー
ドで示している。命令の構成が正しければ、次にステッ
プ205にて、実行可/否フラグでこの命令が実行でき
るかを調べ、実行可であればステップ206で前記特殊
機能ユニット対応命令情報の読み出し/書き込みの区
別、読み出し/書き込み先頭アドレス、読み出し/書き
込み個数、ハンドシェイク信号(命令実行時ON/OF
FされるデバイスとそのON/OFF状態)等の情報に
従って処理を行なう。実行否の場合はエラーとなり、ス
テップ207で所定のエラー処理を行なう。As for the number of devices, the number of devices designated by 72 in FIG. 1 of the sequence program is determined by the type of device (eg, 1-bit relay information, internal word information, 1
Bit network relay information, link register information, etc.) indicates the type of device that can be used for each device specified by the number of devices, such as F5H, F6H, and the like. If the instruction structure is correct, then in step 205, it is checked whether or not this instruction can be executed by the execution enable / disable flag. If it is executable, in step 206 read / write discrimination of the special function unit corresponding instruction information is performed. , Read / write start address, read / write number, handshake signal (ON / OF at command execution
Processing is performed according to information such as the device to be Fed and its ON / OFF state). If it is not executed, an error occurs, and predetermined error processing is performed in step 207.
【0042】この処理が正常に終了し、また、途中エラ
ーが発生した場合はエラー表示等のエラー処理を行いス
テップ209でこの命令の処理を終了し、ステップ20
1に戻り、次の命令の実行に移る。If this processing ends normally, or if an error occurs in the middle, error processing such as error display is performed, and the processing of this instruction is ended in step 209, and then step 20
It returns to 1 and moves to the execution of the next instruction.
【0043】実施例1の場合と同様に、この実施例2の
場合にも、2CH・D/Aユニット(デジタル/アナロ
グ変換機能を2つ持つ特殊機能ユニット)では、Z_A
NALOG_1が1CH目にアナログ値を出力する命
令、Z_ANALOG_2が2CH目にアナログ値を出
力する命令である。同様に、8CH・D/Aユニット
(デジタル/アナログ変換機能を8つ持つ特殊機能ユニ
ット)では、Z_ANALOG_1が1CH目にアナロ
グ値を出力する命令、Z_ANALOG_2が2CH目
にアナログ値を出力する命令、・・・・Z_ANALO
G_8が8CH目にアナログ値を出力する命令であり、
表示ユニットにおいては、LOCATEが表示位置を指
定する命令、PRINTが表示を行う命令である。As in the case of the first embodiment, in the case of the second embodiment as well, in the 2CH.D / A unit (special function unit having two digital / analog conversion functions), Z_A
NALOG_1 is an instruction to output an analog value on CH1 and Z_ANALOG_2 is an instruction to output an analog value on CH2. Similarly, in the 8CH D / A unit (a special function unit having eight digital / analog conversion functions), Z_ANALOG_1 outputs an analog value on CH1, and Z_ANALOG_2 outputs an analog value on CH2. ... Z_ANALO
G_8 is an instruction to output an analog value on CH8,
In the display unit, LOCATE is an instruction to specify a display position, and PRINT is an instruction to display.
【0044】この時、例えば、入出力番号50の位置に
2CH・D/Aユニット(デジタル/アナログ変換機能
を2つ持つ特殊機能ユニット)を装着し、1CH目にデ
バイスD0の内容に対応したアナログ値を出力したい場
合のプログラムについて考える。この場合のプログラム
は図2に示したプログラムステップ7Aとなる。CPU
ユニット1がプログラムメモリにおけるプログラムステ
ップ7Aを実行する時は、その命令の命令名の先頭2文
字がZ_であることを調べ、特殊機能ユニット対応命令
であると判別する。At this time, for example, a 2CH D / A unit (a special function unit having two digital / analog conversion functions) is attached to the position of the input / output number 50, and the analog corresponding to the contents of the device D0 on the 1st CH. Consider a program that outputs values. The program in this case is the program step 7A shown in FIG. CPU
When the unit 1 executes the program step 7A in the program memory, it checks that the first two characters of the instruction name of the instruction are Z_ and determines that it is a special function unit corresponding instruction.
【0045】次に、CPUユニット1は、その命令で指
定された入出力番号50の位置に装着された2CH・D
/Aユニット内の2ポートメモリ41に格納された特殊
機能ユニット対応命令の数430を読み出す。このユニ
ットは4個の特殊機能ユニット対応命令が定義されてい
るものとすると4個分の命令の文字コードを順次調べ
る。この場合は1CH目対応のメモリ情報は一番目にあ
るので、この一番目のメモリ情報、即ち、特殊機能ユニ
ット対応命令の情報に基づいて処理を行なう。Next, the CPU unit 1 is mounted on the position of the input / output number 50 designated by the command, and the 2CH.D
Reads the number 430 of special function unit corresponding instructions stored in the 2-port memory 41 in the / A unit. Assuming that four special function unit corresponding instructions are defined in this unit, the character codes of the four instructions are sequentially examined. In this case, since the memory information corresponding to the 1st CH is the first memory information, the processing is performed based on this first memory information, that is, the information of the special function unit corresponding instruction.
【0046】まず、この命令におけるデバイスの指定は
1個あり、デバイスの種類はコードF5Hで示されてい
ることがわかるので、これをプログラムメモリ11の命
令のD0と比較し正しいことが確認される(D0の種別
はF5に予め定まっているものとする)。次に、読み出
し/書き込み区分、バッファメモリ先頭アドレス、読み
出し/書き込み個数、ハンドシェイク信号(0=なし)
からデバイスメモリ12のデバイスD0の内容を2ポー
トメモリ41のアドレス2に書き込む命令であると判断
し、実行可/否フラグ可(=0)によりこれを実行し、
特殊機能ユニットは2ポートメモリ41に格納されたデ
バイスメモリ12のD0の内容に応じたアナログ値を1
CHに出力する。First, since it is known that there is one device designation in this instruction and the device type is indicated by the code F5H, this is compared with the instruction D0 of the program memory 11 and it is confirmed that it is correct. (The type of D0 is assumed to be predetermined to F5). Next, read / write classification, buffer memory start address, read / write count, handshake signal (0 = none)
From the device memory 12 is determined to be an instruction to write to the address 2 of the two-port memory 41, and this is executed according to the enable / disable flag (= 0),
The special function unit sets the analog value corresponding to the content of D0 of the device memory 12 stored in the 2-port memory 41 to 1
Output to CH.
【0047】次に、例えば、入出力番号50の位置に8
CH・D/Aユニット(デジタル/アナログ変換機能を
8つ持つ特殊機能ユニット)を装着し、1CHにデバイ
スD0の内容に対応したアナログ値を出力したい場合の
プログラムについて考える。この場合も、プログラムは
図1のプログラムステップ7Aとなり、命令の実行動作
も全く同様になる。Next, for example, 8 at the position of input / output number 50
Consider a program in which a CH / D / A unit (special function unit having eight digital / analog conversion functions) is mounted and an analog value corresponding to the contents of the device D0 is output to 1CH. Also in this case, the program is the program step 7A in FIG. 1, and the operation of executing the instruction is also the same.
【0048】このように、同様な機能を持つ特殊機能ユ
ニット対応命令は、Z_ANALOG_1と言う同じ命
令名となり、また命令名を見て1CH目にアナログ値を
出力する命令であることも容易に分かる。As described above, the special function unit corresponding command having the same function has the same command name as Z_ANALOG_1, and it can be easily understood that it is a command that outputs an analog value on the first channel by looking at the command name.
【0049】実施例3. 以下、この発明の他の実施例を図8について説明する。
図8において、1はプログラマブルコントローラ全体を
制御するCPUユニット、11はシーケンスプログラム
が格納されるプログラムメモリ、12はシーケンスプロ
グラムで使われる、あるいは演算結果のデータが格納さ
れているデバイスメモリ、2はプログラムメモリ11に
格納するシーケンスプログラムを作成するプログラム装
置、3はあり、45は2ポートメモリとしてのバッファ
メモリである。Embodiment 3 FIG. Another embodiment of the present invention will be described below with reference to FIG.
In FIG. 8, 1 is a CPU unit that controls the entire programmable controller, 11 is a program memory in which a sequence program is stored, 12 is a device memory used in the sequence program, or data of operation results is stored, 2 is a program There is a programming device 3 for creating a sequence program to be stored in the memory 11, and 45 is a buffer memory as a 2-port memory.
【0050】特殊命令用情報メモリ42の記憶内容(特
殊命令用情報の内容)の例は図5に示した実施例2のも
の構成例とほぼ同一である。すなわち、図5における2
ポートメモリ41の代わりに、図8においては特殊命令
用情報メモリ42とバッファメモリ45とが備わり、特
殊命令用情報メモリ42は特殊命令用情報の格納専用に
用いられている。An example of the stored contents of the special instruction information memory 42 (contents of the special instruction information) is almost the same as the configuration example of the second embodiment shown in FIG. That is, 2 in FIG.
Instead of the port memory 41, a special instruction information memory 42 and a buffer memory 45 are provided in FIG. 8, and the special instruction information memory 42 is used exclusively for storing special instruction information.
【0051】特殊命令の形式は図1に示した例と同じで
ある。 また、特殊命令を実行するときのCPUユニッ
ト1の処理を示す動作フロー図は図6に示した実施例2
の動作フロー図とほぼ同じである。The format of the special instruction is the same as the example shown in FIG. Further, the operation flow chart showing the processing of the CPU unit 1 when executing the special instruction is the embodiment 2 shown in FIG.
It is almost the same as the operation flow chart of.
【0052】以下、この実施例3の動作について説明す
る。2CH・D/Aユニット(デジタル/アナログ変換
機能を2つ持つ特殊機能ユニット)において、”Z_A
NALOG_1”は1CH目にアナログ値を出力する命
令であり、”Z_ANALOG_2”が2CH目にアナ
ログ値を出力する命令である。The operation of the third embodiment will be described below. In the 2CH D / A unit (special function unit with two digital / analog conversion functions), "Z_A"
"NALOG_1" is an instruction to output an analog value on 1CH, and "Z_ANALOG_2" is an instruction to output an analog value on 2CH.
【0053】同じように、8CH・D/Aユニット(デ
ジタル/アナログ変換機能を8つ持つ特殊機能ユニッ
ト)において、”Z_ANALOG_1”は1CH目に
アナログ値を出力する命令、”Z_ANALOG_2”
は2CH目にアナログ値を出力する命令、・・・”Z_A
NALOG_8”は8CH目にアナログ値を出力する命
令、表示ユニットにおいては、”Z_LOCATE”は
表示位置を指定する命令、”Z_PRINT”は表示す
る命令である。Similarly, in the 8CH D / A unit (special function unit having eight digital / analog conversion functions), "Z_ANALOG_1" is an instruction to output an analog value on the first CH, "Z_ANALOG_2".
Is an instruction to output an analog value on the 2nd CH ... "Z_A
NALOG_8 "is an instruction to output an analog value on the 8th CH," Z_LOCATE "is an instruction to specify a display position, and" Z_PRINT "is an instruction to display in the display unit.
【0054】入出力番号50 の位置に2CH・D/A
ユニット (デジタル/アナログ変換機能を2つ持つ特殊
機能ユニット)を装着し、1CH目にデバイスD0の内
容に対応したアナログ値を出力したい場合のプログラム
について考える。この場合、プログラムは図2の命令7
Aとなる。ユーザは、プログラム装置2により図2の命
令7Aというプログラムを作成し、CPUユニット1の
プログラムメモリ11に通信ケーブル3を介してこのプ
ログラム7Aを書き込む。2CH / D / A at the position of input / output number 50
Consider a program when a unit (special function unit having two digital / analog conversion functions) is installed and you want to output an analog value corresponding to the contents of device D0 on CH1. In this case, the program is instruction 7 in FIG.
A. The user creates a program called the instruction 7A of FIG. 2 by the programming device 2, and writes this program 7A in the program memory 11 of the CPU unit 1 via the communication cable 3.
【0055】次に、実際にCPUユニット1が、プログ
ラムメモリ11に書かれたプログラム7Aを実行する時
は、その命令の命令名の先頭2文字がZ_であることを
調べ、特殊命令であると判別する。次に、CPUユニッ
ト1は、その命令で指定された入出力番号50の位置に
装着された2CH・D/Aユニット内の2ポートメモリ
42に格納されている特殊命令について、図5bに示し
た特殊命令の数4130を読み出す。このユニットには
4個の特殊命令が定義されていると分かるので、4個分
の命令の文字コードを順次調べる。この場合一番目で命
令名が一致するので、この一番目の特殊命令の情報に基
づいて処理を行なう。Next, when the CPU unit 1 actually executes the program 7A written in the program memory 11, it checks that the first two characters of the instruction name of the instruction are Z_, and determines that it is a special instruction. Determine. Next, the CPU unit 1 shows the special instruction stored in the 2-port memory 42 in the 2CH • D / A unit mounted at the position of the input / output number 50 designated by the instruction in FIG. 5B. The number of special instructions 4130 is read. Since it is known that four special instructions are defined in this unit, the character codes of the four instructions are sequentially examined. In this case, since the instruction names match at the first position, processing is performed based on the information of this first special instruction.
【0056】まず、この命令はデバテスメモリの指定は
1個であり、その種類はコードF5Hで示される種類が
指定できることが分かるので、これをプログラムメモリ
11の命令のD0と調べ正しいことが分かる。次に、読
み出し/書き込み区分、バッファメモリ先頭アドレス、
読み出し/書き込み個数、ハンドシェイク信号(0=な
し)からデバイスメモリ12のD0内容をバッファメモ
リ45のアドレス2に書き込む命令であると判断し、実
行可/否フラグ(0=可)によりこれを実行し、デバイ
スメモリ12のD0の内容をバッファメモリ45のアド
レス2に書き込む。特殊機能ユニットは従来通りバッフ
ァメモリ45のアドレス2の内容に応じたアナログ値を
1CHに出力する。すなわち、デバイスメモリ12のD
0の内容アナログ値を1CHに出力することになる。First, since it is known that this instruction specifies only one debate memory, and that the kind indicated by the code F5H can be specified, this is checked as D0 of the instruction of the program memory 11 and it is understood that it is correct. Next, read / write classification, buffer memory start address,
It is judged from the read / write number and the handshake signal (0 = none) that the command is to write the D0 contents of the device memory 12 to the address 2 of the buffer memory 45, and this is executed by the execution enable / disable flag (0 = enabled). Then, the contents of D0 of the device memory 12 are written in the address 2 of the buffer memory 45. The special function unit outputs an analog value corresponding to the contents of the address 2 of the buffer memory 45 to 1CH as in the conventional case. That is, D of the device memory 12
The content analog value of 0 will be output to 1CH.
【0057】例えば、入出力NO50の位置に8CH・
D/Aユニット(デジタル/アナログ変換機能を8つ持
つ特殊機能ユニット)を装着し、1CH目にデバイスD
0の内容に対応したアナログ値を出力したい場合のプロ
グラムについて考えると、プログラムは図2の命令7A
となり、命令の実行動作も全く同様になる。For example, at the position of input / output NO50, 8CH
Install a D / A unit (special function unit with 8 digital / analog conversion functions), and connect device D to the 1st CH.
Considering a program for outputting an analog value corresponding to the content of 0, the program is the instruction 7A in FIG.
, And the instruction execution operation becomes exactly the same.
【0058】また、入出力番号50の位置に表示ユニッ
トを装着し、1行3列目にデバテスD0の内容に対応し
た文字を表示したい場合のプログラムについて考える
と、プログラムは図2の命令7Bとなり、命令の実行動
作も全く同様になる。Considering a program in which a display unit is mounted at the position of the input / output number 50 and a character corresponding to the contents of the debates D0 is displayed at the 1st row and the 3rd column, the program is the instruction 7B in FIG. The instruction execution operation is also the same.
【0059】このように、同様な機能を持つ特殊命令
は、”Z_ANALOG_1”と言う同じ命令名とな
り、また命令名を見て1CH目にアナログ値を出力する
命令であることも容易に判る。また、同様な内部処理の
特殊命令でも、2CH・D/Aユニットでは、”Z_A
NALOG_1”表示ユニットでは、”Z_LOCAT
E”、”Z_PRINT”と機能が異なることも容易に
分かる。As described above, the special instruction having the same function has the same instruction name "Z_ANALOG_1", and it can be easily understood that the instruction name is used to output the analog value to the first channel. In addition, even if the special instruction of the same internal processing is used, “Z_A
In the NALOG_1 display unit, "Z_LOCAT"
It is also easy to see that the functions are different from E "and" Z_PRINT ".
【0060】実施例4. 次に、この発明のさらに他の実施例を図について説明す
る。図9において、13は各特殊機能ユニットそれぞれ
の特殊命令用情報を格納するためのメモリである。Embodiment 4 FIG. Next, still another embodiment of the present invention will be described with reference to the drawings. In FIG. 9, 13 is a memory for storing special command information of each special function unit.
【0061】図10は、各特殊機能ユニットそれぞれの
特殊命令用情報を格納するための第2記憶手段、例え
ば、メモリ13の記憶内容の一例を示す図である。図に
おいて、131には入出力番号0に装着されている特殊
機能ユニットの特殊命令用情報メモリ42の内容が格納
される。132には入出力番号10に装着されている特
殊機能ユニットの特殊命令用情報メモリ42の内容が格
納される。以下、同様である。FIG. 10 is a diagram showing an example of the stored contents of the second storage means for storing the special command information of each special function unit, for example, the memory 13. In the figure, 131 stores the contents of the special command information memory 42 of the special function unit attached to the input / output number 0. In 132, the contents of the special command information memory 42 of the special function unit attached to the input / output number 10 are stored. The same applies hereinafter.
【0062】図11は、シーケンスプログラムを実行す
る前に、予め、特殊機能ユニット内のメモリに格納され
た特殊命令用情報メモリの内容をCPUユニット内の前
記情報を格納するためのメモリ13に転送するときのC
PUユニットの処理を示す動作フロー図である。In FIG. 11, before executing the sequence program, the contents of the special instruction information memory previously stored in the memory in the special function unit are transferred to the memory 13 in the CPU unit for storing the information. C when doing
It is an operation | movement flowchart which shows the process of a PU unit.
【0063】次に動作について説明する。プログラム装
置2でプログラムを行う時、命令名の入力の初めにZ_
と入力されると、その後は任意の命令名の入力を受け付
け可能としておく。こうしてプログラム装置2により図
1に示すような形式のプログラムを作成し、CPUユニ
ット1のプログラムメモリ11に通信ケーブル3を介し
て前記プログラムを書き込む。Next, the operation will be described. When programming with the programming device 2, at the beginning of the input of the command name, Z_
After that, input of an arbitrary command name can be accepted. In this way, the program device 2 creates a program of the format shown in FIG. 1, and writes the program in the program memory 11 of the CPU unit 1 via the communication cable 3.
【0064】次に、CPUユニット1が、シーケンスプ
ログラムを実行する前に、予め、特殊機能ユニット内の
特殊命令用情報メモリ42に格納された特殊命令用情報
をCPUユニット内の前記情報を格納するためのメモリ
13に転送する。すなわち、先頭のユニットから順に
(ステップ301)、最終のユニットまで(ステップ3
05)以下の処理を行う。該当のユニットが特殊機能ユ
ニットであるかを調べる(ステップ302)。特殊機能
ユニットであれば、特殊命令定義されているかを調べる
(ステップ303)。定義されていれば、該当の特殊機
能ユニット内の特殊命令用情報メモリ42に格納された
特殊命令用情報をCPUユニット内の前記メモリ13に
転送する(ステップ304)。ステップ305で最終ユ
ニットでなければ、次のユニットへ進む(ステップ30
6)。Next, before the CPU unit 1 executes the sequence program, the special instruction information stored in the special instruction information memory 42 in the special function unit is stored in advance in the CPU unit. To the memory 13 for storing. That is, from the first unit to the last unit (step 301) to the last unit (step 3).
05) Perform the following processing. It is checked whether the corresponding unit is a special function unit (step 302). If it is a special function unit, it is checked whether a special instruction is defined (step 303). If it is defined, the special instruction information stored in the special instruction information memory 42 in the corresponding special function unit is transferred to the memory 13 in the CPU unit (step 304). If it is not the final unit in step 305, proceed to the next unit (step 30
6).
【0065】次に、実際にCPUユニット1が、プログ
ラムメモリ11に書かれたシーケンスプログラムを実行
する。この時の処理は実施例1で説明した通りである
(図6の動作フロー図の通りである)。但し、実施例1
では、該当の特殊機能ユニット内の特殊命令用情報メモ
リ42に格納された特殊命令用情報に基づいて処理する
ようにしたが、この実施例4では、予め、前記情報を格
納しておいたCPUユニット内のメモリ13の該当特殊
命令用情報に基づいて処理するようにしている。一般
に、特殊機能ユニットの特殊命令用情報メモリ42より
もCPUユニット内のメモリ13の方がアクセススピー
ドが数段高速なため、この実施例4の方が特殊命令の実
行速度がより高速である。Next, the CPU unit 1 actually executes the sequence program written in the program memory 11. The processing at this time is as described in the first embodiment (as shown in the operation flow chart of FIG. 6). However, Example 1
Then, the processing is performed based on the special instruction information stored in the special instruction information memory 42 in the corresponding special function unit. However, in the fourth embodiment, the CPU that previously stores the information is described. The processing is performed based on the information for the corresponding special instruction in the memory 13 in the unit. Generally, since the memory 13 in the CPU unit has an access speed several steps faster than the special instruction information memory 42 of the special function unit, the execution speed of the special instruction is faster in the fourth embodiment.
【0066】上述の説明では、予め、特殊命令を持つ全
ての特殊機能ユニットの特殊命令用情報メモリ42の特
殊命令用情報の全てをCPU機能ユニットのメモリ13
に転送するようにしたが、メモリの節約と解読の高速の
ために、シーケンスプログラム中で実際にプログラムさ
れている特殊命令を検索し、それに対応する該当の特殊
機能ユニットの特殊命令用情報メモリ42の該当する特
殊命令用情報のみをCPUユニットのメモリ13に転送
するようにしてもよい。In the above description, all of the special command information in the special command information memory 42 of all special function units having special commands is previously stored in the memory 13 of the CPU function unit.
However, in order to save memory and speed up decoding, the special instruction actually programmed in the sequence program is searched and the corresponding special instruction information memory 42 of the corresponding special function unit is searched. It is also possible to transfer only the corresponding special command information of No. 1 to the memory 13 of the CPU unit.
【0067】実施例5. 次に、この発明のさらに他の実施例を図について説明す
る。図12において、43は特殊機能ユニットに設けら
れCPUユニットからアクセスでき、特殊命令用シーケ
ンスプログラムが格納されている第1記憶手段、例え
ば、特殊命令用シーケンスメモリである。Example 5. Next, still another embodiment of the present invention will be described with reference to the drawings. In FIG. 12, reference numeral 43 denotes a first storage means provided in the special function unit, accessible from the CPU unit, and storing a special instruction sequence program, for example, a special instruction sequence memory.
【0068】図13は特殊命令用シーケンスメモリ43
の記憶内容(特殊命令用シーケンスメモリの内容)の一例
を示す図である。図において、(a)は特殊命令用シー
ケンスメモリ43の一般例である。43aはこのユニッ
トに定義されている特殊命令の総数が格納される部分で
あり、以降に各特殊命令の命令名とシーケンスプログラ
ムが格納される部分がある。この情報を1番目の命令を
例に説明する。431aは一番目に定義された特殊命令
の命令名が文字コードで格納されている部分、432a
はこの命令に対応するシーケンスプログラムが格納され
ている部分である。1つの命令の情報はこのように43
1aと432aを一組として構成されされ、以下このよ
うな一組の情報がアドレス0に格納されている特殊命令
の総数分格納されている。(b)は2CH・D/Aユニ
ットにおける特殊命令用シーケンスメモリ43の記憶内
容の一例、(c)は8CH・D/Aユニットにおける特
殊命令用シーケンスメモリ43の記憶内容の一例、
(d)は表示ユニットにおける特殊命令用シーケンスメ
モリ43の記憶内容の一例を示している。FIG. 13 shows the special instruction sequence memory 43.
FIG. 7 is a diagram showing an example of stored contents (contents of a special instruction sequence memory). In the figure, (a) is a general example of the special instruction sequence memory 43. Reference numeral 43a is a portion for storing the total number of special instructions defined in this unit, and thereafter there is a portion for storing the instruction name of each special instruction and the sequence program. This information will be described using the first instruction as an example. Reference numeral 431a is a portion in which the instruction name of the special instruction defined first is stored in a character code, 432a.
Is the part where the sequence program corresponding to this instruction is stored. Information of one command is 43
1a and 432a are configured as a set, and such a set of information is stored for the total number of special instructions stored at address 0. (B) is an example of the storage contents of the special instruction sequence memory 43 in the 2CH • D / A unit, (c) is an example of the storage contents of the special instruction sequence memory 43 in the 8CH • D / A unit,
(D) shows an example of the stored contents of the special command sequence memory 43 in the display unit.
【0069】図14は特殊命令用シーケンスメモリ43
に格納されている特殊命令に対応するシーケンスプログ
ラムの例である。図において、81は2CH・D/Aユ
ニットの特殊命令”Z_ANALOG_1”に対応する
シーケンスプログラム、および、表示ユニットの特殊命
令”Z_PRINT”に対応するシーケンスプログラム
の例である。82は8CH・D/Aユニットの特殊命
令”Z_ANALOG_1”に対応するシーケンスプロ
グラムの例である。83は8CH・D/Aユニットの特
殊命令”Z_ANALOG”に対応するシーケンスプロ
グラムの例である。FIG. 14 is a sequence memory 43 for special instructions.
It is an example of the sequence program corresponding to the special instruction stored in. In the figure, reference numeral 81 is an example of a sequence program corresponding to the special instruction "Z_ANALOG_1" of the 2CH • D / A unit and a sequence program corresponding to the special instruction "Z_PRINT" of the display unit. Reference numeral 82 is an example of a sequence program corresponding to the special instruction "Z_ANALOG_1" of the 8CH D / A unit. Reference numeral 83 is an example of a sequence program corresponding to the special instruction "Z_ANALOG" of the 8CH D / A unit.
【0070】図15は、特殊命令を実行するときのCP
Uユニットの処理を示す動作フロー図である。次に動作
について説明する。プログラム装置2でプログラム作成
を行う時、命令名の入力の初めにZ_と入力されると、
その後は任意の命令名の入力を受け付け可能としてお
く。こうしてプログラム装置2により図1に示すような
形式のプログラムを作成し、CPUユニット1のプログ
ラムメモリ11に通信ケーブル3を介して前記プログラ
ムを書き込む。FIG. 15 shows a CP when executing a special instruction.
It is an operation | movement flowchart which shows the process of U unit. Next, the operation will be described. When a program is created by the programming device 2, if Z_ is entered at the beginning of the instruction name input,
After that, the input of an arbitrary command name can be accepted. In this way, the program device 2 creates a program of the format shown in FIG. 1, and writes the program in the program memory 11 of the CPU unit 1 via the communication cable 3.
【0071】次に、実際にCPUユニット1が、プログ
ラムメモリ11に書かれたシーケンスプログラムを実行
する。この時の処理を図15の動作フロー図に示す。ま
ず、その命令の命令名の先頭2文字がZ_であれば特殊
命令であると判別する(ステップ501)。Z_以外の
文字であれば通常の命令の処理をする(ステップ50
8)。次に、CPUユニット1は、特殊命令であると判
別した命令が、その命令で指定された入出力NOの位置
に装着された特殊機能ユニット4内の特殊命令用シーケ
ンスメモリ43に格納された特殊命令の数43aからこ
のユニットに定義された命令数を読み出し(ステップ5
02)、その個数分の特殊命令から文字コードが一致す
る命令を検索し、この命令がこの特殊機能ユニットに定
義されているかを調べる(ステップ503)。Next, the CPU unit 1 actually executes the sequence program written in the program memory 11. The processing at this time is shown in the operation flow chart of FIG. First, if the first two characters of the instruction name of the instruction are Z_, it is determined to be a special instruction (step 501). If it is a character other than Z_, a normal instruction is processed (step 50).
8). Next, the CPU unit 1 stores the special instruction stored in the special instruction sequence memory 43 in the special function unit 4 attached to the input / output NO position designated by the instruction. The number of instructions defined in this unit is read from the number of instructions 43a (step 5
02), the number of special instructions is searched for an instruction having a matching character code, and it is checked whether this instruction is defined in this special function unit (step 503).
【0072】一致する命令が見つからなかった場合、こ
の命令名が特殊機能ユニット側で定義されていないとみ
なしてエラーとし(ステップ506)、見つかったら定
義されていたとみなしてCPUユニット1は、次の処理
に移る。まず、その命令で指定されたデバイスの内容を
専用デバイスA(A0,A1,A2・・・)にセットす
る(ステップ504)。次に、その命令に対応する特殊
命令用シーケンスプログラムを実行する(ステップ50
5)。この処理を正常に終了した場合はこの命令の処理
を終了し、また、途中エラーが発生した場合はエラー表
示等のエラー処理を行い(ステップ506)この命令の
処理を終了し、次の命令の実行に移る。If no matching instruction is found, it is regarded as an error because this instruction name is not defined on the special function unit side (step 506), and if found, it is regarded as being defined and the CPU unit 1 proceeds to the next step. Move on to processing. First, the contents of the device designated by the command are set in the dedicated device A (A0, A1, A2 ...) (step 504). Next, the special instruction sequence program corresponding to the instruction is executed (step 50).
5). When this process is completed normally, the process of this command is completed, and when an error occurs in the middle, error processing such as error display is performed (step 506). The process of this command is completed and the next command is executed. Go to execution.
【0073】2CH・D/Aユニット(デジタル/アナ
ログ変換機能を2つ持つ特殊機能ユニット)において、
Z_ANALOG_1が1CH目にアナログ値を出力す
る命令、Z_NALOG_2が2CH目にアナログ値を
出力する命令である。同じように、8CH・D/Aユニ
ット(デジタル/アナログ変換機能を8つ持つ特殊機能
ユニット)において、Z_ANALOG_1が1CH目
にアナログ値を出力する命令、Z_ANALOG_2が
2CH目にアナログ値を出力する命令、・・・Z_AN
ALOG_8が8CH目にアナログ値を出力する命令、
Z_ANALOGが指定CH目にアナログ値を出力する
命令である。また、表示ユニットでは、Z_LOCAT
Eが表示位置を指定する命令、Z_PRINTが表示す
る命令である。In the 2CH D / A unit (special function unit having two digital / analog conversion functions),
Z_ANALOG_1 is an instruction to output an analog value on CH1 and Z_NALOG_2 is an instruction to output an analog value on CH2. Similarly, in the 8CH D / A unit (special function unit having eight digital / analog conversion functions), Z_ANALOG_1 outputs an analog value on 1CH, Z_ANALOG_2 outputs an analog value on 2CH, ... Z_AN
ALOG_8 command to output analog value on CH8,
Z_ANALOG is an instruction to output an analog value to the designated CH. Also, in the display unit, Z_LOCAT
E is an instruction to specify the display position, and Z_PRINT is an instruction to display.
【0074】入出力番号50の位置に2CH・D/Aユ
ニット(デジタル/アナログ変換機能を2つ持つ特殊機
能ユニット)を装着し、1CH目にデバイスD0の内容
に対応したアナログ値を出力したい場合のプログラムに
ついて考える。この場合、プログラムは図2の命令7A
となる。ユーザは、プログラム装置2により、図2の命
令7Aというプログラムを作成し、CPUユニット1の
プログラムメモリ11に通信ケーブル3を介してそのプ
ログラム7Aを書き込む。When a 2CH D / A unit (special function unit having two digital / analog conversion functions) is mounted at the position of input / output number 50 and an analog value corresponding to the contents of the device D0 is output on the 1st CH Think about the program. In this case, the program is instruction 7A in FIG.
Becomes The user uses the programming device 2 to create a program called the instruction 7A in FIG. 2 and writes the program 7A in the program memory 11 of the CPU unit 1 via the communication cable 3.
【0075】次に、実際にCPUユニット1が、プログ
ラムメモリ11に書かれたプログラム7Aを実行する時
は、その命令の命令名の先頭2文字がZ_であることを
調べ、特殊命令であると判別する。次に、CPUユニッ
ト1は、その命令で指定された入出力番号50の位置に
装着された2CH・D/Aユニット内の特殊命令用シー
ケンスメモリ43に格納された特殊命令の数43bを読
み出す。このユニットには4個の特殊命令が定義されて
いるとわかるので、4個分の命令の文字コードを順次調
べる。この場合一番目で命令名が一致する。次に、この
命令で指定された入出力番号50を図14のA0に、デ
バイスメモリ12のD0の内容を図14のA1に格納す
る。その後、この命令に対応するシーケンスプログラム
ステップ81を実行する。このシーケンスプログラムス
テップ81は、A0に50が、A1にD0の内容が格納
されているのでので、このシーケンスプログラムステッ
プ81が実行されるとデバイスメモリ12のD0の内容
に応じたアナログ値が入出力番号50の位置に装着され
た2CH・D/Aユニットの1CHに出力されることに
なる。Next, when the CPU unit 1 actually executes the program 7A written in the program memory 11, it is checked that the first two characters of the instruction name of the instruction are Z_, and it is determined that the instruction is a special instruction. Determine. Next, the CPU unit 1 reads out the number 43b of special instructions stored in the special instruction sequence memory 43 in the 2CH • D / A unit mounted at the position of the input / output number 50 designated by the instruction. Since it is known that four special instructions are defined in this unit, the character codes of the four instructions are sequentially examined. In this case, the instruction names match at the first position. Next, the input / output number 50 designated by this instruction is stored in A0 of FIG. 14, and the contents of D0 of the device memory 12 are stored in A1 of FIG. Then, the sequence program step 81 corresponding to this instruction is executed. Since 50 is stored in A0 and the content of D0 is stored in A1 in this sequence program step 81, when this sequence program step 81 is executed, an analog value corresponding to the content of D0 of the device memory 12 is input / output. It will be output to 1CH of the 2CH • D / A unit mounted at the position of number 50.
【0076】次に、入出力番号50の位置に8CH・D
/Aユニット(デジタル/アナログ変換機能を8つ持つ
特殊機能ユニット)を装着し、1CH目にデバイスD0
の内容に対応したアナログ値を出力したい場合のプログ
ラムについて考える。この場合も、プログラムは図2の
命令7Aとなり、命令の実行動作も全く同様になる。す
なわち、この命令に対応するシーケンスプログラム82
を実行することになる。Next, at the position of input / output number 50, 8CH.D
/ A unit (special function unit with 8 digital / analog conversion functions) is installed, and device D0
Consider a program when you want to output an analog value corresponding to the contents of. In this case as well, the program is the instruction 7A in FIG. 2, and the instruction execution operation is exactly the same. That is, the sequence program 82 corresponding to this instruction
Will be executed.
【0077】次に、入出力番号50の位置に表示ユニッ
トを装着し、1行3列目にデバイスD0の内容に対応し
た文字を表示したい場合のプログラムについて考える。
この場合も、プログラムは図2の命令7Bとなり、命令
の実行動作も全く同様になる。Next, consider a program for mounting a display unit at the position of the input / output number 50 and displaying a character corresponding to the contents of the device D0 in the first row and third column.
In this case as well, the program becomes the instruction 7B in FIG. 2, and the operation of executing the instruction is exactly the same.
【0078】このように、同様な機能を持つ特殊命令
は、”Z_ANALOG_1”と言う同じ命令名とな
り、また命令名を見て1CH目にアナログ値を出力する
命令であることも容易に分かる。また、同様な内部処理
の特殊命令でも、2CH・D/Aユニットでは”Z_A
NALOG_1”、表示ユニットでは、”Z_LOCA
TE”、”Z_PRINT”と機能が異なることも容易
に分かる。As described above, the special instruction having the same function has the same instruction name "Z_ANALOG_1", and it can be easily understood that the instruction name is used to output the analog value to the first channel. In addition, even with the same special instruction for internal processing, "Z_A
NALOG_1 ", in the display unit," Z_LOCA
It is also easy to see that the functions are different from those of TE "and" Z_PRINT ".
【0079】次に、入出力番号50の位置に8CH・D
/Aユニット(デジタル/アナログ変換機能を8つ持つ
特殊機能ユニット)を装着し、1CH目にデバイスD0
の内容に対応したアナログ値を出力したい場合のプログ
ラムについて考える。この場合、プログラムは図2の命
令7Aとなる。ユーザは、プログラム装置2により、図
2の命令7Aというプログラムを作成し、CPUユニッ
ト1のプログラムメモリ11に通信ケーブル3を介して
そのプログラム7Aを書き込む。Next, at the position of input / output number 50, 8CH.D
/ A unit (special function unit with 8 digital / analog conversion functions) is installed, and device D0
Consider a program when you want to output an analog value corresponding to the contents of. In this case, the program is instruction 7A in FIG. The user uses the programming device 2 to create a program called the instruction 7A in FIG. 2 and writes the program 7A in the program memory 11 of the CPU unit 1 via the communication cable 3.
【0080】次に、実際にCPUユニット1が、プログ
ラムメモリ11に書かれたプログラム7Aを実行する時
は、その命令の命令名の先頭2文字がZ_であることを
確認し、特殊命令であると判別する。次に、CPUユニ
ット1は、その命令で指定された入出力番号50の位置
に装着された2CH・D/Aユニット内の特殊命令用シ
ーケンスメモリ43に格納されている特殊命令の数43
bを読み出す。このユニットには4個の特殊命令が定義
されているとわかるので、4個分の命令の文字コードを
順次調べる。この場合1番目で命令名が一致する。Next, when the CPU unit 1 actually executes the program 7A written in the program memory 11, it is confirmed that the first two characters of the instruction name of the instruction are Z_ and it is a special instruction. To determine. Next, the CPU unit 1 sets the number 43 of special instructions stored in the special instruction sequence memory 43 in the 2CH D / A unit mounted at the position of the input / output number 50 designated by the instruction.
Read b. Since it is known that four special instructions are defined in this unit, the character codes of the four instructions are sequentially examined. In this case, the instruction names match at the first position.
【0081】次に、この命令で指定された入出力番号5
0をA0に、CH番号1をA1に、デバイスメモリ12
のD0の内容をA2に格納する。その後、この命令に対
応するシーケンスプログラム83を実行する。この命令
では、A0に50が、A1に3が、A2にD0の内容が
格納されているのでので、”= A1 1”が成立
し、”TO A0 8 A2 1”が実行され、バッフ
ァメモリ45のアドレス8にA2の内容が書き込まれ
る。すなわち、デバイスメモリ12のD0の内容に応じ
たアナログ値を入出力番号50の位置に装着された2C
H・D/Aユニットの1CHに出力することになる。Next, the input / output number 5 designated by this instruction
0 to A0, CH number 1 to A1, device memory 12
Store the contents of D0 in A2. After that, the sequence program 83 corresponding to this instruction is executed. In this command, 50 is stored in A0, 3 is stored in A1, and the content of D0 is stored in A2. Therefore, “= A1 1” is satisfied, “TO A0 8 A2 1” is executed, and the buffer memory 45 The contents of A2 are written in the address 8 of. That is, the analog value according to the contents of D0 of the device memory 12 is attached to the position of the input / output number 50 of 2C.
It will be output to CH1 of the H / D / A unit.
【0082】このように、特殊命令の動作をシームンス
プログラムで自由に記述しているため、複雑な機能を”
Z_ANALOG”という1つの特殊命令で実現でき
る。また、”Z_ANALOG”という命令名を見て指
定CH目にアナログ値を出力する命令であることも容易
に分かる。As described above, since the operation of the special instruction is freely described in the seamless program, the complicated function is "
It can be realized by one special instruction "Z_ANALOG". Also, it is easily understood that the instruction name "Z_ANALOG" outputs an analog value to the designated CH.
【0083】実施例6. 次に、この発明のさらに他の実施例を図について説明す
る。図16において、14は各特殊機能ユニットそれぞ
れの特殊命令用シーケンスプログラムを格納するための
メモリである。Example 6. Next, still another embodiment of the present invention will be described with reference to the drawings. In FIG. 16, 14 is a memory for storing the special instruction sequence program of each special function unit.
【0084】図17は、各特殊機能ユニットそれぞれの
特殊命令用シーケンスプログラムを格納するための第2
記憶手段、例えば、メモリ14の記憶内容の例を示す図
である。図において、141には入出力番号0に装着さ
れている特殊機能ユニットの特殊命令用シーケンスメモ
リ43の内容が格納される。142には入出力番号10
に装着されている特殊機能ユニットの特殊命令用シーケ
ンスメモリ43の内容が格納される。以下、同様であ
る。FIG. 17 shows a second program for storing a special instruction sequence program for each special function unit.
It is a figure which shows the example of a memory | storage means, for example, the memory content of memory 14. In the figure, 141 stores the contents of the special command sequence memory 43 of the special function unit attached to the input / output number 0. Input / output number 10 for 142
The contents of the special command sequence memory 43 of the special function unit mounted in the are stored. The same applies hereinafter.
【0085】図18は、シーケンスプログラムを実行す
る前に、予め特殊機能ユニット内のメモリに格納された
特殊命令用シーケンスメモリ43の内容をCPUユニッ
ト内の前記内容を格納するためのメモリ14に転送する
ときのCPUユニットの処理を示す動作フロー図であ
る。In FIG. 18, before executing the sequence program, the contents of the special instruction sequence memory 43 stored in advance in the memory in the special function unit are transferred to the memory 14 in the CPU unit for storing the contents. FIG. 7 is an operation flow chart showing the processing of the CPU unit when performing.
【0086】次に動作について説明する。プログラム装
置2でプログラム作成を行うとき、命令名の入力の初め
にZ_と入力されると、その後は任意の命令名の入力を
受け付け可能としておく。こうしてプログラム装置2に
より図1に示すような形式のプログラムを作成し、CP
Uユニット1のプログラムメモリ11に通信ケーブル3
を介して前記プログラムを書き込む。Next, the operation will be described. When a program is created by the programming device 2, if Z_ is input at the beginning of the input of a command name, the input of an arbitrary command name can be accepted thereafter. In this way, the program device 2 creates a program having a format as shown in FIG.
Communication cable 3 in the program memory 11 of U unit 1
Write the program via.
【0087】次に、CPUユニット1が、シーケンスプ
ログラムを実行する前に、予め特殊機能ユニット内の特
殊命令用シーケンスメモリ42に格納された特殊命令用
シーケンスプログラム等をCPUユニット内の前記内容
を格納するためのメモリ14に転送する。すなわち、先
頭のユニットから順に(ステップ601)、最終のユニ
ットまで(ステップ605)以下の処理を行う。該当の
ユニットが特殊機能ユニットであるかを調べる(ステッ
プ602)。特殊機能ユニットであれば、特殊命令定義
されているかを調べる(ステップ603)。定義されて
いれば、該当の特殊機能ユニット内のメモリ42に格納
された特殊命令用シーケンスプログラム等をCPUユニ
ット内の前記メモリ14に転送する(ステップ60
4)。ステップ605で最終ユニットでなければ、次の
ユニットへ進む(ステップ606)。Next, before the CPU unit 1 executes the sequence program, the special instruction sequence program or the like previously stored in the special instruction sequence memory 42 in the special function unit is stored in the contents in the CPU unit. Transfer to the memory 14 for That is, the following processes are performed in order from the first unit (step 601) to the last unit (step 605). It is checked whether the corresponding unit is a special function unit (step 602). If it is a special function unit, it is checked whether a special instruction is defined (step 603). If it is defined, the special instruction sequence program or the like stored in the memory 42 in the corresponding special function unit is transferred to the memory 14 in the CPU unit (step 60).
4). If it is not the final unit in step 605, the process proceeds to the next unit (step 606).
【0088】次に、実際にCPUユニット1がプログラ
ムメモリ11に書かれたシーケンスプログラムを実行す
る。この時の処理は、実施例5で説明した通りである
(図15の動作フロー図の通りである)。但し、実施例
5の発明では該当の特殊機能ユニット内のメモリ43に
格納された特殊命令用シーケンスプログラムにもとづい
て処理するようにしたが、この実施例6では、予め前記
情報を格納しておいたCPUユニット内のメモリ14の
該当特殊命令用シーケンスプログラムにもとづいて処理
するようにしている。一般に、特殊機能ユニットの特殊
命令用シーケンスメモリ43よりもCPUユニット内の
メモリ14の方がアクセススピードが数段高速なため、
この実施例6では特殊機能命令の実行速度が高速であ
る。Next, the CPU unit 1 actually executes the sequence program written in the program memory 11. The processing at this time is as described in the fifth embodiment (as shown in the operation flow chart of FIG. 15). However, in the invention of the fifth embodiment, the processing is performed based on the special instruction sequence program stored in the memory 43 in the corresponding special function unit, but in the sixth embodiment, the information is stored in advance. The processing is performed based on the sequence program for the special instruction in the memory 14 in the CPU unit. In general, since the memory 14 in the CPU unit has an access speed several steps higher than that of the special instruction sequence memory 43 of the special function unit,
In the sixth embodiment, the execution speed of the special function instruction is high.
【0089】また、以上の説明においては予め特殊機能
命令を持つ全ての特殊機能ユニットのメモリ42の特殊
命令用シーケンスプログラム全てをCPUユニットのメ
モリ14に転送するとしたが、メモリの節約と解読の高
速のためにシーケンスプログラム中で実際にプログラム
されている特殊機能命令を検索し、該当する特殊機能ユ
ニットの特殊命令用シーケンスメモリ43の該当する特
殊命令用シーケンスプログラムのみをCPUユニットの
メモリ14に転送するようにしてもよい。In the above description, all the special instruction sequence programs in the memories 42 of all special function units having special function instructions are transferred to the memory 14 of the CPU unit in advance. For a special function instruction actually programmed in the sequence program, and transfers only the corresponding special instruction sequence program of the special instruction sequence memory 43 of the corresponding special function unit to the memory 14 of the CPU unit. You may do it.
【0090】実施例7. 次に、この発明のさらに他の実施例を図について説明す
る。図19において、44はCPUユニットからアクセ
スでき、特殊命令用マイコンプログラムが格納されてい
るメモリである。Example 7. Next, still another embodiment of the present invention will be described with reference to the drawings. In FIG. 19, reference numeral 44 denotes a memory which can be accessed from the CPU unit and which stores a special instruction microcomputer program.
【0091】この実施例は、実施例5における特殊命令
用シーケンスプログラムを特殊命令用マイコンプログラ
ムに置き換えたものである。CPUユニットには通常マ
イクロプロセッサが搭載されている。また、このマイク
ロプロセッサの機械語で構成されたプログラムをマイコ
ンプログラムと呼んでいる。この実施例7は動作も実施
例5における特殊命令用シーケンスプログラムの代わり
に、特殊命令用マイコンプログラムを実行するものであ
る。動作は実施例5とほぼ同様である。In this embodiment, the special instruction sequence program in the fifth embodiment is replaced with a special instruction microcomputer program. A microprocessor is usually mounted on the CPU unit. In addition, a program composed of the machine language of this microprocessor is called a microcomputer program. The operation of the seventh embodiment is such that the microcomputer program for the special instruction is executed instead of the sequence program for the special instruction in the fifth embodiment. The operation is almost the same as in the fifth embodiment.
【0092】実施例8. 次に、この発明のさらに他の実施例を図について説明す
る。図20において、15は各特殊機能ユニットそれぞ
れの特殊命令用マイコンプログラムを格納するためのメ
モリである。Example 8. Next, still another embodiment of the present invention will be described with reference to the drawings. In FIG. 20, reference numeral 15 is a memory for storing a special instruction microcomputer program for each special function unit.
【0093】この実施例8は実施例6における特殊命令
用シーケンスプログラムを特殊命令用マイコンプログラ
ムに置き換えたものである。この実施例8の動作も実施
例6における特殊命令用シーケンスプログラムの代わり
に、特殊命令用マイコンプログラムを予め転送してお
き、その後、実行するものである。動作は実施例6とほ
ぼ同様である。In the eighth embodiment, the special instruction sequence program in the sixth embodiment is replaced with a special instruction microcomputer program. Also in the operation of the eighth embodiment, instead of the special instruction sequence program in the sixth embodiment, a special instruction microcomputer program is transferred in advance and then executed. The operation is almost the same as in the sixth embodiment.
【0094】以上のように、実施例1〜実施例8におい
て、特殊機能ユニットの2ポートメモリのアドレスを意
識せずにプログラムでき、また、特殊機能ユニットに対
する命令を見てその命令がどのような動作をするかがす
ぐに分かるのでプログラムの可読性が上がり、設計効率
/保守効率を向上させることができると共に、特殊機能
ユニットの種類が増えても、CPUユニット側に影響を
与える事なく適切な特殊機能ユニット対応命令を持たせ
ることができる。As described above, in the first to eighth embodiments, the program can be performed without being aware of the address of the 2-port memory of the special function unit, and the instruction to the special function unit can be seen to determine what the instruction is. The readability of the program can be improved because the operation can be immediately understood, and the design efficiency / maintenance efficiency can be improved, and even if the number of special function units increases, the appropriate special function can be achieved without affecting the CPU unit side. It is possible to have functional unit compatible instructions.
【0095】なお、上記実施例1〜実施例8では、プロ
グラム装置2とCPUユニット1が通信ケーブル3で接
続されているとしたが、通信ケーブルなしで直接接続さ
れていてもよい。また、通信用特殊機能ユニットにプロ
グラム装置2が通信ケーブル3を介して接続されていて
もよい。また、特殊機能ユニットの1つがプログラム装
置2であってもよい。Although the programming device 2 and the CPU unit 1 are connected by the communication cable 3 in the first to eighth embodiments, they may be directly connected without the communication cable. Further, the program device 2 may be connected to the communication special function unit via the communication cable 3. Further, one of the special function units may be the programming device 2.
【0096】さらに、特殊機能ユニットが持つ特殊命令
用情報を図5のように定義したが、メモリの構成はワー
ド単位でも他の単位でもよいし、1情報ごとに異なって
もよい。各命令の情報はこれらのうちから限定してもよ
いし、他にも必要な情報を追加してもよい。また、ユニ
ットによって異なってもよいし、異なることを知らせる
情報を付加させてもよい。さらに、1命令ずつまとめて
格納したが情報ごとにまとめてもよい。Further, although the special instruction information held by the special function unit is defined as shown in FIG. 5, the memory structure may be a word unit or another unit, or may be different for each information. The information of each command may be limited from these, or other necessary information may be added. Further, it may differ depending on the unit, or information for notifying the difference may be added. Further, although one instruction is stored collectively, it may be stored for each information.
【0097】実施例1〜実施例8では命令記号における
第1の記号がZ_で始まる命令を特殊機能ユニット対応
命令であるとしたが、Z_に限定されるものではなく、
例えばX_、Y_で始まる命令を特殊機能ユニット対応
命令であるとし、X_はアナログ系特殊機能ユニット対
応命令、Y_はリンク系特殊機能ユニット対応命令、Z
_はその他の特殊機能ユニット対応命令などのように使
い分ければプログラムの判読がより容易になる。In the first to eighth embodiments, the instruction in which the first symbol in the instruction symbol starts with Z_ is the instruction corresponding to the special function unit, but the instruction is not limited to Z_.
For example, an instruction starting with X_, Y_ is a special function unit corresponding instruction, X_ is an analog special function unit corresponding instruction, Y_ is a link special function unit corresponding instruction, and Z is
If _ is used properly like other special function unit compatible instructions, the program will be easier to read.
【0098】また、Z_で始まる命令名が特殊機能ユニ
ット対応命令であるとしたが、CPUユニットが標準で
装備する(サポートする)命令名以外を特殊機能ユニッ
ト対応命令であるとしてもよい。すなわち、特殊機能種
別を示す第2の記号が特殊機能ユニット対応命令である
ことを示す第1の記号の役割も兼ね示す。さらに、Z_
が特殊機能ユニット対応命令の判断基準であるとした
が、命令名等が中間コードに変換されプログラムメモリ
に格納されており、その中間コードにより、特殊機能ユ
ニット対応命令であるか判断してもよい。Further, the instruction name starting with Z_ is the special function unit corresponding instruction, but the instruction name other than the standard (equipped) instruction of the CPU unit may be the special function unit corresponding instruction. That is, it also serves as the first symbol indicating that the second symbol indicating the special function type is the special function unit corresponding instruction. Furthermore, Z_
Is the criterion for the special function unit corresponding instruction, but the instruction name etc. is converted into an intermediate code and stored in the program memory, and the intermediate code may determine whether the instruction is a special function unit corresponding instruction. .
【0099】さらに、特殊機能ユニットに対する実行要
求をCPUユニットから特殊機能ユニットに割り込みを
かけることにより行なうようにしたが、特殊機能ユニッ
ト内のフリップフロップ(図示せず)をCPUユニット
1が立て、特殊機能ユニットがそれをポーリンリングし
て実行要求があったか判断してもよいし、CPUユニッ
ト1が特殊機能ユニット内の2ポートメモリに実行要求
のコードを書き込み、特殊機能ユニット4がそれをポー
リングして実行要求があったか判断してもよい。Further, although the execution request to the special function unit is made by interrupting the special function unit from the CPU unit, the CPU unit 1 sets up a flip-flop (not shown) in the special function unit, The functional unit may poll it to determine whether there is an execution request, or the CPU unit 1 writes the execution request code in the 2-port memory in the special function unit, and the special function unit 4 polls it. It may be judged whether there is an execution request.
【0100】なお、上記実施例においては2ポートメモ
リを用いているが、2ポートメモリ用いてCPU部1と
特殊機能部4に属するデータおよびアドレスバスを切替
える方法であってもよい。Although the two-port memory is used in the above embodiment, a method of switching the data and address buses belonging to the CPU unit 1 and the special function unit 4 by using the two-port memory may be used.
【0101】また、実施例1〜実施例8においてはシー
ケンス制御装置であるプログラマブルコントローラを例
にとり説明したが、プログラマブルコントローラ以外
の、例えば、数値制御装置等にも適用できる。Further, although the programmable controller which is the sequence control device has been described as an example in the first to eighth embodiments, the present invention can be applied to a numerical control device or the like other than the programmable controller.
【0102】[0102]
【発明の効果】以上のようにこの発明によれば、D/A
変換ユニット等の特殊機能ユニットの命令であることを
示す第1コードと、特殊機能ユニットの機能を示すとと
もに特殊機能ユニットに複数のチャネルがあり使用する
チャネルを指定する必要がある場合にはさらにチャネル
番号情報を有する第2コードと、特殊機能ユニットの装
着位置と、デバイスメモリのアドレスや印刷位置情報等
の作用情報と、が記述された特殊機能命令を有するシー
ケンスプログラムをCPUユニットが実行するように
し、その実行方法として、特殊機能ユニットに設けられ
CPUユニットからアクセス可能な第1記憶手段に、第
2コード、特殊機能ユニットの双方向アクセス記憶手段
のアドレス、および、転送点数等からなる固有情報が特
殊機能ユニットにより処理可能な所定数の特殊機能命令
について予め格納され、シーケンスプログラムをCPU
ユニットが実行し特殊機能命令が呼び出され、呼び出さ
れた特殊機能命令に対応する固有情報が第1記憶手段に
格納されているか否か第1記憶手段の記憶内容にもとづ
きCPUユニットが判定し、一致するものが格納されて
いればその固有情報と特殊機能命令に記述されている情
報とにもとづき特殊機能命令に対応する入力/出力命令
区分と特殊機能ユニットの装着位置とデバイスメモリの
アドレスと双方向アクセス記憶手段のアドレスと転送点
数とを有するシーケンスプログラム命令をCPUユニッ
トが実行し特殊機能ユニットを介してこのシーケンスプ
ログラム命令にもとづく所定の処理を行うようにしたの
で、特殊機能対応命令及びその種別を表わす命令記号を
用いた命令形式の命令ステップを有するプログラムを実
行することにより、特殊機能ユニットにおける双方向ア
クセス記憶手段のアドレスを意識せずにプログラム作成
が可能になり、命令形式をみてその命令が指定する特殊
機能ユニットが制御する制御対象が分かり、プログラム
の可読性が高くプログラム設計および保守効率を向上で
きるとともに、第1記憶手段を例えば不揮発性メモリと
し予め第1記憶手段に固有情報を格納しておくことによ
り各種の特殊機能ユニットのそれぞれに対してCPUユ
ニットは同一の処理を行えばよくなるので例えば新たな
機能を有する特殊機能ユニットを採用する場合や特殊機
能ユニットの機能の変更を行う場合にもCPUユニット
のシステムプログラムの変更等による作業の増加を防止
できる効果がある。As described above, according to the present invention, the D / A
A first code indicating that it is an instruction of a special function unit such as a conversion unit, and a function that indicates the function of the special function unit, and if there are multiple channels in the special function unit and it is necessary to specify the channel to be used, further The CPU unit executes the sequence program having the special function command in which the second code having the number information, the mounting position of the special function unit, and the action information such as the address of the device memory and the printing position information are described. As the execution method, the first storage means provided in the special function unit and accessible from the CPU unit stores the unique information such as the second code, the address of the bidirectional access storage means of the special function unit, and the number of transfer points. Pre-stored for a certain number of special function commands that can be processed by the special function unit. , CPU sequence program
The unit executes and the special function instruction is called. Whether the unique information corresponding to the called special function instruction is stored in the first storage means is determined by the CPU unit based on the content stored in the first storage means, and the two match. If the stored information is stored, the input / output command classification corresponding to the special function command, the mounting position of the special function unit, the address of the device memory, and the bidirectional based on the unique information and the information described in the special function command. Since the CPU unit executes the sequence program instruction having the address of the access storage means and the number of transfer points and performs the predetermined processing based on the sequence program instruction through the special function unit, the special function corresponding instruction and its type are specified. By executing a program having instruction steps in the instruction format using the indicated instruction symbol A program can be created without considering the address of the bidirectional access storage means in the special function unit, and the control target controlled by the special function unit specified by the instruction can be seen by looking at the instruction format, and the program readability is high and the program design Further, the maintenance efficiency can be improved, and by storing the unique information in the first storage means in advance as the first storage means, for example, a non-volatile memory, the CPU unit performs the same processing for each of various special function units. Since it is sufficient if the special function unit having a new function is adopted or the function of the special function unit is changed, an increase in the work due to the change of the system program of the CPU unit can be prevented.
【0103】また、D/A変換ユニット等の特殊機能ユ
ニットの命令であることを示す第1コードと、特殊機能
ユニットの機能を示すとともに特殊機能ユニットに複数
のチャネルがあり使用するチャネルを指定する必要があ
る場合にはさらにチャネル番号情報を有する第2コード
と、特殊機能ユニットの装着位置と、デバイスメモリの
アドレスや印刷位置情報等の作用情報と、が記述された
特殊機能命令を有するシーケンスプログラムをCPUユ
ニットが実行するようにし、その実行方法として、特殊
機能ユニットに設けられCPUユニットからアクセス可
能な第1記憶手段に、第2コード、特殊機能ユニットの
双方向アクセス記憶手段のアドレス、および、転送点数
等からなる固有情報が特殊機能ユニットにより処理可能
な所定数の特殊機能命令について予め格納され、第1記
憶手段の記憶内容がCPUユニットの第2記憶手段に転
送される段階、シーケンスプログラムをCPUユニット
が実行し特殊機能命令が呼び出され、呼び出された特殊
機能命令に対応する固有情報が第2記憶手段に格納され
ているか否か第2記憶手段の記憶内容にもとづきCPU
ユニットが判定し、一致するものが格納されていればそ
の固有情報と特殊機能命令に記述されている情報とにも
とづき特殊機能命令に対応する入力/出力命令区分と特
殊機能ユニットの装着位置とデバイスメモリのアドレス
と双方向アクセス記憶手段のアドレスと転送点数とを有
するシーケンスプログラム命令をCPUユニットが実行
し特殊機能ユニットを介してこのシーケンスプログラム
命令にもとづく所定の処理を行うようにしたので、請求
項1の発明の効果に加えて処理の迅速化ができる効果が
ある。Further, the first code indicating the instruction of the special function unit such as the D / A conversion unit and the function of the special function unit are shown, and the special function unit has a plurality of channels and the channel to be used is designated. If necessary, a sequence program having a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information are described. Is executed by the CPU unit, and as a method for executing the same, the second code, the address of the bidirectional access storage unit of the special function unit, and the first storage unit provided in the special function unit and accessible from the CPU unit, A specific number of special machines that can process unique information such as the number of transfer points by a special function unit The instruction is stored in advance and the stored content of the first storage means is transferred to the second storage means of the CPU unit, the CPU unit executes the sequence program to call the special function instruction, and corresponds to the called special function instruction. Whether or not the unique information stored in the second storage means is stored in the CPU based on the stored contents of the second storage means.
If the unit judges and if a match is stored, the input / output command category corresponding to the special function command, the mounting position of the special function unit, and the device based on the unique information and the information described in the special function command. Since the CPU unit executes the sequence program instruction having the memory address, the address of the bidirectional access storage means, and the number of transfer points, and the predetermined processing based on the sequence program instruction is performed through the special function unit. In addition to the effect of the first aspect of the invention, there is an effect that the processing can be speeded up.
【0104】また、D/A変換ユニット等の特殊機能ユ
ニットの命令であることを示す第1コードと、特殊機能
ユニットの機能を示すとともに特殊機能ユニットに複数
のチャネルがあり使用するチャネルを指定する必要があ
る場合にはさらにチャネル番号情報を有する第2コード
と、特殊機能ユニットの装着位置と、デバイスメモリア
ドレスや印刷位置情報等の作用情報と、が記述された特
殊機能命令を有するシーケンスプログラムをCPUユニ
ットが実行するようにし、その実行方法として、特殊機
能ユニットに設けられCPUユニットからアクセス可能
な第1記憶手段に、第2コードと、特殊機能命令に対応
する入力/出力命令区分と特殊機能ユニットの装着位置
とデバイスメモリのアドレスと特殊機能ユニットに設け
られた双方向アクセス記憶手段のアドレスと転送点数と
を有するシーケンスプログラム命令とが特殊機能ユニッ
トにより処理可能な所定数の特殊機能命令について予め
格納され、シーケンスプログラムをCPUユニットが実
行し特殊機能命令が呼び出され、呼び出された特殊機能
命令に対応する第2コードと、特殊機能命令に対応する
所定数のシーケンスプログラム命令とが第1記憶手段に
格納されているか否か第1記憶手段の記憶内容にもとづ
きCPUユニットが判定し、一致するものが格納されて
いればその所定数のシーケンスプログラム命令をCPU
ユニットが実行し特殊機能ユニットを介してこの所定数
のシーケンスプログラム命令にもとづく所定の処理を行
うようにしたので、請求項1の発明の効果に加えてCP
Uユニットの負荷を軽減できる効果がある。Also, the first code indicating that it is an instruction of a special function unit such as a D / A conversion unit, the function of the special function unit, and the special function unit having a plurality of channels are designated. If necessary, a sequence program having a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information are described. The CPU unit is executed, and as an execution method thereof, the second code, the input / output command classification corresponding to the special function command, and the special function are stored in the first storage means provided in the special function unit and accessible from the CPU unit. The mounting position of the unit, the address of the device memory, and the bidirectional access provided in the special function unit. A sequence program instruction having the address of the memory means and the number of transfer points is stored in advance for a predetermined number of special function instructions which can be processed by the special function unit, and the CPU unit executes the sequence program to call the special function instruction. Whether the second code corresponding to the special function instruction and the predetermined number of sequence program instructions corresponding to the special function instruction are stored in the first storage means, the CPU unit determines whether or not the first storage means stores the second code. It is judged, and if a matching one is stored, the predetermined number of sequence program instructions are stored in the CPU.
The unit executes the predetermined processing based on the predetermined number of sequence program instructions through the special function unit.
This has the effect of reducing the load on the U unit.
【0105】また、D/A変換ユニット等の特殊機能ユ
ニットの命令であることを示す第1コードと、特殊機能
ユニットの機能を示すとともに特殊機能ユニットに複数
のチャネルがあり使用するチャネルを指定する必要があ
る場合にはさらにチャネル番号情報を有する第2コード
と、特殊機能ユニットの装着位置と、デバイスメモリの
アドレスや印刷位置情報等の作用情報と、が記述された
特殊機能命令を有するシーケンスプログラムをCPUユ
ニットが実行するようにし、その実行方法として、特殊
機能ユニットに設けられCPUユニットからアクセス可
能な第1記憶手段に、第2コードと、特殊機能命令に対
応する入力/出力命令区分と特殊機能ユニットの装着位
置とデバイスメモリのアドレスと特殊機能ユニットに設
けられた双方向アクセス記憶手段のアドレスと転送点数
とを有する所定数のシーケンスプログラム命令とが特殊
機能ユニットにより処理可能な所定数の特殊機能命令に
ついて予め格納され、第1記憶手段の記憶内容がCPU
ユニットの第2記憶手段に転送される段階、シーケンス
プログラムをCPUユニットが実行し特殊機能命令が呼
び出され、呼び出された特殊機能命令に対応する第2コ
ードと、特殊機能命令に対応する所定数のシーケンスプ
ログラム命令とが第2記憶手段に格納されているか否か
第2記憶手段の記憶内容にもとづきCPUユニットが判
定し、一致するものが格納されていればその所定数のシ
ーケンスプログラム命令をCPUユニットが実行し特殊
機能ユニットを介してこの所定数のシーケンスプログラ
ム命令にもとづく所定の処理を行うようにしたので、請
求項3の発明の効果に加えて処理を迅速化できる効果が
ある。Also, the first code indicating that it is an instruction of a special function unit such as a D / A conversion unit, and the function of the special function unit are indicated, and the special function unit has a plurality of channels, and the channel to be used is designated. If necessary, a sequence program having a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information are described. Is executed by the CPU unit. As an execution method, a second code and an input / output command classification corresponding to the special function command and a special code are stored in a first storage means provided in the special function unit and accessible from the CPU unit. The mounting position of the functional unit, the address of the device memory, and the bidirectional address provided in the special functional unit. And a predetermined number of sequence program instructions including an address and transfer count Seth storage means are previously stored for the special function instructions of a predetermined number that can be processed by a special function unit, the storage contents of the first memory means CPU
At the stage of being transferred to the second storage means of the unit, the CPU unit executes the sequence program to call the special function instruction, the second code corresponding to the called special function instruction, and the predetermined number of the special function instruction. The CPU unit determines whether or not the sequence program command is stored in the second storage unit based on the storage content of the second storage unit, and if a matching one is stored, the predetermined number of sequence program commands are stored in the CPU unit. Is executed and the predetermined processing based on the predetermined number of sequence program instructions is executed by the special function unit. Therefore, the processing can be speeded up in addition to the effect of the invention of claim 3.
【0106】また、シーケンスプログラムス命令はマイ
コンプログラム命令により構成されるようにしたので、
広範な制御を行うことができる効果がある。Since the sequence program command is constituted by the microcomputer program command,
There is an effect that a wide range of control can be performed.
【0107】また、第1メモリは双方向アクセス記憶手
段の所定のエリアであるようにしたので、コストが上昇
する場合もあるが特殊機能ユニットのハードウエア構成
を簡略化できる効果がある。Further, since the first memory is the predetermined area of the bidirectional access storage means, the cost may increase, but the hardware structure of the special function unit can be simplified.
【図1】この発明の実施例1〜実施例8による特殊命令
の形式を示す図である。FIG. 1 is a diagram showing a format of a special instruction according to Embodiments 1 to 8 of the present invention.
【図2】この発明の実施例1〜実施例8における特殊命
令の例を示す図である。FIG. 2 is a diagram showing an example of special instructions in Embodiments 1 to 8 of the present invention.
【図3】この発明の実施例1における2ポートメモリ4
1の記憶内容(特殊命令用情報の内容)例である。FIG. 3 is a 2-port memory 4 according to the first embodiment of the present invention.
2 is an example of the stored contents of 1 (contents of special instruction information).
【図4】この発明の実施例1における特殊命令を実行す
るときのCPUユニットの処理を示す動作フロー図であ
る。FIG. 4 is an operational flowchart showing the processing of the CPU unit when executing a special instruction in the first embodiment of the present invention.
【図5】この発明の実施例2における各特殊機能ユニッ
トそれぞれの特殊命令用情報格納メモリ41の記憶内容
の例を示す図である。FIG. 5 is a diagram showing an example of stored contents of a special command information storage memory 41 of each special function unit in Embodiment 2 of the present invention.
【図6】この発明の実施例2における特殊命令を実行す
るときのCPUユニットの処理を示す動作フロー図であ
る。FIG. 6 is an operational flowchart showing the processing of the CPU unit when executing a special instruction in the second embodiment of the present invention.
【図7】この発明の実施例1〜実施例2、および、従来
例に共通なプログラマブルコントローラのシステム構成
図である。FIG. 7 is a system configuration diagram of a programmable controller common to first and second embodiments of the present invention and a conventional example.
【図8】この発明の実施例3におけるプログラマブルコ
ントローラの構成図である。FIG. 8 is a configuration diagram of a programmable controller according to a third embodiment of the present invention.
【図9】この発明の実施例4におけるプログラマブルコ
ントローラの構成図である。FIG. 9 is a configuration diagram of a programmable controller according to a fourth embodiment of the present invention.
【図10】この発明の実施例4における各特殊機能ユニ
ットそれぞれの特殊命令用情報を格納するためのCPU
ユニット内のメモリ13の記憶内容の例を示す図であ
る。FIG. 10 is a CPU for storing special command information of each special function unit according to the fourth embodiment of the present invention.
It is a figure which shows the example of the memory content of the memory 13 in a unit.
【図11】この発明の実施例4における特殊機能ユニッ
ト内のメモリに格納された特殊命令用情報メモリ42の
内容をCPUユニット内のメモリ13に転送するときの
CPUユニットの処理を示す動作フロー図である。FIG. 11 is an operational flowchart showing the processing of the CPU unit when transferring the contents of the special instruction information memory 42 stored in the memory of the special function unit to the memory 13 of the CPU unit according to the fourth embodiment of the present invention. Is.
【図12】この発明の実施例5におけるプログラマブル
コントローラの構成図である。FIG. 12 is a configuration diagram of a programmable controller according to a fifth embodiment of the present invention.
【図13】この発明の実施例5〜実施例6におけるメモ
リ43の記憶内容(特殊命令用シーケンスメモリの内容)
例を示す図である。FIG. 13 is a storage content of a memory 43 (contents of a special instruction sequence memory) in the fifth to sixth embodiments of the present invention.
It is a figure showing an example.
【図14】この発明の実施例5〜実施例6におけるメモ
リ43に格納されている特殊命令に対応するシーケンス
プログラムの例を示す図である。FIG. 14 is a diagram showing an example of a sequence program corresponding to a special instruction stored in the memory 43 in the fifth to sixth embodiments of the present invention.
【図15】この発明の実施例6における特殊命令を実行
するときのCPUユニットの処理を示す動作フロー図で
ある。FIG. 15 is an operation flowchart showing processing of the CPU unit when executing a special instruction in the sixth embodiment of the present invention.
【図16】この発明の実施例6におけるプログラマブル
コントローラの構成図である。FIG. 16 is a configuration diagram of a programmable controller according to a sixth embodiment of the present invention.
【図17】この発明の実施例6における各特殊機能ユニ
ットそれぞれの特殊命令用シーケンスプログラムを格納
するためのメモリ14の記憶内容の例を示す図である。FIG. 17 is a diagram showing an example of stored contents of a memory 14 for storing a special instruction sequence program for each special function unit in Embodiment 6 of the present invention.
【図18】この発明の実施例6における特殊機能ユニッ
ト内のメモリに格納された特殊命令用シーケンスメモリ
43の内容をCPUユニット内のメモリ14に転送する
ときのCPUユニットの処理を示す動作フロー図であ
る。FIG. 18 is an operation flowchart showing the processing of the CPU unit when transferring the contents of the special instruction sequence memory 43 stored in the memory of the special function unit to the memory 14 of the CPU unit according to the sixth embodiment of the present invention. Is.
【図19】この発明の実施例7におけるプログラマブル
コントローラの構成図である。FIG. 19 is a configuration diagram of a programmable controller according to a seventh embodiment of the present invention.
【図20】この発明の実施例8におけるプログラマブル
コントローラの構成図である。FIG. 20 is a configuration diagram of a programmable controller according to an eighth embodiment of the present invention.
【図21】バッファメモリの記憶内容の例を示す図であ
る。FIG. 21 is a diagram showing an example of stored contents of a buffer memory.
【図22】従来の特殊命令の形式を示す図である。FIG. 22 is a diagram showing a format of a conventional special instruction.
【図23】従来の特殊機能ユニットへデータの書き込み
を行う命令の例を示す図である。FIG. 23 is a diagram showing an example of an instruction for writing data to a conventional special function unit.
1 、1A、1B、1C CPUユニット 11 プログラムメモリ 12 デバイスメモリ 13 特殊命令用情報メモリ 14 特殊命令用シーケンスメモリ 15 特殊命令用マイコンメモリ 2 プログラム装置 3 通信ケーブル 4 入出力ユニット 4A、4B、4C、4D 特殊機能ユニット 41 2ポートメモリ 42 特殊命令用情報メモリ 43 特殊命令用シーケンスメモリ 44 特殊命令用マイコンメモリ 45 バッファメモリ 1, 1A, 1B, 1C CPU unit 11 Program memory 12 Device memory 13 Special instruction information memory 14 Special instruction sequence memory 15 Special instruction microcomputer memory 2 Program device 3 Communication cable 4 Input / output unit 4A, 4B, 4C, 4D Special function unit 41 2-port memory 42 Special instruction information memory 43 Special instruction sequence memory 44 Special instruction microcomputer memory 45 Buffer memory
Claims (6)
トの命令であることを示す第1コードと、上記特殊機能
ユニットの機能を示すとともに上記特殊機能ユニットに
複数のチャネルがあり使用するチャネルを指定する必要
がある場合にはさらにチャネル番号情報を有する第2コ
ードと、上記特殊機能ユニットの装着位置と、デバイス
メモリのアドレスや印刷位置情報等の作用情報と、が記
述された特殊機能命令を有するシーケンスプログラムを
CPUユニットが実行し、制御対象からの入力情報、上
記制御対象に設けられたコイル等の出力機器を制御する
出力情報、および、内部情報を記憶する上記デバイスメ
モリの記憶内容にもとづき上記制御対象を制御するシー
ケンス制御方法であって、 上記特殊機能ユニットに設けられ上記CPUユニットか
らアクセス可能な第1記憶手段に、上記第2コード、上
記特殊機能ユニットの双方向アクセス記憶手段のアドレ
ス、および、転送点数等からなる固有情報が上記特殊機
能ユニットにより処理可能な所定数の上記特殊機能命令
について予め格納される段階、 上記シーケンスプログラムを上記CPUユニットが実行
し上記特殊機能命令が呼び出される段階、 呼び出された上記特殊機能命令に対応する上記固有情報
が上記第1記憶手段に格納されているか否か上記第1記
憶手段の記憶内容にもとづき上記CPUユニットが判定
し、一致するものが格納されていればその固有情報と上
記特殊機能命令に記述されている情報とにもとづき上記
特殊機能命令に対応する入力/出力命令区分と上記特殊
機能ユニットの装着位置と上記デバイスメモリのアドレ
スと上記双方向アクセス記憶手段のアドレスと上記転送
点数とを有するシーケンスプログラム命令を上記CPU
ユニットが実行し上記特殊機能ユニットを介して上記シ
ーケンスプログラム命令にもとづく所定の処理を行う段
階、を有することを特徴とするシーケンス制御方法。1. A first code indicating an instruction of a special function unit such as a D / A conversion unit, a function of the special function unit and a channel to be used when the special function unit has a plurality of channels. When it is necessary to specify, a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information is further described. Based on the input information from the control target, the output information for controlling the output device such as the coil provided in the control target, and the stored contents of the device memory for storing the internal information when the CPU unit executes the sequence program. A sequence control method for controlling the controlled object, comprising the CPU unit provided in the special function unit. A predetermined number of unique information, such as the second code, the address of the bidirectional access storage means of the special function unit, and the number of transfer points, which can be accessed by the special function unit, in the first storage means accessible by the special function unit. Of the special function instruction stored in advance, the step of executing the sequence program by the CPU unit to call the special function instruction, the unique information corresponding to the called special function instruction is stored in the first storage means. Stored in the first storage means, the CPU unit determines based on the stored contents of the first storage means, and if a matching one is stored, based on the unique information and the information described in the special function command. Input / output command category corresponding to the special function command, mounting position of the special function module, and device memory The CPU sequence program instruction having an address and the transfer count address and said bidirectional access memory means
A sequence control method, comprising the step of: executing a unit and performing a predetermined process based on the sequence program instruction via the special function unit.
トの命令であることを示す第1コードと、上記特殊機能
ユニットの機能を示すとともに上記特殊機能ユニットに
複数のチャネルがあり使用するチャネルを指定する必要
がある場合にはさらにチャネル番号情報を有する第2コ
ードと、上記特殊機能ユニットの装着位置と、デバイス
メモリのアドレスや印刷位置情報等の作用情報と、が記
述された特殊機能命令を有するシーケンスプログラムを
CPUユニットが実行し、制御対象からの入力情報、上
記制御対象に設けられたコイル等の出力機器を制御する
出力情報、および、内部情報を記憶する上記デバイスメ
モリの記憶内容にもとづき上記制御対象を制御するシー
ケンス制御方法であって、 上記特殊機能ユニットに設けられ上記CPUユニットか
らアクセス可能な第1記憶手段に、上記第2コード、上
記特殊機能ユニットの双方向アクセス記憶手段のアドレ
ス、および、転送点数等からなる固有情報が上記特殊機
能ユニットにより処理可能な所定数の上記特殊機能命令
について予め格納される段階、 上記第1記憶手段の記憶内容が上記CPUユニットの第
2記憶手段に転送される段階、 上記シーケンスプログラムを上記CPUユニットが実行
し上記特殊機能命令が呼び出される段階、 呼び出された上記特殊機能命令に対応する上記固有情報
が上記第2記憶手段に格納されているか否か上記第2記
憶手段の記憶内容にもとづき上記CPUユニットが判定
し、一致するものが格納されていればその固有情報と上
記特殊機能命令に記述されている情報とにもとづき上記
特殊機能命令に対応する入力/出力命令区分と上記特殊
機能ユニットの装着位置と上記デバイスメモリのアドレ
スと上記双方向アクセス記憶手段のアドレスと上記転送
点数とを有するシーケンスプログラム命令を上記CPU
ユニットが実行し上記特殊機能ユニットを介して上記シ
ーケンスプログラム命令にもとづく所定の処理を行う段
階、を有することを特徴とするシーケンス制御方法。2. A first code indicating an instruction of a special function unit such as a D / A conversion unit, a function of the special function unit, and a channel to be used when the special function unit has a plurality of channels. When it is necessary to specify, a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information is further described. Based on the input information from the control target, the output information for controlling the output device such as the coil provided in the control target, and the stored contents of the device memory for storing the internal information when the CPU unit executes the sequence program. A sequence control method for controlling the controlled object, comprising the CPU unit provided in the special function unit. A predetermined number of unique information such as the second code, the address of the bidirectional access storage means of the special function unit, and the number of transfer points that can be processed by the special function unit in the first storage means accessible from the computer. The step of pre-storing the special function instruction, the step of transferring the stored contents of the first storage means to the second storage means of the CPU unit, the CPU unit executing the sequence program, and the special function instruction The step of being called, whether or not the unique information corresponding to the called special function command is stored in the second storage means, the CPU unit determines based on the stored contents of the second storage means, and matches If is stored in the special function instruction based on the unique information and the information described in the special function instruction. A sequence program command having a corresponding input / output command classification, a mounting position of the special function unit, an address of the device memory, an address of the bidirectional access storage means, and the number of transfer points is stored in the CPU.
A sequence control method, comprising the step of: executing a unit and performing a predetermined process based on the sequence program instruction via the special function unit.
トの命令であることを示す第1コードと、上記特殊機能
ユニットの機能を示すとともに上記特殊機能ユニットに
複数のチャネルがあり使用するチャネルを指定する必要
がある場合にはさらにチャネル番号情報を有する第2コ
ードと、上記特殊機能ユニットの装着位置と、デバイス
メモリのアドレスや印刷位置情報等の作用情報と、が記
述された特殊機能命令を有するシーケンスプログラムを
CPUユニットが実行し、制御対象からの入力情報、上
記制御対象に設けられたコイル等の出力機器を制御する
出力情報、および、内部情報を記憶する上記デバイスメ
モリの記憶内容にもとづき上記制御対象を制御するシー
ケンス制御方法であって、 上記特殊機能ユニットに設けられ上記CPUユニットか
らアクセス可能な第1記憶手段に、上記第2コードと、
上記特殊機能命令に対応する入力/出力命令区分と上記
特殊機能ユニットの装着位置と上記デバイスメモリのア
ドレスと上記特殊機能ユニットに設けられた双方向アク
セス記憶手段のアドレスと転送点数とを有する所定数の
シーケンスプログラム命令とが上記特殊機能ユニットに
より処理可能な所定数の上記特殊機能命令について予め
格納される段階、 上記シーケンスプログラムを上記CPUユニットが実行
し上記特殊機能命令が呼び出される段階、 呼び出された上記特殊機能命令に対応する上記第2コー
ドと、上記特殊機能命令に対応する上記所定数のシーケ
ンスプログラム命令とが上記第1記憶手段に格納されて
いるか否か上記第1記憶手段の記憶内容にもとづき上記
CPUユニットが判定し、一致するものが格納されてい
ればその所定数のシーケンスプログラム命令を上記CP
Uユニットが実行し上記特殊機能ユニットを介して上記
所定数のシーケンスプログラム命令にもとづく所定の処
理を行う段階、を有することを特徴とするシーケンス制
御方法。3. A first code indicating an instruction of a special function unit such as a D / A conversion unit, a function of the special function unit, and a channel to be used when the special function unit has a plurality of channels. When it is necessary to specify, a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information is further described. Based on the input information from the control target, the output information for controlling the output device such as the coil provided in the control target, and the stored contents of the device memory for storing the internal information when the CPU unit executes the sequence program. A sequence control method for controlling the controlled object, comprising the CPU unit provided in the special function unit. In the first storage means accessible from Tsu DOO, and the second code,
A predetermined number having an input / output command category corresponding to the special function command, a mounting position of the special function unit, an address of the device memory, an address of a bidirectional access storage means provided in the special function unit, and a transfer point. The sequence program command of is stored in advance for a predetermined number of the special function commands that can be processed by the special function unit, the step of executing the sequence program by the CPU unit, and the special function command is called. Whether or not the second code corresponding to the special function instruction and the predetermined number of sequence program instructions corresponding to the special function instruction are stored in the first storage means is stored in the first storage means. Based on the above, the CPU unit makes a judgment, and if there is a match, then that location The CP the number of sequence program instructions
And a step of executing a predetermined process based on the predetermined number of sequence program instructions executed by the U unit via the special function unit.
トの命令であることを示す第1コードと、上記特殊機能
ユニットの機能を示すとともに上記特殊機能ユニットに
複数のチャネルがあり使用するチャネルを指定する必要
がある場合にはさらにチャネル番号情報を有する第2コ
ードと、上記特殊機能ユニットの装着位置と、デバイス
メモリのアドレスや印刷位置情報等の作用情報と、が記
述された特殊機能命令を有するシーケンスプログラムを
CPUユニットが実行し、制御対象からの入力情報、上
記制御対象に設けられたコイル等の出力機器を制御する
出力情報、および、内部情報を記憶する上記デバイスメ
モリの記憶内容にもとづき上記制御対象を制御するシー
ケンス制御方法であって、 上記特殊機能ユニットに設けられ上記CPUユニットか
らアクセス可能な第1記憶手段に、上記第2コードと、
上記特殊機能命令に対応する入力/出力命令区分と上記
特殊機能ユニットの装着位置と上記デバイスメモリのア
ドレスと上記特殊機能ユニットに設けられた双方向アク
セス記憶手段のアドレスと転送点数とを有する所定数の
シーケンスプログラム命令とが上記特殊機能ユニットに
より処理可能な所定数の上記特殊機能命令について予め
格納される段階、 上記第1記憶手段の記憶内容が上記CPUユニットの第
2記憶手段に転送される段階、 上記シーケンスプログラムを上記CPUユニットが実行
し上記特殊機能命令が呼び出される段階、 呼び出された上記特殊機能命令に対応する上記第2コー
ドと、上記特殊機能命令に対応する上記所定数のシーケ
ンスプログラム命令とが上記第2記憶手段に格納されて
いるか否か上記第2記憶手段の記憶内容にもとづき上記
CPUユニットが判定し、一致するものが格納されてい
ればその所定数のシーケンスプログラム命令を上記CP
Uユニットが実行し上記特殊機能ユニットを介して上記
所定数のシーケンスプログラム命令にもとづく所定の処
理を行う段階、を有することを特徴とするシーケンス制
御方法。4. A first code indicating an instruction of a special function unit such as a D / A conversion unit, a function of the special function unit, and a channel to be used when the special function unit has a plurality of channels. When it is necessary to specify, a special function command in which a second code having channel number information, a mounting position of the special function unit, and action information such as device memory address and printing position information is further described. Based on the input information from the control target, the output information for controlling the output device such as the coil provided in the control target, and the stored contents of the device memory for storing the internal information when the CPU unit executes the sequence program. A sequence control method for controlling the controlled object, comprising the CPU unit provided in the special function unit. In the first storage means accessible from Tsu DOO, and the second code,
A predetermined number having an input / output command category corresponding to the special function command, a mounting position of the special function unit, an address of the device memory, an address of a bidirectional access storage means provided in the special function unit, and a transfer point. And a sequence program command of 5 are stored in advance for a predetermined number of the special function commands that can be processed by the special function unit, and the contents stored in the first storage unit are transferred to the second storage unit of the CPU unit. A step in which the CPU unit executes the sequence program to call the special function instruction, the second code corresponding to the called special function instruction, and the predetermined number of sequence program instructions corresponding to the special function instruction Whether or not and are stored in the second storage means. The CPU unit determines based on the volume, if a match is only to be stored in the predetermined number sequence program instructions the CP
And a step of executing a predetermined process based on the predetermined number of sequence program instructions executed by the U unit via the special function unit.
ログラム命令により構成されることを特徴とする請求項
3または請求項4記載のシーケンス制御方法。5. The sequence control method according to claim 3, wherein the sequence program command is constituted by a microcomputer program command.
所定のエリアであることを特徴とする請求項1乃至請求
項5記載のシーケンス制御方法。6. The sequence control method according to claim 1, wherein the first memory is a predetermined area of the bidirectional access storage means.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3286221A JP2542465B2 (en) | 1990-10-31 | 1991-10-31 | Sequence control method |
Applications Claiming Priority (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2-294504 | 1990-10-31 | ||
| JP29450490 | 1990-10-31 | ||
| JP3286221A JP2542465B2 (en) | 1990-10-31 | 1991-10-31 | Sequence control method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH056208A JPH056208A (en) | 1993-01-14 |
| JP2542465B2 true JP2542465B2 (en) | 1996-10-09 |
Family
ID=26556216
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP3286221A Expired - Lifetime JP2542465B2 (en) | 1990-10-31 | 1991-10-31 | Sequence control method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2542465B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101473282B (en) * | 2006-07-13 | 2012-10-17 | 三菱电机株式会社 | Equipment management system, programmable controller and centralization controller |
| JP5218874B2 (en) * | 2009-04-09 | 2013-06-26 | 株式会社パトライト | Warning light, warning light system, and light emission control method of warning light |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS608939A (en) * | 1983-06-28 | 1985-01-17 | Fujitsu Ltd | Special function set-up controlling system |
| JPS63116209A (en) * | 1986-11-05 | 1988-05-20 | Mitsubishi Electric Corp | Sequence controller |
-
1991
- 1991-10-31 JP JP3286221A patent/JP2542465B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH056208A (en) | 1993-01-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4683549A (en) | Sequence control method and apparatus | |
| JP2610812B2 (en) | Emulation of data processing system | |
| US4855936A (en) | Full-screen input/output application program interface | |
| EP0098172B1 (en) | Register control processing system | |
| JPS6355119B2 (en) | ||
| JP2542465B2 (en) | Sequence control method | |
| US4314332A (en) | Memory control system | |
| JPS646475B2 (en) | ||
| EP0059758A1 (en) | Numerical control unit | |
| US6182207B1 (en) | Microcontroller with register system for the indirect accessing of internal memory via auxiliary register | |
| JPH0196750A (en) | Data processing system | |
| CN108932171B (en) | Embedded software interaction method | |
| JPH06187015A (en) | Sequencer program converter | |
| US5565895A (en) | Programmable controller with independent display | |
| US4882672A (en) | System for initialization of channel controllers utilizing address pointers calculated from multiplying sizes of data fields with device numbers | |
| JP3362347B2 (en) | Serial communication interface and serial communication interface method | |
| JPS6055911B2 (en) | main storage | |
| JPS6240736B2 (en) | ||
| JP2593548B2 (en) | Data processing device | |
| HK1006042A1 (en) | Control apparatus controlling process | |
| JPH03144705A (en) | Operation state monitor for programmable controller | |
| KR940001013B1 (en) | Image processing device and system using it | |
| JP2697901B2 (en) | Character processor | |
| Shaylor | A general purpose CAMAC handler for RSX11M generating a system with the dual CAMAC driver | |
| JPH1027153A (en) | Bus transfer device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20070725 Year of fee payment: 11 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080725 Year of fee payment: 12 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090725 Year of fee payment: 13 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100725 Year of fee payment: 14 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100725 Year of fee payment: 14 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110725 Year of fee payment: 15 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110725 Year of fee payment: 15 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120725 Year of fee payment: 16 |
|
| EXPY | Cancellation because of completion of term | ||
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120725 Year of fee payment: 16 |