JP2001255913A - Device for supporting programmable controller - Google Patents

Device for supporting programmable controller

Info

Publication number
JP2001255913A
JP2001255913A JP2000070414A JP2000070414A JP2001255913A JP 2001255913 A JP2001255913 A JP 2001255913A JP 2000070414 A JP2000070414 A JP 2000070414A JP 2000070414 A JP2000070414 A JP 2000070414A JP 2001255913 A JP2001255913 A JP 2001255913A
Authority
JP
Japan
Prior art keywords
variable
allocation information
memory
held
data
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.)
Withdrawn
Application number
JP2000070414A
Other languages
Japanese (ja)
Inventor
Masashi Yamada
正志 山田
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
Original Assignee
Fuji Electric Co 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 filed Critical Fuji Electric Co Ltd
Priority to JP2000070414A priority Critical patent/JP2001255913A/en
Publication of JP2001255913A publication Critical patent/JP2001255913A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide a device for supporting a programmable controller, capable of surely continuing held variable data, even if a program is changed. SOLUTION: A compiler part 12 converts a source program 18 into a PC machine language 19, and generates held variable allocation information, and stores it as this time held variable allocation information 14. Also, the previous compile time held variable allocation information is held as the previous time held variable allocation information 15. A held variable allocation change judging part 16 compares the previous time held variable allocation information 15 with this held variable allocation information 14, and judges whether any held variable whose memory allocating position is changed is present. Then, a communication control part 13 down-loads the PC machine word 19 to the PC 20 side, and when any held variable whose memory allocating position (address) is changed is present, reads the held variable data from a data memory 22, and writes the data in a new memory allocating position.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラマブルコ
ントローラの支援装置に関する。
The present invention relates to a device for supporting a programmable controller.

【0002】[0002]

【従来の技術】プログラマブルコントローラ(以下、P
Cという)には、一般に、そのプログラム作成、修正、
変更等を行う支援ツールが用いられる。このPC支援ツ
ールは、例えば、PCと接続して用いられるパソコン等
の情報処理装置であり、ラダー図等の図示表現プログラ
ムや、IL(Instructs List)言語等のPCのプログラ
ム言語によりオペレータ等にソースプログラムを作成さ
せる機能や、作成されたソースプログラムをPCで実行
可能なマシン語(PCマシン語)に変換するコンパイル
機能や、生成したPCマシン語をPC側に送る(あるい
はPC側の運用データ等を受信する)通信機能等を備え
ている。
2. Description of the Related Art Programmable controllers (hereinafter referred to as P
C) generally includes program creation, modification,
A support tool for making changes is used. The PC support tool is, for example, an information processing device such as a personal computer used by connecting to a PC, and is provided to an operator or the like by a graphical representation program such as a ladder diagram or a PC program language such as an IL (Instructs List) language. A function for creating a program, a compiling function for converting a created source program into a machine language (PC machine language) executable on a PC, and sending the generated PC machine language to the PC side (or operation data of the PC side, etc.) ) And a communication function.

【0003】図7(a)はJIS B3506「プログ
ラマブルコントローラプログラム言語」にしたがって記
述した変数宣言の一例と、JIS B3506(IEC
61131−3)に規定されたIL言語により記述した
簡単なソースプログラム例、同図(b)にはPC内のメ
モリの記憶領域の割り当てであって特にリテイン変数、
非リテイン変数についての一例、同図(c)は同図
(a)のソースプログラムをコンパイルした結果のPC
マシン語の例、同図(d)はその保持領域割付情報の一
例を示す。
FIG. 7A shows an example of a variable declaration described in accordance with JIS B3506 “Programmable Controller Programming Language” and JIS B3506 (IEC
61131-3) An example of a simple source program described in the IL language specified in FIG. 6B. FIG. 6B shows the allocation of storage areas of the memory in the PC, particularly the retain variables.
An example of non-retained variables, FIG. (C) is a PC obtained by compiling the source program of FIG. (A).
FIG. 14D shows an example of the machine language, and FIG. 14D shows an example of the holding area allocation information.

【0004】まず、図7(a)に示す変数宣言の例で
は、RETAIN(リテイン)変数の宣言を行ってい
る。ここで、“リテイン変数”とは、PC起動時等にP
Cが自動的にそのデータをクリアしない変数(保持型の
変数)を意味し、“保持変数”とも呼ばれる。例えば生
産台数の積算値等、長期に渡って継続的に保持したい情
報に対してリテイン変数宣言される。一方、それ以外の
変数は、通常、PC起動時等にPCが自動的にそのデー
タをクリアする変数(非保持型の変数)であり、“非保
持変数”または“非リテイン変数”と呼ばれる。同図
(a)に示す例ではリテイン変数としてINT型の変数
“CUNTER”が宣言されている。また、ソースプロ
グラム例として、例えば直接数値‘1’を(LD IN
T#1)、変数“CUNTER”(カウンタ値)の現在
値に加算して(ADD)、この加算後の値を変数“CU
NTER”の格納領域に書込む(ST)というような簡
単なプログラムを示してある(例えば、“CUNTE
R”が総生産数を意味する場合、1個生産する毎に上記
プログラム(正確にはコンパイル後のPCマシン語プロ
グラム)が実行される)。
First, in an example of a variable declaration shown in FIG. 7A, a RETAIN (retain) variable is declared. Here, the “retain variable” is a P
C means a variable that does not automatically clear the data (a variable of a holding type), and is also called a “holding variable”. For example, a retain variable is declared for information to be held continuously over a long period of time, such as an integrated value of the number of production units. On the other hand, the other variables are usually variables (non-retained variables) for which the PC automatically clears the data when the PC is started, and are called “non-retained variables” or “non-retained variables”. In the example shown in FIG. 7A, an INT type variable “CUNTER” is declared as a retain variable. Further, as an example of a source program, for example, a numerical value “1” is directly input to (LD IN
T # 1), the current value of the variable “COUNTER” (counter value) is added (ADD), and the value after the addition is added to the variable “CUN”.
A simple program such as writing (ST) in the storage area of “NTER” (for example, “CUNTE”) is shown.
When R "means the total number of productions, the above program (to be exact, a compiled PC machine language program) is executed each time one is produced.)

【0005】ここで、本例のPCでは、同図(b)に示
すように、非リテイン(Non_Retain)変数
は、メモリのアドレス‘h0000’番地から割付けな
ければならず、リテイン変数はアドレス‘h1000’
番地から割付けなければならないと定義されている。
Here, in the PC of this example, as shown in FIG. 1B, the non-retain (Non_Retain) variable must be allocated from the memory address' h0000 ', and the retain variable is the address' h1000 '
It is defined that the address must be allocated from the address.

【0006】これより、図7(a)に示すプログラムを
コンパイルする場合、コンパイラは、ソースプログラム
を、1行毎にオペコードとオペランドを評価し、同図
(c)に示すPCマシン語を生成する。ここで、コンパ
イラは、ソースプログラムの101行目をコンパイルす
る際、まず、IL言語で記述されたソースプログラムの
オペコード‘ADD’(IL言語はアセンブラに近い)
を認識し、対応するPCマシン語‘ADD’を生成す
る。また、オペランド‘CUNTER’については、上
記変数宣言を参照することにより、リテイン(保持)変
数であり、またINT型であることを認識する。
Accordingly, when compiling the program shown in FIG. 7A, the compiler evaluates the operation code and the operand of the source program line by line, and generates a PC machine language shown in FIG. . Here, when the compiler compiles the 101st line of the source program, first, the opcode 'ADD' of the source program described in the IL language (the IL language is close to the assembler)
And generates the corresponding PC machine word 'ADD'. Also, the operand "CENTER" is recognized as a retain variable and an INT type by referring to the above variable declaration.

【0007】また、同図(b)に示すメモリ割付定義よ
り、リテイン(保持)変数は、PCのメモリのアドレス
‘h1000’番地から割付けなければならないことを
認識する。この例では、上記‘CUNTER’は、コン
パイル開始してから最初に現れたリテイン(保持)変数
であったものとする。これより、変数‘CUNTER’
はPCのメモリのアドレス‘h1000’番地に割付け
るものと判断され、図7(a)に示すソースプログラム
の101行目は、同図(c)に示す101行目のPCマ
シン語に変換される。
From the memory allocation definition shown in FIG. 1B, it is recognized that the retain (hold) variable must be allocated from the address 'h1000' in the memory of the PC. In this example, it is assumed that the above-mentioned 'COUNTER' is a retain (hold) variable that first appeared after the compilation was started. From this, the variable 'COUNTER'
Is determined to be assigned to the address 'h1000' in the memory of the PC, and the 101st line of the source program shown in FIG. 7A is converted into the PC machine language on the 101st line shown in FIG. 7C. You.

【0008】更に、このとき、コンパイラは、同図
(d)に示す保持領域割付情報を作成する。これは、こ
の後更にコンパイル処理が進行し、他のリテイン変数
(保持変数)が記述されていたとした場合等に参照する
ことで、多重割付けしないようにする為である。
Further, at this time, the compiler creates holding area allocation information shown in FIG. This is to prevent the multiple assignment by referring to a case where the compile processing further proceeds and another retain variable (holding variable) has been described.

【0009】[0009]

【発明が解決しようとする課題】上記‘CUNTER’
等のリテイン変数(保持変数)の値は、その後、PCの
処理に応じて更新されていき、PCの電源をオフし再起
動したときでもクリアされずに保持される。これは、上
記の通り、長期に渡って継続的に保持したい値である為
であるが、一般に、システムが稼働状態であっても何等
かのプログラム変更が必要になる場合がある。例えば、
プログラムをバージョンアップする場合やシステムの一
部を変更/追加する場合、上記変数の値を引続き保持し
たい場合が少なくない。
The above-mentioned 'CUNTER'
The values of the retain variables (retained variables) such as are subsequently updated in accordance with the processing of the PC, and are retained without being cleared even when the PC is turned off and restarted. This is because it is a value that the user wants to keep continuously over a long period of time, as described above. However, in general, some program change may be required even when the system is in the operating state. For example,
When upgrading a program or changing / adding a part of the system, there are many cases where it is desired to keep the values of the above variables.

【0010】ところが、このような新たなソースプログ
ラムをコンパイルする場合、保持変数(例えば‘CUN
TER’)のメモリ割付位置が変わってしまう可能性が
あった。すなわち、従来のコンパイラでは、上記の様に
変数の出現順等(他に、名前コード順等もある)の特定
のルールに従ってメモリ割付が行われる。この為、例え
ば変数の出現順にメモリ割付が行われる場合、‘CUN
TER’が図7に示すプログラムと同じように最も最初
に出現する変数である場合にはよいが、例えば新たな生
産ライン(Line2)が追加され、これに応じて作成
される新たなソースプログラムには新たな保持変数(例
えば‘CUNTER_Line2’とする)が追加さ
れ、これが保持変数‘CUNTER’より前に記述され
ていたとすると、上述した処理に従ってコンパイルする
と、変数‘CUNTER_Line2’を‘h100
0’番地に割付けるものと判断される。そして、例えば
その次に変数‘CUNTER’が出現した場合、‘h1
000’番地の次の番地(‘h1001’番地)に割付
けるものと判断される。
However, when compiling such a new source program, the holding variables (for example, 'CUN
There is a possibility that the memory allocation position of TER ') changes. That is, in the conventional compiler, memory allocation is performed in accordance with a specific rule such as the order of appearance of variables (otherwise, the order of name codes and the like) as described above. Therefore, for example, when memory allocation is performed in the order in which variables appear, 'CUN
It is good if TER ′ is the first variable that appears as in the program shown in FIG. 7. For example, a new production line (Line 2) is added, and a new source program created accordingly is added. Is added to a new holding variable (for example, 'COUNTER_Line2'). If this is described before the holding variable 'COUNTER', the variable 'COUNTER_Line2' is converted to 'h100
It is determined to be assigned to address 0 '. Then, for example, when the variable 'COUNTER' appears next, 'h1
It is determined to be assigned to the address next to the address 000 '(address'h1001').

【0011】このように、従来では、プログラム変更に
よって、同じ保持変数(例えば‘CUNTER’)に対
するメモリ割付位置が変わってしまう可能性があり、こ
れによって継続して保持したいデータが失われてしまう
という問題があった。
As described above, conventionally, there is a possibility that the memory allocation position for the same holding variable (for example, “COUNTER”) may be changed due to a program change, and this results in the loss of data to be held continuously. There was a problem.

【0012】本発明の課題は、プログラム変更があって
も保持変数のデータを確実に継続できるプログラマブル
コントローラの支援装置を提供することである。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a support device for a programmable controller which can reliably maintain data of a held variable even when a program is changed.

【0013】[0013]

【課題を解決するための手段】本発明による請求項1記
載のプログラマブルコントローラの支援装置は、今回の
ソースプログラムのコンパイルによる保持変数割付情報
を記憶する今回保持変数割付情報記憶手段と、前回のソ
ースプログラムのコンパイルによる保持変数割付情報を
記憶する前回保持変数割付情報記憶手段と、前記今回保
持変数割付情報記憶手段に記憶されている今回の保持変
数割付情報と前回保持変数割付情報記憶手段に記憶され
ている前回の保持変数割付情報とを比較し、メモリ割付
に変更があるか否かを判別する保持変数割付変更判別手
段と、前記保持変数割付変更判別手段によりメモリ割付
に変更があったと判別された保持変数に関してプログラ
マブルコントローラ内のメモリに格納されているデータ
を該保持変数の今回のメモリ割付位置に移す保持データ
アクセス手段とを有するように構成する。
According to a first aspect of the present invention, there is provided an apparatus for supporting a programmable controller, comprising: a presently stored variable allocation information storage unit for storing currently stored variable allocation information obtained by compiling a source program; The previously stored variable allocation information storage means for storing the stored variable allocation information by compiling the program, and the current stored variable allocation information and the previous stored variable allocation information storage means stored in the current stored variable allocation information storage means. And the stored variable allocation change determining means for determining whether there is a change in the memory allocation, and determining that the memory allocation has been changed by the stored variable allocation change determining means. The data stored in the memory in the programmable controller with respect to the held variables Configured to have a holding data access means for transferring the memory allocation position.

【0014】上記構成のプログラマブルコントローラの
支援装置によれば、コンパイル時に通常作成/記憶する
保持変数割付情報を利用し、前回のコンパイル時の保持
変数割付情報を残しておき、これと今回の保持変数割付
情報とを比較することにより、保持変数割付変更判別手
段は、プログラマブルコントローラ内のメモリに対する
保持変数等のメモリ割付け位置(アドレス)が変わって
いるか否かを判別できる。そして、メモリ割付けが変わ
っていた場合には、保持データアクセス手段はメモリ割
付位置が変わった保持変数に関するデータを、旧アドレ
スから新アドレスに移すことにより、旧アドレスに格納
されているデータは失われても新アドレスにおいてこの
データを継続して保持することができる。
According to the support device for a programmable controller having the above configuration, the holding variable allocation information normally created / stored at the time of compiling is used, the holding variable allocation information at the time of the previous compilation is retained, and this and the current holding variable allocation information are stored. By comparing the assignment information with the assignment information, the held variable assignment change determination means can determine whether the memory assignment position (address) of the held variable or the like for the memory in the programmable controller has changed. If the memory allocation has changed, the stored data access means moves the data relating to the stored variable whose memory allocation position has changed from the old address to the new address, so that the data stored at the old address is lost. However, this data can be held continuously at the new address.

【0015】請求項2記載の支援装置は、上記請求項1
記載のプログラマブルコントローラの支援装置におい
て、前記保持変数割付情報は、少なくともソースプログ
ラムのコンパイルの際に決められるプログラマブルコン
トローラ内のメモリに対する各保持変数のメモリ割付位
置の情報であり、保持データアクセス手段は、前記保持
変数割付変更判別手段によりメモリ割付に変更があった
と判別された場合には、前記前回の保持変数割付情報に
従って前記プログラマブルコントローラ内のメモリから
各保持変数に対応するデータを順次読み出し、今回の保
持変数割付情報において同名の保持変数がある場合には
該読み出したデータを対応付けて書込み、該書込みが行
われた今回の保持変数割付情報を用いてプログラマブル
コントローラ内のメモリに各保持変数のデータを書込
む。
According to a second aspect of the present invention, there is provided the support apparatus according to the first aspect.
In the support device for a programmable controller according to the above, the held variable allocation information is information on a memory allocation position of each held variable with respect to a memory in the programmable controller determined at least at the time of compiling the source program, and the held data access unit includes: When it is determined that the memory allocation has been changed by the held variable allocation change determination means, data corresponding to each stored variable is sequentially read from the memory in the programmable controller according to the previous stored variable allocation information, and If there is a held variable having the same name in the held variable allocation information, the read data is written in association with the read data, and the data of each held variable is stored in the memory in the programmable controller using the written held variable allocation information at the time of the writing. Write.

【0016】[0016]

【発明の実施の形態】以下、図面を参照して、本発明の
実施の形態の一例について説明する。図1は、本実施形
態によるPCシステム全体の機能ブロック図である。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a functional block diagram of the entire PC system according to the present embodiment.

【0017】同図に示すPCシステムは、プログラマブ
ルコントローラ(PC)20と、このPC20に接続す
るプログラマブルコントローラ(PC)支援ツール10
より成る。尚、PC支援ツール10、PC20とも、本
例を説明するうえで直接関係の無い構成については図示
していない。
The PC system shown in FIG. 1 includes a programmable controller (PC) 20 and a programmable controller (PC) support tool 10 connected to the PC 20.
Consisting of It should be noted that neither the PC support tool 10 nor the PC 20 has a configuration that is not directly related to the description of the present example.

【0018】PC20は、プログラムメモリ21、デー
タメモリ22等を有する。プログラムメモリ21には、
少なくともPC支援ツール10から送られてくるPCマ
シン語を格納する記憶領域(PCマシン語格納領域)が
割り当てられている。データメモリ22には、図7
(b)で説明したようなメモリ割付定義により、保持変
数(リテイン変数)格納領域、非保持変数(非リテイン
変数)格納領域が割り当てられている。
The PC 20 has a program memory 21, a data memory 22, and the like. In the program memory 21,
A storage area for storing at least a PC machine language sent from the PC support tool 10 (PC machine language storage area) is allocated. In the data memory 22, FIG.
The storage variable (retained variable) storage area and the non-retained variable (non-retained variable) storage area are allocated by the memory allocation definition as described in (b).

【0019】PC支援ツール10は、プログラミングエ
ディタ部11、コンパイラ部12、通信制御部13、今
回保持変数割付情報14、前回保持変数割付情報15、
保持変数割付変更判別部16、及び保持データアクセス
部17等を有する。PC支援ツール10は、例えばパー
ソナルコンピュータ1上で実現される。尚、このPC支
援ツール10を実現するプログラムは、OS(オペレー
ティングシステム)2上で動作する。また、尚、図にお
いて、点線の枠で示す構成が、新たに追加された構成で
ある。
The PC support tool 10 includes a programming editor unit 11, a compiler unit 12, a communication control unit 13, currently held variable assignment information 14, last held variable assignment information 15,
It has a retained variable allocation change determining unit 16, a retained data access unit 17, and the like. The PC support tool 10 is realized on the personal computer 1, for example. A program for implementing the PC support tool 10 operates on an OS (Operating System) 2. In addition, in the figure, the configuration shown by the dotted frame is a newly added configuration.

【0020】上記機能を有するPC支援ツール10にお
いて、まず、プログラミングエディタ部11を起動して
ユーザ等がソースプログラム18を作成すると、このソ
ースプログラム18はコンパイラ部12によりPC20
で実行可能なマシン語(PCマシン語19)に変換され
る。また、このとき、コンパイラ部12は、保持変数割
付情報を生成する。これは、今回保持変数割付情報14
として記憶される。また、前回のコンパイル時の保持変
数割付情報は、消去されずに、前回保持変数割付情報1
5として保持されている。コンパイラ部12が今回保持
変数割付情報14を生成完了すると、保持変数割付変更
判別部16が起動される。
In the PC support tool 10 having the above functions, first, when the programming editor unit 11 is activated and a user or the like creates a source program 18, the source program 18 is translated by the compiler unit 12 into the PC 20.
Is converted into a machine language (PC machine language 19) that can be executed by. At this time, the compiler unit 12 generates retained variable allocation information. This is the currently held variable allocation information 14
Is stored as Also, the retained variable allocation information at the time of the previous compilation is not erased, and the previous retained variable allocation information 1 is not deleted.
5 is retained. When the compiler unit 12 completes the generation of the current holding variable allocation information 14, the holding variable allocation change determining unit 16 is activated.

【0021】保持変数割付変更判別部16は、例えば図
2に示す処理のように、前回保持変数割付情報15と今
回保持変数割付情報14とを比較して(ステップS
1)、メモリ割付位置(各保持変数を割付けたデータメ
モリ22の実アドレス)が前回と今回とで違っている保
持変数が存在するか否かを判別する(ステップS2)。
これは、例えばアドレス毎に比較して判別する。あるい
は、コンパイラ部12でメモリ割付中にチェックサムコ
ードを生成し、これを比較することにより判別する。そ
して、変更があった保持変数が存在する場合には(ステ
ップS2,YES)、変更有フラグ31をセット(O
N)する(ステップS3)。
The retained variable allocation change determining unit 16 compares the previous retained variable allocation information 15 with the current retained variable allocation information 14 as shown in FIG. 2 (step S).
1) It is determined whether or not there is a stored variable whose memory allocation position (the actual address of the data memory 22 to which each stored variable is allocated) is different between the previous time and the present time (step S2).
This is determined by comparing, for example, for each address. Alternatively, determination is made by generating a checksum code during memory allocation by the compiler unit 12 and comparing the generated checksum code. Then, when there is a changed held variable (step S2, YES), the changed flag 31 is set (O
N) (Step S3).

【0022】ここでは、アドレス毎に比較する場合を例
にして、以下、図3に示す前回保持変数割付情報15と
今回保持変数割付情報14の一例を参照して、更に具体
的に説明する。
Here, the comparison will be made for each address as an example. Hereinafter, a more specific description will be given with reference to an example of the previously stored variable allocation information 15 and the currently stored variable allocation information 14 shown in FIG.

【0023】まず、保持変数割付情報14、15は、変
更有フラグ31、チェックサムコード32、PC20の
データメモリ22の実アドレスと保持変数名との対応テ
ーブル33等の情報である。
First, the held variable allocation information 14 and 15 are information such as a change flag 31, a checksum code 32, a correspondence table 33 between the real address of the data memory 22 of the PC 20 and the held variable name, and the like.

【0024】図3に示す例では、コンパイラ部12が、
前回、あるソースプログラム18をコンパイルしたと
き、保持変数‘CUNTER’は、保持変数の中で最も
最初に記述されていたので、同図の前回保持変数割付情
報15に示すようにPC20のデータメモリ22の実ア
ドレス‘h1000’に割付けられている。そして、今
回、例えば上記〔発明が解決しようとする課題〕で説明
したようにして作成された新たなソースプログラム18
をコンパイルすると、保持変数‘CUNTER’より前
に保持変数‘CUNTER_Line2’が記述されて
いた為、コンパイラ部12によって、この保持変数‘C
UNTER_Line2’がデータメモリ22のアドレ
ス‘h1000’に割付けられ、保持変数‘CUNTE
R’はその次のアドレス‘h1001’に割付けられ、
これより同図の今回保持変数割付情報14に示すような
対応テーブル33が作成されたものとする。
In the example shown in FIG. 3, the compiler unit 12
When a certain source program 18 was compiled last time, the held variable 'CUNTER' was described first among the held variables. Therefore, as shown in the last held variable allocation information 15 in FIG. Is assigned to the real address 'h1000'. This time, for example, a new source program 18 created as described in the above [Problems to be Solved by the Invention]
Is compiled, the holding variable 'CUNTER_Line2' is described before the holding variable 'CUNTER'.
UNTER_Line2 'is allocated to the address' h1000 'of the data memory 22, and the held variable' CUNTE
R 'is assigned to the next address'h1001',
It is assumed that a correspondence table 33 as shown in the current holding variable allocation information 14 of FIG.

【0025】保持変数割付変更判別部16は、このよう
な前回保持変数割付情報15と今回保持変数割付情報1
4とにおいてデータメモリ22の実アドレス毎に、同じ
アドレスに割付けられている保持変数名を比較し、両者
が同一名であるか否かにより、今回メモリ割付位置が変
更になった保持変数が存在するか否かを判別する。例え
ば、アドレス‘h1000’に割付けられている保持変
数名を比較すると、前回保持変数割付情報15では保持
変数‘CUNTER’であり、今回保持変数割付情報1
4では保持変数‘CUNTER_Line2’であるの
で、アドレス‘h1000’に割付けられている保持変
数名が前回と今回とで違っていることが分る。そして、
上記のような保持変数が存在すると判定した場合には、
今回保持変数割付情報14における変更有フラグ31を
セット(オン)する(Flag=1)。
The retained variable allocation change determining unit 16 stores the previously stored variable allocation information 15 and the current retained variable allocation information 1
4, for each real address of the data memory 22, the stored variable names assigned to the same address are compared, and depending on whether or not both are the same name, there is a stored variable whose memory allocation position has been changed this time. It is determined whether or not to perform. For example, when comparing the held variable names assigned to the address “h1000”, the last held variable assignment information 15 indicates the held variable “CENTER”, and the currently held variable assignment information 1
In FIG. 4, since the stored variable is “COUNTER_Line2”, it can be seen that the stored variable name assigned to the address “h1000” is different between the previous time and this time. And
If it is determined that the above retained variables exist,
The change flag 31 in the currently held variable allocation information 14 is set (turned on) (Flag = 1).

【0026】保持変数割付変更判別部16による上記処
理が終了すると、上記PCマシン語19をPC20側に
ダウンロードする為に、通信制御部13が起動される。
通信制御部13は、PCマシン語19をPC20側に送
信すると共に、今回保持変数割付情報14における変更
有フラグ31をチェックし、変更有フラグ31がオンで
あったなら保持データアクセス部17を起動する。
When the above-described processing by the retained variable assignment change determining section 16 is completed, the communication control section 13 is started to download the PC machine language 19 to the PC 20 side.
The communication control unit 13 transmits the PC machine language 19 to the PC 20, checks the change flag 31 in the currently held variable assignment information 14, and activates the held data access unit 17 if the change flag 31 is on. I do.

【0027】保持データアクセス部17による処理の一
例を、図4、図5を参照して説明する。図4は、保持デ
ータアクセス部17による処理の一例を示すフローチャ
ート図であり、図5はそのイメージを示す図である。
An example of a process performed by the held data access unit 17 will be described with reference to FIGS. FIG. 4 is a flowchart illustrating an example of a process performed by the held data access unit 17, and FIG. 5 is a diagram illustrating an image thereof.

【0028】保持データアクセス部17は、起動される
と、まず前回保持変数割付情報15における“データメ
モリ22の実アドレスと保持変数名との対応テーブル3
3”を参照して、これまで各保持変数が割付けられてい
たデータメモリ22の実アドレスを知り、PC20にア
クセスしてデータメモリ22の上記各アドレスに格納さ
れているデータを順次読み出す(ステップS11)(す
なわち、今回コンパイルを行う前まで、PCは前回のコ
ンパイル結果に従って処理/動作しており、この処理/
動作により得られた値に基づいて新たな積算値等を、対
応する保持変数に対して割付けられているデータメモリ
22のアドレスに書込んでおり、このデータを読み出
す)。
When the retained data access unit 17 is started, first, the stored data access unit 17 reads the "correspondence table 3 between the real address of the data memory 22 and the retained variable name"
With reference to 3 ", the real address of the data memory 22 to which each held variable has been allocated is known, and the PC 20 is accessed to sequentially read the data stored at each of the addresses in the data memory 22 (step S11). (That is, the PC is processing / operating according to the previous compilation result before the current compilation.
Based on the value obtained by the operation, a new integrated value or the like is written in the address of the data memory 22 allocated to the corresponding held variable, and this data is read out).

【0029】そして、順次読み出したデータを、それぞ
れ、前回保持変数割付情報15の対応テーブル33にお
いてそのデータを読み出した実アドレスに対応付けて書
込む(ステップS12)。例えば、図5に示す例では、
前回保持変数割付情報15を参照すると、まず、保持変
数‘CUNTER’に割付けられているアドレスは‘h
1000’であるので、PC20にアクセスしてデータ
メモリ22のアドレス‘h1000’に格納されている
データ(この例では、‘1234’)を読み出し、この
データ‘1234’を同図に示すように前回保持変数割
付情報15の対応テーブル33の実アドレス‘h100
0’に対応付けて書込む。以下、同様にして、各保持変
数が割付けられるデータメモリ22のアドレスからデー
タを読み出し、これを前回保持変数割付情報15内に書
込む処理を行う。
Then, the sequentially read data is written in the correspondence table 33 of the previously held variable assignment information 15 in association with the real address from which the data was read (step S12). For example, in the example shown in FIG.
Referring to the last held variable assignment information 15, first, the address assigned to the held variable “CENTER” is “h”.
Since it is 1000 ', the PC 20 is accessed to read out the data (' 1234 'in this example) stored in the address'h1000' of the data memory 22, and the data '1234' is stored in the previous time as shown in FIG. Real address' h100 in correspondence table 33 of retained variable allocation information 15
Write in association with 0 '. Hereinafter, similarly, data is read from the address of the data memory 22 to which each held variable is assigned, and the data is written into the previously held held variable allocation information 15.

【0030】次に、保持データアクセス部17は、前回
保持変数割付情報15内における上記対応テーブル33
の先頭から、順次、保持変数名を読み出して、この保持
変数名をキーにして今回保持変数割付情報14内の対応
テーブル33を検索し、同一名称の保持変数があるか否
かを判別する(ステップS13)。同一名称の保持変数
があった場合には(ステップS13,YES)、その保
持変数について上記ステップS12の処理により前回保
持変数割付情報15内に書込まれたデータを、今回保持
変数割付情報14内の同一名称の保持変数に対応付けて
書込む(コピーする)(ステップS14)。
Next, the held data access unit 17 executes the correspondence table 33 in the last held variable allocation information 15.
Are sequentially read from the beginning of the list, and using this held variable name as a key, the corresponding table 33 in the current held variable assignment information 14 is searched to determine whether there is a held variable with the same name ( Step S13). If there is a retained variable having the same name (step S13, YES), the data written in the previous retained variable allocation information 15 by the processing of step S12 for that retained variable is stored in the current retained variable allocation information 14. Is written (copied) in association with the holding variable having the same name (step S14).

【0031】例えば、図5に示す例では、前回保持変数
割付情報15内における対応テーブル33の先頭‘h1
000’に対応する保持変数名は‘CUNTER’であ
り、この‘CUNTER’をキーにして今回保持変数割
付情報14内の対応テーブル33を検索すると、‘h1
001’にある保持変数名‘CUNTER’が分かる。
これより、上記データ‘1234’を、今回保持変数割
付情報14の保持変数‘CUNTER’に対応付けて書
込む。尚、同図に示す例の保持変数‘CUNTER_L
ine2’のように前回保持変数割付情報15内に存在
しない保持変数のデータは、例えば初期設定値(例で
は、‘0000’)を書込む。
For example, in the example shown in FIG. 5, the head 'h1' of the correspondence table 33 in the last held variable allocation information 15
The retained variable name corresponding to “000” is “CUNTER”. When the correspondence table 33 in the current retained variable allocation information 14 is searched using the “CUNTER” as a key, “h1” is obtained.
The stored variable name “CUNTER” in “001” is known.
Thus, the data “1234” is written in association with the held variable “CENTER” of the currently held variable allocation information 14. Note that the holding variable 'CENTER_L' in the example shown in FIG.
For example, an initial setting value ('0000' in the example) is written as data of a held variable that does not exist in the last held variable allocation information 15 such as “ine2”.

【0032】そして、保持データアクセス部17は、P
C20にアクセスして、今回保持変数割付情報14の対
応テーブル33を用いてデータメモリ22の各アドレス
に、対応するデータを書込む(上書きする)(ステップ
S15)。例えば図示の例では、今回保持変数割付情報
14の対応テーブル33を参照すると、まずアドレス
‘h1000’に対応するデータが‘0000’である
ので、データメモリ22の‘h1000’番地に‘00
00’を書込む。次に、アドレス‘h1001’に対応
するデータが‘1234’であるので、データメモリ2
2の‘h1001’番地に‘1234’を書込む。
Then, the held data access unit 17
By accessing C20, the corresponding data is written (overwritten) to each address of the data memory 22 using the correspondence table 33 of the currently held variable allocation information 14 (step S15). For example, in the example shown in the figure, referring to the correspondence table 33 of the currently held variable allocation information 14, first, the data corresponding to the address “h1000” is “0000”, and thus “00” is stored in the address “h1000” of the data memory 22.
Write 00 '. Next, since the data corresponding to the address 'h1001' is '1234', the data memory 2
"1234" is written in the address "h1001" of No. 2.

【0033】このように、プログラム変更/更新等によ
って、ある保持変数のメモリ割付位置(番地;アドレ
ス)が変わっても、この保持変数のデータは継続的に保
持される。
As described above, even if the memory allocation position (address; address) of a certain holding variable changes due to a program change / update or the like, the data of this holding variable is continuously held.

【0034】図6は、上記プログラマブルコントローラ
支援ツール10を実現する情報処理装置(パーソナルコ
ンピュータ1等)のハードウェア構成の一例を示す図で
ある。
FIG. 6 is a diagram showing an example of a hardware configuration of an information processing apparatus (such as a personal computer 1) for realizing the programmable controller support tool 10. As shown in FIG.

【0035】同図において、情報処理装置40は、CP
U41、記憶部42(可搬記憶媒体42aを含む)、メ
モリ43、入出力部44、通信部45等より構成され
る。CPU41は、情報処理装置40全体を制御する中
央処理装置である。
In the figure, the information processing device 40
U41, a storage unit 42 (including a portable storage medium 42a), a memory 43, an input / output unit 44, a communication unit 45, and the like. The CPU 41 is a central processing unit that controls the entire information processing device 40.

【0036】記憶部42は、少なくとも、上述したプロ
グラマブルコントローラ支援ツール10の各種処理機能
を実現するためのプログラム及び各種データが記憶され
ているHDD(ハードディスクドライブ)等の記憶装置
である。また記憶部42には可搬記憶媒体42a(F
D、CD−ROM、メモリカード、DVD、MO)等が
含まれる。
The storage unit 42 is a storage device such as a hard disk drive (HDD) that stores at least programs and various data for implementing the various processing functions of the programmable controller support tool 10 described above. The storage unit 42 has a portable storage medium 42a (F
D, CD-ROM, memory card, DVD, MO) and the like.

【0037】メモリ43は、上述した各種処理実行の際
に、記憶部42に格納されているプログラム、データ等
を読み出して一時的に記憶して当該プログラムをCPU
41に実行させる為のRAM等である。
The memory 43 reads out the programs, data, and the like stored in the storage unit 42 and temporarily stores the programs and executes the programs when executing the various processes described above.
A RAM or the like for the CPU 41 to execute.

【0038】入出力部44は、ユーザ等がプログラムを
作成/入力する為のキーボード、マウス等や、作成する
プログラムやPC20から読み出したデータ等を表示す
る為のディスプレイ等である。
The input / output unit 44 is a keyboard, a mouse, and the like for a user or the like to create / input a program, a display for displaying a program to be created, data read from the PC 20, and the like.

【0039】通信部45は、上述した通信制御部13を
実現する通信機能を提供する。本発明は、プログラマブ
ルコントローラの支援装置に限らず、コンピュータによ
り使用されたときに、上述した本発明の各実施形態の機
能を実現させる為のプログラムが格納されたコンピュー
タ読出し可能な記録媒体(記憶媒体)として構成するこ
ともできる。
The communication section 45 provides a communication function for realizing the communication control section 13 described above. The present invention is not limited to a support device of a programmable controller, and a computer-readable recording medium (storage medium) storing a program for realizing the functions of the above-described embodiments of the present invention when used by a computer. ).

