[go: up one dir, main page]

JP2001209412A - Simulator for sequence program - Google Patents

Simulator for sequence program

Info

Publication number
JP2001209412A
JP2001209412A JP2000018065A JP2000018065A JP2001209412A JP 2001209412 A JP2001209412 A JP 2001209412A JP 2000018065 A JP2000018065 A JP 2000018065A JP 2000018065 A JP2000018065 A JP 2000018065A JP 2001209412 A JP2001209412 A JP 2001209412A
Authority
JP
Japan
Prior art keywords
execution
program
contents
sequence program
memory area
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.)
Granted
Application number
JP2000018065A
Other languages
Japanese (ja)
Other versions
JP3876959B2 (en
Inventor
Hirobumi Yokomizo
博文 横溝
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2000018065A priority Critical patent/JP3876959B2/en
Publication of JP2001209412A publication Critical patent/JP2001209412A/en
Application granted granted Critical
Publication of JP3876959B2 publication Critical patent/JP3876959B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Testing And Monitoring For Control Systems (AREA)
  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a simulator that runs a sequence program feasible for an effective debugging since the program can restore, immediately as requested, a status of an input and output device at the time of scan without asking a debugger to store or record revised position when the input and output device value is changed during a debugging process. SOLUTION: The simulator runs the sequence program that can run on a personal computer and enables us to stop during execution steps. The simulator has a memory region where a referenced object at the sequence program execution and data to be a setting object by the execution result are stored, and the backup region where backup contents for the memory region are stored. The simulator has a memory contents storing mean to store contents of the memory region into a backup region at the beginning of every scanning. The simulator has an initialization function that enforces to bring an execution address of the sequence program into the top address of the program while the contents of the memory region are recovered from the contents being stored in the backup region provided that a prescribed operation is accepted by the initialization function.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、シーケンスプロ
グラムをパソコン上で実行及び途中ステップにおける実
行停止を可能としたシーケンスプログラムのシミュレー
ション装置に係り、特に、スキャン開始時の入出力デバ
イスの状態に戻って、シーケンスプログラムの実行を再
現するための操作を簡便に行えるようにしたシーケンス
プログラムのシミュレーション装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a simulation apparatus for a sequence program which can execute a sequence program on a personal computer and stop the execution of the sequence program in an intermediate step. The present invention relates to a sequence program simulation apparatus that can easily perform an operation for reproducing the execution of a sequence program.

【0002】[0002]

【従来の技術】シーケンスプログラムを構成する命令列
をパソコン上で1ステップ単位で寸送り的に模擬実行さ
せることを可能としたシーケンスプログラムのシミュレ
ーション装置は、公知である。
2. Description of the Related Art A sequence program simulation apparatus which is capable of simulating a sequence of instructions constituting a sequence program on a personal computer step by step is known.

【0003】この種のシミュレーション装置にあって
は、本来1スキャン単位で一括して実行される一連のシ
ーケンスプログラム(命令ステップ列で構成される)
を、1ステップずつ寸送り的に模擬実行してその都度出
力デバイス(リレー等)の値をモニタリング(視認)す
ることによりプログラムのデバッグが行われる。
In this type of simulation apparatus, a series of sequence programs (consisting of a sequence of instruction steps) that are originally executed collectively in units of one scan.
The program is debugged by executing the simulation step-by-step in small steps and monitoring (visually recognizing) the value of the output device (relay or the like) each time.

【0004】モニタリング時に出力デバイスが所期の値
とならない場合、実行した命令ステップに関連する入出
力デバイス(センサやリレー)の値を強制的に変更して
は、再度その命令ステップの実行結果を確認する。状況
によっては複数の入出力データの値を変更しては、再度
その命令ステップの実行結果を確認する。必要な場合に
は、プログラムの修正を行い、修正されたプログラムに
より再度動作の確認を行なう。開発者の意図した動作を
行うことが確認されたならば、プログラムのデバッグは
完了する。
If the output device does not have the expected value during monitoring, the value of the input / output device (sensor or relay) related to the executed instruction step is forcibly changed, and the execution result of the instruction step is again changed. Confirm. If the value of a plurality of input / output data is changed depending on the situation, the execution result of the instruction step is confirmed again. If necessary, the program is corrected, and the operation is confirmed again using the corrected program. If it is confirmed that the operation intended by the developer is performed, the debugging of the program is completed.

【0005】[0005]

【発明が解決しようとする課題】このようなシーケンス
プログラムのデバッグにおいては、デバッグ完了に至る
過程で、各命令ステップの実行動作確認等のために、入
出力デバイスの値を必要により適宜に変更する。そのた
め、最終的なデバッグ完了確認のために、シーケンスプ
ログラムを構成する一連の命令ステップをその先頭から
末尾まで1ステップずつ寸送りに実行させるためには、
それに先立って、それまでに変更された入出力デバイス
等の値を全てスキャン開始時の本来の値(実機PLCに
おける入出力リフレッシュ直後の値に相当する)に戻さ
ねばならない。さもなければ、実機PLCにおいても、
プログラムが正常に動作することが保証されない。
In the debugging of such a sequence program, the values of the input / output devices are appropriately changed as necessary in order to confirm the execution operation of each instruction step in the process of completing the debugging. . Therefore, in order to execute a series of instruction steps composing the sequence program one step at a time from the beginning to the end in order to confirm the final completion of debugging,
Prior to that, all the values of the input / output devices and the like changed so far must be returned to the original values at the start of scanning (corresponding to the values immediately after the input / output refresh in the actual PLC). Otherwise, even in the actual PLC,
There is no guarantee that the program will work properly.

【0006】しかしながら、従来のこの種のシミュレー
ション装置にあっては、デバッグの過程でどの入出力デ
バイスをどのような値に変更したかの情報は、手作業に
よる記録や作業者の記憶に頼る他なかったため、値の戻
し忘れや値の設定ミスが発生したり、値を元に戻すため
に多大な作業工数が必要であったりすることにより、デ
バッグ効率が低下すると言った問題点が指摘されてい
る。
However, in this type of conventional simulation apparatus, information on which input / output device has been changed to what value in the debugging process depends on manual recording or operator's memory. There was a problem that debugging efficiency was reduced due to forgetting to reset the value, mistake in setting the value, and requiring a lot of work to restore the value to the original value. I have.

【0007】この発明は、このような従来の問題点に着
目してなされたもので、その目的とするところは、デバ
ッグの過程で入出力デバイスの値を変更した場合、その
変更箇所を作業者が記録若しくは記憶しておかずとも、
必要に応じてスキャン開始時の入出力デバイスの状態に
直ちに復元することができ、これによりこの種のデバッ
グ作業を効率よく実施可能なシーケンスプログラムのシ
ミュレーション装置を提供することにある。
The present invention has been made in view of such a conventional problem. An object of the present invention is to change the value of an input / output device in the course of debugging and to determine the changed portion by an operator. Is not recorded or memorized,
It is an object of the present invention to provide a sequence program simulation apparatus which can immediately restore the state of an input / output device at the start of scanning as needed, and thereby can efficiently perform this kind of debugging work.

【0008】この発明の他の目的とするところは、デバ
ッグの過程で入出力デバイスの値を変更した場合、その
変更箇所を作業者が記録若しくは記憶しておかずとも、
過去のスキャン回の中で指定されたスキャン回における
スキャン開始時の入出力デバイスの状態に直ちに復元す
ることができ、これによりこの種のデバッグ作業をより
効率よく実施可能なシーケンスプログラムのシミュレー
ション装置を提供することにある。
Another object of the present invention is to change the value of an input / output device in the course of debugging without the operator having to record or store the changed portion.
It is possible to immediately restore the state of the input / output device at the time of the start of the scan in the scans designated in the past scans, thereby providing a sequence program simulation apparatus capable of more efficiently performing this kind of debug work. To provide.

【0009】この発明の他の目的とするところは、デバ
ッグの過程で入出力デバイスの値を変更した場合、その
変更箇所を作業者が記録若しくは記憶しておかずとも、
過去のスキャン回の中で、入出力デバイスが指定の値に
変化したスキャン回におけるスキャン開始時の入出力デ
バイスの状態に直ちに復元することができ、これにより
この種のデバッグ作業をより効率よく実施可能なシーケ
ンスプログラムのシミュレーション装置を提供すること
にある。
Another object of the present invention is to change the value of an input / output device in the course of debugging, without the operator having to record or store the changed portion.
In the past scans, when the input / output device has changed to the specified value, the status of the input / output device at the start of the scan can be immediately restored, and this type of debugging work can be performed more efficiently. An object of the present invention is to provide a simulation device for a sequence program that can be used.

【0010】この発明のさらに他の目的とするところ
は、デバッグの過程で入出力デバイスの値を変更した場
合、その変更箇所を作業者が記録若しくは記憶しておか
ずとも、1ステップずつ命令実行を寸送りに逆戻りさせ
つつ、最終的にスキャン開始時の入出力デバイスの状態
に復元することができ、これによりこの種のデバッグ作
業をより効率よく実施可能なシーケンスプログラムのシ
ミュレーション装置を提供することにある。
It is still another object of the present invention to execute an instruction one step at a time when a value of an input / output device is changed in a debugging process, without the operator recording or storing the changed portion. It is possible to finally restore the state of the input / output device at the start of scanning while reverting to inching, thereby providing a sequence program simulation device capable of performing this kind of debugging work more efficiently. is there.

【0011】[0011]

【課題を解決するための手段】この発明のシーケンスプ
ログラムのシミュレーション装置は、シーケンスプログ
ラムをパソコン上で実行及び途中ステップにおける実行
停止を可能としたシーケンスプログラムのシミュレーシ
ョン装置であって、シーケンスプログラムの実行の際の
参照対象及び実行結果による設定対象となるべきデータ
が格納されるメモリ領域と、メモリ領域の内容をバック
アップするためのバックアップ領域と、毎スキャンの開
始時点で前記メモリ領域の内容をバックアップ領域に保
存するメモリ内容保存手段と、所定の操作が受付られる
のを条件として、メモリ領域の内容を、バックアップ領
域に保存された内容に復元すると共に、シーケンスプロ
グラムの実行アドレスをプログラムの先頭へと強制的に
戻す初期化手段と、を備え、それにより、過去のスキャ
ン時に戻って、シーンプログラムの実行を再現可能とし
たものである。
A sequence program simulation apparatus according to the present invention is a sequence program simulation apparatus capable of executing a sequence program on a personal computer and stopping execution at an intermediate step. A memory area in which data to be referred to and set according to the execution result are stored, a backup area for backing up the contents of the memory area, and the contents of the memory area are stored in the backup area at the start of each scan. A memory content storing means for storing, and on the condition that a predetermined operation is received, the content of the memory area is restored to the content stored in the backup area, and the execution address of the sequence program is forcibly moved to the beginning of the program. Initialization means to return to Comprising a, thereby returning to the time past scan is obtained by a reproducible execution scene program.

【0012】なお、途中ステップにおける実行停止可能
なモードとしては、この種のシミュレーション装置にお
いては種々のモードが知られている。具体的には、1ス
テップ実行モードのほかに、指定された入出力の内容が
特定値となったことを条件として実行を自動停止する各
種の自動停止モード、さらには、任意の時点で手動でプ
ログラムを途中停止させるモード等が存在する。加え
て、そのような途中ステップにおける実行停止可能な新
規なモードとしては、予め停止すべきステップを具体的
にステップ番号により指定し、そのステップの到来を待
って、実行停止を行うモードも考えられる。本発明は、
あらゆる途中停止モードに対応可能である。
As a mode in which execution can be stopped at an intermediate step, various modes are known in this type of simulation apparatus. Specifically, in addition to the one-step execution mode, various automatic stop modes for automatically stopping the execution on condition that the content of the designated input / output becomes a specific value, and further, manually at any time There is a mode for stopping the program halfway. In addition, as a new mode in which execution can be stopped in such an intermediate step, a mode in which a step to be stopped is specifically specified in advance by a step number, and the execution is stopped after the arrival of the step is considered. . The present invention
Compatible with all stop modes.

【0013】このような構成によれば、デバッグの過程
で入出力デバイスの値を変更した場合、その変更箇所を
作業者が記録若しくは記憶しておかずとも、必要に応じ
てスキャン開始時の入出力デバイスの状態に直ちに復元
することができ、これによりこの種のデバッグ作業を効
率よく実施可能となる。
According to such a configuration, when the value of the input / output device is changed in the course of debugging, the input / output device at the start of scanning can be used as needed without the operator recording or storing the changed portion. The state of the device can be immediately restored, so that this kind of debugging work can be efficiently performed.

【0014】好ましい実施の形態では、バックアップ領
域の内容の複数スキャン回数分の履歴を保存する手段を
有し、かつ初期化手段が、メモリ領域の内容を、バック
アップ領域の履歴の中から指定されたスキャン回の内容
に復元すると共に、シーケンスプログラムの実行アドレ
スをプログラムの先頭へと強制的に戻すものである。
In a preferred embodiment, there is provided a means for storing the history of the contents of the backup area for a plurality of scans, and the initialization means specifies the contents of the memory area from the history of the backup area. In addition to restoring the contents of the scan, the execution address of the sequence program is forcibly returned to the beginning of the program.

【0015】このような構成によれば、デバッグの過程
で入出力デバイスの値を変更した場合、その変更箇所を
作業者が記録若しくは記憶しておかずとも、過去のスキ
ャン回の中で指定されたスキャン回におけるスキャン開
始時の入出力デバイスの状態に直ちに復元することがで
き、これによりこの種のデバッグ作業をより効率よく実
施可能となる。
According to such a configuration, when the value of the input / output device is changed in the course of debugging, the changed portion is designated in the past scan times without the operator recording or storing the changed portion. It is possible to immediately restore the state of the input / output device at the time of the start of the scan in the scan cycle, so that this kind of debugging work can be performed more efficiently.

【0016】好ましい実施の形態では、バックアップ領
域が、メモリ領域の内容を複数スキャン回数分の履歴と
して保存可能になされており、かつ初期化手段が、メモ
リ領域の内容を、バックアップ領域に保存された履歴の
中から指定された入出力条件が成立したスキャン回の内
容に復元すると共に、シーケンスプログラムの実行アド
レスをプログラムの先頭へと強制的に戻すものである。
In a preferred embodiment, the backup area is configured to be able to store the contents of the memory area as histories for a plurality of scans, and the initialization means stores the contents of the memory area in the backup area. In addition to restoring from the history to the contents of the scan in which the designated input / output condition is satisfied, the execution address of the sequence program is forcibly returned to the beginning of the program.

【0017】このような構成によれば、デバッグの過程
で入出力デバイスの値を変更した場合、その変更箇所を
作業者が記録若しくは記憶しておかずとも、過去のスキ
ャン回の中で、入出力デバイスが指定の値に変化したス
キャン回におけるスキャン開始時の入出力デバイスの状
態に直ちに復元することができ、これによりこの種のデ
バッグ作業をより効率よく実施可能となる。
According to such a configuration, when the value of the input / output device is changed in the debugging process, the input / output device can be changed in the past scan times without the operator recording or storing the changed portion. It is possible to immediately restore the state of the input / output device at the start of the scan in the scan in which the device has changed to the specified value, and thus this kind of debugging work can be performed more efficiently.

【0018】さらに、この発明のシーケンスプログラム
のシミュレーション装置は、シーケンスプログラムをパ
ソコン上で実行及び途中ステップにおける実行停止可能
としたシーケンスプログラムのシミュレーション装置で
あって、シーケンスプログラムの実行の際に参照及び設
定されるべきデータが格納されるメモリ領域と、メモリ
領域の内容をバックアップするためのバックアップ領域
と、毎スキャンの開始時点で前記メモリ領域の内容をバ
ックアップ領域に保存するメモリ内容保存手段と、所定
の操作が受付られるのを条件として、メモリ領域の内容
を、バックアップ領域に保存された内容に復元すると共
に、シーケンスプログラムの実行アドレスをプログラム
の先頭へと強制的に戻し、以後、前記所定操作が受け付
けられた時点のステップの1ステップ手前まで、シーケ
ンスプログラムを強制的に連続実行させる再実行手段
と、を備え、それにより、シーンプログラムの実行を1
ステップ分逆戻りさせた状態と等価な状態を再現可能と
したものである。
Further, the sequence program simulation apparatus according to the present invention is a sequence program simulation apparatus capable of executing a sequence program on a personal computer and suspending the execution of the sequence program in an intermediate step. A memory area in which data to be stored is stored, a backup area for backing up the content of the memory area, a memory content storage means for storing the content of the memory area in the backup area at the start of each scan, On condition that the operation is accepted, the contents of the memory area are restored to the contents saved in the backup area, and the execution address of the sequence program is forcibly returned to the beginning of the program. At the time Tsu until one step before the flop, and a re-execution means for forcibly continuously executing a sequence program, thereby executing the scene program 1
It is possible to reproduce a state equivalent to a state in which steps are reversed.

【0019】このような構成によれば、デバッグの過程
で入出力デバイスの値を変更した場合、その変更箇所を
作業者が記録若しくは記憶しておかずとも、1ステップ
ずつ命令実行を寸送りに逆戻りさせつつ、最終的にスキ
ャン開始時の入出力デバイスの状態に復元することがで
き、これによりこの種のデバッグ作業をより効率よく実
施可能となる。
According to such a configuration, when the value of the input / output device is changed in the course of debugging, even if the operator does not record or store the changed portion, the execution of the instruction is returned to the step-by-step step by step. Then, it is possible to finally restore the state of the input / output device at the time of starting the scan, so that this kind of debugging work can be performed more efficiently.

【0020】[0020]

【発明の実施の形態】以下に、この発明の好適な幾つか
の実施の一形態を添付図面を参照しながら詳細に説明す
る。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Some preferred embodiments of the present invention will be described below in detail with reference to the accompanying drawings.

【0021】本発明に係るシーケンスプログラムのシミ
ュレーション装置の第1実施形態が図1〜図4に示され
ている。なお、図1はシーケンスプログラムのシミュレ
ーション装置のソフトウェア構成を示す構成図、図2は
シーケンスプログラムのシミュレーション装置の機能ブ
ロック図、図3はシーケンスプログラム実行処理のフロ
ーチャート、図4はステップ実行処理のフローチャート
である。
A first embodiment of a sequence program simulation apparatus according to the present invention is shown in FIGS. 1 is a block diagram showing a software configuration of a sequence program simulation apparatus, FIG. 2 is a functional block diagram of the sequence program simulation apparatus, FIG. 3 is a flowchart of sequence program execution processing, and FIG. 4 is a flowchart of step execution processing. is there.

【0022】図1に示されるように、本発明のシミュレ
ーション装置1は、市販のパソコン(例えば、Windows9
5/98/NT4.0等)10上に、デバッガ101とシミュレー
ションエンジン102とをソフトウェア的に実現して構
成されている。
As shown in FIG. 1, a simulation apparatus 1 of the present invention is a commercially available personal computer (for example, Windows 9).
5/98 / NT4.0), a debugger 101 and a simulation engine 102 are realized by software.

