JPH1196017A - Programmable controller system and its program preparing method - Google Patents

Programmable controller system and its program preparing method

Info

Publication number
JPH1196017A
JPH1196017A JP9252430A JP25243097A JPH1196017A JP H1196017 A JPH1196017 A JP H1196017A JP 9252430 A JP9252430 A JP 9252430A JP 25243097 A JP25243097 A JP 25243097A JP H1196017 A JPH1196017 A JP H1196017A
Authority
JP
Japan
Prior art keywords
program
register
variable symbol
programmable controller
cpu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP9252430A
Other languages
Japanese (ja)
Inventor
Hideyuki Odaka
秀之 小高
Yuji Suzuki
祐司 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuji Electric Co Ltd
FFC Ltd
Original Assignee
Fuji Electric Co Ltd
FFC Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Electric Co Ltd, FFC Ltd filed Critical Fuji Electric Co Ltd
Priority to JP9252430A priority Critical patent/JPH1196017A/en
Publication of JPH1196017A publication Critical patent/JPH1196017A/en
Pending legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce the number of steps of a program for an execution language. SOLUTION: An input variable having the same symbol as that of an output variable is detected from plural variables used in a program operation expression for a programming language, the two variables are allowed to share a register to be used in a CPU 7 at the time of executing the execution language program and the number of steps of the execution language program is reduced by executing the loading processing of the input variable and the storing processing of the output variable.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラミングサ
ポート装置(ローダやプログラミング装置とも称す)で
作成された中間言語形態のシーケンスプログラムをプロ
グラマブルコントローラのCPUが実行可能な実行可能
プログラムに翻訳し、この実行可能プログラムをプログ
ラマブルコントローラのCPUが実行することにより制
御対象の機器を自動制御するプログラマブルコントロー
ラシステムおよびそのプログラム作成方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention translates an intermediate language sequence program created by a programming support device (also referred to as a loader or a programming device) into an executable program that can be executed by a CPU of a programmable controller. The present invention relates to a programmable controller system that automatically controls a device to be controlled by executing a programmable program by a CPU of the programmable controller, and a program creation method thereof.

【0002】[0002]

【従来の技術】従来この種プログラマブルコントローラ
システム(以下PLCと略す)が適応されるプロセス制
御分野の制御内容は、シーケンス制御と数値演算制御と
に大別できる。
2. Description of the Related Art Conventionally, the contents of control in the field of process control to which this type of programmable controller system (hereinafter abbreviated as PLC) is applied can be roughly classified into sequence control and numerical operation control.

【0003】当初のPLCは、従来のリレー盤の機能で
あるシーケンス制御(いわゆる、ビット単位の論理の制
御)のみを実行するものであったが、最近のPLCの殆
どは、数値演算制御機能(いわゆる、ワード単位のどち
らかといえば量の制御)を持ち、また、経済性の観点か
らデータ処理機能といったコンピュータ的機能をも付加
してきている。このうち、数値演算制御機能としては、
AND(アンド)、OR(オア)に代表されるようない
わゆる論理演算と、四則演算や平方根のようないわゆる
算術演算等がある。
[0003] Initial PLCs only execute sequence control (so-called bit-based logic control), which is a function of a conventional relay panel, but most recent PLCs have a numerical operation control function ( In other words, it has a so-called word unit rather than a quantity control), and also has a computer function such as a data processing function added from the viewpoint of economy. Among them, the numerical control function
There are so-called logical operations typified by AND (or) and OR (or), and so-called arithmetic operations such as four arithmetic operations and square root.

【0004】このような制御内容は、ユーザが内容を確
認できるシーケンス回路図の形態の中間言語形態のプロ
グラム(この中には疑似言語や高級言語と呼ばれるプロ
グラムも含まれる)がユーザの編集指示に基づきプログ
ラミングサポート装置において作成される。なお、中間
言語、疑似言語、高級言語を総称してプログラミング言
語と総称することにする。このプログラミング言語のプ
ログラムはプログラマブルコントローラ(CPUユニッ
トとも呼ばれる)のCPUがそのままでは実行できない
ので、CPUが実行可能なプログラム(実行言語のプロ
グラムと呼ぶことにする)に翻訳される。
[0004] Such control contents include a program in the form of an intermediate language in the form of a sequence circuit diagram that allows the user to confirm the contents (including programs called pseudo-languages and high-level languages) in response to a user's editing instruction. Created in the programming support device based on The intermediate language, the pseudo language, and the high-level language are collectively referred to as a programming language. Since the program of the programming language cannot be executed by the CPU of the programmable controller (also called a CPU unit) as it is, it is translated into a program executable by the CPU (referred to as an execution language program).

【0005】プログラミング言語のプログラムから実行
言語のプログラムへの変換はプログラムサポート装置で
行う場合もあればプログラマブルコントローラで行う場
合もある。
Conversion from a programming language program to an execution language program may be performed by a program support device or by a programmable controller.

【0006】従来の代表的なシステム構成例を図1に示
す。図1において、プログラミングサポート装置1で作
成され、プログラミングメモリ3に格納されたプログラ
ミング言語のプログラムはプログラムサポート装置の翻
訳処理4により翻訳される。翻訳後の実行言語のプログ
ラムはCPUユニット2の実行言語メモリ5に記憶され
る。CPU7は、システムプログラムメモリ6に格納さ
れたシステムプログラムの指示で実行言語のプログラム
命令をその記載順に読みとり実行する。
FIG. 1 shows an example of a conventional typical system configuration. In FIG. 1, a program of a programming language created by a programming support device 1 and stored in a programming memory 3 is translated by a translation process 4 of the program support device. The translated execution language program is stored in the execution language memory 5 of the CPU unit 2. The CPU 7 reads and executes the program instructions of the execution language in the order described in accordance with the instructions of the system program stored in the system program memory 6.

【0007】この命令が算術演算の場合の例を図2にニ
ーモニック表現で示す。CPU7は周知のように命令で
処理するデータを一時記憶するレジスタ群10とそのデ
ータを演算するALU(数値演算ユニット)11を有す
る。データメモリ8は制御対象機器の動作状態を示す信
号、例えば、接点のオンオフ状態や数値データ等、およ
び制御対象機器に出力信号、例えば、接点のオンオフ指
示や数値データ等を記憶する。これらのデータが上記命
令の演算対象や演算結果となる。ワークメモリ9は上記
命令の演算結果を一時記憶する。
FIG. 2 shows an example in which this instruction is an arithmetic operation in mnemonic expression. As is well known, the CPU 7 has a register group 10 for temporarily storing data to be processed by an instruction and an ALU (numerical operation unit) 11 for calculating the data. The data memory 8 stores a signal indicating an operation state of the control target device, for example, a contact on / off state, numerical data, and the like, and an output signal, for example, a contact on / off instruction and a numerical data, for the control target device. These data are the operation target and the operation result of the instruction. The work memory 9 temporarily stores the operation result of the instruction.

【0008】プログラミング言語のプログラムと実行言
語のプログラムとの相違を図2にニーモニック表現で示
す。図2の例は、3つのデータA、B、Cの合計Xとそ
の平均YをCPU7で算出するためのプログラムを記載
している。データA、B、Cは予めデータメモリ8また
はワークメモリ9に格納されており、演算結果のX、Y
をデータメモリ8に書き込むものとする。ここでデータ
A、B,C,Yは変数記号で記載され、この変数記号自
体がデータメモリ8やワークメモリ9の記憶アドレスを
示している。
FIG. 2 shows the difference between a program in a programming language and a program in an execution language in a mnemonic expression. The example of FIG. 2 describes a program for the CPU 7 to calculate the total X and the average Y of the three data A, B, and C. The data A, B, and C are stored in the data memory 8 or the work memory 9 in advance, and the X, Y
Is written to the data memory 8. Here, the data A, B, C, and Y are described by variable symbols, and the variable symbols themselves indicate storage addresses of the data memory 8 and the work memory 9.

