JPH03282903A - Task control method in communication system for programmable controller - Google Patents
Task control method in communication system for programmable controllerInfo
- Publication number
- JPH03282903A JPH03282903A JP8428390A JP8428390A JPH03282903A JP H03282903 A JPH03282903 A JP H03282903A JP 8428390 A JP8428390 A JP 8428390A JP 8428390 A JP8428390 A JP 8428390A JP H03282903 A JPH03282903 A JP H03282903A
- Authority
- JP
- Japan
- Prior art keywords
- task
- tasks
- data link
- executed
- execution
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Programmable Controllers (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は、プログラマブルコントローラのタスク制御方
法に関し、特にデータリンク、イベント等の通信が行わ
れるプログラマブルコントローラの通信システムに於け
るタスク制御方法に関するものである。[Detailed Description of the Invention] (Industrial Application Field) The present invention relates to a task control method for a programmable controller, and more particularly to a task control method in a programmable controller communication system in which communication such as data links and events is performed. It is.
(従来の技術)
プログラマブルコントローラの通信システムに於ては、
データリンクタスク、イベントタスク等の複数個のタス
クが定義されてこれらタスクが各々タスク実行指令に基
いて実行される。この場合、複数個のタスクには優先順
位が与えられ、複数個のタスクの実行指令が重なった場
合にはその優先順位に従ってタスクが実行される。(Prior art) In the communication system of a programmable controller,
A plurality of tasks such as data link tasks and event tasks are defined, and each of these tasks is executed based on a task execution command. In this case, a plurality of tasks are given priorities, and when execution instructions for a plurality of tasks overlap, the tasks are executed according to the priorities.
(発明が解決しようとする課題)
上述の如きタスク制御に於ては、ユーザの利用状況によ
っては、優先順位が高いタスクばかりが実行され、それ
より優先順位が低いタスクが実行されず、このため同時
機能作動時の性能が保証されないという問題が生じる虞
れがある。具体的な事例として、一般に、イベントタス
クはデータリンクタスクより優先順位を高く設定される
から、この場合にはイベントタスクばかりが実行されて
データリンクタスクが適切に実行されず、このためデー
タリンク性能が低下し、必要なデータリンクが行われな
くなる虞れがある。(Problem to be Solved by the Invention) In the task control described above, depending on the usage status of the user, only tasks with a high priority are executed, and tasks with a lower priority are not executed. There is a possibility that a problem may arise that the performance when the functions are activated simultaneously is not guaranteed. As a specific example, event tasks are generally given higher priority than data link tasks, so in this case, only event tasks are executed and data link tasks are not executed properly, resulting in poor data link performance. There is a risk that the required data link may not be performed.
本発明は、上述の如き問題点に鑑み、データリンクタス
クが繰返し実行されることを保証した上で、これ以外の
タスクも所定の頻度をもって実行され得るようにするプ
ログラマブルコントローラの通信システムに於けるタス
ク制御方法を提供することを目的としている。In view of the above-mentioned problems, the present invention provides a communication system for a programmable controller that ensures that the data link task is repeatedly executed and also allows other tasks to be executed at a predetermined frequency. The purpose is to provide a task control method.
(課題を解決するだめの手段)
上述の如き目的は、本発明によれば、データリンクタス
ク、イベントタスクの如き複数個のタスクを定義された
プログラマブルコントローラの通信システムに於けるタ
スク制御方法に於て、データリンクタスク以外のタスク
の実行要求がタスク実行中に生じた場合には実行待ち状
態としてこのことを記憶し、−サイクルのデータリンク
タスクの完了毎に実行待ち状態のタスクの存在の有無を
検出し、実行待ち状態のタスクが存在する場合にはこの
時に実行待ち状態のタスクのうち所定個数のタスクのみ
を実行し、その後に次のサイクルのデータリンクタスク
を実行することを特徴とするプログラマブルコントロー
ラの通信システムに於けるタスク制御方法によって達成
される。(Means for Solving the Problem) According to the present invention, the above object is to provide a task control method in a communication system of a programmable controller in which a plurality of tasks such as data link tasks and event tasks are defined. If an execution request for a task other than a data link task occurs during task execution, this is stored as an execution waiting state, and the presence or absence of a task in an execution waiting state is checked every time a cycle of data link tasks is completed. is detected, and if there are tasks waiting to be executed, only a predetermined number of tasks among the tasks waiting to be executed are executed at this time, and then the data link task of the next cycle is executed. This is accomplished by a task control method in a programmable controller communication system.
(作用)
本発明によるプログラマブルコントローラの通信システ
ムに於けるタスク制御方法に於ては、データリンクタス
クがその他のタスクの実行要求の如何に拘りなく必ず繰
返し実行され、そしてこのデータリンクタスクのサイク
ル間にて実行個数を制限されながらもその他のタスクが
実行され、この様にその他のタスクの実行個数が制限さ
れていることから、データリンクタスクがあまり長い間
隔をあけずに繰返し実行されることが保証される。(Operation) In the task control method in the communication system for a programmable controller according to the present invention, the data link task is always repeatedly executed regardless of execution requests of other tasks, and Although other tasks are executed even though the number of executions is limited by Guaranteed.
(実施例)
以下に添付の図を参照して本発明を実施例について詳細
に説明する。(Example) The present invention will be described in detail below with reference to the accompanying drawings.
第1図は本発明によるタスク制御方法の実施に用イラレ
るプログラマブルコントローラの基本的構成を示してい
る。プログラマブルコントローラは、マイクロプロセッ
サにより構成されたCPU10と、内部メモリ11と、
システムプログラムを格納したシステムプログラムRO
M12と、ユーザプログラムを格納するユーザプログラ
ムを格納するユーザプログラムRAM13と、人出力デ
ータを格納する人出カメモリ14と、外部人力信号を与
えられる入力インターフェイス及び外部出力信号を送出
する出力インターフェイスとを含む入出カニニット15
と、他のプログラマブルコントローラとの間に制御デー
タ等の交信を行う通信ユニット16とを含んでいる。FIG. 1 shows the basic configuration of a programmable controller used to implement the task control method according to the present invention. The programmable controller includes a CPU 10 configured by a microprocessor, an internal memory 11,
System program RO that stores system programs
M12, a user program RAM 13 that stores a user program, a human output memory 14 that stores human output data, an input interface that receives an external human power signal, and an output interface that sends out an external output signal. In-out crab knit 15
and a communication unit 16 that communicates control data and the like with other programmable controllers.
通信ユニット16は、CPUl0と、内部メモリ18と
、通信用のシステムプログラムを格納したシステムプロ
グラムROM19と、タイマモジュール20と、通信イ
ンターフェイス回路21とを有している。The communication unit 16 includes a CPU 10, an internal memory 18, a system program ROM 19 storing a communication system program, a timer module 20, and a communication interface circuit 21.
プログラマブルコントローラには、プログラマブルコン
トローラ本体の状況監視等を行うプログラマブルコント
ローラ本体インターフェイスタスクと、送受信処理等を
行う通信制御タスクと、センド/レシーブ及びツール(
通信状態の監視)等を行うセンド/レシーブ・ツールタ
スクと、イベントに関する処理を行うイベントタスクと
、データリンクの実行を行うデータリンクタスクと、ハ
ードウェアの初期化等を行うイニシャルタスクとがあり
、データリンクタスクは他のタスクが実行されていない
時には常に作動するアイドルタスクとして定義されてい
る。The programmable controller has a programmable controller body interface task that monitors the status of the programmable controller body, a communication control task that performs transmission/reception processing, etc., and a send/receive and tool (
There are send/receive tool tasks that perform tasks such as monitoring communication status, event tasks that perform event-related processing, data link tasks that perform data link execution, and initial tasks that perform hardware initialization, etc. The data link task is defined as an idle task that runs whenever no other task is running.
これらのことは通信ユニット16のシステムプログラム
ROM19の通信用システムプログラムに於けるモニタ
によって定められており、このモニタ(オペレーション
システム)は、データリンク稼動中に於ては、タスク実
行中に於てデータリンクタスク以外のタスクの実行要求
、即ち要因が生じた場合には、これを実行待ち状態とし
てこのことを内部メモリ18に書込み、−サイクルのデ
ータリンクタスクの完了の毎に実行待ち状態のタスクの
存在の有無を検出し、実行待ち状態のタスりが存在する
場合にはこの時に実行待ち状態のタスクを実行するよう
になっている。この実行待ち状態のタスクの実行はその
タスクの種類が複数種類に亘っていれば、その種類につ
いては予め定められた優先順位に従って全てについて行
われるが、同一種類のタスクについては、所定個数、こ
の実施例に於ては一個のみに限定して実行されるように
なっている。These matters are determined by the monitor in the communication system program in the system program ROM 19 of the communication unit 16, and this monitor (operation system) monitors data during task execution while the data link is in operation. When a request for execution of a task other than the link task, that is, a factor occurs, it is placed in the execution waiting state and this fact is written in the internal memory 18, and each time the data link task of -cycle is completed, the task in the execution waiting state is The presence or absence of the task is detected, and if there is a task waiting to be executed, the task is executed at this time. If there are multiple types of tasks, all of the tasks in the waiting state will be executed according to a predetermined priority order, but for tasks of the same type, a predetermined number of tasks will be executed. In the embodiment, only one is executed.
次に第3図を用いてデータリンク稼動中に於けるタスク
制御要領について説明する。先ずステップ10に於ては
、データリンク処理が開始されたか否かの判別が行われ
、データリンク処理が開始されるまではこのステップ1
0が繰返し実行され、データンク処理が開始されれば、
次にステップ12が実行される。Next, the task control procedure during data link operation will be explained using FIG. First, in step 10, it is determined whether or not the data link processing has started, and this step 1 is performed until the data link processing is started.
If 0 is executed repeatedly and data tank processing is started,
Step 12 is then executed.
ステップ12に於ては、データリンク処理が終了したか
否かの判別が行われ、データリンク処理が終了するまで
はこのステップ12が繰返し実行され、これに対しデー
タリンク処理が終了すれば、次にステップ14が実行さ
れる。In step 12, it is determined whether or not the data link processing has been completed, and this step 12 is repeatedly executed until the data link processing is completed.On the other hand, once the data link processing is completed, the next Step 14 is executed.
ステップ14に於ては、センド/レシーブ・ツールタス
ク要因があるか否かの判別が行われる。In step 14, it is determined whether there is a send/receive tool task factor.
即ち、このステップに於てはセンド/レシーブ・ツール
タスクが現在、実行待ち状態として存在しているか否か
の判別が行われ、これが存在していれば、次にステップ
16が実行され、そうでない場合はステップ18にジャ
ンプすることが行われる。That is, in this step, it is determined whether or not a send/receive tool task currently exists in the execution waiting state. If this exists, step 16 is executed next, and if not, step 16 is executed. If so, a jump is made to step 18.
ステップ16に於ては、実行待ち状態のセンド/レシー
ブ・ツールタスクを一個のみ実行することが行われる。In step 16, only one send/receive tool task waiting to be executed is executed.
ステップ16の次はステップ18へ進む。After step 16, the process advances to step 18.
ステップ18に於ては、イベントタスク要因があるか否
かの判別が行われる。即ち、現在、実行待ち状態のイベ
ントタスクが存在するが否がの判別が行われ、実行待ち
状態のイベントタスクが存在していれば、次にステップ
2oが実行され、そうでない場合はステップ1oに戻る
。In step 18, it is determined whether or not there is an event task factor. That is, it is determined whether or not there is an event task currently waiting to be executed. If there is an event task waiting to be executed, step 2o is executed next, and if not, step 1o is executed. return.
ステップ20に於ては、実行待ち状態にあるイベントタ
スクを一個のみ実行することが行われる。In step 20, only one event task in the execution waiting state is executed.
ステップ20の次はステップ10へ進む。After step 20, proceed to step 10.
上述の如きフローチャートに従ってタスク制御が行われ
ることにより、例えば第4図に示されている如く、符号
Aにて示されているサイクルのデータリンク処理中に於
て、イベント受信1とセンド命令が発生した場合には、
−サイクルのデータリンク処理Aが終了した時点にて実
行待ち状態にあるタスクが一個ずつ予め定められた優先
順位に従って実行される。この場合には先ずセンド命令
の処理が行われ、次にイベント1の処理が行われる。そ
してイベント1の処理中に於てイベント受信2が発生し
ても、これは実行されず、次に符号Bにて示されている
サイクルのデータリンク処理が実行される。そしてこの
−サイクルのデータリンク処理B中にツール発生が生じ
ると、−サイクルのデータ処理Bの終了後に、優先順位
に従って、先ずツール処理が実行され、次いでイベント
2が実行される。By performing task control according to the flowchart described above, for example, as shown in FIG. 4, event reception 1 and send command occur during the data link processing of the cycle indicated by symbol A. If you do,
- When the data link processing A of the cycle is completed, the tasks waiting to be executed are executed one by one according to a predetermined priority order. In this case, the send command is processed first, and then the event 1 is processed. Even if event reception 2 occurs during the processing of event 1, this is not executed, and the data link processing of the cycle indicated by symbol B is executed next. If a tool occurs during the data link processing B of the - cycle, after the data processing B of the - cycle is completed, the tool processing is executed first in accordance with the priority order, and then the event 2 is executed.
尚、立上り時は、イニシャルタスク、プログラマブルコ
ントローラ本体のインターフェイスタスク、イベントタ
スク、センド/レシーブ・ツールタスク、通信制御タス
ク、データリンクタスクの順で各タスクが実行される。Note that at startup, each task is executed in the order of initial task, programmable controller main body interface task, event task, send/receive tool task, communication control task, and data link task.
データリンク停止中は、各種タスクの実行要求が生じた
時点にて順次そのタスクが実行されればよく、この場合
の様子は第5図に示されている。While the data link is stopped, each task may be executed sequentially when a request for execution occurs, and the situation in this case is shown in FIG.
(発明の効果)
以上の説明から明らかな如く、本発明によるプログラマ
ブルコントローラの通信システムに於けるタスク制御方
法に於ては、データリンクタスクがその他のタスクの実
行要求の如何に拘りなく必ず繰返し実行され、そしてこ
のデータリンクタスクのサイクル間にてその他のタスク
が実行個数を制限されながらも実行され、その他のタス
クの実行個数が制限されていることから、データリンク
タスクが、あまり長い間隔をあけずに繰返し実行される
ことが保証され、データリンクとイベントの同時並行時
に於てもデータリンク性能が低下することがない。(Effects of the Invention) As is clear from the above explanation, in the task control method in the programmable controller communication system according to the present invention, the data link task is always repeatedly executed regardless of execution requests of other tasks. Then, between the cycles of this data link task, other tasks are executed although the number of executions is limited, and since the number of execution of other tasks is limited, the data link task may not be executed at too long an interval. It is guaranteed that the data link will be executed repeatedly without any delay, and the data link performance will not deteriorate even when the data link and event are executed in parallel.
第1図は本発明によるタスク制御方法の実施に用いられ
るプログラマブルコントローラの基本的構成を示すブロ
ック線図、第2図はプログラマブルコントローラの通信
ユニットの基本的構成を示すブロック線図、第3図は本
発明によるプログラマブルコントローラのタスク制御方
法の実施要領の一例を示すフローチャート、第4図は本
発明によるプログラマブルコントローラのタスク制御方
法の実施時に於けるタスク制御の実行要領を示すタイム
チャート、第5図はデータリンク停止中に於けるタスク
制御の実施要領を示すフローチャートである。
10・・・CPU
11・・・内部メモリ
12・・・システムプログラムROM
13・・・ユーザプログラムRAM
14・・・人出カメモリ
15・・・人出カニニット
16・・・通信ユニット
第
図FIG. 1 is a block diagram showing the basic configuration of a programmable controller used to implement the task control method according to the present invention, FIG. 2 is a block diagram showing the basic configuration of a communication unit of the programmable controller, and FIG. FIG. 4 is a flowchart showing an example of the implementation procedure of the task control method for a programmable controller according to the present invention, FIG. 3 is a flowchart illustrating how to perform task control while a data link is stopped. 10...CPU 11...Internal memory 12...System program ROM 13...User program RAM 14...Person count memory 15...Pass count crab unit 16...Communication unit Fig.
Claims (1)
のタスクを定義されたプログラマブルコントローラの通
信システムに於けるタスク制御方法に於て、データリン
クタスク以外のタスクの実行要求がタスク実行中に生じ
た場合には実行待ち状態としてこのことを記憶し、サイ
クルのデータリンクタスクの完了毎に実行待ち状態のタ
スクの存在の有無を検出し、実行待ち状態のタスクが存
在する場合にはこの時に実行待ち状態のタスクのうち所
定個数のタスクのみを実行し、その後に次のサイクルの
データリンクタスクを実行することを特徴とするプログ
ラマブルコントローラの通信システムに於けるタスク制
御方法。1. In a task control method in a programmable controller communication system in which multiple tasks such as data link tasks and event tasks are defined, if a request for execution of a task other than the data link task occurs during task execution. This is stored in the execution waiting state, and the presence or absence of an execution waiting task is detected every time the data link task of the cycle is completed, and if there is an execution waiting task, it is executed at this time. 1. A task control method in a programmable controller communication system, characterized in that only a predetermined number of tasks are executed among the tasks, and then a data link task of the next cycle is executed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8428390A JPH03282903A (en) | 1990-03-30 | 1990-03-30 | Task control method in communication system for programmable controller |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8428390A JPH03282903A (en) | 1990-03-30 | 1990-03-30 | Task control method in communication system for programmable controller |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH03282903A true JPH03282903A (en) | 1991-12-13 |
Family
ID=13826136
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP8428390A Pending JPH03282903A (en) | 1990-03-30 | 1990-03-30 | Task control method in communication system for programmable controller |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH03282903A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2017161994A (en) * | 2016-03-07 | 2017-09-14 | 横河電機株式会社 | Control computation device |
| US10649914B1 (en) * | 2016-07-01 | 2020-05-12 | The Board Of Trustees Of The University Of Illinois | Scratchpad-based operating system for multi-core embedded systems |
-
1990
- 1990-03-30 JP JP8428390A patent/JPH03282903A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2017161994A (en) * | 2016-03-07 | 2017-09-14 | 横河電機株式会社 | Control computation device |
| US10649914B1 (en) * | 2016-07-01 | 2020-05-12 | The Board Of Trustees Of The University Of Illinois | Scratchpad-based operating system for multi-core embedded systems |
| US10846251B1 (en) | 2016-07-01 | 2020-11-24 | The Board Of Trustees Of The University Of Illinois | Scratchpad-based operating system for multi-core embedded systems |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110663006B (en) | Method for performing failover of programmable logic controller and controlling physical system | |
| CN104391754A (en) | Method and device for processing task exception | |
| JPH03282903A (en) | Task control method in communication system for programmable controller | |
| CN108388228A (en) | A kind of synchronous debugging method and apparatus for multichannel embedded control system | |
| JPS63300326A (en) | Transaction execution schedule system | |
| JPH01246602A (en) | Special function unit for programmable controller | |
| JPH064318A (en) | Error detecting system | |
| US20080288952A1 (en) | Processing apparatus and device control unit | |
| KR102764026B1 (en) | Multi-core plc and scan method thereof | |
| Park et al. | Real-time scheduler for Middleware of Industrial Robot | |
| JP2901714B2 (en) | Programmable controller | |
| JPH02311903A (en) | Programmable controller | |
| JP2690937B2 (en) | Multitask monitoring method in PMC device | |
| KR20220138137A (en) | Method and apparatus for processing programmable logic controller commands | |
| JPH03127104A (en) | Data link device of programmable controller | |
| JP2000090063A (en) | Timer managing method and timer monitoring device | |
| JPH01192239A (en) | Polling system in communication circuit | |
| JPH0239143B2 (en) | ||
| JPS61288232A (en) | Output instruction control system | |
| CN107870812A (en) | One kind is based on single thread concurrently more timer application management methods | |
| JPH02168302A (en) | High-order link unit for programmable controller | |
| JPH04270441A (en) | Data processor | |
| JP2010009434A (en) | Load distribution method in collection of monitor and control information | |
| JPH0651998A (en) | Communication monitoring device in accordance with multitask os | |
| JPH01292413A (en) | Information processor |