【0040】「記録媒体」とは、例えば上述してある記
憶部42の一形態である可搬記憶媒体のCD−ROM4
7、フロッピィーディスク48等(その他、MO、DV
D、リムーバブルハードディスク等であってもよい)
や、ハードディスク等である。更に、不図示のモデム等
によってネットワークを介して通信可能である外部の任
意の装置(不図示)から(あるいはケーブル等で直接接
続して)上記本発明の各種機能を実現するプログラムを
ダウンロードして実現する場合、このプログラムを記憶
(一時的に記憶も含む)する上記外部の任意の装置の記
憶媒体(不図示)も含まれる。
The “recording medium” is, for example, a CD-ROM 4 of a portable storage medium which is an example of the storage unit 42 described above.
7, floppy disk 48, etc. (Other, MO, DV
D, removable hard disk, etc.)
And a hard disk. Further, a program for realizing the various functions of the present invention is downloaded from an external device (not shown) communicable via a network by a modem or the like (not shown) (or directly connected with a cable or the like). In the case of realization, a storage medium (not shown) of any external device for storing (including temporarily storing) the program is also included.

【0041】[0041]

【発明の効果】以上、詳細に説明したように、本発明の
プログラマブルコントローラの支援装置によれば、従来
よりコンパイル時に作成/記憶しているメモリ割付情報
を利用し、前回のコンパイル時のメモリ割付情報を残し
ておき、今回のコンパイル時のメモリ割付情報と比較す
ることにより、各保持変数について前回と今回とでメモ
リ割付が変わっていないか判別でき、また変更があった
保持変数のデータをこの保持変数の新たなメモリ割付位
置(アドレス)に移すことができ、これよりプログラム
変更によりメモリ割付が変わった保持変数があってもそ
のデータを確実に継続/保持できるようになる。
As described above in detail, according to the apparatus for supporting a programmable controller of the present invention, the memory allocation information created / stored conventionally at the time of compilation is used, and the memory allocation at the time of the previous compilation is performed. By keeping the information and comparing it with the memory allocation information at the time of this compilation, it is possible to determine whether the memory allocation has changed between the previous and current times for each stored variable, and the data of the stored variables that have changed The data can be moved to a new memory allocation position (address) of the held variable, so that even if there is a held variable whose memory allocation has changed due to a program change, its data can be reliably continued / held.

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