【0009】図2において、プログラミング言語のプロ
グラム中で演算式のように記載される命令100は、デ
ータメモリ8のデータAとデータBとを加算し、その結
果Xをデータメモリに書き込むことを意味している。こ
のプログラミング命令100が翻訳されると実行言語の
プログラムの命令103〜106に示すようなLOAD
命令、ADD命令、STORE命令からなる命令群にな
ることを図2は示している。ちなみにLOAD命令10
3は変数Aをデータメモリ8から読み出してCPU7内
のレジスタreg1に記憶させることを意味している。
In FIG. 2, an instruction 100 described as an arithmetic expression in a programming language program means that data A and data B in data memory 8 are added, and the result X is written in the data memory. doing. When the programming instruction 100 is translated, a LOAD as shown in instructions 103 to 106 of the program of the execution language is obtained.
FIG. 2 shows that the instruction group is composed of an instruction, an ADD instruction, and a STORE instruction. By the way, LOAD instruction 10
Reference numeral 3 indicates that the variable A is read from the data memory 8 and stored in the register reg1 in the CPU 7.

【0010】ADD命令105はCPU7内のレジスタ
reg1およびレジスタreg2の格納データをALU
11により加算し、その加算結果をレジスタreg1に
再度格納(上書き)すること意味している。
The ADD instruction 105 converts the data stored in the registers reg1 and reg2 in the CPU 7 into an ALU.
11 means that the addition result is stored (overwritten) again in the register reg1.

【0011】STORE命令106はレジスタreg2
の格納データを変数Xとしてデータメモリ8に書き込む
ことを意味している。図2の他のプログラミング言語の
命令101、102もそれぞれ、CPUの処理手順に対
応させた上述の命令群に翻訳される。
[0011] The STORE instruction 106 corresponds to the register reg2.
Is stored in the data memory 8 as the variable X. The instructions 101 and 102 in the other programming languages of FIG. 2 are also translated into the above-described instructions corresponding to the processing procedure of the CPU.

【0012】[0012]

【発明が解決しようとする課題】従来装置においては、
LOADやSTORE命令が複数回出現している。その
重複している回数分、プログラム容量は大きくなり、プ
ログラム実行時間は長くなっていた。
In the conventional apparatus,
A LOAD or STORE instruction appears multiple times. The program capacity increases and the program execution time increases by the number of times of the overlap.

【0013】そこで、本発明の目的は、実行内容を変え
ることなく実行プログラムの容量を低減することが可能
なプログラマブルコントローラシステムおよびそのプロ
グラム作成方法を提供することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a programmable controller system capable of reducing the capacity of an execution program without changing the execution contents, and a method of creating the program.

【0014】[0014]

【課題を解決するための手段】このような目的を達成す
るために、請求項1の発明は、実行言語で記載された第
1プログラムをプログラマブルコントローラ内のCPU
において実行して機器を制御し、プログラミング言語で
記載された第2プログラムをプログラミングサポート装
置で作成し、前記プログラマブルコントローラおよび前
記プログラミングサポート装置のいずれかにおいて前記
第2プログラムを翻訳手段により翻訳して前記第1プロ
グラムを作成するプログラマブルコントローラシステム
において、前記翻訳手段は、前記第2プログラムの中で
重複的に使用される変数記号を検出する検出手段と、前
記第1プログラムを前記CPUが実行するときに当該重
複して使用される変数記号が最初に出現するときに前記
CPU内のレジスタに該変数記号が示すデータを共有的
に保持し、2回目以降に出現した変数記号に対しては該
レジスタの値を読み取るように前記第1プログラムを作
成するプログラム作成手段とを具えたことを特徴とす
る。
In order to achieve the above object, according to the first aspect of the present invention, a first program described in an execution language is executed by a CPU in a programmable controller.
To control the device by executing the second program written in a programming language with a programming support device, and translating the second program by a translation means in any of the programmable controller and the programming support device. In a programmable controller system for creating a first program, the translating means includes a detecting means for detecting a variable symbol used redundantly in the second program, and a detecting means for executing the first program by the CPU. When the variable symbol used repeatedly appears first, the data indicated by the variable symbol is held in a register in the CPU in a shared manner. A program for creating the first program so as to read a value Characterized in that comprises the formation means.

【0015】請求項2の発明は、請求項1に記載のプロ
グラマブルコントローラシステムにおいて、前記重複し
て使用される変数記号は、メモリからデータをCPU内
のレジスタにデータを読み込むためのデータ入力用の命
令と、前記メモリに対して該CPU内のレジスタのデー
タを書き込むためのデータ出力用の命令において重複使
用されることを特徴とする。
According to a second aspect of the present invention, in the programmable controller system according to the first aspect, the variable symbols used repeatedly are used for data input for reading data from a memory into a register in a CPU. An instruction and a data output instruction for writing data of a register in the CPU to the memory are repeatedly used.

【0016】請求項3の発明は、請求項2に記載のプロ
グラマブルコントローラシステムにおいて、前記検出手
段は前記第2プログラムに記載されている変数記号を順
次に抽出して検索テーブルに登録し、当該登録に先立っ
て前記検索テーブルの変数記号を参照することにより重
複する変数記号を検出することを特徴とする。
According to a third aspect of the present invention, in the programmable controller system according to the second aspect, the detecting means sequentially extracts the variable symbols described in the second program and registers them in a search table. Prior to this, duplicate variable symbols are detected by referring to the variable symbols in the search table.

【0017】請求項4の発明は、請求項3に記載のプロ
グラマブルコントローラシステムにおいて、前記検出手
段は、前記検索テーブルに前記変数記号と前記レジスタ
の番号を互いに関連づけて登録することによりレジスタ
の割り当てを行うことを特徴とする。
According to a fourth aspect of the present invention, in the programmable controller system according to the third aspect, the detection means assigns registers by registering the variable symbols and the register numbers in the search table in association with each other. It is characterized by performing.

【0018】請求項5の発明は、実行言語で記載された
第1プログラムをプログラマブルコントローラ内のCP
Uにおいて実行して機器を制御し、プログラミング言語
で記載された第2プログラムをプログラミングサポート
装置で作成し、前記プログラマブルコントローラおよび
前記プログラミングサポート装置のいずれかにおいて前
記第2プログラムを翻訳手段により翻訳して前記第1プ
ログラムを作成するプログラマブルコントローラシステ
ムにおいて、前記翻訳手段は、前記第2プログラムの中
でに使用される変数記号それぞれの最終使用位置を検出
する位置検出手段と、前記変数記号の示すデータを前記
CPU内で前記第1プログラムの実行時に保持するため
のレジスタを割り当てるレジスタ指示手段と、任意の変
数記号の最終位置より後に記載された変数記号を検出す
る置換可能変数記号検出手段と、当該後に記載された変
数記号が検出された場合には、前記レジスタ指示手段に
より割り当てられたレジスタを前記任意の変数記号に割
り当てられたレジスタに変更する変更手段とを具えたこ
とを特徴とする。
According to a fifth aspect of the present invention, a first program described in an execution language is stored in a CP in a programmable controller.
U to control the device, create a second program written in a programming language with a programming support device, and translate the second program by a translation means in one of the programmable controller and the programming support device. In the programmable controller system for creating the first program, the translating means includes: a position detecting means for detecting a final use position of each of the variable symbols used in the second program; Register designating means for allocating a register for holding the first program in the CPU during execution of the first program; replaceable variable symbol detecting means for detecting a variable symbol described after the last position of any variable symbol; The described variable symbol is detected Case, characterized in that comprises a changing means for changing the registers allocated by the register instruction means to the register assigned to the arbitrary variable symbols.

