JPH01169504A - Programmable controller - Google Patents
Programmable controllerInfo
- Publication number
- JPH01169504A JPH01169504A JP32529987A JP32529987A JPH01169504A JP H01169504 A JPH01169504 A JP H01169504A JP 32529987 A JP32529987 A JP 32529987A JP 32529987 A JP32529987 A JP 32529987A JP H01169504 A JPH01169504 A JP H01169504A
- Authority
- JP
- Japan
- Prior art keywords
- program
- execution
- instruction
- stopped
- circuit
- 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
Links
- 238000000034 method Methods 0.000 description 17
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 3
- 235000017166 Bambusa arundinacea Nutrition 0.000 description 1
- 235000017491 Bambusa tulda Nutrition 0.000 description 1
- 241001330002 Bambuseae Species 0.000 description 1
- 101001106432 Homo sapiens Rod outer segment membrane protein 1 Proteins 0.000 description 1
- 235000015334 Phyllostachys viridis Nutrition 0.000 description 1
- 102100021424 Rod outer segment membrane protein 1 Human genes 0.000 description 1
- 239000011425 bamboo Substances 0.000 description 1
Landscapes
- Programmable Controllers (AREA)
Abstract
Description
【発明の詳細な説明】
[産業上の利用分野]
本発明はプログラマブルコントローラ(以下、PCと称
す)に関し、詳しくはPCプログラムの継続実行処理に
関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a programmable controller (hereinafter referred to as a PC), and specifically relates to continuous execution processing of a PC program.
[従来の技術]
従来、作成されたユーザープログラムの機能確認やPC
の動作状態を知るために、ユーザープログラムのテスト
実行を行なうことが知られている。このような場合、プ
ログラムのデパック等の必要が生じ、プログラム実行を
途中で停止したり、あるいは途中から再開したりする継
続実行処理を行なうことがある。[Conventional technology] Conventionally, functions of created user programs and PC
It is known to perform test execution of a user program in order to know the operating state of the program. In such a case, it may become necessary to depack the program, and a continuous execution process may be performed in which program execution is stopped midway or restarted from midway.
第4図は上述した継続実行処理の一従来例を示すフロー
チャートである。同図から明らかなように、ステップ5
31において、ユーザープログラムの実行を継続するか
あるいは開始するかを判断し、肯定判断であればステッ
プS32へ進み、プログラムカウンタの示すアドレスの
命令を実行する。FIG. 4 is a flowchart showing a conventional example of the above-described continuous execution process. As is clear from the figure, step 5
In step S31, it is determined whether to continue or start execution of the user program, and if the determination is affirmative, the process advances to step S32, where the instruction at the address indicated by the program counter is executed.
なお、プログラム実行の継続や開始の設定はプログラミ
ング装苦等における人力によって行なわれ、実行を停止
する旨の人力があれはステップ533へ進み、プログラ
ムの実行を停止する。Note that settings for continuing or starting program execution are made manually during programming, etc., and if there is human effort to stop the execution, the process advances to step 533 and the execution of the program is stopped.
[発明が解決しようとする問題点]
しかしながら、プログラム実行を途中で停止し、デパッ
ク等でプログラム変更が行われ、その後プログラムの途
中から実行を開始する場合、プログラムカウンタの示す
アドレスの命令が実行を停止したときの命令と異なるこ
とがある。この結果、ステップ、すなわちラダー図上の
回路の途中から実行が開始されて回路の動作が不確実に
なるという問題点があった。[Problems to be solved by the invention] However, when program execution is stopped midway, the program is changed by depacking, etc., and then execution is started from the middle of the program, the instruction at the address indicated by the program counter is not executed. The command may be different from the one given when the machine was stopped. As a result, there is a problem that execution starts from a step, that is, from the middle of the circuit on the ladder diagram, making the operation of the circuit uncertain.
第5図は上述した問題点を説明するためのラダー図であ
り、詳しくは第5図(A)および([1)はそれぞれプ
ログラム変更前および変更後のユーザープログラムとメ
モリに格納された命令を示す。同図(八)に示すように
、100回路目先頭アドレスの命令、すなわち接点B4
で実行を停止したとする。 ゛その後、プログラム変
更によって5回路目の2つの接点Bl、B2を削除した
場合、プログラム実行を再開してプログラムカウンタの
示すアドレスの命令を実行しようとすると、同図(B)
に示すように100回路目第3アドレスの命令からプ
ログラム実行が再開される。FIG. 5 is a ladder diagram for explaining the above-mentioned problem. In detail, FIG. show. As shown in FIG.
Suppose you stop execution with .゛After that, if the two contacts Bl and B2 of the fifth circuit are deleted by changing the program, when the program execution is restarted and the instruction at the address indicated by the program counter is tried to be executed, the same result as shown in the same figure (B)
As shown in the figure, program execution is restarted from the instruction at the third address of the 100th circuit.
上述したことから明らかなように、実行を停止した命令
から、実行が再び開始されないという問題点がある。As is clear from the above, there is a problem in that execution is not restarted from the instruction whose execution has been stopped.
そこで、本発明の目的は上述した従来の問題点を解消し
、ユーザープログラムが変更されても、回路の途中から
ではなく回路の先頭アドレスの命令から実行することが
可能なプログラマブルコントローラを提供することにあ
る。SUMMARY OF THE INVENTION Therefore, an object of the present invention is to solve the above-mentioned conventional problems and provide a programmable controller that can execute instructions from the start address of the circuit, rather than from the middle of the circuit, even if the user program is changed. It is in.
[問題点を解決するための手段]
そのために、本発明ではプログラムの実行が、1群の命
令で構成されるステップを順次実行することによってな
されるプログラマブルコントローラにおいて、プログラ
ムの変更があったことを記憶する変更記jQ手段と、プ
ログラム実行を停止したときのステップ番号を記憶する
ステップ番号記士、0手段と、変更記憶手段かプログラ
ムの変更を記t、0シているとき、停止したときのステ
ップ番号および変更後のプログラムに基づき、停止した
ステップにおける命令の先頭アドレスを算出する先頭ア
ドレス算出手段と、先頭アドレス算出手段の算出結果に
基づき、プログラムカウンタの内容を書き換える書き換
え手段とを具えたことを特徴とする。[Means for Solving the Problems] To this end, the present invention provides a programmable controller in which program execution is performed by sequentially executing steps consisting of a group of instructions, in which a change in the program is detected. A change record jQ means for storing, a step number recorder for storing the step number when the program execution is stopped, a 0 means, and a change memory means for recording the change in the program when the program is stopped. A start address calculation means for calculating the start address of the instruction in the stopped step based on the step number and the program after the change, and a rewriting means for rewriting the contents of the program counter based on the calculation result of the start address calculation means. It is characterized by
[作 用コ
以上の構成によれば、PCにおけるプログラム実行を停
止し、再びプログラム実行を開始する場合、停止した回
路の先頭アドレスの命令から実行が開始される。[Operation] According to the above configuration, when program execution on the PC is stopped and program execution is restarted, execution is started from the instruction at the top address of the circuit where the program was stopped.
[実施例]
以下、図面を参照して本発明の実施例を詳細に説明する
。[Example] Hereinafter, an example of the present invention will be described in detail with reference to the drawings.
第1図は本発明の一実施例にかかるPCの構成を示すブ
ロック図である。図において、1はPCのプロセッサで
あり、CPUIA、 ROMIB、 RAMIC等を有
してPCに係る制御を行なう。RO旧Bは第2図にて後
述される処理手順等を格納し、RAMICはユーザープ
ログラムが書込まれる領域や後述される回路カウンタお
よび命令カウンタとして機能するワーク領域を有する。FIG. 1 is a block diagram showing the configuration of a PC according to an embodiment of the present invention. In the figure, 1 is a processor of the PC, which includes a CPUIA, ROMIB, RAMIC, etc., and controls the PC. The RO old B stores processing procedures etc. which will be described later in FIG. 2, and the RAMIC has an area where a user program is written and a work area which functions as a circuit counter and an instruction counter which will be described later.
2はプログラミング装置であり、表示部2Aおよびキー
2Bを具え、キー2Bによる人力によって表示部2Aに
表示されるラダー図を作成しながらプログラミングを行
なう。また、プログラミング装置2はPC動作の停止や
始動等の制御をキー2Bの人力によって行う。3は入出
力装置であり、PCに接続される各種機器とプロセッサ
1との間にあってデータの入出力を制御する。Reference numeral 2 denotes a programming device, which includes a display section 2A and keys 2B, and performs programming while creating a ladder diagram displayed on the display section 2A by human power using the keys 2B. Further, the programming device 2 manually controls the stopping and starting of the PC operation using the key 2B. Reference numeral 3 denotes an input/output device, which is located between various devices connected to the PC and the processor 1 and controls data input/output.
第2図(A)および(B)は本発明の一実施例に係る継
続実行処理のフローチャートであり、本処理は作成され
たユーザープログラムの機能確認やPCの動作状態を知
るために起動される処理である。FIGS. 2(A) and 2(B) are flowcharts of continuous execution processing according to an embodiment of the present invention, and this processing is started to check the functions of the created user program and to know the operating status of the PC. It is processing.
第2図(八)において、ステップ51ではユーザープロ
グラムに変更があったか否かをフラグによって判断し、
肯定判断であれば、ステップS2へ進み、回路先頭アド
レス算出処理を行ない、ステップS3では上記算出結果
に基づきプログラムカウンタの書き換えを行ない、上記
フラグを下げた後、ステップS4へ進む。また、ステッ
プ51で否定判断の場合もステップS4へ進む。In FIG. 2 (8), in step 51, it is determined by a flag whether or not there has been a change in the user program;
If the determination is affirmative, the process proceeds to step S2, where circuit start address calculation processing is performed, and in step S3, the program counter is rewritten based on the above calculation result, and after the above flag is lowered, the process proceeds to step S4. Also, if the determination in step 51 is negative, the process proceeds to step S4.
ステップS4では、ユーザープログラムの実行を継続す
るかあるいは開始するかの判断を行なう。In step S4, it is determined whether to continue or start execution of the user program.
すなわち、実行停止の命令が人力されてないか否かの判
断を行ない、肯定判断であれば、ステップS5へ進み、
プログラムカウンタが示すアドレスの命令を実行する。That is, it is determined whether or not the command to stop execution has been manually issued, and if the determination is affirmative, the process proceeds to step S5.
Executes the instruction at the address indicated by the program counter.
ステップS4で否定判断の場合は、ステップS6へ進み
、プログラム実行を停止し、ステップS7で停止した回
路の番号をRAMICに記憶して本処理を終了する。In the case of a negative determination in step S4, the process proceeds to step S6, where the program execution is stopped, and the number of the circuit that was stopped is stored in the RAMIC in step S7, and this process is ended.
第2図(B)は上述した回路先頭アドレス算出処理の詳
細を示すフローチャートであり、また第3図はプログラ
ムカウンタ書き換えの態様を説明するためのラダー図で
ある。FIG. 2(B) is a flowchart showing the details of the circuit start address calculation process described above, and FIG. 3 is a ladder diagram for explaining the aspect of program counter rewriting.
第2図(B)に示す回路先頭アドレス算出処理の詳細を
第3図を参照しながら説明する。まず、ステップS21
で、回路番号を示す回路カウンタおよび命令のアドレス
を示す命令カウンタの内容をそれぞれ1およびOに設定
する。ちなみに、この1は1番目の回路を、0はRAM
ICに格納された命令の最初のアドレスを示す。また、
RAMICに格納された命令のうち各回路の最後の命令
は、最終命令であることを示す所定の情報、例えば所定
ビットの論理が“1″を有している。Details of the circuit start address calculation process shown in FIG. 2(B) will be explained with reference to FIG. 3. First, step S21
Then, the contents of the circuit counter indicating the circuit number and the instruction counter indicating the address of the instruction are set to 1 and O, respectively. By the way, this 1 indicates the first circuit, and 0 indicates the RAM.
Indicates the first address of the instruction stored in the IC. Also,
Among the instructions stored in the RAMIC, the last instruction of each circuit has predetermined information indicating that it is the final instruction, for example, the logic of a predetermined bit is "1".
次に、ステップS22において、回路カウンタの内容が
停止した回路番号と一致するか否かを判断し、否定判断
の場合は、ステップS23へ進み、命令カウンタの示す
アドレスの命令をRAMICから読み出し、ステップS
24で読み出した命令が回路の最終命令か否かを判断す
る。否定判断の場合は命令カウンタの内容を1だけイン
クリメントして、肯定判断の場合は、命令カウンタおよ
び回路カウンタの内容を1だけインクリメントしてそれ
ぞれステップS22へ戻り、ステップ522において、
回路カウンタの内容と停止した回路の番号とが一致する
と本処理を終了する。Next, in step S22, it is determined whether the contents of the circuit counter match the stopped circuit number, and in the case of a negative determination, the process advances to step S23, where the instruction at the address indicated by the instruction counter is read from the RAMIC, and the step S
In step 24, it is determined whether the read instruction is the final instruction of the circuit. If the determination is negative, the contents of the instruction counter are incremented by 1, and if the determination is affirmative, the contents of the instruction counter and the circuit counter are incremented by 1 and the process returns to step S22.In step 522,
If the contents of the circuit counter match the number of the stopped circuit, this process ends.
上述した処理により、例えば第3図に示すようにユーザ
ープログラム変更によって5回路目の2命令が削除され
た場合でも、命令カウンタの内容は、停止したlO0回
路目先頭アドレスを示すことになる。この結果、命令カ
ウンタの内容に基づきプログラムカウンタの内容を書き
換えれば、プログラム実行を再開したとき、停止した回
路の先頭アドレスの命令から実行が行われる。Through the above-described processing, even if the second instruction of the fifth circuit is deleted due to a change in the user program as shown in FIG. 3, the contents of the instruction counter will indicate the starting address of the stopped 100th circuit. As a result, if the contents of the program counter are rewritten based on the contents of the instruction counter, when program execution is restarted, the instruction will be executed starting from the instruction at the top address of the stopped circuit.
[発明の効果]
以上の説明から明らかなように、本発明によれば、PC
におけるプログラム実行を停止し、再びプログラム実行
を開始する場合、停止した回路の先頭アドレスの命令か
ら実行が開始される。[Effects of the Invention] As is clear from the above explanation, according to the present invention, the PC
When program execution is stopped and program execution is started again, execution starts from the instruction at the top address of the stopped circuit.
第1図は本発明の一実施例に係るpcの構成を示すブロ
ック図、
第2図(A)および(B)は本発明の一実施例に係る継
続実行処理を示すフローチャート、第3図は実施例によ
る継続実行の動作例を示すラダー図、
第4図は従来の継続実行処理を示すフローチャート、
第5図は従来の継続実行の動作例を示すラダー図である
。
1・・・プロセッサ、
IA・・・cpu。
1B・・・ROM1
1C・・・RAM。
2・・・プログラミング装置、
2A・・・表示部、
2B・・・キー、
3・・・入出力装置。
突′7と47y1jに−)、−1プろPCの構成乞オ、
すプロ、77図第1V:
実施4列の糸を庫先実竹廻2チ里のフローチャート第2
図(A)
実方池4列n糸Iた実イテ返丁里のフローチャート第2
r(1)
メー\
OコFIG. 1 is a block diagram showing the configuration of a PC according to an embodiment of the present invention, FIGS. 2A and 2B are flowcharts showing continuous execution processing according to an embodiment of the present invention, and FIG. FIG. 4 is a flowchart showing a conventional continuous execution process; FIG. 5 is a ladder diagram showing an example of a conventional continuous execution operation. 1...processor, IA...cpu. 1B...ROM1 1C...RAM. 2... Programming device, 2A... Display unit, 2B... Key, 3... Input/output device. To '7 and 47y1j -), -1 pro PC configuration request,
77 Figure 1V: Flowchart 2 of carrying out the 4th row of threads at the warehouse and the 2nd round of the bamboo shoots
Diagram (A) Flowchart No. 2 of Jiekataike 4 rows n thread I Tamiite Kaechori
r(1) Me\Oko
Claims (1)
を順次実行することによってなされるプログラマブルコ
ントローラにおいて、 プログラムの変更があったことを記憶する変更記憶手段
と、 プログラム実行を停止したときのステップ番号を記憶す
るステップ番号記憶手段と、 前記変更記憶手段がプログラムの変更を記憶していると
き、前記停止したときのステップ番号および変更後のプ
ログラムに基づき、前記停止したステップにおける前記
命令の先頭アドレスを算出する先頭アドレス算出手段と
、 該先頭アドレス算出手段の算出結果に基づき、プログラ
ムカウンタの内容を書き換える書き換え手段と を具えたことを特徴とするプログラマブルコントローラ
。[Claims] In a programmable controller in which a program is executed by sequentially executing steps consisting of a group of instructions, a change storage means for storing a change in the program; step number storage means for storing a step number at the time of the stop; and when the change storage means stores a change in the program, the step number at the time of the stop is determined based on the step number at the time of the stop and the program after the change; A programmable controller comprising: a start address calculation means for calculating the start address of the instruction; and a rewrite means for rewriting the contents of a program counter based on the calculation result of the start address calculation means.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62325299A JPH0719120B2 (en) | 1987-12-24 | 1987-12-24 | Programmable controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62325299A JPH0719120B2 (en) | 1987-12-24 | 1987-12-24 | Programmable controller |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH01169504A true JPH01169504A (en) | 1989-07-04 |
JPH0719120B2 JPH0719120B2 (en) | 1995-03-06 |
Family
ID=18175266
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP62325299A Expired - Fee Related JPH0719120B2 (en) | 1987-12-24 | 1987-12-24 | Programmable controller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0719120B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1997017638A1 (en) * | 1995-11-09 | 1997-05-15 | Fanuc Ltd | Execution control system of sequence program |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS55118158A (en) * | 1979-03-05 | 1980-09-10 | Fuji Electric Co Ltd | Retrial method to malfunction |
JPS6030008U (en) * | 1983-07-30 | 1985-02-28 | 松下電工株式会社 | Sequence control device |
JPS6184705A (en) * | 1984-10-01 | 1986-04-30 | Yaskawa Electric Mfg Co Ltd | User's program modifying method of programmable controller |
JPS61226820A (en) * | 1985-03-30 | 1986-10-08 | Anritsu Corp | Data processing resuming system by power restoration |
-
1987
- 1987-12-24 JP JP62325299A patent/JPH0719120B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS55118158A (en) * | 1979-03-05 | 1980-09-10 | Fuji Electric Co Ltd | Retrial method to malfunction |
JPS6030008U (en) * | 1983-07-30 | 1985-02-28 | 松下電工株式会社 | Sequence control device |
JPS6184705A (en) * | 1984-10-01 | 1986-04-30 | Yaskawa Electric Mfg Co Ltd | User's program modifying method of programmable controller |
JPS61226820A (en) * | 1985-03-30 | 1986-10-08 | Anritsu Corp | Data processing resuming system by power restoration |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1997017638A1 (en) * | 1995-11-09 | 1997-05-15 | Fanuc Ltd | Execution control system of sequence program |
US6290403B1 (en) | 1995-11-09 | 2001-09-18 | Fanuc Ltd | Sequence program execution control system |
Also Published As
Publication number | Publication date |
---|---|
JPH0719120B2 (en) | 1995-03-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH05225076A (en) | Method and device for managing common information | |
JPH01169504A (en) | Programmable controller | |
JPS60136810A (en) | Programmable controller | |
JP3207333B2 (en) | Programmable controller | |
JPS6348698A (en) | Memory storage control device | |
JP3341061B2 (en) | Programmable controller | |
JPS5927303A (en) | Program correcting device | |
JP2762665B2 (en) | Blog programming device for programmable controller | |
JP3024719B2 (en) | Arithmetic processing method of programmable controller | |
JPH01223504A (en) | Sampling trace system for programmable controller | |
JP3560189B2 (en) | How to reflect journal information selectively | |
JPH02196305A (en) | Program editing system for programmable controller | |
JPH03160524A (en) | Information processor | |
JPH11259308A (en) | Programmable controller | |
JPS6041133A (en) | Correcting method of control program | |
JPH03246602A (en) | Programmable controller | |
JPS63177205A (en) | Programming device for programmable controller | |
JPS6076096A (en) | Method and device for write of ep-rom | |
JPS63170703A (en) | Loader command processing device | |
JPS595931B2 (en) | Address stop method for arithmetic processing system | |
JPH08339209A (en) | Display device for programmable controller and display information writing method | |
JPH01236309A (en) | Display device for numerical controller | |
JPH04332003A (en) | Programmable controller | |
JPH0566934A (en) | Programming device for programmable controller | |
JPH02194447A (en) | Debugging control system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |