JPH11212606A - Programming device and program monitoring device - Google Patents

Programming device and program monitoring device

Info

Publication number
JPH11212606A
JPH11212606A JP10015326A JP1532698A JPH11212606A JP H11212606 A JPH11212606 A JP H11212606A JP 10015326 A JP10015326 A JP 10015326A JP 1532698 A JP1532698 A JP 1532698A JP H11212606 A JPH11212606 A JP H11212606A
Authority
JP
Japan
Prior art keywords
program
address
register
displaying
ladder diagram
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
JP10015326A
Other languages
Japanese (ja)
Inventor
Sakae Ito
栄 伊東
Makoto Nakamura
真 中村
Shunsuke Nagasawa
俊輔 長澤
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.)
Sharp Corp
Sharp Manufacturing Systems Corp
Original Assignee
Sharp Corp
Sharp Manufacturing Systems 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 Sharp Corp, Sharp Manufacturing Systems Corp filed Critical Sharp Corp
Priority to JP10015326A priority Critical patent/JPH11212606A/en
Publication of JPH11212606A publication Critical patent/JPH11212606A/en
Pending legal-status Critical Current

Links

Landscapes

  • Storage Device Security (AREA)
  • Stored Programmes (AREA)
  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a programming device for automatically generating a program with which it is monitored whether an indirectly designated address is suitable or not and an alarm is outputted corresponding to the monitored result. SOLUTION: The monitor program for monitoring the contents of a pointer is automatically generated and when an abnormal value is stored in the pointer, the alarm is issued. When the increment values of the reference program and the addresses of respective circuit elements are designated in the case of programming to repeat a similar program, the program is automatically expanded and in the correction, the source program is reproduced. Besides, the memory contents of respective circuit elements in the program are time sequentially displayed together with a ladder diagram.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、FA分野に利用さ
れるプログラマブルコントローラに関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a programmable controller used in the FA field.

【0002】[0002]

【従来の技術】プログラマブルコントローラは、リレー
盤の置き換えとして生まれたもので、ANDやOR等の
ブール代数を演算することにより制御を行うものであっ
たが、近年マイクロプロセッサの発達とともに応用命令
と呼ばれる加減乗除などの数値演算を行うことができる
ようになっている。この応用命令の一部はマイクロプロ
セッサのアセンブリ言語と類似しており、ポインタを用
いたアドレスの間接指定が可能となっている。
2. Description of the Related Art Programmable controllers have been developed as replacements for relay boards, and control by calculating Boolean algebras such as AND and OR. In recent years, with the development of microprocessors, they have been called application instructions. Numerical operations such as addition, subtraction, multiplication and division can be performed. Some of the application instructions are similar to the assembly language of a microprocessor, and an address can be indirectly specified using a pointer.

【0003】ポインタを用いたプログラムを回路図と応
用命令とを複合したようなラダー図に示すと、例えば図
1に示すようなラダー図になる。「MOV」は代入を表
す応用命令1の一つでこの場合「リレー2(アドレスは
0000)がオンのときに9000番地のメモリ内容を
9100番地に指定されたアドレスに代入する」となり
「@9100」がアドレスの間接指定を示すポインタ3
を表している。
When a program using a pointer is shown in a ladder diagram in which a circuit diagram and an application instruction are combined, for example, a ladder diagram as shown in FIG. 1 is obtained. "MOV" is one of the application instructions 1 representing the assignment, in this case, "When the relay 2 (address is 0000) is ON, the memory content at the address 9000 is assigned to the address specified at the address 9100". Is a pointer 3 indicating the indirect designation of an address
Is represented.

【0004】図2にメモリマップによる動作の様子を示
すと、9000番地の内容「5555」が9100番地
に指定されたアドレス「9300番地」に代入されるよ
うになっている。この時に例えば9100番地には何ら
かの条件に応じて変わるような「9100番地の値」=
b+a*iなどの変数として記憶させて代入先のアドレ
スをダイナミックに変更することもできることからプロ
グラムの簡略化に有用であるため、ポインタを用いた間
接指定が多用されるようになっている。
FIG. 2 shows the operation according to the memory map. The contents "5555" at address 9000 are assigned to the address "9300" designated at address 9100. At this time, for example, at address 9100, the value of address 9100 that changes according to some condition =
Since it is possible to dynamically change the address of the substitution destination by storing it as a variable such as b + a * i, which is useful for simplifying the program, indirect designation using a pointer is frequently used.

【0005】プログラム内でアドレスの間接指定を行う
際に、プログラム上はポインタによって指定されるアド
レスは明示的でない(図1には「9300番地」は表示
されない)ためプログラムのミスなどによってポインタ
の値が意図しない値になる場合があり、このような場合
理論的にはメモリ上のいかなるアドレスも代入先になり
得ることから重要なデータの破壊やプログラムの正常な
実行を妨げる危険性がある。また、プログラム実行中に
ハードウェアの誤動作などによってポインタの値が異常
値となる場合も同様である。
When an address is specified indirectly in a program, the address specified by the pointer is not explicit in the program ("9300" is not displayed in FIG. 1). May be an unintended value. In such a case, theoretically, any address in the memory can be an assignment destination, so there is a risk that important data may be destroyed or a program may not be executed normally. The same applies when the value of the pointer becomes an abnormal value due to a malfunction of hardware during execution of the program.

【0006】これを回避する方法として、特開平6−2
22958号公報に、C言語のポインタの誤用に関して
コンパイル時に変数のメモリへの割付けを複数の方法で
行い、コンパイルされた複数のオブジェクトを比較して
チェックするという方法が開示されている。
As a method for avoiding this, Japanese Patent Laid-Open No. 6-2
Japanese Patent Laid-Open No. 22958 discloses a method of allocating a variable to a memory at the time of compilation with a plurality of methods for misuse of a pointer in the C language, and comparing and checking a plurality of compiled objects.

【0007】次に、プログラマブルコントローラで類似
した複数の回路構成をなすプログラムを作成する場合に
おいて、通常は図3に示すようなラダー図形式で1回路
づつ作成して全回路40を得る方法や、基準のプログラ
ム41を作成しこれをコピーして入出力機器などの回路
要素(センサ、近接スイッチ、ソレノイド、ランプな
ど)のアドレスを変更して複製プログラム42を作成し
繰り返しプログラム50を得る方法が用いられる。
Next, when a program having a plurality of circuit configurations similar to each other is created by a programmable controller, usually, a method of creating all the circuits 40 one by one in a ladder diagram format as shown in FIG. A method is used in which a reference program 41 is created, copied, and the addresses of circuit elements (sensors, proximity switches, solenoids, lamps, etc.) such as input / output devices are changed to create a duplicate program 42 and repeatedly obtain a program 50. Can be

【0008】同図において、LS1乃至LS4はリミッ
トスイッチ、/EMERは非常停止の反転、SOL1、
SOL2はソレノイドを示しており、LS1,LS3、
/EMER、2段目のSOL1,4段目SOL2は、オ
ンのときに繋がり、LS2,LS4は、オンのときに切
れるように接続されるような入力機器を表している。ま
た、1段目のSOL1は、LS1、LS2、/EMER
が同時に繋がるとオンになるような出力機器を表し、3
段目のSOL2も同様である。また、夫々の回路要素上
方の数値は各要素のアドレス番号を表している。
In the figure, LS1 to LS4 are limit switches, / EMER is the reversal of emergency stop, SOL1,
SOL2 indicates a solenoid, and LS1, LS3,
/ EMER, the second-stage SOL1 and the fourth-stage SOL2 are input devices that are connected when turned on, and LS2 and LS4 are input devices that are connected to be turned off when turned on. SOL1 of the first stage is LS1, LS2, / EMER
Represents an output device that turns on when connected at the same time.
The same applies to SOL2 at the stage. The numerical value above each circuit element indicates the address number of each element.

【0009】また、流用性の高いラダー図については、
ライブラリとして登録し、必要なときに呼び出して修正
を加える方法や、マクロライブラリにより呼び出し時に
リレー番号やレジスタ番号を一定量増減させて一括に処
理する方法なども用いられるとともに特許第25406
60号には共通シンボルとしてライブラリに登録し、必
要時にラダー図形式に展開するような方法も提案されて
いる。
[0009] For a ladder diagram with high diversion,
A method of registering as a library and calling it when necessary to make corrections, a method of using a macro library to increase or decrease a relay number or a register number by a certain amount at the time of calling and collectively processing them, and the like are also used.
No. 60 proposes a method of registering a symbol as a common symbol in a library and developing the symbol in a ladder diagram format when necessary.