【0019】請求項6の発明は、実行言語で記載された
第1プログラムをプログラマブルコントローラ内のCP
Uにおいて実行して機器を制御し、プログラミング言語
で記載された第2プログラムをプログラミングサポート
装置で作成し、前記プログラマブルコントローラおよび
前記プログラミングサポート装置のいずれかにおいて前
記第2プログラムを翻訳して前記第1プログラムを作成
するプログラマブルコントローラシステムのプログラム
作成方法において、前記第2プログラムの中で重複的に
使用される変数記号を検出し、前記第1プログラムを前
記CPUが実行するときに当該重複して使用される変数
記号が最初に出現するときに前記CPU内のレジスタに
該変数記号が示すデータを共有的に保持し、2回目以降
に出現した変数記号に対しては該レジスタの値を読み取
るように前記第1プログラムを作成することを特徴とす
る。
According to a sixth aspect of the present invention, a first program described in an execution language is stored in a CP in a programmable controller.
U to control a device, create a second program written in a programming language with a programming support device, and translate the second program in one of the programmable controller and the programming support device to translate the first program into the first program. In the method for creating a program of a programmable controller system for creating a program, a variable symbol used repeatedly in the second program is detected, and the variable symbol used when the CPU executes the first program is detected. When a variable symbol appears first, the data indicated by the variable symbol is shared and held in a register in the CPU, and the value of the register is read for a variable symbol that appears for the second or subsequent times. A first program is created.

【0020】請求項7に記載の発明は、請求項6に記載
のプログラマブルコントローラシステムのプログラム作
成方法において、前記重複して使用される変数記号は、
メモリからデータをCPU内のレジスタにデータを読み
込むためのデータ入力用の命令と、前記メモリに対して
該CPU内のレジスタのデータを書き込むためのデータ
出力用の命令において重複使用されることを特徴とす
る。
According to a seventh aspect of the present invention, in the program creating method of the programmable controller system according to the sixth aspect, the variable symbols used repeatedly are:
The data input instruction for reading data from a memory to a register in a CPU and the data output instruction for writing data of a register in the CPU to the memory are used repeatedly. And

【0021】請求項8の発明は、請求項7に記載のプロ
グラマブルコントローラシステムのプログラム作成方法
において、前記第2プログラムに記載されている変数記
号を順次に抽出して検索テーブルに登録し、当該登録に
先立って前記検索テーブルの変数記号を参照することに
より重複する変数記号を検出することを特徴とする。
According to an eighth aspect of the present invention, in the method of the seventh aspect, the variable symbols described in the second program are sequentially extracted and registered in a search table. Prior to this, duplicate variable symbols are detected by referring to the variable symbols in the search table.

【0022】請求項9の発明は、請求項3に記載のプロ
グラマブルコントローラシステムのプログラム作成方法
において、前記検索テーブルに前記変数記号と前記レジ
スタの番号を互いに関連づけて登録することによりレジ
スタの割り当てを行うことを特徴とする。
According to a ninth aspect of the present invention, in the program creating method of the programmable controller system according to the third aspect, registers are allocated by registering the variable symbols and the register numbers in the search table in association with each other. It is characterized by the following.

【0023】請求項10の発明は、実行言語で記載され
た第1プログラムをプログラマブルコントローラ内のC
PUにおいて実行して機器を制御し、プログラミング言
語で記載された第2プログラムをプログラミングサポー
ト装置で作成し、前記プログラマブルコントローラおよ
び前記プログラミングサポート装置のいずれかにおいて
前記第2プログラムを翻訳して前記第1プログラムを作
成するプログラマブルコントローラシステムのプログラ
ム作成方法において、前記第2プログラムの中で使用さ
れる変数記号それぞれの最終使用位置を検出し、前記変
数記号の示すデータを前記CPU内で前記第1プログラ
ムの実行時に保持するためのレジスタを割り当て、任意
の変数記号の最終位置より後に記載された変数記号を検
出し、当該後に記載された変数記号が検出された場合に
は、当該変数記号に割り当てられたレジスタを前記任意
の変数記号に割り当てられたレジスタに変更することを
特徴とする。
According to a tenth aspect of the present invention, a first program written in an execution language is stored in a C in a programmable controller.
The program is executed by a PU to control a device, a second program written in a programming language is created by a programming support device, and the first program is translated by translating the second program in one of the programmable controller and the programming support device. In a program creating method of a programmable controller system for creating a program, a final use position of each variable symbol used in the second program is detected, and data indicated by the variable symbol is stored in the CPU in the first program. Allocate a register to be held at the time of execution, detect a variable symbol described after the last position of an arbitrary variable symbol, and if a variable symbol described after that is detected, assign a register to the variable symbol. Assign registers to any of the above variable symbols And changes the temple register.

【0024】[0024]

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

【0025】図3は本発明実施の形態の機能構成を示
す。図3において、入力データ部抽出手段はプログラミ
ング言語のプログラムの中の入力データ(接点情報や数
値情報でLOAD命令を伴う変数または数値で図2でい
えば、文字、A,B,C,X,3が該当する。以下、入
力部と称する)を抽出する。本実施の形態では、入力部
に使用する変数はたとえば、使用する変数記号の種類、
記載位置等の書式が定まっており、この書式に基づいて
従来と同様の処理で入力部を検出して抽出する。
FIG. 3 shows a functional configuration of the embodiment of the present invention. In FIG. 3, the input data part extracting means is a function of input data (a variable or a numerical value accompanied by a LOAD instruction in contact information or numerical information) in a programming language program. 3 (hereinafter referred to as an input unit). In the present embodiment, the variables used for the input unit are, for example,
A format such as a description position is determined, and based on this format, the input unit is detected and extracted by the same processing as in the related art.

【0026】入力レジスタ割り当て手段101は入力デ
ータ部抽出手段100により新規の入力部が抽出される
とその入力部の示すデータを記憶しておくCPU7内の
レジスタを割り当てる。
When a new input section is extracted by the input data section extracting section 100, the input register allocating section 101 allocates a register in the CPU 7 for storing data indicated by the input section.

【0027】出力データ部抽出手段103はプログラム
言語のプログラム中の出力データ(STORE命令を伴
う変数、図2でいえば文字X,Yが該当する。以下出力
部と称する)をやはり予め定められた書式に従って抽出
する。
The output data section extracting means 103 also pre-determines output data (variable accompanied by a STORE instruction, which corresponds to characters X and Y in FIG. 2; hereinafter referred to as an output section) in a program of a program language. Extract according to the format.

【0028】出力レジスタ割り当て手段104は出力部
抽出手段103により新規に抽出された出力部の示すデ
ータを記憶しておくCPU7内のレジスタを割り当て
る。
The output register allocating unit 104 allocates a register in the CPU 7 for storing data indicated by the output unit newly extracted by the output unit extracting unit 103.

【0029】入力レジスタ最終使用位置検出手段105
はプログラミング言語のプログラム中で使用されている
異なる入力部の個数を計数し、その計数結果から入力部
用のレジスタの最終位置を検出する。出力レジスタ判断
手段106は前記入力レジスタ最終使用位置の検出結果
に基き、残りの空きの入力部用レジスタに出力部を記憶
格納可能かを判断する。記憶可能の判定が得られた場合
には割り当てレジスタ指定変更手段104がこれまでの
割り当てを変更して新規のレジスタを割り当てる。以上
の構成はCPU7が後述の処理手順を実行することによ
り実現される。
Input register last use position detecting means 105
Counts the number of different input units used in a program in a programming language, and detects the final position of a register for the input unit from the counted result. The output register judging means 106 judges whether or not the output section can be stored in the remaining empty input section register based on the detection result of the input register last use position. When it is determined that storage is possible, the assignment register designation changing unit 104 changes the assignment so far and assigns a new register. The above configuration is realized by the CPU 7 executing a processing procedure described later.

【0030】図4は本発明実施の形態のシステム構成を
示す。図1の従来例と同様の個所には同一の符号を付し
ており詳細な説明を省略する。従来例では、プログラミ
ングサポート装置1でプログラミング言語を実行言語に
翻訳していたが本実施の形態では、プログラミング言語
をプログラミングサポート装置1のプログラミングメモ
リ3からCPUユニット2のプログラミングメモリ53
にコピーし、CPUユニット2で翻訳することとする。
このプログラム翻訳のための翻訳プログラム(図6、図
8、図9、図12)51はシステムプログラム用メモリ
6に予め格納されている。翻訳後の実行言語のプログラ
ムは実行言語メモリ2に格納される。従来例と異なる点
は本実施の形態では、上記入力部、出力部をその種類別
に記憶しておく検索用テーブル52を用意している点に
ある。
FIG. 4 shows a system configuration according to the embodiment of the present invention. The same parts as those in the conventional example of FIG. 1 are denoted by the same reference numerals, and detailed description is omitted. In the conventional example, the programming language is translated into the execution language by the programming support device 1. In this embodiment, however, the programming language is translated from the programming memory 3 of the programming support device 1 to the programming memory 53 of the CPU unit 2.
And translated by the CPU unit 2.
A translation program (FIG. 6, FIG. 8, FIG. 9, FIG. 12) 51 for this program translation is stored in the system program memory 6 in advance. The translated execution language program is stored in the execution language memory 2. The difference from the conventional example is that in the present embodiment, a search table 52 for storing the input unit and the output unit for each type is prepared.

【0031】検索用テーブル52は図7に示すように入
力部(入力データ変数名)と出力部(出力データ変数
名)の種類別に記載欄が別れており、それぞれ一定個数
のレジスタが、割り当てられている。
As shown in FIG. 7, the search table 52 has separate entry columns for each type of an input section (input data variable name) and an output section (output data variable name). ing.

【0032】このようなシステム構成で実行される翻訳
処理を図6、図8、図9、図12のフローチャートを使
用して説明する。なお、図6、図8、図9、図12の処
理手順中、従来と同様の処理手順については説明の便宜
上省略している。
The translation processing executed in such a system configuration will be described with reference to the flowcharts of FIGS. 6, 8, 9, and 12. 6, 8, 9, and 12, processing steps similar to those in the related art are omitted for convenience of description.

【0033】翻訳処理が外部から指示されるとCPU7
は図6の処理手順を開始する。CPU7は検索用テーブ
ル52の記載内容を消去する初期化を行う(ステップS
0)。なお、説明のために図5に示すプログラミング言
語のプログラミング命令100〜102の3命令を、L
OAD群150、演算群151、STORE群152に
翻訳するものとする。
When a translation process is instructed from outside, the CPU 7
Starts the processing procedure of FIG. The CPU 7 performs initialization for deleting the contents described in the search table 52 (step S).
0). For the sake of explanation, three programming instructions 100 to 102 of the programming language shown in FIG.
It is to be translated into the OAD group 150, the operation group 151, and the STORE group 152.

【0034】また、入力用レジスタとしてreg1〜1
0を、出力用レジスタとしてreg11〜20(図7参
照)を使用できるものとする。また、図7中の“−”
は、対応する入出力データ変数が無いことを示す。検索
用テープル52を初期化した場合や変数登録を削除した
場合にこの状態となる。
Also, reg1 to reg1 as input registers
0 means that regs 11 to 20 (see FIG. 7) can be used as output registers. Also, "-" in FIG.
Indicates that there is no corresponding input / output data variable. This state is entered when the retrieval table 52 is initialized or when the variable registration is deleted.

【0035】CPU7は第1番目のプログラム命令(図
10の符号100)をプログラミングメモリ53から取
り出し個数を計数する(この場合計数結果は1、ステッ
プS1)。CPU7は、そのプログラミング命令の種類
を従来と同様にして識別する。プログラミング命令が演
算式であるか否かが判定される(ステップS2)。これ
は演算式で上述のLOAD命令やSTORE命令が使用
されるからに他ならない。
The CPU 7 takes out the first program instruction (reference numeral 100 in FIG. 10) from the programming memory 53 and counts the number (the counting result is 1, in this case, step S1). The CPU 7 identifies the type of the programming instruction in the same manner as in the related art. It is determined whether the programming instruction is an arithmetic expression (step S2). This is because the above-mentioned LOAD instruction and STORE instruction are used in the arithmetic expression.

【0036】本例の場合、最初のプログラム命令は加算
の演算式なので、肯定判定が得られる。なお、否定判定
が得られた場合は従来と同様の翻訳処理が行われる。肯
定判定が得られると、CPU7は手順をステップS3に
進め、演算式で使用される最初の入力変数記号を取り出
す(この場合記号A)。
In this example, since the first program instruction is an arithmetic expression for addition, an affirmative judgment is obtained. If a negative determination is obtained, a translation process similar to the conventional one is performed. If an affirmative determination is obtained, the CPU 7 advances the procedure to step S3, and extracts the first input variable symbol used in the arithmetic expression (in this case, symbol A).

【0037】この取り出した入力変数記号が検索用テー
ブル52の出力変数名記載欄に記載されていないことを
検索により確認する(ステップS4→S5)。入力変数
記号Aについは未登録の判定が得られるので、次にCP
U7はこの入力変数記号が検索用テーブル52の入力変
数名記載欄に記載されていないことを検索により確認す
る(ステップS6→S7→S8)。これにより取り出し
た入力変数記号Aが新規のものであることが確認される
ので、検索用テーブル52の入力用レジスタreg1に
対応する入力データ名記載欄に、取り出された入力変数
記号Aが書き込まれる(図7参照)。また、この入力変
数記号Aの最終位置を(現在のプログラム命令のカウン
ト値1)を検索用テーブル52の該当記載欄に記憶する
(図11参照、ステップS9→S200)。
It is confirmed by retrieval that the extracted input variable symbol is not described in the output variable name entry column of the retrieval table 52 (step S4 → S5). For the input variable symbol A, it is possible to obtain a judgment of unregistered.
U7 confirms by a search that the input variable symbol is not described in the input variable name entry column of the search table 52 (steps S6 → S7 → S8). As a result, it is confirmed that the extracted input variable symbol A is a new one, and thus the extracted input variable symbol A is written in the input data name entry column of the search table 52 corresponding to the input register reg1. (See FIG. 7). Also, the last position of the input variable symbol A (the current program instruction count value 1) is stored in the corresponding entry column of the search table 52 (see FIG. 11, step S9 → S200).

【0038】手順はステップS3に戻り、取り出したプ
ログラム命令100の次の入力変数記号Bが抽出される
(ステップS3)。以下、上述と同様にして入力変数記
号Bが新規なものであることが確認されて、検索用テー
ブル52の入力変数名記載欄のレジスタreg2に対応
する欄に格納される(ステップS3〜S9→S200→
S3)。
The procedure returns to step S3, and the next input variable symbol B of the extracted program instruction 100 is extracted (step S3). Thereafter, the input variable symbol B is confirmed to be new in the same manner as described above, and is stored in the column corresponding to the register reg2 in the input variable name description column of the search table 52 (steps S3 to S9 → S200 →
S3).

【0039】プログラム命令100の次の変数記号X
(図10参照)は出力変数なので、手順はS3→S4〜
S11へと進み、検索用テーブル52に新しい出力変数
Xの登録が行われる(ステップS12〜S14)。次に
CPU7は出力変数記号Xについてはリプレイスの有無
を無しに初期設定する。これは出力用変数用のレジスタ
としてこれまでに出現した入力用変数用のレジスタに割
り当てる場合があり、このようなケースの場合には出力
用レジスタを使用せず、入力変数Xに対応させて入力用
レジスタを使用する(リプレイスあり)。この処理のた
めにリプレイスの有無属性を使用する。図6の出力変数
記号の検出処理では検出された出力変数に対して初期値
としてリプレイス無しが与えられる。
The next variable symbol X of the program instruction 100
(See FIG. 10) is an output variable, so the procedure is S3 → S4 ~
Proceeding to S11, a new output variable X is registered in the search table 52 (steps S12 to S14). Next, the CPU 7 initializes the output variable symbol X without replacement. This may be assigned to an input variable register that has appeared so far as an output variable register. In such a case, the output register is not used and the input variable X Use a register for the function (with replacement). For this processing, the attribute of presence or absence of replacement is used. In the output variable symbol detection processing of FIG. 6, no replacement is given as an initial value to the detected output variable.

