[go: up one dir, main page]

JP6686521B2 - Control system and control method - Google Patents

Control system and control method Download PDF

Info

Publication number
JP6686521B2
JP6686521B2 JP2016032611A JP2016032611A JP6686521B2 JP 6686521 B2 JP6686521 B2 JP 6686521B2 JP 2016032611 A JP2016032611 A JP 2016032611A JP 2016032611 A JP2016032611 A JP 2016032611A JP 6686521 B2 JP6686521 B2 JP 6686521B2
Authority
JP
Japan
Prior art keywords
interrupt
program
digital signal
module
interrupt program
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
JP2016032611A
Other languages
Japanese (ja)
Other versions
JP2017062758A (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.)
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
Publication of JP2017062758A publication Critical patent/JP2017062758A/en
Application granted granted Critical
Publication of JP6686521B2 publication Critical patent/JP6686521B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Programmable Controllers (AREA)

Description

本発明は、演算モジュールと入力モジュールとを備える制御システムおよび制御方法に関する。   The present invention relates to a control system and a control method including a calculation module and an input module.

大規模な制御システムでは、システムの構築やメンテナンスの容易性の観点から、必要な機能を複数のモジュールに分散させたプログラマブルコントローラを採用することがある。プログラマブルコントローラは、例えば、演算モジュール、通信モジュール、入出力モジュール(入力モジュール+出力モジュール)、電源モジュールといった複数種類のモジュールで構成され、それぞれのモジュール数を制御対象に合わせて変更可能とすることで、メンテナンスやシステムの拡張性を高めている。   A large-scale control system may employ a programmable controller in which necessary functions are distributed to a plurality of modules from the viewpoint of ease of system construction and maintenance. The programmable controller is composed of a plurality of types of modules such as an arithmetic module, a communication module, an input / output module (input module + output module), and a power supply module, and the number of each module can be changed according to the control target. , Maintenance and system extensibility are enhanced.

プログラマブルコントローラでは、例えば、通信モジュールが、アプリケーションを実行するための実行プログラムを演算モジュールにダウンロードし、演算モジュールが、ダウンロードされた実行プログラムを用い、入出力モジュールを通じて下位の被制御機器から入力データを収集すると共に演算処理を実行し、その演算結果を、入出力モジュールを通じて下位の被制御機器に伝達している(例えば、特許文献1)。   In the programmable controller, for example, the communication module downloads the execution program for executing the application to the arithmetic module, the arithmetic module uses the downloaded execution program, and inputs the input data from the lower controlled device through the input / output module. The data is collected and arithmetic processing is executed, and the arithmetic result is transmitted to a lower controlled device through an input / output module (for example, Patent Document 1).

特開2014−120187号公報JP, 2014-120187, A

上述したように、プログラマブルコントローラでは、演算モジュールが実行プログラムを用いて他のモジュールおよび下位の被制御機器を制御する。このような実行プログラムに基づく演算モジュールの処理は、割込条件の成立に基づいて実行される割込処理と、割込処理による時間的な制約を受けない非割込処理とに大別される。演算モジュールでは、非割込処理を周期的に実行しつつ、また、割込条件が成立すると割込処理を優先的に実行し、割込処理以外の有余時間を有効利用して非割込処理を実行していた。   As described above, in the programmable controller, the arithmetic module controls the other modules and the subordinate controlled devices by using the execution program. The processing of the arithmetic module based on such an execution program is roughly classified into an interrupt processing executed based on the satisfaction of an interrupt condition and a non-interrupt processing not subject to the time constraint of the interrupt processing. . The arithmetic module executes non-interrupt processing cyclically, and preferentially executes interrupt processing when the interrupt conditions are met, and effectively uses the extra time other than interrupt processing to perform non-interrupt processing. Was running.

しかし、アプリケーションの多様化に伴い、実行プログラムの容量も増大し、割込処理および非割込処理の処理時間が共に長期化して、想定される処理時間内で完了することが困難となってきた。ここで、単純に非割込処理の周期を長くしてしまうと、情報の更新頻度も低くなるので、被制御機器の制御能力や分解能の劣化を招くことになってしまう。また、割込処理の処理結果も周期的にしか入出力モジュールに伝達されないので、非割込処理の周期の長期化に伴い割込処理の処理結果が伝達されるタイミングも遅くなることとなる。   However, with the diversification of applications, the capacity of the execution program also increases, and the processing time of both interrupt processing and non-interrupt processing becomes long, making it difficult to complete within the expected processing time. . Here, if the cycle of the non-interruption process is simply lengthened, the frequency of updating the information also becomes low, resulting in deterioration of the control capability and resolution of the controlled device. In addition, since the processing result of the interrupt processing is also transmitted to the input / output module only periodically, the timing of transmitting the processing result of the interrupt processing is delayed as the cycle of the non-interrupt processing becomes longer.

そこで、本発明は、このような課題に鑑み、実行プログラムの容量の増大に拘わらず、被制御機器の制御能力や分解能の劣化を防止することが可能な制御システムおよび制御方法を提供することを目的としている。   Therefore, in view of such a problem, the present invention provides a control system and a control method capable of preventing deterioration of control capability and resolution of a controlled device regardless of an increase in the capacity of an execution program. Has an aim.

上記課題を解決するために、外部からデータを入力する入力モジュールと、入力モジュールとバスを通じて接続され、入力モジュールから受信したデータに基づいて演算を行う演算モジュールと、を備えた本発明の制御システムでは、制御システムで実行されるプログラムは、割込条件の成立を実行契機とする割込プログラムと、割込プログラムを除いた非割込プログラムとを含んでなり、入力モジュールは、割込プログラムに対応付けられた割込条件が成立しているか否か判定する条件判定部と、割込条件が成立していると判定されると、割込プログラムを実行する割込プログラム実行部と、外部のアナログ信号をデジタル信号に変換するADコンバータと、ADコンバータの変換制御を行うAD制御回路と、を備え、割込プログラム実行部は、割込プログラムの実行途中で任意のデジタル信号が必要になると、AD制御回路にADコンバータの変換制御を実行させ、ADコンバータの変換完了後に、任意のデジタル信号のみ正規化して正規化デジタル信号を生成し、正規化デジタル信号によって割込プログラムを実行し、演算モジュールは、割込プログラム実行部の実行結果を参照し、非割込プログラムを実行する非割込プログラム実行部を備えることを特徴とする。
入力モジュールは、デジタル信号をアナログ信号に変換して外部に出力するDAコンバータと、DAコンバータの変換制御を行うDA制御回路と、を備え、割込プログラム実行部は、割込プログラムの実行途中で任意のデジタル信号が生成されると、任意のデジタル信号のみ非正規化して非正規化デジタル信号を生成し、DA制御回路に、非正規化デジタル信号によってDAコンバータの変換制御を実行させてもよい。
上記課題を解決するために、外部からデータを入力する入力モジュールと、入力モジュールとバスを通じて接続され、入力モジュールから受信したデータに基づいて演算を行う演算モジュールと、を備えた本発明の制御システムでは、制御システムで実行されるプログラムは、割込条件の成立を実行契機とする割込プログラムと、割込プログラムを除いた非割込プログラムとを含んでなり、入力モジュールは、割込プログラムに対応付けられた割込条件が成立しているか否か判定する条件判定部と、割込条件が成立していると判定されると、割込プログラムを実行する割込プログラム実行部と、外部のアナログ信号をデジタル信号に変換するADコンバータと、ADコンバータの変換制御を行うAD制御回路と、を備え、AD制御回路は、所定の周期でADコンバータの変換制御を実行し、変換されたデジタル信号を保持し、割込プログラム実行部は、割込プログラムの実行途中で任意のデジタル信号が必要になると、AD制御回路に保持された任意のデジタル信号のみ正規化して正規化デジタル信号を生成し、正規化デジタル信号によって割込プログラムを実行し、演算モジュールは、割込プログラム実行部の実行結果を参照し、非割込プログラムを実行する非割込プログラム実行部を備えることを特徴とする。
入力モジュールは、デジタル信号をアナログ信号に変換して外部に出力するDAコンバータと、DAコンバータの変換制御を行うDA制御回路と、を備え、割込プログラム実行部は、割込プログラムの実行途中で任意のデジタル信号が生成されると、任意のデジタル信号のみ非正規化して非正規化デジタル信号を生成し、非正規化デジタル信号をDA制御回路に保持させ、DA制御回路は、非正規化デジタル信号によってDAコンバータの変換制御を実行してもよい。
In order to solve the above problems, the control system of the present invention includes an input module that inputs data from the outside, and an arithmetic module that is connected to the input module through a bus and performs an arithmetic operation based on the data received from the input module. Then, the program executed by the control system includes an interrupt program triggered by the satisfaction of the interrupt condition and a non-interrupt program excluding the interrupt program. A condition determination unit that determines whether the associated interrupt condition is satisfied, an interrupt program execution unit that executes the interrupt program when it is determined that the interrupt condition is satisfied, and an external comprising an AD converter for converting an analog signal into a digital signal, and AD control circuit for converting the control of the AD converter, the execution interrupt program When an arbitrary digital signal is required during the execution of the interrupt program, the AD control circuit executes the conversion control of the AD converter, and after the conversion of the AD converter is completed, normalizes only the arbitrary digital signal to obtain a normalized digital signal. Is generated and executes the interrupt program by the normalized digital signal, and the arithmetic module includes a non-interrupt program execution unit that refers to the execution result of the interrupt program execution unit and executes the non-interrupt program. And
The input module includes a DA converter that converts a digital signal into an analog signal and outputs the signal to the outside, and a DA control circuit that performs conversion control of the DA converter. The interrupt program execution unit is in the middle of executing the interrupt program. When an arbitrary digital signal is generated, only the arbitrary digital signal is denormalized to generate a denormalized digital signal, and the DA control circuit may be caused to execute the conversion control of the DA converter by the denormalized digital signal. .
In order to solve the above problems, the control system of the present invention includes an input module that inputs data from the outside, and an arithmetic module that is connected to the input module through a bus and performs an arithmetic operation based on the data received from the input module. Then, the program executed by the control system includes an interrupt program triggered by the satisfaction of the interrupt condition and a non-interrupt program excluding the interrupt program. A condition determination unit that determines whether the associated interrupt condition is satisfied, an interrupt program execution unit that executes the interrupt program when it is determined that the interrupt condition is satisfied, and an external The AD control circuit includes an AD converter that converts an analog signal into a digital signal, and an AD control circuit that controls conversion of the AD converter. The conversion control of the AD converter is executed in a cycle of, and the converted digital signal is held. The interrupt program execution unit holds the digital signal in the AD control circuit when an arbitrary digital signal is required during execution of the interrupt program. Generates a normalized digital signal by normalizing only an arbitrary digital signal, executes the interrupt program with the normalized digital signal, and the arithmetic module refers to the execution result of the interrupt program execution unit to execute the non-interrupt program. It is characterized by comprising a non-interruption program execution unit for executing.
The input module includes a DA converter that converts a digital signal into an analog signal and outputs the signal to the outside, and a DA control circuit that performs conversion control of the DA converter. The interrupt program execution unit is in the middle of executing the interrupt program. When an arbitrary digital signal is generated, only the arbitrary digital signal is denormalized to generate a denormalized digital signal, and the denormalized digital signal is held in the DA control circuit. The conversion control of the DA converter may be executed by the signal.

所定の契機に、割込プログラムを入力モジュールに複製するプログラム複製部をさらに備えてもよい。   A program duplication unit that duplicates the interrupt program in the input module may be further provided at a predetermined occasion.

所定の契機は、演算モジュールおよび入力モジュールの起動時であり、プログラム複製部は、割込プログラムを、演算モジュールから入力モジュールに複製してもよい。   The predetermined trigger is when the arithmetic module and the input module are activated, and the program duplication unit may duplicate the interrupt program from the arithmetic module to the input module.

入力モジュールは、割込プログラム実行部が割込プログラムに基づく割込処理を完了すると、割込処理が完了した旨の情報を演算モジュールに送信する履歴通知部をさらに備えてもよい。   The input module may further include a history notification unit that transmits information indicating that the interrupt processing is completed to the arithmetic module when the interrupt program execution unit completes the interrupt processing based on the interrupt program.

入力モジュールは、第1入力モジュールおよび第2入力モジュールを含み、バスは、演算モジュールと第1入力モジュールとを接続する第1バス、および、演算モジュールと第2入力モジュールとを接続する第2バスを含み、演算モジュールは、所定のタクトタイム毎に、第1バスを通じて、第1入力モジュールからデータを入力し、第2入力モジュールの割込プログラム実行部は、タクトタイムに関係ない所定のタイミングで、第2バスを通じて、第2入力モジュールのデータを演算モジュールに入力させてもよい。   The input module includes a first input module and a second input module, and the bus has a first bus connecting the arithmetic module and the first input module and a second bus connecting the arithmetic module and the second input module. The arithmetic module inputs data from the first input module through the first bus at every predetermined tact time, and the interrupt program execution unit of the second input module has a predetermined timing irrespective of the tact time. The data of the second input module may be input to the arithmetic module through the second bus.

演算モジュールは、所定のタクトタイム毎に、第1バスを通じて、第1入力モジュールにデータを出力し、タクトタイムに関係ない所定のタイミングで、第2バスを通じて、第2入力モジュールにデータを出力してもよい。   The arithmetic module outputs data to the first input module via the first bus at predetermined tact times and outputs data to the second input module via the second bus at a predetermined timing regardless of the tact time. May be.

第1バスは、シリアル伝送方式であり、第2バスは、パラレル伝送方式であってもよい。   The first bus may be a serial transmission system and the second bus may be a parallel transmission system.

