JP4811678B2 - PLC simulator apparatus, simulation program, and recording medium on which the program is recorded - Google Patents

PLC simulator apparatus, simulation program, and recording medium on which the program is recorded Download PDF

Info

Publication number
JP4811678B2
JP4811678B2 JP2008034448A JP2008034448A JP4811678B2 JP 4811678 B2 JP4811678 B2 JP 4811678B2 JP 2008034448 A JP2008034448 A JP 2008034448A JP 2008034448 A JP2008034448 A JP 2008034448A JP 4811678 B2 JP4811678 B2 JP 4811678B2
Authority
JP
Japan
Prior art keywords
task
instruction
execution
program
state
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.)
Expired - Lifetime
Application number
JP2008034448A
Other languages
Japanese (ja)
Other versions
JP2008123559A (en
Inventor
裕 阿部
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
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 filed Critical Omron Corp
Priority to JP2008034448A priority Critical patent/JP4811678B2/en
Publication of JP2008123559A publication Critical patent/JP2008123559A/en
Application granted granted Critical
Publication of JP4811678B2 publication Critical patent/JP4811678B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Description

この発明は、タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行や、タスク単位で実行されるPLCプログラムの命令実行をシミュレーションするPLCシミュレータ装置及びシミュレーションするためのプログラムとこれが記録された記録媒体に関する。   The present invention relates to a PLC simulator device for simulating instruction execution of a PLC program that can control the execution state of another task by a task start instruction and a task standby instruction, and instruction execution of a PLC program executed in units of tasks, and for simulation The present invention relates to a program and a recording medium on which the program is recorded.

従来、PLC(プログラマブルロジックコントローラ)のプログラムをデバッグする場合には、例えばパソコン上でプログラムを仮想的に1命令ごと実行させることによってプログラムのシミュレーションを行ない、プログラムのデバッグを行なっていた。   Conventionally, when a PLC (programmable logic controller) program is debugged, the program is simulated by, for example, virtually executing the program on a personal computer one instruction at a time, thereby debugging the program.

ところで、従来、PLCのプログラムは1つの連続したプログラムとして構成されていたが、近年、1つの連続したプログラムをタスクという複数のプログラムに分割してPLCのプログラムを構成する方式が普及してきている。   Conventionally, a PLC program has been configured as a single continuous program. However, in recent years, a method of dividing a single continuous program into a plurality of programs called tasks to form a PLC program has become widespread.

図6はタスクでプログラムを構成する場合の説明図であるが、従来は同図(a)に示す如く、1つの連続したプログラムでPLCプログラム(ユーザプログラム)を構成していたが、タスクを利用したプログラムでは、従来の1つの連続したプログラムを、同図(b)に示す如く、複数のタスク(同図ではタスク1,2,3)に分割してプログラムを構成する。各タスクに割り付けたプログラムは、従来と同じく最後にEND命令をもった1つのプログラムである。   FIG. 6 is an explanatory diagram when a program is composed of tasks. Conventionally, as shown in FIG. 6A, a PLC program (user program) is composed of one continuous program, but the task is used. In this program, one conventional continuous program is divided into a plurality of tasks (tasks 1, 2, and 3 in the figure) as shown in FIG. The program assigned to each task is one program having an END instruction at the end as in the conventional case.

タスクの特徴は、その実行及び非実行(「待機」と呼ぶ)を、他のタスクからの「タスク制御命令」によって任意に制御できることである。図6(b)では、タスク1とタスク3が実行状態で、タスク2は非実行(待機)とされている。   A feature of a task is that its execution and non-execution (referred to as “waiting”) can be arbitrarily controlled by “task control instructions” from other tasks. In FIG. 6B, task 1 and task 3 are in an execution state, and task 2 is not executed (waiting).

従って、いくつかのプログラム部品をタスクとして組み込んでおき(プログラムのモジュール化)、品種や工程などに応じて、あるプログラム(タスク)だけを実行することができる(プログラムの段取り替え)。   Accordingly, some program parts are incorporated as tasks (program modularization), and only a certain program (task) can be executed (program changeover) according to the type or process.

また、必要なときに、必要なプログラムのみを実行させることができるため、性能(サイクルタイム)向上にも貢献する。   In addition, when necessary, only necessary programs can be executed, which contributes to improved performance (cycle time).

また、プログラムのモジュール化が可能なので、デバッグもタスクごとのデバッグが行なえる。   In addition, since the program can be modularized, debugging can be performed for each task.

なお、いったん実行とされたタスクは、次のサイクル以降でも実行される。また、いったん待機とされたタスクは、他のタスクから実行に戻されない限り、次のサイクル以降でも待機のままである。   Note that a task once executed is executed after the next cycle. In addition, a task that has been placed on standby remains on standby even after the next cycle, unless it is returned to execution from another task.

従来のプログラムを実行する場合とタスクを実行する場合の差異を、図7を参照しながら模式的に説明すると、従来は、図7(a)に示す如く、巻物50をはじめから読んでいくイメージなのに対して、タスクは、図7(b)に示す如く、カードを個々に読んでいくイメージである。   The difference between the case of executing the conventional program and the case of executing the task will be described schematically with reference to FIG. 7. Conventionally, as shown in FIG. 7A, an image of reading the scroll 50 from the beginning. On the other hand, the task is an image of reading cards individually as shown in FIG.

すでに述べたように、タスクの場合、各カードは互いに実行、待機を指示でき、待機とされたカードは読み飛ばされる。実行、待機の指示はタスク制御命令にて行なう。図7(b)の場合、タスク1からのタスク制御命令でタスク2を実行可能状態(活性化)とし、タスク3を待機(非活性化)としている。   As described above, in the case of a task, each card can instruct execution and waiting for each other, and the card that has been placed on standby is skipped. Execution and standby instructions are given by task control instructions. In the case of FIG. 7B, the task 2 is made executable (activated) by the task control instruction from the task 1, and the task 3 is put on standby (inactivated).

ところで、タスクにはサイクル実行タスクと割込みタスクがある。   By the way, the task includes a cycle execution task and an interrupt task.

サイクル実行タスクは、1サイクルに1回、タスクの状態が「実行可能状態」なら実行されるタスクである。   The cycle execution task is a task that is executed once in one cycle if the state of the task is “executable state”.

また、割込みタスクは割込み要因が発生すると、サイクル実行タスク実行中でも割り込んで実行されるタスクである。割込みタスクには次の4種類ある。
(1)電断割込みタスク:電源断時に実行
(2)定時割込みタスク:一定時間間隔で実行
(3)I/O割込みタスク:割込み入力ユニットの接点立ち上がりで実行
(4)外部割込みタスク:外部の高機能ユニット等から要求があったとき実行
An interrupt task is a task that is interrupted and executed even when a cycle execution task is executed when an interrupt factor occurs. There are four types of interrupt tasks:
(1) Power interruption interrupt task: Executed when the power is turned off (2) Scheduled interrupt task: Executed at a fixed time interval (3) I / O interrupt task: Executed at the rising edge of the interrupt input unit contact (4) External interrupt task: External Executed when requested by a high-function unit

ここで、このようなタスクより構成されたプログラムをデバッグのためシミュレーションしようとする場合、以下の問題点があった。   Here, when trying to simulate a program composed of such tasks for debugging, there are the following problems.

(1)サイクル実行タスクはシミュレーションできるのでデバッグが行なえるが、割込みタスクは実機と接続されていないのでシミュレーションできず、デバッグが行なえない。 (1) Since the cycle execution task can be simulated, it can be debugged. However, since the interrupt task is not connected to the actual machine, it cannot be simulated and cannot be debugged.

そこで、従来はPLCシステムを構築後、割込み要因を発生させるデバッグ用装置を取り付け、その装置を手動により操作することで行なっていた。   Therefore, conventionally, after a PLC system is constructed, a debugging device for generating an interrupt factor is attached, and the device is manually operated.

しかし、このとき、不具合が発生した場合には、すでにできあがったプログラムの再度の検証が必要となり、後処理が面倒であるという問題点があった。また、別途デバッグ用装置が必要になり、コスト高になるという問題点があった。   However, if a problem occurs at this time, it is necessary to verify the program that has already been completed, and post-processing is troublesome. In addition, a separate debugging device is required, which increases the cost.

(2)また、従来は、タスクの内部状態の変更、すなわち、実行可能状態、待機の変更は、実際にPLCシステムを構築後、PLCに接続されたプログラミングコンソールやパソコン上のアプリケーションを通じて、あるいは上記の如き他のタスクからのタスク制御命令の実行を通じてのみ変更可能であった。 (2) Conventionally, the change of the internal state of the task, that is, the change of the executable state and the standby is actually made through the programming console connected to the PLC or the application on the personal computer after the construction of the PLC system or the above-mentioned It can only be changed through the execution of task control instructions from other tasks such as

従って、タスクの内部状態を変更するデバッグ作業はシステム構築後の工程で行なわれることになり、同じく不具合発生時の後処理が面倒であるという問題点があった。   Therefore, the debugging work for changing the internal state of the task is performed in the process after the system construction, and there is a problem that the post-processing when a problem occurs is troublesome.

(3)また、タスクでプログラムを構成する場合でも、なるべくサイクルタイムを短くしなければならないが、そのための特別の構成がなく、サイクルタイムの短縮化が困難であるという問題点があった。 (3) Even when a program is configured by tasks, the cycle time must be shortened as much as possible. However, there is no special configuration for that purpose, and there is a problem that it is difficult to shorten the cycle time.

本発明は、タスクの実行可能状態及び待機の内部状態の変更やサイクルタイムの短縮化をシミュレーションで行なえるPLCシミュレータ装置及びシミュレーションするためのプログラムとこれが記録された記録媒体を提供することを目的とする。   It is an object of the present invention to provide a PLC simulator device capable of changing a task executable state and a standby internal state and shortening a cycle time by simulation, a program for simulation, and a recording medium on which the program is recorded. To do.

上記目的を達成するために、本発明は、タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行をシミュレーションするPLCシミュレータ装置において、PLCプログラムを構成するタスクの管理を行うタスク管理部と、前記タスク管理部からの命令によってPLCプログラムを実行するメイン処理部と、タスクの内部状態を待機状態と実行可能状態に相互に変更できる内部状態変更手段とを有し、前記内部状態変更手段は、前記命令がタスク起動命令の場合には、前記メイン処理部により指定されたタスクの内部状態を実行可能状態とし、前記内部状態変更手段は、前記命令がタスク待機命令の場合には、前記メイン処理部により指定されたタスクの内部状態を待機状態とすることを特徴とする。
本発明は、タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行と、タスク単位で実行されるPLCプログラムの命令実行とをシミュレーションするPLCシミュレータ装置において、PLCプログラムを構成するタスクの管理を行うタスク管理部と、前記タスク管理部からの命令によってPLCプログラムを実行するメイン処理部と、タスクの内部状態を待機状態と実行可能状態に相互に変更できる内部状態変更手段と、1命令毎に実行条件が成立するか否かを判別する実行条件判別手段と、前記実行条件判別手段で実行条件が成立の場合には、1命令の実行処理時間を読込み、前記実行条件が不成立の場合には、非実行処理時間を読込む1命令処理時間取得手段と、前記1命令処理時間取得手段で読込んだ処理時間を積算して1タスクの処理時間を算出する1タスク処理時間算出手段と、前記1タスク処理時間算出手段で算出された処理時間を記憶する1タスク処理時間記憶手段と、を有し、前記内部状態変更手段は、前記命令がタスク起動命令の場合には、前記メイン処理部により指定されたタスクの内部状態を実行可能状態とし、前記内部状態変更手段は、前記命令がタスク待機命令の場合には、前記メイン処理部により指定されたタスクの内部状態を待機状態とすることを特徴とする。
本発明は、タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行をシミュレーションするプログラムが記録された記録媒体であって、前記記録媒体は、コンピュータを、PLCプログラムを構成するタスクの管理を行うタスク管理手段と、前記タスク管理手段からの命令によってPLCプログラムを実行するメイン処理手段と、前記命令がタスク起動命令の場合には、前記メイン処理手段により指定されたタスクの内部状態を実行可能状態とし、前記命令がタスク待機命令の場合には、前記メイン処理手段により指定されたタスクの内部状態を待機状態とする内部状態変更手段、として機能させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体であることを特徴とする。
本発明は、タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行をシミュレーションするプログラムであって、前記プログラムは、コンピュータを、PLCプログラムを構成するタスクの管理を行うタスク管理手段と、前記タスク管理手段からの命令によってPLCプログラムを実行するメイン処理手段と、前記命令がタスク起動命令の場合には、前記メイン処理手段により指定されたタスクの内部状態を実行可能状態とし、前記命令がタスク待機命令の場合には、前記メイン処理手段により指定されたタスクの内部状態を待機状態とする内部状態変更手段、として機能させるためのプログラムであることを特徴とする。
In order to achieve the above object, the present invention manages a task constituting a PLC program in a PLC simulator device that simulates instruction execution of a PLC program that can control the execution state of another task by a task start instruction and a task standby instruction. A task management unit that performs the above, a main processing unit that executes the PLC program in accordance with an instruction from the task management unit, and an internal state change unit that can mutually change the internal state of the task into a standby state and an executable state, When the instruction is a task activation instruction, the internal state changing means sets the internal state of the task specified by the main processing unit to an executable state, and the internal state changing means determines that the instruction is a task waiting instruction. In this case, the internal state of the task specified by the main processing unit is set to the standby state. To.
The present invention relates to a PLC simulator device for simulating instruction execution of a PLC program capable of controlling the execution state of another task by a task start instruction and a task standby instruction, and instruction execution of a PLC program executed in units of tasks. A task management unit that manages the tasks that constitute the task, a main processing unit that executes a PLC program in response to an instruction from the task management unit, and an internal state change that can mutually change the internal state of the task to a standby state and an executable state Means for determining whether or not an execution condition is satisfied for each instruction, and when the execution condition is satisfied by the execution condition determination means, the execution processing time of one instruction is read and the execution is performed When the condition is not satisfied, the one instruction processing time acquisition means for reading the non-execution processing time and the one instruction processing time One task processing time calculation means for calculating the processing time of one task by accumulating the processing time read by the acquisition means, and one task processing time storage means for storing the processing time calculated by the one task processing time calculation means And when the instruction is a task activation instruction, the internal state change means sets the internal state of the task specified by the main processing unit to an executable state, and the internal state change means When the instruction is a task standby instruction, the internal state of the task designated by the main processing unit is set to the standby state.
The present invention is a recording medium on which a program for simulating instruction execution of a PLC program capable of controlling the execution state of another task by a task start instruction and a task standby instruction is recorded, and the recording medium includes a computer, a PLC program, and the like. A task management means for managing the tasks constituting the program, a main processing means for executing a PLC program in accordance with an instruction from the task management means, and, if the instruction is a task activation instruction, designated by the main processing means A program for causing an internal state of a task to be an executable state and functioning as an internal state changing unit that sets the internal state of the task specified by the main processing unit to a standby state when the instruction is a task standby command. It is a recorded computer-readable recording medium
The present invention is a program for simulating instruction execution of a PLC program that can control the execution state of another task by a task start instruction and a task standby instruction, and the program manages a computer and a task that constitutes the PLC program. Task management means to perform, main processing means for executing a PLC program according to an instruction from the task management means, and when the instruction is a task activation instruction, the internal state of the task specified by the main processing means can be executed When the instruction is a task standby instruction, the program is a program for causing the internal state of the task designated by the main processing means to function as an internal state changing unit.

ここで、PLCプログラムの命令実行をシミュレーションするとは、PLC上で制御対象機器の動作を制御する制御プログラムが設計通り動作するか否か調べるため、パソコン等でPLCプログラムを仮想的に実行することをいう。従って、PLCシミュレータ装置とは、そうして使用されるパソコン等をいう。なお、PLCシミュレータ装置は、PLC、PLCと表示装置の組み合わせ等でも構成できる。   Here, simulating the instruction execution of the PLC program means that the PLC program is virtually executed on a personal computer or the like in order to check whether or not the control program for controlling the operation of the control target device operates on the PLC as designed. Say. Therefore, the PLC simulator device refers to a personal computer or the like used in this manner. Note that the PLC simulator device can be configured by a PLC, a combination of a PLC and a display device, or the like.

ここで、本発明でシミュレーションするPLCプログラムは、サイクル実行タスクと割込みタスクより構成されている。   Here, the PLC program to be simulated in the present invention includes a cycle execution task and an interrupt task.

サイクル実行タスクは、1サイクルに1回、タスクの状態が「実行可能状態」なら実行されるタスクである。   The cycle execution task is a task that is executed once in one cycle if the state of the task is “executable state”.

また、割込みタスクは割込み要因が発生すると、サイクル実行タスク実行中でも割り込んで実行されるタスクである。割込みタスクには次の4種類ある。
(1)電断割込みタスク:電源断時に実行
(2)定時割込みタスク:一定時間間隔で実行
(3)I/O割込みタスク:割込み入力ユニットの接点立ち上がりで実行
(4)外部割込みタスク:外部の高機能ユニット等から要求があったとき実行
An interrupt task is a task that is interrupted and executed even when a cycle execution task is executed when an interrupt factor occurs. There are four types of interrupt tasks:
(1) Power interruption interrupt task: Executed when the power is turned off (2) Scheduled interrupt task: Executed at a fixed time interval (3) I / O interrupt task: Executed at the rising edge of the interrupt input unit contact (4) External interrupt task: External Executed when requested by a high-function unit

ここで、このようなタスクより構成されたプログラムをデバッグのためシミュレーションしようとする場合、サイクル実行タスクはシミュレーションできるのでデバッグが行なえるが、外部の実機から起動される割込みタスクはシミュレーション時、装置は実機と接続されていないのでシミュレーションできず、デバッグが行なえない。   Here, when a program composed of such tasks is to be simulated for debugging, the cycle execution task can be simulated and can be debugged, but the interrupt task started from an external real machine is the simulation, the device Since it is not connected to the actual machine, simulation cannot be performed and debugging cannot be performed.

そこで、本発明では、割込み要因発生手段で特定の割込みタスクを起動するための割込み要因を発生させ、タスク実行手段で上記割込み要因発生手段で指定された割込みタスクを実行するようにしてもよい。   Therefore, in the present invention, an interrupt factor for starting a specific interrupt task may be generated by the interrupt factor generating unit, and the interrupt task specified by the interrupt factor generating unit may be executed by the task executing unit.

特定の割込みタスクを起動するための割込み要因を発生させるとは、実際には電断割込みタスクでは電源断、定時割込みタスクでは一定時間の到来、I/O割込みタスクでは割込み入力ユニットの接点立ち上がり、外部割込みタスクでは外部の高機能ユニット等から要求等であるが、実施形態では、図2に示したメッセージウィンドウ32上のタスク種別表示部32−2に表示されたタスク中のうちいずれかの割込みタスクの指定及びこれに続くポップアップ画面(図示せず)中の「起動」ボタンのクリックに基づくタスク管理部31の割込みタスク起動指示である。   In order to generate an interrupt factor for starting a specific interrupt task, the power interruption is actually performed in the power interruption interrupt task, the fixed time comes in the periodic interruption task, the contact input unit rises in the I / O interruption task, The external interrupt task is a request from an external high-functional unit or the like, but in the embodiment, any interrupt among the tasks displayed in the task type display section 32-2 on the message window 32 shown in FIG. This is an interrupt task start instruction of the task management unit 31 based on the designation of a task and the click of a “start” button in a subsequent pop-up screen (not shown).

また、タスク実行手段で上記割込み要因発生手段で指定された割込みタスクを実行するとは、実施形態では、図3のフローチャートのステップ110〜116の割込みタスク実行処理である。   In addition, the execution of the interrupt task specified by the interrupt factor generation means in the task execution means is the interrupt task execution processing in steps 110 to 116 in the flowchart of FIG.

このように、本発明では、割込みタスクをシミュレーション上で実行でき、PLCシステムを構築前にデバッグを行なうことができる。   Thus, according to the present invention, the interrupt task can be executed on the simulation, and debugging can be performed before the PLC system is constructed.

従って、PLCシステム構築後の、すでにできあがったプログラムの再度の検証等が不要となり、デバッグ効率が向上する。また、デバッグ用装置が不要になり、低コストにデバッグを行なうことができる。   Therefore, it is not necessary to re-verify a program that has already been completed after the PLC system is constructed, and debugging efficiency is improved. Further, a debugging device is not required, and debugging can be performed at a low cost.

また、本発明において、タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御するとは、タスクを使用したプログラムでは、例えば、図7(b)に示す如く、タスク1からのタスク制御命令でタスク2を実行可能状態(活性化)とし、タスク3を待機(非活性化)としていることをいう。   In the present invention, the execution state of another task is controlled by a task start instruction and a task standby instruction. In a program using a task, for example, as shown in FIG. The task 2 is in an executable state (activated) and the task 3 is in a standby state (inactivated).

このように、タスクを使用したプログラムでは、他のタスクからのタスク制御命令によらなければタスク内の実行状態を変更できない。   As described above, in a program using a task, the execution state in the task cannot be changed unless a task control instruction from another task is used.

そこで、本発明では、上記の通り、内部状態変更手段を設けて、タスクの内部状態を待機状態と実行可能状態に相互に変更できるようにした。   Therefore, in the present invention, as described above, the internal state changing means is provided so that the internal state of the task can be changed between the standby state and the executable state.

内部状態変更手段は、実施形態では、図4の処理である。   In the embodiment, the internal state changing means is the process of FIG.

従って、同じく、PLCシステム構築後の、すでにできあがったプログラムの再度の検証等が不要となり、デバッグ効率が向上する。   Accordingly, similarly, it is not necessary to re-verify a program that has already been completed after the PLC system is constructed, and debugging efficiency is improved.

ここで、シミュレーションするためのプログラムが記録された記録媒体は、例えば、フロッピィディスクで構成される。   Here, the recording medium on which the program for simulation is recorded is composed of, for example, a floppy disk.

この記録媒体に記録されたプログラムがパソコン等より構成されるPLCシミュレータ装置に読み取られて実行されると、割込みタスクをシミュレーション上で実行できる。   When the program recorded on the recording medium is read and executed by a PLC simulator device composed of a personal computer or the like, the interrupt task can be executed on the simulation.

本発明では以下の効果を奏する。   The present invention has the following effects.

(1)本発明では、タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行をシミュレーションするPLCシミュレータ装置において、タスクの内部状態を待機状態と実行可能状態に相互に変更できる内部状態変更手段を具備するようにしたので、タスクの内部状態をシミュレーション上で変更できる。 (1) In the present invention, in a PLC simulator device for simulating instruction execution of a PLC program that can control the execution state of another task by a task activation instruction and a task standby instruction, the internal state of the task is changed into a standby state and an executable state. Since the internal state changing means that can be changed to is provided, the internal state of the task can be changed on the simulation.

従って、同じく、PLCシステム構築後の、すでにできあがったプログラムの再度の検証等が不要となり、デバッグ効率が向上する。   Accordingly, similarly, it is not necessary to re-verify a program that has already been completed after the PLC system is constructed, and debugging efficiency is improved.

(2)また、本発明では、タスク単位で実行されるPLCプログラムの命令実行をシミュレーションするPLCシミュレータ装置において、タスク中の1命令毎の実行時または非実行時の処理時間を計測する1命令処理時間計測手段と、上記1命令処理時間計測手段で計測された処理時間を積算して1タスクの処理時間を計測する1タスク処理時間計測手段と、上記1タスク処理時間計測手段で計測された処理時間を記憶する1タスク処理時間記憶手段と、を具備するようにしたので、タスクごとの実行時間等が分かり、例えばプログラムの1サイクルタイムが長い場合等には、そのプログラムを構成する各タスクの実行時間を検証し、1サイクルタイムの短縮化に資することができる。 (2) Further, in the present invention, in a PLC simulator device that simulates instruction execution of a PLC program executed in units of tasks, one instruction processing for measuring a processing time at the time of execution or non-execution of each instruction in a task A time measuring means, a one-task processing time measuring means for measuring the processing time of one task by integrating the processing times measured by the one-command processing time measuring means, and a process measured by the one-task processing time measuring means 1 task processing time storage means for storing time, so that the execution time for each task can be known. For example, when one cycle time of a program is long, each task constituting the program is The execution time can be verified and it can contribute to shortening of one cycle time.

以下、この発明を実施するための最良の形態について、添付した図面を参照しながら詳細に説明する。   The best mode for carrying out the present invention will be described below in detail with reference to the accompanying drawings.

図1は、この発明に係わるPLCシミュレータ装置の概略構成を示すブロック図である。   FIG. 1 is a block diagram showing a schematic configuration of a PLC simulator apparatus according to the present invention.

図1において、PLCシミュレータ装置10はパソコン等より構成され、タスクより構成されるPLCプログラムの命令実行をシミュレーションすることによってプログラムのデバッグを支援するもので、ラダー実行エンジン20とデバッガ30より構成されている。   In FIG. 1, a PLC simulator device 10 is composed of a personal computer or the like, and supports program debugging by simulating instruction execution of a PLC program composed of tasks. The PLC simulator device 10 is composed of a ladder execution engine 20 and a debugger 30. Yes.

ここで、ラダー実行エンジン20は、デバッガ30からの指令によってPLCのプログラムを実行するもので、メイン処理部21、ラダー実行処理部22、周辺処理部23より構成されている。   Here, the ladder execution engine 20 executes a PLC program in response to a command from the debugger 30 and includes a main processing unit 21, a ladder execution processing unit 22, and a peripheral processing unit 23.

ここで、メイン処理部21はデバッガ30からの指示によりプログラムの実行、停止、タスクの切り替え、タスクの内部状態の変更、プログラムの実行時間の積算処理等を行なう。また、ラダー実行処理部22及び周辺処理部23の管理を行なう。   Here, the main processing unit 21 executes program execution, stop, task switching, task internal state change, program execution time integration processing, and the like according to instructions from the debugger 30. Also, the ladder execution processing unit 22 and the peripheral processing unit 23 are managed.

ラダー実行処理部22は、メイン処理部21からの指令によりプログラムを1命令ずつ実行する。   The ladder execution processing unit 22 executes the program one instruction at a time according to a command from the main processing unit 21.

周辺処理部23は、ラダー実行処理部22の非実行時、メイン処理部21からの指令により、図示しない通信機器(例えばPLC)やアプリケーションとの通信処理を行なう。   When the ladder execution processing unit 22 is not executed, the peripheral processing unit 23 performs communication processing with a communication device (for example, PLC) or an application (not shown) according to a command from the main processing unit 21.

デバッガ30は、デバッグのためラダー実行エンジン20に対してプログラムを1命令ずつ実行するよう指示するとともに、本実施形態では特に、ラダー実行エンジン20に対して割込みタスクの起動指示、タスクの内部状態の変更指示、及びタスクの実行時間の管理等が行なえるよう構成され、タスク管理部31とメッセージウィンドウ32を具備している。   The debugger 30 instructs the ladder execution engine 20 to execute the program one instruction at a time for debugging. In this embodiment, in particular, the ladder execution engine 20 instructs the ladder execution engine 20 to start an interrupt task and the internal state of the task. It is configured to be able to perform change instructions, task execution time management, and the like, and includes a task management unit 31 and a message window 32.

ここで、タスク管理部31は、後に詳述する如く、PLCプログラムを構成するタスクの管理を行なうものである。   Here, the task management unit 31 manages the tasks constituting the PLC program, as will be described in detail later.

メッセージウィンドウ32はデバッガ30の行なうプログラムのデバッグを支援するものである。   The message window 32 supports debugging of the program performed by the debugger 30.

ところで、本実施形態は、PLCプログラムのシミュレーションをタスク単位で行なうものであるが、その際、従来できなかったシミュレーション上での割込みタスクの実行、シミュレーション上でのタスクの内部状態の変更、シミュレーション上での各タスクの実行時間の演算を行なう。   By the way, in the present embodiment, the PLC program is simulated in units of tasks. At that time, execution of an interrupt task on the simulation, which has not been possible in the past, change of the internal state of the task on the simulation, The execution time of each task at is calculated.

そこで、本実施形態では、デバッガ30のメッセージウィンドウ32には、図2に示す如きメッセージ画面が表示され、オペレータはこの画面上でマウス等を利用した各種操作を行なうことで上記の如き処理を行なう。   Therefore, in the present embodiment, a message screen as shown in FIG. 2 is displayed in the message window 32 of the debugger 30, and the operator performs the above-described processing by performing various operations using a mouse or the like on this screen. .

なお、請求項でいうシミュレーションするためのプログラムが記録された記録媒体とは、上記の如き処理を行なうプログラムが記録された記録媒体であり、フロッピィディスク等に記録される。   The recording medium on which a program for simulation referred to in the claims is recorded is a recording medium on which a program for performing the above processing is recorded, and is recorded on a floppy disk or the like.

なお、図2において、メッセージウィンドウ32には、タスク表示切替部32−1、タスク種別表示部32−2、タスクNo.表示部32−3、タスク設定表示部32−4、[閉じる]ボタン32−5、メインメニュー表示部32−6、モニタボタン32−7、タスク起動間隔表示部32−8、タスク状態表示部32−9、タスク実行回数表示部32−10、タスク実行時間表示部32−11が設けられている。   In FIG. 2, the message window 32 includes a task display switching unit 32-1, a task type display unit 32-2, a task number. Display section 32-3, task setting display section 32-4, [Close] button 32-5, main menu display section 32-6, monitor button 32-7, task activation interval display section 32-8, task status display section 32 -9, a task execution number display section 32-10, and a task execution time display section 32-11 are provided.

ここで、タスク表示切替部32−1は、この部分をマウスでクリックすることによってタスクの表示を切り替えるものである。   Here, the task display switching unit 32-1 switches the display of the task by clicking on this portion with the mouse.

タスク種別表示部32−2は、タスクの種別を表示するもので、割込みタスクかサイクル実行タスクかの種別が表示される。   The task type display section 32-2 displays the type of task, and displays the type of interrupt task or cycle execution task.

タスクNo.表示部32−3はタスクの番号を表示するものである。   Task No. The display unit 32-3 displays the task number.

タスク設定表示部32−4はタスクの設定状態を表示するもので、割込みタスクの場合は割込みの種別、すなわち、「定時」割込みタスクか、「外部」割込みタスクか、「I/O」割込みタスクか等の種別が表示される。なお、サイクル実行タスクは種別がないので、「サイクル」とのみ表示される。   The task setting display section 32-4 displays the setting state of the task. In the case of an interrupt task, the type of interrupt, that is, a “scheduled” interrupt task, an “external” interrupt task, or an “I / O” interrupt task Or the like type is displayed. Since the cycle execution task has no type, only “cycle” is displayed.

[閉じる]ボタン32−5は、現在の画面を終了させるものである。   The [Close] button 32-5 is used to end the current screen.

メインメニュー表示部32−6は「タスク」とか「ヘルプ」とかのメインメニューが表示されるものである。   The main menu display section 32-6 displays a main menu such as “task” or “help”.

モニタボタン32−7は、タスクの状態をモニタするためのスイッチである。   The monitor button 32-7 is a switch for monitoring the state of the task.

タスク起動間隔表示部32−8は定時割込みタスクの起動間隔を表示するものである。   The task activation interval display section 32-8 displays the activation interval of the scheduled interrupt task.

タスク状態表示部32−9は、サイクル実行タスクの現在の状態を表示するもので、サイクル実行タスクは、未実行状態(INI)、実行可能状態(READY)、実行状態(RUN)、待機状態(WAIT)の4つの状態を遷移するので、いずれの状態かが表示される。   The task state display unit 32-9 displays the current state of the cycle execution task. The cycle execution task includes an unexecuted state (INI), an executable state (READY), an execution state (RUN), and a standby state ( Since the four states of WAIT) are transitioned, which state is displayed.

タスク実行回数表示部32−10は、そのタスクのそれまでの実行回数が表示される。   The task execution number display section 32-10 displays the number of times the task has been executed so far.

タスク実行時間表示部32−11はそのタスクの実行時間が表示される。   The task execution time display section 32-11 displays the execution time of the task.

図3は、シミュレーション上で割込みタスクを実行する場合の処理手順を示すフローチャートである。   FIG. 3 is a flowchart showing a processing procedure when an interrupt task is executed on the simulation.

この処理では、まず、デバッガ30のタスク管理部31よりラダー実行エンジン20のメイン処理部21に対して割込みタスク起動を指示する(ステップ100)。これは、図2に示したメッセージウィンドウ32上でタスク種別表示部32−2に表示されたタスク中のうちいずれかの割込みタスクをマウスでクリックし、このクリックでメッセージウィンドウ32には割込みタスク起動のためのポップアップ画面(図示せず)が出るので、さらにポップアップ画面中の「起動」ボタンをクリックすることにより行なう。   In this process, first, the task management unit 31 of the debugger 30 instructs the main processing unit 21 of the ladder execution engine 20 to start an interrupt task (step 100). This is done by clicking any interrupt task among the tasks displayed in the task type display section 32-2 on the message window 32 shown in FIG. A pop-up screen (not shown) is displayed for the user, and is further performed by clicking the “Start” button in the pop-up screen.

これによって、メイン処理部21は割込み要因を受け取る(ステップ102)。なお、割込み要因とは、実際には電断割込みタスクでは電源断、定時割込みタスクでは一定時間の到来、I/O割込みタスクでは割込み入力ユニットの接点立ち上がり、外部割込みタスクでは外部の高機能ユニット等から要求等であるが、シミュレーション上では、上記の如き、メッセージウィンドウ32上のタスク種別表示部32−2に表示されたタスク中のうちいずれかの割込みタスクの指定及びこれに続くポップアップ画面中の「起動」ボタンのクリックに基づくタスク管理部31の割込みタスク起動指示である。   As a result, the main processing unit 21 receives an interrupt factor (step 102). Note that the interrupt factor is actually a power interruption in a power interruption interrupt task, a fixed time has arrived in a scheduled interrupt task, a contact rise of an interrupt input unit in an I / O interrupt task, an external high-functional unit in an external interrupt task, etc. In the simulation, as described above, one of interrupt tasks among the tasks displayed in the task type display section 32-2 on the message window 32 is specified and a pop-up screen following this is specified. This is an interrupt task activation instruction of the task management unit 31 based on the click of the “activation” button.

こうして、割込み要因を受け取ると、メイン処理部21は割込み要因の受け取りを記憶するが、この記憶は後にステップ108で判断される。   Thus, when receiving the interrupt factor, the main processing unit 21 stores the reception of the interrupt factor, and this storage is determined later in step 108.

次に、メイン処理部21はラダー実行処理部22に対して1命令の実行を依頼する(ステップ104)。これによって、ラダー実行処理部22は1命令を実行する(ステップ106)。   Next, the main processing unit 21 requests the ladder execution processing unit 22 to execute one instruction (step 104). As a result, the ladder execution processing unit 22 executes one instruction (step 106).

次に、ステップ108では割込み要因が発生しているか否かが調べられる。ここでは、ステップ102でメイン処理部21は割込み要因を受け取っているので、割込み要因は発生していると判断される(ステップ108でYES)。従って、ステップ110に進み、メイン処理部21は割込み要因を分析し、該当する割込みタスクへ実行を移す。該当する割込みタスクとは、ステップ102で受け取った割込みタスクである。   Next, in step 108, it is checked whether or not an interrupt factor has occurred. Here, since the main processing unit 21 has received the interrupt factor in step 102, it is determined that the interrupt factor has occurred (YES in step 108). Accordingly, the process proceeds to step 110, where the main processing unit 21 analyzes the interrupt factor and shifts the execution to the corresponding interrupt task. The corresponding interrupt task is the interrupt task received in step 102.

次に、該当する割込みタスクの1命令の実行依頼をメイン処理部21からラダー実行処理部22に対して行なう(ステップ112)。ラダー実行処理部22は1命令を実行する(ステップ114)。   Next, an execution request for one instruction of the corresponding interrupt task is sent from the main processing unit 21 to the ladder execution processing unit 22 (step 112). The ladder execution processing unit 22 executes one instruction (step 114).

次に、割込みタスクの最後のプログラムか否か、すなわちEND命令か否かが調べられ(ステップ116)、プログラムの最後でない場合は(ステップ116でNO)、ステップ112に戻ってさらに1命令を行なうが、プログラムの最後の場合は(ステップ116でYES)、ステップ108に戻って、再度割込み要因が発生しているか否かが調べられる。   Next, it is checked whether or not it is the last program of the interrupt task, that is, whether or not it is an END instruction (step 116). If it is not the end of the program (NO in step 116), the process returns to step 112 to execute one more instruction. However, if it is the last of the program (YES in step 116), the process returns to step 108 and it is checked whether an interrupt factor has occurred again.

ここで、割込み要因が発生している場合は(ステップ108でYES)、再びステップ110に進み、該当する割込みタスクを実行する。なお、この場合の割込み要因の発生は、割込みタスク実行中にさらに割込みタスクの起動があった場合である。   If an interrupt factor has occurred (YES in step 108), the process proceeds to step 110 again to execute the corresponding interrupt task. In this case, an interrupt factor is generated when an interrupt task is further activated during execution of the interrupt task.

また、割込み要因が発生していない場合は(ステップ108でNO)、プログラム(PLCプログラム)の最後か否かが調べられ(ステップ118)、プログラムの最後でない場合は(ステップ118でNO)、ステップ104に進んでさらに1命令を実行する。また、プログラムの最後の場合は(ステップ118でYES)、メイン処理部21は周辺処理部23に対して周辺処理を行なうよう指示する(ステップ120)。そして、再びステップ104の処理を行なう。   If no interrupt factor has occurred (NO in step 108), it is checked whether the program (PLC program) is at the end (step 118). If it is not the end of the program (NO in step 118), step Proceed to 104 to execute one more instruction. In the case of the last program (YES in step 118), the main processing unit 21 instructs the peripheral processing unit 23 to perform peripheral processing (step 120). Then, the process of step 104 is performed again.

以上が、シミュレーション上で割込みタスクを実行する場合の処理手順である。   The above is the processing procedure for executing the interrupt task on the simulation.

なお、以上の説明では、割込み要因の発生方法として、図2に示したメッセージウィンドウ32上でタスク種別表示部32−2に表示されたタスク中のうちいずれかの割込みタスクをマウスでクリックする等して行なうようにしたが、その他、実機を接続して特定のI/Oの入力の変化で割込み要因を発生させるようにすることもできる。   In the above description, as an interrupt factor generation method, one of the interrupt tasks displayed in the task type display section 32-2 on the message window 32 shown in FIG. However, it is also possible to connect an actual machine and generate an interrupt factor by changing the input of a specific I / O.

なお、ステップ108で、割込み要因が発生していると判別された場合は、ステップ110以下の割込みタスクの実行を行ない、割込みタスクの実行中にさらに割込み要因が発生した場合は、再度ステップ110以下の割込みタスクの実行を行なうようにしたが、これは新しく発生した割込み要因は保留とし、現在実行している割込みタスクが終了すると保留した割込みタスクを実行するようにしたものである。つまり、割込みタスクの保留があると、ステップ108では、割込み要因が発生していると判断する。   If it is determined in step 108 that an interrupt factor has occurred, the interrupt task in step 110 and subsequent steps is executed. If an interrupt factor further occurs during execution of the interrupt task, step 110 and subsequent steps are performed again. The interrupt task is executed, but the newly generated interrupt factor is suspended, and the suspended interrupt task is executed when the currently executing interrupt task is completed. That is, if there is an interrupt task pending, it is determined in step 108 that an interrupt factor has occurred.

このように、図3の処理では、図2に示したメッセージウィンドウ32上でタスク種別表示部32−2に表示されたタスク中のうちいずれかの割込みタスクをマウスでクリックする等して特定の割込み要因を発生させ、割込みタスクのシミュレーションを行なうようにしたので、PLCシステムの構築前にシミュレーションによってプログラムのデバッグが行なえ、PLCシステムの構築前に割込みタスクを含めた全てのタスクのデバッグを確実に行なうことができる等の効果を奏する。   As described above, in the process of FIG. 3, a specific interrupted task is clicked out of the tasks displayed in the task type display section 32-2 on the message window 32 shown in FIG. Since the interrupt factor is generated and the interrupt task is simulated, the program can be debugged by the simulation before the PLC system is constructed, and all the tasks including the interrupt task are surely debugged before the PLC system is constructed. There is an effect that it can be performed.

次に、タスクの内部状態を、シミュレーションによって実行可能状態から待機状態に、又は待機状態から実行可能状態に変更する場合の処理手順を図4のフローチャートに基づいて説明する。   Next, a procedure for changing the internal state of a task from an executable state to a standby state or from a standby state to an executable state by simulation will be described with reference to the flowchart of FIG.

このタスクの内部状態変更処理では、まず、デバッガ30のタスク管理部31でタスクの内部状態変更指示を行なう(ステップ130)。次に、この変更指示は待機状態から実行可能状態への変更指示か否かが調べられ(ステップ132)、待機状態から実行可能状態への変更指示の場合は(ステップ132でYES)、ラダー実行エンジン20のメイン処理部21は指定されたタスクの内部状態を実行可能状態にする(ステップ134)。   In this task internal state change process, first, the task management unit 31 of the debugger 30 issues a task internal state change instruction (step 130). Next, it is checked whether or not this change instruction is a change instruction from the standby state to the executable state (step 132). If the change instruction is from the standby state to the executable state (YES in step 132), ladder execution is performed. The main processing unit 21 of the engine 20 sets the internal state of the designated task to an executable state (step 134).

また、変更指示が待機状態から実行可能状態への変更指示でない場合は(ステップ132でNO)、次に、この変更指示は実行可能状態から待機状態への変更指示か否かが調べられ(ステップ136)、実行可能状態から待機状態への変更指示の場合は(ステップ136でYES)、ラダー実行エンジン20のメイン処理部21は指定されたタスクの内部状態を待機状態にする(ステップ138)。   If the change instruction is not an instruction to change from the standby state to the executable state (NO in step 132), it is next checked whether or not this change instruction is an instruction to change from the executable state to the standby state (step 136) In the case of an instruction to change from the executable state to the standby state (YES in step 136), the main processing unit 21 of the ladder execution engine 20 sets the internal state of the designated task to the standby state (step 138).

また、変更指示が実行可能状態から待機状態への変更指示でない場合は(ステップ136でNO)、当処理を終了する。   If the change instruction is not an instruction to change from the executable state to the standby state (NO in step 136), the process ends.

このように、本実施形態では、タスクの内部状態を、シミュレーションによって実行可能状態から待機状態に、又は待機状態から実行可能状態に変更できる。   Thus, in this embodiment, the internal state of a task can be changed from an executable state to a standby state or from a standby state to an executable state by simulation.

従って、タスクの内部状態を変更するデバッグ作業をシステム構築前に行なうことができ、不具合発生を事前に防止できる等の効果を奏する。   Therefore, it is possible to perform a debugging operation for changing the internal state of the task before the system construction, and it is possible to prevent the occurrence of a problem in advance.

次に、シミュレーション上で各タスクの実行時間等の演算を行なう場合の処理手順を図5のフローチャートに基づいて説明する。   Next, a processing procedure in the case of calculating the execution time of each task on the simulation will be described based on the flowchart of FIG.

この処理においては、タスクの実行が開始されると(ステップ150)、1命令のニモニック(コード)読込みを行ない(ステップ152)、実行条件成立か否かが判別される(ステップ154)。これは、1命令について所定の入力条件が成立したか否かが調べられているもので、実行条件不成立の場合は(ステップ154でNO)、非実行処理時間を読込み(ステップ156)、ステップ162に進む。   In this process, when task execution is started (step 150), a mnemonic (code) of one instruction is read (step 152), and it is determined whether or not an execution condition is satisfied (step 154). It is checked whether or not a predetermined input condition is satisfied for one instruction. If the execution condition is not satisfied (NO in step 154), the non-execution processing time is read (step 156). Proceed to

一方、実行条件成立の場合は(ステップ154でYES)、ニモニック処理、すなわち1命令を実行し(ステップ158)、1命令の実行処理時間を読込む(ステップ160)。そして、前回までの処理時間に積算するが(ステップ162)、初めての命令実行の場合は積算しない。   On the other hand, if the execution condition is satisfied (YES in step 154), mnemonic processing, that is, one instruction is executed (step 158), and the execution processing time of one instruction is read (step 160). Then, although integration is performed for the processing time up to the previous time (step 162), the integration is not performed for the first instruction execution.

次に、1タスクの実行が終了したか否かが調べられ(ステップ164)、1タスクの実行が終了しない場合は(ステップ164でNO)、ステップ152に戻り、1タスクの実行を継続するが、1タスクの実行が終了した場合は(ステップ164でYES)、ステップ166に進み、当該1タスクの処理時間を記憶し、タスク数を1インクリメントし(ステップ168)、さらに最後のタスクか否かが調べられる(ステップ170)。   Next, it is checked whether or not the execution of one task is completed (step 164). If the execution of one task is not completed (NO in step 164), the process returns to step 152 and continues to execute one task. When the execution of one task is completed (YES in step 164), the process proceeds to step 166, the processing time of the one task is stored, the number of tasks is incremented by 1 (step 168), and whether or not it is the last task. Are examined (step 170).

ここで、最後のタスクでない場合は(ステップ170でNO)、ステップ152に戻り、1タスクの実行を継続するが、最後のタスクの場合は(ステップ170でYES)、タスクの総実行時間(プログラムの総実行時間)を記憶し(ステップ172)、実行した総タスク数を記憶し(ステップ174)、タスクの実行を終了する(ステップ176)。   If it is not the last task (NO in step 170), the process returns to step 152 and the execution of one task is continued. If it is the last task (YES in step 170), the total execution time of the task (program Is stored (step 172), the total number of tasks executed is stored (step 174), and the task execution is terminated (step 176).

このように、本実施形態では、シミュレーションにおいて、
(1)1つのタスクを構成する1命令ごとの実行時又は非実行時の処理時間を記憶し、
(2)1つのタスクの実行が終了すると各命令の処理時間を積算してその1タスクの処理時間を記憶し、
(3)全てのタスクの実行が終了すると、タスクの総実行時間と、プログラムを構成する総タスク数を記憶
するようにした。
Thus, in this embodiment, in simulation,
(1) Store the processing time at the time of execution or non-execution for each instruction constituting one task,
(2) When the execution of one task is completed, the processing time of each instruction is accumulated and the processing time of the one task is stored.
(3) When all tasks have been executed, the total task execution time and the total number of tasks that make up the program are stored.

このため、タスクごとの実行時間等が分かり、例えばプログラムの1サイクルタイムが長い場合等には、そのプログラムを構成する各タスクの実行時間を検証し、1サイクルタイムの短縮化に資することができる等の効果を奏する。   For this reason, the execution time for each task is known, and when the cycle time of a program is long, for example, the execution time of each task constituting the program can be verified to contribute to shortening of the one cycle time. There are effects such as.

この発明に係わるPLCシミュレータ装置の一実施形態の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of one Embodiment of the PLC simulator apparatus concerning this invention. 図1に示したPLCシミュレータ装置で実行されるPLCプログラムの内容を示す図。The figure which shows the content of the PLC program performed with the PLC simulator apparatus shown in FIG. 図2に示したプログラムが実行された場合のデバッガのメッセージウィンドウにおける表示例を示す図。The figure which shows the example of a display in the message window of a debugger when the program shown in FIG. 2 is performed. 図1に示した実施形態の処理手順を示すフローチャート。The flowchart which shows the process sequence of embodiment shown in FIG. 同じく図1に示した実施形態の処理手順を示すフローチャート。The flowchart which similarly shows the process sequence of embodiment shown in FIG. タスクでプログラムを構成する場合の説明図で、(a)は1つの連続したプログラムでPLCプログラム(ユーザプログラム)を構成する場合、(b)は(a)のプログラムを複数のタスク(同図ではタスク1,2,3)に分割してプログラムを構成する場合の説明図である。In the case of configuring a program with tasks, (a) shows a case where a PLC program (user program) is constituted by one continuous program, (b) shows a program (a) having a plurality of tasks (in the figure, It is explanatory drawing in the case of dividing | segmenting into a task 1,2,3) and comprising a program. 従来のプログラムを実行する場合とタスクを実行する場合の差異を模式的に説明する図で、(a)は従来のプログラムを実行する場合、(b)はタスクを実行する場合の説明図である。It is a figure which illustrates typically the difference between the case where a conventional program is executed, and the case where a task is executed, (a) is an explanatory view when executing a conventional program, and (b) is an explanatory view when executing a task. .

符号の説明Explanation of symbols

10 PLCシミュレータ装置
20 ラダー実行エンジン
21 メイン処理部
22 ラダー実行処理部
23 周辺処理部
30 デバッガ
31 タスク管理部
32 メッセージウィンドウ
32−1 タスク表示切替部
32−2 タスク種別表示部
32−3 タスクNo.表示部
32−4 タスク設定表示部
32−5 [閉じる]ボタン
32−6 メインメニュー表示部
32−7 モニタボタン
32−8 タスク起動間隔表示部
32−9 タスク状態表示部
32−10 タスク実行回数表示部
32−11 タスク実行時間表示部
DESCRIPTION OF SYMBOLS 10 PLC simulator apparatus 20 Ladder execution engine 21 Main processing part 22 Ladder execution processing part 23 Peripheral processing part 30 Debugger 31 Task management part 32 Message window 32-1 Task display switching part 32-2 Task type display part 32-3 Task No. Display section 32-4 Task setting display section 32-5 [Close] button 32-6 Main menu display section 32-7 Monitor button 32-8 Task activation interval display section 32-9 Task status display section 32-10 Task execution count display Part 32-11 Task execution time display part

Claims (4)

タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行をシミュレーションするPLCシミュレータ装置において、
PLCプログラムを構成するタスクの管理を行うタスク管理部と、
前記タスク管理部からの命令によってPLCプログラムを実行するメイン処理部と、
タスクの内部状態を待機状態と実行可能状態に相互に変更できる内部状態変更手段とを有し、
前記内部状態変更手段は、前記命令がタスク起動命令の場合には、前記メイン処理部により指定されたタスクの内部状態を実行可能状態とし、
前記内部状態変更手段は、前記命令がタスク待機命令の場合には、前記メイン処理部により指定されたタスクの内部状態を待機状態とする
ことを特徴とするPLCシミュレータ装置。
In a PLC simulator device that simulates instruction execution of a PLC program that can control the execution state of another task by a task start instruction and a task standby instruction,
A task management unit for managing the tasks constituting the PLC program;
A main processing unit that executes a PLC program according to a command from the task management unit;
An internal state changing means capable of mutually changing the internal state of the task into a standby state and an executable state;
When the instruction is a task activation instruction, the internal state changing means sets the internal state of the task specified by the main processing unit to an executable state,
The PLC simulator device characterized in that the internal state changing means sets the internal state of the task designated by the main processing unit to a standby state when the command is a task standby command.
タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行と、タスク単位で実行されるPLCプログラムの命令実行とをシミュレーションするPLCシミュレータ装置において、
PLCプログラムを構成するタスクの管理を行うタスク管理部と、
前記タスク管理部からの命令によってPLCプログラムを実行するメイン処理部と、
タスクの内部状態を待機状態と実行可能状態に相互に変更できる内部状態変更手段と、
1命令毎に実行条件が成立するか否かを判別する実行条件判別手段と、
前記実行条件判別手段で実行条件が成立の場合には、1命令の実行処理時間を読込み、前記実行条件が不成立の場合には、非実行処理時間を読込む1命令処理時間取得手段と、
前記1命令処理時間取得手段で読込んだ処理時間を積算して1タスクの処理時間を算出する1タスク処理時間算出手段と、
前記1タスク処理時間算出手段で算出された処理時間を記憶する1タスク処理時間記憶手段と、を有し、
前記内部状態変更手段は、前記命令がタスク起動命令の場合には、前記メイン処理部により指定されたタスクの内部状態を実行可能状態とし、
前記内部状態変更手段は、前記命令がタスク待機命令の場合には、前記メイン処理部により指定されたタスクの内部状態を待機状態とする
ことを特徴とするPLCシミュレータ装置。
In a PLC simulator device for simulating instruction execution of a PLC program that can control the execution state of another task by a task start instruction and a task standby instruction, and instruction execution of a PLC program executed in units of tasks,
A task management unit for managing the tasks constituting the PLC program;
A main processing unit that executes a PLC program according to a command from the task management unit;
An internal state change means that can mutually change the internal state of the task to a standby state and an executable state;
Execution condition determining means for determining whether or not the execution condition is satisfied for each instruction;
If the execution condition is satisfied by the execution condition determining means, the execution processing time of one instruction is read; if the execution condition is not satisfied, the one instruction processing time acquisition means for reading the non-execution processing time;
1 task processing time calculation means for calculating the processing time of one task by adding the processing times read by the one command processing time acquisition means;
One-task processing time storage means for storing the processing time calculated by the one-task processing time calculation means,
When the instruction is a task activation instruction, the internal state changing means sets the internal state of the task specified by the main processing unit to an executable state,
The PLC simulator device characterized in that the internal state changing means sets the internal state of the task designated by the main processing unit to a standby state when the command is a task standby command.
タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行をシミュレーションするプログラムが記録された記録媒体であって、
前記記録媒体は、コンピュータを、PLCプログラムを構成するタスクの管理を行うタスク管理手段と、前記タスク管理手段からの命令によってPLCプログラムを実行するメイン処理手段と、前記命令がタスク起動命令の場合には、前記メイン処理手段により指定されたタスクの内部状態を実行可能状態とし、前記命令がタスク待機命令の場合には、前記メイン処理手段により指定されたタスクの内部状態を待機状態とする内部状態変更手段、として機能させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。
A recording medium on which a program for simulating instruction execution of a PLC program capable of controlling the execution state of another task by a task start instruction and a task standby instruction is recorded,
The recording medium includes a computer, a task management unit that manages tasks constituting a PLC program, a main processing unit that executes a PLC program according to a command from the task management unit, and the command is a task activation command. Is an internal state in which the internal state of the task specified by the main processing means is made executable and, when the instruction is a task standby instruction, the internal state of the task specified by the main processing means is in a standby state. A computer-readable recording medium on which a program for functioning as a changing means is recorded.
タスク起動命令とタスク待機命令によって他のタスクの実行状態を制御できるPLCプログラムの命令実行をシミュレーションするプログラムであって、
前記プログラムは、コンピュータを、PLCプログラムを構成するタスクの管理を行うタスク管理手段と、前記タスク管理手段からの命令によってPLCプログラムを実行するメイン処理手段と、前記命令がタスク起動命令の場合には、前記メイン処理手段により指定されたタスクの内部状態を実行可能状態とし、前記命令がタスク待機命令の場合には、前記メイン処理手段により指定されたタスクの内部状態を待機状態とする内部状態変更手段、として機能させるためのプログラム。
A program that simulates instruction execution of a PLC program that can control the execution state of another task by a task start instruction and a task wait instruction,
The program includes: a task management unit that manages a task that constitutes a PLC program; a main processing unit that executes a PLC program according to a command from the task management unit; and when the command is a task activation command The internal state of the task designated by the main processing means is made executable, and if the instruction is a task standby instruction, the internal state change to make the internal state of the task designated by the main processing means standby Program to function as a means.
JP2008034448A 2008-02-15 2008-02-15 PLC simulator apparatus, simulation program, and recording medium on which the program is recorded Expired - Lifetime JP4811678B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008034448A JP4811678B2 (en) 2008-02-15 2008-02-15 PLC simulator apparatus, simulation program, and recording medium on which the program is recorded

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008034448A JP4811678B2 (en) 2008-02-15 2008-02-15 PLC simulator apparatus, simulation program, and recording medium on which the program is recorded

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2000015550A Division JP4192380B2 (en) 2000-01-25 2000-01-25 PLC simulator apparatus, simulation program, and recording medium on which the program is recorded

Publications (2)

Publication Number Publication Date
JP2008123559A JP2008123559A (en) 2008-05-29
JP4811678B2 true JP4811678B2 (en) 2011-11-09

Family

ID=39508164

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008034448A Expired - Lifetime JP4811678B2 (en) 2008-02-15 2008-02-15 PLC simulator apparatus, simulation program, and recording medium on which the program is recorded

Country Status (1)

Country Link
JP (1) JP4811678B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023576B (en) * 2010-12-21 2012-11-07 东风康明斯发动机有限公司 Method and system for simulating run environment simulation model of engine fuel oil system
US8977534B2 (en) 2011-03-15 2015-03-10 Omron Corporation Controller support apparatus, controller support program executed on the apparatus, storage medium storing the program, and method of estimating execution time of control program
JP4748286B1 (en) * 2011-03-15 2011-08-17 オムロン株式会社 Controller support apparatus, controller support program to be executed in the apparatus, recording medium storing the program, and method for estimating execution time of control program
CN110794759B (en) * 2019-10-29 2021-06-22 北京和利时智能技术有限公司 PLC task scheduling method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6289105A (en) * 1985-10-15 1987-04-23 Omron Tateisi Electronics Co Programmable controller
JPS62279439A (en) * 1986-05-28 1987-12-04 Mitsubishi Electric Corp Emulator device
JP3548782B2 (en) * 1997-08-28 2004-07-28 オムロン株式会社 Control device and method
JPH11272310A (en) * 1998-03-23 1999-10-08 Mitsubishi Electric Corp Emulation device for programmable controller

Also Published As

Publication number Publication date
JP2008123559A (en) 2008-05-29

Similar Documents

Publication Publication Date Title
US20150100829A1 (en) Method and system for selecting and executing test scripts
US20150100832A1 (en) Method and system for selecting and executing test scripts
JP5491675B2 (en) Information processing apparatus and information processing apparatus control method
US20150100830A1 (en) Method and system for selecting and executing test scripts
JP2000132424A (en) Software instrumentation method
US20150100831A1 (en) Method and system for selecting and executing test scripts
JP4811678B2 (en) PLC simulator apparatus, simulation program, and recording medium on which the program is recorded
CN110659198A (en) Application program test case execution method and device and software test system
CN114297666A (en) Cloud deployment automation vulnerability mining system based on fuzzy test
CN113190443A (en) Test method, test device, computer equipment and storage medium
CN116820908A (en) Locust-based performance test method, device, equipment and medium
CN111142469B (en) Debugging method and debugging system for PLC configuration program
US9953293B2 (en) Method for controlling changes of replication directions in a multi-site disaster recovery environment for high available application
JP4192380B2 (en) PLC simulator apparatus, simulation program, and recording medium on which the program is recorded
JP5542643B2 (en) Simulation apparatus and simulation program
JP4941674B2 (en) Simulation system
JP2008135008A (en) Program module verification method
JP5212508B2 (en) Debug device
CN110497406B (en) Equipment grouping method, device, equipment and medium
JP2009104490A (en) Apparatus for testing program
JP2005250937A (en) Program verification device for microcomputer software
CN113312247A (en) Fault simulation method and system and test method of distributed system
JP2005353020A (en) Simulation system for computer program
WO2001097035A1 (en) Automatic evaluation method and automatic evaluation system and storage medium storing automatic evaluation program
JP3876959B2 (en) Sequence program simulation device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080222

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100722

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100728

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100916

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110114

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110224

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: 20110728

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110810

R150 Certificate of patent or registration of utility model

Ref document number: 4811678

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: 20140902

Year of fee payment: 3

EXPY Cancellation because of completion of term