【0040】第1番目のプログラム命令100について
入力変数記号および出力変数記号の登録が終了すると
(ステップS11の否定判定)、CPU7は第2番目の
プログラム命令101(図5参照)についての変数記号
登録処理をおこなう。入力変数記号Cは上述と同様にし
て検索用テーブル52の入力変数名記載欄に登録される
(ステップS3〜S9→S200)。
When the registration of the input variable symbol and the output variable symbol for the first program instruction 100 is completed (negative determination in step S11), the CPU 7 registers the variable symbol for the second program instruction 101 (see FIG. 5). Perform processing. The input variable symbol C is registered in the input variable name entry column of the search table 52 in the same manner as described above (steps S3 to S9 → S200).

【0041】次の入力変数記号Xはすでに検索用テーブ
ル52の出力変数名記載欄に登録されているので、この
点が、テーブル検索で検出され(ステップS7→S
8)、登録処理が省略される。なお、入力変数記号が重
複して使用された場合も2回目に出現した変数記号の登
録が省略され、変数記号の最終位置情報のみの更新だけ
が行われる(ステップS8→S200)。
Since the next input variable symbol X has already been registered in the output variable name entry field of the search table 52, this point is detected in the table search (step S7 → S
8), the registration process is omitted. Note that, even when the input variable symbols are used repeatedly, the registration of the second occurrence of the variable symbol is omitted, and only the last position information of the variable symbol is updated (step S8 → S200).

【0042】図10のプログラム命令101の→の後の
出力変数記号XはステップS12のテーブル検索により
すでに登録されていることが検出され(ステップS13
の肯定判定)、登録処理が省略される(ステップS13
→S10)。
The output variable symbol X after → of the program instruction 101 in FIG. 10 is detected by the table search in step S12 to be already registered (step S13).
, The registration process is omitted (step S13).
→ S10).

【0043】以上の入力変数記号および出力変数記号の
検出処理によりプログラミング言語のプログラムから変
数名、その最終位置が検出されて検索用テーブル52に
登録される。図11の符号300がその登録結果を示
す。
The variable name and the final position thereof are detected from the program of the programming language by the above-described input variable symbol and output variable symbol detection processing, and are registered in the search table 52. Reference numeral 300 in FIG. 11 indicates the registration result.

【0044】このようにしてCPU7はプログラミング
言語のプログラム中の重複的に使用されている変数記号
を検出し、この変数記号に対して共有的にレジスタを割
り当てる。従来では、入力用と出力用とで重複的に使用
された変数記号(たとえば図5の変数記号X)はそれぞ
れ異なるレジスタが割り当てられたので、そのレジスタ
を使用するためのLOAD,STORE命令が2組必要
であった。これに対し、本実施の形態では、1回目に出
現した変数記号の示すデータを割り当てられたレジスタ
に読み込むと、2回目の変数記号が出現するまではその
データが割り当てられたレジスタに保持されるので、2
回出現する変数記号に対するLOAD,STORE命令
は1組とすることができる。この点に着目して、本実施
の形態では、入力用と出力用とに重複使用される変数記
号については、CPU7内のレジスタに1回目の読み込
みデータ(LOAD命令によりメモリからレジスタに読
み込むデータ)を保持させるように翻訳処理を実行す
る。
In this way, the CPU 7 detects a redundantly used variable symbol in a program of a programming language and allocates a register to this variable symbol in a shared manner. Conventionally, different registers have been assigned to variable symbols (eg, variable symbol X in FIG. 5) used redundantly for input and output. Therefore, two LOAD and STORE instructions for using the registers are provided. I needed a pair. On the other hand, in the present embodiment, when the data indicated by the first occurrence of the variable symbol is read into the assigned register, the data is held in the assigned register until the second occurrence of the variable symbol. So 2
The LOAD and STORE instructions for the variable symbol appearing once can be one set. Focusing on this point, in the present embodiment, the first read data (data read from the memory to the register by the LOAD instruction) is stored in the register in the CPU 7 for the variable symbol that is used repeatedly for input and output. The translation process is performed so that

【0045】上述した検索用テーブル52への登録処理
の後、CPU7は登録内容に基づき、図8の処理手順を
実行して、プログラム言語のプログラムを実行言語のプ
ログラムに翻訳する。
After the above-described registration processing in the search table 52, the CPU 7 executes the processing procedure of FIG. 8 based on the registered contents, and translates a program in a program language into a program in an execution language.

【0046】図8において、CPU7は検索用テーブル
52に入力用データが登録されていることを確認し、入
力用変数記号(図5のA、B,C,3)に対して検索用
テーブル52で対応づけられているレジスタ番号(re
g1、2、3、4)を使用して実行言語の形態のLOA
D命令を作成する(ステップS51、図5の符号150
参照)。次にCPU7はプログラミング言語のプログラ
ムの中に含まれている演算式(図5の符号100、10
1、102)を実行言語のプログラムの演算命令(図5
の符号151)に変換する(ステップS53→S54→
S52)。
In FIG. 8, the CPU 7 confirms that the input data is registered in the search table 52, and checks the search table 52 for the input variable symbols (A, B, C, 3 in FIG. 5). The register number (re
g1,2,3,4) using an LOA in the form of an executable language
Create a D instruction (step S51, reference numeral 150 in FIG. 5)
reference). Next, the CPU 7 executes an arithmetic expression (reference numerals 100, 10 in FIG. 5) included in the program of the programming language.
1 and 102) are executed by the execution instruction of the program in the execution language (FIG. 5).
(Step S53 → S54 →)
S52).

【0047】最後にCPU7は検索用テーブル52に基
づき、出力用変数記号に対応づけられているレジスタ番
号(reg11,12)を使用してSTORE命令(図
5の符号152)を作成する(ステップS56)。
Finally, based on the search table 52, the CPU 7 creates a STORE instruction (reference numeral 152 in FIG. 5) using the register numbers (reg11, 12) associated with the output variable symbols (step S56). ).

【0048】以上の例では、重複的に出現する変数記号
XのデータはCPU7内の出力用レジスタreg11に
保存される。しかしながら図5の演算式100を見ると
わかるように加算演算後、入力用変数記号A,Bは使用
しない。そこで、このような変数記号が使用したレジス
タを出力用変数記号のレジスタに割り当てることができ
る。これによりレジスタの使用数を減じる。
In the above example, the data of the variable symbol X that appears repeatedly is stored in the output register reg11 in the CPU 7. However, as can be seen from the arithmetic expression 100 in FIG. 5, after the addition operation, the input variable symbols A and B are not used. Therefore, registers used by such variable symbols can be assigned to registers of output variable symbols. This reduces the number of registers used.

【0049】この処理を本実施の形態では図8のステッ
プS53の処理内で行う。このための処理手順を図9に
示す。この実施の形態では、出力用変数記号Xが後で入
力用変数記号として使用されるので、この変数記号Xが
第1回目に使用された演算式、この場合、図5の100
で使用された入力用変数記号A,B用のレジスタを変数
記号X用に置き換えて(リプレイス)して使用する。こ
のために、図6の処理手順ではステップS200で演算
式のステップ位置が入力変数記号の最終使用位置と関連
付けられて検索用テーブル52に格納されている。
In the present embodiment, this processing is performed within the processing of step S53 in FIG. FIG. 9 shows a processing procedure for this. In this embodiment, since the output variable symbol X is used later as the input variable symbol, this variable symbol X is used in the first operation expression, in this case, 100 in FIG.
The registers for the input variable symbols A and B used in (1) are replaced (replaced) with the variable symbol X and used. For this purpose, in the processing procedure of FIG. 6, the step position of the operation expression is stored in the search table 52 in step S200 in association with the last use position of the input variable symbol.