【0010】あるいは、FOR〜NEXT命令を使用し
て必要回数分ループし、リレー番号やレジスタ番号を一
定量増減させて一括にプログラムを作成するような方法
も用いられる。
[0010] Alternatively, a method is also used in which the program is looped by the required number of times using the FOR to NEXT instructions, and the relay number or the register number is increased or decreased by a fixed amount to create a program at once.

【0011】次に、プログラマブルコントローラによる
プログラム実行時におけるの入出力機器の動作を確認す
る場合において、設備の状態をモニタする方法として、
回路要素のオン、オフ情報(以下「ビット情報」とい
う)やレジスタに格納された数値情報(以下「レジスタ
情報」という。なおレジスタにレジスタ情報が格納され
たか否かを表すのはビット情報である)を特定の回路要
素やレジスタに注目してそのアドレスを指定してメモリ
内容の表示させて変化をモニタする方法や、ラダー図に
ビット情報及びレジスタ情報を付加して表示させて動作
をモニタする方法がある。
[0011] Next, when checking the operation of the input / output device when the program is executed by the programmable controller, a method of monitoring the state of the equipment is as follows.
On / off information of circuit elements (hereinafter referred to as “bit information”) and numerical information stored in a register (hereinafter referred to as “register information”. It is bit information that indicates whether or not register information is stored in a register. ) Focuses on a specific circuit element or register, displays its memory contents by specifying its address, monitors the change, or monitors the operation by adding bit information and register information to the ladder diagram and displaying it. There is a way.

【0012】これらの方法は、オンラインで行われるた
め表示の切り換え速度が速く内容を視認できなかった
り、細かなタイミングを確認できなかったりするため有
効にモニタすることができなかった。
Since these methods are performed on-line, the display switching speed is high and the contents cannot be visually recognized, and detailed timing cannot be confirmed, so that effective monitoring cannot be performed.

【0013】これに対して、特許第261663号には
タイムチャート形式でビット情報を表示し、時系列的に
ビット情報の変化を確認できるようにする方法が提案さ
れている。この方法は、図4に示すように、各回路要素
(アドレス0000〜0002)の単位時間t0毎の動
作状態を表示し、各回路要素のオン、オフのタイミング
を知ることができるようになっている。
On the other hand, Japanese Patent No. 261663 proposes a method of displaying bit information in a time chart format so that a change in the bit information can be confirmed in a time series. According to this method, as shown in FIG. 4, the operation state of each circuit element (address 0000 to 0002) at every unit time t0 is displayed, and the on / off timing of each circuit element can be known. I have.

【0014】[0014]

【発明が解決しようとする課題】プログラムでアドレス
の間接指定を行う際に異常なアドレスの値が格納される
場合においては、特開平6−222958号公報に示さ
れる方法は、プログラマブルコントローラにおいては変
数のメモリへの自動的な割付けが行われないことや、複
数のオブジェクトを格納するために多くのメモリが必要
になるとともにテストの度にコンパイルを行わなければ
ならず確認に多くの時間を要することになる。
In the case where an abnormal address value is stored when an address is indirectly specified by a program, the method disclosed in Japanese Patent Laid-Open No. 6-222958 discloses a method in which a programmable controller uses a variable. Is not automatically allocated to memory, requires more memory to store multiple objects, and must be compiled for each test, requiring more time to verify become.

【0015】また、応用命令で間接指定を行った際にア
クセス可能なアドレス範囲を同時に指定して範囲外のア
ドレスには書き込みできないようにするような応用命令
そのものを改良することが考えられるが、間接指定が可
能な応用命令の種類が多いことからこのような機能追加
した応用命令の作成には膨大な工数を必要とする。
Further, it is conceivable to improve the application instruction itself such that an address range that can be accessed when the indirect specification is performed by the application instruction is simultaneously specified so that writing to an address outside the range cannot be performed. Since there are many types of application instructions that can be indirectly specified, enormous man-hours are required to create such application instructions with added functions.

【0016】次に、プログラマブルコントローラで類似
した複数の回路構成をなすプログラムを作成する場合に
おいては、全回路を1回路づつプログラム作成する方法
であるとプログラム作成に多くの時間を要する。また、
基準の回路のコピーまたはライブラリから繰り返し呼び
出しを行った後回路要素のアドレスを修正する方法は、
繰り返しの回数が多くなると修正漏れや誤修正が発生す
ることがある。
Next, when a program having a plurality of similar circuit configurations is created by a programmable controller, it takes a lot of time to create a program if the method is to create a program for all circuits one by one. Also,
A method of correcting the address of a circuit element after repeatedly calling a copy of a reference circuit or a library is as follows.
If the number of repetitions increases, omission of correction or erroneous correction may occur.

【0017】また、マクロライブラリによる展開やシン
ボルをラダー図形式に展開する方法であるとプログラム
作成時は一括に処理が可能でプログラム作成時間を削減
することができるが、仕様変更などで回路要素個々のア
ドレスを変更するときにおいては上記と同様に修正漏れ
や誤修正が発生することがある。
In the method of developing a macro library or developing a symbol in a ladder diagram format, processing can be performed collectively at the time of program creation, and the program creation time can be reduced. When the address is changed, omission of correction or erroneous correction may occur as described above.

【0018】また、FOR〜NEXT命令を用いて作成
した場合は、プログラム実行時において類似回路の繰り
返し毎に回路要素のアドレスをインクリメント(増加)
させるような演算が行われるためにプログラムの実行速
度が低下するとともに、各回路要素の状態と表示される
ラダー図との対比が困難であるため、デバッグ時などに
実行中の各回路要素の状態を判断できないという問題が
ある。
When the program is created by using the FOR to NEXT instructions, the address of a circuit element is incremented (increased) every time a similar circuit is repeated during execution of a program.
The execution speed of the program is reduced due to the computations that cause it to be performed, and it is difficult to compare the state of each circuit element with the displayed ladder diagram, so the state of each circuit element being executed during debugging etc. There is a problem that can not be determined.

【0019】次に、プログラマブルコントローラによる
プログラム実行時におけるの入出力機器の動作を確認す
る場合において、特許第261663号に開示された方
法であると予め記憶されたプログラムの実行結果を時系
列に知ることができ、リレーなどのオン、オフの順序や
レジスタの変化した履歴を確認することに対しては有用
である。
Next, in the case of confirming the operation of the input / output device when the program is executed by the programmable controller, the method disclosed in Japanese Patent No. 261663 knows the execution result of the program stored in advance in time series. It is useful for confirming the order of ON / OFF of the relay and the change history of the register.

【0020】しかし、前述の図4に示すようなタイムチ
ャートは各回路要素の関係がわからないのでプログラム
の実行経過を判断することができず、デバッグ等はラダ
ー図とタイムチャートとを適時切り換えて表示し見比べ
て行う必要があり、効率が悪く作業時間を増大させてい
た。
However, in the time chart as shown in FIG. 4 described above, it is not possible to judge the progress of the program execution because the relationship between the circuit elements is not known. However, it is necessary to perform the comparison, which is inefficient and increases the working time.

【0021】本発明は間接指定されたアドレスが適切で
あるかを監視するとともに監視結果に応じて警報を出力
するようなプログラムを自動的に作成するプログラム作
成装置を提供するものである。
An object of the present invention is to provide a program creating apparatus for monitoring whether an indirectly designated address is appropriate and automatically creating a program for outputting an alarm according to the monitoring result.

【0022】また、本発明は類似したプログラムを繰り
返されるようなプログラムを使用する際においてプログ
ラム作成・変更時には一括して作業を行うことができる
とともに、プログラム実行時には実行速度が速く各要素
の動作に対応したラダー図を視認できるようなプログラ
ムを自動的に付加するプログラム作成装置を提供するも
のである。
Further, according to the present invention, when a program in which a similar program is repeated is used, work can be performed collectively at the time of program creation / change, and at the time of program execution, the execution speed is high and the operation of each element can be performed. An object of the present invention is to provide a program creating apparatus for automatically adding a program that allows a user to visually recognize a corresponding ladder diagram.

