JP2012027621A - Programmable controller system and program updating method thereof - Google Patents

Programmable controller system and program updating method thereof Download PDF

Info

Publication number
JP2012027621A
JP2012027621A JP2010164365A JP2010164365A JP2012027621A JP 2012027621 A JP2012027621 A JP 2012027621A JP 2010164365 A JP2010164365 A JP 2010164365A JP 2010164365 A JP2010164365 A JP 2010164365A JP 2012027621 A JP2012027621 A JP 2012027621A
Authority
JP
Japan
Prior art keywords
controller
synchronous
program
processing means
management table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010164365A
Other languages
Japanese (ja)
Other versions
JP5549455B2 (en
Inventor
Daisuke Yoshihara
大助 吉原
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
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 Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP2010164365A priority Critical patent/JP5549455B2/en
Publication of JP2012027621A publication Critical patent/JP2012027621A/en
Application granted granted Critical
Publication of JP5549455B2 publication Critical patent/JP5549455B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a programmable controller system and program updating method thereof capable of synchronization of program updating and synchronization of activation.SOLUTION: At a timing of application start cycle, counts of synchronous free-run counters 25A and 35A are updated, and a synchronous interruption signal is transmitted from a basic controller 20 to an expansion controller 30. At this timing, applications of the controllers 20 and 30 are requested to start, and when the counter value being updated coincides with a preset value, execution management table is switched to activate an application program which includes updated machine language object.

Description

本発明は、基本コントローラおよび少なくとも1つの拡張コントローラを備え、これらの複数のコントローラの各々で用意された実行管理テーブルに従って各々のアプリケーションプログラムを実行する構成とされたプログラマブルコントローラシステムおよびそのプログラム更新方法に係り、実行中のアプリケーションプログラムを更新する場合に利用できる。   The present invention relates to a programmable controller system including a basic controller and at least one extended controller, and configured to execute each application program according to an execution management table prepared in each of the plurality of controllers, and a method for updating the program. It can be used to update an application program being executed.

従来、プログラマブルコントローラは、シーケンス命令を高速に実行させるために専用ハードウェアで実装するのが主流であったが、汎用CPU(中央演算処理装置)の高速化に伴い、汎用CPUを用いたプログラマブルコントローラが開発されるようになってきている。また、演算処理の高速化のために、複数のプロセッサを用いたプログラマブルコントローラシステムの開発も行われている。   Conventionally, a programmable controller has been mainly implemented with dedicated hardware in order to execute a sequence instruction at a high speed. However, a programmable controller using a general-purpose CPU has been developed along with an increase in the speed of a general-purpose CPU (central processing unit). Has been developed. In addition, a programmable controller system using a plurality of processors has been developed in order to speed up arithmetic processing.

一方、プログラマブルコントローラには、運転中のシステムを停止しないで、プログラムを更新する機能があるが、従来の更新方式では、複数のプロセッサを備えたプログラマブルコントローラシステムの場合には、プロセッサ毎に個別にプログラムの更新を実施していた。   On the other hand, the programmable controller has a function to update the program without stopping the running system. However, in the case of a programmable controller system having a plurality of processors in the conventional updating method, each programmable processor is individually provided. The program was updated.

なお、複数のプロセッサを同期させるシステムとして、プログラム制御モードを示す情報を保持するプログラム同期フラグを備え、このプログラム同期フラグの情報を更新したときに、その更新情報を、プログラムの各命令を記憶する命令記憶部に通知するマルチプロセッサシステムが知られている(特許文献1参照)。   As a system for synchronizing a plurality of processors, a program synchronization flag that holds information indicating a program control mode is provided, and when the information of the program synchronization flag is updated, the update information is stored in each instruction of the program. A multiprocessor system that notifies an instruction storage unit is known (see Patent Document 1).

特開2003−76667号公報(要約、請求項1)JP 2003-76667 A (summary, claim 1)

しかしながら、複数のプロセッサを備えたプログラマブルコントローラシステムにおいて、従来のようにプロセッサ毎に個別にプログラムの更新を行うと、つまり、同期をとらずに個々のタイミングで更新を行うと、各々のプロセッサの出力結果や動作が異なる結果、システムの動作に悪影響を及ぼすことがある。   However, in a programmable controller system having a plurality of processors, if the program is updated individually for each processor as in the past, that is, if the update is performed at individual timing without synchronization, the output of each processor Different results and behavior may adversely affect system operation.

例えば、アプリケーションプログラムは、複数のプログラムを組み合わせてなる階層構造を有しているので、複数のプロセッサで独立して実行される各々のアプリケーションプログラムには、同じ機能を備えたプログラム(例えばサブルーチンやファンクション等)が含まれることがある。すなわち、複数のプロセッサで共通に実行されるプログラム(例えばサブルーチンやファンクション等)がある。そして、このような共通のプログラムを変更した場合に、複数のプロセッサで個別にプログラムの更新を行うと、複数のプロセッサ間でプログラムの切替タイミングがずれるので、その間、変更前のプログラムを実行しているプロセッサと、変更後のプログラムを実行しているプロセッサとが混在する状態となり、各々のプロセッサの出力結果や動作が異なるという事態が発生し、制御対象の動作に不具合が生じるおそれがある。より具体的には、例えば、制御対象内に、別々のサーボモータで駆動される2本の軸がある場合に、一方のサーボモータの回転数が変わらずに、他方のサーボモータの回転数だけが上がった結果、2本の軸の回転数が異なってしまう等の不具合である。従って、このようなプログラムの切替タイミングのずれにより生じる不都合を未然に防止するために、プログラムを同期して更新することが必要となる。   For example, since an application program has a hierarchical structure formed by combining a plurality of programs, each application program executed independently by a plurality of processors has a program (for example, a subroutine or function) having the same function. Etc.) may be included. That is, there are programs (for example, subroutines and functions) that are executed in common by a plurality of processors. And when such a common program is changed, if the program is updated individually by a plurality of processors, the program switching timing is shifted between the plurality of processors. During that time, the program before the change is executed. There is a possibility that a processor that is executing a program that has been changed and a processor that executes a program after the change are mixed, resulting in a situation in which the output result and operation of each processor are different, resulting in a malfunction in the operation of the control target. More specifically, for example, when there are two shafts driven by different servo motors in the controlled object, the rotation speed of one servo motor does not change, and only the rotation speed of the other servo motor. As a result, the number of rotations of the two shafts is different. Therefore, in order to prevent inconvenience caused by such a shift in program switching timing, it is necessary to update the program synchronously.

また、プログラムの同期更新と併せ、周期的に繰り返されるアプリケーションプログラムの起動について同期を図ることも必要である。精緻な制御が要求される制御対象の場合には、周期的に繰り返されるアプリケーションプログラムの起動について同期が図られていなければ、やはり不都合が生じるおそれがあるからである。例えば、カラー印刷機に設けられた送り用のサーボモータの制御等では、僅かなズレで印刷物の品質が落ちてしまうため、高精度な同期制御が要求される。   In addition to the synchronous update of the program, it is also necessary to synchronize the activation of the application program that is repeated periodically. This is because in the case of a control target that requires precise control, there is a possibility that inconvenience may still occur if the application program that is repeated periodically is not synchronized. For example, in the control of a servo motor for feeding provided in a color printing machine, the quality of printed matter is deteriorated by a slight deviation, so that highly accurate synchronous control is required.

本発明の目的は、プログラムの更新の同期化および起動の同期化を図ることができるプログラマブルコントローラシステムおよびそのプログラム更新方法を提供するところにある。   An object of the present invention is to provide a programmable controller system and a program update method thereof capable of synchronizing program updates and starting.

本発明は、基本コントローラおよび少なくとも1つの拡張コントローラを備え、これらの複数のコントローラの各々で用意された実行管理テーブルに従って各々のアプリケーションプログラムを実行する構成とされたプログラマブルコントローラシステムであって、基本コントローラおよび拡張コントローラで共有される共有メモリ領域に設けられた同期フリーランカウンタと、共有メモリ領域に設けられてアプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を記憶するプログラム切替カウンタ値記憶手段とを備え、基本コントローラは、拡張コントローラへ同期割込み信号を送信する処理を実行する同期割込み送信処理手段と、同期フリーランカウンタに、同期割込み信号の1回の送信につき、1カウント若しくは一定数のカウントを加算または減算する処理を実行するカウント更新処理手段とを備え、拡張コントローラは、基本コントローラからの同期割込み信号を受信する処理を実行する同期割込み受信処理手段を備え、基本コントローラおよび拡張コントローラの各々は、ローダから送信されてくる変更後の機械語オブジェクトを、各々のコントローラのプロセッサ用の主メモリに格納して配置するとともに、変更後の機械語オブジェクトの格納先アドレスを現在使用中の実行管理テーブルとは別の実行管理テーブルに記録する処理を実行する機械語オブジェクト配置処理手段と、同期フリーランカウンタの現在値とプログラム切替カウンタ値記憶手段に記憶された同期フリーランカウンタ値とが一致したか否かを判断する処理を繰り返し実行するプログラム切替タイミング判断処理手段と、このプログラム切替タイミング判断処理手段により一致したと判断した場合に、各々のコントローラ用の実行管理テーブルを別の実行管理テーブルへ切り替える処理を実行する実行管理テーブル切替処理手段と、同期割込み信号の送受信のタイミングで、各々のコントローラ用の実行管理テーブルに従って実行される各々のアプリケーションプログラムの起動要求処理を実行するアプリケーション起動要求処理手段とを備えたことを特徴とするものである。   The present invention is a programmable controller system comprising a basic controller and at least one extended controller, and configured to execute each application program in accordance with an execution management table prepared in each of the plurality of controllers. And a synchronous free-run counter provided in a shared memory area shared by the expansion controller, and a program switching counter value storage means provided in the shared memory area for storing a synchronous free-run counter value indicating the switching timing of the application program The basic controller includes a synchronous interrupt transmission processing means for executing a process of transmitting a synchronous interrupt signal to the extended controller, and a synchronous free-run counter for one count of the synchronous interrupt signal. Includes a count update processing means for executing processing for adding or subtracting a certain number of counts, and the extended controller comprises synchronous interrupt reception processing means for executing processing for receiving a synchronous interrupt signal from the basic controller. Each of the extended controllers stores the changed machine language object transmitted from the loader in the main memory for the processor of each controller and arranges the storage address of the changed machine language object at the current time. Machine language object placement processing means for executing processing to be recorded in an execution management table different from the currently used execution management table, and a synchronous free run counter stored in the current value of the synchronous free run counter and program switching counter value storage means Repeated processing to determine whether the value matches Program switching timing determination processing means and execution management table switching processing for executing processing for switching the execution management table for each controller to another execution management table when it is determined by the program switching timing determination processing means And an application activation request processing means for executing the activation request processing of each application program executed according to the execution management table for each controller at the timing of transmission / reception of a synchronous interrupt signal. It is.

ここで、「カウント更新処理手段」における「同期割込み信号の1回の送信につき、1カウント若しくは一定数のカウントを加算または減算する処理」とは、同期割込み信号の送信を繰り返すと、同期フリーランカウンタが、0,1,2,3,4,…と1カウントずつ増加してもよく、あるいは、例えば、0,2,4,6,8,…等のように毎回カウントが同数ずつ増加してもよく、さらには、…,8,7,6,5,4,…と1カウントずつ減少してもよく、あるいは、例えば、…,16,14,12,10,8,…等のように毎回カウントが同数ずつ減少してもよい趣旨である。但し、設計の容易化、構成の簡易化等の観点からは、1カウントずつ増加していくことが好ましい。   Here, “the process of adding or subtracting one count or a fixed number of counts per transmission of the synchronous interrupt signal” in the “count update processing means” means that the synchronous free run is repeated when the transmission of the synchronous interrupt signal is repeated. The counter may be incremented by one count of 0, 1, 2, 3, 4,... Or the count is incremented by the same number each time, for example, 0, 2, 4, 6, 8,. It may be decreased by one count such as ..., 8, 7, 6, 5, 4, ..., or, for example, ..., 16, 14, 12, 10, 8, ... etc. In other words, the count may be decreased by the same number every time. However, from the viewpoint of ease of design, simplification of the configuration, etc., it is preferable to increase by 1 count.

このような本発明のプログラマブルコントローラシステムにおいては、基本コントローラのカウント更新処理手段により、同期フリーランカウンタの値を更新していき、基本コントローラおよび拡張コントローラの各々のプログラム切替タイミング判断処理手段により、同期フリーランカウンタの現在値と、プログラム切替カウンタ値記憶手段に記憶された同期フリーランカウンタ値とが一致したと判断した場合に、各々の実行管理テーブル切替処理手段により、各々のコントローラ用の実行管理テーブルを、変更後の機械語オブジェクトの格納先アドレスが記録された別の実行管理テーブルへ切り替える。このため、切替後には、各々のコントローラで、別の実行管理テーブルに従って、変更後の機械語オブジェクトを含んで構成される更新されたアプリケーションプログラムが実行されることになり、プログラムの同期更新が実現される。   In such a programmable controller system of the present invention, the value of the synchronous free-run counter is updated by the count update processing means of the basic controller, and the program switching timing judgment processing means of each of the basic controller and the extended controller is synchronized. When it is determined that the current value of the free-run counter matches the synchronous free-run counter value stored in the program switching counter value storage means, the execution management table switching processing means performs execution management for each controller. The table is switched to another execution management table in which the storage destination address of the machine language object after the change is recorded. For this reason, after switching, each controller executes an updated application program that includes the machine language object after the change according to another execution management table, thereby realizing synchronous update of the program Is done.

また、基本コントローラの同期割込み送信処理手段および拡張コントローラの同期割込み受信処理手段により、同期割込み信号の送受信を行い、基本コントローラおよび拡張コントローラの各々のアプリケーション起動要求処理手段により、同期割込み信号の送受信のタイミングで、各々のアプリケーションプログラムの起動要求処理を実行するので、各々のアプリケーションプログラムの周期的に繰り返される起動を毎回同期させることが可能となる。   In addition, the synchronous interrupt signal is transmitted / received by the synchronous interrupt transmission processing means of the basic controller and the synchronous interrupt reception processing means of the extended controller, and the synchronous interrupt signal is transmitted / received by the respective application activation request processing means of the basic controller and the extended controller. Since the activation request processing of each application program is executed at the timing, it is possible to synchronize the periodically repeated activation of each application program every time.

そして、このように周期的に繰り返されるアプリケーションプログラムの起動の同期化を図ることが可能となることで、同期割込み信号の送受信のタイミングで、変更後の機械語オブジェクトを含んで構成される各々のアプリケーションプログラムを同期させて起動することが可能となることから、プログラムの同期更新および同期起動の双方を実現することができるようになり、これらにより前記目的が達成される。   In addition, since it is possible to synchronize the start of the application program that is periodically repeated in this way, each of the configurations including the machine language object after the change at the timing of transmission / reception of the synchronization interrupt signal Since the application program can be activated in synchronization, both the synchronous update and the synchronous activation of the program can be realized, thereby achieving the object.

なお、前述した特許文献1に記載されたマルチプロセッサシステムの技術は、プログラムの同期更新を行うものではなく、また、同期フリーランカウンタによるタイミング制御を行うものでもないので、本発明とは異なる技術である。   Note that the technique of the multiprocessor system described in Patent Document 1 described above does not perform synchronous update of a program and does not perform timing control by a synchronous free-run counter, and therefore is different from the present invention. It is.

また、前述したプログラマブルコントローラシステムにおいて、複数のコントローラのプロセッサとは別のプロセッサを有する管理部、または基本コントローラは、ローダからのプログラム切替指示を受け付けた場合に、同期フリーランカウンタの現在値に、予め定められたカウント数を加算または減算することにより、アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を算出し、算出した同期フリーランカウンタ値をプログラム切替カウンタ値記憶手段に記憶させる処理を実行するプログラム切替カウンタ値算出・設定処理手段を備えた構成とすることが望ましい。   In the programmable controller system described above, the management unit having a processor different from the processors of the plurality of controllers, or the basic controller, when receiving a program switching instruction from the loader, sets the current value of the synchronous free-run counter to Executes processing to calculate a synchronous free-run counter value indicating the switching timing of the application program by adding or subtracting a predetermined count number, and to store the calculated synchronous free-run counter value in the program switching counter value storage means It is desirable that the program switching counter value calculation / setting processing means be provided.

ここで、「予め定められたカウント数を加算または減算する」とは、同期フリーランカウンタが、0,1,2,3,4,…と1カウントずつ増加していくか、あるいは、例えば、0,2,4,6,8,…等のように同数カウントずつ増加していく場合には、「予め定められたカウント数」を「加算」し、一方、…,8,7,6,5,4,…と1カウントずつ減少していくか、あるいは、例えば、…,16,14,12,10,8,…等のように同数カウントずつ減少していく場合には、「予め定められたカウント数」を「減算」するという意味である。   Here, “adding or subtracting a predetermined count number” means that the synchronous free-run counter is incremented by one count of 0, 1, 2, 3, 4,. When incrementing the same number of counts, such as 0, 2, 4, 6, 8,..., Etc., the “predetermined count number” is “added”, while…, 8, 7, 6, etc. .., 16, 14, 12, 10, 8,... Or the like, for example, when the number is decreased by the same number, for example, “predetermined It means to “subtract” the counted number.

このように同期フリーランカウンタの現在値に予め定められたカウント数を加算または減算するプログラム切替カウンタ値算出・設定処理手段を備えた構成とした場合には、ローダからのプログラム切替指示を受け付けたときに、そのときの同期フリーランカウンタの値を基準として、相対的にアプリケーションプログラムの切替タイミングを定めることができるので、適切でかつ早期の切替タイミングを設定することが可能となる。   As described above, when the program switching counter value calculation / setting processing means for adding or subtracting a predetermined count number to the current value of the synchronous free-run counter is provided, the program switching instruction from the loader is accepted. Sometimes, since the application program switching timing can be relatively determined based on the value of the synchronous free-run counter at that time, an appropriate and early switching timing can be set.