【0050】そこで、図9の処理手順では、たとえば、
図5の演算式100を例にとると、最初の入力用変数記
号Aが検索用テーブル52に登録されていることを確認
した後(ステップS100→S101→S102→S1
03)、ADD命令の中に、対応のレジスタ番号(re
g1,図10符号251参照)を指定する(ステップS
104)。同じ演算式に含まれる入力変数記号Bについ
ても同様にしてADD命令の中に、対応のレジスタ番号
(reg2,図10符号251参照)を指定する(ステ
ップS100→S101→S102→S103)。
Therefore, in the processing procedure of FIG.
Taking the arithmetic expression 100 of FIG. 5 as an example, after confirming that the first input variable symbol A is registered in the search table 52 (step S100 → S101 → S102 → S1)
03), the corresponding register number (re
g1, see reference numeral 251 in FIG. 10) (Step S)
104). Similarly, for the input variable symbol B included in the same operation expression, the corresponding register number (reg2, see 251 in FIG. 10) is specified in the ADD instruction (steps S100 → S101 → S102 → S103).

【0051】なお、この際にステップS202において
図12の処理手順、すなわち、入力用変数記号の最終使
用位置についてのレジスタの割り当てを終わったことを
図12のステップS250で検出するとCPU7は検索
用テーブル52の出力データ変数名記載欄の中でリプレ
イス無しの属性を持つレジスタ番号、この場合、reg
11をreg1に変更する(図11参照)。以下、次の
演算式に101、102の演算式で使用されている入力
用変数記号についても同様の処理が行われる。この結
果、図11に示すように入力用変数記号Bのレジスタの
割り当てが終わったときに2つの出力用変数記号X、Y
のためにreg1、reg2が出力用に変更される。
At this time, in step S202, when it is detected in step S250 in FIG. 12 that the procedure of FIG. 12 has been completed, ie, that the register allocation for the last use position of the input variable symbol has been completed, the CPU 7 searches the search table. The register number having the attribute of no replacement in the output data variable name description column of 52, in this case, reg
11 is changed to reg1 (see FIG. 11). Hereinafter, the same processing is performed on the input variable symbols used in the following arithmetic expressions 101 and 102. As a result, as shown in FIG. 11, when the register of the input variable symbol B has been allocated, the two output variable symbols X and Y
Reg1 and reg2 are changed for output.

【0052】入力用変数記号についてのレジスタの割り
当てが進み、次に、図10の演算式101で使用されて
いる変数記号Xがプログラミング言語のプログラムから
抽出されると(ステップS100)、変数記号Xは検索
用テーブル52の出力データ変数名記載欄に登録されて
いるので(図7参照または図11参照)、出力データ変
数名記載欄に登録の旨がステップS102→S103→
S105→S106の順で検出される。そこでCPU7
は現在、出力用に割り当てられているレジスタreg1
を変数記号Xに割り当てる(ステップS105→S10
6→S108、図10のADD命令およびDIV命令の
reg1(符号253、254)が該当)。この後、検
索用テーブル52の出力データ変数名記載欄の該当欄
(reg11)をリプレイス有りに変更する(図11参
照)。
The allocation of registers for input variable symbols proceeds, and then, when the variable symbol X used in the arithmetic expression 101 of FIG. 10 is extracted from the programming language program (step S100), the variable symbol X Is registered in the output data variable name entry column of the search table 52 (see FIG. 7 or FIG. 11), so that the registration in the output data variable name entry column is performed in steps S102 → S103 →
It is detected in the order of S105 → S106. So CPU7
Is the register reg1 currently assigned for output.
Is assigned to the variable symbol X (step S105 → S10).
6 → S108, reg1 (reference numerals 253, 254) of the ADD instruction and the DIV instruction in FIG. 10). After that, the corresponding column (reg11) of the output data variable name description column of the search table 52 is changed to "replaced" (see FIG. 11).

【0053】以上のようにして入力用変数記号のレジス
タの割り当てを終了し、図10の演算式100の出力用
変数Xが次に抽出されると(ステップS100→S10
9)、検索用テーブル52の出力データ変数名記載欄に
登録されていることが確認される(ステップS110→
S111→S112)。CPU7は変数記号Xに割り当
てられているレジスタreg1を使用してADD命令を
作成しこの中に変数記号Xのデータ格納用にレジスタr
eg1を指定する(図10の符号255、ステップS1
14)。また、出力用レジスタ番号欄を有りに再度変更
する(ステップS108)。
As described above, the assignment of the register of the input variable symbol is completed, and the output variable X of the arithmetic expression 100 in FIG. 10 is extracted next (steps S100 → S10).
9) It is confirmed that the data is registered in the output data variable name entry field of the search table 52 (step S110 →).
S111 → S112). The CPU 7 creates an ADD instruction by using the register reg1 assigned to the variable symbol X. In the ADD instruction, the register r is used for storing data of the variable symbol X.
eg1 (255 in FIG. 10, step S1).
14). Further, the output register number column is changed to “Yes” again (step S108).

【0054】さらに、同一の変数記号が入力用として登
録されている場合を考慮して検索用テーブル52の入力
データ変数名記載欄が検索されて、同一の変数記号が登
録されている場合には、その変数登録を削除する(ステ
ップS115→S116→S117)。
Further, in consideration of the case where the same variable symbol is registered for input, the input data variable name entry field of the search table 52 is searched, and when the same variable symbol is registered, Then, the variable registration is deleted (step S115 → S116 → S117).

【0055】以上の処理過程で、検索テーブル52の入
力データ変数名および出力データ変数名のいずれの記載
欄に登録されていない変数記号が現れた場合には異常が
発生したものとして処理される(ステップS107,S
113)。
In the above process, if a variable symbol that is not registered in any of the input data variable names and output data variable names in the search table 52 appears, it is determined that an abnormality has occurred (see FIG. 4). Step S107, S
113).

【0056】以上の翻訳処理を実行すると、図10のプ
ログラミング言語のプログラム命令100、101、1
02は実行言語のプログラム命令群250、251、2
52に翻訳される。また、検索用テーブルは52は図1
1の符号300から400のように変更される。
When the above translation processing is executed, the program instructions 100, 101, 1 of the programming language shown in FIG.
02 is a program instruction group 250, 251, 2 of the execution language.
Translated to 52. The search table 52 is shown in FIG.
The number is changed from 300 to 400.

【0057】図2の従来の翻訳結果のステップ数は12
であるのに対し、本実施の形態では図5、図10に示す
ようにステップ数が9と少なくなっていることが理解さ
れよう。また、図10の例では使用するレジスタの数が
4であり、図5の例の使用数6よりも少なくなっている
ことも理解されよう。さらに、プログラム実行内容に何
らの変更がないことは言うまでもない。
The number of steps in the conventional translation result shown in FIG.
On the other hand, in the present embodiment, it can be understood that the number of steps is reduced to 9 as shown in FIGS. It is also understood that the number of registers used in the example of FIG. 10 is four, which is smaller than the number of registers used in the example of FIG. Furthermore, it goes without saying that there is no change in the program execution contents.

【0058】[0058]

【発明の効果】以上、説明したように請求項1、6の発
明によれば、重複使用される変数記号名についてレジス
タを共有することにより外部メモリからのデータ読み出
し、書き込みに関するLOAD命令やSTORE命令数
を従来よりも減じることができ、以て、システムで使用
するメモリ容量を減じ、処理の高速化にも寄与すること
ができる。
As described above, according to the first and sixth aspects of the present invention, a LOAD instruction and a STORE instruction relating to data reading and writing from an external memory are achieved by sharing a register for variable symbol names used repeatedly. The number can be reduced as compared with the conventional case, so that the memory capacity used in the system can be reduced and the processing can be speeded up.

【0059】請求項2、7の発明によれば、入力用変数
記号および出力用変数記号用に2つのレジスタを用意す
る必要はなく、1つのレジスタを用意すればよい。これ
によりレジスタの使用制限が緩和される。
According to the second and seventh aspects of the present invention, it is not necessary to prepare two registers for the input variable symbol and the output variable symbol, but it is sufficient to prepare one register. This alleviates the restriction on the use of registers.