上記課題を解決するための、外部からデータを入力する入力モジュールと、入力モジュールとバスを通じて接続され、入力モジュールから受信したデータに基づいて演算を行う演算モジュールと、を備える制御システムを用いた本発明の制御方法では、制御システムで実行されるプログラムは、割込条件の成立を実行契機とする割込プログラムと、割込プログラムを除いた非割込プログラムとを含んでなり、入力モジュールが、割込プログラムに対応付けられた割込条件が成立しているか否か判定し、割込条件が成立していると判定すると、割込プログラムを実行し、割込プログラムの実行途中で任意のデジタル信号が必要になると、外部のアナログ信号をデジタル信号に変換するADコンバータの変換制御を行うAD制御回路にADコンバータの変換制御を実行させ、ADコンバータの変換完了後に、任意のデジタル信号のみ正規化して正規化デジタル信号を生成し、正規化デジタル信号によって割込プログラムを実行し、演算モジュールが、割込プログラムの実行結果を参照し、非割込プログラムを実行することを特徴とする。
上記課題を解決するための、外部からデータを入力する入力モジュールと、入力モジュールとバスを通じて接続され、入力モジュールから受信したデータに基づいて演算を行う演算モジュールと、を備える制御システムを用いた本発明の制御方法では、制御システムで実行されるプログラムは、割込条件の成立を実行契機とする割込プログラムと、割込プログラムを除いた非割込プログラムとを含んでなり、入力モジュールが、割込プログラムに対応付けられた割込条件が成立しているか否か判定し、割込条件が成立していると判定すると、割込プログラムを実行し、外部のアナログ信号をデジタル信号に変換するADコンバータの変換制御を行うAD制御回路が、所定の周期でADコンバータの変換制御を実行し、変換されたデジタル信号を保持し、入力モジュールが、割込プログラムの実行途中で任意のデジタル信号が必要になると、AD制御回路に保持された任意のデジタル信号のみ正規化して正規化デジタル信号を生成し、正規化デジタル信号によって割込プログラムを実行し、演算モジュールが、割込プログラムの実行結果を参照し、非割込プログラムを実行することを特徴とする。
A book using a control system including an input module for inputting data from the outside to solve the above problem, and an arithmetic module connected to the input module through a bus and performing an arithmetic operation based on data received from the input module In the control method of the invention, the program executed by the control system includes an interrupt program triggered by the establishment of an interrupt condition and a non-interrupt program excluding the interrupt program, and the input module has: If it is determined whether the interrupt condition associated with the interrupt program is satisfied, and if it is determined that the interrupt condition is satisfied, the interrupt program is executed and any digital signal is executed during execution of the interrupt program. When a signal is required, the AD control circuit performs the conversion control of the AD converter that converts an external analog signal into a digital signal. To execute the conversion control data, after conversion completion of the AD converter to generate a normalized digital signal is normalized only arbitrary digital signals, executing an interrupt program by the normalized digital signals, computation module interrupt program The non-interruption program is executed by referring to the execution result of.
A book using a control system including an input module for inputting data from the outside to solve the above problem, and an arithmetic module connected to the input module through a bus and performing an arithmetic operation based on data received from the input module In the control method of the invention, the program executed by the control system includes an interrupt program triggered by the establishment of an interrupt condition and a non-interrupt program excluding the interrupt program, and the input module has: It is determined whether the interrupt condition associated with the interrupt program is satisfied. If it is determined that the interrupt condition is satisfied, the interrupt program is executed and the external analog signal is converted to a digital signal. An AD control circuit that performs conversion control of the AD converter executes conversion control of the AD converter at a predetermined cycle, and the converted digital signal When the input module holds an arbitrary digital signal during the execution of the interrupt program, the input module normalizes only the arbitrary digital signal held in the AD control circuit to generate a normalized digital signal. Is executed, the arithmetic module refers to the execution result of the interrupt program, and executes the non-interrupt program.

本発明によれば、実行プログラムの容量の増大に拘わらず、被制御機器の制御能力や分解能の劣化を防止することが可能となる。   According to the present invention, it is possible to prevent the control capability and resolution of the controlled device from deteriorating regardless of the increase in the capacity of the execution program.

制御システムを構成する各装置の概略的な接続関係を示した外観図である。It is an outline view showing a schematic connection relation of each device which constitutes a control system. 制御システムの概略的な構成を示した説明図である。It is an explanatory view showing a schematic structure of a control system. 実行プログラムに基づく処理のタイミングを説明するためのタイミングチャートである。6 is a timing chart for explaining the timing of processing based on an execution program. 演算モジュールのハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware constitutions of an arithmetic module. 入出力モジュールのハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware constitutions of an input / output module. 演算モジュールおよび入出力モジュールの処理の流れを説明するタイミングチャートである。6 is a timing chart illustrating a processing flow of the arithmetic module and the input / output module. プログラム複製部の処理を説明するための説明図である。It is an explanatory view for explaining processing of a program duplication part. 非割込プログラム実行部と割込プログラム実行部の処理の流れを説明するための説明図である。It is an explanatory view for explaining a flow of processing of a non-interruption program execution part and an interruption program execution part. 入出力部の構成を示したブロック図である。It is a block diagram showing a configuration of an input / output unit. 割込プログラムの処理の一例を示したタイミングチャートである。7 is a timing chart showing an example of processing of an interrupt program. 割込プログラムの処理の他の例を示したタイミングチャートである。7 is a timing chart showing another example of the processing of the interrupt program. 割込プログラムの処理のさらに他の例を示したタイミングチャートである。9 is a timing chart showing still another example of the processing of the interrupt program. 非割込処理の一例を説明するためのタイミングチャートである。6 is a timing chart for explaining an example of non-interruption processing. 非割込処理の他の例を説明するためのタイミングチャートである。9 is a timing chart for explaining another example of non-interrupt processing.

以下に添付図面を参照しながら、本発明の好適な実施形態について詳細に説明する。かかる実施形態に示す寸法、材料、その他具体的な数値などは、発明の理解を容易とするための例示にすぎず、特に断る場合を除き、本発明を限定するものではない。なお、本明細書および図面において、実質的に同一の機能、構成を有する要素については、同一の符号を付することにより重複説明を省略し、また本発明に直接関係のない要素は図示を省略する。   Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. The dimensions, materials, and other specific numerical values shown in the embodiments are merely examples for facilitating the understanding of the invention, and do not limit the invention unless otherwise specified. In this specification and the drawings, elements having substantially the same function and configuration are denoted by the same reference numerals to omit redundant description, and elements not directly related to the present invention are omitted. To do.

(第1の実施形態:制御システム100)
図1は、制御システム100を構成する各装置の概略的な接続関係を示した外観図であり、図2は、制御システム100の概略的な構成を示した説明図である。制御システム100は、管理装置110と、プログラマブルコントローラ120と、被制御機器130とを含んで構成される。また、管理装置110とプログラマブルコントローラ120とは、例えば、ギガ(G)ベース等のEthernet(登録商標)によるネットワーク配線140によって互いに接続される。さらに、プログラマブルコントローラ120と被制御機器130とは、例えば、専用の接続配線142を通じて通信や信号伝達可能に接続されている。
(First embodiment: control system 100)
FIG. 1 is an external view showing a schematic connection relationship of each device constituting the control system 100, and FIG. 2 is an explanatory view showing a schematic configuration of the control system 100. The control system 100 includes a management device 110, a programmable controller 120, and a controlled device 130. The management device 110 and the programmable controller 120 are connected to each other by, for example, a network wiring 140 based on Ethernet (registered trademark) such as Giga (G) base. Further, the programmable controller 120 and the controlled device 130 are connected so as to be capable of communication and signal transmission through, for example, a dedicated connection wiring 142.

上記管理装置110は、制御システム100全体がアプリケーションに定められた工程に沿って動作するように、複数のプログラマブルコントローラ120を一括して制御する。例えば、管理装置110は、個々のプログラマブルコントローラ120からステータス情報や制御結果を収集したり、その収集した内容に応じて、個々のプログラマブルコントローラ120に各種制御指令を出力したりする。   The management device 110 collectively controls the plurality of programmable controllers 120 so that the entire control system 100 operates along the process defined by the application. For example, the management device 110 collects status information and control results from each programmable controller 120, and outputs various control commands to each programmable controller 120 according to the collected contents.

プログラマブルコントローラ120は、PLC(Programmable Logic Controller)とも呼ばれ、図2に示すように、演算モジュール122、通信モジュール124、入出力(I/O)モジュール126、電源モジュール128等の複数のモジュールを含んで構成される。また、各モジュールはベースボードに着脱可能に固定され、電源モジュール128を除く各モジュール同士は、ベースボード上のバスを通じて接続される。かかるバスには、例えば、シリアル伝送方式の第1バス(不図示)や、パラレル伝送方式の第2バス(不図示)が準備されている。本実施形態では、複数の入出力モジュール126が、それぞれ第1バスまたは第2バスのいずれかを通じて演算モジュール122と接続されている。   The programmable controller 120 is also called a PLC (Programmable Logic Controller), and includes a plurality of modules such as a calculation module 122, a communication module 124, an input / output (I / O) module 126, and a power supply module 128 as shown in FIG. Composed of. In addition, each module is detachably fixed to the base board, and each module except the power supply module 128 is connected through a bus on the base board. As such a bus, for example, a first bus of a serial transmission system (not shown) and a second bus of a parallel transmission system (not shown) are prepared. In the present embodiment, the plurality of input / output modules 126 are connected to the arithmetic module 122 via either the first bus or the second bus.

ここで、演算モジュール122は、制御システム100に定められたアプリケーションを実現するために、それぞれのプログラマブルコントローラ120用に分割されたプログラムである実行プログラムを管理装置110からダウンロードし、その実行プログラムを遂行したり、プログラマブルコントローラ120の動作状況を不図示のモニタに表示したりする。その際、管理装置110から受信した制御指令、入出力モジュール126を通じて入力された被制御機器130のセンサ検出結果等に基づいて被制御機器130を制御する。   Here, the arithmetic module 122 downloads an execution program, which is a program divided for each programmable controller 120, from the management device 110 in order to realize an application defined in the control system 100, and executes the execution program. Alternatively, the operating status of the programmable controller 120 is displayed on a monitor (not shown). At that time, the controlled device 130 is controlled based on the control command received from the management device 110, the sensor detection result of the controlled device 130 input through the input / output module 126, and the like.

通信モジュール124は、Ethernet(登録商標)によるネットワーク配線140を通じて、管理装置110、他のプログラマブルコントローラ120、および、他のモジュールに接続され、それぞれと通信を確立することができる。   The communication module 124 is connected to the management device 110, another programmable controller 120, and another module through the network wiring 140 of Ethernet (registered trademark), and can establish communication with each of them.

入出力モジュール126は、被制御機器130(外部)からの入力管理を行う入力モジュールと、被制御機器130に対する出力管理を行う出力モジュールとを結合したモジュールである。例えば、被制御機器130がセンサであれば、センサ検出結果を収集し、電動機であれば、ディスクリートで表される制御指令を送信するとともに、その制御結果を収集する。電源モジュール128は、演算モジュール122、通信モジュール124、入出力モジュール126等の各モジュールに電力を供給する。   The input / output module 126 is a module in which an input module that manages input from the controlled device 130 (external) and an output module that manages output to the controlled device 130 are combined. For example, when the controlled device 130 is a sensor, the sensor detection result is collected, and when the controlled device 130 is an electric motor, the control command represented by discrete is transmitted and the control result is collected. The power supply module 128 supplies power to each module such as the arithmetic module 122, the communication module 124, and the input / output module 126.

被制御機器130は、例えば、FA(Factory Automation)における様々な状態を検知するセンサ、そのセンサの検知結果に応じて動作する電動機、エンコーダ等の電気機器で構成される。   The controlled device 130 is composed of, for example, a sensor that detects various states in FA (Factory Automation), an electric device that operates according to the detection result of the sensor, an electric device such as an encoder.

このような制御システム100は、様々な制御対象に適用できる。例えば、生産実行システム(MES:Manufacturing Execution System)に制御システム100を適用した場合、被制御機器130としての、モーションコントロールユニット(Motion Control Unit)、センタシーラユニット(Center Sealer Unit)、および、フィルムユニット(Film Unit)等の生産機器にプログラマブルコントローラ120を接続する。そして、プログラマブルコントローラ120の演算モジュール122は、入出力モジュール126から生産機器の動作状態を入力データとして取り込み、実行プログラムを用いて入力データを処理した後、入出力モジュール126を通じて生産機器への指令を行う。このようなアプリケーションは、以下のような実行プログラムにより実現される。   Such a control system 100 can be applied to various controlled objects. For example, when the control system 100 is applied to a production execution system (MES), a motion control unit (Motion Control Unit), a center sealer unit (Center Sealer Unit), and a film unit as the controlled device 130. The programmable controller 120 is connected to a production device such as a (Film Unit). Then, the arithmetic module 122 of the programmable controller 120 takes in the operating state of the production equipment as input data from the input / output module 126, processes the input data using the execution program, and then issues a command to the production equipment through the input / output module 126. To do. Such an application is realized by the following execution program.

図3は、実行プログラムに基づく処理のタイミングを説明するためのタイミングチャートである。一般的に、実行プログラムに基づく演算モジュール122の処理は、入出力モジュール126における割込条件の成立に基づいて実行される割込処理(割込条件の成立を実行契機とする処理)と、割込処理による時間的な制約を受けない非割込処理とに大別される。ここでは、割込処理に用いられるプログラムを割込プログラム、非割込処理に用いられるプログラムを非割込プログラムとする。なお、本実施形態では、割込条件として、入出力モジュール126への入力状態(例えば、離散信号の状態やカウント値)に基づく条件について説明する。   FIG. 3 is a timing chart for explaining the timing of processing based on the execution program. In general, the processing of the arithmetic module 122 based on the execution program includes an interrupt processing executed based on the satisfaction of the interrupt condition in the input / output module 126 (processing triggered by the satisfaction of the interrupt condition). It is roughly divided into non-interrupt processing that is not subject to time restrictions due to interrupt processing. Here, a program used for interrupt processing is an interrupt program, and a program used for non-interrupt processing is a non-interrupt program. In the present embodiment, as the interrupt condition, a condition based on the input state (for example, the state of discrete signal or the count value) to the input / output module 126 will be described.

演算モジュール122は、例えば、図3(a)に示すように、非割込プログラムを用いて非割込処理を周期的に(例えばタクトタイム20msec毎に)実行し、周期の始めにデータを入力し、周期の終わりにその処理結果を出力する。ここで、入出力モジュール126において割込条件が成立すると、図3(a)のように、演算モジュール122は、割込プログラムを用いて割込処理を優先的に実行し、割込処理以外の有余時間を有効利用して、非割込処理を実行する。具体的には、割込処理が発生すると、その割込処理が終了するまで非割込処理が中断され、割込処理終了後に非割込処理が再開される。そして、周期の終わりに、割込処理および非割込処理の処理結果が出力される。   The arithmetic module 122, for example, as shown in FIG. 3A, periodically executes non-interrupt processing using a non-interrupt program (for example, every tact time of 20 msec), and inputs data at the beginning of the cycle. Then, the processing result is output at the end of the cycle. Here, when the interrupt condition is satisfied in the input / output module 126, as shown in FIG. 3A, the arithmetic module 122 preferentially executes the interrupt process using the interrupt program, and executes the interrupt process other than the interrupt process. Non-interrupt processing is executed by effectively using the extra time. Specifically, when an interrupt process occurs, the non-interrupt process is suspended until the interrupt process ends, and the non-interrupt process is restarted after the interrupt process ends. Then, at the end of the cycle, the processing results of the interrupt processing and the non-interrupt processing are output.