【図1】本実施形態によるPCシステム全体の機能ブロ
ック図である。
FIG. 1 is a functional block diagram of an entire PC system according to an embodiment.

【図2】保持変数割付変更判別部による処理の一例を説
明する為のフローチャート図である。
FIG. 2 is a flowchart illustrating an example of a process performed by a retained variable assignment change determining unit.

【図3】前回保持変数割付情報と今回保持変数割付情報
の一例を示す図である。
FIG. 3 is a diagram showing an example of previously held variable allocation information and presently held variable allocation information.

【図4】保持データアクセス部による処理の一例を説明
する為のフローチャート図である。
FIG. 4 is a flowchart illustrating an example of a process performed by a held data access unit.

【図5】保持データアクセス部による処理の一例を説明
する為の図である。
FIG. 5 is a diagram illustrating an example of a process performed by a held data access unit.

【図6】プログラマブルコントローラ支援ツールを実現
する情報処理装置のハードウェア構成の一例を示す図で
ある。
FIG. 6 is a diagram illustrating an example of a hardware configuration of an information processing apparatus that implements a programmable controller support tool.

【図7】(a)は変数宣言とソースプログラムの一例、
(b)はPC内のメモリの記憶領域の割り当ての一例、
(c)は(a)のソースプログラムをコンパイルした結
果のPCマシン語の例、(d)はその保持領域割付情報
の一例を示す図である。
FIG. 7A is an example of a variable declaration and a source program,
(B) is an example of the allocation of the storage area of the memory in the PC,
(C) is a diagram showing an example of a PC machine language obtained as a result of compiling the source program of (a), and (d) is a diagram showing an example of holding area allocation information.

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