【0060】請求項3、8の発明によれば、検索テーブ
ルを使用して重複する変数記号を検出でき、また、使用
が1回のみの変数記号をも抽出できる。
According to the third and eighth aspects of the present invention, duplicate variable symbols can be detected by using the search table, and variable symbols that are used only once can be extracted.

【0061】請求項4、9の発明によれば、検索テーブ
ルに割り当てのレジスタ番号を格納することで、情報管
理が容易となり、レジスタ番号の変更に対処できる。
According to the fourth and ninth aspects of the present invention, by storing the assigned register number in the search table, information management becomes easy and it is possible to cope with the change of the register number.

【0062】請求項5、10の発明によれば、使用済み
の変数記号はレジスタが空きとなるので、その変数記号
の最終記載位置を検出することで、対応のレジスタを2
回以上有効利用することができる。これによりレジスタ
の割り当て制限を緩和することで、たとえば、請求項1
に記載の重複使用するレジスタの個数を増やすことがで
き、これにより実行プログラムのプログラム命令を減ら
すことができる。
According to the fifth and tenth aspects of the present invention, since the registers of used variable symbols are vacant, by detecting the last written position of the variable symbols, the corresponding registers can be set to two.
It can be used more than once. Thus, the restriction on register allocation is relaxed.
Can increase the number of registers used repeatedly, thereby reducing the number of program instructions of the execution program.

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

【図1】従来例のシステム構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing a system configuration of a conventional example.

【図2】従来例の翻訳内容を示す説明図である。FIG. 2 is an explanatory diagram showing translation contents of a conventional example.

【図3】本発明実施の形態の機能構成を示すブロック図
である。
FIG. 3 is a block diagram showing a functional configuration according to the embodiment of the present invention.

【図4】本発明実施の形態のシステム構成を示すブロッ
ク図である。
FIG. 4 is a block diagram showing a system configuration according to the embodiment of the present invention.

【図5】本発明実施の形態の翻訳内容を示す説明図であ
る。
FIG. 5 is an explanatory diagram showing translation contents according to the embodiment of the present invention.

【図6】本発明実施の形態のCPU7の実行する処理手
順を示すフローチャートである。
FIG. 6 is a flowchart illustrating a processing procedure executed by a CPU 7 according to the embodiment of the present invention.

【図7】検索用テーブル52の内容を示す説明図であ
る。
FIG. 7 is an explanatory diagram showing the contents of a search table 52;

【図8】本発明実施の形態のCPU7の処理手順を示す
フローチャートである。
FIG. 8 is a flowchart illustrating a processing procedure of a CPU 7 according to the embodiment of the present invention.

【図9】本発明実施の形態のCPU7の処理手順を示す
フローチャートである。
FIG. 9 is a flowchart illustrating a processing procedure of a CPU 7 according to the embodiment of the present invention.

【図10】本発明実施の形態の翻訳内容を示す説明図で
ある。
FIG. 10 is an explanatory diagram showing translation contents according to the embodiment of the present invention.

【図11】本発明実施の形態の割り当てレジスタの変更
内容を示す説明図である。
FIG. 11 is an explanatory diagram showing changed contents of an assignment register according to the embodiment of the present invention.

【図12】本発明実施の形態のCPU7の処理手順を示
すフローチャートである。
FIG. 12 is a flowchart illustrating a processing procedure of a CPU 7 according to the embodiment of the present invention.

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