【0023】シミュレーションエンジン102は、実行
管理部102aと、プログラム実行部102bと、メモ
リ領域102cと、バックアップ領域102dとを含ん
でいる。
The simulation engine 102 includes an execution management unit 102a, a program execution unit 102b, a memory area 102c, and a backup area 102d.

【0024】デバッガ101は、シミュレーションエン
ジン102に対する動作指示やシミュレーションエンジ
ンの動作監視を行う。使用者は、デバッガ101のユー
ザインタフェースを介して、シミュレーションエンジン
102に対して指示することができる。
The debugger 101 issues an operation instruction to the simulation engine 102 and monitors the operation of the simulation engine. The user can instruct the simulation engine 102 via the user interface of the debugger 101.

【0025】シミュレーションエンジン102は、本発
明の要部を構成するものであり、シーケンスプログラム
のシミュレーション機能を有する。
The simulation engine 102 constitutes a main part of the present invention and has a function of simulating a sequence program.

【0026】実行管理部102aは、シーケンスプログ
ラムの実行指示、メモリバックアップ処理等を行う。ま
た、実行管理部102aは、デバッガ101からの指示
を受け付け、プログラムの実行を制御する。
The execution management unit 102a performs a sequence program execution instruction, a memory backup process, and the like. Further, the execution management unit 102a receives an instruction from the debugger 101 and controls execution of a program.

