JPH10326105A - Programmable controller and its programming device - Google Patents

Programmable controller and its programming device

Info

Publication number
JPH10326105A
JPH10326105A JP13675297A JP13675297A JPH10326105A JP H10326105 A JPH10326105 A JP H10326105A JP 13675297 A JP13675297 A JP 13675297A JP 13675297 A JP13675297 A JP 13675297A JP H10326105 A JPH10326105 A JP H10326105A
Authority
JP
Japan
Prior art keywords
data area
programmable controller
user program
write
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.)
Pending
Application number
JP13675297A
Other languages
Japanese (ja)
Inventor
Masahiko Sato
雅彦 佐藤
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.)
Denso Corp
Original Assignee
Denso Corp
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 Denso Corp filed Critical Denso Corp
Priority to JP13675297A priority Critical patent/JPH10326105A/en
Publication of JPH10326105A publication Critical patent/JPH10326105A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To prevent the breakdown of data areas used by other tasks without managing the data areas for every program that performs the writing into a data area via a user program of a programmable controller. SOLUTION: At a conversion processing part of the control part of a programming device, the use of a specific data area where a label is added is declared in a program (P1). When the data word length and the number of words are designated for the specific data area, the capacity of the data area is decided based on these decided data word length and number of words. Then the specific data area is allocated to a part of an RAM of a programmable controller (P3). The specific data area can be accessed by a user program only via the label.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラマブルコ
ントローラに実行させるユーザプログラムをプログラミ
ングするプログラミング装置、及びそのプログラミング
装置によってプログラミングされたユーザプログラムを
実行するプログラマブルコントローラに関する。
The present invention relates to a programming device for programming a user program to be executed by a programmable controller, and a programmable controller for executing a user program programmed by the programming device.

【0002】[0002]

【発明が解決しようとする課題】近年、プログラマブル
コントローラ(以下、PCと称す)の制御対象となる設
備は大規模になると共に複雑化しており、それに伴っ
て、PCの制御プログラム及びそれに付随するデータも
大容量化してきている。
In recent years, equipment to be controlled by a programmable controller (hereinafter, referred to as a PC) has become large-scale and complicated, and accordingly, a control program of the PC and data accompanying the PC have been accompanied. Are also increasing in capacity.

【0003】これに対して、従来のPCのプログラミン
グ装置においては、PCのメモリ領域の一部をユーザが
使用可能なデータ領域として公開しており、ユーザは、
そのデータ領域の先頭番地を指定することにより、配列
的な領域を使用していた。
On the other hand, in a conventional PC programming device, a part of a memory area of a PC is disclosed as a data area that can be used by a user.
By specifying the start address of the data area, an array-like area is used.

【0004】しかしながら、データ領域は、ユーザプロ
グラムの各タスクが共通に使用する領域であり、各タス
ク毎に自分が使用するメモリ領域の管理を行わないと、
自分のメモリ領域を越えて、他のタスクが使用している
メモリ領域を破壊してしまう場合がある。
[0004] However, the data area is an area commonly used by each task of the user program, and unless the memory area used by itself is managed for each task,
In some cases, a memory area used by another task may be destroyed beyond its own memory area.

【0005】従って、データ領域に書込みを行うタスク
には、これから行おうとする書込みが可能であるか否か
を、自分のメモリ領域の容量と書込みデータ量とを比較
して判定し、書込みが可能である場合は書込みを行う、
といったようなメモリ領域を管理するためのプログラム
を記述する必要があり、プログラミング作業が煩雑化す
るという問題があった。
[0005] Therefore, in the task of writing to the data area, whether or not the writing to be performed is possible is determined by comparing the capacity of its own memory area with the amount of write data, and writing is possible. If it is, write
It is necessary to write a program for managing the memory area as described above, and there has been a problem that the programming operation becomes complicated.

【0006】また、設定されたデータ領域は単なるアド
レスの配列であるため、本来、そのデータ領域を使用す
る必要のないタスクにおいても、プログラミングのミス
などによりデータ領域のアドレスが記述されれば不用意
にアクセスされてしまい、思わぬ動作等の不具合を発生
することがある。この点からも、データの保護が十分で
あるとは言えなかった。
Further, since the set data area is merely an array of addresses, even in a task which does not need to use the data area, if the address of the data area is described due to a programming mistake or the like, carelessness is required. May be accessed, and a malfunction such as an unexpected operation may occur. Also from this point, data protection was not sufficient.

【0007】本発明は上記事情に鑑みてなされたもので
あり、その目的は、ユーザプログラムにおいて、データ
領域に書込みを行うタスク毎にデータ領域の管理を行わ
ずとも、他のタスクが使用しているデータ領域を破壊す
ることがないプログラマブルコントローラのプログラミ
ング装置及びプログラマブルコントローラを提供するこ
とにある。
The present invention has been made in view of the above circumstances, and an object of the present invention is to allow a user program to manage a data area for each task for writing to the data area without using the data area for management. It is an object of the present invention to provide a programmable controller programming device and a programmable controller that do not destroy a data area.

【0008】[0008]

【課題を解決するための手段】請求項1記載のプログラ
マブルコントローラのプログラミング装置によれば、ユ
ーザは、識別名を付与したデータ領域の使用をユーザプ
ログラム中で宣言するだけで、領域割り付け手段によっ
て、当該データ領域がプログラマブルコントローラのメ
モリ領域の一部に所定容量を以て自動的に割り付けられ
る。
According to a first aspect of the present invention, a user simply declares the use of a data area to which an identification name has been assigned in a user program. The data area is automatically allocated to a part of the memory area of the programmable controller with a predetermined capacity.

【0009】従って、ユーザは、データ領域を使用する
ために割り付けアドレスや容量を一々指定する必要がな
く、プログラミングが容易となる。また、当該データ領
域は、識別名を介してのみアクセスを可能としているの
で、当該データ領域に対しては、ユーザプログラム中に
おいて不用意にアドレスを記述した場合でも、アクセス
が行われることを阻止でき、データの保護管理を確実且
つ容易に行うことができる。
Therefore, the user does not need to specify each assigned address or capacity to use the data area, which facilitates programming. Also, since the data area can be accessed only through the identification name, even if an address is carelessly described in the user program, access to the data area can be prevented. In addition, data protection management can be performed reliably and easily.

【0010】請求項2記載のプログラマブルコントロー
ラのプログラミング装置によれば、領域割り付け手段
は、識別名付与手段によってデータ語長及びデータ数が
指定されると、そのデータ語長及びデータ数に基づいて
データ領域の所定容量を決定するので、ユーザは、目的
に応じて異なるデータ語長及びデータ数を有する複数の
データ領域を使用することが可能となり、ユーザプログ
ラムの自由度を高めることができる。
According to the second aspect of the present invention, when the data word length and the number of data are specified by the identification name assigning means, the area allocating means is configured to store the data based on the data word length and the data number. Since the predetermined capacity of the area is determined, the user can use a plurality of data areas having different data word lengths and the number of data according to purposes, thereby increasing the degree of freedom of the user program.

【0011】請求項3記載のプログラマブルコントロー
ラのプログラミング装置によれば、識別名付与手段によ
って付与された識別名は、ユーザプログラム中において
対応するデータ領域にアクセスを行うためのデータ数が
パラメータとして指定できる。従って、ユーザは、ユー
ザプログラム中で例えば異なるデータ語長及びデータ数
を有する複数のデータ領域を使用する場合でも、各デー
タ領域によって異なるデータ語長に応じてアドレスのオ
フセットを演算することなく、必要なデータ数のみを指
定すれば良いので、ユーザプログラムの自由度が高くな
ると共に記述がより容易となる。
According to the third aspect of the present invention, the number of data for accessing the corresponding data area in the user program can be specified as a parameter for the identifier assigned by the identifier assigning means. . Therefore, even when the user program uses a plurality of data areas having different data word lengths and data numbers in the user program, for example, the user does not need to calculate the address offset according to the different data word length for each data area. Since it is only necessary to specify a large number of data, the degree of freedom of the user program is increased and the description is easier.

