JP4793585B2 - Programmable controller - Google Patents

Programmable controller Download PDF

Info

Publication number
JP4793585B2
JP4793585B2 JP2007066485A JP2007066485A JP4793585B2 JP 4793585 B2 JP4793585 B2 JP 4793585B2 JP 2007066485 A JP2007066485 A JP 2007066485A JP 2007066485 A JP2007066485 A JP 2007066485A JP 4793585 B2 JP4793585 B2 JP 4793585B2
Authority
JP
Japan
Prior art keywords
program
memory
plc
asic
processing
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.)
Active
Application number
JP2007066485A
Other languages
Japanese (ja)
Other versions
JP2007280376A (en
Inventor
玲 原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp filed Critical Omron Corp
Priority to JP2007066485A priority Critical patent/JP4793585B2/en
Publication of JP2007280376A publication Critical patent/JP2007280376A/en
Application granted granted Critical
Publication of JP4793585B2 publication Critical patent/JP4793585B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Description

本発明は、専用LSI(以下、ASICと言う)とマイクロプロセッサ(以下、MPUと言う)とを併有するプログラマブル・コントローラ(以下、PLCと言う)に関するものである。   The present invention relates to a programmable controller (hereinafter referred to as PLC) having both a dedicated LSI (hereinafter referred to as ASIC) and a microprocessor (hereinafter referred to as MPU).

ASICとMPUとを備えてPLCとしての機能を実現するようにしたPLCは、従来より種々に知られている(特許文献1参照)。このようなPLCの一例、より具体的には、ASICとMPUとを併有するビルディングブロック型PLCのCPUユニットのハードウェア構成図が図8に示されている。   Various types of PLCs that include an ASIC and an MPU so as to realize a function as a PLC have been conventionally known (see Patent Document 1). An example of such a PLC, more specifically, a hardware configuration diagram of a CPU unit of a building block type PLC having both an ASIC and an MPU is shown in FIG.

同図に示されるように、このCPUユニット12は、C言語等に代表されるMPU言語で記述されたプログラムを実行するMPU121と、ラダー図言語等に代表されるPLC言語で記述されたプログラムを実行するASIC122と、PLCとしてのシステム制御仕様を実現するためのシステムプログラムを格納するためのシステムプログラムメモリ(ROMで構成される)123と、MPUがプログラムを実行する際のワークエリアを提供するワーキングメモリ(RAMで構成される)124と、異常通知の設定や異常ステータスを格納するための設定メモリ(フラッシュメモリ(以下、FROMと言う)で構成される)125と、ユーザの所望する機器制御仕様を実現するためのPLC言語で記述されたユーザプログラムを格納するためのユーザプログラムバッファメモリ(フラッシュメモリ(以下、FROMと言う)で構成される)126と、ASICの実行対象となるプログラムを格納するためのASIC実行対象メモリ(高速動作するRAMで構成される)127と、外部入出力ユニットの入出力割付に対応する入出力データ並びにユーザプログラムで使用される各種データを格納する入出力メモリ(高速動作するRAMで構成される)128とを備えている。   As shown in the figure, the CPU unit 12 includes an MPU 121 that executes a program described in an MPU language represented by C language and a program written in a PLC language represented by ladder diagram language. ASIC 122 to be executed, system program memory (configured by ROM) 123 for storing a system program for realizing system control specifications as a PLC, and working for providing a work area when the MPU executes the program A memory (configured by RAM) 124, a setting memory (configured by flash memory (hereinafter referred to as FROM)) 125 for storing abnormality notification settings and abnormality status, and a device control specification desired by the user To store user programs written in PLC language A user program buffer memory 126 (configured by a flash memory (hereinafter referred to as FROM)) 126 and an ASIC execution target memory (configured by a high-speed RAM) 127 for storing a program to be executed by the ASIC. And an input / output memory (comprising a high-speed RAM) 128 for storing input / output data corresponding to the input / output assignment of the external input / output unit and various data used in the user program.

システムプログラムメモリに格納されたシステムプログラムには、電源ON時イニシャル処理と、共通処理と、演算処理(ユーザプログラム中のASICでは実行できない複雑なデータ演算処理部分等)、I/Oリフレッシュ処理、及び周辺サービス処理のそれぞれに対応するプログラム部分が含まれている。それらの処理に対応する各プログラム部分はいずれもMPU言語にて記述されている。   The system program stored in the system program memory includes initial processing at power-on, common processing, arithmetic processing (such as complicated data arithmetic processing portion that cannot be executed by ASIC in the user program), I / O refresh processing, and A program portion corresponding to each peripheral service process is included. Each program portion corresponding to these processes is described in the MPU language.

電源ON時イニシャル処理に対応するプログラム部分には、電源ON時イニシャル処理として、ユーザプログラムバッファメモリ(FROM)126からASIC実行対象メモリ127へとPLC言語で記述されたユーザプログラムを転送する機能(図8のST01参照)が組み込まれている。   A function for transferring a user program written in the PLC language from the user program buffer memory (FROM) 126 to the ASIC execution target memory 127 as an initial process at the time of power ON (see FIG. 8 ST01) is incorporated.

なお、この電源ON時イニシャル処理に対応するプログラム部分には、その他の機能として、ハードメモリやシステムワークを初期化する機能、実装されているユニットの認識機能、メモリカードからの電源ON時自動転送機能、電源ユニットと実装I/Oテーブルの照合機能、入出力メモリのクリア機能、ユーザプログラムメモリのチェック機能、強制セットやリセット解除等の機能、等々が必要に応じて組み込まれている。   In addition, the program part corresponding to the initial process at the time of power-on includes other functions such as a function for initializing hard memory and system work, a function for recognizing the installed unit, and automatic transfer from the memory card when the power is turned on. Functions, such as a function for checking the power supply unit and the mounted I / O table, a function for clearing the input / output memory, a function for checking the user program memory, a function such as forced set and reset release, are incorporated as necessary.

ASIC122には、ユーザプログラムで使用可能なPLC言語の命令語のうちの大部分(MPU121が処理を担当する命令語を除く)を実行するための機能を実現する回路部分、通信ユニットインターフェースとしての機能を実現する回路部分、メモリアクセスのためのバス調停機能を実現する回路部分等々が含まれている。   The ASIC 122 includes a circuit part that implements a function for executing most of the PLC language instruction words that can be used in the user program (except for the instruction word that the MPU 121 is responsible for processing), and functions as a communication unit interface. And a circuit part for realizing a bus arbitration function for memory access, and the like.

次に、PLC1のCPUユニット12の動作を示すゼネラルフローチャート(従来例)が図9に示されている。同図において、電源投入により処理が開始されると、先ず、MPU121はシステムプログラムメモリ123から電源ON時イニシャル処理(ステップ901)に対応するプログラム部分を読み出して実行する。   Next, a general flowchart (conventional example) showing the operation of the CPU unit 12 of the PLC 1 is shown in FIG. In the figure, when the processing is started by turning on the power, the MPU 121 first reads and executes the program portion corresponding to the initial processing (step 901) when the power is turned on from the system program memory 123.

すると、電源ON時イニシャル処理に相当する各種の機能が実現される。これらの機能の中には、ユーザプログラムバッファメモリ(FROM)126からASIC実行対象メモリ127へとPLC言語で記述されたユーザプログラムを転送する機能(図8のST01参照)も含まれている。   Then, various functions corresponding to the initial process when the power is turned on are realized. These functions include a function of transferring a user program written in the PLC language from the user program buffer memory (FROM) 126 to the ASIC execution target memory 127 (see ST01 in FIG. 8).

以後、図9のフローチャートに示されるように、共通処理(ステップ902)、演算処理(ステップ903)、I/Oリフレッシュ処理(ステップ904)、周辺サービス処理(ステップ905)がサイクリックに実行される。ここで、共通処理(ステップ902)、演算処理(ステップ903)、I/Oリフレッシュ処理(ステップ904)、周辺サービス処理(ステップ905)の一巡実行時間をサイクルタイムと称する。この種のスキャニング型PLCにおいて、入出力応答性を向上させるためには、サイクルタイムをできる限り短縮することが必要とされる。   Thereafter, as shown in the flowchart of FIG. 9, common processing (step 902), calculation processing (step 903), I / O refresh processing (step 904), and peripheral service processing (step 905) are cyclically executed. . Here, a round execution time of the common process (step 902), the calculation process (step 903), the I / O refresh process (step 904), and the peripheral service process (step 905) is referred to as a cycle time. In this type of scanning PLC, in order to improve the input / output response, it is necessary to shorten the cycle time as much as possible.

従来、サイクルタイムを決定する上記処理(ステップ902〜905)の中で、演算処理(ステップ903)に相当するプログラム部分は、MPU121に委ねられる複雑なデータ演算処理等を除いては、主として、ASIC122により実行され、これによりサイクルタイムの短縮化が図られている。   Conventionally, in the above-described processing (steps 902 to 905) for determining the cycle time, the program portion corresponding to the arithmetic processing (step 903) is mainly the ASIC 122 except for the complicated data arithmetic processing that is left to the MPU 121. As a result, the cycle time is shortened.

すなわち、ASIC122は、ASIC実行対象メモリ127からPLC言語で記述されたユーザプログラムの各命令語を順次に読み出す(図8のST02参照)。次いで、ASIC122は、読み出された各命令語を入出力メモリ128の入出力データ並びに設定データ等を参照しつつ解読実行し、その実行結果で入出力メモリ128の出力データを書き換える(図8のST03参照)。以上の動作がユーザプログラムの末尾まで繰り返される。   That is, the ASIC 122 sequentially reads out each instruction word of the user program described in the PLC language from the ASIC execution target memory 127 (see ST02 in FIG. 8). Next, the ASIC 122 decodes and executes each read instruction word while referring to the input / output data and setting data of the input / output memory 128, and rewrites the output data of the input / output memory 128 with the execution result (FIG. 8). (See ST03). The above operation is repeated until the end of the user program.

演算処理(ステップ903)が実行完了すると、続いて、I/Oリフレッシュ処理(ステップ904)、周辺サービス処理(ステップ905)に対応するプログラム部分が順次に実行される。それらの処理については、MPU121がシステムプログラムメモリ123から該当するプログラム部分(いずれもC言語等のMPU言語で記述)を順次に読み出しつつこれを実行することにより実現される(図8のST04参照)。なお、MPU121による上記各プログラム部分の実行に際しては、ワーキングメモリ内のシステムワークエリアが利用される。   When the execution of the arithmetic processing (step 903) is completed, program portions corresponding to the I / O refresh processing (step 904) and the peripheral service processing (step 905) are sequentially executed. These processes are realized by the MPU 121 sequentially reading out the corresponding program parts (both described in MPU language such as C language) from the system program memory 123 (see ST04 in FIG. 8). . Note that the system work area in the working memory is used when the MPU 121 executes the program portions.

なお、共通処理(ステップ902)に対応するプログラムには、例えば、バッテリ異常チェック機能、メモリカード電源チェック機能、ディップスイッチ監視機能、入出力バス(システムバス)のチェック機能、ユーザプログラムのメモリチェック機能、等々が組み込まれている。   The program corresponding to the common processing (step 902) includes, for example, a battery abnormality check function, a memory card power supply check function, a DIP switch monitoring function, an input / output bus (system bus) check function, and a user program memory check function. , Etc. are incorporated.

また、I/Oリフレッシュ処理(ステップ904)に対応するプログラムには、例えば、(1)基本I/Oユニットとの間におけるデータ交換機能、(2)高機能I/Oユニットの割付リレーエリアのサイクリックなデータ交換及びユニット固有のデータ交換機能、(3)CPU高機能ユニットの割付リレーやDMエリアのサイクリックなデータ交換機能、及びユニット固有のデータ交換機能、等々が組み込まれている。   The program corresponding to the I / O refresh process (step 904) includes, for example, (1) a data exchange function with the basic I / O unit, and (2) an allocation relay area of the high function I / O unit. Cyclic data exchange and unit-specific data exchange functions, (3) allocation relays for CPU high-function units, cyclic data exchange functions for DM areas, unit-specific data exchange functions, and the like are incorporated.

さらに、周辺サービス処理(ステップ905)に対応するプログラムには、例えば、イベント発生時のみに実行される、(1)高機能I/Oユニットとのイベントサービス機能、(2)CPU高機能ユニットとのイベントサービス機能、(3)周辺ポートサービス機能、(4)RS232Cポートサービス機能、(5)ファイルアセスサービス機能、(6)通信ポートサービス機能、等々が組み込まれている。
特開2002−358104号公報
Further, the program corresponding to the peripheral service processing (step 905) includes, for example, (1) an event service function with a high-function I / O unit that is executed only when an event occurs, and (2) a CPU high-function unit. Event service function, (3) peripheral port service function, (4) RS232C port service function, (5) file access service function, (6) communication port service function, and the like.
JP 2002-358104 A

しかしながら、このような従来のPLCあっては、PLCの実現に必要な諸々の処理(電源ON時イニシャル処理、共通処理、PLC言語で記述されたユーザプログラムを実行する演算処理、I/Oリフレッシュ処理、周辺サービス処理)のうちで、演算処理の大部分をPLC言語(ラダー図言語等)を実行可能なASICに委ねる一方、それ以外の処理については、MPU言語(C言語等)を実行するMPUに委ねると言うものであるから、この方式においてさらなるサイクルタイムの短縮を図ろうとすると、ASICとして高速動作可能な素子構造のものを採用するか、MPUとして動作速度の高速なものを採用するか、あるいは、演算処理以外の処理(電源ON時イニシャル処理、共通処理、I/Oリフレッシュ処理、周辺サービス処理)を新たに製作されたASICに委ねる他はなく、いずれにしても、大規模な設計変更が必要となって大幅なコストアップに繋がり実用に供し得ないと言う問題点があった。   However, in such a conventional PLC, various processes necessary for realizing the PLC (initial processing at power-on, common processing, arithmetic processing for executing a user program described in the PLC language, I / O refresh processing) In the peripheral service processing), most of the arithmetic processing is left to the ASIC capable of executing the PLC language (ladder diagram language or the like), while the MPU that executes the MPU language (C language or the like) is used for other processing. Therefore, in order to further reduce the cycle time in this method, either an element structure capable of high-speed operation is adopted as an ASIC, or a high-speed operation speed is adopted as an MPU. Or processing other than arithmetic processing (initial processing at power-on, common processing, I / O refresh processing, peripheral service processing ), But in addition to entrust the newly fabricated ASIC and, in any event, change large-scale design there is a problem that not be put to practical use leads to significant cost-up is required.

この発明は、上述の問題点に着目してなされたものであり、その目的とするところは、この種のMPUとASICとを併有するPLCにおいて、既存のPLC資源を有効活用しつつ、入出力応答性の高いPLCを低コストに提供することにある。   The present invention has been made paying attention to the above-mentioned problems, and the object of the present invention is to input / output while effectively utilizing existing PLC resources in a PLC having both of this type of MPU and ASIC. The object is to provide a PLC with high responsiveness at low cost.

この発明は、上記の目的を達成するために、つぎのような構成を有するPLCを提供するものである。   In order to achieve the above object, the present invention provides a PLC having the following configuration.

すなわち、このPLCは、PLCとしてのシステム制御仕様を実現するためのシステムプログラムを格納するためのシステムプログラムメモリと、ユーザの所望する機器制御仕様を実現するためのPLC言語で記述されたユーザプログラムを格納するためのユーザプログラムバッファメモリと、MPU言語で記述されたプログラムを実行するMPUと、PLC言語で記述されたプログラムを実行するASICと、ASICの実行対象となるプログラムを格納するためのASIC実行対象メモリと、を有する。   That is, the PLC includes a system program memory for storing a system program for realizing system control specifications as a PLC, and a user program written in a PLC language for realizing device control specifications desired by the user. User program buffer memory for storing, MPU for executing a program described in MPU language, ASIC for executing a program described in PLC language, and ASIC execution for storing a program to be executed by ASIC And a target memory.

システムプログラムメモリに格納されたシステムプログラムは、MPU言語で記述されかつ電源ON時のイニシャル処理を少なくとも含む第1のプログラム部分と、PLC言語で記述された第2のプログラム部分とを有し、かつ電源ON時のイニシャル処理には、ユーザプログラムバッファメモリからASIC実行対象メモリへとPLC言語で記述されたユーザプログラムを転送する第1の転送処理と、システムプログラムメモリからASIC実行対象メモリへとPLC言語で記述された第2のプログラム部分を転送する第2の転送処理とが含まれている。ここで、「PLC言語で記述された」とは、当該プログラムのソースプログラムを作成する際に、PLC言語(ラダー図言語等)を用いたという意味であり、ASIC実行対象メモリに格納された状態においては、ASICが実行可能なコード(実行可能プログラム)に変換されている。また、「MPU言語で記述された」とは、当該プログラムのソースプログラムを作成する際に、MPU言語(C言語等)を用いたという意味であり、システムプログラムメモリに格納された状態においては、MPUが実行可能なコード(実行可能プログラム)に変換されている。   The system program stored in the system program memory has a first program part described in the MPU language and including at least an initial process at power-on, and a second program part described in the PLC language, and Initial processing at power-on includes first transfer processing for transferring a user program written in the PLC language from the user program buffer memory to the ASIC execution target memory, and PLC language from the system program memory to the ASIC execution target memory. And a second transfer process for transferring the second program part described in (1). Here, “written in the PLC language” means that the PLC language (ladder diagram language or the like) is used when creating the source program of the program, and is stored in the ASIC execution target memory. In FIG. 2, the ASIC is converted into an executable code (executable program). “Written in MPU language” means that the MPU language (C language or the like) was used when creating the source program of the program, and in the state stored in the system program memory, The MPU is converted into executable code (executable program).

このような構成によれば、電源ONと共に、MPUが第1の転送処理と第2の転送処理とを実行することにより、ASIC実行対象メモリには、ユーザプログラムとシステムプログラムの第2のプログラム部分とが転送格納され、しかもそれらの2つのプログラム部分はいずれもPLC言語にて記述されているため、それら2つのプログラム部分をASICにて実行させることができる。そのため、本発明によれば、ユーザプログラムのみならず、システムプログラムの一部についてもASICにてMPUよりも高速に実行させるため、既存のPLC資源を有効活用しつつ、入出力応答性の良好なPLCを低コストに実現することができる。   According to such a configuration, when the power is turned on and the MPU executes the first transfer process and the second transfer process, the ASIC execution target memory has the second program part of the user program and the system program. Are transferred and stored, and the two program parts are both described in the PLC language, so that these two program parts can be executed by the ASIC. Therefore, according to the present invention, not only the user program but also a part of the system program is executed by the ASIC at a speed higher than that of the MPU. Therefore, the existing PLC resources are effectively used and the input / output response is good. PLC can be realized at low cost.

好ましい実施の形態においては、第1の転送処理にて転送されるユーザプログラム部分をASIC実行対象メモリにその先頭から格納すると共に、第2の転送処理にて転送されるシステムプログラム部分をASIC実行対象メモリのユーザプログラム部分に続く空きエリアに格納する。   In the preferred embodiment, the user program portion transferred in the first transfer process is stored in the ASIC execution target memory from the beginning, and the system program portion transferred in the second transfer process is stored in the ASIC execution target. Store in an empty area following the user program portion of the memory.

このような構成によれば、ASIC実行対象メモリ内におけるユーザプログラム配置を変更することなく、ASIC実行対象メモリ内にシステムプログラムの一部を配置することができるため、従前の構成に対して必要最小限の変更を加えるだけで、本発明を実施することができる。   According to such a configuration, a part of the system program can be arranged in the ASIC execution target memory without changing the user program arrangement in the ASIC execution target memory. The invention can be implemented with only minor changes.

好ましい実施の形態においては、ASICには、PLC言語を構成する各命令語が読み出されるたびに、そのオペランドで指定されるアクセス対象アドレスが予め決められたユーザプログラムアクセス範囲に収まっているか否かをチェックし、そのチェック結果に基づいて、アクセス対象メモリへのアクセス可否を制御するアクセス範囲チェック機能を有するアクセス範囲チェック回路が含まれており、かつアクセス範囲チェック回路には、各読み出される命令語がアクセス範囲チェックイネーブルの命令語であると判定されるときに限り、アクセス範囲チェック機能を有効とするプロテクト回路が含まれているようにしてもよい。   In a preferred embodiment, each time an instruction word constituting the PLC language is read, the ASIC determines whether or not the access target address specified by the operand falls within a predetermined user program access range. An access range check circuit having an access range check function for controlling whether or not to access to the memory to be accessed based on the check result is included, and each read instruction word is included in the access range check circuit. Only when it is determined that the instruction word is an access range check enable instruction, a protect circuit for enabling the access range check function may be included.

このような構成によれば、ユーザプログラムを記述するPLC言語の各命令語に関しては、例えばオペーコードの特定ビットを第1の論理値とすることでアクセス範囲チェックディセーブルとする一方、システムプログラムの第2のプログラム部分を記述するPLC言語の各命令語に関しては、例えばオペーコードの特定ビットを第2の論理値とすることでアクセス範囲チェックイネーブルとすることにより、ユーザプログラムに関しては予定のアドレス空間内におけるアクセスを保証しつつも、システムプログラムの第2のプログラム部分に関しては、それよりも広いアドレス空間へのアクセスを可能とすることで、システム設計の自由度を確保することができる。   According to such a configuration, for each instruction word in the PLC language describing the user program, for example, the access range check is disabled by setting a specific bit of the operation code as the first logical value, while For each instruction language in the PLC language that describes two program parts, for example, by enabling the access range check by setting a specific bit of the operation code as the second logical value, the user program is set in the predetermined address space. While guaranteeing access, the second program portion of the system program can secure a degree of freedom in system design by enabling access to a wider address space.

なお、システムプログラムの第2のプログラム部分としては、共通処理、I/Oリフレッシュ処理、及び/又は、周辺サービス処理を含ませることができる。すなわち、この発明によれば、共通処理、I/Oリフレッシュ処理、及び/又は、周辺サービス処理をASICにより実行させることで、サイクルタイムを短縮しつつ、入出力応答制約向上させることができる。   The second program portion of the system program can include common processing, I / O refresh processing, and / or peripheral service processing. That is, according to the present invention, the common process, the I / O refresh process, and / or the peripheral service process are executed by the ASIC, so that the input / output response constraint can be improved while shortening the cycle time.

この発明によれば、電源ONと共に、MPUが第1の転送処理と第2の転送処理とを実行することにより、ASIC実行対象メモリには、ユーザプログラムとシステムプログラムの第2のプログラム部分とが転送格納され、しかもそれらの2つのプログラム部分はいずれもPLC言語にて記述されているため、それら2つのプログラム部分をASICにて実行させることができる。そのため、本発明によれば、ユーザプログラムのみならず、システムプログラムの一部についてもASICにてMPUよりも高速に実行させるため、既存のPLC資源を有効活用しつつ、入出力応答性の良好なPLCを低コストに実現することができる。   According to this invention, when the power is turned on and the MPU executes the first transfer process and the second transfer process, the user program and the second program part of the system program are stored in the ASIC execution target memory. Since these two program parts are transferred and stored and are both described in the PLC language, these two program parts can be executed by the ASIC. Therefore, according to the present invention, not only the user program but also a part of the system program is executed by the ASIC at a speed higher than that of the MPU. Therefore, the existing PLC resources are effectively used and the input / output response is good. PLC can be realized at low cost.

以下に、この発明に係るPLCの好適な実施の一形態を添付図面を参照しながら詳細に説明する。   Hereinafter, a preferred embodiment of a PLC according to the present invention will be described in detail with reference to the accompanying drawings.

PLC全体の基本構成の説明図が図1に示されている。同図(a),(b)に示されるように、この実施形態に係るPLC1は、ビルディングブロック型に構成されたものであり、電源ユニット11と、CPUユニット12と、1台もしくは2台以上の入出力ユニット(I/Oユニット)13,13・・・と、特殊機能ユニット14とを備えて構成されている。   An explanatory diagram of the basic configuration of the entire PLC is shown in FIG. As shown in FIGS. 4A and 4B, the PLC 1 according to this embodiment is configured in a building block type, and includes a power supply unit 11, a CPU unit 12, and one or more units. And input / output units (I / O units) 13, 13... And a special function unit 14.

これらのユニット11〜14は、バックプレーン3上に敷設されたシステムバス(入出バスとも言う)31に対して、それぞれコネクタ3a,3a・・・を介して着脱自在に接続されている。   These units 11 to 14 are detachably connected to a system bus (also referred to as an input / output bus) 31 laid on the backplane 3 via connectors 3a, 3a.

CPUユニット12は、PLC1の全体を統括制御するものであり、この例では、ケーブル5を介して開発支援装置2が接続されている。開発支援装置2は、この例では、パーソナルコンピュータ(以下、パソコンと言う)に、所定のアプリケーションプログラムをインストールすることで構成されている。   The CPU unit 12 performs overall control of the entire PLC 1. In this example, the development support apparatus 2 is connected via the cable 5. In this example, the development support apparatus 2 is configured by installing a predetermined application program in a personal computer (hereinafter referred to as a personal computer).

開発支援装置2には、ユーザプログラムをPLC1からダウンロードしてモニタする機能、ユーザプログラムを作成してPLC1にアップロードする機能、入出力データや設定データをPLC1からダウンロードしてモニタする機能等々が組み込まれている。   The development support apparatus 2 includes a function for downloading and monitoring a user program from the PLC 1, a function for creating a user program and uploading it to the PLC 1, a function for downloading input / output data and setting data from the PLC 1, and the like. ing.

CPUユニット12のハードウェア構成図(本発明)が図2に示されている。同図に示されるように、本発明に係るCPUユニット12は、C言語等に代表されるMPU言語で記述されたプログラムを実行するMPU121と、ラダー図言語等に代表されるPLC言語で記述されたプログラムを実行するASIC122と、PLCとしてのシステム制御仕様を実現するためのシステムプログラムを格納するためのシステムプログラムメモリ(ROMで構成される)123と、MPUがプログラムを実行する際のワークエリアを提供するワーキングメモリ(RAMで構成される)124と、異常通知の設定や異常ステータスを格納するための設定メモリ(フラッシュメモリ(以下、FROMと言う)で構成される)125と、ユーザの所望する機器制御仕様を実現するためのPLC言語で記述されたユーザプログラムを格納するためのユーザプログラムバッファメモリ(フラッシュメモリ(以下、FROMと言う)で構成される)126と、ASICの実行対象となるプログラムを格納するためのASIC実行対象メモリ(高速動作するRAMで構成される)127と、外部入出力ユニットの入出力割付に対応する入出力データ並びにユーザプログラムで使用される各種データを格納する入出力メモリ(高速動作するRAMで構成される)128とを備えている。   FIG. 2 shows a hardware configuration diagram (the present invention) of the CPU unit 12. As shown in the figure, the CPU unit 12 according to the present invention is described in an MPU 121 that executes a program described in an MPU language typified by C language and the PLC language typified by a ladder diagram language. An ASIC 122 for executing the program, a system program memory (configured by ROM) 123 for storing a system program for realizing system control specifications as a PLC, and a work area for the MPU to execute the program. Working memory (configured by RAM) 124 to be provided, setting memory (configured by flash memory (hereinafter referred to as FROM)) 125 for storing anomaly notification settings and anomaly status, and user desired A user program written in the PLC language for realizing device control specifications is stored. A user program buffer memory (consisting of a flash memory (hereinafter referred to as FROM)) 126 and an ASIC execution target memory for storing a program to be executed by the ASIC (high-speed RAM) ) 127 and an input / output memory (comprising a high-speed RAM) 128 for storing input / output data corresponding to the input / output assignment of the external input / output unit and various data used in the user program.

システムプログラムメモリ(ROM)123には、PLCとしてのシステム制御仕様を実現するためのシステム制御用プログラムが格納されている。このシステム制御用プログラムは、図7を参照して後に詳述するように、電源ON時のイニシャル処理、共通処理、演算処理(但し、ASICが実行する部分を除いた処理)、I/Oリフレッシュ処理、周辺サービス処理のそれぞれに対応するプログラム部分を含んでいる。   A system program memory (ROM) 123 stores a system control program for realizing system control specifications as a PLC. As will be described in detail later with reference to FIG. 7, this system control program includes initial processing at power-on, common processing, arithmetic processing (however, processing excluding the portion executed by the ASIC), I / O refresh A program portion corresponding to each of the processing and the peripheral service processing is included.

電源ON時のイニシャル処理に対応するプログラム部分は、C言語等のMPU言語にて記述された第1のプログラム部分と、ラダー言語等のPLC言語で記述された第2のプログラム部分とから構成されている。   The program part corresponding to the initial process when the power is turned on is composed of a first program part described in MPU language such as C language and a second program part described in PLC language such as ladder language. ing.

第1のプログラム部分には、ハードメモリやシステムワークを初期化する処理、実装されているユニットの認識処理、メモリカードからの電源ON時自動転送処理、電源ユニットと実装I/Oテーブルの照合処理、入出力メモリのクリア処理、ユーザプログラムメモリのチェック処理、強制セットやリセット解除等の処理、等々の一般的な電源ON時処理に対応するプログラム部分に加えて、ユーザプログラムバッファメモリ(FROM)126からASIC実行実行対象メモリ(高速RAM)127へとユーザプログラムを転送する処理(第1の転送処理)に対応するプログラム部分と、システムプログラムメモリ(ROM)123からASICが実行実行対象メモリ(高速RAM)127へとシステムプログラムの第2のプログラム部分を転送する処理(第2転送処理)に対応するプログラム部分とが含まれている。   The first program part includes a process for initializing hard memory and system work, a process for recognizing a mounted unit, a process for automatically transferring power from a memory card, and a process for checking a power supply unit and a mounted I / O table. In addition to program portions corresponding to general power-on processing such as input / output memory clear processing, user program memory check processing, forced set and reset release processing, etc., a user program buffer memory (FROM) 126 From the system program memory (ROM) 123 to the execution execution target memory (high-speed RAM), and the program portion corresponding to the processing (first transfer processing) for transferring the user program from the memory to the ASIC execution execution target memory (high-speed RAM) 127. ) 127 to the second program part of the system program A program portion corresponding to the process of transferring (second transfer process) are included.

第2のプログラム部分には、この例にあっては、共通処理と、演算処理(ASICが実行する機能に相当する部分を除く)、I/Oリフレッシュ処理、及び周辺サービス処理のそれぞれに対応するプログラムが含まれている。   In this example, the second program portion corresponds to each of common processing, arithmetic processing (except for the portion corresponding to the function executed by the ASIC), I / O refresh processing, and peripheral service processing. The program is included.

ここで、先に従来例で説明したように、共通処理に対応するプログラムには、例えば、バッテリ異常チェック処理、メモリカード電源チェック処理、ディップスイッチ監視処理、入出力バス(システムバス)のチェック処理、ユーザプログラムのメモリチェック処理、等々に対応するプログラムが組み込まれている。   Here, as described above in the conventional example, the program corresponding to the common process includes, for example, a battery abnormality check process, a memory card power check process, a DIP switch monitoring process, and an input / output bus (system bus) check process. A program corresponding to the memory check process of the user program, etc. is incorporated.

また、I/Oリフレッシュ処理に対応するプログラムには、例えば、基本I/Oユニットとの間におけるデータ交換処理、高機能I/Oユニットの割付リレーエリアのサイクリックなデータ交換及びユニット固有のデータ交換処理、CPU高機能ユニットの割付リレーやDMエリアのサイクリックなデータ交換処理、及びユニット固有のデータ交換処理、等々に相当するプログラムが含まれている。   The program corresponding to the I / O refresh processing includes, for example, data exchange processing with the basic I / O unit, cyclic data exchange in the assigned relay area of the high-function I / O unit, and unit-specific data. Programs corresponding to exchange processing, CPU high-function unit allocation relay, cyclic data exchange processing in the DM area, unit-specific data exchange processing, and the like are included.

さらに、周辺サービス処理に対応するプログラムには、例えば、イベント発生時のみに実行される、高機能I/Oユニットとのイベントサービス処理、CPU高機能ユニットとのイベントサービス処理、周辺ポートサービス処理、RS232Cポートサービス処理、ファイルアセスサービス処理、通信ポートサービス処理、等々に対応するプログラムが含まれている。   Further, the program corresponding to the peripheral service process includes, for example, an event service process with a high function I / O unit, an event service process with a CPU high function unit, a peripheral port service process, which are executed only when an event occurs. Programs corresponding to RS232C port service processing, file access service processing, communication port service processing, and the like are included.

ASIC実行対象メモリ127内の格納内容の説明図が図3に示されている。同図に示されるように、ユーザプログラムバッファメモリ(FROM)126からASIC実行対象メモリ(高速RAM)127に転送されるユーザプログラムは、ASIC実行対象メモリ127内の先頭(AD0)から順に格納される。一方、システムプログラムメモリ(ROM)123からASIC実行対象メモリ(高速RAM)127に転送されるシステムプログラムの第2の部分は、ASIC実行対象メモリ127内のユーザプログラム格納エリア127aに続く空きエリア(システム制御用プログラム格納エリア)127b内の適当な位置に格納される。   An explanatory diagram of the contents stored in the ASIC execution target memory 127 is shown in FIG. As shown in the figure, the user program transferred from the user program buffer memory (FROM) 126 to the ASIC execution target memory (high-speed RAM) 127 is sequentially stored from the head (AD0) in the ASIC execution target memory 127. . On the other hand, the second part of the system program transferred from the system program memory (ROM) 123 to the ASIC execution target memory (high-speed RAM) 127 is an empty area (system) following the user program storage area 127a in the ASIC execution target memory 127. Control program storage area) 127b is stored in an appropriate position.

このようなメモリ内配置によれば、ユーザプログラムに関しては従前通りの配置となるため、ASIC122においてはユーザプログラム処理に関する従前通りの回路構成をそのまま採用することができる一方、システムプログラムの第2のプログラム部分については、ユーザプログラムのサイズに応じたメモリ内配置を自由に選択することができる。   According to such an arrangement in the memory, since the user program is arranged as before, the ASIC 122 can adopt the conventional circuit configuration related to the user program processing as it is, while the second program of the system program. For the portion, it is possible to freely select the arrangement in the memory according to the size of the user program.

ところで、ASIC122には、従前より、PLC言語を構成する各命令語が読み出されるたびに、そのオペランドで指定されるアクセス対象アドレスが予め決められたユーザプログラムアクセス範囲に収まっているか否かをチェックし、そのチェック結果に基づいて、アクセス対象メモリへのアクセス可否を制御するアクセス範囲チェック機能を有するアクセス範囲チェック回路が含まれている。   By the way, the ASIC 122 checks whether or not the access target address specified by the operand is within a predetermined user program access range every time each instruction word constituting the PLC language is read. An access range check circuit having an access range check function for controlling whether or not to access the access target memory is included based on the check result.

このアクセス範囲チェック回路によれば、ユーザプログラムのプログラミング誤り等を原因として、ユーザプログラムの実行により予期せぬアドレス空間へのアクセスが生じて、PLCの誤動作乃至故障に至る危険を未然に防止することができる。   According to this access range check circuit, it is possible to prevent the risk of unexpected malfunction or failure of the PLC due to an unexpected access to the address space caused by the execution of the user program due to a programming error of the user program. Can do.

しかし、本発明にあっては、ASIC実行対象メモリ127内には、ユーザプログラムのみならず、システム制御用プログラムの第2のプログラム部分も格納されており、ASIC122としては、それらのプログラムの双方に対応せねばならない。換言すれば、図4に示されるように、ASICとしては、ユーザプログラムのオペランドで規定されるアドレス空間を超えて、システム制御のための拡張されたオペランド範囲で規定されるアドレス空間へのアクセスを保証しなければならない。   However, in the present invention, not only the user program but also the second program part of the system control program is stored in the ASIC execution target memory 127, and the ASIC 122 includes both of these programs. You must respond. In other words, as shown in FIG. 4, the ASIC has access to the address space defined by the extended operand range for system control beyond the address space defined by the user program operand. Must be guaranteed.

そこで、この実施形態においては、アクセス範囲チェック回路に対して、各読み出される命令語がアクセス範囲チェックイネーブルの命令語であると判定されるときに限り、アクセス範囲チェック機能を有効とするプロテクト回路を組み込んでいる。   Therefore, in this embodiment, a protection circuit that enables the access range check function only when it is determined that each read instruction word is an access range check enable instruction word for the access range check circuit. Incorporated.

ユーザプログラムとシステム制御プログラムのアクセス範囲チェック回路のブロック図が図5に示されている。なお、このアクセス範囲チェック回路20は、ASIC122に組み込まれるものである。   A block diagram of the access range check circuit of the user program and the system control program is shown in FIG. The access range check circuit 20 is incorporated in the ASIC 122.

同図に示されるように、このアクセス範囲チェック回路20は、ユーザプログラムのアクセス範囲チェック回路20aと、第1のANDゲート20bと、第2のANDゲート20cと、1個のゲート回路20dとを備えている。   As shown in the figure, the access range check circuit 20 includes an access range check circuit 20a for a user program, a first AND gate 20b, a second AND gate 20c, and one gate circuit 20d. I have.

ユーザプログラムのアクセス範囲チェック回路20aは、アクセス対象を特定するアドレスデータ(ADx)とユーザプログラムのアクセス範囲を特定するアドレスデータ(Dk)とに基づいてユーザプログラムアクセス範囲をチェックして範囲外アドレスアクセス信号S1を生成する。ここで、範囲外アドレスアクセス信号S1は、範囲外のときには“1”状態となり、範囲内のときには“0”状態となる。   The user program access range check circuit 20a checks the user program access range based on the address data (ADx) that specifies the access target and the address data (Dk) that specifies the access range of the user program, and accesses the address outside the range. A signal S1 is generated. Here, the out-of-range address access signal S1 is in the “1” state when it is out of the range, and is in the “0” state when it is within the range.

第1のANDゲート20bは、所定の設定レジスタ(図示せず)に設定されたアクセス範囲チェック回路のイネーブル設定状態ST1により開閉制御され、命令語のオペコードの特定ビットに設定されたアクセス範囲チェックイネーブル状態ST2の論理反転したものを通過又は遮断する。ここで、アクセス範囲チェック回路のイネーブル設定状態ST1は、イネーブルのときには“1”状態となり、ディセーブルのときには“0”状態となる。また、命令語のオペコードのアクセス範囲チェックイネーブル状態ST2は、ディセーブルのときには“0”となり、イネーブルのときには“1”となる。   The first AND gate 20b is controlled to be opened and closed by an enable setting state ST1 of an access range check circuit set in a predetermined setting register (not shown), and an access range check enable set in a specific bit of an instruction word opcode. Pass or block the logically inverted version of state ST2. Here, the enable setting state ST1 of the access range check circuit is “1” when enabled and “0” when disabled. The instruction code opcode access range check enable state ST2 is "0" when disabled and "1" when enabled.

第2のANDゲート20cは、プロテクト回路として機能するものであり、第1のANDゲート20bの出力信号S2により開閉制御され、ユーザプログラムのアクセス範囲チェック回路20aから出力される範囲外アドレスアクセス信号S1を通過又は遮断する。ここで、第2のANDゲート20cの出力信号はプロテクト信号S3としてゲート回路20dの開閉制御入力へと供給される。ここで、プロテクト信号S3は、プロテクトありのときには“1”となり、プロテクトなしのときには“0”となる。   The second AND gate 20c functions as a protect circuit, is controlled to open / close by the output signal S2 of the first AND gate 20b, and is out-of-range address access signal S1 output from the access range check circuit 20a of the user program. Pass or block. Here, the output signal of the second AND gate 20c is supplied as the protect signal S3 to the open / close control input of the gate circuit 20d. Here, the protect signal S3 is “1” when protection is provided, and is “0” when protection is not provided.

ゲート回路20dは、アクセス対象メモリ20eに至る制御信号(チップイネーブル信号)の通過経路に介在され、プロテクト信号S3により開閉制御されて、制御信号S4を通過又は遮断する。ここで、ゲート回路20dは、プロテクト信号S3が“1”のとき開状態となり、“0”のとき閉状態となる。   The gate circuit 20d is interposed in the passage path of the control signal (chip enable signal) reaching the access target memory 20e, and is controlled to be opened and closed by the protect signal S3, thereby passing or blocking the control signal S4. Here, the gate circuit 20d is opened when the protect signal S3 is "1", and is closed when "0".

アクセス対象メモリ20eは、制御信号S4が供給されているときに、アクセスアドレスデータ(ADx)で指定されるアドレスに対して、データ(DATA)のリード又はライトが可能になされている。なお、DBはデータバス、ABはアドレスバスである。   The access target memory 20e can read or write data (DATA) to an address specified by the access address data (ADx) when the control signal S4 is supplied. Note that DB is a data bus and AB is an address bus.

以上の構成において、アクセス範囲チェック回路のイネーブル設定状態ST1をイネーブル(“1”)としておけば、第1のAND回路20bは開状態に維持されるから、命令語のオペコードのアクセス範囲チェックイネーブル状態ST2は、論理判定されたのち、第1のANDゲートの出力信号S2として現れる。   In the above configuration, if the enable setting state ST1 of the access range check circuit is enabled (“1”), the first AND circuit 20b is maintained in the open state, so that the access range check enable state of the opcode of the instruction word ST2 appears as an output signal S2 of the first AND gate after logical determination.

したがって、ユーザプログラムを記述するPLC命令のオペコードの特定ビットを第1の論理値(例えば、“0”)とする一方、システムプログラムを記述するPLC命令のオペコードの特定ビットを第2の論理値(例えば、“1”)としておけば、ユーザプログラムを実行する際には、第1のANDゲート20bの出力信号S2は“1”となって、プロテクト回路を構成する第2のANDゲートは開いたままの状態となる。すると、第2のANDゲート20cの出力であるプロテクト信号S3の値は、ユーザプログラムのアクセス範囲チェック回路20aの出力である範囲外アドレスアクセス信号S1の値に追従して変化する。   Therefore, the specific bit of the opcode of the PLC instruction describing the user program is set to the first logical value (for example, “0”), while the specific bit of the opcode of the PLC instruction describing the system program is set to the second logical value ( For example, if “1” is set, when the user program is executed, the output signal S2 of the first AND gate 20b becomes “1”, and the second AND gate constituting the protect circuit is opened. It will remain as it is. Then, the value of the protect signal S3 that is the output of the second AND gate 20c changes following the value of the out-of-range address access signal S1 that is the output of the access range check circuit 20a of the user program.

そのため、ゲート回路20dは、アクセスアドレスデータ(ADx)の値がユーザプログラムアクセス範囲を超えていると閉状態となり、アクセス対象メモリ20eへ供給される制御信号S4を遮断するから、アクセス対象メモリ20eに対するデータリード又はデータライトが禁止されて、誤ったデータによるアクセスがプロテクトされる。   Therefore, the gate circuit 20d is in a closed state when the value of the access address data (ADx) exceeds the user program access range and cuts off the control signal S4 supplied to the access target memory 20e. Data read or data write is prohibited, and access by erroneous data is protected.

一方、システムプログラムの第2のプログラム部分を実行する際には、第1のANDゲート20bの出力信号S2は“0”となって、プロテクト回路を構成する第2のANDゲートは閉じたままの状態となる。すると、第2のANDゲート20cの出力であるプロテクト信号S3の値は、常に、“0”となるから、ゲート回路20dは開いたままの状態のままとなり、仮に、アクセスアドレスデータ(ADx)の値がユーザプログラムアクセス範囲を超えていたとしても、アクセス対象メモリ20eに対するアクセスにプロテクトがかかることはなくなり、システムプログラムを支障なく事項することがかのうとなる。   On the other hand, when the second program portion of the system program is executed, the output signal S2 of the first AND gate 20b becomes “0”, and the second AND gate constituting the protect circuit remains closed. It becomes a state. Then, the value of the protect signal S3, which is the output of the second AND gate 20c, is always “0”, so that the gate circuit 20d remains open, and it is assumed that the access address data (ADx) Even if the value exceeds the user program access range, the access to the access target memory 20e is not protected, and the system program can be handled without any trouble.

なお、アクセス範囲チェック回路のイネーブル設定状態ST1をディセーブル(“0”)としておけば、命令語のオペコードのアクセス範囲チェックイネーブル状態ST2の値に拘わらず、第1のANDゲート20bの出力信号S2は常に“0”となるから、プロテクト信号S3の値も常にプロテクトなし(“0”)となり、ゲート回路20dは開いたままの状態となって、ユーザプログラムのアクセス範囲チェック回路20aの範囲外アドレスアクセス信号S1は無効化され、メモリアクセスに関してプロテクトがかかることはなくなる。   If the enable setting state ST1 of the access range check circuit is disabled (“0”), the output signal S2 of the first AND gate 20b is set regardless of the value of the access range check enable state ST2 of the instruction code opcode. Is always "0", the value of the protect signal S3 is also always unprotected ("0"), the gate circuit 20d remains open, and the address outside the range of the access range check circuit 20a of the user program The access signal S1 is invalidated and the memory access is not protected.

以上説明したアクセス範囲チェック回路のイネーブル設定処理を示すフローチャートが図6に示されている。同図に示されるように、設定レジスタ(図示せず)に記憶されたアクセス範囲チェック回路のイネーブル設定状態ST1がイネーブル(“1”)のとき(ステップ601YES)、ユーザプログラムのアクセス範囲チェック回路20aは有効とされるから(ステップ602)、以後、命令語のオペコードのアクセス範囲チェックイネーブル状態がディセーブルであるか否かが、命令実行毎に繰り返しチェックされ(ステップ603)、アクセス対象メモリ20eに対するプロテクトがかかることになる。   A flowchart showing the enable setting process of the access range check circuit described above is shown in FIG. As shown in the figure, when the enable setting state ST1 of the access range check circuit stored in the setting register (not shown) is enabled ("1") (step 601 YES), the access range check circuit 20a of the user program Is enabled (step 602), and thereafter, whether or not the access range check enable state of the instruction word opcode is disabled is repeatedly checked every time the instruction is executed (step 603), and the access target memory 20e is checked. It will be protected.

これに対して、アクセス範囲チェック回路のイネーブル設定状態ST1がディセーブル(“0”)のときには(ステップ601NO)、アクセス範囲チェック回路20aは常に無効とされ、アクセス対象メモリ20eに対するプロテクトがかかることことはない。   On the other hand, when the enable setting state ST1 of the access range check circuit is disabled (“0”) (NO in step 601), the access range check circuit 20a is always disabled and the access target memory 20e is protected. There is no.

次に、CPU処理を本発明と従来例とで比較して示すフローチャートが図7に示されている。   Next, FIG. 7 shows a flowchart showing the CPU processing in comparison between the present invention and the conventional example.

同図において処理が開始されると、同図(a)に示される従来処理及び同図(b)に示される本発明処理のいずれにおいても、電源ON時のイニシャル処理を実行したのち、サイクルタイムを規定する一連の処理(共通処理、演算処理、I/Oリフレッシュ処理、及び周辺サービス処理)がサイクリックに実行される。   When the process is started in the figure, the cycle time is determined after executing the initial process at the time of turning on the power in both the conventional process shown in the figure (a) and the process of the present invention shown in the figure (b). A series of processes (common processing, arithmetic processing, I / O refresh processing, and peripheral service processing) that define the above are cyclically executed.

このとき、電源オン時のイニシャル処理に着目すると、従来処理にあっては、一般的なイニシャル処理(ステップ711)及びFROM125からASIC実行対象メモリ127へとユーザプログラムを転送する第1の転送処理(ステップ712)がMPU121により実行されるのに対して、本発明処理にあっては、一般的なイニシャル処理(ステップ721)及びFROM125からASIC実行対象メモリ127へとユーザプログラムを転送する第1の転送処理(ステップ722、図2のST11参照)に加えて、ROM123からASIC実行対象メモリ127へとシステムプログラムの第2のプログラム部分を転送する第2の転送処理(ステップ722A、図2のST12参照)がMPU121により実行される。そのため、本発明処理と従来処理とのいずれにおいてもMPU121による処理ではあるものの、本発明処理における電源ON時のイニシャル処理の所要時間(T21)は、処理(ステップ722A)が追加された分だけ、従来処理における電源ON時のイニシャル処理の所要時間(T11)よりも長く(T21>T11)なる。   At this time, focusing on the initial process at power-on, in the conventional process, the general initial process (step 711) and the first transfer process (step 711) and the first transfer process (from the FROM 125 to the ASIC execution target memory 127) Whereas step 712) is executed by the MPU 121, in the process of the present invention, general initial processing (step 721) and the first transfer for transferring the user program from the FROM 125 to the ASIC execution target memory 127 In addition to the processing (step 722, see ST11 in FIG. 2), the second transfer processing for transferring the second program part of the system program from the ROM 123 to the ASIC execution target memory 127 (step 722A, see ST12 in FIG. 2) Is executed by the MPU 121. Therefore, although both the present invention process and the conventional process are processes by the MPU 121, the time required for the initial process when the power is turned on in the present process (T21) is the amount of the process (step 722A) added. It takes longer (T21> T11) than the time required for initial processing (T11) when the power is turned on in the conventional processing.

同様にして、共通処理に着目すると、従来処理にあっては、ハードウェア、ユーザプログラムメモリのチェック処理(ステップ713)及びその他のチェック処理(ステップ714)がMPU121にて実行されるのに対して、本発明処理にあっては、ハードウェア、ユーザプログラムメモリのチェック処理(ステップ723)及びその他のチェック処理(ステップ724)がASIC122にて実行される。そのため、本発明処理と従来処理とのいずれにおいても処理内容は変わらないものの、実行主体がMPU121とASIC122とで異なることから、本発明処理における共通処理の所要時間(T22)は、従来処理における共通処理の所要時間T12よりも短く(T22<T12)なる。   Similarly, focusing on common processing, in the conventional processing, the MPU 121 executes hardware and user program memory check processing (step 713) and other check processing (step 714). In the processing of the present invention, hardware and user program memory check processing (step 723) and other check processing (step 724) are executed by the ASIC 122. For this reason, although the processing content does not change in both the processing of the present invention and the conventional processing, the execution subject is different between the MPU 121 and the ASIC 122. Therefore, the time required for the common processing in the processing of the present invention (T22) is common in the conventional processing. This is shorter than the time required for processing T12 (T22 <T12).

同様にして、演算処理に着目すると、従来処理にあっては、ユーザプログラムの実行処理(ステップ715)がASIC122にて実行されるのに対して、本発明処理にあっても、ユーザプログラムの実行処理(ステップ725)がASIC122にて実行される(図2のST13,14参照)。そのため、本発明処理における演算処理の所要時間(T23)は、従来処理における本発明処理の所要時間(T13)と実質的に変わりはない(T23=T13)。   Similarly, focusing on the arithmetic processing, in the conventional processing, the execution processing of the user program (step 715) is executed by the ASIC 122, whereas in the processing of the present invention, the execution of the user program is executed. The process (step 725) is executed by the ASIC 122 (see ST13 and ST14 in FIG. 2). Therefore, the time required for the arithmetic processing in the processing of the present invention (T23) is not substantially different from the time required for the processing of the present invention in the conventional processing (T13) (T23 = T13).

同様にして、I/Oリフレッシュ処理に着目すると、従来処理にあっては、I/Oリフレッシュ処理(ステップ716)がMPU121にて実行されるのに対して、本発明処理にあっては、I/Oリフレッシュ処理(ステップ726)がASIC122にて実行される。そのため、本発明処理におけるI/Oリフレッシュ処理の所要時間(T24)は、従来処理におけるI/Oリフレッシュ処理(T14)に比べて短く(T24<T14)なる。   Similarly, focusing on the I / O refresh process, in the conventional process, the I / O refresh process (step 716) is executed by the MPU 121, whereas in the process of the present invention, the I / O refresh process is performed. The / O refresh process (step 726) is executed by the ASIC 122. Therefore, the time required for the I / O refresh process (T24) in the process of the present invention is shorter (T24 <T14) than the I / O refresh process (T14) in the conventional process.

同様にして、周辺サービス処理に着目すると、従来処理にあっては、周辺サービス処理(ステップ717)がMPU121にて実行されるのに対して、本発明処理にあっては、周辺サービス処理(ステップ727)がASIC122にて実行される。そのため、本発明処理における周辺サービス処理の所要時間(T25)は、従来処理における周辺サービス処理(T15)に比べて短く(T25<T15)なる。   Similarly, focusing on the peripheral service processing, in the conventional processing, the peripheral service processing (step 717) is executed by the MPU 121, whereas in the processing of the present invention, the peripheral service processing (step 727) is executed by the ASIC 122. Therefore, the time required for the peripheral service process (T25) in the process of the present invention is shorter (T25 <T15) than the peripheral service process (T15) in the conventional process.

その結果、本発明者等の試算によれば、同図(b)に示される本発明処理におけるサイクルタイムは、同図(a)に示される従来処理におけるサイクルタイムの1/3程度に短縮されることが確認された。   As a result, according to a trial calculation by the present inventors, the cycle time in the process of the present invention shown in FIG. 6B is shortened to about 1/3 of the cycle time in the conventional process shown in FIG. It was confirmed that

なお、以上の実施形態においては、共通処理、I/Oリフレッシュ処理、周辺サービス処理のすべてをPLC言語にて記述することにより、それらの処理を全てASIC121にて実行させるように構成したが、どの処理をPLC言語で記述してASIC121に実行させるかは、要求されるサイクルタイムと設計変更のコスト等とを勘案して、任意に決定すればよい。   In the above embodiment, the common process, the I / O refresh process, and the peripheral service process are all described in the PLC language so that all the processes are executed by the ASIC 121. Whether the process is described in the PLC language and executed by the ASIC 121 may be arbitrarily determined in consideration of the required cycle time and the cost of design change.

また、MPU言語にて記述されたシステム制御用プログラムをコンパイラを介してPLC言語に変換する際には、PLC言語を構成する各命令語のオペコードの特定ビットに、その命令語がアクセス範囲チェックにかからなくなるように、ディセーブル(“0”)を設定することが好ましい。   When a system control program written in the MPU language is converted into the PLC language via the compiler, the instruction word is used for checking the access range in the specific bit of the operation code of each instruction word constituting the PLC language. It is preferable to set disable (“0”) so that it does not occur.

この発明によれば、この種のMPUとASICとを併有するPLCにおいて、既存のPLC資源を有効活用しつつ、入出力応答性の高いPLCを低コストに提供することができる。   According to the present invention, in a PLC having both this type of MPU and ASIC, it is possible to provide a PLC with high input / output responsiveness at low cost while effectively utilizing existing PLC resources.

PLC全体の基本構成の説明図である。It is explanatory drawing of the basic composition of the whole PLC. CPUユニットのハードウェア構成図(本発明)である。It is a hardware block diagram (this invention) of a CPU unit. ASIC実行対象メモリの格納内容を示す説明図である。It is explanatory drawing which shows the storage content of ASIC execution object memory. オペランド範囲に関して本発明と従来例とを比較して示すアドレス空間の説明図である。It is explanatory drawing of the address space which compares and shows this invention and a prior art example regarding an operand range. ユーザプログラムとシステム制御プログラムのアクセス範囲チェック回路のブロック図である。It is a block diagram of the access range check circuit of a user program and a system control program. アクセス範囲チェック回路イネーブル設定処理を示すフローチャートである。It is a flowchart which shows an access range check circuit enable setting process. CPU処理を本発明と従来例とで比較して示すフローチャートである。It is a flowchart which compares and shows CPU processing by this invention and a prior art example. CPUユニットのハードウェア構成図(従来例)である。It is a hardware block diagram (conventional example) of a CPU unit. PLCのCPUユニットの動作を示すゼネラルフローチャート(従来例)である。It is a general flowchart (conventional example) which shows operation | movement of CPU unit of PLC.

符号の説明Explanation of symbols

1 PLC
2 開発支援装置
3 バックプレーン
11 電源ユニット
12 CPUユニット
13 入出力ユニット(I/Oユニット)
14 特殊機能ユニット
121 MPU
122 ASIC
123 システムプログラムメモリ(ROM)
124 ワーキングメモリ(RAM)
125 設定メモリ(FROM)
126 ユーザプログラムバッファメモリ(FROM)
127 ASIC実行対象メモリ(高速RAM)
127a ユーザプログラム格納エリア
127b システム制御用プログラム格納エリア
128 入出力メモリ(高速RAM)
20 アクセス範囲チェック回路
ST1 アクセス範囲チェック回路のイネーブル設定状態
ST2 命令オペコードのアクセス範囲チェックイネーブル状態
20a ユーザプログラムのアクセス範囲チェック回路
20b 第1のANDゲート
20c 第2のANDゲート(プロテクト回路)
20d ゲート回路
20e アクセス対象メモリ
ADx アクセス対象となるアドレスデータ
ADk ユーザプログラムアクセス範囲を示すアドレスデータ
S1 範囲外アドレスアクセス信号
S2 第1のANDゲートの出力信号
S3 第2のANDゲート(プロテクト回路)の出力信号(プロテクト信号)
S4 制御信号
DATA 書き込まれるデータ
DB データバス
AD アドレスデータ
1 PLC
2 Development Support Device 3 Backplane 11 Power Supply Unit 12 CPU Unit 13 Input / Output Unit (I / O Unit)
14 Special Function Unit 121 MPU
122 ASIC
123 System program memory (ROM)
124 Working memory (RAM)
125 Setting memory (FROM)
126 User program buffer memory (FROM)
127 ASIC execution target memory (high-speed RAM)
127a User program storage area 127b System control program storage area 128 Input / output memory (high-speed RAM)
20 Access Range Check Circuit ST1 Access Range Check Circuit Enable Setting State ST2 Instruction Opcode Access Range Check Enable State 20a User Program Access Range Check Circuit 20b First AND Gate 20c Second AND Gate (Protect Circuit)
20d Gate circuit 20e Access target memory ADx Address data ADk to be accessed Address data indicating user program access range S1 Out-of-range address access signal S2 Output signal of first AND gate S3 Output of second AND gate (protection circuit) Signal (Protect signal)
S4 Control signal DATA Data to be written DB Data bus AD Address data

Claims (4)

PLCとしてのシステム制御仕様を実現するためのシステムプログラムを格納するための不揮発性メモリで構成されたシステムプログラムメモリと、
ユーザの所望する機器制御仕様を実現するためのPLC言語で記述されたユーザプログラムを格納するための不揮発性メモリで構成されたユーザプログラムバッファメモリと、
MPU言語で記述されたプログラムを実行するMPUと、
PLC言語で記述されたプログラムを実行するASICと、
ASICの実行対象となるプログラムを格納するためのシステムプログラムメモリ及びユーザプログラムバッファメモリより高速動作可能なメモリで構成されたASIC実行対象メモリと、を有し、
システムプログラムメモリに格納されたシステムプログラムは、MPU言語で記述されかつ電源ON時のイニシャル処理を少なくとも含む第1のプログラム部分と、PLC言語で記述された第2のプログラム部分とを有し、かつ
電源ON時のイニシャル処理には、ユーザプログラムバッファメモリからASIC対象メモリへとPLC言語で記述されたユーザプログラムを転送する第1の転送処理と、システムプログラムメモリからASIC実行対象メモリへとPLC言語で記述された第2のプログラム部分を転送する第2の転送処理とが含まれていることを特徴とするPLC。
A system program memory composed of a non-volatile memory for storing a system program for realizing system control specifications as a PLC;
A user program buffer memory composed of a non-volatile memory for storing a user program written in the PLC language for realizing a device control specification desired by the user;
An MPU that executes a program written in the MPU language;
An ASIC that executes a program written in the PLC language;
An ASIC execution target memory composed of a system program memory for storing a program to be executed by the ASIC and a memory capable of operating at a higher speed than the user program buffer memory ,
The system program stored in the system program memory has a first program part described in the MPU language and including at least an initial process at power-on, and a second program part described in the PLC language, and Initial processing at power-on includes first transfer processing for transferring a user program written in the PLC language from the user program buffer memory to the ASIC target memory, and from the system program memory to the ASIC execution target memory in the PLC language. A PLC comprising: a second transfer process for transferring a second program portion described.
第1の転送処理にて転送されるユーザプログラム部分をASIC実行対象メモリにその先頭から格納すると共に、第2の転送処理にて転送されるシステムプログラム部分をASIC実行対象メモリのユーザプログラム部分に続く空きエリアに格納することを特徴とする請求項1に記載のPLC。   The user program part transferred in the first transfer process is stored in the ASIC execution target memory from the beginning, and the system program part transferred in the second transfer process is continued from the user program part of the ASIC execution target memory. The PLC according to claim 1, wherein the PLC is stored in an empty area. ASICには、PLC言語を構成する各命令語が読み出されるたびに、そのオペランドで指定されるアクセス対象アドレスが予め決められたユーザプログラムアクセス範囲に収まっているか否かをチェックし、そのチェック結果に基づいて、アクセス対象メモリへのアクセス可否を制御するアクセス範囲チェック機能を有するアクセス範囲チェック回路が含まれており、かつ
アクセス範囲チェック回路には、各読み出される命令語がアクセス範囲チェックイネーブルの命令語であると判定されるときに限り、アクセス範囲チェック機能を有効とするプロテクト回路が含まれていることを特徴とする請求項1又は2に記載のPLC。
Each time an instruction word constituting the PLC language is read, the ASIC checks whether the access target address specified by the operand falls within a predetermined user program access range. And an access range check circuit having an access range check function for controlling whether or not access to the access target memory is possible, and each read instruction word includes an access range check enable instruction word. 3. The PLC according to claim 1, further comprising a protect circuit that enables the access range check function only when it is determined that
第2のプログラム部分には、
共通処理、I/Oリフレッシュ処理、及び/又は、周辺サービス処理が含まれていることを特徴とする請求項1〜3のいずれかに記載のPLC。
In the second program part,
4. The PLC according to claim 1, wherein common processing, I / O refresh processing, and / or peripheral service processing are included.
JP2007066485A 2006-03-15 2007-03-15 Programmable controller Active JP4793585B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007066485A JP4793585B2 (en) 2006-03-15 2007-03-15 Programmable controller

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2006071845 2006-03-15
JP2006071845 2006-03-15
JP2007066485A JP4793585B2 (en) 2006-03-15 2007-03-15 Programmable controller

Publications (2)

Publication Number Publication Date
JP2007280376A JP2007280376A (en) 2007-10-25
JP4793585B2 true JP4793585B2 (en) 2011-10-12

Family

ID=38681707

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007066485A Active JP4793585B2 (en) 2006-03-15 2007-03-15 Programmable controller

Country Status (1)

Country Link
JP (1) JP4793585B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106063197A (en) * 2014-03-04 2016-10-26 欧姆龙株式会社 Control system, control device, and control method

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8688258B2 (en) 2008-09-11 2014-04-01 Rockwell Automation Technologies, Inc. Method of controlling a machine tool

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01100604A (en) * 1987-10-14 1989-04-18 Fanuc Ltd Programmable controller and its performing system
JP2810317B2 (en) * 1994-03-31 1998-10-15 三菱電機株式会社 Control instruction processing unit
JP3691986B2 (en) * 1999-07-09 2005-09-07 株式会社東芝 Programmable controller
JP3548780B2 (en) * 2001-03-30 2004-07-28 オムロン株式会社 Programmable controller and control method thereof
JP3594035B2 (en) * 2003-03-13 2004-11-24 オムロン株式会社 Control device, CPU unit, user program editing method of programmable controller, and processing method of programmable controller when online editing is performed
JP4450161B2 (en) * 2003-09-05 2010-04-14 オムロン株式会社 Unit and programmable controller
JP4324866B2 (en) * 2004-03-31 2009-09-02 オムロン株式会社 tool

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106063197A (en) * 2014-03-04 2016-10-26 欧姆龙株式会社 Control system, control device, and control method
CN106063197B (en) * 2014-03-04 2019-04-09 欧姆龙株式会社 Control system, control device and control method
US10277417B2 (en) 2014-03-04 2019-04-30 Omron Corporation Control system, control apparatus and control method with input-only communication frame

Also Published As

Publication number Publication date
JP2007280376A (en) 2007-10-25

Similar Documents

Publication Publication Date Title
JP6030987B2 (en) Memory control circuit
JP6044316B2 (en) In-vehicle electronic control unit
JP2010282252A5 (en)
US20060090053A1 (en) Program-controlled unit
US20060112246A1 (en) Program-controlled unit
US9092570B2 (en) Memory management for remote software debuggers and methods
JP4793585B2 (en) Programmable controller
US20060080497A1 (en) Program-controlled unit
JP2008033890A (en) Microcomputer system
TWI530954B (en) Apparatuses for securing software code stored in a non-volatile memory
WO2006051692A1 (en) Nonvolatile memory system
JP2012022479A (en) Microcontroller and its control method
US11586446B1 (en) System and methods for hardware-based PCIe link up based on post silicon characterization
JP5644380B2 (en) Information processing device
JP4522799B2 (en) Semiconductor circuit device and runaway detection method
JP6495290B2 (en) IC wireless device
US20060080519A1 (en) Program-controlled unit
JP2008257415A (en) Controller having program write function
US20120017035A1 (en) Runtime reprogramming of a processor code space memory area
JP6596455B2 (en) Electronic control unit for automobile
JP5024546B2 (en) PLC with interrupt function
EP1975787B1 (en) A method, a computer program, a computer readable medium, and a computer
JP7276755B2 (en) Processing speed matching circuit and microprocessor
JPS63214804A (en) Processor for plc and plc
JP4542556B2 (en) Semiconductor memory system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090123

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101208

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101209

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110202

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110712

R150 Certificate of patent or registration of utility model

Ref document number: 4793585

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140805

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250