【0027】プログラム実行部102bは、メモリ領域
102cを参照・操作しつつ、シーケンスプログラムの
実行を行う。すなわち、プログラム実行部102bは、
メモリ領域102cの入力デバイスの値を参照して命令
を実行すると共に、命令実行結果によりメモリ領域10
2cの出力デバイスの値を(書き替え)操作する。
The program execution unit 102b executes a sequence program while referring to and operating the memory area 102c. That is, the program execution unit 102b
The instruction is executed with reference to the value of the input device in the memory area 102c, and the memory area 10
Operate (rewrite) the value of the output device 2c.

【0028】メモリ領域102cは、プログラム実行部
102bが参照するメモリ領域である。このメモリ領域
102cには、シーケンスプログラムの実行の際の参照
対象及び実行結果による設定対象となるべき入出力デー
タが格納される。
The memory area 102c is a memory area referred to by the program execution unit 102b. In this memory area 102c, input / output data to be referred to when executing the sequence program and to be set according to the execution result are stored.

【0029】バックアップ領域102dは、メモリ領域
102cを一時的にバックアップするための領域であ
る。このバックアップ領域102dには、後述するよう
に、スキャン毎にメモリ領域102cの内容が保存され
る。また、バックアップ領域102dの内容は、デバッ
ガ101からの指示に応じて、メモリ領域102cへと
転送複写され、これによりメモリ領域102cにはスキ
ャン開始時の内容(プログラムの実行等により変更され
ていない内容)が復元される。
The backup area 102d is an area for temporarily backing up the memory area 102c. As described later, the contents of the memory area 102c are stored in the backup area 102d for each scan. Further, the contents of the backup area 102d are transferred and copied to the memory area 102c in accordance with an instruction from the debugger 101, whereby the contents at the start of scanning (contents not changed by execution of a program or the like) are stored in the memory area 102c. ) Is restored.

【0030】次に、図2〜図4を参照しつつ、本発明に
関連するシミュレーション装置1の構成機能並びに全体
動作をより詳細に説明する。
Next, the configuration functions and the overall operation of the simulation apparatus 1 related to the present invention will be described in more detail with reference to FIGS.

【0031】先ず、図2を参照して説明すると、デバッ
ガ101は、ユーザからの各種の操作指令乃至指示を受
け付ける役目とユーザに対して動作内容を認識可能に出
力(表示等)する役目とを果たすマンマシンインタフェ
ース(MMI)として有効に機能するソフトウェアであ
る。
First, referring to FIG. 2, the debugger 101 has a function of receiving various operation commands or instructions from the user and a function of outputting (displaying, etc.) the operation contents to the user in a recognizable manner. It is software that effectively functions as a fulfilling man-machine interface (MMI).

【0032】ユーザからの操作指令乃至指示としては、
(1)プログラム実行に関する指示、(2)デバッグ中
等のプログラム変更指示、(3)デバッグ中等の入出力
デバイスの値の変更指示、等が少なくとも含まれてい
る。
The operation commands or instructions from the user include:
It includes at least (1) an instruction related to program execution, (2) an instruction to change a program during debugging or the like, and (3) an instruction to change a value of an input / output device during debugging or the like.

【0033】特に、プログラム実行に関する指示には、
実行(モニタモード)指示、停止(プログラムモー
ド)指示、一時停止指示、ステップ実行指示、ス
キャン実行指示、連続スキャン実行指示、スキャン
再実行指示(本発明の要部)、等が少なくとも含まれて
いる。
In particular, instructions relating to program execution include:
At least an execution (monitor mode) instruction, a stop (program mode) instruction, a pause instruction, a step execution instruction, a scan execution instruction, a continuous scan execution instruction, a scan re-execution instruction (a main part of the present invention), and the like are included. .

【0034】ここで、実行(モニタモード)指示と
は、スキャンを連続的に行わせながらプログラムを実行
する指示である。
Here, the execution (monitor mode) instruction is an instruction to execute a program while continuously performing scanning.

【0035】停止(プログラムモード)指示とは、プ
ログラムの実行を停止させる指示である。このとき、ラ
ダー実行エンジンの運転モードは、自動的にプログラム
モードになる。
The stop (program mode) instruction is an instruction to stop the execution of the program. At this time, the operation mode of the ladder execution engine automatically changes to the program mode.

【0036】一時停止指示とは、一時的にプログラム
の実行を停止する指示である。このとき、各実行モード
で処理を再開することができる。
The temporary stop instruction is an instruction for temporarily stopping the execution of the program. At this time, the process can be restarted in each execution mode.

【0037】ステップ実行指示とは、プログラムを構
成する一連のニモニックの1ステップ毎の処理(解読実
行)を寸送り的に行う指示である。ステップ実行では、
1ステップ分のプログラム実行の毎に動作は停止する。
The step execution instruction is an instruction for executing a process (decoding execution) for each step of a series of mnemonics constituting the program in a stepwise manner. In step execution,
The operation stops every time the program for one step is executed.