しかし、アプリケーションの多様化に伴い、そのアプリケーションを実現するための実行プログラムの容量が増大すると、図3(b)のように、割込処理に費やす時間が長くなり、有余時間が短くなる。一方、割込処理と同様に、非割込処理に費やす時間も長くなるが、短くなった有余時間内では処理を完了することができなくなる。ここで、単純に非割込処理を実行する周期を長くすると、有余時間の長期化は図れるが、情報の更新頻度が低くなり、被制御機器130の制御能力や分解能の劣化を招くこととなる。特に、割込処理の処理結果も周期的にしか(周期の終わりにしか)入出力モジュール126に伝達されないので、所定の上下限値に達すると制御方式を変更するような即時反応を要する割込処理の場合でも、非割込処理の周期の長期化に伴い、その反応が遅くなってしまう。   However, when the capacity of the execution program for realizing the application increases with the diversification of the application, as shown in FIG. 3B, the time spent for interrupt processing becomes long and the surplus time becomes short. On the other hand, similarly to the interrupt processing, the time spent for the non-interrupt processing becomes long, but the processing cannot be completed within the shortened dead time. Here, if the cycle of executing the non-interruption process is simply lengthened, the surplus time can be lengthened, but the frequency of updating information becomes low, and the controllability and resolution of the controlled device 130 deteriorate. . In particular, since the processing result of the interrupt processing is also transmitted to the input / output module 126 only periodically (only at the end of the cycle), an interrupt requiring an immediate reaction such as changing the control method when the predetermined upper and lower limit values are reached. Even in the case of processing, the reaction becomes slower as the cycle of non-interrupt processing becomes longer.

そこで、本実施形態では、割込処理の一部または全部を他のモジュール(ここでは入出力モジュール126)で行い、演算モジュール122では、主として非割込処理を行うことで(残った割込処理も含む)、分散処理を実現する。例えば、図3(c)のように、突発的に発生する割込処理を入出力モジュール126内で完結的に実行し、並行して、非割込処理を演算モジュール122で周期的に実行する。かかる構成により、即時反応を要する割込処理が生じた場合でも、演算モジュール122における非割込処理の周期の影響を受けることなく、入出力モジュール126内で割込処理を迅速に実行し、その結果を即座に反映できるので、実行プログラムの容量の増大に拘わらず、被制御機器130の制御能力や分解能の劣化を防止することが可能となる。   Therefore, in the present embodiment, some or all of the interrupt processing is performed by another module (here, the input / output module 126), and the arithmetic module 122 mainly performs the non-interrupt processing (the remaining interrupt processing. Including distributed). For example, as shown in FIG. 3C, interrupt processing that occurs suddenly is completely executed in the input / output module 126, and in parallel, non-interrupt processing is periodically executed by the arithmetic module 122. . With this configuration, even if an interrupt process that requires an immediate response occurs, the interrupt process is executed quickly in the input / output module 126 without being affected by the cycle of the non-interrupt process in the arithmetic module 122, and Since the result can be reflected immediately, it is possible to prevent deterioration of the control capability and resolution of the controlled device 130, regardless of the increase in the capacity of the execution program.

また、本実施形態では、このような割込処理を行う割込プログラムを起動時等、所定の契機に自動的に入出力モジュール126に配置する。かかる構成により、個々のモジュールへの煩雑なインストール作業を回避できるとともに、入出力モジュール126を新設または交換した場合においても当該割込処理を即座に開始することが可能となる。以下、かかる目的を実現する演算モジュール122および入出力モジュール126のハードウェア構成を詳述する。   Further, in the present embodiment, an interrupt program for performing such an interrupt process is automatically arranged in the input / output module 126 at a predetermined timing such as at the time of starting. With such a configuration, it is possible to avoid a complicated installation work for each module, and it is possible to immediately start the interrupt process even when the input / output module 126 is newly installed or replaced. Hereinafter, the hardware configurations of the arithmetic module 122 and the input / output module 126 that achieve such an object will be described in detail.

(演算モジュール122)
図4は、演算モジュール122のハードウェア構成の一例を示す図である。図4に示す演算モジュール122は、I/F部150と、不揮発性メモリ152と、共有メモリ154と、固有メモリ156と、制御部158とを含んで構成される。
(Operation module 122)
FIG. 4 is a diagram illustrating an example of the hardware configuration of the arithmetic module 122. The arithmetic module 122 shown in FIG. 4 includes an I / F unit 150, a non-volatile memory 152, a shared memory 154, a unique memory 156, and a control unit 158.

I/F部150は、第1バスや第2バスを通じて、通信モジュール124および入出力モジュール126と通信を確立し、その通信モジュール124を通じて、管理装置110、他のプログラマブルコントローラ120と通信することができる。   The I / F unit 150 can establish communication with the communication module 124 and the input / output module 126 through the first bus and the second bus, and communicate with the management device 110 and other programmable controllers 120 through the communication module 124. it can.

不揮発性メモリ152は、ROM、EEPROM、フラッシュメモリ、HDD等の記憶媒体で構成され、コンピュータを動作させる基本プログラムであるシステムプログラム、ならびに、実行プログラム(非割込プログラムおよび割込プログラム)を保持する。共有メモリ154は、RAM等の記憶媒体で構成され、入力データや、制御部158が非割込プログラムを遂行することにより更新される出力データを記憶する。なお、I/F部150と、不揮発性メモリ152と、共有メモリ154とは、共通バス160によりアクセス可能に接続されている。したがって、不揮発性メモリ152や共有メモリ154は、他のモジュールからのアクセスも受け付ける。   The non-volatile memory 152 is composed of a storage medium such as a ROM, an EEPROM, a flash memory, and an HDD, and holds a system program which is a basic program for operating a computer and an execution program (non-interruption program and interruption program). . The shared memory 154 is configured by a storage medium such as a RAM, and stores input data and output data updated by the control unit 158 executing the non-interruption program. The I / F unit 150, the non-volatile memory 152, and the shared memory 154 are connected via a common bus 160 so that they can be accessed. Therefore, the nonvolatile memory 152 and the shared memory 154 also accept access from other modules.

例えば、共有の作業領域として利用可能なメモリ領域が各モジュールに分割して割り当てられる場合、割り当てられたメモリ領域に共有メモリ154を対応付ける。したがって、演算モジュール122に割り当てられたメモリ領域には、他のモジュールのメモリが存在せず、当該メモリ領域にアクセスすると、唯一、演算モジュール122の共有メモリ154のみデータを読み出しまたは書き込みできる。   For example, when a memory area that can be used as a shared work area is divided and assigned to each module, the shared memory 154 is associated with the assigned memory area. Therefore, the memory area allocated to the arithmetic module 122 does not have the memory of other modules, and when the memory area is accessed, only the shared memory 154 of the arithmetic module 122 can read or write data.

固有メモリ156は、共有メモリ154同様、RAM等の記憶媒体で構成され、入力データや、制御部158が非割込プログラムを遂行することにより更新される内部データを記憶する。ただし、固有メモリ156は、共通バス160に接続されておらず、制御部158からのみアクセス可能となる。このようなメモリへのアクセス制限は、FPGA(Field-Programmable Gate Array)等を用いたデコーダによって実現できる。   Like the shared memory 154, the unique memory 156 is configured by a storage medium such as a RAM, and stores input data and internal data updated when the control unit 158 executes the non-interruption program. However, the unique memory 156 is not connected to the common bus 160 and can be accessed only from the control unit 158. Such access restriction to the memory can be realized by a decoder using an FPGA (Field-Programmable Gate Array) or the like.

制御部158は、中央処理装置(CPU)等を含む半導体集積回路で構成され、非割込プログラムを不揮発性メモリ152から読み出し、固有メモリ156に展開して非割込処理を実行する。そして、制御部158は、プログラム複製部170、非割込プログラム実行部172、履歴管理部174といった機能部として機能する。かかる機能部の動作については後程詳述する。   The control unit 158 is composed of a semiconductor integrated circuit including a central processing unit (CPU) and the like, reads a non-interruption program from the nonvolatile memory 152, expands it in the unique memory 156, and executes the non-interruption process. Then, the control unit 158 functions as a functional unit such as the program duplication unit 170, the non-interruption program execution unit 172, and the history management unit 174. The operation of such a functional unit will be described later in detail.

(入出力モジュール126)
図5は、入出力モジュール126のハードウェア構成の一例を示す図である。本実施形態では、入出力モジュール126が複数準備されている。ここでは、複数の入出力モジュール126のうち、比較的高速に動作する入出力モジュール126を挙げて説明する。図5に示す入出力モジュール126は、I/F部180と、不揮発性メモリ182と、共有メモリ184と、固有メモリ186と、入出力部188と、制御部190とを含んで構成される。
(I / O module 126)
FIG. 5 is a diagram showing an example of the hardware configuration of the input / output module 126. In this embodiment, a plurality of input / output modules 126 are prepared. Here, of the plurality of input / output modules 126, the input / output module 126 that operates at a relatively high speed will be described as an example. The input / output module 126 shown in FIG. 5 includes an I / F unit 180, a non-volatile memory 182, a shared memory 184, a unique memory 186, an input / output unit 188, and a control unit 190.

I/F部180は、第1バスや第2バスを通じて、演算モジュール122、通信モジュール124および入出力モジュール126と通信を確立する。   The I / F unit 180 establishes communication with the arithmetic module 122, the communication module 124, and the input / output module 126 via the first bus and the second bus.

不揮発性メモリ182は、ROM、EEPROM、フラッシュメモリ、HDD(Hard Disk Drive)等の記憶媒体で構成され、システムプログラムを保持する。共有メモリ184は、RAM等の記憶媒体で構成され、実行プログラムの一部である割込プログラムや、入力データ、制御部190が割込プログラムを遂行することにより更新される出力データを記憶する。なお、I/F部180と、不揮発性メモリ182と、共有メモリ184と、入出力部188は、共通バス192によりアクセス可能に接続されている。したがって、不揮発性メモリ182や共有メモリ184は、他のモジュールからのアクセスも受け付ける。ただし、複数ある共有メモリ184それぞれの配置場所は、その共有メモリ184へのアクセス頻度が高いモジュールとするとよい。例えば、共有メモリ184へのアクセス頻度は入出力モジュール126が高いので、共有メモリ184は入出力モジュール126に配置される。   The non-volatile memory 182 includes a storage medium such as a ROM, an EEPROM, a flash memory, and an HDD (Hard Disk Drive), and holds a system program. The shared memory 184 is configured by a storage medium such as a RAM, and stores an interrupt program that is a part of an execution program, input data, and output data updated by the control unit 190 executing the interrupt program. The I / F unit 180, the non-volatile memory 182, the shared memory 184, and the input / output unit 188 are connected by a common bus 192 so that they can be accessed. Therefore, the nonvolatile memory 182 and the shared memory 184 also accept access from other modules. However, it is preferable that each of the plurality of shared memories 184 is arranged in a module that frequently accesses the shared memory 184. For example, since the input / output module 126 has a high access frequency to the shared memory 184, the shared memory 184 is arranged in the input / output module 126.

固有メモリ186は、共有メモリ184同様、RAM等の記憶媒体で構成され、入力データや、制御部190が割込プログラムを遂行することにより更新される内部データを記憶する。ただし、固有メモリ186は、共通バス192に接続されておらず、制御部190からのみアクセス可能となる。   Like the shared memory 184, the unique memory 186 is configured by a storage medium such as a RAM, and stores input data and internal data updated by the control unit 190 executing an interrupt program. However, the unique memory 186 is not connected to the common bus 192 and can be accessed only from the control unit 190.

入出力部188は、被制御機器130に接続され、被制御機器130との通信および信号伝達を行う。例えば、入出力部188は、FPGA、ADコンバータ、DAコンバータ、フォトカプラ、トランジスタ等で構成され、アナログ信号、デジタル信号、矩形波(カウンタ入力)等を入出力する。特に、アナログ信号については、後述するように、ADコンバータ、DAコンバータに対する個々の変換制御をFPGAで行うことで、処理負荷の分散を果たしている。   The input / output unit 188 is connected to the controlled device 130 and performs communication and signal transmission with the controlled device 130. For example, the input / output unit 188 includes an FPGA, an AD converter, a DA converter, a photo coupler, a transistor, and the like, and inputs and outputs an analog signal, a digital signal, a rectangular wave (counter input), and the like. In particular, for analog signals, as described later, the FPGA performs individual conversion control for the AD converter and the DA converter, thereby achieving the distribution of the processing load.

制御部190は、演算モジュール122とスペックが同等の中央処理装置(CPU)等を含む半導体集積回路で構成され、割込プログラムを共有メモリ184から読み出し、固有メモリ186に展開して割込処理を実行する。そして、制御部190は、条件判定部200、割込プログラム実行部202、履歴通知部204といった機能部としても機能する。かかる機能部の動作については後程詳述する。以下、割込プログラムの入出力モジュール126への複製処理や割込処理を遂行するための、演算モジュール122および入出力モジュール126の処理の流れを説明する。   The control unit 190 is composed of a semiconductor integrated circuit including a central processing unit (CPU) or the like having the same specifications as the arithmetic module 122, reads an interrupt program from the shared memory 184, expands it in the unique memory 186, and executes the interrupt process. Run. Then, the control unit 190 also functions as functional units such as the condition determination unit 200, the interrupt program execution unit 202, and the history notification unit 204. The operation of such a functional unit will be described later in detail. Hereinafter, a flow of processing of the arithmetic module 122 and the input / output module 126 for performing the copying processing of the interrupt program to the input / output module 126 and the interrupt processing will be described.

(プログラム複製処理S300)
図6は、演算モジュール122および入出力モジュール126の処理(制御方法)の流れを説明するタイミングチャートである。当該制御システム100が起動され、演算モジュール122および入出力モジュール126に電力の供給が開始されると、演算モジュール122の制御部158や入出力モジュール126の制御部190は、それぞれ、システムプログラムを固有メモリ156、186に展開し、演算モジュール122のプログラム複製部170は、かかる起動を契機に、不揮発性メモリ152に記憶している実行プログラムのうち割込プログラムを入出力モジュール126に複製する(S300)。なお、不揮発性メモリ152内の割込プログラムは、当該複製によって削除されず、そのまま保持される。
(Program duplication processing S300)
FIG. 6 is a timing chart illustrating the flow of processing (control method) of the arithmetic module 122 and the input / output module 126. When the control system 100 is started and power supply to the arithmetic module 122 and the input / output module 126 is started, the control unit 158 of the arithmetic module 122 and the control unit 190 of the input / output module 126 each have a unique system program. Upon being activated, the program duplication unit 170 of the arithmetic module 122 duplicates the interrupt program of the execution programs stored in the non-volatile memory 152 to the input / output module 126 (S300). ). It should be noted that the interrupt program in the non-volatile memory 152 is not deleted by the duplication and is retained as it is.

図7は、プログラム複製部170の処理を説明するための説明図である。例えば、当該制御システム100における実行プログラムは、それぞれが独立した(他のプログラムの影響を受けない)6つのプログラムに分割することができ、その内訳は、非割込プログラム3つと、割込プログラム3つであるとする。ただし、この時点では、6つのプログラムは、それぞれコンパイルが完了し、実行形式となっている。プログラム複製部170は、このうち3つの割込プログラムを、その割込プログラムが制御対象としている被制御機器130に接続された入出力モジュール126にそれぞれ複製する。   FIG. 7 is an explanatory diagram for explaining the processing of the program duplication unit 170. For example, the execution program in the control system 100 can be divided into six independent programs (not affected by other programs), the breakdown of which is three non-interruption programs and three interruption programs. Suppose However, at this point, the six programs have been compiled and are in the executable form. The program duplication unit 170 duplicates three of these interrupt programs to the input / output module 126 connected to the controlled device 130 controlled by the interrupt program.

ここで、割込プログラムには、それぞれ、割込処理に関する情報である複製ステータスが付されている。したがって、プログラム複製部170は、割込プログラムに付されている複製ステータスを読み出し、複製先として入出力モジュール126の識別子が登録されていれば、その識別子によって特定される入出力モジュール126に、当該複製ステータスに対応付けられた割込プログラムを複製する。入出力モジュール126では、演算モジュール122から受信した割込プログラムを共有メモリ184の所定のメモリ位置に保持させる。なお、複製ステータスには、識別子の他、割込ポート番号と、割込条件も含まれている。ここで、割込ポート番号は、入出力部188における割込対象となるポート(割込端子)の番号を示し、割込条件は、割込を発生させる条件、例えば、割込ポート番号に入力された離散信号がTRUEかFALSEか、もしくは、サーボ等の出力信号を計数したカウント値が所定の値に到達したか等の条件を示す。   Here, each interrupt program is provided with a copy status, which is information about the interrupt process. Therefore, the program duplication unit 170 reads the duplication status attached to the interrupt program, and if the identifier of the I / O module 126 is registered as the duplication destination, the I / O module 126 specified by the identifier Duplicate the interrupt program associated with the duplication status. The input / output module 126 holds the interrupt program received from the arithmetic module 122 at a predetermined memory location in the shared memory 184. The duplication status includes an interrupt port number and an interrupt condition in addition to the identifier. Here, the interrupt port number indicates the number of the port (interrupt terminal) to be interrupted in the input / output unit 188, and the interrupt condition is a condition for generating an interrupt, such as an interrupt port number. It indicates a condition such as whether the generated discrete signal is TRUE or FALSE, or whether the count value obtained by counting the output signals of the servo or the like has reached a predetermined value.

図7の例では、割込プログラム(1)および割込プログラム(2)の識別子が「1」となっているので、プログラム複製部170は、割込プログラム(1)および割込プログラム(2)を、識別子「1」によって特定される入出力モジュール(1)の共有メモリ184の所定のメモリ位置に複製する。また、割込プログラム(3)の識別子が「2」となっているので、プログラム複製部170は、割込プログラム(3)を、識別子「2」によって特定される入出力モジュール(2)の共有メモリ184に複製する。   In the example of FIG. 7, since the identifiers of the interrupt program (1) and the interrupt program (2) are “1”, the program duplication unit 170 causes the interrupt program (1) and the interrupt program (2). Is copied to a predetermined memory location of the shared memory 184 of the input / output module (1) specified by the identifier “1”. Further, since the identifier of the interrupt program (3) is “2”, the program duplication unit 170 shares the interrupt program (3) with the input / output module (2) specified by the identifier “2”. Duplicate in memory 184.

続いて、プログラム複製部170は、各割込プログラムの作業領域となるメモリ領域を確保する。具体的に、プログラム複製部170は、図7のように、割込プログラム(1)を入出力モジュール(1)の共有メモリ184に複製するとともに、その割込プログラム(1)に対し予め定められた容量のメモリ領域(1)を入出力モジュール(1)の共有メモリ184内に確保する。同様に、プログラム複製部170は、割込プログラム(2)に対し予め定められた容量のメモリ領域(2)を入出力モジュール(1)の共有メモリ184内に確保し、割込プログラム(3)に対し予め定められた容量のメモリ領域(3)を入出力モジュール(2)の共有メモリ184内に確保する。   Subsequently, the program duplication unit 170 secures a memory area which is a work area of each interrupt program. Specifically, as shown in FIG. 7, the program duplication unit 170 duplicates the interrupt program (1) in the shared memory 184 of the input / output module (1) and determines the interrupt program (1) in advance. A memory area (1) having a large capacity is secured in the shared memory 184 of the input / output module (1). Similarly, the program duplication unit 170 secures a memory area (2) of a predetermined capacity for the interrupt program (2) in the shared memory 184 of the input / output module (1), and then the interrupt program (3). On the other hand, a memory area (3) having a predetermined capacity is secured in the shared memory 184 of the input / output module (2).

(非割込プログラム設定処理S302)
図8は、非割込プログラム実行部172と割込プログラム実行部202の処理の流れを説明するための説明図である。上述したように割込プログラムの複製が完了すると、演算モジュール122の非割込プログラム実行部172は、非割込プログラムの実行準備を行う。具体的に、非割込プログラム実行部172は、図8に示すように、非割込プログラム(1)〜(3)を不揮発性メモリ152から読み出し、固有メモリ156に展開する。
(Non-interruption program setting process S302)
FIG. 8 is an explanatory diagram for explaining the processing flow of the non-interruption program execution unit 172 and the interruption program execution unit 202. When the duplication of the interrupt program is completed as described above, the non-interrupt program execution unit 172 of the arithmetic module 122 prepares to execute the non-interrupt program. Specifically, the non-interruption program execution unit 172 reads out the non-interruption programs (1) to (3) from the non-volatile memory 152 and expands them in the unique memory 156, as shown in FIG.

(割込プログラム設定処理S304)
同様に、上述したように割込プログラムの複製が完了すると、入出力モジュール126の割込プログラム実行部202は、割込プログラムの実行準備を行う。具体的に、図8に示すように、入出力モジュール(1)の割込プログラム実行部202は、割込プログラム(1)、(2)を共有メモリ184から読み出し、固有メモリ186に展開する。同様に、入出力モジュール(2)の割込プログラム実行部202は、割込プログラム(3)を共有メモリ184から読み出し、固有メモリ186に展開する。
(Interrupt program setting process S304)
Similarly, when the duplication of the interrupt program is completed as described above, the interrupt program execution unit 202 of the input / output module 126 prepares to execute the interrupt program. Specifically, as shown in FIG. 8, the interrupt program execution unit 202 of the input / output module (1) reads the interrupt programs (1) and (2) from the shared memory 184 and expands them in the unique memory 186. Similarly, the interrupt program execution unit 202 of the input / output module (2) reads the interrupt program (3) from the shared memory 184 and expands it in the unique memory 186.

(非割込プログラム実行処理S310)
続いて、非割込プログラム実行部172は、固有メモリ156に展開された非割込プログラムを用い非割込プログラムを実行する。ここで、非割込プログラム実行部172は、必要に応じて、後述する入出力モジュール126の割込プログラム実行部202の実行結果を参照し(共有メモリ184からデータを読み出し)、例えば20msec毎に当該非割込プログラムの実行結果を導出する。
(Non-interrupt program execution process S310)
Subsequently, the non-interruption program execution unit 172 executes the non-interruption program using the non-interruption program expanded in the unique memory 156. Here, the non-interruption program execution unit 172 refers to the execution result of the interrupt program execution unit 202 of the input / output module 126 described later (reads data from the shared memory 184) as necessary, and for example, every 20 msec. The execution result of the non-interruption program is derived.

(条件判定処理S312)
条件判定部200は、割込プログラムに対応付けられた割込条件が成立しているか否か判定する。図7の複製ステータスを参照すると、本実施形態では、割込プログラム(1)〜(3)に、それぞれ割込条件「1234」、「TRUE」、「5678」が対応付けられている。したがって、入出力モジュール(1)の条件判定部200は、割込ポート番号「1」で特定される、サーボ等の動作に応じて積算されたカウント値を参照し、そのカウント値が「1234」と一致すると、割込プログラム(1)の割込条件が成立したと判定する。そして、一度、割込条件が成立したと判定するとカウント値を0にリセットする。
(Condition determination processing S312)
The condition determination unit 200 determines whether or not the interrupt condition associated with the interrupt program is satisfied. Referring to the replication status in FIG. 7, in the present embodiment, the interrupt programs (1) to (3) are associated with interrupt conditions “1234”, “TRUE”, and “5678”, respectively. Therefore, the condition determination unit 200 of the input / output module (1) refers to the count value accumulated according to the operation of the servo or the like specified by the interrupt port number “1”, and the count value is “1234”. If it coincides with, it is determined that the interrupt condition of the interrupt program (1) is satisfied. Then, once it is determined that the interrupt condition is satisfied, the count value is reset to 0.

同様に、入出力モジュール(1)の条件判定部200は、割込ポート番号「3」で特定される離散信号を参照し、その離散信号がTRUEであれば、割込プログラム(2)の割込条件が成立したと判定する。また、入出力モジュール(2)の条件判定部200は、割込ポート番号「1」で特定される、サーボ等の動作に応じて積算されたカウント値を参照し、そのカウント値が「5678」と一致すると、割込プログラム(3)の割込条件が成立したと判定する。   Similarly, the condition determination unit 200 of the input / output module (1) refers to the discrete signal identified by the interrupt port number “3”, and if the discrete signal is TRUE, the interrupt determination of the interrupt program (2) is performed. It is determined that the inclusion condition is satisfied. The condition determination unit 200 of the input / output module (2) refers to the count value accumulated according to the operation of the servo or the like specified by the interrupt port number “1”, and the count value is “5678”. If it coincides with, it is determined that the interrupt condition of the interrupt program (3) is satisfied.

(割込プログラム実行処理S314)
割込プログラム実行部202は、条件判定部200が所定の割込条件が成立していると判定すると、その割込条件に対応する割込プログラムを実行する。例えば、入出力モジュール(1)の条件判定部200が、割込ポート番号「1」で特定されるカウント値が「1234」に到達したと判定すると、割込プログラム実行部202は、割込プログラム(1)を実行する。そして、割込プログラム実行部202は、割込プログラム(1)に基づく割込処理の処理結果を、プログラム複製部170が共有メモリ184内に確保したメモリ領域(1)に記憶する。こうして、演算モジュール122の非割込プログラム実行部172は、任意のタイミングで、共有メモリ184から処理結果を読み出すことが可能となる。
(Interrupt program execution process S314)
When the condition determination unit 200 determines that the predetermined interrupt condition is satisfied, the interrupt program execution unit 202 executes the interrupt program corresponding to the interrupt condition. For example, when the condition determination unit 200 of the input / output module (1) determines that the count value specified by the interrupt port number “1” has reached “1234”, the interrupt program execution unit 202 causes the interrupt program execution unit 202 to execute the interrupt program. Execute (1). Then, the interrupt program execution unit 202 stores the processing result of the interrupt processing based on the interrupt program (1) in the memory area (1) secured in the shared memory 184 by the program duplication unit 170. In this way, the non-interruption program execution unit 172 of the arithmetic module 122 can read the processing result from the shared memory 184 at an arbitrary timing.

ここで、割込プログラム実行部202は、非割込プログラム実行部172による周期的な処理の制限を受けることなく、独立かつ最優先に割込プログラムを実行し、その処理結果を迅速に反映することができる。したがって、例えば、所定の上下限値に達すると制御方式を変更するような即時反応を要する割込処理については、反応時間の短縮化を図ることが可能となる。また、非割込プログラム実行部172による制限を受けない(非割込処理の周期の影響を受けない)ので、非割込処理の周期より短い時間で割込処理を繰り返し実行することもでき、割込処理を高頻度で実現することも可能となる。こうして、実行プログラムの容量の増大に拘わらず、被制御機器130の制御能力や分解能の劣化を防止することができる。   Here, the interrupt program execution unit 202 executes the interrupt program independently and with the highest priority without being restricted by the periodic processing by the non-interrupt program execution unit 172, and promptly reflects the processing result. be able to. Therefore, for example, for an interrupt process that requires an immediate reaction such that the control method is changed when a predetermined upper and lower limit value is reached, it is possible to shorten the reaction time. Further, since the non-interruption program execution unit 172 is not restricted (not affected by the cycle of non-interruption processing), the interrupt processing can be repeatedly executed in a time shorter than the cycle of non-interruption processing. It is also possible to implement interrupt processing with high frequency. In this way, it is possible to prevent the controllability and the resolution of the controlled device 130 from deteriorating despite the increase in the capacity of the execution program.

また、入出力モジュール126に離散信号による割込が発生した場合、本来、入出力モジュール126が、一旦、離散信号をバス信号に置き換えて演算モジュール122に伝達し、演算モジュール122で、その条件を判定した上で割込処理を行っていたところ、本実施形態では、バス信号に置き換えることなく、入出力モジュール126内で処理を完結することができるので、割込処理に費やす時間自体を短縮することができる。   Also, when an interrupt due to a discrete signal occurs in the input / output module 126, the input / output module 126 originally replaces the discrete signal with a bus signal and transmits the bus signal to the arithmetic module 122. When the interrupt process is performed after the determination, in the present embodiment, the process can be completed in the input / output module 126 without replacing with the bus signal, and therefore the time itself required for the interrupt process is shortened. be able to.

(履歴通知処理S316)
履歴通知部204は、割込プログラム実行部202が割込プログラムに基づく割込処理を完了すると、それに伴って、割込処理が完了した旨の情報を演算モジュール122に送信する。これは、演算モジュール122において、割込処理が想定通りに遂行されているか否か管理するためである。
(History notification processing S316)
When the interrupt program execution unit 202 completes the interrupt process based on the interrupt program, the history notification unit 204 sends information indicating that the interrupt process is completed to the arithmetic module 122 accordingly. This is because the arithmetic module 122 manages whether or not the interrupt processing is performed as expected.

(履歴管理処理S318)
履歴管理部174は、履歴通知部204から割込処理が完了した旨の情報を受信すると、それを履歴(ログ)として管理し、割込処理の数やタイミングが、想定された範囲に収まるか否か判定し、想定された範囲を逸脱すると、割込処理にエラーが生じたとして、エラー処理を行う。
(History management process S318)
When the history management unit 174 receives the information indicating that the interrupt processing is completed from the history notification unit 204, the history management unit 174 manages the information as a history (log), and whether the number and timing of the interrupt processing fall within the expected range. If it is judged whether or not it deviates from the expected range, it is determined that an error has occurred in the interrupt process, and the error process is performed.