【0023】また、本発明は、プログラム内の各回路要
素の状態を時系列にラダー図上で確認することができる
ようなプログラマブルコントローラのモニタ装置を提供
するものである。
Another object of the present invention is to provide a monitor device of a programmable controller which can check the state of each circuit element in a program in a time series on a ladder diagram.

【0024】[0024]

【課題を解決するための手段】上記目的を達成するため
に本発明は、間接指定可能な命令によって間接指定され
たアドレスがアクセス可能なアクセス範囲を指定する手
段を有し、前記アドレスと前記アクセス範囲との比較結
果に応じてプログラムの停止あるいは警報を出力させる
ようなプログラムが前記命令の前に実行されるように追
加されるようになっている。
SUMMARY OF THE INVENTION In order to achieve the above object, the present invention has means for designating an access range in which an address indirectly specified by an indirectly specifiable instruction can be accessed, wherein the address and the access are specified. A program that stops the program or outputs an alarm according to the result of comparison with the range is added so as to be executed before the instruction.

【0025】この構成によると、ユーザによって間接指
定命令がプログラムに記述されると、間接指定されたア
ドレスがアクセスしても良い範囲を問い合わせるような
入力画面が表示され入力が行われると、間接指定された
アドレスがアクセスしても良い範囲内にあるかどうかを
監視するような監視プログラムが前記間接指定命令の前
に実行されるように自動的に作成される。
According to this configuration, when an indirect designation command is described in a program by a user, an input screen for inquiring about a range in which the indirectly designated address can be accessed is displayed. A monitoring program for monitoring whether the specified address is within the accessible range is automatically created so as to be executed before the indirect designation instruction.

【0026】また、本発明は、前記監視プログラムを画
面に表示させない手段を備えている。この構成による
と、設計回路とは無関係な監視用のプログラムを必要に
応じて表示画面に表示させないようになっている。
Further, the present invention comprises means for preventing the monitoring program from being displayed on a screen. According to this configuration, a monitoring program unrelated to the design circuit is not displayed on the display screen as needed.

【0027】また、回路要素やレジスタを有する類似し
たプログラムが複数回繰り返されるようなプログラムを
作成する際において、基準の第1のプログラムと前記第
1のプログラムを複製する複製回数と前記第1のプログ
ラムを複製して得られる複製プログラム毎に回路要素や
レジスタを変更する変更規則とを指定する手段と、前記
第1のプログラムを前記複製回数複製し前記変更規則に
則って回路要素やレジスタを変更して第2のプログラム
を作成する手段と、前記第1のプログラムと前記変更規
則と前記複製回数とを導出可能な情報を第3のプログラ
ムに記録する手段とを備え、前記第2、第3のプログラ
ムを含むプログラムを表示する際において、前記第2、
第3のプログラムから前記第1のプログラムと前記変更
規則とを再現する手段と、前記第1のプログラムと前記
変更規則と前記複製回数とを表示する第1の表示手段と
を備えている。
Further, when creating a program in which a similar program having circuit elements and registers is repeated a plurality of times, the first reference program, the number of duplications for duplicating the first program, and the first program Means for designating a change rule for changing a circuit element or a register for each copy program obtained by duplicating a program; and copying the first program the number of times of copying and changing a circuit element or a register in accordance with the change rule Means for creating a second program, and means for recording, in a third program, information from which the first program, the change rule, and the number of duplications can be derived, wherein the second and third programs are provided. When displaying a program including the second program, the second,
The program includes means for reproducing the first program and the change rule from a third program, and first display means for displaying the first program, the change rule, and the number of times of copying.

【0028】この構成によると、複製元のプログラム
(第1のプログラム)と、複製回数と、複製毎にプログ
ラムに含まれる各回路要素やレジスタのアドレスをイン
クリメントさせるインクリメント量とを指定すると、類
似したプログラムを繰り返すような所望のプログラム
(第2のプログラム)が自動的に作成され、第2のプロ
グラムの先頭位置、最終位置および前記複製回数などの
情報を示す第3のプログラムが自動的に追記される。こ
のプログラムを表示する際には先頭位置、最終位置およ
び前記複製回数から前記複製元のプログラムと前記イン
クリメント量とが求められ、前記複製元のプログラムと
前記インクリメント量と前記複製回数とがラダー図に表
示されるようになっている。
According to this configuration, when the copy source program (first program), the number of times of copying, and the increment amount for incrementing the address of each circuit element or register included in the program for each copy are specified, a similar result is obtained. A desired program (second program) that repeats the program is automatically created, and a third program indicating information such as the start position, end position, and the number of times of duplication of the second program is automatically added. You. When displaying this program, the source program and the increment are obtained from the start position, the final position, and the number of copies, and the source program, the increment, and the number of copies are represented in a ladder diagram. It is displayed.

【0029】また、本発明は、前記第2のプログラムを
表示する第2の表示手段を有し、前記第1の表示手段と
前記第2の表示手段とを切り換えて表示させることがで
きるようになっている。
Further, the present invention has second display means for displaying the second program so that the display can be switched between the first display means and the second display means. Has become.

【0030】この構成によると、プログラム修正時には
前記複製元のプログラムと前記インクリメント量と前記
複製回数とを表示させ、プログラム実行時には第2のプ
ログラム全体を表示させるように切り換えることが可能
となっている。
According to this configuration, it is possible to switch so as to display the original program, the increment amount and the number of times of copying when the program is modified, and to display the entire second program when executing the program. .

【0031】また、本発明は、プログラマブルコントロ
ーラのプログラム実行時におけるメモリ内容を時系列に
記憶する記憶手段を有し、前記記憶手段から前記メモリ
内容を時系列に任意のタイミングで逐次取り出して前記
プログラム内の回路要素やレジスタの状態をラダー図と
ともに表示するようになっている。
The present invention further comprises a storage means for storing the contents of the memory in a time-series manner when the program of the programmable controller is executed, and sequentially fetching the contents of the memory from the storage means in a time-series at an arbitrary timing. The state of the circuit elements and registers inside are displayed together with the ladder diagram.

【0032】この構成によると、プログラムの実行経過
が記憶され、オフラインでユーザからトリガが入力され
る度に、単位時間毎の各回路要素及びレジスタの状態が
呼び出されラダー図上に逐次表示されるようになる。
According to this configuration, the progress of execution of the program is stored, and each time a trigger is input from the user off-line, the state of each circuit element and register per unit time is called and sequentially displayed on the ladder diagram. Become like

【0033】[0033]

【発明の実施の形態】本発明の第1の実施形態を図を参
照して説明する。先に説明した図1のような応用命令1
にポインタ3が記述されると、図5に示すようなポイン
タ3によって指定されるアドレスがアクセスしてもよい
範囲を指定する入力画面6が表示される。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A first embodiment of the present invention will be described with reference to the drawings. Application instruction 1 as shown in FIG.
When the pointer 3 is described in the input screen, an input screen 6 is displayed as shown in FIG.

【0034】入力画面6にはポインタ3によって指定さ
れるアドレスがアクセスしてもよい上限のアドレス7、
アクセスしてもよい下限のアドレス8、ポインタ3によ
って指定されるアドレスが上限のアドレス7と下限のア
ドレス8の間にない場合に警報を発するリレーのアドレ
ス9、ポインタ3によって指定されるアドレスが上限の
アドレス7と下限のアドレス8の間にない場合にプログ
ラムの実行を停止するか継続するかを選択するスイッチ
4、後述する監視プログラムを画面に表示するか否かを
選択するスイッチ5等から構成され、ユーザの入力が行
われると「OK」ボタンを選択して入力画面6が閉じら
れる。
The input screen 6 has an upper limit address 7, which can be accessed by an address designated by the pointer 3,
The lower address 8 that can be accessed, the address 9 of the relay that issues an alarm when the address specified by the pointer 3 is not between the upper address 7 and the lower address 8, and the address specified by the pointer 3 are the upper limit A switch 4 for selecting whether to stop or continue the execution of the program when it is not between the address 7 and the lower limit address 8, a switch 5 for selecting whether to display a monitoring program described later on the screen, and the like. Then, when the user inputs, the "OK" button is selected and the input screen 6 is closed.