【0038】スキャン実行指示とは、ラダープログラ
ムを1スキャンだけ実行する指示である。ステップ実行
中にスキャン実行指示を与えると、ラダーの最後まで実
行する。
The scan execution instruction is an instruction to execute the ladder program for only one scan. When a scan execution instruction is given during the step execution, the ladder is executed to the end.

【0039】連続スキャン実行指示とは、スキャン実
行を一定の間隔(インターバル)で連続して行う指示で
ある。
The continuous scan execution instruction is an instruction for continuously performing the scan at a constant interval.

【0040】スキャン再実行指示とは、図2の再実行
指示(201)に相当するものであり、ステップ実行の
途中で、入出力メモリ(I/Oメモリ)の内容をスキャ
ン開始時の状態に戻すと共に、プログラムカウンタの内
容をクリアさせる(先頭値とさせる)指示である。ここ
で、当業者には良く知られているように、入出力メモリ
とはプログラム実行に際して参照乃至設定されるメモリ
領域102cに相当するものである。また、プログラム
カウンタとは、プログラムの実行アドレスを管理するポ
インタとして機能するものである。
The scan re-execution instruction is equivalent to the re-execution instruction (201) in FIG. 2. During the step execution, the contents of the input / output memory (I / O memory) are changed to the state at the start of the scan. This is an instruction to return and clear the contents of the program counter (to make it the top value). Here, as is well known to those skilled in the art, the input / output memory corresponds to the memory area 102c which is referred to or set when executing the program. The program counter functions as a pointer for managing the execution address of the program.

【0041】実行管理部102aは、デバッガ101か
らの各種の指示を受け付けると共に、それらに対応する
動作を実現するために、プログラム実行部102bやメ
モリ領域102cを適宜に制御するものである。本発明
に関連する処理としては、プログラム実行モードを様々
に変更するためのプログラムアドレス変更処理(20
2)が挙げられる。
The execution management unit 102a receives various instructions from the debugger 101 and appropriately controls the program execution unit 102b and the memory area 102c in order to realize operations corresponding thereto. The processing related to the present invention includes a program address change processing (20) for variously changing the program execution mode.
2).

【0042】プログラム実行部102bは、シーケンス
プログラムを実行するためのラダー実行エンジンとして
機能するものであり、このプログラム実行部102bの
プログラム実行アドレスは実行管理部102aにより制
御される。
The program execution unit 102b functions as a ladder execution engine for executing a sequence program, and the program execution address of the program execution unit 102b is controlled by the execution management unit 102a.

【0043】メモリ領域102cは、PLCの所謂入出
力メモリ(I/Oメモリ)に相当するものであり、この
メモリ領域102cには入出力デバイスに対応する入出
力データの他に、プログラムの実行に必要なタイマやカ
ウンタのデータ等が格納される。このメモリ領域102
の入力領域の内容は、実行管理部102の制御下にあっ
て、1スキャン毎に仮想入力デバイスとの間で更新さ
れ、出力領域の内容は1スキャン毎に仮想出力デバイス
との間で更新される。すなわち、実行管理部102a
は、命令実行工程、入出力更新工程、周辺サービス処理
工程を含む1サイクル動作を基準として動作管理をおこ
なっている。
The memory area 102c corresponds to a so-called input / output memory (I / O memory) of the PLC. In the memory area 102c, in addition to the input / output data corresponding to the input / output device, the memory area 102c is used for executing a program. Necessary timer and counter data and the like are stored. This memory area 102
Under the control of the execution management unit 102, the content of the input area is updated with the virtual input device every scan, and the content of the output area is updated with the virtual output device every scan. You. That is, the execution management unit 102a
Performs operation management based on one cycle operation including an instruction execution step, an input / output update step, and a peripheral service processing step.

【0044】当業者に良く知られているように、メモリ
領域102cの内容は、プログラムの実行に際して適宜
に参照(203)される。また、プログラムの実行結果
を受けて適宜に書き替え設定(204)される。
As is well known to those skilled in the art, the contents of the memory area 102c are appropriately referenced (203) when executing the program. In addition, rewriting and setting (204) are appropriately performed in response to the execution result of the program.

【0045】バックアップ領域102dは、本発明に関
連して新たに設けられたものであり、メモリ領域102
cの内容を1スキャン分だけ保存するための記憶領域で
ある。すなわち、後述するように、このバックアップ領
域102dには、毎スキャンの開始時点で、メモリ領域
102cの内容(すなわち、最新の1スキャン分のプロ
グラム実行開始時の内容)が上書き保存(205)さ
れ、後述する再実行指令(201)が与えられた場合に
は、その保存された内容に基づいて、メモリ領域102
cの内容が復元(206)される。
The backup area 102d is newly provided in connection with the present invention, and includes a memory area 102d.
This is a storage area for storing the contents of c for one scan. That is, as described later, the contents of the memory area 102c (that is, the contents at the start of program execution for the latest one scan) are overwritten and saved (205) in the backup area 102d at the start of each scan. When a re-execution command (201) described later is given, the memory area 102
The content of c is restored (206).

【0046】次に、図2及び図3を参照しながら、ステ
ップ実行処理及びスキャン再実行処理を中心として、第
1実施形態のシミュレーション装置1におけるシーケン
スプログラム実行動作を説明する。
Next, a sequence program execution operation in the simulation apparatus 1 of the first embodiment will be described with reference to FIGS. 2 and 3, focusing on step execution processing and scan re-execution processing.

【0047】このシミュレーション装置にあっては、シ
ーケンスプログラムをパソコン上で1ステップ単位で寸
送り的に模擬実行させることを可能としている。これ
は、次のような一連の処理の実行により実現される。
In this simulation apparatus, the sequence program can be simulated on a personal computer in one-step increments. This is realized by executing the following series of processing.

【0048】図3のフローチャートに示されるように、
スキャン再実行指示がない状態(ステップ304NO)
では、ステップ実行処理(ステップ303)だけが繰り
返し実行される。図4のフローチャートに示されるよう
に、ステップ実行処理では、1ステップ分の実行指示を
受けてリセットされ(ステップ405YES)かつ1ス
テップ分の命令実行完了毎にセット(ステップ403)
されるフラグF1を参照(ステップ401,405)す
ることで、1ステップ単位による寸送り的(ステップ4
04)な命令模擬実行動作(ステップ402)が行われ
る。
As shown in the flowchart of FIG.
No scan re-execution instruction (NO in step 304)
Then, only the step execution process (step 303) is repeatedly executed. As shown in the flowchart of FIG. 4, in the step execution processing, the instruction is reset upon receiving an execution instruction for one step (step 405 YES), and is set every time the execution of the instruction for one step is completed (step 403).
By referring to the flag F1 to be executed (steps 401 and 405), it is possible to perform a step-by-step unit (step 4).
04) Instruction simulation execution operation (step 402) is performed.

【0049】また、このシミュレーション装置にあって
は、毎スキャンの開始時点で、メモリ領域102cの内
容をバックアップ領域102dへと保存する。これは、
つぎのような一連の処理の実行により実現される。
In the simulation apparatus, the contents of the memory area 102c are stored in the backup area 102d at the start of each scan. this is,
This is realized by executing the following series of processes.

【0050】図3のフローチャートに示されるように、
プログラムカウンタの内容を参照してスキャンの先頭で
あると判定されると(ステップ302YES)、そのと
きのメモリ領域102cの内容は、バックアップ領域1
02dへと保存される(ステップ307)。
As shown in the flowchart of FIG.
If it is determined that the start of the scan is made by referring to the contents of the program counter (YES in step 302), the contents of the memory area 102c at that time are stored in the backup area 1
02d (step 307).

【0051】また、所定の操作(スキャンの再実行指
示)が受付られるのを条件として、メモリ領域102c
の内容を、バックアップ領域102dに保存されたスキ
ャン開始時(プログラム実行開始時)の内容に復元する
と共に、シーケンスプログラムの実行アドレスをプログ
ラムの先頭へと強制的に戻すことを可能としている。こ
れは、次のような一連の処理の実行により実現される。
Further, on condition that a predetermined operation (scan re-execution instruction) is accepted, the memory area 102c
Is restored to the content at the start of scanning (at the start of program execution) stored in the backup area 102d, and the execution address of the sequence program can be forcibly returned to the beginning of the program. This is realized by executing the following series of processing.

【0052】図3のフローチャートに示されるように、
ステップモードの実行中に、スキャン再実行指示(図2
の201)が与えられると(ステップ304YES)、
バックアップ領域102dからメモリ領域102cへの
復元処理が行われ(ステップ305)、同時に、プログ
ラムの実行アドレスを管理するプログラムカウンタの値
は先頭値に戻される(ステップ306)。
As shown in the flowchart of FIG.
During the execution of the step mode, a scan re-execution instruction (FIG. 2)
Is given (step 304 YES),
The restoration process from the backup area 102d to the memory area 102c is performed (step 305), and at the same time, the value of the program counter that manages the execution address of the program is returned to the head value (step 306).