1 パーソナルコンピュータ 2 OS(オペレーティングシステム) 10 PC支援ツール 11 プログラミングエディタ部 12 コンパイラ部 13 通信制御部 14 今回保持変数割付情報 15 前回保持変数割付情報 16 保持変数割付変更判別部 17 保持データアクセス部 18 ソースプログラム 19 PCマシン語 20 PC(プログラマブルコントローラ) 21 プログラムメモリ 22 データメモリ 31 変更有フラグ 32 チェックサムコード 33 対応テーブル 40 情報処理装置 41 CPU 42 記憶部 42a 可搬記憶媒体 43 メモリ 44 入出力部 45 通信部 47 CD−ROM 48 フロッピィーディスク DESCRIPTION OF SYMBOLS 1 Personal computer 2 OS (Operating system) 10 PC support tool 11 Programming editor part 12 Compiler part 13 Communication control part 14 Current holding variable allocation information 15 Previous holding variable allocation information 16 Holding variable allocation change judgment part 17 Holding data access part 18 Source Program 19 PC machine language 20 PC (programmable controller) 21 Program memory 22 Data memory 31 Change flag 32 Check sum code 33 Correspondence table 40 Information processing device 41 CPU 42 Storage unit 42a Portable storage medium 43 Memory 44 Input / output unit 45 Communication Part 47 CD-ROM 48 Floppy disk

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 今回のソースプログラムのコンパイルに
よる保持変数割付情報を記憶する今回保持変数割付情報
記憶手段と、 前回のソースプログラムのコンパイルによる保持変数割
付情報を記憶する前回保持変数割付情報記憶手段と、 前記今回保持変数割付情報記憶手段に記憶されている今
回の保持変数割付情報と前回保持変数割付情報記憶手段
に記憶されている前回の保持変数割付情報とを比較し、
メモリ割付に変更があるか否かを判別する保持変数割付
変更判別手段と、 前記保持変数割付変更判別手段によりメモリ割付に変更
があったと判別された保持変数に関してプログラマブル
コントローラ内のメモリに格納されているデータを該保
持変数の今回のメモリ割付位置に移す保持データアクセ
ス手段と、 を有することを特徴とするプログラマブルコントローラ
の支援装置。
1. A current storage variable allocation information storage unit for storing storage variable allocation information obtained by compiling a current source program, and a previous storage variable allocation information storage unit for storing storage variable allocation information obtained by compiling a previous source program. Comparing the current holding variable allocation information stored in the current holding variable allocation information storage means with the previous holding variable allocation information stored in the previous holding variable allocation information storage means,
Holding variable allocation change determining means for determining whether there is a change in the memory allocation; and storing the variable stored in the memory in the programmable controller with respect to the held variable determined to have changed in the memory allocation by the stored variable allocation change determining means. Holding data access means for moving the stored data to the current memory allocation position of the holding variable.
【請求項2】 前記保持変数割付情報は、少なくともソ
ースプログラムのコンパイルの際に決められるプログラ
マブルコントローラ内のメモリに対する各保持変数のメ
モリ割付位置の情報であり、 保持データアクセス手段は、前記保持変数割付変更判別
手段によりメモリ割付に変更があったと判別された場合
には、前記前回の保持変数割付情報に従って前記プログ
ラマブルコントローラ内のメモリから各保持変数に対応
するデータを順次読み出し、今回の保持変数割付情報に
おいて同名の保持変数がある場合には該読み出したデー
タを対応付けて書込み、該書込みが行われた今回の保持
変数割付情報を用いてプログラマブルコントローラ内の
メモリに各保持変数のデータを書込むことを特徴とする
請求項1記載のプログラマブルコントローラの支援装
置。
2. The storage variable allocation information is information on a memory allocation position of each storage variable to a memory in a programmable controller which is determined at least when compiling a source program. When it is determined by the change determining means that the memory allocation has been changed, data corresponding to each stored variable is sequentially read from the memory in the programmable controller according to the previous stored variable allocation information, and the current stored variable allocation information is read. In the case where there is a held variable having the same name, the read data is written in association with the read data, and the data of each held variable is written to the memory in the programmable controller using the held variable assignment information at the time of the writing. The programmable controller according to claim 1, wherein Support device.
JP2000070414A 2000-03-14 2000-03-14 Device for supporting programmable controller Withdrawn JP2001255913A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000070414A JP2001255913A (en) 2000-03-14 2000-03-14 Device for supporting programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000070414A JP2001255913A (en) 2000-03-14 2000-03-14 Device for supporting programmable controller