【0035】次に入力画面6の入力に応じて図6のラダ
ー図に示すような監視プログラム30が追加される。1
段目の「WCMP」は、引数13に示されるアドレスの
内容が引数17と引数18との間にあるかどうかを判断
する応用命令であり、第1引数のレジスタ13にはポイ
ンタ3のアドレス、第2引数のレジスタ17には上限の
アドレス7、第3引数のレジスタ18には下限のアドレ
ス8がそれぞれ代入される。「WCMP」の実行結果に
対応したフラグ21(アドレス1000)は、「WCM
P」の実行結果が真の時にオンとなり、偽の時にオフと
なるようになっている。尚フラグ21のアドレスは予め
決められている。
Then, a monitoring program 30 as shown in the ladder diagram of FIG. 1
The “WCMP” at the bottom is an application instruction for determining whether or not the contents of the address indicated by the argument 13 are between the arguments 17 and 18. The register 13 of the first argument has the address of the pointer 3, The upper limit address 7 is assigned to the register 17 of the second argument, and the lower limit address 8 is assigned to the register 18 of the third argument. The flag 21 (address 1000) corresponding to the execution result of “WCMP” is “WCM”.
It turns on when the execution result of "P" is true, and turns off when it is false. The address of the flag 21 is determined in advance.

【0036】2段目のフラグ21aはフラグ21の実行
結果を示しフラグ21が真の時に切れるようになってお
り、「WCMP」の実行結果が偽の時に繋がって警報用
リレー22(アドレス1234)をオンさせるようにな
っている。警報用リレー22のアドレスは入力画面6の
警報を発するリレーのアドレス9が代入される。
The flag 21a in the second stage indicates the execution result of the flag 21 and is turned off when the flag 21 is true. The flag 21a is connected when the execution result of "WCMP" is false, and is connected to the alarm relay 22 (address 1234). Is turned on. As the address of the alarm relay 22, the address 9 of the relay that issues an alarm on the input screen 6 is substituted.

【0037】警報用リレー22がオンされると、例えば
図7に示すような回路によってブザー23やライト24
をオンするようになって警報を発することができるよう
になっている。
When the alarm relay 22 is turned on, the buzzer 23 and the light 24 are turned on by a circuit as shown in FIG.
Is turned on and an alarm can be issued.

【0038】図6の3段目のフラグ21bは、フラグ2
1の実行結果を示しており、入力画面6のスイッチ4に
おいて「停止」が選択されたときに挿入され、「WCM
P」の実行結果が真の時にのみ繋がって「MOV」を実
行するようになる。
The flag 21b at the third stage in FIG.
1 shows the execution result, and is inserted when “Stop” is selected by the switch 4 on the input screen 6 and “WCM” is displayed.
"MOV" is executed only when the execution result of "P" is true.

【0039】以上に説明した監視プログラム30の作成
手順のフローチャートは図8のようになる。まず、WC
MP命令とフラグ21と警報用リレー22を有した図6
のような回路を持った監視プログラム30を間接指定命
令の前段に挿入する(110)。次にWCMP命令の第
1引数のレジスタ13にポインタ3のアドレス、WCM
P命令の第2引数のレジスタ17に上限のアドレス7、
WCMP命令の第3引数のレジスタ18に下限のアドレ
ス8を代入する(120)。次に警報用リレー22のア
ドレスに警報を発するリレーのアドレス9を代入する
(130)。次に、スイッチ4において「停止」が選択
されているかどうかを判断し(140)、選択されてい
る場合はフラグ21bが挿入され(150)、終了する
(160)。
FIG. 8 is a flowchart of the procedure for creating the monitoring program 30 described above. First, WC
FIG. 6 with MP instruction, flag 21 and alarm relay 22
The monitoring program 30 having such a circuit is inserted before the indirect designation command (110). Next, the address of the pointer 3 and the WCM are stored in the register 13 of the first argument of the WCMP instruction.
The address 7 of the upper limit is stored in the register 17 of the second argument of the P instruction,
The lower limit address 8 is assigned to the register 18 of the third argument of the WCMP instruction (120). Next, the address 9 of the alarm relay is substituted into the address of the alarm relay 22 (130). Next, it is determined whether or not "stop" is selected in the switch 4 (140). If it is selected, the flag 21b is inserted (150), and the process ends (160).

【0040】次に、入力画面6において、監視プログラ
ムを画面に表示するか否かを選択するスイッチ5が、表
示しないと選択されていた場合、図9に示すようなフロ
ーチャートで表示形式が作成される。
Next, when the switch 5 for selecting whether or not to display the monitoring program on the input screen 6 has been selected not to be displayed, the display format is created according to the flowchart shown in FIG. You.

【0041】まず、WCMP命令とフラグ21と警報用
リレー22を有した図6のような回路であるかを判断し
(210)、WCMP命令の第1引数のレジスタ13が
ポインタ3のアドレスと同じかを調べる(220)。次
にyesの場合は監視プログラムは挿入されていると判
断されるので、スイッチ5が、「表示する」と選択され
ているかどうかを判断し(230)、監視プログラム3
0の部分を省いて表示するようになる(240)。上記
がいずれもnoの場合には、何も処理が行われずにプロ
グラムが表示されるようになる(250)。
First, it is determined whether the circuit has the WCMP instruction, the flag 21 and the alarm relay 22 as shown in FIG. 6 (210), and the register 13 of the first argument of the WCMP instruction is the same as the address of the pointer 3. Is checked (220). Next, in the case of yes, it is determined that the monitoring program has been inserted, so it is determined whether or not the switch 5 is selected to “display” (230).
The image is displayed without the 0 part (240). If any of the above is no, the program is displayed without performing any processing (250).

【0042】このように表示形式を選択できることによ
り設計回路とは無関係な監視用のプログラムを必要に応
じて表示画面に表示させないようすることができる。
By being able to select the display format in this way, it is possible to prevent a monitoring program unrelated to the design circuit from being displayed on the display screen as required.

【0043】なお、警報はポインタ3に指定されたアド
レスがアクセス範囲内の時に信号を発するようにするこ
とも可能である。また、警報の出力を行うかどうかを選
択するようにすることも可能であり、警報の出力あるい
は、プログラムの停止のいづれかのみを有するようにし
てもよい。
It should be noted that an alarm can be issued when the address specified by the pointer 3 is within the access range. It is also possible to select whether or not to output an alarm, and it may be possible to have only one of outputting an alarm or stopping a program.

【0044】また、本実施形態は、プログラマブルコン
トローラのプログラムについて説明したが、アセンブリ
言語やC言語などのアドレスの間接指定が可能な他の言
語についても同様に監視させること可能である。
In the present embodiment, the program of the programmable controller has been described. However, it is also possible to monitor other languages such as an assembly language and a C language in which addresses can be specified indirectly in the same manner.

【0045】以上のように、入力画面6に入力された内
容に従って監視プログラム30を作成し、挿入すること
によってポインタによって指定されたアドレスに異常な
値が格納された際に警報を発することができ、プログラ
ムを停止することも可能で重要なデータの破壊やプログ
ラムの暴走を防止することが可能になる。
As described above, by creating and inserting the monitoring program 30 in accordance with the contents input on the input screen 6, an alarm can be issued when an abnormal value is stored at the address specified by the pointer. It is also possible to stop the program, thereby preventing destruction of important data and runaway of the program.

【0046】次に、図10は、プログラマブルコントロ
ーラとプログラマブルコントローラのプログラム作成装
置との関係を示している。プログラマブルコントローラ
46は、RS232CやRS422等のインターフェー
ス45でパーソナルコンピュータ43に接続され、パー
ソナルコンピュータ43上で動作するソフトウェアであ
るプログラム作成装置44で作成されたプログラムによ
って制御されており、ユーザーは、パーソナルコンピュ
ータ43を操作することによってプログラムの読み出し
書き込みなどを行うことが可能となっている。
Next, FIG. 10 shows the relationship between a programmable controller and a program creating device for the programmable controller. The programmable controller 46 is connected to the personal computer 43 via an interface 45 such as RS232C or RS422, and is controlled by a program created by a program creating device 44 which is software operating on the personal computer 43. By operating the 43, it is possible to read and write a program.