【0053】そのため、この実施形態によれば、デバッ
グの過程で入出力デバイスの値を変更した場合、その変
更箇所を作業者が記録若しくは記憶しておかずとも、ス
キャン再実行指示を与えるだけで、スキャン開始時の入
出力デバイスの状態に直ちに復元することができ、同一
の内部条件でシーケンスプログラムのスキャンを繰り返
すことが可能となるほか、状態の確認やデバッグ後の確
認のための作業工数を軽減することが可能になり、人手
を介することなくスキャン実行前の状態に戻せるため、
作業ミスによるデバッグ効率の低下を防ぐことができ
る、等の格別の作用効果が得られる。
Therefore, according to this embodiment, when the value of the input / output device is changed in the process of debugging, the operator does not need to record or store the changed portion, but only gives a scan re-execution instruction. Immediately restores the state of the input / output devices at the start of the scan, which makes it possible to repeat the scan of the sequence program under the same internal conditions, and reduces the number of man-hours required to check the state and check after debugging It is possible to return to the state before scanning without human intervention,
Particularly advantageous effects such as a reduction in debugging efficiency due to a work error can be obtained.

【0054】本発明に係るシーケンスプログラムのシミ
ュレーション装置の第2実施形態が図5〜図8に示され
ている。なお、図5はシーケンスプログラムのシミュレ
ーション装置の機能ブロック図、図6はシーケンスプロ
グラム実行処理のフローチャート、図7は履歴からのメ
モリ領域復元処理のフローチャート、図8は履歴の内容
を説明するための概念図である。
A second embodiment of the sequence program simulation apparatus according to the present invention is shown in FIGS. 5 is a functional block diagram of a sequence program simulation apparatus, FIG. 6 is a flowchart of a sequence program execution process, FIG. 7 is a flowchart of a memory area restoration process from a history, and FIG. 8 is a concept for explaining the contents of the history. FIG.

【0055】図2に示されるように、この実施形態のシ
ミュレーション装置にあっても、第1実施形態の場合と
同様に、デバッガ101と、実行管理部102aと、プ
ログラム実行部102bと、メモリ領域102cと、バ
ックアップ領域102dとを有する。これらの機能要素
の詳細については、第1実施例の該当項目の説明を参照
されたい。
As shown in FIG. 2, even in the simulation apparatus of this embodiment, a debugger 101, an execution management unit 102a, a program execution unit 102b, a memory area 102c and a backup area 102d. For details of these functional elements, refer to the description of the corresponding items in the first embodiment.

【0056】新たな機能要素であるバックアップ領域の
履歴103は、バックアップ領域102dの内容の複数
スキャン回数分の履歴に相当する。このバックアップ領
域の履歴103は、必要により、例えばパソコン10上
の主メモリ或いは補助メモリ上に格納される。
The backup area history 103, which is a new functional element, corresponds to the history of the contents of the backup area 102d for a plurality of scans. The history 103 of the backup area is stored in, for example, the main memory or the auxiliary memory of the personal computer 10 as needed.

【0057】また、図5に示される再実行指示(10
1)には、復元を希望するメモリ領域のスキャン回若し
くは入出力条件を指定することが可能となっている。す
なわち、『第n回目のスキャンにおけるスキャン開始時
のメモリ領域』或いは『入出力デバイスが特定状態に変
化したときのスキャン回のメモリ領域』と言った具合の
指定が所定のコマンド言語で可能となされている。
The re-execution instruction (10
In 1), the number of scans or input / output conditions of the memory area desired to be restored can be specified. That is, designation of a condition such as "memory area at the start of scanning in the n-th scan" or "memory area at the time of scanning when the input / output device changes to a specific state" can be performed in a predetermined command language. ing.

【0058】次に、図6〜図8を参照しながら、ステッ
プ実行処理及びスキャン再実行処理を中心として、第2
実施形態のシミュレーション装置1におけるシーケンス
プログラム実行動作を説明する。
Next, referring to FIG. 6 to FIG. 8, the second step will be described focusing on the step execution processing and the scan re-execution processing.
A sequence program execution operation in the simulation apparatus 1 according to the embodiment will be described.

【0059】このシミュレーション装置にあっても、シ
ーケンスプログラムをパソコン上で1ステップ単位で寸
送り的に模擬実行させることを可能としている。これ
は、次のような一連の処理の実行により実現される。
Even in this simulation apparatus, it is possible to simulate and execute a sequence program on a personal computer in one-step units. This is realized by executing the following series of processing.

【0060】図6のフローチャートに示されるように、
スキャン再実行指示がない状態(ステップ606NO)
では、ステップ実行処理(ステップ605)だけが繰り
返し実行される。ステップ実行処理の内容は先に図4を
参照して説明したものと同様であるので、重複説明は回
避するまた、このシミュレーション装置にあっては、毎
スキャンの開始時点で、メモリ領域102cの内容をバ
ックアップ領域102dへと保存すと共に、これと同時
にバックアップ領域の履歴103を作成している。
As shown in the flowchart of FIG.
No scan re-execution instruction (NO in step 606)
Then, only the step execution processing (step 605) is repeatedly executed. Since the contents of the step execution processing are the same as those described above with reference to FIG. 4, redundant description is avoided. Also, in this simulation apparatus, the contents of the memory area 102 c are Is stored in the backup area 102d, and at the same time, a history 103 of the backup area is created.

【0061】図6のフローチャートに示されるように、
プログラムカウンタの内容を参照してスキャンの先頭で
あると判定されると(ステップ602YES)、そのと
きのメモリ領域102cの内容は、バックアップ領域1
02dへと保存される(ステップ603)。続いて、そ
れまでのバックアップ領域102dの内容は履歴103
へと追加保存される(ステップ604)。
As shown in the flowchart of FIG.
If it is determined that the start of the scan is made by referring to the contents of the program counter (YES in step 602), the contents of the memory area 102c at that time are stored in the backup area 1
02d (step 603). Subsequently, the contents of the backup area 102d up to that time are stored in the history 103.
Is additionally stored (step 604).

【0062】また、所定の操作(スキャンの再実行指
示)が受付られるのを条件として、メモリ領域102c
の内容を、バックアップ領域の履歴103に保存された
バックアップ領域の内容から選択された内容に復元する
と共に、シーケンスプログラムの実行アドレスをプログ
ラムの先頭へと強制的に戻すことを可能としている。こ
れは、次のような一連の処理の実行により実現される。
The memory area 102c is provided on condition that a predetermined operation (scan re-execution instruction) is accepted.
Is restored from the contents of the backup area stored in the history 103 of the backup area to the selected contents, and the execution address of the sequence program can be forcibly returned to the beginning of the program. This is realized by executing the following series of processing.

【0063】図6のフローチャートに示されるように、
ステップモードの実行中に、スキャン再実行指示(図2
の201)が与えられると(ステップ606YES)、
図7に示される所定のアルゴリズムに従ってバックアッ
プ領域の履歴103からメモリ領域102cへのデータ
復元処理が行われ(ステップ607)、同時に、プログ
ラムの実行アドレスを管理するプログラムカウンタの値
は先頭値に戻される(ステップ608)。
As shown in the flowchart of FIG.
During the execution of the step mode, a scan re-execution instruction (FIG. 2)
Is given (step 606 YES),
Data restoration processing from the backup area history 103 to the memory area 102c is performed according to the predetermined algorithm shown in FIG. 7 (step 607), and at the same time, the value of the program counter managing the execution address of the program is returned to the head value. (Step 608).

【0064】履歴からのメモリ領域復元処理の詳細が図
7のフローチャートに示されている。同図において、ス
テップ701では、その再実行指令において復元対象と
なるメモリ領域が、『指定スキャン時』又は『条件成立
時』のいずれのものであるかの判定が行われる。ここ
で、『指定スキャン時』とは、スキャン回により復元さ
れるべきメモリ領域を指定した場合のことである。ま
た、『条件成立時』とは、特定の入出力の状態により復
元されるべきメモリ領域を指定した場合である。
The details of the process of restoring the memory area from the history are shown in the flowchart of FIG. In the figure, in step 701, it is determined whether the memory area to be restored in the re-execution instruction is “when the designated scan” or “when the condition is satisfied”. Here, “at the time of the designated scan” means a case where a memory area to be restored by the scan is designated. Further, "when the condition is satisfied" means that a memory area to be restored according to a specific input / output state is specified.