以上、説明した制御システム100では、実行プログラムを、演算モジュール122と入出力モジュール126で分散処理することで、たとえ、実行プログラムの容量が増大したとしても、演算モジュール122の処理負荷を増大させることなく、かつ、割込処理を非割込処理から独立したタイミングで迅速に実行することができ、被制御機器130の制御能力や分解能の劣化を防止することが可能となる。   In the control system 100 described above, the processing load of the calculation module 122 is increased by performing the distributed processing of the execution program by the calculation module 122 and the input / output module 126 even if the capacity of the execution program is increased. In addition, the interrupt process can be executed quickly at a timing independent of the non-interrupt process, and the control capability and resolution of the controlled device 130 can be prevented from deteriorating.

また、このような割込処理を行う割込プログラムを起動時に自動的に入出力モジュール126に配置しているので、個々のモジュールへの煩雑なインストール作業を回避できるとともに、入出力モジュール126を新設または交換した場合においても当該割込処理を即座に開始することが可能となる。したがって、既存の入出力モジュール126を、実行プログラムがインストールされていない出荷状態の入出力モジュール126と交換したとしても、既存の入出力モジュール126と同状態を迅速に復元できるので、メンテナンス性を高めることができる。   In addition, since the interrupt program for performing such interrupt processing is automatically arranged in the input / output module 126 at the time of startup, it is possible to avoid complicated installation work for each module and to newly install the input / output module 126. Alternatively, even if the service is exchanged, the interrupt process can be started immediately. Therefore, even if the existing input / output module 126 is replaced with the shipping state input / output module 126 in which the execution program is not installed, the same state as the existing input / output module 126 can be quickly restored, thus improving maintainability. be able to.

(第2の実施形態)
このように、演算モジュール122で本来実行すべき処理を入出力モジュール126に分散することで、演算モジュール122自体の処理負荷を低減することができる。しかし、その一方で、演算モジュール122で低減された処理負荷分、入出力モジュール126の処理負荷が増大する場合がある。そこで、入出力モジュール126における、特に、ADコンバータやDAコンバータに割く処理負荷を低減し、入出力モジュール126の処理負担を低減する。
(Second embodiment)
In this way, by distributing the processing that should originally be executed by the arithmetic module 122 to the input / output module 126, the processing load of the arithmetic module 122 itself can be reduced. However, on the other hand, the processing load of the input / output module 126 may increase by the processing load reduced by the arithmetic module 122. Therefore, the processing load of the input / output module 126, particularly the AD converter and the DA converter, is reduced, and the processing load of the input / output module 126 is reduced.

図9は、入出力部188の構成を示したブロック図である。入出力モジュール126の入出力部188は、ADコンバータ220、DAコンバータ222、FPGA224、を含んで構成される。   FIG. 9 is a block diagram showing the configuration of the input / output unit 188. The input / output unit 188 of the input / output module 126 includes an AD converter 220, a DA converter 222, and an FPGA 224.

ADコンバータ220は、外部のアナログ信号をデジタル信号に変換する。DAコンバータ222は、デジタル信号をアナログ信号に変換して外部に出力する。FPGA224は、ADコンバータ220の変換制御を行うAD制御回路224aやDAコンバータの変換制御を行うDA制御回路224bとしても機能する。また、AD制御回路224aには、ADコンバータ220で変換されたデジタル信号を保持するバッファが設けられ、DA制御回路224bには、DAコンバータ222の変換対象となるデジタル信号を保持するバッファが設けられている。   The AD converter 220 converts an external analog signal into a digital signal. The DA converter 222 converts a digital signal into an analog signal and outputs it to the outside. The FPGA 224 also functions as an AD control circuit 224a that controls conversion of the AD converter 220 and a DA control circuit 224b that controls conversion of the DA converter. Further, the AD control circuit 224a is provided with a buffer for holding the digital signal converted by the AD converter 220, and the DA control circuit 224b is provided with a buffer for holding the digital signal to be converted by the DA converter 222. ing.

図10は、割込プログラムの処理の一例を示したタイミングチャートである。図10の例では、AD制御回路224aやDA制御回路224bが主体となり、所定の周期(例えば、25μsec)でAD変換およびDA変換を繰り返し、その途中でADコンバータ220によってデジタル信号が生成されたことを契機に割込プログラムが実行される。   FIG. 10 is a timing chart showing an example of the processing of the interrupt program. In the example of FIG. 10, the AD control circuit 224a and the DA control circuit 224b are mainly used, and AD conversion and DA conversion are repeated at a predetermined cycle (for example, 25 μsec), and the AD converter 220 generates a digital signal on the way. The interrupt program is executed at the trigger.

具体的に、AD制御回路224aは、所定の周期に基づく、例えば時点(a)でADコンバータ220の変換制御を開始し、変換されたデジタル信号を保持し、時点(b)において、制御部190を通じ、デジタル信号を正規化して正規化デジタル信号を生成する。   Specifically, the AD control circuit 224a starts conversion control of the AD converter 220 at a time point (a) based on a predetermined cycle, holds the converted digital signal, and at the time point (b), the control unit 190. To normalize the digital signal to generate a normalized digital signal.

かかる正規化は、以下の処理を含む。すなわち、AD制御回路224aは、制御部190を通じて、ADコンバータ220のハードフェア特性であるオフセットおよびゲインを調整するアナログ値調整処理、ADコンバータ220の出力値(例えば65536)を割込プログラムの利用範囲(例えば10000)に変換するスケール変換処理、過去の複数(例えば8や16)のデジタル値の平均を示す移動平均処理を行う。   Such normalization includes the following processes. That is, the AD control circuit 224a uses the control unit 190 to perform analog value adjustment processing for adjusting the offset and gain, which are the hardware characteristics of the AD converter 220, and the output value of the AD converter 220 (for example, 65536) in the use range of the interrupt program. Scale conversion processing for converting into (for example, 10000) and moving average processing showing an average of a plurality of past (for example, 8 or 16) digital values are performed.

なお、ここで用いられるADコンバータ220は複数(例えば4つ)のチャンネルを有しており、割込プログラムによってどのチャンネルのデジタル値が利用されるか把握できないため、正規化は複数のチャンネル全てに対して行われ、その総時間はチャンネル数分だけ長くなる。   Since the AD converter 220 used here has a plurality of channels (for example, four channels) and it is not possible to know which channel's digital value is used by the interrupt program, normalization is applied to all the plurality of channels. However, the total time is increased by the number of channels.

そして、AD変換に対する一通りの処理が終了すると、DA制御回路224bは、時点(c)において、DA制御回路224bのバッファに保持されたデジタル信号を、制御部190を通じて非正規化して非正規化デジタル信号を生成し、非正規化デジタル信号によってDAコンバータ222の変換制御を実行する。こうして、DAコンバータ222からアナログ信号が出力される。   Then, when a series of processes for AD conversion is completed, the DA control circuit 224b denormalizes and denormalizes the digital signal held in the buffer of the DA control circuit 224b at the time point (c) through the control unit 190. A digital signal is generated, and conversion control of the DA converter 222 is executed by the denormalized digital signal. In this way, the DA converter 222 outputs an analog signal.

かかる非正規化は、以下の処理を含む。すなわち、DA制御回路224bは、制御部190を通じて、割込プログラムの利用範囲(例えば10000)をDAコンバータ222の出力値(例えば65536)に変換するスケール変換処理、DAコンバータ222のハードフェア特性であるオフセットおよびゲインを調整するアナログ値調整処理を行う。   Such denormalization includes the following processes. That is, the DA control circuit 224b is a scale conversion process for converting the use range (for example, 10000) of the interrupt program into the output value (for example, 65536) of the DA converter 222 through the control unit 190, and the hardware characteristic of the DA converter 222. Performs analog value adjustment processing to adjust offset and gain.

なお、ここで用いられるDAコンバータ222は複数(例えば4つ)のチャンネルを有しており、割込プログラムによってどのチャンネルの出力を要するか把握できないため、非正規化は複数のチャンネル全てに対して行われ、その総時間はチャンネル数分だけ長くなる。   Since the DA converter 222 used here has a plurality of (for example, four) channels and it is not possible to know which channel is required to be output by the interrupt program, denormalization is performed on all the plurality of channels. And the total time is extended by the number of channels.

このように、所定の周期でAD変換およびDA変換が繰り返される途中、AD制御回路224aが主体となり、割込プログラムを動作させる。具体的に、AD制御回路224aは、正規化デジタル信号を生成したことを契機に、制御部190に割込処理をかけ、時点(d)から割込プログラム実行部202に、割込プログラムを実行させる。そして、割込プログラムにおいて、当該正規化デジタル信号の処理が終了すると、時点(e)において、DA制御回路224bに正規化デジタル信号を保持させ、DA制御回路224bが、割込プログラムの処理結果をDAコンバータ222に反映する。   In this way, the AD control circuit 224a mainly operates the interrupt program while the AD conversion and the DA conversion are repeated at a predetermined cycle. Specifically, the AD control circuit 224a causes the control unit 190 to perform an interrupt process when the normalized digital signal is generated, and causes the interrupt program execution unit 202 to execute the interrupt program from time (d). Let Then, when the processing of the normalized digital signal is completed in the interrupt program, at the time point (e), the DA control circuit 224b holds the normalized digital signal, and the DA control circuit 224b displays the processing result of the interrupt program. It is reflected in the DA converter 222.

しかし、制御部190においては、ADコンバータ220やDAコンバータ222を正確な時間で周期的に行うため、デジタル信号の全チャンネル分の正規化処理や非正規化処理が優先される。したがって、非同期の割込プログラムは、図10においてハッチングで示されるように、デジタル信号の正規化処理や非正規化処理と排他的に実行されるので、その結果、割込プログラムの中断、再開を繰り返し、割込プログラムが完了するまでの時間が長期化し、ひいては、DAコンバータ222に処理結果が反映される時間が遅延する。   However, in the control unit 190, since the AD converter 220 and the DA converter 222 are periodically performed at an accurate time, the normalization processing and the non-normalization processing for all channels of the digital signal are prioritized. Therefore, the asynchronous interrupt program is exclusively executed with the digital signal normalizing process and the non-normalizing process as indicated by hatching in FIG. 10, and as a result, the interrupt program is interrupted and restarted. Repeatedly, the time until the interrupt program is completed becomes long, and eventually the time when the processing result is reflected in the DA converter 222 is delayed.

そこで、本実施形態では、デジタル信号の正規化処理や非正規化処理を必要最小限に留め、かつ、正規化処理や非正規化処理を実行する場合であっても必要なチャンネルのみに限定することで、その分、割込プログラムに時間を解放する。   Therefore, in the present embodiment, the normalization process and the non-normalization process of the digital signal are kept to a necessary minimum, and even when the normalization process and the non-normalization process are executed, only the necessary channels are limited. This frees up time for the interrupt program.

図11は、割込プログラムの処理の他の例を示したタイミングチャートである。図11の例では、制御部190の割込プログラム実行部202が主体となり、割込プログラムの要求に応じて必要最小限のAD変換およびDA変換を行う。   FIG. 11 is a timing chart showing another example of the processing of the interrupt program. In the example of FIG. 11, the interrupt program execution unit 202 of the control unit 190 serves as a main component, and performs minimum necessary AD conversion and DA conversion in response to a request from the interrupt program.

具体的に、割込プログラム実行部202は、割込プログラムの実行途中の時点(a)で任意のデジタル信号が必要になると、例えば、ADコンバータ220に接続されたアナログ信号のアドレスに対してアクセスを検出すると、AD制御回路224aにADコンバータ220の変換制御を実行させる。こうして時点(b)からAD変換が開始される。   Specifically, when the interrupt program execution unit 202 needs an arbitrary digital signal at the time (a) during execution of the interrupt program, the interrupt program execution unit 202 accesses, for example, the address of the analog signal connected to the AD converter 220. When AD is detected, the AD control circuit 224a is caused to execute the conversion control of the AD converter 220. Thus, the AD conversion is started from the time point (b).

そして、ADコンバータの変換が完了すると、AD制御回路224aは、時点(c)において、変換されたデジタル信号を保持し、制御部190を通じ、デジタル信号を正規化して正規化デジタル信号を生成する。かかる正規化は、図10を用いて説明したのと同様、アナログ値調整処理、スケール変換処理、移動平均処理からなる。   Then, when the conversion of the AD converter is completed, the AD control circuit 224a holds the converted digital signal at the time point (c) and normalizes the digital signal through the control unit 190 to generate a normalized digital signal. The normalization includes analog value adjustment processing, scale conversion processing, and moving average processing, as described with reference to FIG.

ただし、ここでは、ADコンバータ220に複数備わっているチャンネルのうち、デジタル信号が必要なチャンネルのみを正規化する。したがって、その正規化処理に費やされる処理時間は図10と比べて1/チャンネル数(ここでは1/4)となる。これは、以下の理由による。すなわち、従来のように、割込処理を演算モジュール122で実行すると、デジタル信号が必要な入出力が、入出力モジュール126のいずれのチャンネルに対応するか演算モジュール122では把握できなかったところ、図11の例では、割込処理を入出力モジュール126自体で実行しているので、デジタル信号が必要な入出力とチャンネルとの対応を把握可能となったからである。   However, here, of the plurality of channels provided in the AD converter 220, only the channel that requires a digital signal is normalized. Therefore, the processing time spent for the normalization processing is 1 / the number of channels (1/4 in this case) as compared with FIG. This is for the following reason. That is, as in the conventional case, when the interrupt processing is executed by the arithmetic module 122, the arithmetic module 122 cannot grasp which channel of the input / output module 126 the input / output requiring the digital signal corresponds to. In the example of 11, the interrupt processing is executed by the input / output module 126 itself, so that it is possible to grasp the correspondence between the input / output that requires the digital signal and the channel.

続いて、割込プログラム実行部202は、正規化デジタル信号によって割込プログラムを実行し、時点(d)において、処理結果として任意のデジタル信号が生成されると、任意のデジタル信号を非正規化して非正規化デジタル信号を生成し、DA制御回路224bのバッファに保持させる。かかる非正規化は、図10を用いて説明したのと同様、スケール変換処理、アナログ値調整処理からなる。   Subsequently, the interrupt program execution unit 202 executes the interrupt program with the normalized digital signal, and at time (d), when an arbitrary digital signal is generated as a processing result, the arbitrary digital signal is denormalized. Then, a denormalized digital signal is generated and held in the buffer of the DA control circuit 224b. The denormalization includes scale conversion processing and analog value adjustment processing as described with reference to FIG.

ただし、ここでは、DAコンバータ222に複数備わっているチャンネルのうち、デジタル信号を出力する対象となっているチャンネルのみを非正規化する。したがって、その非正規化処理に費やされる処理時間は図10と比べて1/チャンネル数(ここでは1/4)となる。   However, here, of the plurality of channels provided in the DA converter 222, only the channel for which the digital signal is output is denormalized. Therefore, the processing time spent for the denormalization processing is 1 / the number of channels (1/4 in this case) as compared with FIG.