【0047】本発明の第2の実施形態について図11乃
至図13を参照して説明する。先に説明した図3におい
て、類似のプログラムを繰り返すようなプログラムを作
成するときに繰り返しの基準となる基準のプログラム
(第1のプログラム)41を作成あるいはライブラリか
ら呼び出した後繰り返しの範囲を指定し、例えば「繰り
返し入力」というような名前のコマンドを選択すると複
製する回数を入力後、図11に示すような入力画面47
が表示される。
A second embodiment of the present invention will be described with reference to FIGS. In FIG. 3 described above, when a program that repeats a similar program is created, a reference program (first program) 41 serving as a reference for repetition is created or a repetition range is designated after calling from a library. For example, when a command having a name such as “repeat input” is selected, the number of times of copying is input, and then an input screen 47 as shown in FIG.
Is displayed.

【0048】入力画面47では、プログラム41内に含
まれるLS1やSOL1などの回路要素やレジスタなど
のアドレスが表示され、複製する毎に各アドレスを増減
させるようなインクリメント量を入力できるようになっ
ている。
On the input screen 47, addresses of circuit elements such as LS1 and SOL1 included in the program 41 and registers are displayed, and it is possible to input an increment amount for increasing or decreasing each address for each copy. I have.

【0049】図3の例では、複製回数は2回で、LS1
(アドレス00000)、LS2(アドレス0000
1)、/EMER(アドレス00200)、SOL1
(アドレス00100)のインクリメント量をそれぞれ
+2,+2,0,+1と入力して入力画面47を閉じる
と図12に示すような繰り返しプログラム(第2のプロ
グラム)50が作成される。基準のプログラム41と類
似した複製プログラム42に含まれる回路要素のアドレ
スは指定した様にインクリメントされ、LS1の位置に
LS3が置き換えられているように所望の回路要素に変
更されている。
In the example of FIG. 3, the number of duplications is two,
(Address 000000), LS2 (address 0000)
1), / EMER (address 00200), SOL1
When the increments of (address 00100) are input as +2, +2, 0, and +1 and the input screen 47 is closed, a repetitive program (second program) 50 as shown in FIG. 12 is created. The address of the circuit element included in the copy program 42 similar to the reference program 41 is incremented as specified and changed to a desired circuit element such that LS3 is replaced at the position of LS1.

【0050】しかし、繰り返しプログラム50は複製回
数が多い場合などにはプログラムの修正時に修正漏れや
修正ミスが発生しやすい。これを回避するため、図12
に示すように、繰り返しプログラム50の先頭位置を示
す命令51と、基準のプログラム41の複製回数を示す
命令52と、繰り返しプログラム50の最終位置を示す
命令53とからなる第3のプログラム54を付加するこ
とによって繰り返しプログラム50を修正する際におい
ては、基準のプログラム40と各回路要素のアドレスの
インクリメント量とを導出し、繰り返しプログラム50
に相当する部分は図13に示すようなラダー図50’で
表示させることができるようになる。
However, when the repetitive program 50 has a large number of duplications, omission of correction or erroneous correction is likely to occur when the program is corrected. In order to avoid this, FIG.
As shown in (3), a third program 54 including an instruction 51 indicating the start position of the repetition program 50, an instruction 52 indicating the number of times the reference program 41 is duplicated, and an instruction 53 indicating the end position of the repetition program 50 is added When the repetition program 50 is corrected by performing the above operation, the reference program 40 and the increment of the address of each circuit element are derived, and the repetition program 50 is modified.
Can be displayed in a ladder diagram 50 'as shown in FIG.

【0051】同図において各回路要素のアドレス番号に
付加された演算子と数値は各回路要素のアドレスの複製
毎のインクリメント量を示している。ラダー図50’を
作成する時のフローチャートを図14に示す。
In the figure, the operator and the numerical value added to the address number of each circuit element indicate the increment amount for each copy of the address of each circuit element. FIG. 14 shows a flowchart when the ladder diagram 50 'is created.

【0052】まず、プログラムに記された命令が先頭位
置を示す命令であるかを判別し(310)、noの場合
はそのまま表示される(320)。次に複製回数を取得
し変数Aに格納する(330)。次に繰り返しプログラ
ム50の最終位置を検出する(340)。次に繰り返し
プログラム50の先頭位置から最終位置までの回路要素
やレジスタなどを設定する命令語数を取得し変数Bに格
納する(350)。
First, it is determined whether the instruction described in the program is an instruction indicating the head position (310), and if no, it is displayed as it is (320). Next, the number of times of copying is obtained and stored in the variable A (330). Next, the last position of the repetitive program 50 is detected (340). Next, the number of command words for setting circuit elements, registers, and the like from the start position to the end position of the repetitive program 50 is obtained and stored in the variable B (350).

【0053】次に基準のプログラム41に含まれる命令
語数C=A/Bを計算する(360)。ここで複製時の
エラーなどを確認するため変数Cが整数であるかどうか
を判別させるようにしてもよい。次に各回路要素の繰り
返しプログラム50内の順序を表すプログラムアドレス
が1からCまでの回路要素について、プログラムアドレ
スがi(iは1〜C)の回路要素とプログラムアドレス
がi+Cの回路要素とのアドレスの差D(i)を計算する
(370〜400)。ここでD(i)は要素数がCの配列
変数を用いている。複製回数(A)が2回のときはここ
でラダー図50’が表示されて終了し、複製回数(A)
が3回以上のときは以下の動作が行われる(410)。
Next, the number of instruction words C = A / B included in the reference program 41 is calculated (360). Here, it may be determined whether or not the variable C is an integer in order to confirm an error at the time of duplication or the like. Next, for the circuit elements whose program addresses indicating the order in the repetitive program 50 of each circuit element are 1 to C, the circuit element whose program address is i (i is 1 to C) and the circuit element whose program address is i + C are The address difference D (i) is calculated (370 to 400). Here, D (i) uses an array variable whose number of elements is C. If the number of copies (A) is two, the ladder diagram 50 'is displayed here and the process ends.
If the number of times is three or more, the following operation is performed (410).

【0054】次に、さらにプログラムアドレスが1+C
×j(jは1〜A−2)からC+C×jまでの回路要素
についてプログラムアドレスがi+C×jの回路要素と
プログラムアドレスがi+C+C×jの回路要素とのア
ドレスの差E(i)を計算し、アドレスの差(インクリメ
ント量)が一定かどうかをチェックする(420〜46
0)。この作業をjがA−2となるまで繰り返して(4
70〜480)全ての回路要素についてチェックし、イ
ンクリメント量が一定でなければそのまま表示して終了
する(500)。
Next, when the program address is 1 + C
Calculate the address difference E (i) between the circuit element having the program address of i + C × j and the circuit element having the program address of i + C + C × j for the circuit elements from × j (j is 1 to A−2) to C + C × j. Then, it is checked whether the address difference (increment amount) is constant (420 to 46).
0). This operation is repeated until j becomes A-2 (4
70 to 480) All circuit elements are checked, and if the increment is not constant, it is displayed as it is and the process ends (500).

【0055】全ての回路要素について各回路要素におけ
る複製毎のインクリメント量が一定であれば図13に示
すように基準のプログラム41とインクリメント量とを
表示するラダー図50’を表示させる(490)ように
なる。
If the increment amount for each copy in each circuit element is constant for all circuit elements, a ladder diagram 50 'displaying the reference program 41 and the increment amount is displayed as shown in FIG. 13 (490). become.

【0056】また、プログラム修正時にはラダー図5
0’を表示してアドレスやアドレスのインクリメント量
を修正することで修正漏れなどを減少させることができ
るとともにプログラム実行時には繰り返しプログラム5
0または全体のプログラム60に切り換えて表示できる
ようにすると各回路要素やレジスタのプログラム実行時
における状態がラダー図上で把握できるため設備動作の
状況がわかりやすくデバッグなどを容易にすることがで
きるようになるので望ましい。
When the program is modified, the ladder diagram shown in FIG.
By displaying 0 'and correcting the address and the increment of the address, it is possible to reduce omission of correction and the like.
If the display is switched to 0 or the entire program 60, the state of each circuit element and register at the time of program execution can be grasped on a ladder diagram, so that the state of equipment operation can be easily understood and debugging can be facilitated. Is desirable.

【0057】また、第3のプログラム54はプログラム
の修正時には表示されて類似のプログラムの範囲をユー
ザーが知ることができるが、基準のプログラム41の先
頭位置および最終位置と複製回数とが識別できれば他の
表示方法としてもよく、繰り返しプログラム50を表示
しているときには第3のプログラム54は不要であるの
で非表示としてもよい。
The third program 54 is displayed when the program is modified so that the user can know the range of similar programs. However, if the start position and the last position of the reference program 41 and the number of times of duplication can be identified, the third program 54 can be identified. The third program 54 is unnecessary when the repetitive program 50 is displayed, and may be hidden.

【0058】また、第3のプログラムは図12に示すよ
うな位置に必ずしも挿入する必要はなく、繰り返しプロ
グラム50の先頭位置と最終位置と複製回数を判断でき
れば他の位置に挿入してもよい。
The third program does not always need to be inserted at the position shown in FIG. 12, but may be inserted at another position as long as the start position, the last position, and the number of times of duplication of the repetitive program 50 can be determined.

【0059】また、第3のプログラム54には例えば繰
り返しプログラム50の先頭位置と、基準のプログラム
41または複製プログラム42の先頭位置および最終位
置と、複製回数とを記録しても同様に基準のプログラム
41と各回路要素のアドレスのインクリメント量とを導
出することが可能であり、基準のプログラム40と各回
路要素のアドレスのインクリメント量と複製回数とを導
出できれば他の情報を記録してもよい。
Even if the third program 54 records, for example, the start position of the repetition program 50, the start position and the end position of the reference program 41 or the copy program 42, and the number of times of duplication, the reference program It is possible to derive 41 and the increment of the address of each circuit element, and other information may be recorded as long as the reference program 40 and the increment of the address of each circuit element and the number of times of duplication can be derived.

【0060】次に本発明の第3の実施形態について説明
する。図15における(a)はプログラムの例を示すラ
ダー図70であり、数値は回路要素のアドレスを示して
いる。同図の1、2段目はスイッチやリレー接点などの
入力機器71(アドレス00000)と入力機器72
(アドレス00001)とのいづれかがオンになるとリ
レー73(アドレス00100)がオンとなるOR回路
を構成し、3段目はリレー接点73a(アドレス001
00)と入力機器74(アドレス00002)とがオン
となるとリレーやランプなどの出力機器75(アドレス
00200)がオンとなるAND回路を構成している。
Next, a third embodiment of the present invention will be described. FIG. 15A is a ladder diagram 70 showing an example of a program, and numerical values indicate addresses of circuit elements. The first and second stages in the figure are input devices 71 (address 000000) such as switches and relay contacts and input devices 72.
An OR circuit that turns on the relay 73 (address 00100) when any of the (address 00001) is turned on is provided. The third stage is a relay contact 73a (address 001).
00) and the input device 74 (address 00002) are turned on, and the output device 75 (address 00200) such as a relay or a lamp is turned on.

【0061】(a)に示すようなプログラムにおいてプ
ログラム実行時には例えば(b)に示すようなタイミン
グで各回路要素がオンオフされる場合、タイムチャート
は(c)に示すようになる。(b)において1、0はそ
れぞれオン、オフを表す。
In the case of the program shown in (a), when each circuit element is turned on and off at the timing shown in (b), for example, when the program is executed, the time chart becomes as shown in (c). In (b), 1 and 0 represent ON and OFF, respectively.

【0062】図16は、プログラム70を実行させたと
きの各回路要素の時系列データを記憶しておき、図15
の(c)における単位時間t0毎に動作している各回路
要素がラダー図上で判別できるように表示した例であ
り、(a)乃至(d)はそれぞれユーザがトリガを入力
することによって切り換えることができるようになって
いる。
FIG. 16 stores time series data of each circuit element when the program 70 is executed.
(C) is an example in which each circuit element operating at every unit time t0 is displayed on the ladder diagram so as to be distinguished, and (a) to (d) are switched by a user inputting a trigger. You can do it.

【0063】このような表示によると、プログラムの実
行経過を判断することができデバッグ等の際にはラダー
図とタイムチャートとを適時切り換えて表示し見比べて
行う必要がなく、効率良く作業を行うことが可能であ
る。
According to such a display, it is possible to judge the progress of the execution of the program, and it is not necessary to switch and display the ladder diagram and the time chart at appropriate times during debugging or the like, and to compare them with each other. It is possible.

【0064】さらに応用命令及びレジスタを含んだ図1
7のラダー図80に示すようなプログラム例を用いて、
ラダー図上で時系列に各回路要素の動作状態を確認可能
な表示画面を得る方法について説明する。
FIG. 1 further including application instructions and registers
7 using a program example as shown in FIG.
A method for obtaining a display screen on which the operation state of each circuit element can be confirmed in time series on a ladder diagram will be described.

【0065】図17において、入力機器81(アドレス
00020)、83a(アドレス00030)いづれか
がオンされるとリレー82(アドレス00010)およ
びリレー接点82a(アドレス00010)がオンされ
て出力機器84(アドレス00000)がオンになる。
このときリレー接点82aがオフからオンに変わると応
用命令「INC」が実行される。また、入力機器83a
(アドレス00010)がオフからオンになると応用命
令「XFER」と「DEC」とが実行されるようになっ
ている。
In FIG. 17, when one of the input devices 81 (address 00020) and 83a (address 00030) is turned on, the relay 82 (address 00010) and the relay contact 82a (address 00010) are turned on, and the output device 84 (address 000000) is turned on. ) Turns on.
At this time, when the relay contact 82a changes from off to on, the application instruction “INC” is executed. Also, the input device 83a
When (address 00010) is turned on from off, the applied instructions “XFER” and “DEC” are executed.

【0066】応用命令「INC」はレジスタ86(アド
レス09100)の値を「1」増加(インクリメント)
させる命令であり、応用命令「XFER」は第1の引数
のレジスタ88(アドレス09100)から第2の引数
のレジスタ89(アドレス09200)への転送を行う
命令であり、応用命令「DEC」はレジスタ91(アド
レス09000)の値を「1」減少(デクリメント)さ
せる命令である。
The application instruction “INC” increases (increments) the value of the register 86 (address 09100) by “1”.
The application instruction “XFER” is an instruction for performing a transfer from the first argument register 88 (address 09100) to the second argument register 89 (address 09200), and the application instruction “DEC” is a register. This is an instruction to decrease (decrement) the value of 91 (address 09000) by “1”.

【0067】このようなプログラム実行時において例え
ば図18に示すようなタイミングでビット情報あるいは
レジスタ情報が変化した際に、図19、図20に示すよ
うな表を作成する。図19は、図18に示すような動作
経過をテーブル番号tと時系列番号mとを付加してビッ
ト情報(a)とレジスタ情報(b)とを別々に表してい
る。時系列データを取り出す際にアドレスsを検索して
取り出すことが可能であるがテーブル番号tを付加して
テーブル番号tを検索して時系列データを取り出す用に
する方が連続した番号を検索することになり、検索時間
が短縮されるので望ましい。
When the bit information or the register information changes at the timing shown in FIG. 18 during such a program execution, tables as shown in FIGS. 19 and 20 are created. FIG. 19 separately shows bit information (a) and register information (b) by adding a table number t and a time series number m to the operation progress as shown in FIG. When fetching the time-series data, it is possible to retrieve the address s by retrieval. However, it is preferable to add the table number t and retrieve the table number t to retrieve the time-series data to retrieve consecutive numbers. This is desirable because the search time is reduced.

【0068】図20は、ラダー図80内の回路要素やレ
ジスタのプログラムアドレスnとアドレスsとテーブル
番号tを対比させている。これらの表を参照して時系列
データを取り出すことによってユーザーからのトリガ入
力により図21に示すような時系列にプログラムの動作
状態を表示させる表示画面が得られる。図21における
(a)および(b)は、時系列番号m=0の時とm=5
の時の表示例であり、図中()内の数値はプログラムア
ドレスを表している。図21を得るためのフローチャー
トを図22に示す。
FIG. 20 compares the program addresses n and s of the circuit elements and registers in the ladder diagram 80 with the table number t. By extracting the time-series data with reference to these tables, a display screen for displaying the operation states of the programs in a time-series manner as shown in FIG. 21 is obtained by a trigger input from the user. (A) and (b) in FIG. 21 show the case where the time series number m = 0 and m = 5.
This is a display example at the time of, and the numerical value in parentheses in the figure represents the program address. FIG. 22 shows a flowchart for obtaining FIG.