さらに、本発明は、基本コントローラおよび少なくとも1つの拡張コントローラを備え、これらの複数のコントローラの各々で用意された実行管理テーブルに従って各々のアプリケーションプログラムを実行する構成とされたプログラマブルコントローラシステムのプログラム更新方法であって、基本コントローラおよび拡張コントローラで共有される共有メモリ領域に、同期フリーランカウンタと、アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を記憶するプログラム切替カウンタ値記憶手段とを設けておき、基本コントローラの同期割込み送信処理手段が、拡張コントローラへ同期割込み信号を送信する処理を実行し、基本コントローラのカウント更新処理手段が、同期フリーランカウンタに、同期割込み信号の1回の送信につき、1カウント若しくは一定数のカウントを加算または減算する処理を実行し、拡張コントローラの同期割込み受信処理手段が、基本コントローラからの同期割込み信号を受信する処理を実行し、基本コントローラおよび拡張コントローラの各々の機械語オブジェクト配置処理手段が、ローダから送信されてくる変更後の機械語オブジェクトを、各々のコントローラのプロセッサ用の主メモリに格納して配置するとともに、変更後の機械語オブジェクトの格納先アドレスを現在使用中の実行管理テーブルとは別の実行管理テーブルに記録する処理を実行し、基本コントローラおよび拡張コントローラの各々のプログラム切替タイミング判断処理手段が、同期フリーランカウンタの現在値とプログラム切替カウンタ値記憶手段に記憶された同期フリーランカウンタ値とが一致したか否かを判断する処理を繰り返し実行し、基本コントローラおよび拡張コントローラの各々の実行管理テーブル切替処理手段が、プログラム切替タイミング判断処理手段により一致したと判断した場合に、各々のコントローラ用の実行管理テーブルを別の実行管理テーブルへ切り替える処理を実行し、基本コントローラおよび拡張コントローラの各々のアプリケーション起動要求処理手段が、同期割込み信号の送受信のタイミングで、各々のコントローラ用の実行管理テーブルに従って実行される各々のアプリケーションプログラムの起動要求処理を実行することを特徴とするものである。   Furthermore, the present invention provides a program update method for a programmable controller system comprising a basic controller and at least one extended controller, and configured to execute each application program in accordance with an execution management table prepared in each of the plurality of controllers. In the shared memory area shared by the basic controller and the extended controller, a synchronous free-run counter and a program switching counter value storage means for storing a synchronous free-run counter value indicating the switching timing of the application program are provided. The basic controller synchronous interrupt transmission processing means executes a process of transmitting a synchronous interrupt signal to the extended controller, and the basic controller count update processing means performs a synchronous interrupt on the synchronous free-run counter. A process of adding or subtracting one count or a certain number of counts for each transmission of the signal is executed, and the synchronous interrupt reception processing means of the extended controller executes a process of receiving a synchronous interrupt signal from the basic controller, The machine language object placement processing means of each of the basic controller and the extended controller stores and places the machine language object after the change sent from the loader in the main memory for the processor of each controller, and after the change. A process for recording the storage address of the machine language object in an execution management table different from the currently used execution management table is executed, and the program switching timing determination processing means of each of the basic controller and the extended controller is a synchronous free-run counter. Current value and program switching counter value The process of determining whether or not the synchronous free-run counter value stored in the means matches is repeatedly executed, and the execution management table switching processing means of the basic controller and the extended controller are matched by the program switching timing judgment processing means. If it is determined that the execution management table for each controller is switched to another execution management table, the application activation request processing means of each of the basic controller and the extended controller performs the transmission / reception timing of the synchronous interrupt signal. Thus, the activation request processing of each application program executed in accordance with the execution management table for each controller is executed.

このような本発明のプログラマブルコントローラシステムのプログラム更新方法においては、前述した本発明のプログラマブルコントローラシステムで得られる作用・効果がそのまま得られ、これにより前記目的が達成される。   In such a program update method of the programmable controller system of the present invention, the operations and effects obtained by the above-described programmable controller system of the present invention can be obtained as they are, thereby achieving the object.

以上に述べたように本発明によれば、基本コントローラと拡張コントローラとの間での同期割込み信号および同期フリーランカウンタによるタイミング制御により、プログラムの更新の同期化、および周期的に繰り返されるアプリケーションプログラムの起動の同期化を図ることができるので、制御対象の動作の不具合を未然に防止するとともに、高精度な同期制御を実現することができるという効果がある。   As described above, according to the present invention, the synchronization of the program update and the periodically repeated application program are performed by the synchronous interrupt signal and the timing control by the synchronous free-run counter between the basic controller and the extended controller. As a result, it is possible to synchronize the activations of the devices, thereby preventing problems in the operation of the controlled object and realizing highly accurate synchronous control.

本発明の一実施形態のプログラマブルコントローラシステムの全体構成図。1 is an overall configuration diagram of a programmable controller system according to an embodiment of the present invention. 前記実施形態のシステム処理手段の詳細構成図。The detailed block diagram of the system processing means of the said embodiment. 前記実施形態のソースコードの管理状況および実行プログラムの格納状況の一例を示す説明図。Explanatory drawing which shows an example of the management condition of the source code of the said embodiment, and the storage condition of an execution program. 前記実施形態のシステム処理のうちの同期割込みを行う処理Aの流れを示すフローチャートの図。The figure of the flowchart which shows the flow of the process A which performs a synchronous interruption among the system processes of the said embodiment. 前記実施形態のシステム処理のうちのアプリケーション運転状態への移行を行う処理Bの流れを示すフローチャートの図。The figure of the flowchart which shows the flow of the process B which transfers to the application operation state among the system processes of the said embodiment. 前記実施形態のシステム処理のうちのプログラム切替を行う処理Cの流れを示すフローチャートの図。The figure of the flowchart which shows the flow of the process C which performs program switching among the system processes of the said embodiment. 前記実施形態のシステム処理の全体的な流れを示すタイムチャートの図。The figure of the time chart which shows the whole flow of the system processing of the said embodiment. 前記実施形態のプログラム配置の一例を示す図。The figure which shows an example of the program arrangement | positioning of the said embodiment. 前記実施形態の変更後の機械語オブジェクトの送信後の状態の一例を示す図。The figure which shows an example of the state after transmission of the machine language object after the change of the said embodiment. 前記実施形態の変更後の機械語オブジェクトの送信後に行う補完処理の説明図。Explanatory drawing of the complementation process performed after the transmission of the machine language object after the change of the said embodiment. 前記実施形態の実行管理テーブルの切替処理の説明図。Explanatory drawing of the switching process of the execution management table of the said embodiment.

以下に本発明の一実施形態について図面を参照して説明する。図1には、本実施形態のプログラマブルコントローラシステム10の全体構成が示されている。図2には、プログラマブルコントローラシステム10のシステム処理手段24,34,44の詳細構成が示され、図3には、ソースコードの管理状況および実行プログラムの格納状況の一例が示されている。また、図4には、システム処理のうちの同期割込みを行う処理Aの流れがフローチャートで示され、図5には、システム処理のうちのアプリケーション運転状態への移行を行う処理Bの流れがフローチャートで示され、図6には、システム処理のうちのプログラム切替を行う処理Cの流れがフローチャートで示されている。さらに、図7には、システム処理の全体的な流れがタイムチャートで示されている。また、図8には、主メモリ23,33へのプログラム配置の一例が示され、図9には、変更後の機械語オブジェクトP2’の送信後の状態の一例が示され、図10には、変更後の機械語オブジェクトP2’の送信後に行う補完処理の説明図が示され、図11には、実行管理テーブルT1,T2の切替処理の説明図が示されている。   An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 shows an overall configuration of a programmable controller system 10 of the present embodiment. FIG. 2 shows a detailed configuration of the system processing means 24, 34, 44 of the programmable controller system 10, and FIG. 3 shows an example of a source code management status and an execution program storage status. FIG. 4 is a flowchart showing the flow of process A for performing a synchronous interrupt among the system processes, and FIG. 5 is a flowchart showing the flow of process B for shifting to the application operating state among the system processes. FIG. 6 shows a flow chart of the process C for switching programs among the system processes. Further, in FIG. 7, the overall flow of the system processing is shown in a time chart. 8 shows an example of program arrangement in the main memories 23 and 33, FIG. 9 shows an example of the state after transmission of the machine language object P2 ′ after the change, and FIG. FIG. 11 shows an explanatory diagram of a complementing process performed after transmission of the machine language object P2 ′ after the change, and FIG. 11 shows an explanatory diagram of a switching process of the execution management tables T1 and T2.

図1において、プログラマブルコントローラシステム10は、基本コントローラ20と、拡張コントローラ30と、管理部40とを備えて構成されている。本実施形態では、これらの基本コントローラ20、拡張コントローラ30、および管理部40は、それぞれ別々のプリント基板上に形成され、これらの3つの基板が1つの筐体(不図示)に収納される構成となっているが、これに限定されるものではなく、例えば、基本コントローラ20、拡張コントローラ30、および管理部40が、それぞれ別の筐体に収納されていてもよい。   In FIG. 1, the programmable controller system 10 includes a basic controller 20, an expansion controller 30, and a management unit 40. In the present embodiment, the basic controller 20, the expansion controller 30, and the management unit 40 are formed on separate printed circuit boards, and these three boards are housed in one housing (not shown). However, the present invention is not limited to this. For example, the basic controller 20, the expansion controller 30, and the management unit 40 may be housed in separate cases.

基本コントローラ20は、バスLSI21と、マイクロプロセッサ22と、主メモリ23と、共有メモリ領域25と、フラッシュメモリ26と、データメモリ27とを備えている。そして、マイクロプロセッサ22およびその動作手順を規定するシステムプログラムγ、並びに作業領域である主メモリ23等により、システム処理手段24が構成されている。   The basic controller 20 includes a bus LSI 21, a microprocessor 22, a main memory 23, a shared memory area 25, a flash memory 26, and a data memory 27. A system processing means 24 is constituted by the microprocessor 22, the system program γ that defines its operation procedure, the main memory 23 that is a work area, and the like.

拡張コントローラ30も同様な構成であり、バスLSI31と、マイクロプロセッサ32と、主メモリ33と、共有メモリ領域35と、フラッシュメモリ36と、データメモリ37とを備えている。そして、マイクロプロセッサ32およびその動作手順を規定するシステムプログラムδ、並びに作業領域である主メモリ33等により、システム処理手段34が構成されている。   The extended controller 30 has the same configuration, and includes a bus LSI 31, a microprocessor 32, a main memory 33, a shared memory area 35, a flash memory 36, and a data memory 37. A system processing means 34 is constituted by the microprocessor 32, the system program δ that defines the operation procedure thereof, the main memory 33 that is a work area, and the like.

管理部40は、基本コントローラ20や拡張コントローラ30とは異なった構成であり、バスLSI41と、マイクロプロセッサ42と、主メモリ43と、共有メモリ領域45と、フラッシュメモリ46と、USB接続部47Aと、イーサネット接続部47B(イーサネットは登録商標)と、シリアル接続部47Cと、スイッチ操作信号入力部48とを備えている。そして、マイクロプロセッサ42およびその動作手順を規定するシステムプログラムε、並びに作業領域である主メモリ43等により、システム処理手段44が構成されている。   The management unit 40 has a different configuration from the basic controller 20 and the expansion controller 30, and includes a bus LSI 41, a microprocessor 42, a main memory 43, a shared memory area 45, a flash memory 46, and a USB connection unit 47A. , An Ethernet connection unit 47B (Ethernet is a registered trademark), a serial connection unit 47C, and a switch operation signal input unit 48. A system processing means 44 is constituted by the microprocessor 42, the system program ε that defines the operation procedure thereof, the main memory 43 that is a work area, and the like.

基本コントローラ20、拡張コントローラ30、および管理部40のバスLSI21,31,41は、内部バス11に接続され、これらのバスLSI21,31,41による共有化のための内部バス11を介した通信機能により、基本コントローラ20、拡張コントローラ30、および管理部40の共有メモリ領域25,35,45に記憶された各種のデータは共有化され、各共有メモリ領域25,35,45のそれぞれに同じデータが保持されるようになっている。   The basic LSI 20, the expansion controller 30, and the bus LSIs 21, 31, 41 of the management unit 40 are connected to the internal bus 11, and the communication function via the internal bus 11 for sharing by these bus LSIs 21, 31, 41. As a result, various data stored in the shared memory areas 25, 35, and 45 of the basic controller 20, the extended controller 30, and the management unit 40 are shared, and the same data is stored in each of the shared memory areas 25, 35, and 45, respectively. It is supposed to be retained.

マイクロプロセッサ22,32,42は、主メモリ23,33,43に記憶されたアプリケーションプログラムα,βやシステムプログラムγ,δ,εを読み込んで実行する中央演算処理装置である。なお、管理部40のマイクロプロセッサ42では、アプリケーションプログラムの実行処理は行わない。   The microprocessors 22, 32, and 42 are central processing units that read and execute application programs α, β and system programs γ, δ, ε stored in the main memories 23, 33, 43. Note that the microprocessor 42 of the management unit 40 does not execute an application program.

主メモリ23,33,43は、本実施形態では、一例としてシンクロナスDRAM(SDRAM)とされているが、これに限定されるものではない。   In the present embodiment, the main memories 23, 33, and 43 are synchronous DRAMs (SDRAMs) as an example, but are not limited thereto.

共有メモリ領域25,35,45は、本実施形態では、一例としてSRAMとされているが、これに限定されるものではない。これらの共有メモリ領域25,35,45には、同期フリーランカウンタ25A,35A,45Aと、アプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値を記憶するアプリ運転状態開始カウンタ値記憶手段25B,35B,45Bと、アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を記憶するプログラム切替カウンタ値記憶手段25C,35C,45Cと、基本コントローラ20に対してアプリケーション運転開始要求が行われたか否かを示すフラグを記憶する基本コントローラ20用のアプリ運転開始要求フラグ記憶手段25D,35D,45Dと、拡張コントローラ30に対してアプリケーション運転開始要求が行われたか否かを示すフラグを記憶する拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段25E,35E,45Eと、基本コントローラ20用のアプリケーションαについての運転状態および停止状態を含むステータスを記憶する基本コントローラ20用のステータス記憶手段25F,35F,45Fと、拡張コントローラ30用のアプリケーションβについての運転状態および停止状態を含むステータスを記憶する拡張コントローラ30用のステータス記憶手段25G,35G,45Gとが設けられている。   In the present embodiment, the shared memory areas 25, 35, and 45 are SRAMs as an example, but the present invention is not limited to this. In these shared memory areas 25, 35, 45, synchronous free-run counters 25A, 35A, 45A and application operation state start counter value storage means 25B for storing a synchronous free-run counter value indicating the start timing of the application operation state, 35B, 45B, program switching counter value storage means 25C, 35C, 45C for storing the synchronous free-run counter value indicating the switching timing of the application program, and whether or not an application operation start request has been made to the basic controller 20 The application operation start request flag storage means 25D, 35D, 45D for the basic controller 20 that stores a flag to indicate, and the extension controller 30 that stores a flag that indicates whether an application operation start request has been made to the extension controller 30 Application operation start request flag storage means 25E, 35E, 45E, status storage means 25F, 35F, 45F for the basic controller 20 for storing the status including the operation state and stop state for the application α for the basic controller 20, and expansion Status storage means 25G, 35G, and 45G for the extended controller 30 that store the status including the operation state and the stop state of the application β for the controller 30 are provided.

なお、共有メモリ領域25,35,45には、その他に、基本コントローラ20に対してアプリケーション停止要求が行われたか否かを示すフラグを記憶する基本コントローラ20用のアプリ停止要求フラグ記憶手段(不図示)や、拡張コントローラ30に対してアプリケーション停止要求が行われたか否かを示すフラグを記憶する拡張コントローラ30用のアプリ停止要求フラグ記憶手段(不図示)等が設けられているが、本発明の処理に直接関係しないため、説明を省略する。   In addition, in the shared memory areas 25, 35, and 45, an application stop request flag storage means (not specified) for the basic controller 20 that stores a flag indicating whether or not an application stop request has been made to the basic controller 20 is also stored. And an application stop request flag storage means (not shown) for the extension controller 30 for storing a flag indicating whether or not an application stop request has been made to the extension controller 30 is provided. The description is omitted because it is not directly related to this process.

フラッシュメモリ26,36、46は、ローダ50でユーザにより作成されてコンパイルされたアプリケーションプログラムα,βや、システムプログラムγ,δ,εを格納するものである。   The flash memories 26, 36, and 46 store application programs α and β created by the loader 50 and compiled by the user, and system programs γ, δ, and ε.

データメモリ27,37は、例えばSRAM等であり、アプリケーションプログラムα,βの実行時に使用される各種変数等を記憶するユーザデータ領域27A,37Aを有している。なお、管理部40では、アプリケーションプログラムを実行することはないので、データメモリ27,37に相当するメモリは設置されていない。   The data memories 27 and 37 are, for example, SRAMs or the like, and have user data areas 27A and 37A for storing various variables used when executing the application programs α and β. Note that the management unit 40 does not execute an application program, so no memory corresponding to the data memories 27 and 37 is installed.

管理部40のUSB接続部47A、イーサネット接続部47B(イーサネットは登録商標)、およびシリアル接続部47Cは、外部端末との通信のために設けられ、ローダ50を接続することができる。なお、外部端末との通信のための接続部は、これらの種類に限定されるものではなく、有線、無線の別も問わない。また、管理部40のスイッチ操作信号入力部48は、スイッチ操作による外部からの起動要求等の信号を入力するものである。   The USB connection unit 47A, the Ethernet connection unit 47B (Ethernet is a registered trademark), and the serial connection unit 47C of the management unit 40 are provided for communication with an external terminal and can be connected to the loader 50. Note that the connection unit for communication with the external terminal is not limited to these types, and may be wired or wireless. The switch operation signal input unit 48 of the management unit 40 inputs a signal such as an activation request from the outside by a switch operation.

ローダ50は、プログラマブルコントローラシステム10の管理部40に接続され、ユーザによるアプリケーションプログラムの開発を支援し、作成されたアプリケーションプログラム(機械語オブジェクト)を通信によりプログラマブルコントローラシステム10の管理部40へ送信する開発支援装置であり、ユーザによるアプリケーションのソースコードの編集(作成、変更等)を支援する処理を実行するソース編集処理手段51と、このソース編集処理手段51による編集支援で作成されたアプリケーションのソースコードを記憶するソースコード記憶手段52と、このソースコード記憶手段52に記憶されたソースコードをコンパイルして機械語オブジェクトに変換する処理を実行するコンパイラ53と、このコンパイラ53による変換処理で得られた機械語オブジェクトを記憶する機械語オブジェクト記憶手段54と、ソースコード名とその変換後の機械語オブジェクト名との対応関係を定めるソースコード管理表を記憶するソースコード管理表記憶手段55と、機械語オブジェクト記憶手段54に記憶された機械語オブジェクトをプログラマブルコントローラシステム10の管理部40へ送信する処理を実行する機械語オブジェクト送信処理手段56とを備えて構成されている。このローダ50は、例えば、ノート型等の汎用のコンピュータにより構成されていてもよく、あるいは専用のハンディローダ等であってもよい。   The loader 50 is connected to the management unit 40 of the programmable controller system 10, supports the development of the application program by the user, and transmits the created application program (machine language object) to the management unit 40 of the programmable controller system 10 by communication. A development support apparatus, a source editing processing means 51 for executing processing for supporting editing (creation, change, etc.) of the application source code by the user, and an application source created by the editing support by the source editing processing means 51 Source code storage means 52 for storing code, a compiler 53 for executing processing for compiling the source code stored in the source code storage means 52 and converting it into a machine language object, and the compiler 53 Machine language object storage means 54 for storing the machine language object obtained by the conversion process, and a source code management table storage for storing a source code management table for defining the correspondence between the source code name and the machine language object name after the conversion Means 55 and machine language object transmission processing means 56 for executing processing for transmitting the machine language object stored in the machine language object storage means 54 to the management unit 40 of the programmable controller system 10. The loader 50 may be constituted by a general-purpose computer such as a notebook computer, or may be a dedicated handy loader or the like.

図2において、基本コントローラ20のシステム処理手段24は、システムイニシャル処理手段24Aと、アプリケーション起動周期待機処理手段24Bと、カウント更新処理手段24Cと、同期割込み送信処理手段24Dと、アプリケーション起動要求処理手段24Eと、外部要求待機処理手段24Fと、設定用カウンタ値算出・設定処理手段24Gと、アプリ運転開始要求フラグ設定処理手段24Hと、アプリ起動準備処理手段24Jと、アプリ運転状態開始タイミング判断処理手段24Kと、アプリ運転状態移行処理手段24Lと、機械語オブジェクト配置処理手段24Mと、実行管理テーブル補完処理手段24Nと、プログラム切替タイミング判断処理手段24Pと、実行管理テーブル切替処理手段24Qとを含んで構成されている。   In FIG. 2, the system processing unit 24 of the basic controller 20 includes a system initial processing unit 24A, an application activation cycle standby processing unit 24B, a count update processing unit 24C, a synchronous interrupt transmission processing unit 24D, and an application activation request processing unit. 24E, external request standby processing means 24F, setting counter value calculation / setting processing means 24G, application operation start request flag setting processing means 24H, application activation preparation processing means 24J, application operation state start timing determination processing means 24K, application operation state transition processing means 24L, machine language object placement processing means 24M, execution management table supplement processing means 24N, program switching timing judgment processing means 24P, and execution management table switching processing means 24Q. It is configured