1 プログラミングサポート装置 2 CPUユニット 3 プログラミングメモリ 4 翻訳処理 5 実行言語メモリ 6 システムプログラム用メモリ 7 CPU 8 データメモリ 9 ワークメモリ 10 レジスタ群 11 ALU 51 翻訳用プログラム 52 検索用テーブル DESCRIPTION OF SYMBOLS 1 Programming support apparatus 2 CPU unit 3 Programming memory 4 Translation processing 5 Execution language memory 6 System program memory 7 CPU 8 Data memory 9 Work memory 10 Register group 11 ALU 51 Translation program 52 Search table

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 実行言語で記載された第1プログラムを
プログラマブルコントローラ内のCPUにおいて実行し
て機器を制御し、プログラミング言語で記載された第2
プログラムをプログラミングサポート装置で作成し、前
記プログラマブルコントローラおよび前記プログラミン
グサポート装置のいずれかにおいて前記第2プログラム
を翻訳手段により翻訳して前記第1プログラムを作成す
るプログラマブルコントローラシステムにおいて、前記
翻訳手段は、 前記第2プログラムの中で重複的に使用される変数記号
を検出する検出手段と、 前記第1プログラムを前記CPUが実行するときに当該
重複して使用される変数記号が最初に出現するときに前
記CPU内のレジスタに該変数記号が示すデータを共有
的に保持し、2回目以降に出現した変数記号に対しては
該レジスタの値を読み取るように前記第1プログラムを
作成するプログラム作成手段とを具えたことを特徴とす
るプログラマブルコントローラシステム。
A first program written in an execution language is executed by a CPU in a programmable controller to control a device, and a second program written in a programming language is executed.
In a programmable controller system in which a program is created by a programming support device and the first program is created by translating the second program by a translation device in one of the programmable controller and the programming support device, the translation device includes: Detecting means for detecting a variable symbol used redundantly in a second program; and detecting the variable symbol used repeatedly when the CPU first executes the first program. Program creating means for creating the first program so as to share the data indicated by the variable symbol in a register in the CPU and to read the value of the register for the variable symbol appearing for the second time or later. Programmable controller system characterized by Temu.
【請求項2】 請求項1に記載のプログラマブルコント
ローラシステムにおいて、前記重複して使用される変数
記号は、メモリからデータをCPU内のレジスタにデー
タを読み込むためのデータ入力用の命令と、前記メモリ
に対して該CPU内のレジスタのデータを書き込むため
のデータ出力用の命令において重複使用されることを特
徴とするプログラマブルコントローラシステム。
2. The programmable controller system according to claim 1, wherein the variable symbols used repeatedly are a data input instruction for reading data from a memory into a register in a CPU, and the memory. And a data output instruction for writing data in a register in the CPU.
【請求項3】 請求項2に記載のプログラマブルコント
ローラシステムにおいて、前記検出手段は前記第2プロ
グラムに記載されている変数記号を順次に抽出して検索
テーブルに登録し、当該登録に先立って前記検索テーブ
ルの変数記号を参照することにより重複する変数記号を
検出することを特徴とするプログラマブルコントローラ
システム。
3. The programmable controller system according to claim 2, wherein said detecting means sequentially extracts variable symbols described in said second program and registers them in a search table, and performs said search prior to said registration. A programmable controller system for detecting duplicate variable symbols by referring to variable symbols in a table.
【請求項4】 請求項3に記載のプログラマブルコント
ローラシステムにおいて、前記検出手段は、前記検索テ
ーブルに前記変数記号と前記レジスタの番号を互いに関
連づけて登録することによりレジスタの割り当てを行う
ことを特徴とするプログラマブルコントローラシステ
ム。
4. The programmable controller system according to claim 3, wherein said detecting means performs register allocation by registering said variable symbol and said register number in said search table in association with each other. Programmable controller system.
【請求項5】 実行言語で記載された第1プログラムを
プログラマブルコントローラ内のCPUにおいて実行し
て機器を制御し、プログラミング言語で記載された第2
プログラムをプログラミングサポート装置で作成し、前
記プログラマブルコントローラおよび前記プログラミン
グサポート装置のいずれかにおいて前記第2プログラム
を翻訳手段により翻訳して前記第1プログラムを作成す
るプログラマブルコントローラシステムにおいて、前記
翻訳手段は、 前記第2プログラムの中でに使用される変数記号それぞ
れの最終使用位置を検出する位置検出手段と、 前記変数記号の示すデータを前記CPU内で前記第1プ
ログラムの実行時に保持するためのレジスタを割り当て
るレジスタ指示手段と、 任意の変数記号の最終位置より後に記載された変数記号
を検出する置換可能変数記号検出手段と、 当該後に記載された変数記号が検出された場合には、前
記レジスタ指示手段により割り当てられたレジスタを前
記任意の変数記号に割り当てられたレジスタに変更する
変更手段とを具えたことを特徴とするプログラマブルコ
ントローラシステム。
5. A first program written in an execution language is executed by a CPU in a programmable controller to control a device, and a second program written in a programming language is executed.
In a programmable controller system in which a program is created by a programming support device and the first program is created by translating the second program by a translation device in one of the programmable controller and the programming support device, the translation device includes: Allocating a position detecting means for detecting a final use position of each variable symbol used in the second program, and a register for holding data indicated by the variable symbol in the CPU when the first program is executed Register instructing means, replaceable variable symbol detecting means for detecting a variable symbol described after the last position of an arbitrary variable symbol, and when the variable symbol described after is detected, the register instructing means Before assigned register Changing means for changing to a register assigned to an arbitrary variable symbol.
【請求項6】 実行言語で記載された第1プログラムを
プログラマブルコントローラ内のCPUにおいて実行し
て機器を制御し、プログラミング言語で記載された第2
プログラムをプログラミングサポート装置で作成し、前
記プログラマブルコントローラおよび前記プログラミン
グサポート装置のいずれかにおいて前記第2プログラム
を翻訳して前記第1プログラムを作成するプログラマブ
ルコントローラシステムのプログラム作成方法におい
て、 前記第2プログラムの中で重複的に使用される変数記号
を検出し、 前記第1プログラムを前記CPUが実行するときに当該
重複して使用される変数記号が最初に出現するときに前
記CPU内のレジスタに該変数記号が示すデータを共有
的に保持し、2回目以降に出現した変数記号に対しては
該レジスタの値を読み取るように前記第1プログラムを
作成することを特徴とするプログラマブルコントローラ
システムのプログラム作成方法。
6. A first program written in an execution language is executed by a CPU in a programmable controller to control a device, and a second program written in a programming language is executed.
A program creation method for a programmable controller system, wherein a program is created by a programming support device, and the first program is created by translating the second program in one of the programmable controller and the programming support device. When the CPU executes the first program, when the variable symbol used repeatedly appears first, the variable symbol is stored in a register in the CPU. A program creation method for a programmable controller system, wherein the first program is created so that data indicated by a symbol is shared and a value of the register is read for a variable symbol appearing after the second time. .
【請求項7】 請求項6に記載のプログラマブルコント
ローラシステムのプログラム作成方法において、前記重
複して使用される変数記号は、メモリからデータをCP
U内のレジスタにデータを読み込むためのデータ入力用
の命令と、前記メモリに対して該CPU内のレジスタの
データを書き込むためのデータ出力用の命令において重
複使用されることを特徴とするプログラマブルコントロ
ーラシステムのプログラム作成方法。
7. The program creating method for a programmable controller system according to claim 6, wherein the variable symbols used in duplicate are obtained by transferring data from a memory to a CP.
A programmable controller characterized by being repeatedly used in a data input instruction for reading data into a register in U and a data output instruction for writing data in a register in the CPU to the memory. How to program the system.
【請求項8】 請求項7に記載のプログラマブルコント
ローラシステムのプログラム作成方法において、前記第
2プログラムに記載されている変数記号を順次に抽出し
て検索テーブルに登録し、当該登録に先立って前記検索
テーブルの変数記号を参照することにより重複する変数
記号を検出することを特徴とするプログラマブルコント
ローラシステムのプログラム作成方法。
8. The method according to claim 7, wherein the variable symbols described in the second program are sequentially extracted and registered in a search table, and the search is performed prior to the registration. A program creating method for a programmable controller system, wherein a variable symbol is detected by referring to a variable symbol in a table.
【請求項9】 請求項8に記載のプログラマブルコント
ローラシステムのプログラム作成方法において、前記検
索テーブルに前記変数記号と前記レジスタの番号を互い
に関連づけて登録することによりレジスタの割り当てを
行うことを特徴とするプログラマブルコントローラシス
テムのプログラム作成方法。
9. The method according to claim 8, wherein register assignment is performed by registering the variable symbol and the register number in the search table in association with each other. Program creation method for programmable controller system.
【請求項10】 実行言語で記載された第1プログラム
をプログラマブルコントローラ内のCPUにおいて実行
して機器を制御し、プログラミング言語で記載された第
2プログラムをプログラミングサポート装置で作成し、
前記プログラマブルコントローラおよび前記プログラミ
ングサポート装置のいずれかにおいて前記第2プログラ
ムを翻訳して前記第1プログラムを作成するプログラマ
ブルコントローラシステムのプログラム作成方法におい
て、 前記第2プログラムの中で使用される変数記号それぞれ
の最終使用位置を検出し、 前記変数記号の示すデータを前記CPU内で前記第1プ
ログラムの実行時に保持するためのレジスタを割り当
て、 任意の変数記号の最終位置より後に記載された変数記号
を検出し、 当該後に記載された変数記号が検出された場合には、当
該変数記号に割り当てられたレジスタを前記任意の変数
記号に割り当てられたレジスタに変更することを特徴と
するプログラマブルコントローラシステムのプログラム
作成方法。
10. A first program written in an execution language is executed by a CPU in a programmable controller to control a device, and a second program written in a programming language is created by a programming support device.
In a program creation method of a programmable controller system for creating the first program by translating the second program in one of the programmable controller and the programming support device, each of the variable symbols used in the second program Detecting a last use position, allocating a register for holding the data indicated by the variable symbol in the CPU when the first program is executed, and detecting a variable symbol described after the last position of any variable symbol. A method of creating a program for a programmable controller system, wherein, when a variable symbol described later is detected, a register assigned to the variable symbol is changed to a register assigned to the arbitrary variable symbol. .
JP9252430A 1997-09-17 1997-09-17 Programmable controller system and its program preparing method Pending JPH1196017A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9252430A JPH1196017A (en) 1997-09-17 1997-09-17 Programmable controller system and its program preparing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9252430A JPH1196017A (en) 1997-09-17 1997-09-17 Programmable controller system and its program preparing method

Publications (1)

Publication Number Publication Date
JPH1196017A true JPH1196017A (en) 1999-04-09

Family

ID=17237266

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9252430A Pending JPH1196017A (en) 1997-09-17 1997-09-17 Programmable controller system and its program preparing method

Country Status (1)

Country Link
JP (1) JPH1196017A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018180706A (en) * 2017-04-06 2018-11-15 富士電機株式会社 Support device and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018180706A (en) * 2017-04-06 2018-11-15 富士電機株式会社 Support device and program

Similar Documents

Publication Publication Date Title
US5088031A (en) Virtual machine file control system which translates block numbers into virtual addresses then into real addresses for accessing main storage
CA1159151A (en) Cellular network processors
Lonergan et al. Design of the B5000 system
JPH03266039A (en) Free format data link processing system
JPH0630066B2 (en) Table type language translation method
JPH113269A (en) System and method for assisting accurate garbage collection by separating contents of stack into sub-stacks
JPH01142829A (en) Detection of control information in control program
JPH1196017A (en) Programmable controller system and its program preparing method
JP2920393B2 (en) Document editing method
US7028292B1 (en) Program executing apparatus, control method therefor, and storage medium for interpreting and executing intermediate codes
JPH113105A (en) Programming device for programmable controller
JP2901543B2 (en) Magnetic disk file relocation method
JPS6148741B2 (en)
JPH0524549B2 (en)
JPS6398704A (en) Programmable controller
JPS63245723A (en) System command registering system
JPS61199126A (en) Microprogram check system
JPH0293829A (en) Data processor
JPH04107738A (en) Optimum allocation system for literal
JPH05197565A (en) Constant area allocation processing method
JPS5872251A (en) Data processing system
JPH0318928A (en) System load processing method and disk controller
JPH0784842A (en) Relative record batch read system
JPH06175862A (en) Electronic computer
JPH0440528A (en) Program translating device