【0065】図8に示されるように、バックアップ領域
の履歴103としては、例えば、n個のメモリ内容(メ
モリ領域102cの内容)MD0〜MDnが含まれてい
る。その内、例えば、3つ前のスキャン時のメモリ領域
と言った指定が行われると、それに対応してメモり内容
MD3が復元される。また、各メモリ内容MD0〜MD
nには入力データ領域、出力データ領域、制御データ領
域(カウンタ、タイマ等)が含まれている。そこで、特
定の入出力が特定のオンオフパターンとなったときと言
った指定を行うと、そのようなオンオフパターンが検索
されて、その条件に合致したスキャン時点のメモリ内容
が復元されるのである。
As shown in FIG. 8, the backup area history 103 includes, for example, n pieces of memory contents (contents of the memory area 102c) MD0 to MDn. When the designation of, for example, the memory area at the time of the previous scan is performed, the memory content MD3 is restored correspondingly. In addition, each memory contents MD0 to MD
n includes an input data area, an output data area, and a control data area (counter, timer, etc.). Therefore, when a specific input / output is designated as a specific on / off pattern, such an on / off pattern is searched, and the memory content at the time of scanning that meets the condition is restored.

【0066】すなわち、ステップ701において、『条
件成立時』と判定されると、入出力条件成立のスキャン
時データが探索され(ステップ703)、探索されたス
キャン時のメモリ領域が復元される(ステップ70
4)。これに対して、ステップ701において、『指定
スキャン時』と判定されると、当該スキャン時のメモリ
領域が復元される(ステップ702)。
That is, if it is determined in step 701 that “when the condition is satisfied”, the data at the time of scanning satisfying the input / output condition is searched (step 703), and the searched memory area at the time of scanning is restored (step 703). 70
4). On the other hand, if it is determined in step 701 that "at the time of designated scanning", the memory area at the time of the scanning is restored (step 702).

【0067】そのため、この実施形態によれば、デバッ
グの過程で入出力デバイスの値を変更した場合、その変
更箇所を作業者が記録若しくは記憶しておかずとも、ス
キャン再実行指示をスキャン時指定又は入出力条件指定
と共に与えるだけで、該当するスキャン開始時の入出力
デバイスの状態に直ちに復元することができる。そのた
め、第1実施形態のものに比べて、より一層に使い勝手
の良好なシミュレーション装置となる。
Therefore, according to this embodiment, when the value of the input / output device is changed during the debugging process, the scan re-execution instruction can be specified at the time of scanning or the operator does not need to record or store the changed portion. Only by giving it together with the input / output condition designation, the state of the input / output device at the start of the corresponding scan can be immediately restored. For this reason, the simulation device is more convenient than the first embodiment.

【0068】次に、図9〜図11を参照しながら、ステ
ップ実行処理及びステップバック処理を中心として、第
3実施形態のシミュレーション装置1におけるシーケン
スプログラム実行動作を説明する。
Next, a sequence program execution operation in the simulation apparatus 1 of the third embodiment will be described with reference to FIGS. 9 to 11, focusing on step execution processing and step back processing.

【0069】このシミュレーション装置にあっても、シ
ーケンスプログラムをパソコン上で1ステップ単位で寸
送り的に模擬実行させることを可能としている。これ
は、次のような一連の処理の実行により実現される。
Even in this simulation apparatus, it is possible to simulate and execute a sequence program in one-step units on a personal computer. This is realized by executing the following series of processing.

【0070】図9のフローチャートに示されるように、
スキャン再実行指示がない状態(ステップ905NO)
では、ステップバック機能付ステップ実行処理(ステッ
プ904)だけが繰り返し実行される。
As shown in the flowchart of FIG.
No scan re-execution instruction (NO in step 905)
Then, only the step execution processing with step back function (step 904) is repeatedly executed.

【0071】このとき、図10のフローチャートに示さ
れるように、ステップバック機能付ステップ実行処理で
は、ステップバックモードを示すフラグF2がリセット
されているため(ステップ1001NO)、第1実施形
態と同様にして、ステップ実行処理(ステップ1002
〜1007)だけが実行される。
At this time, as shown in the flowchart of FIG. 10, in the step execution process with the step-back function, the flag F2 indicating the step-back mode is reset (NO in step 1001). Step execution processing (step 1002)
-1007) are performed.

【0072】また、このシミュレーション装置にあって
も、毎スキャンの開始時点で、メモリ領域102cの内
容をバックアップ領域102dへと保存する。これは、
つぎのような一連の処理の実行により実現される。
Further, even in this simulation apparatus, at the start of each scan, the contents of the memory area 102c are stored in the backup area 102d. this is,
This is realized by executing the following series of processes.

【0073】図9のフローチャートに示されるように、
プログラムカウンタの内容を参照してスキャンの先頭で
あると判定されると(ステップ902YES)、そのと
きのメモリ領域102cの内容は、バックアップ領域1
02dへと保存される(ステップ903)。
As shown in the flowchart of FIG.
If it is determined that the start of the scan is made by referring to the contents of the program counter (YES in step 902), the contents of the memory area 102c at that time are stored in the backup area 1
02d (step 903).

【0074】また、所定の操作(スキャンの再実行指
示)が受付られるのを条件として、メモリ領域102c
の内容を、バックアップ領域102dに保存されたスキ
ャン開始時(プログラム実行開始時)の内容に復元する
と共に、シーケンスプログラムの実行アドレスをプログ
ラムの先頭へと強制的に戻すことを可能としている。こ
れは、次のような一連の処理の実行により実現される。
Further, on condition that a predetermined operation (scan re-execution instruction) is accepted, the memory area 102c
Is restored to the content at the start of scanning (at the start of program execution) stored in the backup area 102d, and the execution address of the sequence program can be forcibly returned to the beginning of the program. This is realized by executing the following series of processing.

【0075】図9のフローチャートに示されるように、
ステップモードの実行中に、スキャン再実行指示(図2
の201)が与えられると(ステップ905YES)、
バックアップ領域102dからメモリ領域102cへの
復元処理が行われ(ステップ906)、同時に、プログ
ラムの実行アドレスを管理するプログラムカウンタの値
は先頭値に戻される(ステップ907)。
As shown in the flowchart of FIG.
During the execution of the step mode, a scan re-execution instruction (FIG. 2)
Is given (step 905 YES),
The restoration process from the backup area 102d to the memory area 102c is performed (step 906), and at the same time, the value of the program counter managing the execution address of the program is returned to the head value (step 907).

【0076】さらに、ステップバック指示が与えられた
場合には、所定の操作が受付られるのを条件として、メ
モリ領域102cの内容を、バックアップ領域102d
に保存された内容に復元すると共に、シーケンスプログ
ラムの実行アドレスをプログラムの先頭へと強制的に戻
し、以後、前記所定操作が受け付けられた時点のステッ
プの1ステップ手前まで、シーケンスプログラムを強制
的に連続実行させる処理が実行される。これは、次ぎよ
うな一連の処理の実行により実現される。
Further, when a step back instruction is given, the contents of the memory area 102c are stored in the backup area 102d on the condition that a predetermined operation is accepted.
And the execution address of the sequence program is forcibly returned to the beginning of the program. Thereafter, the sequence program is forcibly restored until one step before the step at which the predetermined operation is received. A process for continuous execution is executed. This is realized by executing the following series of processing.

【0077】図10のフローチャートに示されるよう
に、ステップモードの実行中にステップバック指示が与
えられると(ステップ1008YES)、先程説明した
ステップバックモードフラグF2がセットされる(ステ
ップ1009)。すると、ステップ1001における判
定結果はYESとなる。そのため、1ステップ分の命令
実行処理(ステップ1010)とプログラム実行アドレ
スの歩進処理(ステップ1011)とが繰り返し実行さ
れる。そして、プログラム実行アドレスがステップバッ
ク指示が与えられたステップよりも一つ前の値まで達す
ると(ステップ1012YES)、ステップバックモー
ドフラグF2はリセットされて(ステップ1013)、
ステップバック動作は完了する。
As shown in the flowchart of FIG. 10, when a step back instruction is given during execution of the step mode (step 1008 YES), the step back mode flag F2 described above is set (step 1009). Then, the determination result in step 1001 is YES. Therefore, the instruction execution process for one step (step 1010) and the step execution process of the program execution address (step 1011) are repeatedly executed. When the program execution address reaches a value one step before the step to which the step back instruction is given (step 1012: YES), the step back mode flag F2 is reset (step 1013),
The step back operation is completed.