また、拡張コントローラ30のシステム処理手段34は、システムイニシャル処理手段34Aと、同期割込み受信処理手段34Bと、アプリケーション起動要求処理手段34Cと、アプリ運転開始要求フラグ監視処理手段34Dと、アプリ起動準備処理手段34Eと、アプリ運転状態開始タイミング判断処理手段34Fと、アプリ運転状態移行処理手段34Gと、機械語オブジェクト配置処理手段34Hと、実行管理テーブル補完処理手段34Jと、プログラム切替タイミング判断処理手段34Kと、実行管理テーブル切替処理手段34Lとを含んで構成されている。   Further, the system processing means 34 of the extended controller 30 includes a system initial processing means 34A, a synchronous interrupt reception processing means 34B, an application activation request processing means 34C, an application operation start request flag monitoring processing means 34D, and an application activation preparation process. Means 34E, application operation state start timing determination processing means 34F, application operation state transition processing means 34G, machine language object placement processing means 34H, execution management table supplement processing means 34J, and program switching timing determination processing means 34K And an execution management table switching processing means 34L.

さらに、管理部40のシステム処理手段44は、プログラム切替カウンタ値算出・設定処理手段44Aを含んで構成されている。   Further, the system processing unit 44 of the management unit 40 includes a program switching counter value calculation / setting processing unit 44A.

このうち、基本コントローラ20の各処理手段24B,24C,24D,24Fおよび拡張コントローラ30の各処理手段34B,34Cは、図4の処理Aを実行する手段である。また、基本コントローラ20の各処理手段24F,24G,24H,24J,24K,24Lおよび拡張コントローラ30の各処理手段34D,34E,34F,34Gは、図5の処理Bを実行する手段である。さらに、基本コントローラ20の各処理手段24M,24N,24P,24Q、拡張コントローラ30の各処理手段34H,34J,34K,34L、および管理部40のプログラム切替カウンタ値算出・設定処理手段44Aは、図6の処理Cを実行する手段である。なお、後述するように、プログラム切替カウンタ値算出・設定処理手段は、基本コントローラ20に設けてもよい。   Among these, the processing means 24B, 24C, 24D, 24F of the basic controller 20 and the processing means 34B, 34C of the expansion controller 30 are means for executing the processing A of FIG. Further, the processing means 24F, 24G, 24H, 24J, 24K, and 24L of the basic controller 20 and the processing means 34D, 34E, 34F, and 34G of the expansion controller 30 are means for executing the process B of FIG. Furthermore, each processing means 24M, 24N, 24P, 24Q of the basic controller 20, each processing means 34H, 34J, 34K, 34L of the expansion controller 30, and program switching counter value calculation / setting processing means 44A of the management unit 40 are shown in FIG. 6 is a means for executing process C. As will be described later, the program switching counter value calculation / setting processing means may be provided in the basic controller 20.

システムイニシャル処理手段24A,34Aは、リセット状態解除で立ち上がり、ハンドシェイク(通信用パラメータの取り決め等の通信規律の確立処理)により、基本コントローラ20と拡張コントローラ30との間のイニシャル完了待ち合わせを行うものである。また、基本コントローラ20のシステムイニシャル処理手段24Aは、同期フリーランカウンタ25Aを起動する処理を行い、これにより同期フリーランカウンタ25Aは、本実施形態では、ゼロからのカウントを開始する。   The system initial processing means 24A, 34A rises when the reset state is released, and waits for initial completion between the basic controller 20 and the expansion controller 30 by handshaking (processing for establishing communication rules such as communication parameter arrangement). It is. Further, the system initial processing unit 24A of the basic controller 20 performs a process of starting the synchronous free-run counter 25A, and thus the synchronous free-run counter 25A starts counting from zero in this embodiment.

(処理Aを実行する手段)   (Means for executing process A)

基本コントローラ20のアプリケーション起動周期待機処理手段24Bは、タイマ時間計測により、所定の時間間隔(例えば1ミリ秒の間隔等)のアプリケーション起動周期が到来したか否かを判断する処理を繰り返し実行するものである。   The application activation cycle standby processing unit 24B of the basic controller 20 repeatedly executes a process of determining whether or not an application activation cycle of a predetermined time interval (for example, an interval of 1 millisecond) has arrived by measuring a timer time. It is.

基本コントローラ20のカウント更新処理手段24Cは、アプリケーション起動周期が到来したときに、同期割込み信号の送信直前に、同期フリーランカウンタ25A(図1参照)に、1カウントを加算する処理を実行するものである。従って、本実施形態では、同期フリーランカウンタ25Aの値は、同期割込み信号の1回の送信につき、1カウント増加することになる。   The count update processing unit 24C of the basic controller 20 executes a process of adding 1 count to the synchronous free-run counter 25A (see FIG. 1) immediately before the transmission of the synchronous interrupt signal when the application start cycle arrives. It is. Therefore, in this embodiment, the value of the synchronous free-run counter 25A is incremented by one count for each transmission of the synchronous interrupt signal.

基本コントローラ20の同期割込み送信処理手段24Dは、アプリケーション起動周期が到来したときに、拡張コントローラ30へ同期割込み信号を送信する処理を実行するものである。従って、同期割込み信号は、アプリケーション起動周期の到来タイミングに合わせて送信されることになる。   The synchronous interrupt transmission processing unit 24D of the basic controller 20 executes a process of transmitting a synchronous interrupt signal to the extension controller 30 when the application activation cycle has arrived. Therefore, the synchronous interrupt signal is transmitted in accordance with the arrival timing of the application activation cycle.

拡張コントローラ30の同期割込み受信処理手段34Bは、基本コントローラ20からの同期割込み信号を受信する処理を実行するものである。   The synchronous interrupt reception processing unit 34B of the extension controller 30 executes processing for receiving a synchronous interrupt signal from the basic controller 20.

アプリケーション起動要求処理手段24E,34Cは、同期割込み信号の送受信の直後に、各々のステータス記憶手段25F,35G(図1参照)に記憶されたステータスを取得し、取得したステータスがアプリケーション運転状態(RUN)である場合に、各々のアプリケーションプログラムα,βの起動要求処理を実行するものである。従って、アプリケーションプログラムの起動要求処理は、アプリケーション起動周期の到来タイミングに合わせて行われることになる。このアプリケーションプログラムの起動要求処理が行われるときには、アプリケーションプログラムα,βは、既に主メモリ23,33上に配置されており、主メモリ23,33に記憶されている各コントローラ20,30のプログラム実行管理表ポインタにより指示された実行管理テーブル(図3、図8〜図11参照)に従って、複数の機械語オブジェクトを組み合わせてなるアプリケーションプログラムα,βの実行が開始される。つまり、マイクロプロセッサ22,32は、アプリケーションプログラムα,βを実行する場合、実行管理テーブルから、起動するプログラム(アプリケーションプログラムα,βを構成する機械語オブジェクト)が格納されている領域の先頭アドレス(格納先アドレス)を取得し、その取得したアドレスからプログラムを実行していくようになっている。なお、実行管理テーブルに記録されている格納先アドレスは、上から順に取得していく。   The application activation request processing units 24E and 34C acquire the statuses stored in the respective status storage units 25F and 35G (see FIG. 1) immediately after the transmission / reception of the synchronous interrupt signal, and the acquired status is the application operation state (RUN). ), The activation request processing of each application program α, β is executed. Accordingly, the application program activation request processing is performed in accordance with the arrival timing of the application activation cycle. When the application program activation request processing is performed, the application programs α and β are already arranged on the main memories 23 and 33, and the programs of the controllers 20 and 30 stored in the main memories 23 and 33 are executed. In accordance with the execution management table (see FIGS. 3 and 8 to 11) designated by the management table pointer, the execution of the application programs α and β including a plurality of machine language objects is started. That is, when the microprocessors 22 and 32 execute the application programs α and β, from the execution management table, the start addresses of the areas storing the programs to be activated (machine language objects constituting the application programs α and β) ( Storage destination address) is acquired, and the program is executed from the acquired address. Note that the storage destination addresses recorded in the execution management table are acquired in order from the top.

(処理Bを実行する手段)   (Means for executing process B)

基本コントローラ20の外部要求待機処理手段24Fは、管理部40のスイッチ操作信号入力部48(図1参照)に、スイッチ操作による外部からの起動要求信号の入力があったときに、この起動要求信号を管理部40から受信する処理を実行するものである。   The external request standby processing means 24F of the basic controller 20 receives this activation request signal when an external activation request signal is input by a switch operation to the switch operation signal input unit 48 (see FIG. 1) of the management unit 40. Is received from the management unit 40.

基本コントローラ20の設定用カウンタ値算出・設定処理手段24Gは、外部からの起動要求信号を受信した場合に、同期フリーランカウンタ25A(図1参照)の現在値に、予め定められたアプリ運転状態開始タイミング設定用のカウント数C1を加算することにより、アプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値を算出し、算出した同期フリーランカウンタ値を、アプリ運転状態開始カウンタ値記憶手段25B(図1参照)に記憶させる処理を実行するものである。   The counter value calculation / setting processing means 24G for setting of the basic controller 20 receives the activation request signal from the outside, and the application operating state determined in advance to the current value of the synchronous free-run counter 25A (see FIG. 1). By adding the count number C1 for setting the start timing, a synchronous free run counter value indicating the start timing of the application operation state is calculated, and the calculated synchronous free run counter value is stored in the application operation state start counter value storage unit 25B ( The processing to be stored in (see FIG. 1) is executed.

具体的には、同期フリーランカウンタ25Aの現在値をLとすると、アプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値Nは、N=L+C1で算出される(図7参照)。   Specifically, assuming that the current value of the synchronous free-run counter 25A is L, a synchronous free-run counter value N indicating the start timing of the application operation state is calculated as N = L + C1 (see FIG. 7).

例えば、アプリ運転状態開始タイミング設定用のカウント数C1は、基本コントローラ20および拡張コントローラ30のメモリ処理化処理(データメモリ27,37のユーザデータ領域27A,37Aに記憶された各種変数の初期化処理)を含む各々のコントローラ20,30のアプリケーション起動準備処理に要する時間(例えば、数百ミリ秒)のうち最長のものの所要時間を考慮し、例えば1000カウント(仮に1カウントを1ミリ秒とすれば、1秒に相当する。)等と定められている。そして、このカウント数C1は、上記のように見込みの数値であるが、設定用カウンタ値算出・設定処理手段24G(システム処理手段24)を構成するシステムプログラムγ内に記述しておいてもよく、あるいはメモリ(例えばフラッシュメモリ26等)に記憶させておいてもよい。   For example, the count number C1 for setting the application operation state start timing is the memory processing of the basic controller 20 and the extended controller 30 (initialization processing of various variables stored in the user data areas 27A and 37A of the data memories 27 and 37). ) Including the time required for the application startup preparation processing of each controller 20, 30 (for example, several hundred milliseconds), for example, 1000 counts (assuming that 1 count is 1 millisecond) For example, 1 second). The count number C1 is a probable numerical value as described above, but may be described in the system program γ constituting the setting counter value calculation / setting processing means 24G (system processing means 24). Alternatively, it may be stored in a memory (for example, the flash memory 26).

基本コントローラ20のアプリ運転開始要求フラグ設定処理手段24Hは、外部からの起動要求信号を受信した場合に、基本コントローラ20に設けられた基本コントローラ20用のアプリ運転開始要求フラグ記憶手段25D(図1参照)に記憶されたフラグ、および基本コントローラ20に設けられた拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段25E(図1参照)に記憶されたフラグを立てる処理(運転開始要求があったことを示す状態に変更する処理)を実行するものである。なお、このアプリ運転開始要求フラグ設定処理手段24Hにより、基本コントローラ20に設けられた拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段25E(図1参照)に記憶されたフラグが立てられると、この状態が内部バス11を介して、共有メモリ機能により、拡張コントローラ30に設けられた拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段35E(図1参照)に記憶されたフラグに反映される。   The application operation start request flag setting processing unit 24H of the basic controller 20 receives the activation request signal from the outside, and the application operation start request flag storage unit 25D for the basic controller 20 provided in the basic controller 20 (FIG. 1). (Refer to FIG. 1) and a flag stored in the application operation start request flag storage means 25E (see FIG. 1) for the extended controller 30 provided in the basic controller 20 The process of changing to a state indicating) is executed. When the application operation start request flag setting processing unit 24H sets the flag stored in the application operation start request flag storage unit 25E (see FIG. 1) for the extended controller 30 provided in the basic controller 20, The state is reflected in the flag stored in the application operation start request flag storage means 35E (see FIG. 1) for the expansion controller 30 provided in the expansion controller 30 through the internal bus 11 by the shared memory function.

拡張コントローラ30のアプリ運転開始要求フラグ監視処理手段34Dは、拡張コントローラ30に設けられた拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段35E(図1参照)に記憶されたフラグの状態を監視し、このフラグが立った状態に変更されたか否かを判断する処理を繰り返し実行するものである。   The application operation start request flag monitoring processing unit 34D of the expansion controller 30 monitors the state of the flag stored in the application operation start request flag storage unit 35E (see FIG. 1) for the expansion controller 30 provided in the expansion controller 30. The process of determining whether or not the flag has been changed is repeatedly executed.

アプリ起動準備処理手段24J,34Eは、基本コントローラ20および拡張コントローラ30のメモリ初期化処理(データメモリ27,37のユーザデータ領域27A,37Aに記憶された各種変数の初期化処理)を含む各々のコントローラ20,30のアプリケーション起動準備処理を実行するものである。   The application activation preparation processing means 24J and 34E include memory initialization processing (initialization processing of various variables stored in the user data areas 27A and 37A of the data memories 27 and 37) of the basic controller 20 and the expansion controller 30, respectively. An application activation preparation process of the controllers 20 and 30 is executed.

アプリ運転状態開始タイミング判断処理手段24K,34Fは、同期フリーランカウンタ25A,35A(図1参照)の現在値と、アプリ運転状態開始カウンタ値記憶手段25B,35B(図1参照)に記憶された同期フリーランカウンタ値とが一致したか否かを判断することにより、アプリケーション運転状態の開始タイミングが到来したか否かを判断する処理を繰り返し実行するものである。   The application operation state start timing determination processing means 24K and 34F are stored in the current values of the synchronous free-run counters 25A and 35A (see FIG. 1) and the application operation state start counter value storage means 25B and 35B (see FIG. 1). By determining whether or not the synchronous free-run counter value matches, the process of determining whether or not the start timing of the application operating state has been reached is repeatedly executed.

アプリ運転状態移行処理手段24L,34Gは、アプリ運転状態開始タイミング判断処理手段24K,34Fにより双方の値が一致した(つまり、アプリケーション運転状態の開始タイミングが到来した)と判断した場合に、各々のコントローラ20,30用のアプリ運転開始要求フラグ記憶手段25D,35E(図1参照)に記憶されたフラグを降ろす処理(運転開始要求が無いことを示す状態に変更する処理)を実行するとともに、各々のステータス記憶手段25F,35G(図1参照)に記憶されたステータスを、アプリケーション停止状態(STOP)からアプリケーション運転状態(RUN)へ移行させる処理を実行するものである。   When the application operation state transition processing means 24L and 34G determine that both values match (that is, the start timing of the application operation state has arrived) by the application operation state start timing determination processing means 24K and 34F, A process for lowering the flag stored in the application operation start request flag storage means 25D and 35E (see FIG. 1) for the controllers 20 and 30 (a process for changing to a state indicating that there is no operation start request) is executed, and The status storage means 25F, 35G (see FIG. 1) of the status is transferred from the application stop state (STOP) to the application operation state (RUN).

(処理Cを実行する手段)   (Means for executing process C)

基本コントローラ20の機械語オブジェクト配置処理手段24Mは、ローダ50から送信されてくる変更後の機械語オブジェクトを、この変更後の機械語オブジェクトに対応する番号とともに受信し、受信した変更後の機械語オブジェクトのうち自コントローラ20用の変更後の機械語オブジェクトについては、主メモリ23に格納して配置する(つまり、自己の主メモリ23に残しておく)とともに、その配置した変更後の機械語オブジェクトの格納先アドレスを、主メモリ23に記憶されている現在使用中の実行管理テーブルT1とは別の実行管理テーブルT2(図3、図8〜図11参照)に記録し、拡張コントローラ30用の変更後の機械語オブジェクトについては、拡張コントローラ30のマイクロプロセッサ32に送信する処理を実行するものである。また、機械語オブジェクト配置処理手段24Mは、自コントローラ20用の変更後の機械語オブジェクトを、主メモリ23に展開することと併せ、自己のフラッシュメモリ26に記憶させる処理も行う。   The machine language object placement processing unit 24M of the basic controller 20 receives the changed machine language object transmitted from the loader 50 together with the number corresponding to the machine language object after the change, and receives the received changed machine language object. Among the objects, the changed machine language object for the own controller 20 is stored and arranged in the main memory 23 (that is, left in its own main memory 23), and the changed machine language object is arranged. Is stored in an execution management table T2 (see FIGS. 3 and 8 to 11) that is different from the currently used execution management table T1 stored in the main memory 23, and is used for the expansion controller 30. For the machine language object after the change, a process of transmitting to the microprocessor 32 of the expansion controller 30 is performed. It is intended to row. Further, the machine language object arrangement processing unit 24M performs a process of storing the machine language object after the change for the controller 20 in the main memory 23 and storing the machine language object in the flash memory 26 thereof.

この際、機械語オブジェクト配置処理手段24Mは、受信した番号を、実行管理テーブルのインデックスとして利用し、実行管理テーブル上における当該番号の示す位置に、当該番号に対応する機械語オブジェクトの格納先アドレスを記録する。例えば、図3に示す変更前のプログラムの格納状況を参照して説明すると、番号1に対応する機械語オブジェクトP1の格納先アドレスは、実行管理テーブルT1上の先頭の位置に記録し、番号2に対応する機械語オブジェクトP2の格納先アドレスは、実行管理テーブルT1上の2番目の位置に記録する。この格納先アドレス記録処理は、変更後のプログラムの格納時についても同様であり、実行管理テーブルT1が別の実行管理テーブルT2に変わるだけである。また、後述する拡張コントローラ30の機械語オブジェクト配置処理手段34Hの場合も同様である。   At this time, the machine language object placement processing unit 24M uses the received number as an index of the execution management table, and stores the storage address of the machine language object corresponding to the number at the position indicated by the number on the execution management table. Record. For example, referring to the storage status of the program before the change shown in FIG. 3, the storage destination address of the machine language object P1 corresponding to the number 1 is recorded at the top position on the execution management table T1, and the number 2 Is stored at the second position on the execution management table T1. This storage destination address recording process is the same when the changed program is stored, and only the execution management table T1 is changed to another execution management table T2. The same applies to the machine language object arrangement processing unit 34H of the extended controller 30 described later.