【0069】まず、プログラムアドレスnを先頭の値に
セットする(610)。次にプログラムアドレスnが、
回路要素またはレジスタでなければ次の値にプログラム
アドレスnをセットする(620〜630)。次にプロ
グラムアドレスnに対応するテーブル番号tを読み出す
(640)。次に該プログラムアドレスnに対応するア
ドレスsとテーブル番号tとを登録し(650)、プロ
グラムアドレスnが最後の番号となるまで繰り返して
(660)、図20に示すような表が得られる。
First, the program address n is set to the first value (610). Next, the program address n is
If it is not a circuit element or a register, the program address n is set to the next value (620 to 630). Next, the table number t corresponding to the program address n is read (640). Next, the address s corresponding to the program address n and the table number t are registered (650), and the process is repeated until the program address n becomes the last number (660), thereby obtaining a table as shown in FIG.

【0070】次に、時系列番号mを0にセットしプログ
ラムアドレスnを図20における先頭の値にセットする
(710)。次に時系列番号mに応じてプログラムアド
レスnに対応するテーブル番号tの回路要素あるいはレ
ジスタの値を図19から読みとる(720)。次に、プ
ログラムアドレスnの回路要素の状態あるいはレジスタ
の内容をラダー図80上に表示し(730)プログラム
アドレスnが最後の番号となるまで繰り返して図21に
示すようなラダー図80’を得る(740〜750)。
Next, the time series number m is set to 0, and the program address n is set to the first value in FIG. 20 (710). Next, the value of the circuit element or the register of the table number t corresponding to the program address n is read from FIG. 19 according to the time series number m (720). Next, the state of the circuit element at the program address n or the contents of the register is displayed on the ladder diagram 80 (730), and the process is repeated until the program address n reaches the last number to obtain a ladder diagram 80 'as shown in FIG. (740-750).

【0071】次に、プログラムアドレスnを図20にお
ける先頭の値にセットし(760)、時系列番号mが最
後になるまで(770)かあるいはユーザによって表示
終了命令が入力される(780)までの間ユーザからの
トリガ入力(790)によって順に時系列番号mを増加
させて(800)上記と同様にプログラムアドレスnの
回路要素の状態あるいはレジスタの内容をラダー図80
上に表示させることにより時系列に表示することができ
るようになる。
Next, the program address n is set to the first value in FIG. 20 (760), until the time series number m reaches the end (770), or until the display end command is input by the user (780). The time series number m is sequentially increased by the trigger input (790) from the user during the period (800), and the state of the circuit element of the program address n or the contents of the register is ladder diagram 80 in the same manner as described above.
By displaying it on the top, it can be displayed in chronological order.

【0072】以上に説明したように、あらかじめ時系列
に記憶されたプログラム実行時の回路要素の状態あるい
はレジスタの内容を、ユーザのトリガにより任意のタイ
ミングで取り出しラダー図とともに逐次表示させること
で、ユーザは各回路要素やレジスタの関係を視認しなが
らプログラムの実行経過を判断することができるのでデ
バッグ等の作業を容易にすることができる。
As described above, the state of the circuit element or the contents of the register at the time of program execution, which is stored in advance in time series, is extracted at an arbitrary timing by the user's trigger, and is sequentially displayed together with the ladder diagram. Since it is possible to judge the execution progress of the program while visually checking the relationship between each circuit element and register, it is possible to easily perform operations such as debugging.

【0073】[0073]

【発明の効果】請求項1の発明によると、入力画面に入
力された内容に従って監視プログラムを作成し、挿入す
ることによってポインタによって指定されたアドレスに
異常な値が格納された際に警報を発することができ、プ
ログラムを停止することも可能で重要なデータの破壊や
プログラムの暴走を防止することが可能になる。
According to the first aspect of the present invention, an alarm is issued when an abnormal value is stored in the address specified by the pointer by creating and inserting a monitoring program according to the contents input on the input screen. It is also possible to stop the program and prevent destruction of important data and runaway of the program.

【0074】請求項2の発明によると、表示形式を選択
して作成可能となり、表示画面に設計回路とは無関係な
監視用のプログラムを必要に応じて表示させないようす
ることができる。
According to the second aspect of the present invention, a display format can be selected and created, and a monitoring program unrelated to a design circuit can be prevented from being displayed on a display screen as needed.

【0075】請求項3の発明によると、類似したプログ
ラムを繰り返すようなプログラムを使用する際におい
て、プログラムプログラム作成・変更時には一括して作
業を行うことができるようになり、プログラムの作成・
変更時に記述漏れや修正漏れなどのミスを防止すること
ができるとともにプログラム実行時には実行速度を低下
させないようにすることが可能である。
According to the third aspect of the present invention, when a program that repeats a similar program is used, work can be performed collectively when the program program is created / changed, and the program creation / change can be performed.
It is possible to prevent mistakes such as omission of description or omission of correction at the time of change, and to prevent the execution speed from decreasing at the time of program execution.

【0076】請求項4の発明によると、プログラム実行
時には展開されたプログラム全体を表示できるので、各
回路要素やレジスタのプログラム実行時における状態が
ラダー図上で把握できるため設備動作の状況がわかりや
すくデバッグなどを容易にすることができる。
According to the fourth aspect of the present invention, since the entire developed program can be displayed at the time of executing the program, the state of each circuit element and register at the time of executing the program can be grasped on the ladder diagram, so that the state of the equipment operation can be easily understood. Debugging and the like can be facilitated.

【0077】請求項5の発明によると、あらかじめ時系
列に記憶されたプログラム実行時の回路要素の状態ある
いはレジスタの内容を示すメモリ内容を、ユーザのトリ
ガにより任意のタイミングで取り出しラダー図とともに
逐次表示させることで、ユーザは各回路要素やレジスタ
の関係を視認しながらプログラムの実行経過を判断する
ことができるのでデバッグ等の作業を容易にすることが
できる。
According to the fifth aspect of the present invention, the memory contents indicating the states of the circuit elements or the contents of the registers stored in a time series in advance when the program is executed are taken out at an arbitrary timing by a user's trigger and sequentially displayed together with the ladder diagram. By doing so, the user can determine the execution progress of the program while visually checking the relationship between each circuit element and register, so that work such as debugging can be facilitated.

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

【図1】 プログラムの一例を示すラダー図であ
る。
FIG. 1 is a ladder diagram showing an example of a program.

【図2】 プログラムの動作を説明する図である。FIG. 2 is a diagram illustrating the operation of a program.

【図3】 類似したプログラムが繰り返されるよう
なプログラムの一例を示すラダー図である。
FIG. 3 is a ladder diagram showing an example of a program in which a similar program is repeated.

【図4】 プログラムの実行状態の一例を示すタイ
ムチャートである。
FIG. 4 is a time chart showing an example of an execution state of a program.

【図5】 監視プログラムの作成条件の入力画面を
示す図である。
FIG. 5 is a diagram showing an input screen of a condition for creating a monitoring program.

【図6】 本発明によって作成された監視プログラ
ムが追加されたプログラムを示すラダー図である。
FIG. 6 is a ladder diagram showing a program to which a monitoring program created according to the present invention is added.

【図7】 警報を行うプログラムを示すラダー図で
ある。
FIG. 7 is a ladder diagram showing a program for performing an alarm.

【図8】 監視プログラムを作成する手順を示すフ
ローチャートである。
FIG. 8 is a flowchart illustrating a procedure for creating a monitoring program.

【図9】 監視プログラムを表示させないようにす
る手順を示すフローチャートである。
FIG. 9 is a flowchart illustrating a procedure for preventing a monitoring program from being displayed.

【図10】 プログラムコントローラとプログラミン
グ装置との関係を示す図である。
FIG. 10 is a diagram showing a relationship between a program controller and a programming device.

【図11】 類似したプログラムを繰り返す際の条件
の入力画面を示す図である。
FIG. 11 is a diagram showing an input screen for conditions for repeating a similar program.

【図12】 本発明によって作成されたプログラムを
示すラダー図である。
FIG. 12 is a ladder diagram showing a program created by the present invention.

【図13】 本発明によって作成されたプログラムを
修正する際に表示されるラダー図である。
FIG. 13 is a ladder diagram displayed when modifying a program created by the present invention.

【図14】 プログラムを修正する際に表示される表
示画面を作成する手順を示すフローチャートである。
FIG. 14 is a flowchart showing a procedure for creating a display screen displayed when modifying a program.