最後に、割込プログラム実行部202は、時点(e)において、DA制御回路224bに、非正規化デジタル信号によってDAコンバータ222の変換制御を実行させる。こうして、DAコンバータ222からアナログ信号が出力される。   Finally, the interrupt program execution unit 202 causes the DA control circuit 224b to execute the conversion control of the DA converter 222 by the denormalized digital signal at the time point (e). In this way, the DA converter 222 outputs an analog signal.

かかる図11の処理では、図10での処理と比べ、AD変換やDA変換を周期的に行っていないので、そのAD変換やDA変換に伴うデジタル信号の正規化処理や非正規化処理が行われない。また、制御部190が主体となり、必要なチャンネルのみ正規化処理や非正規化処理を実行し、他のチャンネルについての正規化処理や非正規化処理を実行していない(前回値をそのまま利用する)。   In the processing of FIG. 11, compared with the processing of FIG. 10, since AD conversion and DA conversion are not periodically performed, normalization processing and denormalization processing of digital signals accompanying the AD conversion and DA conversion are performed. I don't know. In addition, the control unit 190 takes the lead, executes normalization processing and denormalization processing only on necessary channels, and does not execute normalization processing and denormalization processing on other channels (the previous value is used as it is. ).

したがって、図11にハッチングで示すように、正規化処理や非正規化処理によって割込プログラムが中断させられることもなく、割込プログラムが図10に比べて短時間で終了することが理解できる。このように、図11の例では、割込プログラムの実行時間を確保し、資源の有効利用を図ることができる。   Therefore, as shown by hatching in FIG. 11, it can be understood that the interrupt program is not interrupted by the normalization process or the non-normalization process, and the interrupt program ends in a shorter time than in FIG. 10. As described above, in the example of FIG. 11, it is possible to secure the execution time of the interrupt program and effectively use the resources.

また、他の処理でも、デジタル信号の正規化処理や非正規化処理を必要最小限に留め、かつ、正規化処理や非正規化処理を実行する場合であっても必要なチャンネルのみに限定することで、その分、割込プログラムに処理時間を解放することができる。   Also, in other processing, the normalization processing and the non-normalization processing of the digital signal are kept to a minimum, and even when the normalization processing and the non-normalization processing are executed, they are limited to only the necessary channels. As a result, the processing time can be released to the interrupt program.

図12は、割込プログラムの処理のさらに他の例を示したタイミングチャートである。図12の例では、AD制御回路224aやDA制御回路224bが主体となり、所定の周期(例えば、25μsec)でAD変換およびDA変換を繰り返しつつ、その途中で、制御部190の割込プログラム実行部202が主体となり、割込プログラムの要求に応じてデジタル信号の処理を行う。   FIG. 12 is a timing chart showing still another example of the processing of the interrupt program. In the example of FIG. 12, the AD control circuit 224a and the DA control circuit 224b are the main components, and while the AD conversion and the DA conversion are repeated at a predetermined cycle (for example, 25 μsec), the interrupt program execution unit of the control unit 190 is in the middle thereof. The main unit 202 is to process digital signals in response to a request from the interrupt program.

具体的に、AD制御回路224aは、所定の周期に基づく、例えば時点(a)において、ADコンバータ220の変換制御を開始し、変換されたデジタル信号をバッファに保持する。また、DA制御回路224bは、AD制御回路224aと独立した所定の周期に基づく、例えば時点(b)において、DA制御回路224bのバッファに保持された非正規化デジタル信号によってDAコンバータ222の変換制御を実行する。こうして、DAコンバータ222からアナログ信号が出力される。ここでは、正規化処理および非正規化処理を除くAD変換およびDA変換が周期的に行われる。   Specifically, the AD control circuit 224a starts conversion control of the AD converter 220 at a time point (a) based on a predetermined cycle, and holds the converted digital signal in a buffer. Further, the DA control circuit 224b controls the conversion of the DA converter 222 by the denormalized digital signal held in the buffer of the DA control circuit 224b at a time point (b) based on a predetermined cycle independent of the AD control circuit 224a. To execute. In this way, the DA converter 222 outputs an analog signal. Here, AD conversion and DA conversion excluding normalization processing and non-normalization processing are periodically performed.

そして、制御部190の割込プログラム実行部202は、割込プログラムの実行途中の時点(c)で任意のデジタル信号が必要になると、例えば、ADコンバータ220に接続されたアナログ信号のアドレスに対してアクセスを検出すると、時点(d)において、AD制御回路224aに保持された、変換後の最新のデジタル信号を読み出し、デジタル信号を正規化して正規化デジタル信号を生成する。かかる正規化は、図10を用いて説明したのと同様、アナログ値調整処理、スケール変換処理、移動平均処理からなる。ここで、時点(d)では、ADコンバータ220が次の変換を開始しているが、変換結果が生成されていないので、前回の変換結果が用いられる。   Then, the interrupt program execution unit 202 of the control unit 190, when an arbitrary digital signal is required at the time point (c) during the execution of the interrupt program, for example, with respect to the address of the analog signal connected to the AD converter 220, When the access is detected, the latest digital signal after conversion held in the AD control circuit 224a is read out at the time point (d), and the digital signal is normalized to generate a normalized digital signal. The normalization includes analog value adjustment processing, scale conversion processing, and moving average processing, as described with reference to FIG. Here, at the time point (d), the AD converter 220 has started the next conversion, but since the conversion result has not been generated, the previous conversion result is used.

ただし、ここでも、ADコンバータ220に複数備わっているチャンネルのうち、デジタル信号が必要なチャンネルのみを正規化する。したがって、その正規化処理に費やされる処理時間は図10と比べて1/チャンネル数(ここでは1/4)となる。   However, also here, of the plurality of channels provided in the AD converter 220, only the channel for which a digital signal is required is normalized. Therefore, the processing time spent for the normalization processing is 1 / the number of channels (1/4 in this case) as compared with FIG.

続いて、割込プログラム実行部202は、正規化デジタル信号によって割込プログラムを実行し、時点(e)において、処理結果として任意のデジタル信号が生成されると、任意のデジタル信号を非正規化して非正規化デジタル信号を生成し、DA制御回路224bのバッファに保持させる。かかる非正規化は、図10を用いて説明したのと同様、スケール変換処理、アナログ値調整処理からなる。   Subsequently, the interrupt program execution unit 202 executes the interrupt program with the normalized digital signal, and when an arbitrary digital signal is generated as a processing result at the time point (e), the arbitrary digital signal is denormalized. Then, a denormalized digital signal is generated and held in the buffer of the DA control circuit 224b. The denormalization includes scale conversion processing and analog value adjustment processing as described with reference to FIG.

ただし、ここでも、DAコンバータ222に複数備わっているチャンネルのうち、デジタル信号を出力する対象となっているチャンネルのみを非正規化する。したがって、その非正規化処理に費やされる処理時間は図10と比べて1/チャンネル数(ここでは1/4)となる。   However, also here, of the plurality of channels provided in the DA converter 222, only the channel for which the digital signal is output is denormalized. Therefore, the processing time spent for the denormalization processing is 1 / the number of channels (1/4 in this case) as compared with FIG.

そして、DA制御回路224bは、バッファに保持している非正規化デジタル信号によってDAコンバータ222の変換制御を実行させる。   Then, the DA control circuit 224b executes the conversion control of the DA converter 222 by the denormalized digital signal held in the buffer.

かかる図12の処理でも、図10の処理と比べ、デジタル信号の正規化処理や非正規化処理を周期的に行っていない。また、制御部190が主体となって実行されるAD変換やDA変換においては、必要なチャンネルのみ正規化処理や非正規化処理を実行し、他のチャンネルについての正規化処理や非正規化処理を実行していない(前回値をそのまま利用する)。   Even in the process of FIG. 12, the normalizing process and the denormalizing process of the digital signal are not periodically performed as compared with the process of FIG. Further, in AD conversion and DA conversion mainly performed by the control unit 190, normalization processing and denormalization processing are performed only on necessary channels, and normalization processing and denormalization processing are performed on other channels. Is not executed (the previous value is used as it is).

したがって、図12にハッチングで示すように、正規化処理や非正規化処理によって割込プログラムが中断させられることもなく、かつ、AD変換を待つことすらないので、割込プログラムが、図10や図11に比べて短時間で終了することが理解できる。このように、図12の例では、割込プログラムの実行時間を確保し、資源のさらなる有効利用を図ることができる。   Therefore, as shown by hatching in FIG. 12, the interrupt program is not interrupted by the normalization process or the non-normalization process, and the AD conversion is not waited. It can be understood that the processing is completed in a shorter time than in FIG. As described above, in the example of FIG. 12, the execution time of the interrupt program can be secured and the resources can be used more effectively.

また、正規化処理や非正規化処理の負荷が最小化されるので、制御部190の駆動時間が短くなり、発熱や消費電力を抑えることもできる。   Moreover, since the load of the normalization process and the non-normalization process is minimized, the drive time of the control unit 190 is shortened, and heat generation and power consumption can be suppressed.

(第3の実施形態)
図3でも説明したように、実行プログラムは、割込プログラムと非割込プログラムに大別され、割込プログラムに基づく割込処理については、入出力モジュール126に完結的に割り当てることができる。そして、演算モジュール122は、非割込プログラムに基づく非割込処理によって入出力モジュール126から割込処理の結果を取得することができる。
(Third Embodiment)
As described with reference to FIG. 3, the execution program is roughly divided into the interrupt program and the non-interrupt program, and the interrupt processing based on the interrupt program can be completely assigned to the input / output module 126. Then, the arithmetic module 122 can acquire the result of the interrupt processing from the input / output module 126 by the non-interrupt processing based on the non-interrupt program.

図13は、非割込処理の一例を説明するためのタイミングチャートである。まず、入出力モジュール126の割込プログラム実行部202は、時点(a)において割込処理が発生すると、割込プログラムに基づいて演算処理を実行し、その処理結果を、時点(b)において、共有メモリ184に保持する。   FIG. 13 is a timing chart for explaining an example of non-interrupt processing. First, when the interrupt process occurs at the time point (a), the interrupt program execution unit 202 of the input / output module 126 executes arithmetic processing based on the interrupt program, and the processing result is obtained at the time point (b). It is held in the shared memory 184.

続いて、演算モジュール122は、周期的に、非割込プログラムに基づく非割込処理を実行し、その開始時点(c)において、入出力モジュール126の共有メモリ184から入力データを取得する。そして、非割込プログラムの実行途中の時点(d)で当該入力データを演算し、その演算結果である出力データを、周期の終了時点(e)において、共有メモリ184に保持する。最後に、入出力モジュール126の割込プログラム実行部202は、任意の時点(f)において共有メモリ184から出力データを取得する。   Subsequently, the arithmetic module 122 periodically executes the non-interruption process based on the non-interruption program, and at the start time (c), acquires the input data from the shared memory 184 of the input / output module 126. Then, the input data is calculated at a time point (d) during the execution of the non-interruption program, and the output data as the calculation result is held in the shared memory 184 at the end time point (e) of the cycle. Finally, the interrupt program execution unit 202 of the input / output module 126 acquires output data from the shared memory 184 at an arbitrary time point (f).

このように、周期的に非割込処理を実行することで、データの入出力をタクトタイムに正確に同期させることが可能となる。しかし、入力データが生成されてから非割込プログラムで処理される入力応答時間や、非割込プログラムで処理されてから出力データが反映されるまでの出力応答時間は長くなってしまう。このような入力応答時間や出力応答時間は、タクトタイムに影響を受けている。例えば、入出力モジュール126の数や、入出力モジュール126で用いる入出力数が増加し、それに応じて非割込処理が長くなると、タクトタイムを長くせざるを得なくなり、それに伴って、入力応答時間や出力応答時間も長期化する。そうすると、制御システム100全体の制御精度や応答性が低下するおそれがある。   As described above, by periodically executing the non-interruption process, it becomes possible to accurately synchronize the input / output of data with the takt time. However, the input response time after the input data is generated and processed by the non-interrupt program, and the output response time after the non-interrupt program is processed until the output data is reflected become long. Such input response time and output response time are affected by the takt time. For example, if the number of input / output modules 126 or the number of input / outputs used by the input / output module 126 increases and the non-interrupt processing becomes longer accordingly, the takt time is inevitably lengthened. The time and output response time also become longer. Then, the control accuracy and responsiveness of the entire control system 100 may deteriorate.

ここで、入出力の即応性が必要となる場合、プログラマブルコントローラ120を別途独立して設け、その独立したプログラマブルコントローラ120において、演算処理や入出力数を必要最小限に抑え、タクトタイムを短縮して高速に入出力処理を実行し、その結果を、通信モジュール124を介して送受信することも考えられる。しかし、かかる手法では制御システム100が大規模化してしまう。   Here, when input / output responsiveness is required, the programmable controller 120 is separately provided, and in the independent programmable controller 120, arithmetic processing and the number of inputs / outputs are minimized to shorten the takt time. It is also conceivable to execute input / output processing at high speed and send / receive the result via the communication module 124. However, with this method, the control system 100 becomes large-scale.

そこで、プログラマブルコントローラ120内で、即応性より同期性を優先する処理と、同期性より即応性を優先する処理とを分け、それぞれにバスおよび入出力モジュール126を個別に割り当てる。具体的には、上述したように、ベースボードにシリアル伝送方式の第1バスや、パラレル伝送方式の第2バスといった複数のバスを準備し、それぞれ異なる複数の入出力モジュール126に接続する。ここでシリアル伝送方式は、データのビット数未満のラインに対し1ビットずつ順番に情報を伝達する方式であり、パラレル伝送方式は、少なくともデータのビット数のラインに対し、全ての情報を各ラインに並行して同時に伝送する方式をいう。   Therefore, in the programmable controller 120, a process that prioritizes synchronism over responsiveness and a process that prioritizes responsiveness over synchronism are separated, and a bus and an input / output module 126 are individually assigned to each. Specifically, as described above, a plurality of buses such as a serial transmission type first bus and a parallel transmission type second bus are prepared on the base board, and are connected to different input / output modules 126. Here, the serial transmission method is a method of sequentially transmitting information one bit at a time to a line having less than the number of bits of data, and the parallel transmission method is a method of transmitting all information to each line for at least a line having the number of bits of data. It is a method of transmitting data in parallel in parallel.