なお、機械語オブジェクト配置処理手段24Mは、受信した変更後の機械語オブジェクトが、拡張コントローラ30用の変更後の機械語オブジェクトであるか否かの判断を行わずに、ローダ50から受信した変更後の機械語オブジェクトの全てを、拡張コントローラ30のマイクロプロセッサ32に転送するようにしてもよい。   The machine language object placement processing unit 24M does not determine whether the received machine language object after the change is a machine language object after the change for the extended controller 30, and the change received from the loader 50. All subsequent machine language objects may be transferred to the microprocessor 32 of the expansion controller 30.

拡張コントローラ30の機械語オブジェクト配置処理手段34Hは、ローダ50から基本コントローラ20のマイクロプロセッサ22を介して送信されてくる変更後の機械語オブジェクトを、対応する番号とともに受信し、受信した変更後の機械語オブジェクトのうち自コントローラ30用の変更後の機械語オブジェクトのみ(なお、基本コントローラ20から拡張コントローラ30用の変更後の機械語オブジェクトのみが送信されてくる場合には、受信した変更後の機械語オブジェクトの全てとなる。)を、自己の主メモリ33に格納して配置するとともに、その配置した変更後の機械語オブジェクトの格納先アドレスを、主メモリ33に記憶されている現在使用中の実行管理テーブルT1とは別の実行管理テーブルT2(図3、図8〜図11参照)に記録する処理を実行するものである。また、機械語オブジェクト配置処理手段34Hは、自コントローラ30用の変更後の機械語オブジェクトを、主メモリ33に展開することと併せ、自己のフラッシュメモリ36に記憶させる処理も行う。   The machine language object arrangement processing unit 34H of the extended controller 30 receives the changed machine language object transmitted from the loader 50 via the microprocessor 22 of the basic controller 20 together with the corresponding number, and receives the received changed machine object. Of the machine language objects, only the machine language object after the change for the own controller 30 (in the case where only the machine language object after the change for the extended controller 30 is transmitted from the basic controller 20, the received changed Is stored in its own main memory 33, and the storage destination address of the changed machine language object is stored in the main memory 33 and is currently in use. Execution management table T2 different from the execution management table T1 of FIG. And executes processing for recording the first reference). Further, the machine language object arrangement processing unit 34H performs processing for storing the changed machine language object for the controller 30 in the main memory 33 and storing the machine language object in its own flash memory 36.

実行管理テーブル補完処理手段24N,34Jは、ローダ50から送信されてくる変更後の機械語オブジェクトの送信完了通知の信号を受信し、現在使用中の実行管理テーブルT1とは別の実行管理テーブルT2(図3、図8〜図11参照)を補完する処理を実行するものである。この補完処理は、現在使用中の実行管理テーブルT1に記録された機械語オブジェクトの格納先アドレスのうち、変更する必要のない機械語オブジェクトの格納先アドレスを、そのまま利用して別の実行管理テーブルT2に記録する処理である。   The execution management table complement processing means 24N, 34J receives the change completion notification signal of the machine language object after the change sent from the loader 50, and the execution management table T2 different from the currently used execution management table T1. The process which complements (refer FIG. 3, FIG. 8-FIG. 11) is performed. This complementing process uses another storage management address of the machine language object that does not need to be changed among the storage destination addresses of the machine language object recorded in the currently used execution management table T1. This is a process of recording at T2.

プログラム切替タイミング判断処理手段24P,34Kは、同期フリーランカウンタ25A,35A(図1参照)の現在値と、プログラム切替カウンタ値記憶手段25C,35C(図1参照)に記憶された同期フリーランカウンタ値とが一致したか否かを判断することにより、アプリケーションプログラムの切替タイミングが到来したか否かを判断する処理を繰り返し実行するものである。   The program switching timing determination processing means 24P and 34K are the current values of the synchronous free run counters 25A and 35A (see FIG. 1) and the synchronous free run counters stored in the program switching counter value storage means 25C and 35C (see FIG. 1). By determining whether or not the values match, the process of determining whether or not the application program switching timing has arrived is repeatedly executed.

実行管理テーブル切替処理手段24Q,34Lは、プログラム切替タイミング判断処理手段24P,34Kにより双方が一致した(つまり、アプリケーションプログラムの切替タイミングが到来した)と判断した場合に、主メモリ23,33に記憶されている各々のコントローラ20,30用の現在実行中の実行管理テーブルT1を、別の実行管理テーブルT2へ切り替える処理、すなわち主メモリ23,33に記憶されているプログラム実行管理表ポインタを、現在実行中の実行管理テーブルT1のアドレスから別の実行管理テーブルT2のアドレスへと切り替える処理(図11参照)を実行するものである。   The execution management table switching processing means 24Q and 34L store in the main memories 23 and 33 when the program switching timing determination processing means 24P and 34K determine that both match (that is, the application program switching timing has arrived). A process for switching the currently executed execution management table T1 for each of the controllers 20 and 30 to another execution management table T2, that is, the program execution management table pointer stored in the main memories 23 and 33 is Processing for switching from the address of the execution management table T1 being executed to the address of another execution management table T2 (see FIG. 11) is executed.

管理部40のプログラム切替カウンタ値算出・設定処理手段44Aは、ローダ50から送信されてくるプログラムの切替指示の信号を受信し、同期フリーランカウンタ45Aの現在値に、予め定められたカウント数C2を加算することにより、アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を算出し、算出した同期フリーランカウンタ値を、プログラム切替カウンタ値記憶手段45C(図1参照)に記憶させる処理を実行するものである。   The program switching counter value calculation / setting processing unit 44A of the management unit 40 receives the program switching instruction signal transmitted from the loader 50, and sets a predetermined count number C2 to the current value of the synchronous free-run counter 45A. Is added to calculate a synchronous free-run counter value indicating the switching timing of the application program, and a process of storing the calculated synchronous free-run counter value in the program switching counter value storage means 45C (see FIG. 1) is executed. Is.

具体的には、同期フリーランカウンタ45Aの現在値をMとすると、アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値Kは、K=M+C2で算出される(図7参照)。   Specifically, assuming that the current value of the synchronous free-run counter 45A is M, a synchronous free-run counter value K indicating the switching timing of the application program is calculated as K = M + C2 (see FIG. 7).

例えば、プログラム切替タイミング設定用のカウント数C2は、数カウント(2カウント等)と定められている。このカウント数C2は、見込みの数値であるが、プログラム切替カウンタ値算出・設定処理手段44A(システム処理手段44)を構成するシステムプログラムε内に記述しておいてもよく、あるいはメモリ(例えばフラッシュメモリ46等)に記憶させておいてもよい。   For example, the count number C2 for setting the program switching timing is defined as a number count (2 counts, etc.). The count number C2 is a probable numerical value, but may be described in the system program ε constituting the program switching counter value calculation / setting processing means 44A (system processing means 44), or a memory (for example, a flash memory) It may be stored in the memory 46 or the like.

(その他のシステム処理)   (Other system processing)

管理部40のシステム処理手段44は、プログラム切替カウンタ値算出・設定処理手段44Aによる処理の他に、スイッチ操作信号入力部48(図1参照)に、スイッチ操作による外部からの起動要求信号の入力があったときに、この起動要求信号を基本コントローラ20へ送信する処理等を実行するものである。   In addition to the processing by the program switching counter value calculation / setting processing unit 44A, the system processing unit 44 of the management unit 40 inputs an activation request signal from the outside by switch operation to the switch operation signal input unit 48 (see FIG. 1). When there is, the process of transmitting the activation request signal to the basic controller 20 is executed.

このような本実施形態においては、以下のようにしてプログラマブルコントローラシステム10におけるシステム処理が実行され、アプリケーションが起動される。   In this embodiment, system processing in the programmable controller system 10 is executed as follows and an application is activated.

(処理Aの流れ)   (Process A flow)

図4において、基本コントローラ20および拡張コントローラ30において、システム処理のうちの処理Aを開始する(ステップS1,S2)。先ず、基本コントローラ20において、アプリケーション起動周期待機処理手段24Bにより、タイマ時間計測を行って所定の時間間隔(例えば1ミリ秒の間隔等)のアプリケーション起動周期が到来したか否かを繰り返し判断する(ステップS3)。   In FIG. 4, the basic controller 20 and the expansion controller 30 start process A of the system processes (steps S1 and S2). First, in the basic controller 20, the application activation cycle standby processing unit 24B performs timer time measurement to repeatedly determine whether or not an application activation cycle of a predetermined time interval (for example, an interval of 1 millisecond) has come ( Step S3).

ステップS3でアプリケーション起動周期が到来したと判断された場合には、カウント更新処理手段24Cにより、同期フリーランカウンタ25Aに、1カウントを加算する(ステップS4)。なお、同期フリーランカウンタ25Aの値を変更した状態は、内部バス11を介して、共有メモリ機能により、他の同期フリーランカウンタ35A,45Aにも反映される。   If it is determined in step S3 that the application activation cycle has arrived, the count update processing unit 24C adds 1 count to the synchronous free-run counter 25A (step S4). The state in which the value of the synchronous free-run counter 25A is changed is also reflected in the other synchronous free-run counters 35A and 45A via the internal bus 11 by the shared memory function.

続いて、同期割込み送信処理手段24Dにより、拡張コントローラ30へ同期割込み信号を送信する(ステップS5)。この同期割込み信号は、基本コントローラ20のバスLSI21、内部バス11、および拡張コントローラ30のバスLSI31を介して拡張コントローラ30のマイクロプロセッサ32に伝達される。そして、拡張コントローラ30において、同期割込み受信処理手段34Bにより、基本コントローラ20からの同期割込み信号を受信する(ステップS6)。   Subsequently, the synchronous interrupt transmission processing unit 24D transmits a synchronous interrupt signal to the extension controller 30 (step S5). This synchronous interrupt signal is transmitted to the microprocessor 32 of the expansion controller 30 via the bus LSI 21 of the basic controller 20, the internal bus 11, and the bus LSI 31 of the expansion controller 30. Then, in the extended controller 30, the synchronous interrupt reception processing means 34B receives the synchronous interrupt signal from the basic controller 20 (step S6).

それから、同期割込み信号の送受信の後に、基本コントローラ20においては、アプリケーション起動要求処理手段24Eにより、基本コントローラ20用のステータス記憶手段25Fに記憶されたステータスを取得し、取得したステータスがアプリケーション運転状態(RUN)であるか否かを判断し(ステップS7)、アプリケーション運転状態(RUN)である場合には、基本コントローラ20のアプリケーションαの起動要求を行い(ステップS8)、処理Aを終了する(ステップS9)。一方、取得したステータスがアプリケーション停止状態(STOP)である場合には、アプリケーションαの起動要求は行わずに、処理Aを終了する(ステップS9)。   Then, after transmission / reception of the synchronous interrupt signal, in the basic controller 20, the application activation request processing unit 24E acquires the status stored in the status storage unit 25F for the basic controller 20, and the acquired status is the application operating state ( RUN) is determined (step S7), and if it is in the application operating state (RUN), a request for starting the application α of the basic controller 20 is made (step S8), and the process A is terminated (step S7). S9). On the other hand, when the acquired status is the application stop state (STOP), the process A is terminated without making a request to start the application α (step S9).

また、拡張コントローラ30においても同様にして、アプリケーション起動要求処理手段34Cにより、拡張コントローラ30用のステータス記憶手段35Gに記憶されたステータスを取得し、取得したステータスがアプリケーション運転状態(RUN)であるか否かを判断し(ステップS10)、アプリケーション運転状態(RUN)である場合には、拡張コントローラ30のアプリケーションβの起動要求を行い(ステップS11)、処理Aを終了する(ステップS12)。一方、取得したステータスがアプリケーション停止状態(STOP)である場合には、アプリケーションβの起動要求は行わずに、処理Aを終了する(ステップS12)。   Similarly, in the extension controller 30, the application activation request processing means 34C acquires the status stored in the status storage means 35G for the extension controller 30, and whether the acquired status is the application operating state (RUN). If it is in the application operating state (RUN), a request to start the application β of the expansion controller 30 is made (step S11), and the process A is terminated (step S12). On the other hand, when the acquired status is the application stop state (STOP), the process A is terminated without making a request to start the application β (step S12).

なお、基本コントローラ20および拡張コントローラ30において、アプリケーションプログラムα,βの起動要求処理が行われると、図8〜図11に示すように、各々のコントローラ20,30のマイクロプロセッサ22,32により、主メモリ23,33に記憶されている各コントローラ20,30用のプログラム実行管理表ポインタを取得し、その取得時点のプログラム実行管理表ポインタにより指示されている主メモリ23,33上の実行管理テーブル(例えば、最初は、実行管理テーブルT1であり、切替後は、実行管理テーブルT2となる。)を取得し、取得した実行管理テーブルの1番目に記録されている機械語オブジェクトの先頭アドレスを取得し、取得したアドレスから、既に主メモリ23,33上に配置されているアプリケーションプログラムα,βを構成するプログラム(機械語オブジェクト)を実行していく。これらのアプリケーションプログラムα,βは、いずれも、図7中の縦の点線で示された一定周期(例えば1ミリ秒間隔等)内、すなわちアプリケーション起動周期内で実行が完了するように設定されている。   When the basic controller 20 and the expansion controller 30 perform the activation request processing of the application programs α and β, the microprocessors 22 and 32 of the controllers 20 and 30 respectively perform the main request processing as shown in FIGS. The program execution management table pointers for the controllers 20 and 30 stored in the memories 23 and 33 are acquired, and the execution management tables on the main memories 23 and 33 (indicated by the program execution management table pointer at the time of acquisition) For example, the first is the execution management table T1, and after switching, the execution management table T2 is acquired), and the first address of the machine language object recorded first in the acquired execution management table is acquired. , Apps that are already placed in the main memory 23, 33 from the acquired address The programs (machine language objects) constituting the application programs α and β are executed. These application programs α and β are set so that the execution is completed within a certain period (for example, an interval of 1 millisecond) indicated by a vertical dotted line in FIG. 7, that is, within an application activation period. Yes.

(処理Bの流れ)   (Process B flow)

図5において、基本コントローラ20および拡張コントローラ30において、システム処理のうちの処理Bを開始する(ステップS21,S22)。先ず、基本コントローラ20において、外部要求待機処理手段24Fにより、外部からの起動要求を待ち、管理部40のスイッチ操作信号入力部48(図1参照)に、スイッチ操作による外部からの起動要求信号の入力があったときに、この起動要求信号を管理部40から受信する(ステップS23)。   In FIG. 5, the basic controller 20 and the expansion controller 30 start process B of the system processes (steps S21 and S22). First, in the basic controller 20, the external request waiting processing means 24F waits for an external activation request, and the switch operation signal input unit 48 (see FIG. 1) of the management unit 40 receives the activation request signal from the outside by the switch operation. When there is an input, this activation request signal is received from the management unit 40 (step S23).

続いて、設定用カウンタ値算出・設定処理手段24Gにより、同期フリーランカウンタ25Aの現在値(図7の例では、L)に、予め定められたアプリ運転状態開始タイミング設定用のカウント数C1(例えば、C1=1000カウント等)を加算することにより、アプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値(図7の例では、N)を、N=L+C1として算出し、算出した同期フリーランカウンタ値(図7の例では、N)を、アプリ運転状態開始カウンタ値記憶手段25Bに記憶させる(ステップS24)。なお、アプリ運転状態開始カウンタ値記憶手段25Bに記憶された同期フリーランカウンタ値(図7の例では、N)は、内部バス11を介して、共有メモリ機能により、他のアプリ運転状態開始カウンタ値記憶手段35B,45Bにも反映される。   Subsequently, the setting counter value calculation / setting processing unit 24G sets the current count value of the synchronous free-run counter 25A (L in the example of FIG. 7) to a predetermined count number C1 for setting the application operation state start timing ( For example, a synchronous free run counter value (N in the example of FIG. 7) indicating the start timing of the application operation state is calculated as N = L + C1 by adding C1 = 1000 counts) and the calculated synchronous free run The counter value (N in the example of FIG. 7) is stored in the application operation state start counter value storage unit 25B (step S24). The synchronous free-run counter value (N in the example of FIG. 7) stored in the application operation state start counter value storage unit 25B is sent to another application operation state start counter by the shared memory function via the internal bus 11. It is also reflected in the value storage means 35B, 45B.

それから、アプリ運転開始要求フラグ設定処理手段24Hにより、基本コントローラ20用のアプリ運転開始要求フラグ記憶手段25Dに記憶されたフラグ、および拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段25Eに記憶されたフラグを立てる処理(運転開始要求があったことを示す状態に変更する処理)を実行する(ステップS25)。なお、基本コントローラ20用のアプリ運転開始要求フラグ記憶手段25Dに記憶されたフラグが立てられると、この状態が内部バス11を介して、共有メモリ機能により、拡張コントローラ30や管理部40に設けられた基本コントローラ20用のアプリ運転開始要求フラグ記憶手段35D,45Dに記憶されたフラグに反映される。同様に、拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段25Eに記憶されたフラグが立てられると、この状態が内部バス11を介して、共有メモリ機能により、拡張コントローラ30や管理部40に設けられた拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段35E,45Eに記憶されたフラグに反映される。   Then, the application operation start request flag setting processing unit 24H stores the flag stored in the application operation start request flag storage unit 25D for the basic controller 20 and the application operation start request flag storage unit 25E for the extended controller 30. A process of setting a flag (a process of changing to a state indicating that there has been an operation start request) is executed (step S25). When the flag stored in the application operation start request flag storage unit 25D for the basic controller 20 is set, this state is provided to the extended controller 30 and the management unit 40 via the internal bus 11 by the shared memory function. It is reflected in the flags stored in the application operation start request flag storage means 35D, 45D for the basic controller 20. Similarly, when the flag stored in the application operation start request flag storage unit 25E for the expansion controller 30 is set, this state is provided to the expansion controller 30 and the management unit 40 via the internal bus 11 by the shared memory function. This is reflected in the flags stored in the application operation start request flag storage means 35E and 45E for the extended controller 30.

そして、拡張コントローラ30において、アプリ運転開始要求フラグ監視処理手段34Dにより、拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段35Eに記憶されたフラグの状態を監視し、このフラグが立った状態に変更されたか否かを判断する処理を繰り返し実行し(ステップS26)、フラグが立った場合には、次のステップに進む。   Then, in the extended controller 30, the application operation start request flag monitoring processing unit 34D monitors the state of the flag stored in the application operation start request flag storage unit 35E for the extended controller 30, and changes to a state in which this flag is set. The process of determining whether or not the process has been performed is repeatedly executed (step S26). If the flag is set, the process proceeds to the next step.

その後、基本コントローラ20および拡張コントローラ30において、アプリ起動準備処理手段24J,34Eにより、各コントローラ20,30のメモリ初期化処理(データメモリ27,37のユーザデータ領域27A,37Aに記憶されたアプリケーションα,β用の各種変数の初期化処理)を含む各コントローラ20,30のアプリケーション起動準備処理を実行する(ステップS27,S28)。   Thereafter, in the basic controller 20 and the extended controller 30, the application activation preparation processing means 24J, 34E performs the memory initialization process of each controller 20, 30 (the application α stored in the user data areas 27A, 37A of the data memories 27, 37). , Β initialization processing for various variables), application startup preparation processing of each controller 20, 30 is executed (steps S27, S28).