【0012】請求項4記載のプログラマブルコントロー
ラのプログラミング装置によれば、変換手段は、ユーザ
プログラムを対象となるプログラマブルコントローラが
実行可能な形式に変換する場合に、何れかのステップに
識別名が記述されている場合は、識別名が使用されてい
ることを示す識別フラグを当該ステップにセットする。
従って、プログラマブルコントローラは、識別フラグを
参照することによって、そのステップのオペランドに指
定されているものが、ユーザプログラム中で使用が宣言
されたデータ領域であるか否かを判断することができ
る。
According to a fourth aspect of the present invention, when the conversion means converts the user program into a format executable by the target programmable controller, the identification name is described in any of the steps. If so, an identification flag indicating that the identification name is used is set in the step.
Therefore, by referring to the identification flag, the programmable controller can determine whether or not what is specified in the operand of the step is a data area declared to be used in the user program.

【0013】請求項5記載のプログラマブルコントロー
ラのプログラミング装置によれば、書込み判定シミュレ
ート手段は、シミュレーション手段がユーザプログラム
の実行状態をシミュレートする時に、書込み命令を実行
するステップに識別フラグがセットされている場合は、
その識別名が付されたデータ領域の書込み可能容量と当
該データ領域に対して指定されている書込み容量とを比
較して、前記書込み命令を実行すると前記データ領域を
オーバーすると判断した場合は、エラーメッセージを出
力する。
According to a fifth aspect of the present invention, when the simulation means simulates the execution state of the user program, the identification flag is set in the step of executing the write instruction. If you have
If a comparison is made between the writable capacity of the data area to which the identification name is assigned and the write capacity specified for the data area, and execution of the write command determines that the data area is exceeded, an error will occur. Output a message.

【0014】従って、例えば、識別名に付されたパラメ
ータのデータ数が即値で指定されているステップに関し
ては、プログラマブルコントローラに実際に実行させる
前に、シミュレーションを行うことによってデータ領域
をオーバーするような書込みが行われるか否かを事前に
チェックすることができるので、デバッグ作業をより効
率的に行うことができる。
Therefore, for example, for a step in which the number of data of the parameter assigned to the identification name is specified by an immediate value, the data area is overrun by performing a simulation before the program is actually executed by the programmable controller. Since it is possible to check in advance whether or not writing is performed, debugging can be performed more efficiently.

【0015】請求項6記載のプログラマブルコントロー
ラのプログラミング装置によれば、送信手段は、領域割
り付け手段によって割り付けが行われたデータ領域に関
するデータ領域情報を、実行可能な形式に変換されたユ
ーザプログラムと共に前記プログラマブルコントローラ
側に送信する。従って、プログラマブルコントローラ
は、ユーザプログラムの各ステップにおける識別フラグ
の有無とデータ領域情報とを参照することによって、識
別名が付されたデータ領域のアドレス等の情報を得るこ
とができる。
According to a sixth aspect of the present invention, the transmitting means transmits the data area information relating to the data area allocated by the area allocating means together with the user program converted into an executable form. Transmit to the programmable controller side. Therefore, the programmable controller can obtain information such as the address of the data area to which the identification name is given by referring to the presence or absence of the identification flag and the data area information in each step of the user program.

【0016】請求項7記載のプログラマブルコントロー
ラによれば、書込み判定手段は、実行形式に変換された
ユーザプログラムの実行時に、書込み命令を実行するス
テップに識別フラグがセットされていると、データ領域
情報を参照して当該ステップのオペランドで指定されて
いる識別名が付されたデータ領域の書込み可能容量と当
該データ領域に対して指定されている書込み容量とを比
較して、書込み命令を実行するとデータ領域をオーバー
するとした場合は、CPUの実行ステータスレジスタに
書込みエラーを示すエラーフラグをセットする。
According to the seventh aspect of the present invention, when the identification flag is set in the step of executing the write instruction when the user program converted into the execution form is executed, the write determination means may execute the data area information. Compare the writable capacity of the data area with the identification name specified by the operand of the step with the write capacity specified for the data area, and execute the write instruction. If the area is exceeded, an error flag indicating a write error is set in the execution status register of the CPU.

【0017】従って、ユーザプログラムの実行時におい
て、例えば、識別名に付されたパラメータのデータ数
が、実際の処理結果によって値が変化するような変数で
与えられている場合、実際に書込みが実行される前に、
その書込みがデータ領域をオーバーする書込みであるか
否かを、実行ステータスレジスタのエラーフラグを参照
することによりチェックすることができるので、他の領
域に記憶されているデータが破壊されるのを未然に防止
することができる。
Therefore, when the user program is executed, for example, when the number of data of the parameter assigned to the identification name is given by a variable whose value changes according to the actual processing result, the writing is actually executed. Before being
It is possible to check whether or not the write is a write that exceeds the data area by referring to the error flag of the execution status register. Therefore, it is possible to prevent data stored in other areas from being destroyed. Can be prevented.

【0018】[0018]

【発明の実施の形態】以下、本発明の一実施例について
図面を参照して説明する。図7及び図8は、プログラマ
ブルコントローラ及びそのプログラミング装置の構成を
示す機能ブロック図である。図8において、プログラミ
ング装置1は、例えばパーソナルコンピュータによって
構成されており、キーボード2,マイクロコンピュータ
を中心とする制御部(識別名付与手段,送信手段)3,
ディスプレイ4などからなるものである。
DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below with reference to the drawings. 7 and 8 are functional block diagrams showing the configuration of the programmable controller and its programming device. In FIG. 8, a programming device 1 is constituted by a personal computer, for example, and includes a keyboard 2, a control unit (identification name assigning means, transmitting means) centered on a microcomputer 3,
It comprises a display 4 and the like.

【0019】制御部3には、プログラマブルコントロー
ラ(以下、PCと称す。図7参照)5に実行させるユー
ザプログラム(以下、単にプログラムと称す)を入力,
修正するためのソフトウエアであるエディタ3a,入力
されたプログラムの変換処理などを行う変換処理部(領
域割り付け手段,変換手段)3b及びPC5によるプロ
グラムの実行状態をシミュレーションするためのシミュ
レータ(シミュレーション手段,書込み判定シミュレー
ション手段)3cが、ハードディスク6から読み出され
て図示しないワークエリアたるRAM上に常駐している
ものとする。
A user program (hereinafter, simply referred to as a program) to be executed by a programmable controller (hereinafter, referred to as PC; see FIG. 7) 5 is input to the control unit 3.
An editor 3a which is software for correction, a conversion processing unit (area allocation means, conversion means) 3b for performing a conversion process of an input program, and a simulator for simulating a program execution state by the PC 5 (simulation means, It is assumed that the write determination simulation means 3c is read from the hard disk 6 and is resident on the RAM, which is a work area (not shown).

【0020】プログラミング装置1は、更に、PC5と
の間でデータ転送を行うための通信用インターフェイス
(送信手段)7などを有している。通信用インターフェ
イス7は、RS−232C若しくはRS−485などの
シリアル通信方式によって、通信用ケーブル8を介して
データ転送を行うようになっている。
The programming device 1 further has a communication interface (transmission means) 7 for transferring data to and from the PC 5. The communication interface 7 performs data transfer via a communication cable 8 by a serial communication method such as RS-232C or RS-485.

【0021】一方、図7に示すように、PC5側は、C
PU9,そのCPU9にシステムバスを介して接続され
ているROM10及びRAM11,プログラミング装置
1側の通信用インターフェイス7と通信ケーブル8を介
して接続され、CPU9とも通信用バスで接続されてい
る通信用インターフェイス12などから構成されてい
る。
On the other hand, as shown in FIG.
PU 9, a ROM 10 and a RAM 11 connected to the CPU 9 via a system bus, a communication interface 7 connected to a communication interface 7 of the programming device 1 via a communication cable 8, and also connected to the CPU 9 via a communication bus. 12 and the like.

【0022】ROM10には、CPU9の基本的な制御
を行うプログラムであるファームウエア(図9参照)が
記憶されており、RAM11には、プログラミング装置
1側から送信されるユーザプログラム及びデータが記憶
されるようになっている。また、CPU9には、I/O
バスを介して図示しない他のI/O装置が接続されてい
る。
The ROM 10 stores firmware (see FIG. 9) which is a program for performing basic control of the CPU 9, and the RAM 11 stores a user program and data transmitted from the programming device 1 side. It has become so. Also, the CPU 9 has an I / O
Another I / O device (not shown) is connected via a bus.

【0023】図9は、PC5のCPU9がプログラムを
実行する場合のハードウエア−ソフトウエアの階層構造
を概念的に示すものである。この図9においては、CP
U9のハードウエア13が最下層にあり、その上層にC
PU9のファームウエア14が存在し、更にその上層に
ユーザプログラムたるラダープログラム15が存在して
いる。CPU9のファームウエア14には、ハードウエ
ア13を直接操作して基本的なデータの入出力を行わせ
るリソースアクセス部14aがあり、そのリソースアク
セス部14aの一部として、実行判定部(書込み判定手
段)14bを有している。
FIG. 9 conceptually shows a hierarchical structure of hardware and software when the CPU 9 of the PC 5 executes a program. In this FIG.
The hardware 13 of U9 is at the lowest layer, and the upper layer is C
The firmware 14 of the PU 9 exists, and a ladder program 15 as a user program exists above the firmware 14. The firmware 14 of the CPU 9 includes a resource access unit 14a for directly operating the hardware 13 to input and output basic data. As a part of the resource access unit 14a, an execution determination unit (write determination unit) ) 14b.