例えば、任意の入出力モジュール126(以下、単に第1入出力モジュールという)は、第1バスのみを通じて演算モジュール122と接続し、任意の他の入出力モジュール126(以下、単に第2入出力モジュールという)は、第2バスのみを通じて演算モジュール122と接続する。そして、第1バスを通じた第1入出力モジュール(第1入力モジュール)については、図13のように周期的に処理し、第2バスを通じた第2入出力モジュール(第2入力モジュール)については、以下に示すように高速処理を行い、かかる同期性を優先する処理と即応性を優先する処理とを並行して実行する。   For example, the arbitrary input / output module 126 (hereinafter, simply referred to as the first input / output module) is connected to the arithmetic module 122 through only the first bus, and any other input / output module 126 (hereinafter, simply referred to as the second input / output module). Is connected to the arithmetic module 122 through only the second bus. Then, the first input / output module (first input module) through the first bus is periodically processed as shown in FIG. 13, and the second input / output module (second input module) through the second bus is processed. As described below, high-speed processing is performed, and processing for prioritizing such synchronism and processing for prioritizing responsiveness are executed in parallel.

図14は、非割込処理の他の例を説明するためのタイミングチャートである。ここでは、図13を用いて説明した周期的な処理ではなく、データが生成されたタイミングで処理を開始する割込処理が行われる。入出力モジュール126の割込プログラム実行部202は、時点(a)において割込処理が発生すると、割込プログラムに基づいて演算処理を実行し、その処理結果を、時点(b)において、共有メモリ184に保持し、演算モジュール122に、入力データの準備ができた旨伝達する(割込通知)。   FIG. 14 is a timing chart for explaining another example of the non-interrupt processing. Here, instead of the periodical processing described with reference to FIG. 13, an interrupt processing for starting the processing at the timing when the data is generated is performed. When the interrupt processing occurs at the time point (a), the interrupt program execution unit 202 of the input / output module 126 executes the arithmetic processing based on the interrupt program, and outputs the processing result to the shared memory at the time point (b). 184 is held and the operation module 122 is notified that the input data is ready (interrupt notification).

続いて、演算モジュール122は、非割込プログラムに基づく非割込処理を実行し、入出力モジュール126からの伝達に応じて、時点(c)において、入出力モジュール126の共有メモリ184から入力データを取得し、当該入力データを演算し、その演算結果である出力データを、周期の終了時点(d)において、共有メモリ184に保持し、入出力モジュール126に、入力データの準備ができた旨伝達する(割込通知)。最後に、入出力モジュール126の割込プログラム実行部202は、演算モジュール122からの伝達に応じて、時点(e)において共有メモリ184から出力データを取得する。   Subsequently, the arithmetic module 122 executes the non-interrupt processing based on the non-interrupt program, and in response to the transmission from the input / output module 126, at the time point (c), the input data is input from the shared memory 184 of the input / output module 126. Is obtained, the input data is calculated, and the output data, which is the calculation result, is held in the shared memory 184 at the end point (d) of the cycle and the input / output module 126 is ready for the input data. Communicate (interrupt notification). Finally, the interrupt program execution unit 202 of the input / output module 126 acquires the output data from the shared memory 184 at the time point (e) in response to the transmission from the arithmetic module 122.

ここでは、データが生成されたタイミングで割込通知を行い、タクトタイムに関係なく、データが生成された直後にモジュール間でデータの送受信を行っているので、入力応答時間や出力応答時間を短縮することが可能となる。   Here, the interrupt notification is given at the timing when the data is generated, and the data is sent and received between the modules immediately after the data is generated, regardless of the tact time, so the input response time and output response time are shortened. It becomes possible to do.

図13、図14を用いて説明したように、即応性より同期性を優先する処理と、同期性より即応性を優先する処理とを並行して実行することで以下の効果を得られる。すなわち、第1バスを通じた第1入出力モジュールにより、従来通り、データの入力、出力をタクトタイムに正確に同期させることが可能となる。また、第2バスを通じた第2入出力モジュールにより、入力応答時間や出力応答時間を短縮できるので、入出力モジュール126の数や、入出力モジュール126で用いる入出力数が増加し、それに応じて非割込処理が長くなり、タクトタイムを長くせざるを得なくなったとしても、制御システム100全体の制御精度や応答性を向上することが可能となる。   As described with reference to FIGS. 13 and 14, the following effects can be obtained by executing the processing that prioritizes synchronism over responsiveness and the processing that prioritizes responsiveness over synchronism in parallel. That is, the first input / output module via the first bus enables the input and output of data to be accurately synchronized with the tact time as in the conventional case. In addition, since the second input / output module through the second bus can reduce the input response time and the output response time, the number of input / output modules 126 and the number of input / outputs used by the input / output module 126 increase, and accordingly. Even if the non-interruption process becomes long and the takt time has to be lengthened, the control accuracy and responsiveness of the entire control system 100 can be improved.

このように複数の伝送方式を採用し、それぞれの特性を活かして入出力を分配することで、制御システム100全体として処理効率や汎用性を高めることができる。また、少ないプログラマブルコントローラ120による少ないモジュール数で、同期性と即応性とをいずれも実現することが可能となる。   In this way, by adopting a plurality of transmission methods and utilizing the respective characteristics to distribute the input and output, it is possible to improve the processing efficiency and versatility of the control system 100 as a whole. In addition, both the synchronism and the responsiveness can be realized with a small number of modules by the small programmable controller 120.

また、コンピュータを制御システム100として機能させるプログラムや、当該プログラムを記録した、コンピュータで読み取り可能なフレキシブルディスク、光磁気ディスク、ROM、CD、DVD、BD等の記憶媒体も提供される。ここで、プログラムは、任意の言語や記述方法にて記述されたデータ処理手段をいう。   In addition, a program that causes a computer to function as the control system 100 and a computer-readable storage medium such as a computer-readable flexible disk, a magneto-optical disk, a ROM, a CD, a DVD, or a BD are also provided. Here, the program means a data processing unit described in an arbitrary language or a description method.

以上、添付図面を参照しながら本発明の好適な実施形態について説明したが、本発明はかかる実施形態に限定されないことは言うまでもない。当業者であれば、特許請求の範囲に記載された範疇において、各種の変更例または修正例に想到し得ることは明らかであり、それらについても当然に本発明の技術的範囲に属するものと了解される。   The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but it goes without saying that the present invention is not limited to such embodiments. It is obvious to those skilled in the art that various changes or modifications can be conceived within the scope of the claims, and it should be understood that these also belong to the technical scope of the present invention. To be done.

例えば、上述した実施形態においては、説明の便宜上、入出力モジュール126において割込プログラムを用い、演算モジュール122で、その割込プログラムを除く非割込プログラムを用いる例を挙げて説明したが、入出力モジュール126に割り当てる割込プログラムは、実行プログラムに含まれる全ての割込プログラムの一部であればよく、残りの割込プログラムを演算モジュール122自体で用いることができる。したがって、非割込プログラムは、入出力モジュール126に割り当てた割込プログラムを除く全てのプログラムを含むこととなる。   For example, in the above-described embodiment, for convenience of description, an example in which the input / output module 126 uses an interrupt program and the arithmetic module 122 uses a non-interrupt program excluding the interrupt program has been described. The interrupt program assigned to the output module 126 may be a part of all the interrupt programs included in the execution program, and the remaining interrupt programs can be used by the arithmetic module 122 itself. Therefore, the non-interruption program includes all programs except the interruption program assigned to the input / output module 126.

また、上述した実施形態においては、プログラム複製部170が演算モジュール122に備わっている例を挙げて説明したが、かかる場合に限らず、入出力モジュール126や他のモジュール、もしくは、管理装置110に備わるとしてもよい。同様に、複製対象となる割込プログラムが演算モジュール122の不揮発性メモリ152に保持されている例を挙げて説明したが、その保持されるメモリは制御システム100内のいずれのメモリであってもよい。また、上述した実施形態においては、割込プログラムを入出力モジュール126に複製する例を挙げたが、非割込プログラムをいずれかのメモリに保持しておき、所定の契機に、非割込プログラムを演算モジュール122に複製するとしてもよい。   Further, in the above-described embodiment, an example in which the program duplication unit 170 is provided in the arithmetic module 122 has been described, but the present invention is not limited to this case, and the input / output module 126, another module, or the management device 110 may be used. It may be equipped. Similarly, the example in which the interrupt program to be copied is held in the nonvolatile memory 152 of the arithmetic module 122 has been described, but the held memory may be any memory in the control system 100. Good. Further, in the above-described embodiment, an example in which the interrupt program is duplicated in the input / output module 126 has been described, but the non-interrupt program is held in any memory, and the non-interrupt program is triggered at a predetermined timing. May be duplicated in the computing module 122.

また、上述した実施形態においては、割込プログラムを複製する所定の契機として、制御システム100の起動時を挙げて説明したが、他の任意のタイミングを排除するものではなく、様々なタイミングを選択することができる。なお、上述した実施形態においては、制御システム100を起動する度に割込プログラムを入出力モジュール126の共有メモリ184に複製する例を挙げて説明したが、入出力モジュール126において割込プログラムを保持するメモリが不揮発性であれば、そのメモリに割込プログラムが既に複製されているか否か判定し、複製されていない場合にのみ割込プログラムを複製するとしてもよい。   Further, in the above-described embodiment, the case where the control system 100 is started has been described as the predetermined trigger for copying the interrupt program, but other arbitrary timings are not excluded, and various timings are selected. can do. In the above-described embodiment, an example in which the interrupt program is copied to the shared memory 184 of the input / output module 126 each time the control system 100 is activated has been described, but the input / output module 126 holds the interrupt program. If the memory to be executed is non-volatile, it may be determined whether or not the interrupt program has already been copied to the memory, and the interrupt program may be copied only when it has not been copied.

上述した実施形態においては、制御システム100を例に挙げて説明したが、分散型制御装置(DCS)等、様々な機器に適用することができる。また、上述した実施形態においては、入力モジュールと出力モジュールが結合された入出力モジュール126を通じて外部からデータを入力する例を挙げているが、出力モジュールは必須の構成ではなく、少なくとも入力モジュールがあれば本実施形態を適用することができる。   In the above-described embodiment, the control system 100 has been described as an example, but it can be applied to various devices such as a distributed control device (DCS). Further, in the above-described embodiment, an example is given in which data is input from the outside through the input / output module 126 in which the input module and the output module are combined, but the output module is not an indispensable configuration, and at least the input module is required. For example, this embodiment can be applied.

また、上述した実施形態においては、実行プログラムのうち割込プログラムを入出力モジュール126に複製し、入出力モジュール126にて割込処理を実行する例を挙げて説明したが、パラレル伝送方式の第2バスによって接続される場合、その割込処理の一部を、さらに演算モジュール122に割り当て、割込処理を分散することもできる。   Further, in the above-described embodiment, an example in which the interrupt program of the execution programs is duplicated in the input / output module 126 and the interrupt processing is executed in the input / output module 126 has been described. When connected by two buses, a part of the interrupt processing can be further allocated to the arithmetic module 122 to distribute the interrupt processing.

また、上述した実施形態においては、複数のバスとして、シリアル伝送方式の第1バスとパラレル伝送方式の第2バスを挙げて説明したが、かかる場合に限らず、複数のバスがいずれもシリアル伝送方式であってもよいし、パラレル伝送方式であってもよい。また、上述した実施形態においては、いずれのバスにも制御部190を有する入出力モジュール126を接続する例を挙げて説明したが、即応性を要さない第1バスに接続する入出力モジュール126は、制御部190を有さないFPGA等により入出力を管理する入出力モジュールであってもよい。   Further, in the above-described embodiments, the first bus of the serial transmission system and the second bus of the parallel transmission system have been described as the plurality of buses, but the present invention is not limited to such a case, and all the plurality of buses perform serial transmission. It may be a system or a parallel transmission system. Further, in the above-described embodiment, the example in which the input / output module 126 having the control unit 190 is connected to any of the buses has been described, but the input / output module 126 connected to the first bus that does not require responsiveness. May be an input / output module that manages input / output by an FPGA or the like that does not have the control unit 190.

なお、本明細書の制御方法の各工程は、必ずしもタイミングチャートとして記載された順序に沿って時系列に処理する必要はなく、また、並列的あるいはサブルーチンによる処理を含んでもよい。   It should be noted that each step of the control method of the present specification does not necessarily have to be processed in time series in the order described as the timing chart, and may be processed in parallel or by a subroutine.

本発明は、演算モジュールと入力モジュールとを備える制御システムおよび制御方法に利用することができる。   INDUSTRIAL APPLICABILITY The present invention can be used for a control system and a control method including an arithmetic module and an input module.

100 制御システム
122 演算モジュール
126 入出力モジュール(入力モジュール、第1入力モジュール、第2入力モジュール)
170 プログラム複製部
172 非割込プログラム実行部
174 履歴管理部
200 条件判定部
202 割込プログラム実行部
204 履歴通知部
220 ADコンバータ
222 DAコンバータ
224a AD制御回路
224b DA制御回路
100 control system 122 arithmetic module 126 input / output module (input module, first input module, second input module)
170 Program Duplication Unit 172 Non-Interrupt Program Execution Unit 174 History Management Unit 200 Condition Judgment Unit 202 Interrupt Program Execution Unit 204 History Notification Unit 220 AD Converter 222 DA Converter 224a AD Control Circuit 224b DA Control Circuit

Claims (12)