次に、基本コントローラ20においては、アプリ運転状態開始タイミング判断処理手段24Kにより、同期フリーランカウンタ25Aの現在値と、アプリ運転状態開始カウンタ値記憶手段25Bに記憶された同期フリーランカウンタ値(図7の例では、N)とが一致したか否かを判断することにより、アプリケーション運転状態の開始タイミングが到来したか否かを判断する処理を繰り返し実行する(ステップS29)。   Next, in the basic controller 20, the application operation state start timing determination processing unit 24K causes the current value of the synchronous free run counter 25A and the synchronization free run counter value stored in the application operation state start counter value storage unit 25B (see FIG. In the example of FIG. 7, the process of determining whether or not the start timing of the application operating state has been reached is determined by determining whether or not N) matches (step S29).

ステップS29で双方の値が一致した(つまり、アプリケーション運転状態の開始タイミングが到来した)と判断された場合には、アプリ運転状態移行処理手段24Lにより、基本コントローラ20用のアプリ運転開始要求フラグ記憶手段25Dに記憶されたフラグを降ろす処理(運転開始要求が無いことを示す状態に変更する処理)を実行する(ステップS30)。なお、基本コントローラ20用のアプリ運転開始要求フラグ記憶手段25Dに記憶されたフラグが降ろされると、この状態が内部バス11を介して、共有メモリ機能により、拡張コントローラ30や管理部40に設けられた基本コントローラ20用のアプリ運転開始要求フラグ記憶手段35D,45Dに記憶されたフラグに反映される。   If it is determined in step S29 that both values match (that is, the start timing of the application operation state has arrived), the application operation start request flag memory for the basic controller 20 is stored by the application operation state transition processing means 24L. Processing for lowering the flag stored in the means 25D (processing for changing to a state indicating that there is no operation start request) is executed (step S30). When the flag stored in the application operation start request flag storage unit 25D for the basic controller 20 is cleared, this state is provided to the expansion controller 30 and the management unit 40 via the internal bus 11 by the shared memory function. It is reflected in the flags stored in the application operation start request flag storage means 35D, 45D for the basic controller 20.

続いて、アプリ運転状態移行処理手段24Lにより、基本コントローラ20用のステータス記憶手段25Fに記憶されたステータスを、アプリケーション停止状態(STOP)からアプリケーション運転状態(RUN)へ移行させる処理を実行し(ステップS31)、処理Bを終了する(ステップS32)。なお、基本コントローラ20用のステータス記憶手段25Fに記憶されたステータスを変更すると、この変更後の状態が内部バス11を介して、共有メモリ機能により、拡張コントローラ30や管理部40に設けられた基本コントローラ20用のステータス記憶手段35F,45Fに記憶されたステータスに反映される。   Subsequently, the application operation state transition processing unit 24L executes a process of shifting the status stored in the status storage unit 25F for the basic controller 20 from the application stop state (STOP) to the application operation state (RUN) (step S31), process B is terminated (step S32). When the status stored in the status storage unit 25F for the basic controller 20 is changed, the changed state is changed to the basic provided in the extended controller 30 or the management unit 40 by the shared memory function via the internal bus 11. It is reflected in the status stored in the status storage means 35F, 45F for the controller 20.

また、拡張コントローラ30においては、アプリ運転状態開始タイミング判断処理手段34Fにより、同期フリーランカウンタ35Aの現在値と、アプリ運転状態開始カウンタ値記憶手段35Bに記憶された同期フリーランカウンタ値(図7の例では、N)とが一致したか否かを判断することにより、アプリケーション運転状態の開始タイミングが到来したか否かを判断する処理を繰り返し実行する(ステップS33)。   Further, in the expansion controller 30, the application operation state start timing determination processing unit 34F causes the current value of the synchronous free run counter 35A and the synchronous free run counter value stored in the application operation state start counter value storage unit 35B (FIG. 7). In this example, the process of determining whether or not the start timing of the application operating state has arrived is repeatedly performed by determining whether or not N) matches (step S33).

ステップS33で双方の値が一致した(つまり、アプリケーション運転状態の開始タイミングが到来した)と判断された場合には、アプリ運転状態移行処理手段34Gにより、拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段35Eに記憶されたフラグを降ろす処理(運転開始要求が無いことを示す状態に変更する処理)を実行する(ステップS34)。なお、拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段35Eに記憶されたフラグが降ろされると、この状態が内部バス11を介して、共有メモリ機能により、基本コントローラ20や管理部40に設けられた拡張コントローラ30用のアプリ運転開始要求フラグ記憶手段25E,45Eに記憶されたフラグに反映される。   If it is determined in step S33 that both values match (that is, the start timing of the application operation state has arrived), the application operation start request flag memory for the expansion controller 30 is stored by the application operation state transition processing unit 34G. Processing for lowering the flag stored in the means 35E (processing for changing to a state indicating that there is no operation start request) is executed (step S34). When the flag stored in the application operation start request flag storage means 35E for the expansion controller 30 is cleared, this state is provided to the basic controller 20 and the management unit 40 via the internal bus 11 by the shared memory function. This is reflected in the flags stored in the application operation start request flag storage means 25E and 45E for the extended controller 30.

続いて、アプリ運転状態移行処理手段34Gにより、拡張コントローラ30用のステータス記憶手段35Gに記憶されたステータスを、アプリケーション停止状態(STOP)からアプリケーション運転状態(RUN)へ移行させる処理を実行し(ステップS35)、処理Bを終了する(ステップS36)。なお、拡張コントローラ30用のステータス記憶手段35Gに記憶されたステータスを変更すると、この変更後の状態が内部バス11を介して、共有メモリ機能により、基本コントローラ20や管理部40に設けられた拡張コントローラ30用のステータス記憶手段25G,45Gに記憶されたステータスに反映される。   Subsequently, the application operating state transition processing unit 34G executes a process of shifting the status stored in the status storage unit 35G for the extended controller 30 from the application stop state (STOP) to the application operating state (RUN) (step S35), process B is terminated (step S36). When the status stored in the status storage unit 35G for the expansion controller 30 is changed, the state after the change is extended via the internal bus 11 by the shared memory function to the extension provided in the basic controller 20 or the management unit 40. The status is stored in the status storage means 25G and 45G for the controller 30.

(処理Cの流れ)   (Process C flow)

図6において、ローダ50でのプログラムの開発支援処理を開始するとともに(ステップS41)、管理部40、基本コントローラ20、および拡張コントローラ30において、システム処理のうちの処理Cを開始する(ステップS42,S43,S44)。   6, the program development support process in the loader 50 is started (step S41), and the management unit 40, the basic controller 20, and the expansion controller 30 start the process C among the system processes (step S42, S43, S44).

先ず、ユーザは、ローダ50のソース編集処理手段51によるインターフェース機能により、変更対象のプログラムのソースコードの記述を変更する作業を行い、変更後のソースコードをソースコード記憶手段52に記憶させる(ステップS45)。   First, the user performs an operation of changing the description of the source code of the program to be changed by the interface function of the source editing processing means 51 of the loader 50, and stores the changed source code in the source code storage means 52 (step) S45).

続いて、ローダ50のコンパイラ53により、ソースコード記憶手段52に記憶された変更後のソースコードをコンパイルすることにより、ターゲット上(各コントローラ20,30のマイクロプロセッサ22,32上)で動作する機械語オブジェクトに変換し、変換処理で得られた変更後の機械語オブジェクトを機械語オブジェクト記憶手段54に記憶させる(ステップS46)。また、図3に示すように、コンパイラ53により、ソースコード名と、その変換後の機械語オブジェクト名と、これらに付された番号との対応関係を定めるソースコード管理表を作成し、作成したソースコード管理表をソースコード管理表記憶手段55に記憶させる(ステップS46)。   Subsequently, the machine operating on the target (on the microprocessors 22 and 32 of the controllers 20 and 30) is compiled by compiling the changed source code stored in the source code storage means 52 by the compiler 53 of the loader 50. The converted machine language object obtained by the conversion process is stored in the machine language object storage means 54 (step S46). In addition, as shown in FIG. 3, the compiler 53 created and created a source code management table that defines the correspondence between source code names, machine language object names after conversion, and numbers assigned thereto. The source code management table is stored in the source code management table storage means 55 (step S46).

それから、ローダ50の機械語オブジェクト送信処理手段56により、ソースコード管理表記憶手段55に記憶された機械語オブジェクト名と番号との対応関係を用いて、機械語オブジェクト記憶手段54からこの機械語オブジェクト名を付された変更後の機械語オブジェクトを取得し、取得した変更後の機械語オブジェクトを、対応する番号とともに、管理部40のUSB接続部47A、イーサネット接続部47B(イーサネットは登録商標)、またはシリアル接続部47Cのいずれかを用いた通信により、管理部40を介して(但し、図6では、管理部40の中継処理の図示は省略されている。)、基本コントローラ20へ送信する(ステップS47)。なお、複数の変更後の機械語オブジェクトがある場合には、全ての変更後の機械語オブジェクトを、管理部40を介して基本コントローラ20へ送信する。また、後述するように、管理部40の機能は、基本コントローラ20の1つの機能として実装されていてもよいので、この場合には、変更後の機械語オブジェクトを、対応する番号とともに、基本コントローラ20に直接に送信してもよい。   Then, the machine language object transmission processing unit 56 of the loader 50 uses the correspondence relationship between the machine language object name and the number stored in the source code management table storage unit 55, and uses this machine language object storage unit 54 from the machine language object storage unit 54. The machine language object after the change with the name attached is acquired, and the acquired machine language object after the change together with the corresponding number is connected to the USB connection unit 47A, the Ethernet connection unit 47B (Ethernet is a registered trademark) of the management unit 40, Alternatively, the data is transmitted to the basic controller 20 via the management unit 40 by communication using any one of the serial connection units 47C (however, the relay processing of the management unit 40 is omitted in FIG. 6) ( Step S47). When there are a plurality of machine language objects after change, all the machine language objects after change are transmitted to the basic controller 20 via the management unit 40. Further, as will be described later, the function of the management unit 40 may be implemented as one function of the basic controller 20, and in this case, the machine language object after the change together with the corresponding number is added to the basic controller. 20 may be transmitted directly.

例えば、図8に示すように、プログラム更新前においては、基本コントローラ20のマイクロプロセッサ22用の主メモリ23には、機械語オブジェクトP1,P2が格納され、拡張コントローラ30のマイクロプロセッサ32用の主メモリ33には、機械語オブジェクトP2,P3が格納されているとする。そして、ユーザが、ローダ50で、機械語オブジェクトP2に対応するソースコードU2(図3参照)を変更し、その変更後のソースコードをコンパイルして機械語オブジェクトP2’が得られた場合には、この変更後の機械語オブジェクトP2’が、番号2とともに、管理部40を介して基本コントローラ20へ送信される。   For example, as shown in FIG. 8, before the program update, the main memory 23 for the microprocessor 22 of the basic controller 20 stores the machine language objects P1 and P2, and the main memory for the microprocessor 32 of the extended controller 30. It is assumed that machine language objects P2 and P3 are stored in the memory 33. When the user changes the source code U2 (see FIG. 3) corresponding to the machine language object P2 with the loader 50 and compiles the changed source code to obtain the machine language object P2 ′. The machine language object P2 ′ after the change is transmitted to the basic controller 20 through the management unit 40 together with the number 2.

基本コントローラ20では、機械語オブジェクト配置処理手段24Mにより、ローダ50から送信されてくる変更後の機械語オブジェクトを、対応する番号とともに受信する(ステップS48)。そして、機械語オブジェクト配置処理手段24Mにより、受信した変更後の機械語オブジェクトが、いずれのコントローラで実行される変更後の機械語オブジェクトであるかを判断し、受信した変更後の機械語オブジェクトのうち自コントローラ20用の変更後の機械語オブジェクトについては、主メモリ23に格納して配置するとともに、拡張コントローラ30用の変更後の機械語オブジェクトについては、拡張コントローラ30のマイクロプロセッサ32に送信する(ステップS49)。なお、拡張コントローラ30用の変更後の機械語オブジェクトであるか否かの判断を行うことなく、ローダ50から受信した変更後の機械語オブジェクトの全てを、拡張コントローラ30へ転送してもよい。   In the basic controller 20, the machine language object placement processing unit 24M receives the changed machine language object transmitted from the loader 50 together with the corresponding number (step S48). Then, the machine language object placement processing unit 24M determines whether the received machine language object after the change is a machine language object after the change executed by which controller, and the received machine language object after the change is received. Among them, the changed machine language object for the own controller 20 is stored and arranged in the main memory 23, and the changed machine language object for the extended controller 30 is transmitted to the microprocessor 32 of the extended controller 30. (Step S49). Note that all of the changed machine language objects received from the loader 50 may be transferred to the extension controller 30 without determining whether or not the machine language objects are changed for the extended controller 30.

続いて、主メモリ23に配置した変更後の機械語オブジェクトを格納した領域の先頭アドレス(格納先アドレス)を、主メモリ23に記憶されている現在使用中の実行管理テーブルT1とは別の実行管理テーブルT2に記録する(ステップS50)。   Subsequently, the start address (storage destination address) of the area storing the machine language object after the change arranged in the main memory 23 is executed separately from the currently used execution management table T1 stored in the main memory 23. Record in the management table T2 (step S50).

例えば、図9に示すように、変更後の機械語オブジェクトP2’を、番号2とともに受信した場合には、受信した変更後の機械語オブジェクトP2’を主メモリ23に格納して配置するとともに、番号2であるから、実行管理テーブルT2の2番目の位置に、変更後の機械語オブジェクトP2’の格納先アドレスを記録する。   For example, as shown in FIG. 9, when the machine language object P2 ′ after change is received together with the number 2, the received machine language object P2 ′ after change is stored in the main memory 23 and arranged. Since the number is 2, the storage destination address of the machine language object P2 ′ after the change is recorded at the second position in the execution management table T2.

なお、機械語オブジェクト配置処理手段24Mにより、受信した変更後の機械語オブジェクトが、いずれのコントローラ用の変更後の機械語オブジェクトであるかの判断処理を行う際には、自コントローラ20用の変更後の機械語オブジェクトであるか否かを判断するだけであれば、現在使用中の実行管理テーブルT1を用いて、受信した番号の示す実行管理テーブルT1上の位置に、機械語オブジェクトの格納先アドレスが記録されているか否かにより判断することができる。また、受信した番号から、別途にメモリ(例えばフラッシュメモリ26等)に記憶されたデータ(番号とコントローラとの対応関係を示すデータ)を用いて判断してもよく、あるいは、ローダ50から機械語オブジェクトおよび番号とともに送信されてくるターゲット識別情報(いずれのコントローラで実行される機械語オブジェクトであるかを識別するための情報)を用いて判断してもよい。   When the machine language object placement processing unit 24M determines whether the received machine language object after the change is a machine language object after the change for which controller, the change for the own controller 20 is performed. If it is only determined whether or not it is a later machine language object, the storage location of the machine language object is stored at the position on the execution management table T1 indicated by the received number using the currently used execution management table T1. The determination can be made based on whether an address is recorded. Alternatively, the received number may be determined using data (data indicating the correspondence between the number and the controller) stored separately in a memory (for example, the flash memory 26), or from the loader 50 in the machine language. The determination may be made using target identification information (information for identifying which machine language object is executed by which controller) transmitted together with the object and the number.

その後、拡張コントローラ30では、機械語オブジェクト配置処理手段34Hにより、ローダ50から基本コントローラ20のマイクロプロセッサ22を介して送信されてくる変更後の機械語オブジェクトを、対応する番号とともに受信し(ステップS51)、受信した変更後の機械語オブジェクトのうち自コントローラ30用の変更後の機械語オブジェクトのみ(なお、基本コントローラ20から拡張コントローラ30用の変更後の機械語オブジェクトのみが送信されてくる場合には、受信した変更後の機械語オブジェクトの全てとなる。)を、自己の主メモリ33に格納して配置する(ステップS52)。   Thereafter, in the extended controller 30, the machine language object placement processing unit 34H receives the machine language object after the change transmitted from the loader 50 via the microprocessor 22 of the basic controller 20 together with the corresponding number (step S51). ) Of the received machine language objects after the change, only the machine language object after the change for the own controller 30 (when only the machine language object after the change for the extended controller 30 is transmitted from the basic controller 20) Are all of the received machine language objects after change.) Are stored in the main memory 33 of their own (step S52).

なお、基本コントローラ20から、拡張コントローラ30用の変更後の機械語オブジェクト以外の変更後の機械語オブジェクトも含めて送信されてきた場合には、現在使用中の実行管理テーブルT1を用いて、受信した番号の示す実行管理テーブルT1上の位置に、機械語オブジェクトの格納先アドレスが記録されているか否かにより、自コントローラ30用の変更後の機械語オブジェクトであるか否かを判断することができる。   Note that when the basic controller 20 transmits a machine language object after the change other than the machine language object after the change for the extended controller 30, it is received by using the execution management table T1 currently in use. It is possible to determine whether or not the machine language object has been changed for the controller 30 based on whether or not the storage destination address of the machine language object is recorded at the position on the execution management table T1 indicated by the number. it can.

続いて、機械語オブジェクト配置処理手段34Hにより、主メモリ33に配置した変更後の機械語オブジェクトの格納先アドレスを、主メモリ33に記憶されている現在使用中の実行管理テーブルT1とは別の実行管理テーブルT2に記録する(ステップS53)。   Subsequently, the machine language object placement processing unit 34H sets the storage address of the machine language object after the change placed in the main memory 33 to be different from the currently used execution management table T1 stored in the main memory 33. It records in the execution management table T2 (step S53).

例えば、図9に示すように、変更後の機械語オブジェクトP2’を、番号2とともに受信した場合には、受信した変更後の機械語オブジェクトP2’を主メモリ33に格納して配置するとともに、番号2であるから、実行管理テーブルT2の2番目の位置に、変更後の機械語オブジェクトP2’の格納先アドレスを記録する。   For example, as shown in FIG. 9, when the machine language object P2 ′ after change is received together with the number 2, the received machine language object P2 ′ after change is stored in the main memory 33 and arranged. Since the number is 2, the storage destination address of the machine language object P2 ′ after the change is recorded at the second position in the execution management table T2.

そして、各コントローラ20,30で主メモリ23,33への変更後の機械語オブジェクトの格納が完了した後(複数の変更後の機械語オブジェクトがある場合には、全ての変更後の機械語オブジェクトの格納が完了した後)に、ローダ50では、機械語オブジェクト送信処理手段56により、機械語オブジェクトの送信完了通知の信号を、管理部40を介して(但し、図6では、管理部40の中継処理の図示は省略されている。)、各コントローラ20,30のマイクロプロセッサ22,32へ送信する(ステップS54)。   Then, after storing the changed machine language objects in the main memories 23 and 33 in the controllers 20 and 30 (if there are a plurality of changed machine language objects, all the changed machine language objects In the loader 50, the machine language object transmission processing means 56 sends a machine language object transmission completion notification signal via the management unit 40 (however, in FIG. The illustration of the relay process is omitted.), The data is transmitted to the microprocessors 22 and 32 of the controllers 20 and 30 (step S54).

それから、基本コントローラ20では、実行管理テーブル補完処理手段24Nにより、ローダ50から送信されてくる変更後の機械語オブジェクトの送信完了通知の信号を受信し(ステップS55)、別の実行管理テーブルT2の補完処理、すなわち現在使用中の実行管理テーブルT1に記録された機械語オブジェクトの格納先アドレスのうち、変更する必要のない機械語オブジェクトの格納先アドレスを、そのまま利用して別の実行管理テーブルT2に記録する処理を実行する(ステップS56)。   Then, in the basic controller 20, the execution management table supplement processing means 24N receives the signal of the completion of transmission of the machine language object after the change transmitted from the loader 50 (step S55), and stores it in another execution management table T2. Complementary processing, that is, the storage destination address of the machine language object that does not need to be changed among the storage destination addresses of the machine language object recorded in the currently used execution management table T1, is used as it is, and another execution management table T2 The process of recording in (S56) is executed.

また、拡張コントローラ30でも、実行管理テーブル補完処理手段34Jにより、ローダ50から送信されてくる変更後の機械語オブジェクトの送信完了通知の信号を受信し(ステップS57)、別の実行管理テーブルT2の補完処理、すなわち現在使用中の実行管理テーブルT1に記録された機械語オブジェクトの格納先アドレスのうち、変更する必要のない機械語オブジェクトの格納先アドレスを、そのまま利用して別の実行管理テーブルT2に記録する処理を実行する(ステップS58)。   Also in the extended controller 30, the execution management table complement processing means 34J receives the signal of the completion of transmission of the machine language object after the change sent from the loader 50 (step S57), and the other controller in the other execution management table T2. Complementary processing, that is, the storage destination address of the machine language object that does not need to be changed among the storage destination addresses of the machine language object recorded in the currently used execution management table T1, is used as it is, and another execution management table T2 The process of recording is executed (step S58).

例えば、図10に示すように、基本コントローラ20では、主メモリ23に記憶されている別の実行管理テーブルT2の補完処理として、機械語オブジェクトP1は変更されていないので、そのまま利用し、現在使用中の実行管理テーブルT1の1番目の位置に記録されている機械語オブジェクトP1の格納先アドレスを、別の実行管理テーブルT2の1番目の位置に記録する。また、図10に示すように、拡張コントローラ30では、主メモリ33に記憶されている別の実行管理テーブルT2の補完処理として、機械語オブジェクトP3は変更されていないので、そのまま利用し、現在使用中の実行管理テーブルT1の3番目の位置に記録されている機械語オブジェクトP3の格納先アドレスを、別の実行管理テーブルT2の3番目の位置に記録する。   For example, as shown in FIG. 10, the basic controller 20 uses the machine language object P1 as it is as a complementary process of another execution management table T2 stored in the main memory 23, so that it is used as it is and is currently used. The storage address of the machine language object P1 recorded at the first position of the execution management table T1 is recorded at the first position of another execution management table T2. Also, as shown in FIG. 10, in the extended controller 30, the machine language object P3 has not been changed as a complementary process to another execution management table T2 stored in the main memory 33, so it is used as it is and is currently used. The storage address of the machine language object P3 recorded at the third position of the execution management table T1 is recorded at the third position of another execution management table T2.

次に、ローダ50から、管理部40に対してプログラムの切替指示の信号を送信し(ステップS59)、ローダ50でのプログラム変更に関する処理を終了する(ステップS60)。管理部40では、プログラム切替カウンタ値算出・設定処理手段44Aにより、ローダ50から送信されてくるプログラムの切替指示の信号を受信し(ステップS61)、同期フリーランカウンタ45Aの現在値(図7の例では、M)に、予め定められたカウント数C2(例えば、C2=2カウント等)を加算することにより、アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値(図7の例では、K)を、K=M+C2として算出し、算出した同期フリーランカウンタ値(図7の例では、K)を、プログラム切替カウンタ値記憶手段45C(図1参照)に記憶させ(ステップS62)、管理部40での処理Cを終了する(ステップS63)。   Next, the loader 50 transmits a program switching instruction signal to the management unit 40 (step S59), and the processing related to program change in the loader 50 is terminated (step S60). In the management unit 40, the program switching counter value calculation / setting processing unit 44A receives a program switching instruction signal transmitted from the loader 50 (step S61), and the current value of the synchronous free-run counter 45A (FIG. 7). In the example, a synchronous free-run counter value indicating the switching timing of the application program (K in the example of FIG. 7) by adding a predetermined count number C2 (for example, C2 = 2 count) to M). Is calculated as K = M + C2, and the calculated synchronous free-run counter value (K in the example of FIG. 7) is stored in the program switching counter value storage means 45C (see FIG. 1) (step S62). The process C is terminated (step S63).

その後、基本コントローラ20では、プログラム切替タイミング判断処理手段24Pにより、同期フリーランカウンタ25A(図1参照)の現在値と、プログラム切替カウンタ値記憶手段25C(図1参照)に記憶された同期フリーランカウンタ値(図7の例では、K)とが一致したか否かを判断することにより、アプリケーションプログラムの切替タイミングが到来したか否かを判断する処理を繰り返し実行する(ステップS64)。   Thereafter, in the basic controller 20, the program switching timing determination processing means 24P performs the synchronization free run stored in the current value of the synchronous free run counter 25A (see FIG. 1) and the program switching counter value storage means 25C (see FIG. 1). By determining whether or not the counter value (K in the example of FIG. 7) matches, the process of determining whether or not the application program switching timing has arrived is repeatedly executed (step S64).

そして、ステップS64で、プログラム切替タイミング判断処理手段24Pにより双方が一致した(つまり、アプリケーションプログラムの切替タイミングが到来した)と判断した場合には、実行管理テーブル切替処理手段24Qにより、主メモリ23に記憶されている基本コントローラ20用の現在実行中の実行管理テーブルT1を、別の実行管理テーブルT2へ切り替える処理、すなわち、図11に示すように、主メモリ23に記憶されているプログラム実行管理表ポインタを、現在実行中の実行管理テーブルT1のアドレスから別の実行管理テーブルT2のアドレスへと切り替える処理を実行し(ステップS65)、基本コントローラ20での処理Cを終了する(ステップS66)。   In step S64, if the program switching timing determination processing unit 24P determines that the two match (that is, the application program switching timing has arrived), the execution management table switching processing unit 24Q stores the information in the main memory 23. Processing for switching the currently executed execution management table T1 for the basic controller 20 to another execution management table T2, ie, a program execution management table stored in the main memory 23 as shown in FIG. A process of switching the pointer from the address of the currently executing execution management table T1 to the address of another execution management table T2 is executed (step S65), and the process C in the basic controller 20 is terminated (step S66).

また、拡張コントローラ30では、プログラム切替タイミング判断処理手段34Kにより、同期フリーランカウンタ35A(図1参照)の現在値と、プログラム切替カウンタ値記憶手段35C(図1参照)に記憶された同期フリーランカウンタ値(図7の例では、K)とが一致したか否かを判断することにより、アプリケーションプログラムの切替タイミングが到来したか否かを判断する処理を繰り返し実行する(ステップS67)。   Further, in the extended controller 30, the program switching timing determination processing means 34K uses the current value of the synchronous free run counter 35A (see FIG. 1) and the synchronous free run stored in the program switching counter value storage means 35C (see FIG. 1). By determining whether or not the counter value (K in the example of FIG. 7) matches, the process of determining whether or not the application program switching timing has come is repeatedly executed (step S67).

そして、ステップS67で、プログラム切替タイミング判断処理手段34Kにより双方が一致した(つまり、アプリケーションプログラムの切替タイミングが到来した)と判断した場合には、実行管理テーブル切替処理手段34Lにより、主メモリ33に記憶されている拡張コントローラ30用の現在実行中の実行管理テーブルT1を、別の実行管理テーブルT2へ切り替える処理、すなわち、図11に示すように、主メモリ33に記憶されているプログラム実行管理表ポインタを、現在実行中の実行管理テーブルT1のアドレスから別の実行管理テーブルT2のアドレスへと切り替える処理を実行し(ステップS68)、拡張コントローラ30での処理Cを終了する(ステップS69)。   In step S67, when it is determined by the program switching timing determination processing unit 34K that both match (that is, the switching timing of the application program has arrived), the execution management table switching processing unit 34L stores it in the main memory 33. Processing for switching the currently executed execution management table T1 for the extended controller 30 to another execution management table T2, that is, a program execution management table stored in the main memory 33 as shown in FIG. A process of switching the pointer from the address of the currently executing execution management table T1 to the address of another execution management table T2 is executed (step S68), and the process C in the expansion controller 30 is terminated (step S69).

(システム処理の全体の流れ)   (Overall flow of system processing)

図7において、先ず、図示は省略されているが、リセット状態解除により、基本コントローラ20および拡張コントローラ30において、システムイニシャル処理手段24A,34Aによる処理が開始される。この際、基本コントローラ20のシステムイニシャル処理手段24Aにより、同期フリーランカウンタ25Aが起動され、ゼロからのカウントが開始される。なお、同期フリーランカウンタ25Aの状態は、内部バス11を介して、共有メモリ機能により、拡張コントローラ30や管理部40に設けられた同期フリーランカウンタ35A,45Aに反映される。   In FIG. 7, first, although not shown, the processing by the system initial processing means 24A and 34A is started in the basic controller 20 and the extended controller 30 by the reset state cancellation. At this time, the synchronous free-run counter 25A is activated by the system initial processing means 24A of the basic controller 20 and starts counting from zero. The state of the synchronous free-run counter 25A is reflected to the synchronous free-run counters 35A and 45A provided in the expansion controller 30 and the management unit 40 via the internal bus 11 by the shared memory function.

また、基本コントローラ20のシステムイニシャル処理手段24Aにより、基本コントローラ20用のステータス記憶手段25Fに記憶されたステータスが、アプリケーション停止状態(STOP)に設定され、この状態が内部バス11を介して、共有メモリ機能により、拡張コントローラ30や管理部40に設けられた基本コントローラ20用のステータス記憶手段35F,45Fに記憶されたステータスに反映される。同様に、拡張コントローラ30のシステムイニシャル処理手段34Aにより、拡張コントローラ30用のステータス記憶手段35Gに記憶されたステータスが、アプリケーション停止状態(STOP)に設定され、この状態が内部バス11を介して、共有メモリ機能により、基本コントローラ20や管理部40に設けられた拡張コントローラ30用のステータス記憶手段25G,45Gに記憶されたステータスに反映される。なお、ステータスは、最初にイニシャル状態としておき、ハンドシェイクしてイニシャル処理を完了してから、アプリケーション停止状態(STOP)としてもよい。   Further, the system initial processing means 24A of the basic controller 20 sets the status stored in the status storage means 25F for the basic controller 20 to the application stop state (STOP), and this state is shared via the internal bus 11. By the memory function, it is reflected in the status stored in the status storage means 35F, 45F for the basic controller 20 provided in the expansion controller 30 or the management unit 40. Similarly, the status stored in the status storage unit 35G for the expansion controller 30 is set to the application stop state (STOP) by the system initial processing unit 34A of the expansion controller 30, and this state is set via the internal bus 11. The shared memory function reflects the status stored in the status storage means 25G and 45G for the expansion controller 30 provided in the basic controller 20 and the management unit 40. Note that the status may be set to the initial state first, and after handshaking to complete the initial processing, the application may be stopped (STOP).

続いて、基本コントローラ20のアプリケーション起動周期待機処理手段24Bによるアプリケーション起動周期の到来監視が開始され、以降、図7中の点線で示された縦線のように、一定周期(例えば1ミリ秒間隔等)で、すなわちアプリケーション起動周期のタイミングで、処理A(図4参照)の同期割込みが繰り返し実行されるとともに、同期フリーランカウンタ25Aのカウントアップが進んでいく。図7では、アプリケーション起動周期の到来(図4のステップS3)が点線の縦線で示され、同期フリーランカウンタ25Aのカウントアップ(図4のステップS4)で点線の直後からカウンタ値が1カウント増加し、さらにその直後の同期割込み信号の送受信(図4のステップS5,S6)が下方に向かう太い矢印で示されている。   Subsequently, the arrival monitoring of the application start cycle by the application start cycle standby processing means 24B of the basic controller 20 is started, and thereafter, as shown by the vertical lines shown by dotted lines in FIG. Etc.), that is, at the timing of the application activation cycle, the synchronous interrupt of the process A (see FIG. 4) is repeatedly executed, and the synchronous free-run counter 25A is incremented. In FIG. 7, the arrival of the application start cycle (step S3 in FIG. 4) is indicated by a dotted vertical line, and the counter value is counted by 1 immediately after the dotted line when the synchronous free-run counter 25A counts up (step S4 in FIG. 4). The transmission / reception (steps S5 and S6 in FIG. 4) of the synchronous interrupt signal immediately after that is indicated by a thick arrow pointing downward.

その後、システムイニシャル処理手段24A,34Aにより、図示は省略されているが、ハンドシェイク(通信用パラメータの取り決め等の通信規律の確立処理)を行うことにより、基本コントローラ20と拡張コントローラ30との間のイニシャル完了待ち合わせを行う。   After that, although not shown by the system initial processing means 24A, 34A, a handshake (processing for establishing communication discipline such as communication parameter arrangement) is performed, so that the basic controller 20 and the extended controller 30 are connected. Wait for initial completion.

そして、イニシャル処理の完了後には、基本コントローラ20および拡張コントローラ30の双方とも、イニシャル状態(不図示)からアプリケーション停止状態となり、基本コントローラ20の外部要求待機処理手段24Fによる外部からの起動要求待ち(起動のスイッチ操作待ち)を行う処理B(図5参照)が開始される。   After the initial processing is completed, both the basic controller 20 and the expansion controller 30 are changed from the initial state (not shown) to the application stopped state, and the external request waiting processing means 24F of the basic controller 20 waits for an external activation request ( Processing B (see FIG. 5) for starting the activation switch operation) is started.

この際、処理B(図5参照)に対し、処理A(図4参照)は、一定周期での割込みとなるので、図7に示すように、処理Aと処理Bとが交互に実行されるタイムチャートとなる。但し、処理Aは、割込みの処理であるため、図7のタイムチャートにおいて、図4の処理Aの流れは何回も繰り返されるが、図5の処理Bの流れは1回である。なお、図7中において、点線で示されたアプリケーション起動周期の時間間隔(例えば1ミリ秒等)を示す長さと、処理Aの実行時間を示す長さと、処理Bの実行時間を示す長さとは、実際の時間の比率を示すものではなく、各処理の時間的関係をイメージし易くするための説明の便宜上の記載である。   At this time, since the process A (see FIG. 4) is interrupted at a constant cycle with respect to the process B (see FIG. 5), the process A and the process B are alternately executed as shown in FIG. It becomes a time chart. However, since the process A is an interrupt process, the flow of the process A of FIG. 4 is repeated many times in the time chart of FIG. 7, but the flow of the process B of FIG. In FIG. 7, the length indicating the time interval (for example, 1 millisecond) of the application start cycle indicated by the dotted line, the length indicating the execution time of the process A, and the length indicating the execution time of the process B are as follows. However, it does not show the actual time ratio, but is a description for convenience of explanation to make it easier to imagine the temporal relationship of each process.

図7に示すように、同期フリーランカウンタ25Aの値がLになった時点で、外部からの起動要求(図5のステップS23)があったとすると、この時点で、アプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値Nが、見込みで予め定められたカウント数C1を用いて、N=L+C1により算出され、算出された同期フリーランカウンタ値Nの設定が行われる(図5のステップS24)。   As shown in FIG. 7, assuming that there is an external activation request (step S23 in FIG. 5) when the value of the synchronous free-run counter 25A becomes L, the start timing of the application operating state is determined at this point. The synchronous free-run counter value N shown is calculated by N = L + C1 using a prospective predetermined count number C1, and the calculated synchronous free-run counter value N is set (step S24 in FIG. 5). .

それから、基本コントローラ20では、アプリケーションαの起動準備処理が行われ(図5のステップS27)、拡張コントローラ30では、アプリケーションβの起動準備処理が行われる(図5のステップS28)。なお、図7の例では、アプリケーションαの起動準備処理がカウント値(N−1)まで続き、アプリケーションβの起動準備処理がカウント値(N−2)まで続くように記載されているが、これは、各コントローラ20,30によって起動準備処理に要する時間が異なることを示すための記載であり、実際のカウント値ではない。実際には、例えばC1=1000カウント等の大きさの数値を見込んでNを設定するので、Nよりも、もっと手前のカウント値でそれぞれの起動準備処理は終了する。   Then, the basic controller 20 performs application α activation preparation processing (step S27 in FIG. 5), and the extended controller 30 performs application β activation preparation processing (step S28 in FIG. 5). In the example of FIG. 7, it is described that the application α activation preparation process continues to the count value (N−1) and the application β activation preparation process continues to the count value (N−2). Is a description for indicating that the time required for the startup preparation process differs depending on the controllers 20 and 30, and is not an actual count value. Actually, for example, N is set in anticipation of a numerical value such as C1 = 1000 counts. Therefore, each startup preparation process is completed with a count value before N.

その後、アプリケーション起動周期の到来タイミングで、処理Aの同期フリーランカウンタ25Aのカウンタアップ(図4のステップS4)を行って、同期フリーランカウンタ25Aの値がNになったとする。そして、処理Aの同期割込み信号の送受信(図4のステップS5,S6)の後に、ステータスの確認(図4のステップS7,S10)を行っても、このときには、ステータスは、未だアプリケーション停止状態(STOP)であるから、アプリケーション起動要求(図4のステップS8,S11)は行われない。   Thereafter, it is assumed that the synchronous free-run counter 25A of process A is incremented (step S4 in FIG. 4) at the arrival timing of the application activation cycle, and the value of the synchronous free-run counter 25A becomes N. Even if the status check (steps S7 and S10 in FIG. 4) is performed after the transmission / reception of the synchronous interrupt signal of process A (steps S5 and S6 in FIG. 4), the status is still in the application stopped state ( Therefore, the application activation request (steps S8 and S11 in FIG. 4) is not performed.

この直後に、処理Aの割込みを終了し、処理Bに戻ると、同期フリーランカウンタ25A,35Aの値はNになっているので、アプリケーション運転状態の開始タイミングが到来したと判断され(図5のステップS29,S33)、基本コントローラ20および拡張コントローラ30において、基本コントローラ20用のステータスおよび拡張コントローラ30用のステータスが、それぞれアプリケーション停止状態(STOP)からアプリケーション運転状態(RUN)へ移行される(図5のステップS31,S35)。   Immediately after this, when the interruption of the process A is completed and the process returns to the process B, the values of the synchronous free-run counters 25A and 35A are N, so it is determined that the start timing of the application operating state has arrived (FIG. 5). Steps S29 and S33), in the basic controller 20 and the extended controller 30, the status for the basic controller 20 and the status for the extended controller 30 are respectively shifted from the application stop state (STOP) to the application operation state (RUN) ( Steps S31 and S35 in FIG. 5).

続いて、同期フリーランカウンタ25A,35Aの値が(N+1)になった時点で、処理Aの同期割込み信号の送受信(図4のステップS5,S6)の後に、ステータスの確認(図4のステップS7,S10)を行うと、この時点では、ステータスは、既にアプリケーション運転状態(RUN)へ移行されているので、基本コントローラ20および拡張コントローラ30において、アプリケーションα,βが起動される(図4のステップS8,S11)。以降、同期フリーランカウンタ25A,35Aの値が(N+2),(N+3),…になった時点でも同様であり、ステータスは、アプリケーション運転状態(RUN)となっているので、アプリケーションα,βが起動される(図4のステップS8,S11)。従って、アプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値がNであれば、その次のカウンタ値(N+1)の時点から、アプリケーション運転状態(アプリケーションα,βの一定周期での起動が繰り返される期間)が続くことになる。   Subsequently, when the values of the synchronous free-run counters 25A and 35A reach (N + 1), the status confirmation (steps in FIG. 4) is performed after transmission / reception of the synchronous interrupt signal in step A (steps S5 and S6 in FIG. 4). When S7 and S10) are performed, since the status has already been shifted to the application operating state (RUN) at this time, the applications α and β are started in the basic controller 20 and the expansion controller 30 (FIG. 4). Steps S8 and S11). Thereafter, the same is true when the values of the synchronous free-run counters 25A, 35A become (N + 2), (N + 3),..., And the status is the application operating state (RUN). It is activated (steps S8 and S11 in FIG. 4). Therefore, if the synchronous free-run counter value indicating the start timing of the application operation state is N, the application operation state (applications α and β are repeatedly activated in a certain cycle from the next counter value (N + 1). Period) will continue.

また、上述したように、同期フリーランカウンタ25A,35Aの値が(N+1)になった時点から、アプリケーションα,βの一定周期での起動が繰り返されるが、アプリケーションα,βは、一定周期内で実行が終了するように作成されているので、各周期におけるアプリケーションα,βの実行の終了後に、運転中のプログラムの更新を受け付ける処理C(図6参照)が待機状態となる。   Further, as described above, the applications α and β are repeatedly started in a certain cycle from the time when the values of the synchronous free-run counters 25A and 35A become (N + 1), but the applications α and β are within a certain cycle. Therefore, the process C (see FIG. 6) for accepting the update of the running program is in a standby state after the execution of the applications α and β in each cycle is completed.

従って、処理C(図6参照)に対し、処理A(図4参照)は、一定周期での割込みとなり、また、その割込みのタイミングで繰り返し起動されるアプリケーションα,βの実行は、各周期内で終了するので、図7に示すように、処理Aと、アプリケーションによる処理APLと、処理Cとが入れ替わりながら実行されるタイムチャートとなる。但し、図7のタイムチャートにおいて、図4の処理Aの流れや、アプリケーションによる処理APLは、何回も繰り返されるが、図6の処理Cの流れは1回である。なお、図7中において、点線で示されたアプリケーション起動周期の時間間隔(例えば1ミリ秒等)を示す長さと、処理Aの実行時間を示す長さと、アプリケーションによる処理APLの実行時間を示す長さと、処理Cの実行時間を示す長さとは、実際の時間の比率を示すものではなく、各処理の時間的関係をイメージし易くするための説明の便宜上の記載である。   Accordingly, the process A (see FIG. 4) is interrupted at a constant cycle with respect to the process C (see FIG. 6), and the execution of the applications α and β that are repeatedly started at the timing of the interrupt is within each cycle. Therefore, as shown in FIG. 7, the process A, the process APL by the application, and the process C are executed while being switched. However, in the time chart of FIG. 7, the flow of the process A in FIG. 4 and the process APL by the application are repeated many times, but the flow of the process C in FIG. 6 is one time. In FIG. 7, the length indicating the time interval (for example, 1 millisecond) of the application start cycle indicated by the dotted line, the length indicating the execution time of the process A, and the length indicating the execution time of the process APL by the application In addition, the length indicating the execution time of the process C does not indicate an actual time ratio, but is a description for convenience of explanation to make it easy to imagine the temporal relationship of each process.

図7に示すように、同期フリーランカウンタ45Aの値がMになる時点までに、変更後の機械語オブジェクトの送信および主メモリ23,33への格納が行われ、同期フリーランカウンタ45Aの値がMになった時点で、ローダ50からのプログラムの切替指示(図6のステップS59,S61)があったとすると、この時点で、プログラムの切替タイミングを示す同期フリーランカウンタ値Kが、見込みで予め定められたカウント数C2を用いて、K=M+C2により算出され、算出された同期フリーランカウンタ値Kの設定が行われる(図6のステップS62)。   As shown in FIG. 7, by the time when the value of the synchronous free-run counter 45A becomes M, the changed machine language object is transmitted and stored in the main memories 23 and 33, and the value of the synchronous free-run counter 45A Assuming that there is a program switching instruction (steps S59 and S61 in FIG. 6) from the loader 50 at the time when becomes M, the synchronous free-run counter value K indicating the program switching timing is expected at this time. A predetermined count number C2 is used to calculate K = M + C2, and the calculated synchronous free-run counter value K is set (step S62 in FIG. 6).

その後、アプリケーション起動周期の到来タイミングで、処理Aの同期フリーランカウンタ25Aのカウンタアップ(図4のステップS4)を行って、同期フリーランカウンタ25Aの値がKになったとする。このとき、処理A(図4参照)の割込みのタイミングで同期して起動されたアプリケーションα,βの実行後に、処理C(図6参照)に戻ると、同期フリーランカウンタ25A,35Aの値はKになっているので、プログラムの切替タイミングが到来したと判断され(図6のステップS64,S67)、基本コントローラ20および拡張コントローラ30において、主メモリ23,33に記憶されている各コントローラ20,30用の現在実行中の実行管理テーブルT1を、別の実行管理テーブルT2へ切り替える処理、すなわち、図11に示すように、主メモリ23,33に記憶されているプログラム実行管理表ポインタを、現在実行中の実行管理テーブルT1のアドレスから別の実行管理テーブルT2のアドレスへと切り替える処理が行われる。   Thereafter, it is assumed that the synchronous free-run counter 25A of process A is incremented (step S4 in FIG. 4) at the arrival timing of the application activation cycle, and the value of the synchronous free-run counter 25A becomes K. At this time, when the processing α (see FIG. 6) is executed after execution of the applications α and β started synchronously at the timing of the interrupt of the processing A (see FIG. 4), the values of the synchronous free-run counters 25A and 35A are Therefore, it is determined that the program switching timing has arrived (steps S64 and S67 in FIG. 6). In the basic controller 20 and the expansion controller 30, the controllers 20, The process of switching the currently executing execution management table T1 for 30 to another execution management table T2, that is, as shown in FIG. 11, the program execution management table pointer stored in the main memories 23 and 33 is A process of switching from the address of the execution management table T1 being executed to the address of another execution management table T2 is performed. It is.

続いて、同期フリーランカウンタ25A,35Aの値が(K+1)になった時点で、処理Aのアプリケーションα,βの起動要求(図4のステップS8,S11)が行われると、この時点では、各コントローラ20,30用のプログラム実行管理表ポインタが既に切り替えられているので、切替後のプログラム実行管理表ポインタが指している実行管理テーブルT2に従って、主メモリ23,33に格納されたプログラムが実行される。すなわち、この時点では、実行管理テーブルが既にT1からT2へ切り替えられているので、切替後の実行管理テーブルT2に従って、主メモリ23,33に格納されたプログラムが実行される。そして、切替後の実行管理テーブルT2には、変更後の機械語プログラムの格納先アドレスが含まれているので、変更後の機械語プログラムを含むアプリケーションプログラムα,βが実行されることになる。従って、プログラムの切替タイミングを示す同期フリーランカウンタ値がKであれば、その次のカウンタ値(K+1)の時点から、切替後のプログラムによる運転状態が続くことになる。   Subsequently, when the values of the synchronous free-run counters 25A and 35A reach (K + 1), when the activation requests for the applications α and β of the process A are made (steps S8 and S11 in FIG. 4), at this time, Since the program execution management table pointers for the controllers 20 and 30 have already been switched, the programs stored in the main memories 23 and 33 are executed according to the execution management table T2 pointed to by the program execution management table pointer after switching. Is done. That is, since the execution management table has already been switched from T1 to T2 at this time, the programs stored in the main memories 23 and 33 are executed according to the switched execution management table T2. Since the changed execution management table T2 includes the storage address of the machine language program after the change, the application programs α and β including the machine language program after the change are executed. Therefore, if the synchronous free-run counter value indicating the switching timing of the program is K, the operation state by the program after switching continues from the time of the next counter value (K + 1).

このような本実施形態によれば、次のような効果がある。すなわち、基本コントローラ20のカウント更新処理手段24Cにより、同期フリーランカウンタ25Aの値を更新していき、基本コントローラ20および拡張コントローラ30の各々のプログラム切替タイミング判断処理手段24P,34Kにより、同期フリーランカウンタ25A,35Aの現在値と、プログラム切替カウンタ値記憶手段25C,35Cに記憶された同期フリーランカウンタ値とが一致したと判断した場合に、各々の実行管理テーブル切替処理手段24Q,34Lにより、各々のコントローラ20,30用の実行管理テーブルT1を、変更後の機械語オブジェクトの格納先アドレスが記録された別の実行管理テーブルT2へ切り替えるので、切替後には、各々のコントローラ20,30で、切替後の実行管理テーブルT2に従って、変更後の機械語オブジェクトを含んで構成される更新されたアプリケーションプログラムα,βを実行することができる。このため、プログラムの同期更新を実現することができる。   According to this embodiment, there are the following effects. That is, the count update processing unit 24C of the basic controller 20 updates the value of the synchronous free run counter 25A, and the program switching timing determination processing units 24P and 34K of the basic controller 20 and the extended controller 30 respectively synchronize free run. When it is determined that the current values of the counters 25A and 35A match the synchronous free-run counter values stored in the program switching counter value storage means 25C and 35C, the respective execution management table switching processing means 24Q and 34L Since the execution management table T1 for each controller 20, 30 is switched to another execution management table T2 in which the storage destination address of the machine language object after the change is recorded, each controller 20, 30 Execution management table T2 after switching Therefore, it is possible to execute the application program α is updated configured to include a machine language object after the change, the beta. For this reason, the synchronous update of a program is realizable.

また、基本コントローラ20の同期割込み送信処理手段24Dおよび拡張コントローラ30の同期割込み受信処理手段34Bにより、同期割込み信号の送受信を行い、基本コントローラ20および拡張コントローラ30の各々のアプリケーション起動要求処理手段24E,34Cにより、同期割込み信号の送受信のタイミングで、各々のアプリケーションα,βの起動要求処理を実行するので(図4参照)、各々のアプリケーションα,βの周期的に繰り返される起動を毎回同期させることができる。   The synchronous interrupt signal is transmitted / received by the synchronous interrupt transmission processing means 24D of the basic controller 20 and the synchronous interrupt reception processing means 34B of the extended controller 30, and the application activation request processing means 24E of each of the basic controller 20 and the extended controller 30 is received. Since the activation request processing of each application α, β is executed at the timing of transmission / reception of the synchronous interrupt signal by 34C (see FIG. 4), the periodically repeated activation of each application α, β is synchronized every time. Can do.

そして、このように周期的に繰り返されるアプリケーションプログラムα,βの起動の同期化を図ることができるので、同期割込み信号の送受信のタイミングで、変更後の機械語オブジェクトを含んで構成される各々のアプリケーションプログラムα,βを同期させて起動することができるため、プログラムの同期更新および同期起動の双方を実現することができる。   Since it is possible to synchronize the activation of the application programs α and β that are periodically repeated in this way, each of the configurations including the machine language object after the change at the timing of transmission and reception of the synchronization interrupt signal Since the application programs α and β can be activated in synchronization, both synchronous update and synchronous activation of the program can be realized.

また、以上のように、基本コントローラ20と拡張コントローラ30との間での同期割込み信号および同期フリーランカウンタ25A,35Aによるタイミング制御により、プログラムの更新の同期化、および周期的に繰り返されるアプリケーションプログラムの起動の同期化を図ることができるので、制御対象の動作の不具合を未然に防止するとともに、高精度な同期制御を実現することができる。   In addition, as described above, the synchronization of the program update and the periodically repeated application program are performed by the synchronous interrupt signal between the basic controller 20 and the extended controller 30 and the timing control by the synchronous free-run counters 25A and 35A. Therefore, it is possible to prevent the malfunction of the operation to be controlled, and to realize highly accurate synchronous control.

さらに、プログラム切替カウンタ値算出・設定処理手段44Aは、同期フリーランカウンタ45Aの現在値に、予め定められたカウント数C2を加算することにより、アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を算出し、設定する構成とされているので、ローダ50からのプログラム切替指示を受け付けたときに、そのときの同期フリーランカウンタ45Aの値を基準として、相対的にアプリケーションプログラムの切替タイミングを定めることができるため、適切でかつ早期の切替タイミングを設定することができる。   Further, the program switching counter value calculation / setting processing means 44A adds a predetermined count number C2 to the current value of the synchronous free-run counter 45A, thereby obtaining a synchronous free-run counter value indicating the switching timing of the application program. Since it is configured to calculate and set, when a program switching instruction from the loader 50 is received, the application program switching timing is relatively determined based on the value of the synchronous free-run counter 45A at that time. Therefore, it is possible to set an appropriate and early switching timing.

なお、本発明は前記実施形態に限定されるものではなく、本発明の目的を達成できる範囲内での変形等は本発明に含まれるものである。   Note that the present invention is not limited to the above-described embodiment, and modifications and the like within a scope where the object of the present invention can be achieved are included in the present invention.

例えば、前記実施形態では、拡張コントローラ30は1つであるものとして説明を行ったが、拡張コントローラ30は複数でもよい。   For example, in the above embodiment, the description has been made assuming that there is one expansion controller 30, but there may be a plurality of expansion controllers 30.

また、前記実施形態では、管理部40に、プログラム切替カウンタ値算出・設定処理手段44Aが設けられていたが、基本コントローラ20に、プログラム切替カウンタ値算出・設定処理手段を設けてもよい。この場合、プログラム切替カウンタ値算出・設定処理手段は、ローダ50からのプログラム切替指示の信号を受信し、このときの同期フリーランカウンタ25Aの現在値に、予め定められたカウント数C2を加算することにより、アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を算出し、算出した同期フリーランカウンタ値をプログラム切替カウンタ値記憶手段25Cに記憶させる構成とすればよい。   In the embodiment, the management unit 40 is provided with the program switching counter value calculation / setting processing means 44A. However, the basic controller 20 may be provided with a program switching counter value calculation / setting processing means. In this case, the program switching counter value calculation / setting processing means receives a program switching instruction signal from the loader 50, and adds a predetermined count number C2 to the current value of the synchronous free-run counter 25A at this time. Thus, the synchronization free-run counter value indicating the switching timing of the application program may be calculated, and the calculated synchronous free-run counter value may be stored in the program switching counter value storage unit 25C.

そして、上記のプログラム切替カウンタ値算出・設定処理手段44Aの機能だけではなく、より一般的には、管理部40の機能(システム処理手段44により実現される機能全般)は、基本コントローラ20の1つの機能として実装されていてもよい。従って、図6に示されている管理部40で実行されるステップS42〜S63の処理は、基本コントローラ20で実行してもよい。   In addition to the function of the program switching counter value calculation / setting processing unit 44A, more generally, the function of the management unit 40 (all functions realized by the system processing unit 44) is 1 of the basic controller 20. It may be implemented as one function. Therefore, the processing of steps S42 to S63 executed by the management unit 40 shown in FIG. 6 may be executed by the basic controller 20.

さらに、前記実施形態では、変更後の機械語オブジェクトは、ローダ50から管理部40を介して(但し、図6では、管理部40の中継処理の図示は省略されている。)基本コントローラ20へ送信された後に、基本コントローラ20から拡張コントローラ30へ送信されるようになっていたが、ローダ50から、管理部40を介して、基本コントローラ20および拡張コントローラ30へ直接に送信するようにしてもよい。つまり、基本コントローラ20から拡張コントローラ30への送信を行わないようにしてもよい。この場合、拡張コントローラ30へ直接に送信される変更後の機械語オブジェクトの中には、自コントローラ30用の変更後の機械語オブジェクトではないものが含まれることになるので、拡張コントローラ30の機械語オブジェクト配置処理手段34Hにより、受信した変更後の機械語オブジェクトが、自コントローラ30用の変更後の機械語オブジェクトであるか否かの判断を行えばよい。なお、管理部40で単なる中継処理を行うのではなく、管理部40のシステム処理手段44により、ローダ50から受信した変更後の機械語オブジェクトが、いずれのコントローラで実行される変更後の機械語オブジェクトであるかを判断し、受信した変更後の機械語オブジェクトのうち基本コントローラ20用の変更後の機械語オブジェクトについては、基本コントローラ20のマイクロプロセッサ22に送信し、拡張コントローラ30用の変更後の機械語オブジェクトについては、拡張コントローラ30のマイクロプロセッサ32に送信するようにしてもよい。   Furthermore, in the above embodiment, the machine language object after the change is sent from the loader 50 to the basic controller 20 via the management unit 40 (however, in FIG. 6, the relay process of the management unit 40 is not shown). After being transmitted, the data was transmitted from the basic controller 20 to the extended controller 30, but may be transmitted directly from the loader 50 to the basic controller 20 and the extended controller 30 via the management unit 40. Good. That is, transmission from the basic controller 20 to the expansion controller 30 may not be performed. In this case, since the machine language object after the change directly transmitted to the extension controller 30 includes an object that is not the machine language object after the change for the own controller 30, the machine of the extension controller 30 is included. The word object arrangement processing unit 34H may determine whether or not the received changed machine language object is a changed machine language object for the controller 30 itself. It should be noted that the changed machine language object received from the loader 50 by the system processing unit 44 of the management unit 40 is the machine code after the change executed by any controller. It is determined whether it is an object, and the machine language object after the change for the basic controller 20 among the received machine language objects after the change is transmitted to the microprocessor 22 of the basic controller 20, and after the change for the extended controller 30 These machine language objects may be transmitted to the microprocessor 32 of the extension controller 30.

また、前記実施形態では、設定用カウンタ値算出・設定処理手段24Gにより、外部からの起動要求を受け付けたときの同期フリーランカウンタ25Aの値を基準として、相対的にアプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値を算出し、設定する構成とされていたが(図5のステップS24)、これに限定されるものではなく、例えば、基本コントローラ20および拡張コントローラ30の双方(3つ以上のコントローラがある場合には、それらの全部)についてのアプリケーション起動準備処理が終了するのをフラグやステータス等を用いて確認してから(つまり、起動準備処理の終了を判断できるようなフラグやステータスを設けておく。)、確認後にアプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値を算出し、設定する構成としてもよい。例えば、全部のアプリケーション起動準備処理が終了するのを確認した時点の同期フリーランカウンタ25Aの値に、予め定められたカウント数C3(例えば、C3=2カウント等)を加算することにより、アプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値を算出し、設定してもよい。しかし、アプリケーション運転状態の開始タイミングの判断処理の容易化という観点からは、前記実施形態のような構成とすることが好ましい。   In the embodiment, the setting counter value calculation / setting processing unit 24G relatively sets the start timing of the application operation state based on the value of the synchronous free-run counter 25A when an activation request from the outside is received. The synchronous free-run counter value shown is calculated and set (step S24 in FIG. 5), but is not limited to this. For example, both the basic controller 20 and the extended controller 30 (three or more) If there are other controllers, check that the application startup preparation process is complete for all of them using a flag, status, etc. (that is, a flag or status that can determine the completion of the startup preparation process) ), Indicating the start timing of the application operating state after confirmation Calculates a period free running counter value, may set. For example, application operation is performed by adding a predetermined count number C3 (for example, C3 = 2 count) to the value of the synchronous free-run counter 25A at the time when it is confirmed that all the application activation preparation processes are completed. A synchronous free-run counter value indicating the start timing of the state may be calculated and set. However, from the viewpoint of facilitating the determination process of the start timing of the application operation state, the configuration as in the above embodiment is preferable.

さらに、前記実施形態では、3つの共有メモリ領域25,35,45でデータを共有する構成とされていたが(図1、図2参照)、それぞれのマイクロプロセッサとバスで接続された1つの共有メモリ領域を設置してもよい。   Furthermore, in the above-described embodiment, the data is shared by the three shared memory areas 25, 35, and 45 (see FIGS. 1 and 2). However, one shared connection connected to each microprocessor by a bus. A memory area may be provided.