【0078】図11に示されるように、このとき、実際
には、アドレス(8)にてステップバック指示が与えら
れた瞬間に、プログラムの先頭であるアドレス(0)に
戻ってから、順次に各ステップであるアドレス(1)〜
(6)を実行しつつ一つ手前のステップであるアドレス
(7)に到達したのにも拘わらず、一連のステップの実
行は瞬時に完了するため、恰も、1ステップ逆戻りさせ
たものと等価な状態が出現される。従って、このステッ
プバック指示を繰り返すことで、プログラムの実質的な
逆戻りが可能となる。特に、この等価逆戻り方式によれ
ば、各ステップにおける実行途中結果を保存しなくて
も、実質的に逆戻りが可能となる利点がある。
As shown in FIG. 11, at this moment, at the moment when the step-back instruction is given at the address (8), the program returns to the address (0) which is the head of the program, and then sequentially. Address (1) to each step
The execution of a series of steps is completed instantaneously, despite the arrival at the address (7), which is the immediately preceding step, while executing (6). A state appears. Therefore, by repeating this step back instruction, the program can be substantially reversed. In particular, according to the equivalent reversion method, there is an advantage that reversion can be performed substantially without saving the results of the execution in each step.

【0079】そのため、この実施形態によれば、デバッ
グの過程で入出力デバイスの値を変更した場合、その変
更箇所を作業者が記録若しくは記憶しておかずとも、1
ステップずつ命令実行を寸送りに逆戻りさせつつ、最終
的にスキャン開始時の入出力デバイスの状態に復元する
ことができ、これによりこの種のデバッグ作業をより効
率よく実施可能となる。
Therefore, according to this embodiment, when the value of the input / output device is changed in the course of debugging, even if the operator does not record or memorize the changed portion, the value is changed to one.
The instruction execution can be restored to the state of the input / output device at the start of the scan while returning the instruction execution to the step-by-step feed, so that this kind of debugging work can be performed more efficiently.

【0080】[0080]

【発明の効果】以上の説明で明らかなように、この発明
によれば、デバッグの過程で入出力デバイスの値を変更
した場合、その変更箇所を作業者が記録若しくは記憶し
ておかずとも、必要に応じて簡単な操作を行うだけで、
スキャン開始時の入出力デバイスの状態に直ちに復元す
ることができ、これによりこの種のデバッグ作業を効率
よく実施可能となる。
As is apparent from the above description, according to the present invention, when the value of the input / output device is changed in the course of debugging, it is necessary for the operator to not record or store the changed portion. Just perform simple operations according to
It is possible to immediately restore the state of the input / output device at the time of starting the scan, so that this kind of debugging work can be efficiently performed.

【0081】また、この発明によれば、デバッグの過程
で入出力デバイスの値を変更した場合、その変更箇所を
作業者が記録若しくは記憶しておかずとも、スキャン回
を指定して簡単な操作を行うだけで、過去のスキャン回
の中で指定されたスキャン回におけるスキャン開始時の
入出力デバイスの状態に直ちに復元することができ、こ
れによりこの種のデバッグ作業をより効率よく実施可能
となる。
Further, according to the present invention, when the value of an input / output device is changed in the course of debugging, a simple operation can be performed by designating the number of scans without the operator recording or storing the changed portion. By simply performing the above, it is possible to immediately restore the state of the input / output device at the time of the start of the scan in the scans designated in the past scans, so that this kind of debugging work can be performed more efficiently.

【0082】また、この発明によれば、デバッグの過程
で入出力デバイスの値を変更した場合、その変更箇所を
作業者が記録若しくは記憶しておかずとも、入出力デバ
イス並びにその状態を指定して簡単な操作を行うだけ
で、過去のスキャン回の中で、入出力デバイスが指定の
値に変化したスキャン回におけるスキャン開始時の入出
力デバイスの状態に直ちに復元することができ、これに
よりこの種のデバッグ作業をより効率よく実施可能とな
る。
Further, according to the present invention, when the value of the input / output device is changed in the debugging process, the input / output device and its state can be specified without the operator recording or storing the changed portion. By simply performing a simple operation, it is possible to immediately restore the state of the input / output device at the start of the scan in which the input / output device has changed to the specified value in the past scans. Debugging work can be performed more efficiently.

【0083】さらに、この発明によれば、デバッグの過
程で入出力デバイスの値を変更した場合、その変更箇所
を作業者が記録若しくは記憶しておかずとも、必要によ
り簡単な操作を行うだけで、1ステップずつ命令実行を
寸送りに逆戻りさせつつ、最終的にスキャン開始時の入
出力デバイスの状態に復元することができ、これにより
この種のデバッグ作業をより効率よく実施可能となる。
Further, according to the present invention, when the value of the input / output device is changed in the course of debugging, the operator does not need to record or memorize the changed portion, but only needs to perform a simple operation if necessary. The instruction execution can be restored to the state of the input / output device at the start of the scan while returning the instruction execution to the step feed step by step, so that this kind of debugging work can be performed more efficiently.

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

【図1】シーケンスプログラムのシミュレーション装置
の構成図(第1実施形態)である。
FIG. 1 is a configuration diagram (first embodiment) of a simulation device for a sequence program.

【図2】シーケンスプログラムのシミュレーション装置
の機能ブロック図(第1実施形態)である。
FIG. 2 is a functional block diagram of a sequence program simulation device (first embodiment).

【図3】シーケンスプログラム実行処理のフローチャー
ト(第1実施形態)である。
FIG. 3 is a flowchart (first embodiment) of a sequence program execution process.

【図4】ステップ実行処理のフローチャートである。FIG. 4 is a flowchart of a step execution process.

【図5】シーケンスプログラムのシミュレーション装置
の機能ブロック図(第2実施形態)である。
FIG. 5 is a functional block diagram of a sequence program simulation apparatus (second embodiment).

【図6】シーケンスプログラム実行処理のフローチャー
ト(第2実施形態)である。
FIG. 6 is a flowchart (second embodiment) of a sequence program execution process.

【図7】履歴からのメモリ領域復元処理のフローチャー
トである。
FIG. 7 is a flowchart of a memory area restoration process from a history.

【図8】履歴の内容を説明するための概念図である。FIG. 8 is a conceptual diagram for explaining the contents of a history.

【図9】シーケンスプログラム実行処理のフローチャー
ト(第3実施形態)である。
FIG. 9 is a flowchart (third embodiment) of a sequence program execution process.

【図10】ステップバック機能付きステップ実行処理の
フローチャートである。
FIG. 10 is a flowchart of a step execution process with a step back function.

【図11】ステップバック動作の概念図である。FIG. 11 is a conceptual diagram of a step-back operation.

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