【0024】リソースアクセス部14bの上層には、ラ
ダープログラム15の実行時において、既に機械語(ネ
イティブコード)に変換されている部分をデコードする
ネイティブデコード部14c、及びユーザプログラム1
5のその他の部分をネイティブコードに変換した後ネイ
ティブデコード部14cに渡すインタプリタ部14dが
存在する。
In the upper layer of the resource access unit 14b, when the ladder program 15 is executed, a native decoding unit 14c for decoding a part which has already been converted into a machine language (native code), and a user program 1
There is an interpreter unit 14d which converts the other parts of the code No. 5 into native codes and passes them to the native decode unit 14c.

【0025】次に、本実施例の作用について図1乃至図
6をも参照して説明する。作業者は、プログラミング装
置1のエディタ3aを起動すると、キーボード2を操作
して、ディスプレイ4の表示を見ながらラダープログラ
ム(以下、単にプログラムと称す)を作成する。図3
は、プログラミング作業の処理手順を示すプロセスチャ
ートである。
Next, the operation of the present embodiment will be described with reference to FIGS. When the operator starts the editor 3a of the programming device 1, the operator operates the keyboard 2 and creates a ladder program (hereinafter, simply referred to as a program) while watching the display on the display 4. FIG.
Is a process chart showing a processing procedure of a programming operation.

【0026】この図3において、先ず、「ラベルの使用
を宣言」のステップP1の処理が実行される。ここで、
ユーザたる作業者は、PC5のRAM11内においてユ
ーザ定義メモリ領域としてシステム上設定されているも
のの一部をデータ領域として使用したい場合は、プログ
ラムの冒頭部分で、例えば以下のような書式によって宣
言を行う。 DUM ラベル[データ語長,ワード数] …(1) ここで、“DUM”は、ユーザ定義メモリ領域の一部
を、ラベル(識別名)を付したデータ領域として使用す
ることを宣言するコマンドであり、具体的には、以下の
ように記述する(図4参照)。
In FIG. 3, first, the process of step P1 of "declare use of label" is executed. here,
If the user who wants to use a part of the system area set as the user-defined memory area in the RAM 11 of the PC 5 as the data area, the user makes a declaration at the beginning of the program in the following format, for example. . DUM label [data word length, number of words] (1) Here, "DUM" is a command for declaring that a part of the user-defined memory area is used as a data area with a label (identification name). Yes, specifically, it is described as follows (see FIG. 4).