外部からデータを入力する入力モジュールと、前記入力モジュールとバスを通じて接続され、該入力モジュールから受信したデータに基づいて演算を行う演算モジュールと、を備えた制御システムであって、
前記制御システムで実行されるプログラムは、割込条件の成立を実行契機とする割込プログラムと、該割込プログラムを除いた非割込プログラムとを含んでなり、
前記入力モジュールは、
前記割込プログラムに対応付けられた割込条件が成立しているか否か判定する条件判定部と、
前記割込条件が成立していると判定されると、前記割込プログラムを実行する割込プログラム実行部と、
外部のアナログ信号をデジタル信号に変換するADコンバータと、
該ADコンバータの変換制御を行うAD制御回路と、
を備え、
前記割込プログラム実行部は、
前記割込プログラムの実行途中で任意のデジタル信号が必要になると、前記AD制御回路に前記ADコンバータの変換制御を実行させ、
前記ADコンバータの変換完了後に、前記任意のデジタル信号のみ正規化して正規化デジタル信号を生成し、
前記正規化デジタル信号によって前記割込プログラムを実行し、
前記演算モジュールは、
前記割込プログラム実行部の実行結果を参照し、前記非割込プログラムを実行する非割込プログラム実行部
を備えることを特徴とする制御システム。
A control system comprising: an input module for inputting data from the outside; and an arithmetic module connected to the input module through a bus and performing an arithmetic operation based on data received from the input module,
The program executed by the control system includes an interrupt program triggered by the establishment of an interrupt condition and a non-interrupt program excluding the interrupt program,
The input module is
A condition determination unit that determines whether or not an interrupt condition associated with the interrupt program is satisfied,
When it is determined that the interrupt condition is satisfied, an interrupt program execution unit that executes the interrupt program,
An AD converter for converting an external analog signal into a digital signal,
An AD control circuit for controlling conversion of the AD converter;
Equipped with
The interrupt program execution unit,
When an arbitrary digital signal is required during execution of the interrupt program, the AD control circuit is caused to execute conversion control of the AD converter,
After the conversion of the AD converter is completed, only the arbitrary digital signal is normalized to generate a normalized digital signal,
Executing the interrupt program by the normalized digital signal,
The arithmetic module is
A control system comprising a non-interruption program execution unit for executing the non-interruption program with reference to the execution result of the interruption program execution unit.
前記入力モジュールは、デジタル信号をアナログ信号に変換して外部に出力するDAコンバータと、該DAコンバータの変換制御を行うDA制御回路と、を備え、
前記割込プログラム実行部は、
前記割込プログラムの実行途中で任意のデジタル信号が生成されると、前記任意のデジタル信号のみ非正規化して非正規化デジタル信号を生成し、
前記DA制御回路に、前記非正規化デジタル信号によって前記DAコンバータの変換制御を実行させることを特徴とする請求項に記載の制御システム。
The input module includes a DA converter that converts a digital signal into an analog signal and outputs the analog signal to the outside, and a DA control circuit that performs conversion control of the DA converter.
The interrupt program execution unit,
When an arbitrary digital signal is generated during the execution of the interrupt program, only the arbitrary digital signal is denormalized to generate a denormalized digital signal,
The control system according to claim 1 , wherein the DA control circuit is caused to execute conversion control of the DA converter by the denormalized digital signal.
外部からデータを入力する入力モジュールと、前記入力モジュールとバスを通じて接続され、該入力モジュールから受信したデータに基づいて演算を行う演算モジュールと、を備えた制御システムであって、
前記制御システムで実行されるプログラムは、割込条件の成立を実行契機とする割込プログラムと、該割込プログラムを除いた非割込プログラムとを含んでなり、
前記入力モジュールは、
前記割込プログラムに対応付けられた割込条件が成立しているか否か判定する条件判定部と、
前記割込条件が成立していると判定されると、前記割込プログラムを実行する割込プログラム実行部と、
外部のアナログ信号をデジタル信号に変換するADコンバータと、
該ADコンバータの変換制御を行うAD制御回路と、
を備え、
前記AD制御回路は、
所定の周期で前記ADコンバータの変換制御を実行し、
変換されたデジタル信号を保持し、
前記割込プログラム実行部は、
前記割込プログラムの実行途中で任意のデジタル信号が必要になると、前記AD制御回路に保持された該任意のデジタル信号のみ正規化して正規化デジタル信号を生成し、
前記正規化デジタル信号によって前記割込プログラムを実行し、
前記演算モジュールは、
前記割込プログラム実行部の実行結果を参照し、前記非割込プログラムを実行する非割込プログラム実行部
を備えることを特徴とする制御システム。
A control system comprising: an input module for inputting data from the outside; and an arithmetic module connected to the input module through a bus and performing an arithmetic operation based on data received from the input module,
The program executed by the control system includes an interrupt program triggered by the establishment of an interrupt condition and a non-interrupt program excluding the interrupt program,
The input module is
A condition determination unit that determines whether or not an interrupt condition associated with the interrupt program is satisfied,
When it is determined that the interrupt condition is satisfied, an interrupt program execution unit that executes the interrupt program,
An AD converter for converting an external analog signal into a digital signal,
An AD control circuit for controlling conversion of the AD converter;
Equipped with
The AD control circuit is
The conversion control of the AD converter is executed at a predetermined cycle,
Hold the converted digital signal,
The interrupt program execution unit,
When an arbitrary digital signal is required during the execution of the interrupt program, only the arbitrary digital signal held in the AD control circuit is normalized to generate a normalized digital signal,
Executing the interrupt program by the normalized digital signal,
The arithmetic module is
A control system comprising a non-interruption program execution unit for executing the non-interruption program with reference to the execution result of the interruption program execution unit.
前記入力モジュールは、デジタル信号をアナログ信号に変換して外部に出力するDAコンバータと、該DAコンバータの変換制御を行うDA制御回路と、を備え、
前記割込プログラム実行部は、
前記割込プログラムの実行途中で任意のデジタル信号が生成されると、前記任意のデジタル信号のみ非正規化して非正規化デジタル信号を生成し、
前記非正規化デジタル信号を前記DA制御回路に保持させ、
前記DA制御回路は、
前記非正規化デジタル信号によって前記DAコンバータの変換制御を実行することを特徴とする請求項に記載の制御システム。
The input module includes a DA converter that converts a digital signal into an analog signal and outputs the analog signal to the outside, and a DA control circuit that performs conversion control of the DA converter.
The interrupt program execution unit,
When an arbitrary digital signal is generated during the execution of the interrupt program, only the arbitrary digital signal is denormalized to generate a denormalized digital signal,
Holding the denormalized digital signal in the DA control circuit,
The DA control circuit is
The control system according to claim 3 , wherein conversion control of the DA converter is executed by the denormalized digital signal.
所定の契機に、前記割込プログラムを前記入力モジュールに複製するプログラム複製部をさらに備えることを特徴とする請求項1から4のいずれか1項に記載の制御システム。 The control system according to any one of claims 1 to 4, further comprising a program duplication unit that duplicates the interrupt program in the input module at a predetermined occasion. 前記所定の契機は、前記演算モジュールおよび前記入力モジュールの起動時であり、
前記プログラム複製部は、前記割込プログラムを、前記演算モジュールから前記入力モジュールに複製することを特徴とする請求項に記載の制御システム。
The predetermined trigger is when the arithmetic module and the input module are activated,
The control system according to claim 5 , wherein the program duplication unit duplicates the interrupt program from the arithmetic module to the input module.
前記入力モジュールは、前記割込プログラム実行部が前記割込プログラムに基づく割込処理を完了すると、割込処理が完了した旨の情報を前記演算モジュールに送信する履歴通知部をさらに備えることを特徴とする請求項1からのいずれか1項に記載の制御システム。 The input module further includes a history notification unit that transmits information indicating that the interrupt processing is completed to the arithmetic module when the interrupt program execution unit completes the interrupt processing based on the interrupt program. The control system according to any one of claims 1 to 6 . 前記入力モジュールは、第1入力モジュールおよび第2入力モジュールを含み、
前記バスは、前記演算モジュールと前記第1入力モジュールとを接続する第1バス、および、前記演算モジュールと前記第2入力モジュールとを接続する第2バスを含み、
前記演算モジュールは、所定のタクトタイム毎に、前記第1バスを通じて、前記第1入力モジュールからデータを入力し、
前記第2入力モジュールの前記割込プログラム実行部は、前記タクトタイムに関係ない所定のタイミングで、前記第2バスを通じて、前記第2入力モジュールのデータを前記演算モジュールに入力させることを特徴とする請求項1からのいずれか1項に記載の制御システム。
The input module includes a first input module and a second input module,
The bus includes a first bus connecting the arithmetic module and the first input module, and a second bus connecting the arithmetic module and the second input module,
The arithmetic module inputs data from the first input module through the first bus at every predetermined tact time,
The interrupt program execution unit of the second input module causes the data of the second input module to be input to the arithmetic module via the second bus at a predetermined timing irrelevant to the tact time. The control system according to any one of claims 1 to 7 .
前記演算モジュールは、
所定のタクトタイム毎に、前記第1バスを通じて、前記第1入力モジュールにデータを出力し、
前記タクトタイムに関係ない所定のタイミングで、前記第2バスを通じて、前記第2入力モジュールにデータを出力することを特徴とする請求項に記載の制御システム。
The arithmetic module is
Outputting data to the first input module through the first bus at every predetermined tact time,
9. The control system according to claim 8 , wherein data is output to the second input module through the second bus at a predetermined timing irrelevant to the takt time.
前記第1バスは、シリアル伝送方式であり、
前記第2バスは、パラレル伝送方式であることを特徴とする請求項またはに記載の制御システム。
The first bus is a serial transmission system,
Said second bus, the control system according to claim 8 or 9, characterized in that a parallel transmission scheme.
外部からデータを入力する入力モジュールと、前記入力モジュールとバスを通じて接続され、該入力モジュールから受信したデータに基づいて演算を行う演算モジュールと、を備える制御システムを用いた制御方法であって、
前記制御システムで実行されるプログラムは、割込条件の成立を実行契機とする割込プログラムと、該割込プログラムを除いた非割込プログラムとを含んでなり、
前記入力モジュールが、
前記割込プログラムに対応付けられた割込条件が成立しているか否か判定し、
前記割込条件が成立していると判定すると、前記割込プログラムを実行し、
前記割込プログラムの実行途中で任意のデジタル信号が必要になると、外部のアナログ信号をデジタル信号に変換するADコンバータの変換制御を行うAD制御回路に前記ADコンバータの変換制御を実行させ、
前記ADコンバータの変換完了後に、前記任意のデジタル信号のみ正規化して正規化デジタル信号を生成し、
前記正規化デジタル信号によって前記割込プログラムを実行し、
前記演算モジュールが、
前記割込プログラムの実行結果を参照し、前記非割込プログラムを実行することを特徴とする制御方法。
A control method using a control system, comprising: an input module for inputting data from the outside; and an arithmetic module that is connected to the input module through a bus and performs an arithmetic operation based on data received from the input module.
The program executed by the control system includes an interrupt program triggered by the establishment of an interrupt condition and a non-interrupt program excluding the interrupt program,
The input module is
It is determined whether or not the interrupt condition associated with the interrupt program is satisfied,
If it is determined that the interrupt condition is satisfied, the interrupt program is executed,
When an arbitrary digital signal is required during the execution of the interrupt program, an AD control circuit that performs conversion control of an AD converter that converts an external analog signal into a digital signal is caused to execute conversion control of the AD converter.
After the conversion of the AD converter is completed, only the arbitrary digital signal is normalized to generate a normalized digital signal,
Executing the interrupt program by the normalized digital signal,
The arithmetic module is
A control method for executing the non-interruption program by referring to an execution result of the interruption program.
外部からデータを入力する入力モジュールと、前記入力モジュールとバスを通じて接続され、該入力モジュールから受信したデータに基づいて演算を行う演算モジュールと、を備える制御システムを用いた制御方法であって、
前記制御システムで実行されるプログラムは、割込条件の成立を実行契機とする割込プログラムと、該割込プログラムを除いた非割込プログラムとを含んでなり、
前記入力モジュールが、
前記割込プログラムに対応付けられた割込条件が成立しているか否か判定し、
前記割込条件が成立していると判定すると、前記割込プログラムを実行し、
外部のアナログ信号をデジタル信号に変換するADコンバータの変換制御を行うAD制御回路が、
所定の周期で前記ADコンバータの変換制御を実行し、
変換されたデジタル信号を保持し、
前記入力モジュールが、
前記割込プログラムの実行途中で任意のデジタル信号が必要になると、前記AD制御回路に保持された該任意のデジタル信号のみ正規化して正規化デジタル信号を生成し、
前記正規化デジタル信号によって前記割込プログラムを実行し、
前記演算モジュールが、
前記割込プログラムの実行結果を参照し、前記非割込プログラムを実行することを特徴とする制御方法。
A control method using a control system, comprising: an input module for inputting data from the outside; and an arithmetic module that is connected to the input module through a bus and performs an arithmetic operation based on data received from the input module.
The program executed by the control system includes an interrupt program triggered by the establishment of an interrupt condition and a non-interrupt program excluding the interrupt program,
The input module is
It is determined whether or not the interrupt condition associated with the interrupt program is satisfied,
If it is determined that the interrupt condition is satisfied, the interrupt program is executed,
An AD control circuit that performs conversion control of an AD converter that converts an external analog signal into a digital signal,
The conversion control of the AD converter is executed at a predetermined cycle,
Hold the converted digital signal,
The input module is
When an arbitrary digital signal is required during the execution of the interrupt program, only the arbitrary digital signal held in the AD control circuit is normalized to generate a normalized digital signal,
Executing the interrupt program by the normalized digital signal,
The arithmetic module is
A control method for executing the non-interruption program by referring to an execution result of the interruption program.
JP2016032611A 2015-09-24 2016-02-24 Control system and control method Active JP6686521B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2015186289 2015-09-24
JP2015186289 2015-09-24

Publications (2)

Publication Number Publication Date
JP2017062758A JP2017062758A (en) 2017-03-30
JP6686521B2 true JP6686521B2 (en) 2020-04-22

Family

ID=58428930

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016032611A Active JP6686521B2 (en) 2015-09-24 2016-02-24 Control system and control method

Country Status (1)

Country Link
JP (1) JP6686521B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7132257B2 (en) * 2020-02-04 2022-09-06 株式会社日立製作所 control system
CN116710857B (en) * 2021-06-25 2024-06-25 三菱电机株式会社 Input unit, control system, communication method, and recording medium

Also Published As

Publication number Publication date
JP2017062758A (en) 2017-03-30

Similar Documents

Publication Publication Date Title
EP2687927B1 (en) Cpu of plc, system program for plc, and recording medium storing system program for plc
US10274936B2 (en) Control apparatus
JP6409557B2 (en) Control device, controller system, output control method, and program
US20140207254A1 (en) Cpu unit for plc, plc-use system program, recording medium in which plc-use system program is stored, plc system, plc support device, plc support program, and recording medium in which plc support program is stored
CN101233460B (en) Robot control system and control method for robot
US8504176B2 (en) CPU unit of PLC, system program for PLC, and recording medium storing system program for PLC
US20190272197A1 (en) Control apparatus, control method and non-transitory storage medium
JP2016194830A (en) Control device
KR102294177B1 (en) control device
US20220244697A1 (en) Control system, setting device, and computer-readable storage medium
US11287793B2 (en) Control device, control method for control device, information processing program, and recording medium
JP6686521B2 (en) Control system and control method
US11886170B2 (en) Control system, setting device and setting program
JP7391629B2 (en) Motor control equipment, numerical control equipment, robot controllers and integrated controller systems
WO2020075351A1 (en) Control device
CN110278716B (en) PLC, network unit, CPU unit, and data transfer method
US20190033834A1 (en) Slave device, industrial network system, and method of controlling slave device
CN116909678A (en) An implementation method, system and management server of containerized PLC
JP2008186426A (en) Unit extension system
CN114064225A (en) Self-adaptive scheduling method, device, computer storage medium and system
JP7110911B2 (en) Control method for controller and communication control unit provided in controller
JP2023028829A (en) Controller and method of controlling controller
CN118661414A (en) Control System
JP4854598B2 (en) Data transfer control device
JP2017130039A (en) Programmable controller

Legal Events

Date Code Title Description
AA64 Notification of invalidation of claim of internal priority (with term)

Free format text: JAPANESE INTERMEDIATE CODE: A241764

Effective date: 20160315

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160328

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190111

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20191113

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20191119

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200116

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200316

R150 Certificate of patent or registration of utility model

Ref document number: 6686521

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