Publications (1)

Publication Number Publication Date
JP2001255913A true JP2001255913A (en) 2001-09-21

Family

ID=18589149

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000070414A Withdrawn JP2001255913A (en) 2000-03-14 2000-03-14 Device for supporting programmable controller

Country Status (1)

Country Link
JP (1) JP2001255913A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003058380A (en) * 2001-08-09 2003-02-28 Fuji Electric Co Ltd Support device of programmable controller, compiling method and compiler
JP2015022511A (en) * 2013-07-18 2015-02-02 富士電機株式会社 Programmable controller system, and support device and program thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003058380A (en) * 2001-08-09 2003-02-28 Fuji Electric Co Ltd Support device of programmable controller, compiling method and compiler
JP2015022511A (en) * 2013-07-18 2015-02-02 富士電機株式会社 Programmable controller system, and support device and program thereof

Similar Documents

Publication Publication Date Title
US7627851B2 (en) Modification method for modifying a source code
US6961931B2 (en) Dependency specification using target patterns
JPH04330520A (en) Method and apparatus for setting software file in data processing network
KR20050079835A (en) Method for updating firmware in embedded controller and medium recorded update firmware
JP2009146229A (en) Programmable controller system
JP5849592B2 (en) Programmable controller system, programming device thereof, programmable controller, program, and debugging method
JPH04245545A (en) Method of constituting multi-user virtual computer system and multi-user virtual computer system
JP2001255913A (en) Device for supporting programmable controller
JP6541902B1 (en) Program management system, programming support apparatus, program management method, and programming support program
US5555410A (en) Generation management system and method for managing resource generation using pre-edit and post-edit line renumbering
JP2000284815A (en) Program generating device
JPH1185486A (en) Program edition device, its method, and computer-readable medium
CN113360143A (en) Remote software development method, device, storage medium and processor
JP2004206353A (en) Installation method of software
JP3795357B2 (en) Editor device, editor program, and recording medium recording the same
US20020073412A1 (en) Parameter tuner system
JP2003058380A (en) Support device of programmable controller, compiling method and compiler
JPH11282690A (en) Method for writing control program, information processor and information processing system
JPH1027095A (en) Software version managing system
JPH11259308A (en) Programmable controller
CN110609698B (en) Online upgrading method and device for control algorithm unit
JPH0887416A (en) Control program generating device
WO2024128118A1 (en) Development assistance device, development assistance method, and development assistance program
KR20000050238A (en) Manufacturing System and Method for executable program operating at multiple platform
JPH08137521A (en) Program management method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070605