また、実用上、同期フリーランカウンタ25Aの値のオーバーフローが問題になることはないが、万一、オーバーフローした場合(外部からの起動要求が著しく遅れた場合等)を考慮し、アプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値の算出処理を、次のようにしてもよい。すなわち、同期フリーランカウンタ25Aの最大値をMAXとし(0〜MAXの値をとるので、カウント総数は(MAX+1)となる。)、算出するアプリケーション運転状態の開始タイミングを示す同期フリーランカウンタ値をNとし、この算出処理の時点での同期フリーランカウンタ25Aの現在値をLとし、予め定められたカウント数をC1(このC1の値は、前記実施形態と同じでよい。)とすると、N=L+C1がMAXを超える場合には、N=L+C1−(MAX+1)とする処理を行ってもよい。つまり、カウント値がMAXとなった後に、0に戻ることを考慮し、カウント総数の(MAX+1)を減じている。なお、同期フリーランカウンタ25Aが1からカウントされるものとすれば(つまり、カウント値がMAXとなった後に、1に戻るとすれば)、1〜MAXの値をとるので、カウント総数はMAXとなり、N=L+C1−MAXでよい。要するに、カウント値がLの時点(外部からの起動要求があった時点)から、カウント数C1の時間分だけ経過した時点を定めることができればよい。   In practice, overflow of the value of the synchronous free-run counter 25A does not become a problem, but in the unlikely event that it overflows (such as when an external startup request is significantly delayed) The calculation process of the synchronous free-run counter value indicating the start timing may be performed as follows. That is, the maximum value of the synchronous free-run counter 25A is set to MAX (the total number of counts is (MAX + 1) because it takes a value of 0 to MAX), and the synchronous free-run counter value indicating the start timing of the application operation state to be calculated is Assuming that N is N, the current value of the synchronous free-run counter 25A at the time of this calculation process is L, and the predetermined number of counts is C1 (the value of C1 may be the same as in the above embodiment), N When L = C1 exceeds MAX, a process of N = L + C1- (MAX + 1) may be performed. That is, in consideration of returning to 0 after the count value becomes MAX, (MAX + 1) of the total count is reduced. If the synchronous free-run counter 25A is counted from 1 (that is, if it returns to 1 after the count value becomes MAX), it takes a value of 1 to MAX, so the total number of counts is MAX. N = L + C1-MAX may be sufficient. In short, it is only necessary to be able to determine the time point when the count number C1 has elapsed from the time point when the count value is L (the time point when the activation request is received from the outside).

以上のように、本発明のプログラマブルコントローラシステムおよびそのプログラム更新方法は、実行中のアプリケーションプログラムを更新する場合に用いるのに適している。   As described above, the programmable controller system and the program update method thereof according to the present invention are suitable for use when updating an application program being executed.

10 プログラマブルコントローラシステム
20 基本コントローラ
24C カウント更新処理手段
24D 同期割込み送信処理手段
24E,34C アプリケーション起動要求処理手段
24M,34H 機械語オブジェクト配置処理手段
24P,34K プログラム切替タイミング判断処理手段
24Q,34L 実行管理テーブル切替処理手段
25,35,45 共有メモリ領域
25A,35A,45A 同期フリーランカウンタ
25C,35C,45C プログラム切替カウンタ値記憶手段
30 拡張コントローラ
34B 同期割込み受信処理手段
40 管理部
44A プログラム切替カウンタ値算出・設定処理手段
α,β アプリケーションプログラム
P1,P2,P3 機械語オブジェクト
P2’ 変更後の機械語オブジェクト
T1,T2 実行管理テーブル
10 Programmable Controller System 20 Basic Controller 24C Count Update Processing Unit 24D Synchronous Interrupt Transmission Processing Unit 24E, 34C Application Activation Request Processing Unit 24M, 34H Machine Language Object Placement Processing Unit 24P, 34K Program Switching Timing Determination Processing Unit 24Q, 34L Execution Management Table Switching processing means 25, 35, 45 Shared memory area 25A, 35A, 45A Synchronous free-run counter 25C, 35C, 45C Program switching counter value storage means 30 Extended controller 34B Synchronous interrupt reception processing means 40 Management unit 44A Program switching counter value calculation / Setting processing means α, β Application program P1, P2, P3 Machine language object P2 'Machine language object after change T1, T2 Execution management Buru

Claims (3)

基本コントローラおよび少なくとも1つの拡張コントローラを備え、これらの複数のコントローラの各々で用意された実行管理テーブルに従って各々のアプリケーションプログラムを実行する構成とされたプログラマブルコントローラシステムであって、
前記基本コントローラおよび前記拡張コントローラで共有される共有メモリ領域に設けられた同期フリーランカウンタと、
前記共有メモリ領域に設けられてアプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を記憶するプログラム切替カウンタ値記憶手段とを備え、
前記基本コントローラは、
前記拡張コントローラへ同期割込み信号を送信する処理を実行する同期割込み送信処理手段と、
前記同期フリーランカウンタに、前記同期割込み信号の1回の送信につき、1カウント若しくは一定数のカウントを加算または減算する処理を実行するカウント更新処理手段とを備え、
前記拡張コントローラは、
前記基本コントローラからの前記同期割込み信号を受信する処理を実行する同期割込み受信処理手段を備え、
前記基本コントローラおよび前記拡張コントローラの各々は、
ローダから送信されてくる変更後の機械語オブジェクトを、各々のコントローラのプロセッサ用の主メモリに格納して配置するとともに、前記変更後の機械語オブジェクトの格納先アドレスを現在使用中の実行管理テーブルとは別の実行管理テーブルに記録する処理を実行する機械語オブジェクト配置処理手段と、
前記同期フリーランカウンタの現在値と前記プログラム切替カウンタ値記憶手段に記憶された前記同期フリーランカウンタ値とが一致したか否かを判断する処理を繰り返し実行するプログラム切替タイミング判断処理手段と、
このプログラム切替タイミング判断処理手段により一致したと判断した場合に、各々のコントローラ用の実行管理テーブルを前記別の実行管理テーブルへ切り替える処理を実行する実行管理テーブル切替処理手段と、
前記同期割込み信号の送受信のタイミングで、各々のコントローラ用の実行管理テーブルに従って実行される各々のアプリケーションプログラムの起動要求処理を実行するアプリケーション起動要求処理手段と
を備えたことを特徴とするプログラマブルコントローラシステム。
A programmable controller system comprising a basic controller and at least one extended controller, and configured to execute each application program according to an execution management table prepared in each of the plurality of controllers,
A synchronous free-run counter provided in a shared memory area shared by the basic controller and the extended controller;
Program switching counter value storage means for storing a synchronous free-run counter value provided in the shared memory area and indicating a switching timing of the application program,
The basic controller is
Synchronous interrupt transmission processing means for executing processing for transmitting a synchronous interrupt signal to the expansion controller;
The synchronous free-run counter comprises a count update processing means for executing a process of adding or subtracting one count or a fixed number of counts per transmission of the synchronous interrupt signal,
The expansion controller is
Synchronous interrupt reception processing means for executing processing for receiving the synchronous interrupt signal from the basic controller,
Each of the basic controller and the expansion controller is
The changed machine language object transmitted from the loader is stored and arranged in the main memory for the processor of each controller, and the storage destination address of the changed machine language object is currently being used. Machine language object placement processing means for executing processing to be recorded in a separate execution management table,
Program switching timing determination processing means for repeatedly executing processing for determining whether or not the current value of the synchronous free run counter matches the synchronous free run counter value stored in the program switching counter value storage means;
An execution management table switching processing means for executing a process of switching the execution management table for each controller to the another execution management table when it is determined by the program switching timing determination processing means;
A programmable controller system comprising: application activation request processing means for executing activation request processing of each application program executed according to an execution management table for each controller at the timing of transmission / reception of the synchronous interrupt signal .
前記複数のコントローラのプロセッサとは別のプロセッサを有する管理部、または前記基本コントローラは、
前記ローダからのプログラム切替指示を受け付けた場合に、前記同期フリーランカウンタの現在値に、予め定められたカウント数を加算または減算することにより、前記アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を算出し、算出した前記同期フリーランカウンタ値を前記プログラム切替カウンタ値記憶手段に記憶させる処理を実行するプログラム切替カウンタ値算出・設定処理手段を備えた
ことを特徴とする請求項1に記載のプログラマブルコントローラシステム。
The management unit having a processor different from the processors of the plurality of controllers, or the basic controller,
When receiving a program switching instruction from the loader, a synchronous free run counter value indicating the switching timing of the application program by adding or subtracting a predetermined count number to the current value of the synchronous free run counter The program switching counter value calculation / setting processing means for executing the process of calculating the synchronous free-run counter value in the program switching counter value storage means is calculated. Programmable controller system.
基本コントローラおよび少なくとも1つの拡張コントローラを備え、これらの複数のコントローラの各々で用意された実行管理テーブルに従って各々のアプリケーションプログラムを実行する構成とされたプログラマブルコントローラシステムのプログラム更新方法であって、
前記基本コントローラおよび前記拡張コントローラで共有される共有メモリ領域に、同期フリーランカウンタと、アプリケーションプログラムの切替タイミングを示す同期フリーランカウンタ値を記憶するプログラム切替カウンタ値記憶手段とを設けておき、
前記基本コントローラの同期割込み送信処理手段が、前記拡張コントローラへ同期割込み信号を送信する処理を実行し、
前記基本コントローラのカウント更新処理手段が、前記同期フリーランカウンタに、前記同期割込み信号の1回の送信につき、1カウント若しくは一定数のカウントを加算または減算する処理を実行し、
前記拡張コントローラの同期割込み受信処理手段が、前記基本コントローラからの前記同期割込み信号を受信する処理を実行し、
前記基本コントローラおよび前記拡張コントローラの各々の機械語オブジェクト配置処理手段が、ローダから送信されてくる変更後の機械語オブジェクトを、各々のコントローラのプロセッサ用の主メモリに格納して配置するとともに、前記変更後の機械語オブジェクトの格納先アドレスを現在使用中の実行管理テーブルとは別の実行管理テーブルに記録する処理を実行し、
前記基本コントローラおよび前記拡張コントローラの各々のプログラム切替タイミング判断処理手段が、前記同期フリーランカウンタの現在値と前記プログラム切替カウンタ値記憶手段に記憶された前記同期フリーランカウンタ値とが一致したか否かを判断する処理を繰り返し実行し、
前記基本コントローラおよび前記拡張コントローラの各々の実行管理テーブル切替処理手段が、前記プログラム切替タイミング判断処理手段により一致したと判断した場合に、各々のコントローラ用の実行管理テーブルを前記別の実行管理テーブルへ切り替える処理を実行し、
前記基本コントローラおよび前記拡張コントローラの各々のアプリケーション起動要求処理手段が、前記同期割込み信号の送受信のタイミングで、各々のコントローラ用の実行管理テーブルに従って実行される各々のアプリケーションプログラムの起動要求処理を実行する
ことを特徴とするプログラマブルコントローラシステムのプログラム更新方法。
A program update method for a programmable controller system comprising a basic controller and at least one extended controller, and configured to execute each application program according to an execution management table prepared in each of the plurality of controllers,
In a shared memory area shared by the basic controller and the extended controller, a synchronous free-run counter and a program switching counter value storage means for storing a synchronous free-run counter value indicating the switching timing of the application program are provided.
The synchronous interrupt transmission processing means of the basic controller executes a process of transmitting a synchronous interrupt signal to the extended controller,
The count update processing means of the basic controller executes a process of adding or subtracting one count or a certain number of counts to the synchronous free-run counter for each transmission of the synchronous interrupt signal,
A synchronous interrupt reception processing means of the extended controller executes a process of receiving the synchronous interrupt signal from the basic controller;
The machine language object arrangement processing means of each of the basic controller and the extended controller stores and arranges the machine language object after the change transmitted from the loader in the main memory for the processor of each controller, and Execute the process of recording the storage address of the machine language object after the change in an execution management table different from the currently used execution management table,
Whether the program switching timing determination processing means of each of the basic controller and the extended controller matches the current value of the synchronous free-run counter with the synchronous free-run counter value stored in the program switching counter value storage means. Repeatedly execute the process of determining whether
When the execution control table switching processing means of each of the basic controller and the extended controller determines that the program switching timing determination processing means matches, the execution management table for each controller is transferred to the other execution management table. Execute the switching process,
The application activation request processing means of each of the basic controller and the extended controller executes activation request processing of each application program executed according to the execution management table for each controller at the transmission / reception timing of the synchronous interrupt signal. A program update method for a programmable controller system.
JP2010164365A 2010-07-21 2010-07-21 Programmable controller system and program updating method thereof Active JP5549455B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010164365A JP5549455B2 (en) 2010-07-21 2010-07-21 Programmable controller system and program updating method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010164365A JP5549455B2 (en) 2010-07-21 2010-07-21 Programmable controller system and program updating method thereof

Publications (2)

Publication Number Publication Date
JP2012027621A true JP2012027621A (en) 2012-02-09
JP5549455B2 JP5549455B2 (en) 2014-07-16

Family

ID=45780492

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010164365A Active JP5549455B2 (en) 2010-07-21 2010-07-21 Programmable controller system and program updating method thereof

Country Status (1)

Country Link
JP (1) JP5549455B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015005224A (en) * 2013-06-21 2015-01-08 富士電機株式会社 Programmable controller system, support device thereof, programmable controller, program
JP2015210790A (en) * 2014-04-30 2015-11-24 ファナック株式会社 Controller that outputs switching notice signal in switching of sequence program
CN107766128A (en) * 2016-08-17 2018-03-06 华为技术有限公司 A kind of method and device for starting application
CN108541307A (en) * 2016-01-07 2018-09-14 三菱电机株式会社 Programmable controller and synchronous control program
JP2021536055A (en) * 2018-08-23 2021-12-23 シーメンス アクチエンゲゼルシヤフトSiemens Aktiengesellschaft Artificial intelligence calculators, control methods and controls, engineer stations and industrial automation systems

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06124262A (en) * 1991-09-18 1994-05-06 Nec Corp System constitution change system
JPH1131133A (en) * 1997-07-11 1999-02-02 Yaskawa Electric Corp Intra-module synchronization method
JPH11338522A (en) * 1998-05-28 1999-12-10 Mitsubishi Electric Corp Servo system controller
JP2000357002A (en) * 1999-06-15 2000-12-26 Canon Inc Unit and method for load control
JP2003076667A (en) * 2001-09-03 2003-03-14 Matsushita Electric Ind Co Ltd Multi-processor system, and program optimizing method
JP2005293569A (en) * 2004-03-11 2005-10-20 Omron Corp Synchronous controller
JP2006268476A (en) * 2005-03-24 2006-10-05 Murata Mfg Co Ltd Heat treatment facility system
JP2007213474A (en) * 2006-02-13 2007-08-23 Yaskawa Electric Corp Motion control system
JP2008077265A (en) * 2006-09-20 2008-04-03 Fuji Electric Fa Components & Systems Co Ltd Program update method for programmable controller
JP2009289131A (en) * 2008-05-30 2009-12-10 Mitsubishi Electric Corp Multi-controller system
JP2012003732A (en) * 2010-06-21 2012-01-05 Fuji Electric Co Ltd Programmable controller system and application start method thereof

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06124262A (en) * 1991-09-18 1994-05-06 Nec Corp System constitution change system
JPH1131133A (en) * 1997-07-11 1999-02-02 Yaskawa Electric Corp Intra-module synchronization method
JPH11338522A (en) * 1998-05-28 1999-12-10 Mitsubishi Electric Corp Servo system controller
JP2000357002A (en) * 1999-06-15 2000-12-26 Canon Inc Unit and method for load control
JP2003076667A (en) * 2001-09-03 2003-03-14 Matsushita Electric Ind Co Ltd Multi-processor system, and program optimizing method
JP2005293569A (en) * 2004-03-11 2005-10-20 Omron Corp Synchronous controller
JP2006268476A (en) * 2005-03-24 2006-10-05 Murata Mfg Co Ltd Heat treatment facility system
JP2007213474A (en) * 2006-02-13 2007-08-23 Yaskawa Electric Corp Motion control system
JP2008077265A (en) * 2006-09-20 2008-04-03 Fuji Electric Fa Components & Systems Co Ltd Program update method for programmable controller
JP2009289131A (en) * 2008-05-30 2009-12-10 Mitsubishi Electric Corp Multi-controller system
JP2012003732A (en) * 2010-06-21 2012-01-05 Fuji Electric Co Ltd Programmable controller system and application start method thereof

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015005224A (en) * 2013-06-21 2015-01-08 富士電機株式会社 Programmable controller system, support device thereof, programmable controller, program
JP2015210790A (en) * 2014-04-30 2015-11-24 ファナック株式会社 Controller that outputs switching notice signal in switching of sequence program
CN108541307A (en) * 2016-01-07 2018-09-14 三菱电机株式会社 Programmable controller and synchronous control program
CN108541307B (en) * 2016-01-07 2021-04-02 三菱电机株式会社 Programmable controller and synchronization control method
CN107766128A (en) * 2016-08-17 2018-03-06 华为技术有限公司 A kind of method and device for starting application
US11132219B2 (en) 2016-08-17 2021-09-28 Huawei Technologies Co., Ltd. Starting method for applications which are closed automatically based on the insufficient memory of the system
JP2021536055A (en) * 2018-08-23 2021-12-23 シーメンス アクチエンゲゼルシヤフトSiemens Aktiengesellschaft Artificial intelligence calculators, control methods and controls, engineer stations and industrial automation systems

Also Published As

Publication number Publication date
JP5549455B2 (en) 2014-07-16

Similar Documents

Publication Publication Date Title
JP5549455B2 (en) Programmable controller system and program updating method thereof
US8190941B2 (en) Field control system
US4263647A (en) Fault monitor for numerical control system
JP5099251B1 (en) PLC CPU unit, PLC system program, recording medium storing PLC system program, PLC system, PLC support device, PLC support program, and recording medium storing PLC support program
KR950012293B1 (en) Information processing apparatus and information processing method using it
JP5218585B2 (en) Control device and system program
US7168075B1 (en) Automation device and updating method
CA3043127C (en) Data prefetching method, apparatus, and system
EP3196717B1 (en) Emulated industrial control
CN114679481A (en) Robot control method and device, storage medium and robot cluster
JP2009070137A (en) Microprocessor control device, and method and program therefor
JP2021089715A (en) System and method for synchronizing communications between multiple processors
US20210064275A1 (en) Control System, Development Assistance Device, and Development Assistance Program
JP5845771B2 (en) Information transmission system and information transmission method
JP2009252113A (en) Information processing apparatus, control method, and computer program
KR20010106407A (en) Peripheral device of programmable controller
JP5540928B2 (en) Programmable controller system and application startup method thereof
KR100459417B1 (en) Task function processing method for multi processor system
JP2014134989A (en) Computer system and computer management method
CN111143141B (en) State machine setting method and system
JP7243575B2 (en) Electronic controller, method of operation thereof, and control program
CN114779883B (en) System clock synchronization method, device, system and storage medium
JP7291840B1 (en) Work instruction communication system and information processing device used therefor
US11360462B2 (en) Support device and support program
JP6394169B2 (en) Simulation device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130614

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140312

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140505

R150 Certificate of patent or registration of utility model

Ref document number: 5549455

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250