1 シミュレーション装置 10 パソコン 101 デバッガ 102 シミュレーションエンジン 102a 実行管理部 102b プログラム実行部 102c メモリ領域 102d バックアップ領域 103 バックアップ領域の履歴 MD0〜MDn メモリ領域の履歴 Reference Signs List 1 simulation apparatus 10 personal computer 101 debugger 102 simulation engine 102a execution management unit 102b program execution unit 102c memory area 102d backup area 103 backup area history MD0-MDn memory area history

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 シーケンスプログラムをパソコン上で実
行及び途中ステップにおける実行停止を可能としたシー
ケンスプログラムのシミュレーション装置であって、 シーケンスプログラムの実行の際の参照対象及び実行結
果による設定対象となるべきデータが格納されるメモリ
領域と、 メモリ領域の内容をバックアップするためのバックアッ
プ領域と、 毎スキャンの開始時点で前記メモリ領域の内容をバック
アップ領域に保存するメモリ内容保存手段と、 所定の操作が受付られるのを条件として、メモリ領域の
内容を、バックアップ領域に保存された内容に復元する
と共に、シーケンスプログラムの実行アドレスをプログ
ラムの先頭へと強制的に戻す初期化手段と、を備え、 それにより、スキャン開始時点に戻って、シーンプログ
ラムの再実行を可能としたシーケンスプログラムのシミ
ュレーション装置。
An apparatus for simulating a sequence program capable of executing a sequence program on a personal computer and stopping execution at an intermediate step, comprising: a data to be referred to when the sequence program is executed and a data to be set based on an execution result. A memory area for storing the contents of the memory area, a backup area for backing up the contents of the memory area, a memory contents storing means for storing the contents of the memory area in the backup area at the start of each scan, and a predetermined operation is received. Initialization means for restoring the contents of the memory area to the contents stored in the backup area, and forcibly returning the execution address of the sequence program to the beginning of the program. Return to the starting point and restart the scene program. Simulation apparatus of the sequence program which enables the line.
【請求項2】 バックアップ領域の内容の複数スキャン
回数分の履歴を保存する手段を有し、かつ初期化手段
が、メモリ領域の内容を、バックアップ領域の履歴の中
から指定されたスキャン回の内容に復元すると共に、シ
ーケンスプログラムの実行アドレスをプログラムの先頭
へと強制的に戻すものである、 請求項1に記載のシーケンスプログラムのシミュレーシ
ョン装置。
2. The apparatus according to claim 1, further comprising means for storing a history of the contents of the backup area for a plurality of scans, and wherein the initialization means stores the contents of the memory area in the history of the backup area for the number of scans specified from the history of the backup area. 2. The sequence program simulation apparatus according to claim 1, wherein the sequence program execution address is restored and the execution address of the sequence program is forcibly returned to the beginning of the program.
【請求項3】 バックアップ領域の内容の複数スキャン
回数分の履歴を保存する手段を有し、かつ初期化手段
が、メモリ領域の内容を、バックアップ領域の履歴の中
から指定された入出力条件が成立したスキャン回の内容
に復元すると共に、シーケンスプログラムの実行アドレ
スをプログラムの先頭へと強制的に戻すものである、 請求項1に記載のシーケンスプログラムのシミュレーシ
ョン装置。
And means for storing a history of the contents of the backup area for a plurality of scans, and wherein the initialization means stores the contents of the memory area in accordance with an input / output condition designated from the history of the backup area. 2. The sequence program simulation device according to claim 1, wherein the sequence program execution device restores the contents of the established scan times and forcibly returns the execution address of the sequence program to the beginning of the program.
【請求項4】 シーケンスプログラムをパソコン上で実
行及び途中ステップにおける実行停止を可能としたシー
ケンスプログラムのシミュレーション装置であって、 シーケンスプログラムの実行の際に参照及び設定される
べきデータが格納されるメモリ領域と、 メモリ領域の内容をバックアップするためのバックアッ
プ領域と、 毎スキャンの開始時点で前記メモリ領域の内容をバック
アップ領域に保存するメモリ内容保存手段と、 所定の操作が受付られるのを条件として、メモリ領域の
内容を、バックアップ領域に保存された内容に復元する
と共に、シーケンスプログラムの実行アドレスをプログ
ラムの先頭へと強制的に戻し、以後、前記所定操作が受
け付けられた時点のステップの1ステップ手前まで、シ
ーケンスプログラムを強制的に連続実行させる再実行手
段と、を備え、 それにより、シーンプログラムの実行を1ステップ分逆
戻りさせた状態と等価な状態を再現可能としたシーケン
スプログラムのシミュレーション装置。
4. A simulation apparatus for a sequence program, which is capable of executing a sequence program on a personal computer and stopping the execution in an intermediate step, wherein the memory stores data to be referred to and set when the sequence program is executed. An area, a backup area for backing up the content of the memory area, a memory content saving means for saving the content of the memory area in the backup area at the start of each scan, and on the condition that a predetermined operation is received, The contents of the memory area are restored to the contents stored in the backup area, and the execution address of the sequence program is forcibly returned to the beginning of the program. Thereafter, one step before the step when the predetermined operation is received, Until the sequence program And a re-execution means for connection executed, whereby the simulation apparatus of the sequence program and reproducible conditions equivalent to a state of being back one step execution scene program.
【請求項5】 シーケンスプログラムをパソコン上で実
行及び途中ステップにおける実行停止を可能としたシー
ケンスプログラムのシミュレーション装置を実現するた
めのコンピュータプログラムを格納した記録媒体であっ
て、 シーケンスプログラムの実行の際の参照対象及び実行結
果による設定対象となるべきデータが格納されるメモリ
領域を定義する手段と、 メモリ領域の内容をバックアップするためのバックアッ
プ領域を定義するための手段と、 毎スキャンの開始時点で前記メモリ領域の内容をバック
アップ領域に保存するメモリ内容保存手段と、 所定の操作が受付られるのを条件として、メモリ領域の
内容を、バックアップ領域に保存された内容に復元する
と共に、シーケンスプログラムの実行アドレスをプログ
ラムの先頭へと強制的に戻す初期化手段と、 を備える記録媒体。
5. A recording medium for storing a computer program for realizing a sequence program simulation apparatus capable of executing a sequence program on a personal computer and stopping the execution of the sequence program in an intermediate step. Means for defining a memory area in which data to be set based on a reference object and an execution result is stored; means for defining a backup area for backing up the contents of the memory area; and A memory content storage means for storing the contents of the memory area in the backup area; and, on condition that a predetermined operation is received, restoring the contents of the memory area to the contents stored in the backup area, and an execution address of the sequence program. To the beginning of the program Recording medium comprising an initialization means, a return to manner.
JP2000018065A 2000-01-25 2000-01-25 Sequence program simulation device Expired - Lifetime JP3876959B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000018065A JP3876959B2 (en) 2000-01-25 2000-01-25 Sequence program simulation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000018065A JP3876959B2 (en) 2000-01-25 2000-01-25 Sequence program simulation device

Publications (2)

Publication Number Publication Date
JP2001209412A true JP2001209412A (en) 2001-08-03
JP3876959B2 JP3876959B2 (en) 2007-02-07

Family

ID=18544964

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000018065A Expired - Lifetime JP3876959B2 (en) 2000-01-25 2000-01-25 Sequence program simulation device

Country Status (1)

Country Link
JP (1) JP3876959B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7243260B2 (en) 2002-12-27 2007-07-10 Omron Corporation Programmable controller unit and method of automatically restoring memory
WO2013136931A1 (en) * 2012-03-15 2013-09-19 オムロン株式会社 Plc simulation system, plc simulator, recording medium, and simulation method
WO2022249713A1 (en) * 2021-05-27 2022-12-01 オムロン株式会社 Control system, system program, and debugging method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7243260B2 (en) 2002-12-27 2007-07-10 Omron Corporation Programmable controller unit and method of automatically restoring memory
WO2013136931A1 (en) * 2012-03-15 2013-09-19 オムロン株式会社 Plc simulation system, plc simulator, recording medium, and simulation method
JP2013191151A (en) * 2012-03-15 2013-09-26 Omron Corp Plc simulation system, plc simulator, control program, and recording medium
US9317397B2 (en) 2012-03-15 2016-04-19 Omron Corporation Programmable logic controller (PLC) simulation system, PLC simulator, recording medium, and simulation method
WO2022249713A1 (en) * 2021-05-27 2022-12-01 オムロン株式会社 Control system, system program, and debugging method
JP7589645B2 (en) 2021-05-27 2024-11-26 オムロン株式会社 CONTROL SYSTEM, SYSTEM PROGRAM, AND DEBUG METHOD

Also Published As

Publication number Publication date
JP3876959B2 (en) 2007-02-07

Similar Documents

Publication Publication Date Title
WO2013136918A1 (en) Information processing apparatus, simulation method, and program
US20220326673A1 (en) Support device and storage medium
JPH05341819A (en) Method and device for debugging of sfc program
JP4811678B2 (en) PLC simulator apparatus, simulation program, and recording medium on which the program is recorded
JP2001209412A (en) Simulator for sequence program
JPH06242819A (en) Signal state control system for programmable controller
JP2000293210A (en) Developing environment device for control program, controller executing control program, and recording medium for program actualizing them
JP4192380B2 (en) PLC simulator apparatus, simulation program, and recording medium on which the program is recorded
JP4542494B2 (en) Programmable display device, debugging support program, and debugging device control method
JPH0410081B2 (en)
JP3443184B2 (en) Programmer for programmable controller
JPH10177590A (en) Debugging device and method for logic circuit model
JPH06214854A (en) Information processing equipment
JPH10124119A (en) Sequence program editing method
JPH10187212A (en) Programmable controller
JPH11110005A (en) Process simulator for distributed control system
JPH01217650A (en) Test executing system for software simulator
JPH07168609A (en) Sequence program debugging method
WO2024084602A1 (en) Simulation program, simulation method, and simulation device
JPH06295295A (en) Simulator
JPH04191906A (en) User program execution control system for programmable controller
JPH0772918A (en) Numerical control device
JP2005301334A (en) Motion controller
JPH05233332A (en) Schedule correcting system
JPH0520001A (en) User interface device and user interface method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040223

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060323

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060502

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060703

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060726

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060915

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20061011

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061024

R150 Certificate of patent or registration of utility model

Ref document number: 3876959

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101110

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101110

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111110

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121110

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121110

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131110

Year of fee payment: 7

EXPY Cancellation because of completion of term