【0027】 DUM BMEM[ 8,2048] DUM WMEM[16,1024] …(2) DUM LMEM[32, 512] 例えば、“WMEM[16,1024]”は、データ語
長16ビットで、ワード数(データ数)が1024ワー
ド、即ち、16×1024=2Kバイトの領域を、ラベ
ル“WMEM”としてユーザ定義メモリ領域の一部に確
保することを意味する。尚、ラベルを付したデータ領域
を、以降、特定データ領域と称する。
DUM BMEM [8, 2048] DUM WMEM [16, 1024] (2) DUM LMEM [32, 512] For example, “WMEM [16, 1024]” has a data word length of 16 bits and a word number ( This means that an area having 1024 words, that is, 16 × 1024 = 2 Kbytes, is secured in a part of the user-defined memory area as a label “WMEM”. Note that the labeled data area is hereinafter referred to as a specific data area.

【0028】次に、作業者は、「プログラム記述」のス
テップP2において、使用を宣言した特定データ領域の
ラベルを用いてプログラムの記述を行う。プログラムの
記述が終了して、例えばキーボード2の『入力確定』キ
ーが操作されると、記述されたプログラムの入力が確定
する。
Next, in step P2 of the "program description", the worker describes the program using the label of the specific data area declared to be used. When the description of the program is completed and, for example, the "input confirmation" key of the keyboard 2 is operated, the input of the described program is confirmed.

【0029】すると、「特定データ領域割り付け」のス
テップP3において、制御部3の変換処理部3bによっ
て各特定データ領域の割り付けが行われる。例えば、ユ
ーザ定義メモリ領域がアドレス800H(16進数表
示)〜4000Hまでであり、特定データ領域の割り付
けが1000Hから行われるとすると、(2)のように
記述が行われた場合は、 BMEM 1000H〜17FFH WMEM 1800H〜1BFFH …(3) LMEM 1C00H〜1FFFH の各2Kバイトの領域として割り付けられる(図5参
照)。また、この様に割り付けが行われた結果、特定デ
ータ領域情報が生成される。
Then, in step P3 of "assignment of specific data area", assignment of each specific data area is performed by the conversion processing unit 3b of the control unit 3. For example, if the user-defined memory area has addresses from 800H (hexadecimal) to 4000H and the specific data area is allocated from 1000H, if the description is made as in (2), BMEM 1000H to 17FFH WMEM 1800H to 1BFFH (3) Allocated as 2 Kbyte areas of LMEM 1C00H to 1FFFH (see FIG. 5). Also, as a result of the allocation, specific data area information is generated.

【0030】次に、「プログラム変換」のステップP4
において、記述されたプログラムは、変換処理部3bに
よってPC5が実行可能な形式に変換される。例えば、
プログラム中において、特定データ領域“WMEM”を
オペランドに指定し、以下のような記述が行われたと
する(図6(a)参照)。 COPY 10000H WMEM[256] …(4) これは、10000H番地から、特定データ領域“WM
EM”に16ビットデータを256ワード分転送せよ、
という意味である。
Next, step P4 of "program conversion"
In, the described program is converted by the conversion processing unit 3b into a format executable by the PC 5. For example,
It is assumed that a specific data area “WMEM” is specified as an operand in a program and the following description is made (see FIG. 6A). COPY 10000H WMEM [256] (4) This is from the address 10000H to the specific data area “WM
Transfer 256 bits of 16-bit data to EM ",
It means.

【0031】図6(b)は、(4)のコマンドライン
(ステップ)を、PC5が実行可能な形式に変換した場
合の例を示すものである。この場合、オペランドに対
応する識別フラグ格納領域には、ラベルが付された特定
データ領域が使用されていることを示す識別フラグが
“1”にセットされる。そして、ラベル“WMEM”自
体は割り付けられたドレスには変換されず、テキストコ
ードがそのままセットされる。
FIG. 6B shows an example in which the command line (step) of (4) is converted into a format executable by the PC 5. In this case, an identification flag indicating that a specific data area with a label is used is set to “1” in the identification flag storage area corresponding to the operand. Then, the label “WMEM” itself is not converted into the assigned dress, and the text code is set as it is.

【0032】また、図6(b)の識別フラグの後に配置
されているのは、オペランド,のアドレッシングモ
ードを指定するためのビットであり、実際には、各オペ
ランドに対して例えば3〜4ビット程度のビット数が割
り当てられている。
The bits arranged after the identification flag shown in FIG. 6B are bits for designating the addressing mode of the operand. Actually, for example, 3 to 4 bits are assigned to each operand. About the number of bits are assigned.

【0033】一方、例えばコマンドが“LD”などであ
り、特定データ領域から読み出しを行なうものである場
合は、ラベル“WMEM”を割り付けたアドレスの即値
に変換して、識別フラグをセットしないようして良い。
On the other hand, if the command is, for example, "LD" and reads from a specific data area, the label is converted to the immediate value of the address to which the label "WMEM" is assigned, and the identification flag is not set. Good.

【0034】尚、プログラム変換処理では、プログラム
の記述文法等に関するエラーチェックも行われるように
なっている。そして、ステップP1においてラベルの使
用を宣言した特定データ領域にステップP3においてア
ドレスの割り付けが行われた結果、プログラム中で特定
データ領域に対応するアドレスが即値で記述されている
と、変換処理部3bは、それを不正な記述と判断してデ
ィスプレイ4にエラーメッセージを出力させる。
In the program conversion process, an error check on the program description grammar and the like is also performed. If the address is assigned in step P3 to the specific data area in which the use of the label is declared in step P1 and the address corresponding to the specific data area is described as an immediate value in the program, the conversion processing unit 3b Determines that the description is incorrect and causes the display 4 to output an error message.

【0035】即ち、特定データ領域に対しては、プログ
ラム中で使用を宣言したラベル名を介してのみアクセス
を可能として、特定データ領域に対応するアドレスを不
用意に記述してしまうことによる特定データ領域のデー
タの破壊を防止するようにしている。
That is, the specific data area can be accessed only through the label name declared to be used in the program, and the address corresponding to the specific data area is inadvertently described. The data in the area is prevented from being destroyed.

【0036】以上のようにしてプログラミング作業が終
了する。そして、実行形式に変換されたプログラム及び
特定データ領域情報は、プログラミング装置1に例えば
“セーブ”コマンドが入力されるとハードディスク6へ
書き込まれて記憶され、“送信(アップロード)”コマ
ンドが入力されると、PC5に通信用インターフェイス
7を介して送信される。そして、プログラミング装置1
から実行開始命令が与えられると、PC5のCPU9
は、プログラムを実行する。
The programming operation is completed as described above. The program and the specific data area information converted into the execution format are written and stored in the hard disk 6 when a "save" command is input to the programming device 1, for example, and a "send (upload)" command is input. Is transmitted to the PC 5 via the communication interface 7. And the programming device 1
When an execution start instruction is given from the CPU 5, the CPU 9 of the PC 5
Runs the program.

【0037】図2は、ユーザプログラム中で、ラベルを
付した特定データ領域に対して書込みを行う処理を記述
する場合の手順を概略的に示すフローチャートである。
この図2において、先ず、「特定データ領域に書込み」
の処理ステップA1で、例えば上記した(4)のコマン
ドラインのような書込み命令を記述する。尚、ここで
“書込み”とは、“MOV”,“COPY”などの命令
を包括的に意味している。
FIG. 2 is a flowchart schematically showing a procedure for describing a process of writing in a specific data area with a label in a user program.
In FIG. 2, first, “write to specific data area”
In the processing step A1, a write command such as the command line of (4) is described. Here, "write" comprehensively means instructions such as "MOV" and "COPY".

【0038】次に、「エラーフラグセット?」の判断ス
テップA2において、詳細は後述するが、CPU9の実
行ステータスレジスタを参照して、書込みが実行できな
かったことを示すエラーフラグがセットされたか否かを
判断する。エラーフラグがセットされておらず「NO」
と判断すると、書込み処理を終了する。
Next, in the determination step A2 of "error flag set?", As will be described in detail later, referring to the execution status register of the CPU 9, whether or not an error flag indicating that writing could not be executed has been set. Judge. Error flag is not set and "NO"
, The writing process is terminated.

【0039】また、エラーフラグがセットされており
「YES」と判断すると、「領域一杯フラグセット」の
処理ステップA3に移行して、例えばCPU9の外部レ
ジスタとして、RAM11や或いはハードウエア的に設
定されている領域一杯フラグの格納領域に、領域一杯フ
ラグをセットする。すると、書込み処理を終了する。
If the error flag has been set and the judgment is "YES", the processing shifts to the processing step A3 of "set the area full flag", and the RAM 9 or the hardware is set as an external register of the CPU 9, for example. The full area flag is set in the storage area of the full area flag. Then, the writing process ends.

【0040】即ち、ユーザプログラムとしては、書込み
命令を発行した後は、CPU9の実行ステータスレジス
タを参照して、書込みが正常に実行されたか否かを判断
すれば良いだけである。そして、書込みが正常に実行さ
れなかった場合は領域一杯フラグをセットすることによ
って、例えば書込みエラーを報知するランプを点灯させ
たり、或いは、予備として別個に設定されている特定デ
ータ領域に書込みを行わせるなどのエラー処理を行うよ
うにする。
That is, as for the user program, after issuing the write command, it is only necessary to refer to the execution status register of the CPU 9 and determine whether or not the write has been normally performed. If the writing is not performed normally, the area full flag is set, for example, to turn on a lamp for notifying a writing error or to perform writing to a specific data area separately set as a spare. Error processing such as

【0041】図1は、PC5のCPU9がユーザプログ
ラムを実行する場合のフェッチ,デコード及び実行のサ
イクルを、特定データ領域に対する書込み処理を中心と
して表したフローチャートである。
FIG. 1 is a flowchart showing a cycle of fetching, decoding and execution when the CPU 9 of the PC 5 executes a user program, focusing on a writing process to a specific data area.

【0042】この図1において、先ず、「フェッチ」の
ステップB1で、CPU9は、RAM11からプログラ
ムの1ステップ(以下、Pステップと称す)を読み出す
と、次の「命令デコード」の処理ステップB2におい
て、当該Pステップの命令コード(オペコード)のデコ
ードを行う。そして、「書込み命令?」の判断ステップ
B3に移行する。
In FIG. 1, first, at step B1 of "fetch", the CPU 9 reads one step (hereinafter, referred to as P step) of the program from the RAM 11, and then at step B2 of "instruction decode". , Decodes the instruction code (op code) of the P step. Then, the process proceeds to the judgment step B3 of "write command?"

【0043】判断ステップB3において、CPU9は、
ステップB2でデコードした命令が書込み命令であるか
否かを判断する。書込み命令ではなく「NO」と判断す
ると、「他の処理」の処理ステップB4に移行して、他
の命令に応じた処理を行う。また、デコードした命令が
書込み命令であり「YES」と判断すると、「識別フラ
グセット?」の判断ステップB5に移行する。
In the decision step B3, the CPU 9
It is determined whether or not the instruction decoded in step B2 is a write instruction. If it is determined to be “NO” instead of the write instruction, the process shifts to the processing step B4 of “other processing” to perform processing according to the other instruction. If the decoded instruction is a write instruction and the judgment is "YES", the flow shifts to "identification flag set?" Judgment step B5.

【0044】判断ステップB5において、CPU9は、
読み出したPステップに識別フラグがセットされている
か否かを判断する。識別フラグがセットされておらず
「NO」と判断すると、「書込み実行」の処理ステップ
B6に移行する。
In the decision step B5, the CPU 9
It is determined whether or not the identification flag is set in the read P step. If it is determined that the identification flag is not set and the determination is "NO", the process proceeds to the processing step B6 of "write execution".

【0045】即ち、識別フラグがセットされていないP
ステップにおけるオペランドのデスティネーションアド
レスには、特定領域を示すラベルは使用されておらず、
アドレスの即値がセットされている。この場合は、処理
ステップB6において、CPU9は、ネイティブデコー
ド部14cに処理を渡し、そのアドレスをアクセスして
書込み命令を実行する。そして、ステップB1に移行し
て、プログラムの次のPステップを読み出す。
That is, the P for which the identification flag is not set
No label indicating a specific area is used for the destination address of the operand in the step.
The immediate value of the address is set. In this case, in the processing step B6, the CPU 9 passes the processing to the native decoding unit 14c, accesses the address, and executes the write instruction. Then, the process proceeds to step B1 to read the next P step of the program.

【0046】一方、判断ステップB5において、識別フ
ラグがセットされておりCPU9が「YES」と判断す
ると、「特定データ領域の情報を得る」の処理ステップ
B7に移行する。処理ステップB7においては、インタ
プリタ部14dによって処理が行われる。CPU9は、
Pステップのオペランドにあるラベル名“WMEM”を
判別して、特定データ領域“WMEM”に関する割り付
けアドレス,データ語長やワード数などの情報を、プロ
グラミング装置1からRAM11に送信されている特定
データ領域情報から得る。そして、「書込み可能容量算
出」の処理ステップB8に移行する。
On the other hand, in the judgment step B5, if the identification flag is set and the CPU 9 judges "YES", the processing shifts to the processing step B7 of "obtaining information of a specific data area". In the processing step B7, the processing is performed by the interpreter unit 14d. CPU 9
The label name “WMEM” in the operand of the P step is determined, and information such as the allocation address, the data word length, and the number of words relating to the specific data area “WMEM” is stored in the specific data area transmitted from the programming device 1 to the RAM 11. Gain from information. Then, the process shifts to processing step B8 of “calculation of writable capacity”.

【0047】処理ステップB8〜B12の処理は、実行
判定部14bによって行われる。処理ステップB8にお
いて、CPU9は、特定データ領域“WMEM”の書込
み可能容量を算出する。ここで、特定データ領域“WM
EM”は他の処理において演算に用いられるデータが一
時的に記憶されるテンポラリバッファとして使用されて
おり、ユーザプログラムにおいて書込み命令が発行され
ると、1回の発行毎にデータ領域の先頭からデータの書
込みが行われるようになっている。
The processing of the processing steps B8 to B12 is performed by the execution determining unit 14b. In the processing step B8, the CPU 9 calculates the writable capacity of the specific data area “WMEM”. Here, the specific data area “WM
EM "is used as a temporary buffer for temporarily storing data used for calculation in other processing. When a write instruction is issued in a user program, data is written from the beginning of the data area every time a write instruction is issued. Is written.

【0048】従って、この場合、特定データ領域“WM
EM”についての書込み可能容量とは、当該データ領域
全体の容量を示す。また、書込み命令は、(4)に示す
ようにパラメータとして書込みワード数を指定するの
で、ステップB5で得た情報から、特定データ領域“W
MEM”のワード数(1024)を書込み可能容量とす
る。次に、「書込み容量算出」の処理ステップB9に移
行する。
Therefore, in this case, the specific data area "WM
The writable capacity for EM "indicates the capacity of the entire data area. Further, since the write command specifies the number of write words as a parameter as shown in (4), from the information obtained in step B5, Specific data area "W
The number of words (1024) of “MEM” is set as the writable capacity. Next, the processing shifts to processing step B9 of “calculation of write capacity”.

【0049】処理ステップB9において、CPU9は、
(4)に示すラベル“WMEM”のパラメータとして指
定されている書込みワード数100H(256)を得
て、この場合の書込み容量とする。そして、「書込み可
否値算出」の処理ステップB10に移行する。
In the processing step B9, the CPU 9
The number of write words 100H (256) specified as the parameter of the label "WMEM" shown in (4) is obtained, and is set as the write capacity in this case. Then, the process shifts to processing step B10 of “calculation of write enable / disable value”.

【0050】処理ステップB10において、CPU9
は、ステップB8で得た書込み可能容量から、ステップ
B9で得た書込み容量を減算することにより書込み可否
値を演算する。この場合、書込み可否値は、1024−
256=768 となる。そして、次の「書込み可否値
<0?」の判断ステップB11において、CPU9は、
ステップB10で算出した書込み可否値が0未満である
か否かを判断する。
In the processing step B10, the CPU 9
Calculates the writability value by subtracting the write capacity obtained in step B9 from the writable capacity obtained in step B8. In this case, the write enable / disable value is 1024-
256 = 768. Then, in the next determination step B11 of “writability value <0?”, The CPU 9
It is determined whether the writability value calculated in step B10 is less than 0.

【0051】この場合は、書込み可否値が0以上であり
CPU9が「NO」と判断するので、ステップB6に移
行して、特定データ領域“WMEM”に先頭アドレス1
800Hから256ワード、即ち容量512バイトの書
込みを行う。また、書込み可否値が0未満であり「YE
S」と判断した場合は、「エラーフラグセット」の処理
ステップB12に移行して、実行判定部14bは、CP
U9内部の実行ステータスレジスタの書込みエラーフラ
グのビットにフラグをセットする。その後、ステップB
1に移行する。
In this case, since the write enable / disable value is equal to or greater than 0 and the CPU 9 determines "NO", the process shifts to step B6 to store the first address 1 in the specific data area "WMEM".
Writing is performed from 800H to 256 words, that is, a capacity of 512 bytes. Also, the write enable / disable value is less than 0 and “YE
S ”, the process proceeds to“ Error flag set ”processing step B12, and the execution determination unit 14b
A flag is set in the write error flag bit of the execution status register inside U9. Then, step B
Move to 1.

【0052】即ち、CPU9の実行判定部14bによっ
て行われるステップB11における判断の結果が、図2
に示すユーザプログラムのステップA2における、書込
みの成否の判断に反映されるようになっている。
That is, the result of the determination in step B11 performed by the execution determining unit 14b of the CPU 9 is shown in FIG.
In the step A2 of the user program shown in FIG.

【0053】以上の図1に示したフローチャートは、P
C5のCPU9が実際にユーザプログラムを実行する場
合の処理である。一方、プログラミング装置1の制御部
3が有するシミュレータ3cは、CPU9のユーザプロ
グラムの実行状態をプログラミング装置1側においてシ
ミュレートするものであり、そのシミュレータ3cがシ
ミュレーションを実行する場合も、基本的には、図1に
示したフローチャートに従って実行するようになってい
る。
The flowchart shown in FIG.
This is a process when the CPU 9 of C5 actually executes the user program. On the other hand, the simulator 3c included in the control unit 3 of the programming device 1 simulates the execution state of the user program of the CPU 9 on the programming device 1 side. , According to the flowchart shown in FIG.

【0054】そして、シミュレータ3cは、CPU9に
よる実行状態をした結果、例えば、プログラム中で定義
されていない変数を使用していたり、或いは0除算など
の不正な演算が行なわれた場合などには、ディスプレイ
4にエラーメッセージを出力するなどして、作業者にプ
ログラムの修正を促す。
Then, as a result of the execution state of the CPU 9, for example, when the simulator 3 c uses a variable that is not defined in the program or performs an illegal operation such as division by zero, An error message is output on the display 4 to urge the operator to correct the program.

【0055】また、例えばステップB12に対応する処
理において「YES」と判断した場合も、シミュレータ
3cは、ディスプレイ4にエラーメッセージを出力させ
る。但し、この場合シミュレータ3cによってチェック
が可能となるのは、特定データ領域の書込みに対して与
えられるパラメータが(4)に示すコマンドラインのよ
うに即値であるもの、若しくは、与えられている既知の
データから数値が確定される変数に限る。
Also, for example, when it is determined “YES” in the processing corresponding to step B 12, the simulator 3 c causes the display 4 to output an error message. However, in this case, the simulator 3c can check whether the parameter given to the writing of the specific data area is an immediate value like a command line shown in (4), or the given known parameter. Limited to variables whose values can be determined from data.

【0056】逆に、特定データ領域の書込みに対して与
えられるパラメータが、例えば、 COPY 20000H WMEM[DATAIN] …(5) のように変数“DATAIN”であり、この変数“DA
TAIN”が、PC5が実際に動作した時に、外部装置
からPC5に対して送信されるデータ量によって決定さ
れるものである場合は、プログラミング装置1側のシミ
ュレータ3cでは書込みの可否をチェックすることはで
きない。
Conversely, the parameter given to the writing of the specific data area is a variable “DATAIN” such as, for example, COPY 20000H WMEM [DATAIN] (5).
If TAIN "is determined by the amount of data transmitted from the external device to the PC 5 when the PC 5 actually operates, the simulator 3c on the programming device 1 side checks whether writing is possible. Can not.

【0057】しかしながら、PC5側においては、実際
にユーザプログラムを実行する場合に、図1に示す処理
ステップB8〜B12の処理を、CPU9の実行判定部
14bがリアルタイムで行うことによって、パラメータ
が動的に変化する場合であっても書込みの可否をチェッ
クすることができるのである。
However, on the PC 5 side, when the user program is actually executed, the execution determination unit 14b of the CPU 9 performs the processing of the processing steps B8 to B12 shown in FIG. Can be checked whether writing is possible or not.

【0058】以上のように本実施例によれば、プログラ
ミング装置1の制御部3における変換処理部3bは、ラ
ベルが付与された特定データ領域を使用することがユー
ザプログラム中で宣言され、且つ、その特定データ領域
のデータ語長及びワード数が指定されると、そのデータ
語長及びワード数に基づいて特定データ領域の容量を決
定し、その特定データ領域をPC5のRAM11の一部
に割り付ける。そして、その特定データ領域は、ユーザ
プログラムからはラベルを介してのみアクセスが可能と
なるようにした。
As described above, according to this embodiment, the conversion processing unit 3b in the control unit 3 of the programming device 1 declares in the user program that the specific data area to which the label has been assigned is used, and When the data word length and the number of words of the specific data area are designated, the capacity of the specific data area is determined based on the data word length and the number of words, and the specific data area is allocated to a part of the RAM 11 of the PC 5. The specific data area can be accessed from the user program only via the label.

【0059】従って、作業者は、ユーザプログラムにお
いて特定データ領域を使用するために割り付けアドレス
や容量を一々指定する必要がなく、目的に応じて異なる
データ語長及びワード数を有する複数の特定データ領域
を使用することができ、プログラミングの自由度が高ま
り、記述を容易に行うことができる。また、ユーザプロ
グラム中において不用意に記述された特定データ領域に
対応するアドレスによりアクセスが行われることがな
く、データの保護管理を容易に行うことができる。
Therefore, it is not necessary for the operator to specify the assigned addresses and the capacities one by one in order to use the specific data area in the user program, and a plurality of specific data areas having different data word lengths and word numbers according to the purpose are not required. Can be used, the degree of freedom of programming is increased, and description can be easily performed. In addition, since access is not performed by an address corresponding to a specific data area described carelessly in a user program, data protection management can be easily performed.

【0060】また、本実施例によれば、ユーザプログラ
ム中において対応する特定データ領域にアクセスを行う
ためのワード数がパラメータとして指定できるので、作
業者は、ユーザプログラム中で例えば異なるデータ語長
及びワード数を有する複数の特定データ領域を使用する
場合でも、各特定データ領域によって異なるデータ語長
に応じてアドレスのオフセットを演算することなく、必
要なデータ数のみを指定すれば良いので、ユーザプログ
ラムの記述がより容易となる。
Further, according to the present embodiment, the number of words for accessing the corresponding specific data area in the user program can be designated as a parameter. Even when a plurality of specific data areas having the number of words are used, it is sufficient to specify only the necessary number of data without calculating an address offset according to a data word length different for each specific data area. Is easier to describe.

【0061】更に、本実施例によれば、変換処理部3b
は、ユーザプログラムをPC5が実行可能な形式に変換
する場合に、何れかのステップにラベルが記述されてい
る場合は、ラベルが使用されていることを示す識別フラ
グを当該ステップにセットするので、PC5は、識別フ
ラグを参照することによって、そのステップのオペラン
ドに指定されているものが、ユーザプログラム中で使用
が宣言された特定データ領域であるか否かを判断するこ
とができる。
Further, according to the present embodiment, the conversion processing unit 3b
When converting a user program into a format executable by the PC 5, if a label is described in any step, an identification flag indicating that the label is used is set in the step. By referring to the identification flag, the PC 5 can determine whether or not the one specified in the operand of the step is a specific data area declared to be used in the user program.

【0062】加えて、本実施例によれば、プログラミン
グ装置1の制御部3におけるシミュレータ3cは、PC
5によるユーザプログラムの実行状態をシミュレートす
る時に、書込み命令を実行するステップに識別フラグが
セットされている場合は、その特定データ領域の書込み
可能容量とその特定データ領域に対して指定されている
書込み容量とを比較して、書込み命令を実行すると特定
データ領域をオーバーすると判断した場合は、ディスプ
レイ4にエラーメッセージを出力するようにした。
In addition, according to this embodiment, the simulator 3c in the control unit 3 of the programming device 1
When the identification flag is set in the step of executing the write instruction when simulating the execution state of the user program according to No. 5, the writable capacity of the specific data area and the specified data area are designated. By comparing with the write capacity, if it is determined that the execution of the write command exceeds the specific data area, an error message is output to the display 4.

【0063】従って、ラベルに付されたパラメータのワ
ード数が即値若しくは確定値で指定されているステップ
に関しては、PC5に実際に実行させる前に、特定デー
タ領域をオーバーするような書込みが行われるか否かを
事前にチェックすることができるので、デバッグ作業を
より効率的に行うことができる。
Therefore, regarding the step in which the number of words of the parameter attached to the label is specified by an immediate value or a definite value, before the actual execution by the PC 5, whether writing is performed so as to exceed the specific data area. Since it is possible to check in advance whether or not it is possible, debugging can be performed more efficiently.

【0064】また、本実施例によれば、制御部3は、変
換処理部3bよって割り付けが行われた特定データ領域
に関する特定データ領域情報を、実行可能な形式に変換
されたユーザプログラムと共にPC5側に送信するの
で、PC5は、ユーザプログラムの各ステップにおける
識別フラグの有無と特定データ領域情報とを参照するこ
とによって、特定データ領域のアドレス等の情報を得る
ことができる。
Further, according to the present embodiment, the control unit 3 transmits the specific data area information relating to the specific data area allocated by the conversion processing unit 3b together with the user program converted into an executable format to the PC 5 side. Therefore, the PC 5 can obtain information such as the address of the specific data area by referring to the presence or absence of the identification flag and the specific data area information in each step of the user program.

【0065】また、本実施例によれば、PC5のCPU
9における実行判定部14bは、ユーザプログラムの実
行時において、書込み命令を実行するステップに識別フ
ラグがセットされていると、特定データ領域情報を参照
してオペランドで指定されている特定データ領域の書込
み可能容量と当該データ領域に対して指定されている書
込み容量とを比較し、その書込み命令を実行すると特定
データ領域をオーバーすると判断した場合は、CPU9
の実行ステータスレジスタに書込みエラーを示す書込み
エラーフラグをセットするようにした。
According to the present embodiment, the CPU of the PC 5
9, when the identification flag is set in the step of executing the write instruction during execution of the user program, the execution determination unit 14b refers to the specific data area information to write the specific data area specified by the operand. The available capacity is compared with the write capacity specified for the data area, and if it is determined that the execution of the write command exceeds the specific data area, the CPU 9
, A write error flag indicating a write error is set in the execution status register.

【0066】従って、ユーザプログラムの実行時におい
て、例えば、ラベルに付されたパラメータのワード数
が、実際の処理結果によって値が変化するような変数で
与えられている場合でも、実際に書込みが実行される前
に、その書込みが特定データ領域をオーバーする書込み
であるか否かをチェックすることができるので、他の領
域に記憶されているデータが破壊されるのを未然に防止
することができる。
Therefore, when the user program is executed, for example, even if the number of words of the parameter attached to the label is given by a variable whose value changes according to the actual processing result, the writing is actually executed. Before the writing, it is possible to check whether the writing is a writing exceeding a specific data area, so that it is possible to prevent data stored in other areas from being destroyed beforehand. .

【0067】本発明は上記し且つ図面に記載した実施例
にのみ限定されるものではなく、次のような変形または
拡張が可能である。ユーザプログラム中において、ラベ
ルを付した特定データ領域の使用を宣言する場合には、
必ずしもデータ語長及びワード数を指定する必要はな
く、例えば、データ語長のみを指定した場合はワード数
はデフォルト値で決定し、また、ワード数のみを指定し
てデータ語長が無指定の場合は、データ語長をデフォル
ト値とするようにしても良い。或いは、何れも無指定で
ありラベル名のみ使用が宣言された場合は、データ語長
及びワード数共にデフォルト値で決定される所定容量を
与えるようにしても良い。
The present invention is not limited to the embodiment described above and shown in the drawings, and the following modifications or extensions are possible. When declaring the use of a specific data area with a label in a user program,
It is not always necessary to specify the data word length and the number of words.For example, if only the data word length is specified, the number of words is determined by the default value. In this case, the data word length may be set to a default value. Alternatively, when both are unspecified and only the label name is declared, both the data word length and the number of words may be given a predetermined capacity determined by default values.

【0068】特定データ領域にアクセスする場合は、パ
ラメータとしてワード数を指定するものに限らず、パラ
メータを指定せずに、例えば、命令の記述フォーマット
に応じて、アドレスの××××H番地から××××H番
地までの内容を特定データ領域に転送せよ、というよう
にしても良い。また、特定データ領域に対しては、例え
ば2Kバイトなどの容量の枠のみを与えておき、書込み
命令の発行時において、書込みデータ語長及びワード数
を一々パラメータとして与えるようにしても良い。変換
処理部3bは、ユーザプログラムをPC5が実行可能な
形式に変換する場合に、ラベルの使用に応じて識別フラ
グを必ずしもセットする必要はなく、PC5側のCPU
9において、命令のオペランドを直接参照させて、テキ
ストコードが記述されている場合は、ラベルが使用され
ていると判断させるようにしても良い。プログラミング
装置1のシミュレータ3cは、必要に応じて設ければ良
い。
When a specific data area is accessed, the parameter is not limited to the one specifying the number of words, but may be specified without specifying the parameter, for example, starting from the address XXXXXH according to the instruction description format. The contents up to address XXXH may be transferred to the specific data area. Alternatively, only a capacity frame such as 2 Kbytes may be given to the specific data area, and the write data word length and the number of words may be given as parameters at the time of issuing a write command. When converting the user program into a format executable by the PC 5, the conversion processing unit 3b does not necessarily need to set the identification flag according to the use of the label.
In step 9, when the text code is described by directly referring to the operand of the instruction, it may be determined that the label is used. The simulator 3c of the programming device 1 may be provided as needed.

【0069】特定データ領域は、プログラムにおける書
込み命令が発行される毎に領域の先頭から書込みが行わ
れるようなテンポラリバッファとして使用するものに限
らず、プログラムにおける書込み命令が所定回数発行さ
れるまでは、領域の先頭から順次データが書込まれて行
くスタックとして使用しても良い。この場合、ステップ
B8における書込み可能容量は、特定データ領域におい
て未だ書込みが行われていない残容量を算出するように
する。そして、特定データ領域に対して既に書込みが行
われた容量の管理はユーザプログラム側で行って、当該
容量を書込み命令の発行時にパラメータとして与えても
良いし、或いは、上記実施例のように、ユーザプログラ
ム側では各書込み命令発行時の書込み容量のみをパラメ
ータとして与えて、CPU9の実行判定部14bにおい
て管理するようにしても良い。書込み可能容量の算出
は、特定データ領域の最終アドレスから先頭アドレスを
減算して求めても良い。処理ステップB9における書込
み容量の算出は、パラメータとしてデータ語長及びワー
ド数が指定された場合は、(データ語長)×(ワード
数) によって算出しても良い。
The specific data area is not limited to the one used as a temporary buffer in which writing is performed from the beginning of the area every time a write instruction in a program is issued. May be used as a stack in which data is sequentially written from the head of the area. In this case, as the writable capacity in step B8, the remaining capacity in which writing has not yet been performed in the specific data area is calculated. The management of the capacity already written to the specific data area may be performed on the user program side, and the capacity may be given as a parameter when the write command is issued, or as in the above embodiment, On the user program side, only the write capacity at the time of issuing each write instruction may be given as a parameter and managed by the execution determination unit 14b of the CPU 9. The writable capacity may be calculated by subtracting the start address from the end address of the specific data area. When the data word length and the number of words are specified as parameters, the calculation of the write capacity in the processing step B9 may be calculated by (data word length) × (number of words).

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

【図1】本発明の一実施例を示す、プログラマブルコン
トローラ側のCPUがユーザプログラムを実行する場合
における処理内容のフローチャート
FIG. 1 is a flowchart of a processing content when a CPU of a programmable controller executes a user program according to an embodiment of the present invention;

【図2】ユーザプログラム中において、特定データ領域
に対する書込み処理を記述する場合の手順を概略的に示
すフローチャート
FIG. 2 is a flowchart schematically showing a procedure for describing a write process for a specific data area in a user program;

【図3】プログラミング作業の処理手順を示すプロセス
チャート
FIG. 3 is a process chart showing a processing procedure of a programming operation.

【図4】ユーザプログラム中における、ラベル名を付し
た特定データ領域の宣言をする場合の記述例を示す図
FIG. 4 is a diagram showing a description example in a case where a specific data area with a label name is declared in a user program;

【図5】特定データ領域を、ユーザ定義メモリ領域に割
り付けた状態を概念的に示す図
FIG. 5 is a diagram conceptually showing a state in which a specific data area is allocated to a user-defined memory area.

【図6】(a)はラベル名を付した特定データ領域に対
してアクセスを行う場合のユーザプログラムの記述例を
示す図、(b)は、(a)をプログラマブルコントロー
ラが実行可能な形式に変換した場合のデータフォーマッ
トの例を示す図
FIG. 6A is a diagram showing a description example of a user program when accessing a specific data area to which a label name is added, and FIG. 6B is a diagram in which FIG. Diagram showing an example of the data format when converted

【図7】プログラミング装置及びプログラマブルコント
ローラの全体の構成を示す機能ブロック図
FIG. 7 is a functional block diagram showing the overall configuration of a programming device and a programmable controller.

【図8】プログラミング装置の詳細な構成を示す機能ブ
ロック図
FIG. 8 is a functional block diagram showing a detailed configuration of a programming device.

【図9】プログラマブルコントローラのCPUにおけ
る、ハードウエア−ソフトウエアの階層構造を概念的に
示す図
FIG. 9 is a diagram conceptually showing a hardware-software hierarchical structure in a CPU of a programmable controller.

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

1はプログラミング装置、3は制御部(識別名付与手
段,送信手段)、3bは変換処理部(領域割り付け手
段,変換手段)、3cはシミュレータ(シミュレーショ
ン手段,書き込み判定シミュレーション手段)、5はプ
ログラマブルコントローラ、7は通信用インターフェイ
ス(送信手段)、14bは実行判定部(書込み判定手
段)を示す。
1 is a programming device, 3 is a control unit (identifier giving means, transmission means), 3b is a conversion processing unit (area allocating means, conversion means), 3c is a simulator (simulation means, writing judgment simulation means), 5 is a programmable controller , 7 indicate a communication interface (transmitting means), and 14b indicates an execution determining unit (writing determining means).

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 プログラマブルコントローラのユーザプ
ログラムにおいて使用するデータ領域に識別名を付与す
る識別名付与手段と、 前記識別名が付与されたデータ領域を使用することが前
記ユーザプログラム中で宣言されると、前記データ領域
を前記プログラマブルコントローラのメモリ領域の一部
に所定容量を以て割り付け、且つ、当該データ領域を前
記ユーザプログラムからは前記識別名を介してのみアク
セスすることを可能とする領域割り付け手段とを備えた
ことを特徴とするプログラマブルコントローラのプログ
ラミング装置。
1. An identification name assigning means for assigning an identification name to a data area used in a user program of a programmable controller, and when the use of the data area with the identification name is declared in the user program. Area allocation means for allocating the data area to a part of the memory area of the programmable controller with a predetermined capacity, and enabling the data area to be accessed only from the user program via the identification name. A programming device for a programmable controller, comprising:
【請求項2】 前記識別名付与手段は、前記識別名を付
与する際に、前記データ領域のデータ語長及びデータ数
が指定可能であり、 前記領域割り付け手段は、前記識別名付与手段によって
データ語長及びデータ数が指定された場合は、当該デー
タ語長及びデータ数に基づいて前記データ領域の容量を
決定することを特徴とする請求項1記載のプログラマブ
ルコントローラのプログラミング装置。
2. The method according to claim 1, wherein the identification name assigning means is capable of designating a data word length and a data number of the data area when assigning the identification name. 2. The programming device according to claim 1, wherein when a word length and the number of data are designated, the capacity of the data area is determined based on the data word length and the number of data.
【請求項3】 前記識別名付与手段によって付与された
識別名は、ユーザプログラム中において、対応するデー
タ領域にアクセスを行うためのデータ数がパラメータと
して指定可能であることを特徴とする請求項1または2
記載のプログラマブルコントローラのプログラミング装
置。
3. An identification name assigned by the identification name assigning means, wherein a number of data for accessing a corresponding data area can be designated as a parameter in a user program. Or 2
A programming device for a programmable controller as described.
【請求項4】 前記ユーザプログラムを対象となるプロ
グラマブルコントローラが実行可能な形式に変換する際
に、当該ユーザプログラム中の何れかのステップに前記
識別名が記述されている場合は、前記識別名が使用され
ていることを示す識別フラグを前記ステップにセットす
る変換手段を備えたことを特徴とする請求項1乃至3の
何れかに記載のプログラマブルコントローラのプログラ
ミング装置。
4. When converting the user program into a format executable by a target programmable controller, if the identification name is described in any step in the user program, the identification name is 4. The programming device for a programmable controller according to claim 1, further comprising a conversion unit that sets an identification flag indicating that the program is being used in the step.
【請求項5】 プログラマブルコントローラが実行可能
な形式に変換されたユーザプログラムの実行状態をシミ
ュレートすることが可能なシミュレーション手段と、 このシミュレーション手段が前記ユーザプログラムの実
行状態をシミュレートする時に、書込み命令を実行する
ステップに前記識別フラグがセットされている場合は、
その識別名が付されたデータ領域の書込み可能容量と当
該データ領域に対して指定されている書込み容量とを比
較して、前記書込み命令を実行すると前記データ領域を
オーバーすると判断した場合は、エラーメッセージを出
力する書込み判定シミュレーション手段を備えたことを
特徴とする請求項4記載のプログラマブルコントローラ
のプログラミング装置。
5. A simulation means capable of simulating an execution state of a user program converted into a form executable by a programmable controller, and writing the simulation program when simulating the execution state of the user program. When the identification flag is set in the step of executing the instruction,
If a comparison is made between the writable capacity of the data area to which the identification name is assigned and the write capacity specified for the data area, and execution of the write command determines that the data area is exceeded, an error will occur. 5. The programming device for a programmable controller according to claim 4, further comprising a write determination simulation means for outputting a message.
【請求項6】 前記領域割り付け手段によって割り付け
が行われた前記データ領域に関するデータ領域情報を、
実行可能な形式に変換されたユーザプログラムと共に前
記プログラマブルコントローラ側に送信する送信手段を
備えたことを特徴とする請求項3乃至5の何れかに記載
のプログラマブルコントローラのプログラミング装置。
6. The data area information on the data area allocated by the area allocation means,
The programming device for a programmable controller according to claim 3, further comprising a transmission unit configured to transmit the user program converted to an executable format to the programmable controller.
【請求項7】 請求項6記載のプログラマブルコントロ
ーラのプログラミング装置によって実行形式に変換され
たユーザプログラムの実行時において、書込み命令を実
行するステップに前記識別フラグがセットされている場
合は、前記データ領域情報を参照することにより、当該
ステップのオペランドで指定されている識別名が付され
たデータ領域の書込み可能容量と前記当該データ領域に
対して指定されている書込み容量とを比較して、前記書
込み命令を実行すると前記データ領域をオーバーすると
判断した場合は、CPUの実行ステータスレジスタに書
込みエラーを示すエラーフラグをセットする書込み判定
手段を備えたことを特徴とするプログラマブルコントロ
ーラ。
7. When the identification flag is set in a step of executing a write instruction at the time of executing a user program converted into an executable form by the programming device of the programmable controller according to claim 6, the data area is set. By referring to the information, the writable capacity of the data area with the identification name specified by the operand of the step is compared with the write capacity specified for the data area, and the write A programmable controller, comprising: a write determination unit that sets an error flag indicating a write error in an execution status register of a CPU when it is determined that the data area is exceeded when an instruction is executed.
JP13675297A 1997-05-27 1997-05-27 Programmable controller and its programming device Pending JPH10326105A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13675297A JPH10326105A (en) 1997-05-27 1997-05-27 Programmable controller and its programming device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13675297A JPH10326105A (en) 1997-05-27 1997-05-27 Programmable controller and its programming device

Publications (1)

Publication Number Publication Date
JPH10326105A true JPH10326105A (en) 1998-12-08

Family

ID=15182681

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13675297A Pending JPH10326105A (en) 1997-05-27 1997-05-27 Programmable controller and its programming device

Country Status (1)

Country Link
JP (1) JPH10326105A (en)

Similar Documents

Publication Publication Date Title
JP4525681B2 (en) Program generating device for programmable controller, program generating method for programmable controller, and recording medium recording program of the method
WO2013114926A1 (en) Support device, recording medium having support program recorded thereon, and method for generating executable program
JP3729251B2 (en) Controller and system
JPH02214994A (en) Ic card
US20150227128A1 (en) Control device and communication control method
US20030130980A1 (en) Efficient configuration data migration technique
US20060184924A1 (en) Intelligent platform management interface firmware architecture and method of building the same
US6327509B1 (en) Programmable controller data communications using variable names associated with data addresses
JP2009157533A (en) Programmable controller system
JP3829905B2 (en) Programmable controller
JPH10326105A (en) Programmable controller and its programming device
WO2019171794A1 (en) Support device and support program
JP6746040B1 (en) Instruction conversion device, method, and program
JPH113105A (en) Programming device for programmable controller
JP2000132208A (en) Control controller
JP4479558B2 (en) Programmable controller and programming tool thereof
JP2007280377A (en) Plc system
JP2006018759A (en) Control device and method
JP6691884B2 (en) Computer and application management method
JP2005107909A (en) Multi-processor system having debug function and program for multi-processor system
JPH11259308A (en) Programmable controller
JP2885957B2 (en) Sequence program programming method and apparatus
JP2013061740A (en) Extension memory unit, plc system, and adapter device
JPH10333718A (en) Programming device for programmable controller and programmable controller
KR20110052271A (en) Protocol interface device, system and method using a text file