【図15】 従来のプログラム表示画面を示す図であ
る。
FIG. 15 is a diagram showing a conventional program display screen.

【図16】 本発明のプログラム表示画面の例を示す
図である。
FIG. 16 is a diagram showing an example of a program display screen of the present invention.

【図17】 プログラムの一例を示すラダー図であ
る。
FIG. 17 is a ladder diagram showing an example of a program.

【図18】 各回路要素やレジスタが時系列に変化す
る状態を示す図である。
FIG. 18 is a diagram showing a state in which each circuit element and register change in a time series.

【図19】 本発明の表示画面を得るために作成され
る表を示す図である。
FIG. 19 is a diagram showing a table created to obtain a display screen of the present invention.

【図20】 本発明の表示画面を得るために作成され
る表を示す図である。
FIG. 20 is a diagram showing a table created to obtain a display screen of the present invention.

【図21】 本発明のプログラム表示画面の例を示す
図である。
FIG. 21 is a diagram showing an example of a program display screen of the present invention.

【図22】 本発明の表示画面を得る手順を示すフロ
ーチャートである。
FIG. 22 is a flowchart showing a procedure for obtaining a display screen according to the present invention.

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

6、47 入力画面 43 パーソナルコンピュータ 44 プログラム作成装置 45 インターフェース 46 プログラマブルコントローラ 6, 47 Input screen 43 Personal computer 44 Program creation device 45 Interface 46 Programmable controller

───────────────────────────────────────────────────── フロントページの続き (72)発明者 中村 真 大阪府八尾市跡部本町4丁目1番33号 シ ャープマニファクチャリングシステム株式 会社内 (72)発明者 長澤 俊輔 大阪府八尾市跡部本町4丁目1番33号 シ ャープマニファクチャリングシステム株式 会社内 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Makoto Nakamura 4-133 Atobe-Honcho, Yao-shi, Osaka Sharp Manufacturing System Co., Ltd. (72) Inventor Shunsuke Nagasawa Atobe-Honcho, Yao-shi, Osaka 4-1-1-3 Sharp Manufacturing System Co., Ltd.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 間接指定可能な命令によって間接指定さ
れたアドレスがアクセスすることができるアクセス範囲
を指定する手段を有し、前記アドレスと前記アクセス範
囲との比較結果に応じてプログラムの停止あるいは警報
を出力させるような監視プログラムが前記命令の前に実
行されるように追加されることを特徴とするプログラム
作成装置。
A means for designating an access range in which an address indirectly specified by an indirectly specifiable instruction can access, and stopping or warning of a program in accordance with a result of comparison between the address and the access range A program creation device, wherein a monitoring program for outputting a program is added so as to be executed before the instruction.
【請求項2】 前記監視プログラムのみを表示させない
手段を備えたことを特徴とする請求項1に記載のプログ
ラム作成装置。
2. The program creating apparatus according to claim 1, further comprising means for not displaying only the monitoring program.
【請求項3】 回路要素やレジスタを有する類似したプ
ログラムが複数回繰り返されるようなプログラムを作成
する際において、基準の第1のプログラムと前記第1の
プログラムを複製する複製回数と前記第1のプログラム
を複製して得られる複製プログラム毎に回路要素やレジ
スタを変更する変更規則とを指定する手段と、前記第1
のプログラムを前記複製回数複製し前記変更規則に則っ
て回路要素やレジスタを変更して第2のプログラムを作
成する手段と、前記第1のプログラムと前記変更規則と
前記複製回数とを導出可能な情報を第3のプログラムに
記録する手段とを備え、前記第2、第3のプログラムを
含むプログラムを表示する際において、前記第2、第3
のプログラムから前記第1のプログラムと前記変更規則
とを再現する手段と、前記第1のプログラムと前記変更
規則と前記複製回数とを表示する第1の表示手段とを備
えたことを特徴とするプログラム作成装置。
3. When creating a program in which a similar program having circuit elements and registers is repeated a plurality of times, a first reference program, the number of duplications for duplicating the first program, and the first program Means for designating a change rule for changing circuit elements and registers for each copy program obtained by copying the program;
Means for creating the second program by duplicating the program in the number of times of copying and changing circuit elements and registers in accordance with the change rule, and deriving the first program, the change rule, and the number of copies Means for recording information in a third program, when displaying a program including the second and third programs,
Means for reproducing the first program and the change rule from the first program, and first display means for displaying the first program, the change rule, and the number of copies. Program creation device.
【請求項4】 前記第2のプログラムを表示する第2の
表示手段を有し、前記第1の表示手段と前記第2の表示
手段とを切り換えて表示させることができることを特徴
とする請求項3に記載のプログラム作成装置。
4. The apparatus according to claim 1, further comprising second display means for displaying said second program, wherein said first display means and said second display means can be switched and displayed. 4. The program creation device according to 3.
【請求項5】 プログラマブルコントローラのプログラ
ム実行時におけるメモリ内容を時系列に記憶する記憶手
段を有し、前記記憶手段から前記メモリ内容を時系列に
任意のタイミングで逐次取り出して前記プログラム内の
回路要素やレジスタの状態をラダー図とともに表示する
ことを特徴とするプログラムモニタ装置。
5. A storage device for storing the contents of a memory in a time-series manner when a program of a programmable controller is executed, and sequentially extracting the contents of the memory from the storage means in a time-series at an arbitrary timing. A program monitor device for displaying the status of a register and a register together with a ladder diagram.
JP10015326A 1998-01-28 1998-01-28 Programming device and program monitoring device Pending JPH11212606A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10015326A JPH11212606A (en) 1998-01-28 1998-01-28 Programming device and program monitoring device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10015326A JPH11212606A (en) 1998-01-28 1998-01-28 Programming device and program monitoring device

Publications (1)

Publication Number Publication Date
JPH11212606A true JPH11212606A (en) 1999-08-06

Family

ID=11885661

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10015326A Pending JPH11212606A (en) 1998-01-28 1998-01-28 Programming device and program monitoring device

Country Status (1)

Country Link
JP (1) JPH11212606A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007257077A (en) * 2006-03-20 2007-10-04 Mitsubishi Electric Corp Program debugging device, method and program
JP2013054650A (en) * 2011-09-06 2013-03-21 Toshiba Corp Program inspection device
JP2020077150A (en) * 2018-11-07 2020-05-21 ファナック株式会社 Trace device and programmable controller

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007257077A (en) * 2006-03-20 2007-10-04 Mitsubishi Electric Corp Program debugging device, method and program
JP4537336B2 (en) * 2006-03-20 2010-09-01 三菱電機株式会社 Program debugging apparatus, program debugging method, and debugging program
JP2013054650A (en) * 2011-09-06 2013-03-21 Toshiba Corp Program inspection device
JP2020077150A (en) * 2018-11-07 2020-05-21 ファナック株式会社 Trace device and programmable controller

Similar Documents

Publication Publication Date Title
US5926638A (en) Program debugging system for debugging a program having graphical user interface
WO2009096322A1 (en) Program test device and program
JPH11212606A (en) Programming device and program monitoring device
US20020129336A1 (en) Automatic symbol table selection in a multi-cell environment
JP4488226B2 (en) Macro program that realizes highly functional ladder program
JPH10247142A (en) System and method for programming process control program
JP3253224B2 (en) I / O command test equipment
JP2827724B2 (en) Program debug processing method
JPH0887406A (en) Program display device
JPH1091477A (en) Control microcomputer device and maintenance tool for the same
JP3098501B2 (en) Source step execution method and apparatus
JPH0535455A (en) Scroll display system for program
JPH0362104A (en) Inspection instrument
JPH07306813A (en) Test device for input/output device
JPH11272496A (en) Failure recovery verification method for information processor and system therefor
JPS5870361A (en) Input controlling system
JPH0325631A (en) Microprogram controller
JPH0535464A (en) Hicroprogram control system
JPH02253305A (en) Signal tracing system for programmable controller
JPH09160806A (en) Method for supporting debugging and its device
JPS5927303A (en) Program correcting device
JPH0651888A (en) Operation re-executing device
JPH05334135A (en) Error information display system for abnormal end of program
JPH06161516A (en) Checking method for sequence program
JP2001312418A (en) Device and method for supporting debugging of sequence program for programmable controller and computer- readable recording medium

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20031216