JP6705464B2 - Control device and communication control method - Google Patents

Control device and communication control method Download PDF

Info

Publication number
JP6705464B2
JP6705464B2 JP2018027136A JP2018027136A JP6705464B2 JP 6705464 B2 JP6705464 B2 JP 6705464B2 JP 2018027136 A JP2018027136 A JP 2018027136A JP 2018027136 A JP2018027136 A JP 2018027136A JP 6705464 B2 JP6705464 B2 JP 6705464B2
Authority
JP
Japan
Prior art keywords
data group
variable
server device
communication
data
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
JP2018027136A
Other languages
Japanese (ja)
Other versions
JP2018088277A (en
Inventor
安宏 北村
安宏 北村
良峰 武内
良峰 武内
久則 五十嵐
久則 五十嵐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp filed Critical Omron Corp
Priority to JP2018027136A priority Critical patent/JP6705464B2/en
Publication of JP2018088277A publication Critical patent/JP2018088277A/en
Application granted granted Critical
Publication of JP6705464B2 publication Critical patent/JP6705464B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Description

本発明は、ユーザプログラムを周期的に実行するコントローラを含む制御システムに関し、特に、サーバ装置と通信可能に接続する制御システムに関する。 The present invention relates to a control system including a controller that periodically executes a user program, and particularly to a control system that is communicably connected to a server device.

多くの生産現場で使用される機械や設備は、典型的には、プログラマブルコントローラ(Programmable Logic Controller;以下「PLC」とも称す)などの制御装置を主たる
構成とした制御システムによって制御される。このような制御システムでは、システム構成時や運転時に発生した不具合を事後的に検証できる。
Machines and equipment used in many production sites are typically controlled by a control system mainly composed of a control device such as a programmable controller (Programmable Logic Controller; hereinafter also referred to as “PLC”). With such a control system, it is possible to ex post factually verify the problems that occurred during system configuration and operation.

このような制御装置に関する先行技術文献としての特許文献1(特開2011−39643号公報)に記載のPLCは、CPUユニットと、該CPUユニットと接続された一又は複数の拡張ユニットとで構成され、ファイル転送時にFTP(File Transfer Protocol:ファイル転送プロトコル)クライアントとして機能する。当該PLCは、FTPクライアントとして機能させる設定データの入力を受け付け、入力を受け付けた設定データを記憶する。PLCは、FTPクライアントに所定の機能を割り当てるか否かに関するフラグ情報を含む機能割当て情報を記憶しておき、所定の機能ごとにフラグ情報を書き込む。PLCは、フラグ情報の書き込みを検知した場合、記憶してある設定データに基づいてファイル転送を実行する。 The PLC described in Patent Document 1 (Japanese Patent Laid-Open No. 2011-39643) as a prior art document relating to such a control device is composed of a CPU unit and one or a plurality of extension units connected to the CPU unit. , Functions as an FTP (File Transfer Protocol) client during file transfer. The PLC receives an input of setting data to function as an FTP client, and stores the input setting data. The PLC stores function allocation information including flag information regarding whether or not to allocate a predetermined function to the FTP client, and writes the flag information for each predetermined function. When detecting the writing of the flag information, the PLC executes the file transfer based on the stored setting data.

特開2011−39643号公報JP, 2011-39643, A

PLCの利用シーンにおいて、FTPクライアント機能は生産データ等のデータを外部機器に転送するために用いられる。ここで、外部機器において転送されたファイルが上書きされたり、外部機器において転送されたファイルのファイル名が変更されると、トレーサビリティが求めれる生産データ等のデータが失われてしまう虞があった。 In a PLC usage scene, the FTP client function is used to transfer data such as production data to an external device. If the file transferred in the external device is overwritten or the file name of the file transferred in the external device is changed, there is a possibility that data such as production data requiring traceability may be lost.

そのため、生産設備等を動作する制御プログラムユーザが作成する場合には、ユーザはファイル名に一義的なデータを付与するようにプログラミングを行う必要があった。このため、ユーザに対する利便性を欠いていた。 Therefore, when the control program user who operates the production equipment or the like creates it, the user needs to perform programming so as to give unique data to the file name. Therefore, it is not convenient for the user.

本願発明は、上記の問題点に鑑みなされたものであって、その目的は、FTPクライアント機能を搭載し、サーバ装置に対するデータ送信時のデータの信頼性を担保することが可能な制御装置、および制御装置における通信制御方法を提供することにある。 The present invention has been made in view of the above problems, and an object thereof is to provide a control device that is equipped with an FTP client function and can ensure the reliability of data when transmitting data to a server device, and It is to provide a communication control method in a control device.

本発明のある局面に従うと、制御装置は、サーバ装置と通信するとともに、制御プログラムを実行することによって予め定められた機器を制御する。制御装置は、制御プログラムを実行する実行手段と、予め定められた機器から制御に基づくデータを取得する取得手段と、取得されたデータを予め定められた規則によって複数の互いに名称の異なるデータ群に分類することにより、データを管理する管理手段と、予め定められた通信プロトコルを用いてサーバ装置と通信する第1の通信手段と、通信プロトコルを利用する際に用いる変数と、変数の値とを記憶するための記憶手段とを備える。制御プログラムは、変数を入
力変数として含む。実行手段は、第1の通信手段によるサーバ装置との通信によって、分類されたデータ群の名称と同一名称のデータ群がサーバ装置に存在するか否かを判断する。第1の通信手段は、変数の値が入力されたときの制御プログラムの実行結果に基づいて、データ群のうち同一名称のデータ群が存在すると判断されなかった第1のデータ群をサーバ装置に送信する。
According to one aspect of the present invention, a control device controls a predetermined device by communicating with a server device and executing a control program. The control device includes an execution unit that executes a control program, an acquisition unit that acquires data based on control from a predetermined device, and the acquired data into a plurality of data groups having different names according to a predetermined rule. By categorizing, a management unit that manages data, a first communication unit that communicates with a server device using a predetermined communication protocol, a variable used when using the communication protocol, and a value of the variable And storage means for storing. The control program includes variables as input variables. The executing means determines whether or not a data group having the same name as the classified data group exists in the server apparatus through the communication with the server apparatus by the first communication means. The first communication means, based on the execution result of the control program when the value of the variable is input, transmits to the server device the first data group that has not been determined to have a data group with the same name among the data groups. Send.

好ましくは、変数は、データ群の名称を含む。制御プログラムは、データ群のうち第1のデータ群以外の第2のデータ群の名称を入力として利用する。実行手段は、サーバ装置との通信によって、第2のデータ群と同一名称のデータ群がサーバ装置に存在するか否かを再度判断する。第1の通信手段は、実行手段による再度の判断の結果、第2のデータ群のうち同一名称のデータ群が存在すると判断されなかった第3のデータ群を、制御プログラムの実行結果に基づいてサーバ装置に送信する。 Preferably, the variable includes the name of the data group. The control program uses the names of the second data group other than the first data group in the data group as an input. The executing means determines again by communication with the server device whether or not a data group having the same name as the second data group exists in the server device. The first communication unit determines, based on the execution result of the control program, a third data group that is not determined as a data group having the same name among the second data groups as a result of the determination made again by the execution unit. Send to the server device.

好ましくは、制御装置は、プログラマブル表示器と通信する第2の通信手段と、プログラマブル表示器からの指令に基づき、変数の値を設定する設定手段とをさらに備える。 Preferably, the control device further includes second communication means for communicating with the programmable display, and setting means for setting the value of the variable based on a command from the programmable display.

好ましくは、管理手段は、データ群をファイルとして管理する。通信プロトコルは、ファイル転送プロトコルである。 Preferably, the management unit manages the data group as a file. The communication protocol is a file transfer protocol.

本発明の他の局面に従うと、通信制御方法は、サーバ装置と通信するとともに、制御プログラムを実行することによって予め定められた機器を制御する制御装置において実行される。通信制御方法は、制御装置のプロセッサが、制御プログラムを実行するステップと、プロセッサが、予め定められた機器から制御に基づくデータを取得するステップと、プロセッサが、取得されたデータを予め定められた規則によって複数の互いに名称の異なるデータ群に分類することにより、データを管理するステップと、プロセッサが、予め定められた通信プロトコルを用いてサーバ装置と通信するステップとを備える。制御装置は、通信プロトコルを利用する際に用いる変数と、変数の値とを記憶している。制御プログラムは、変数を入力変数として含む。通信制御方法は、プロセッサが、第1の通信手段によるサーバ装置との通信によって、分類されたデータ群の名称と同一名称のデータ群がサーバ装置に存在するか否かを判断するステップをさらに備える。サーバ装置と通信するステップは、プロセッサが、変数の値が入力されたときの制御プログラムの実行結果に基づいて、データ群のうち同一名称のデータ群が存在すると判断されなかった第1のデータ群をサーバ装置に送信するステップを含む。 According to another aspect of the present invention, a communication control method is executed in a control device that communicates with a server device and controls a predetermined device by executing a control program. The communication control method includes a step in which a processor of a control device executes a control program, a step in which the processor acquires data based on control from a predetermined device, and a processor in which the acquired data is predetermined. The method includes a step of managing data by classifying into a plurality of data groups having different names by a rule, and a step of causing a processor to communicate with a server device using a predetermined communication protocol. The control device stores variables used when using the communication protocol and the values of the variables. The control program includes variables as input variables. The communication control method further includes a step of causing the processor to determine whether or not a data group having the same name as the classified data group exists in the server apparatus through communication with the server apparatus by the first communication unit. .. The step of communicating with the server device is the first data group in which the processor has not determined that there is a data group with the same name among the data groups based on the execution result of the control program when the value of the variable is input. Is transmitted to the server device.

本発明によれば、サーバ装置に対するデータ送信時のデータの信頼性を担保することが可能となる。 According to the present invention, it is possible to ensure the reliability of data when transmitting data to the server device.

本実施の形態に係る制御システム1のシステム構成を示す模式図である。It is a schematic diagram which shows the system configuration of the control system 1 which concerns on this Embodiment. 本実施の形態に係るPLC100の主要部を示すハードウェア構成を示す模式図である。It is a schematic diagram which shows the hardware constitutions which show the principal part of PLC100 which concerns on this Embodiment. 本実施の形態に係るPLC100が提供する各種機能を実現するためのソフトウェア構成を示す模式図である。It is a schematic diagram which shows the software structure for implement|achieving various functions which PLC100 which concerns on this Embodiment provides. プログラマブル表示器300のハードウェア構成の一例を説明するための図である。FIG. 6 is a diagram for explaining an example of a hardware configuration of a programmable display device 300. サーバ装置400のハードウェア構成を示す模式図である。3 is a schematic diagram showing a hardware configuration of a server device 400. FIG. FTPクライアント通信命令の種類を説明するための図である。It is a figure for demonstrating the kind of FTP client communication command. ユーザプログラム186の一例を表した図である。FIG. 6 is a diagram showing an example of a user program 186. FTPGetFileList命令の入力変数および出力変数を説明するための図である。It is a figure for demonstrating the input variable and output variable of an FTPGetFileList command. FTPPutFile命令の入力変数および出力変数を説明するための図である。It is a figure for demonstrating the input variable and output variable of an FTPPutFile command. PLC100の機能的構成を説明するための図である。It is a figure for demonstrating the functional structure of PLC100. FTPPutFile命令における複数の入力変数のうちの一部の入力変数の値を表した図である。It is a figure showing the value of some input variables of the some input variable in an FTPPutFile command. FTPクライアント通信命令を実行するときに行なわれる処理流れの概略を表したフローチャートである。6 is a flowchart showing an outline of a processing flow performed when an FTP client communication command is executed. PLC100がFTPGetFilelist命令とFTPPutFile命令とをこの順に実行する際の処理の流れを表した図である。It is a figure showing a flow of processing when PLC100 executes an FTPGetFilelist command and an FTPPutFile command in this order. 図13のステップS112における処理の詳細を表したフローチャートである。14 is a flowchart showing details of the processing in step S112 of FIG. プログラマブル表示器300のタッチスクリーン318に表示される操作画面(UI:UserInterface)を表した図である。6 is a diagram showing an operation screen (UI: User Interface) displayed on the touch screen 318 of the programmable display device 300. FIG. ファイル名が重複するためにファイルの転送を意図的に行なわなかったファイルについて、再度、ファイルの転送が可能であるか否かを判断する処理を説明するための図である。FIG. 9 is a diagram for explaining a process of determining again whether or not a file can be transferred for a file for which transfer of the file has not been intentionally performed due to duplication of file names. ユーザプログラム186から各入力変数の値を書き換える構成を有するユーザプログラム186を表した図である。FIG. 9 is a diagram showing a user program 186 having a configuration in which the value of each input variable is rewritten from the user program 186.

本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰り返さない。 Embodiments of the present invention will be described in detail with reference to the drawings. It should be noted that the same or corresponding parts in the drawings are designated by the same reference numerals and the description thereof will not be repeated.

<A.システム構成>
まず、本実施の形態に係る制御システムのシステム構成について説明する。本実施の形態においては、機械や設備などの制御対象を制御するプログラマブルコントローラ(PLC)を制御装置の典型例として説明を行う。但し、本発明に係る制御装置は、PLCに限られることなく、各種の制御装置へ適用可能である。
<A. System configuration>
First, the system configuration of the control system according to the present embodiment will be described. In the present embodiment, a programmable controller (PLC) that controls a controlled object such as a machine or equipment will be described as a typical example of the control device. However, the control device according to the present invention is not limited to the PLC and can be applied to various control devices.

図1は、本実施の形態に係る制御システム1のシステム構成を示す模式図である。図1を参照して、制御システム1は、PLC100と、PLC100と通信可能に接続されたプログラマブル表示器(HMI:Human Machine Interface)300と、PLC100と
通信可能に接続されたサーバ装置400とを含む。サーバ装置400は、たとえば、イントラネットを構成する機器である。
FIG. 1 is a schematic diagram showing a system configuration of a control system 1 according to this embodiment. Referring to FIG. 1, control system 1 includes a PLC 100, a programmable display (HMI: Human Machine Interface) 300 communicatively connected to PLC 100, and a server device 400 communicatively connected to PLC 100. .. The server device 400 is, for example, a device forming an intranet.

詳細については後述するが、PLC100は、FTP(ファイル転送プロトコル)に基づく通信によってサーバ装置400と通信する。すなわち、PLC100は、FTPクライアント機能を有しており、FTPクライアントとして機能する。また、サーバ装置400は、FTPサーバ機能を有しており、FTPサーバとして機能する。 Although details will be described later, the PLC 100 communicates with the server device 400 by communication based on FTP (File Transfer Protocol). That is, the PLC 100 has an FTP client function and functions as an FTP client. Further, the server device 400 has an FTP server function and functions as an FTP server.

PLC100は、後述するようなユーザプログラムを周期的またはイベント的に実行する。ユーザプログラムは、PLC100の利用者によって作成される。ユーザは、例えばサポート装置(図示せず)を操作することにより、アクセス命令を含むプログラム(ソースプログラム)を作成することができる。なお、サポート装置は、ソースプログラムを、PLC100において実行可能な形式に変換し、変換されたユーザプログラムをPLC100へ送信する。サポート装置は、PLC100との間で各種パラメータの設定、プログラミング、モニタ、デバッグなどの機能を提供する。PLC100とサポート装置との間は、典型的には、USB(Universal Serial Bus)規格に従って通信可能に構成される。 The PLC 100 executes a user program, which will be described later, periodically or on an event basis. The user program is created by the user of the PLC 100. The user can create a program (source program) including an access command by operating a support device (not shown), for example. The support device converts the source program into a format that can be executed by the PLC 100, and transmits the converted user program to the PLC 100. The support device provides functions such as setting various parameters, programming, monitoring, and debugging with the PLC 100. The PLC 100 and the support device are typically configured to be communicable according to the USB (Universal Serial Bus) standard.

PLC100は、ユーザプログラムを実行し、ユーザプログラムに含まれる命令に従って、サーバ装置400と通信する。すなわち、PLC100およびサーバ装置400は、
イーサネット(登録商標)などのネットワーク112を介して、データを互いに遣り取りできるように構成される。当該処理の詳細については後述する。
The PLC 100 executes the user program and communicates with the server device 400 according to the instructions included in the user program. That is, the PLC 100 and the server device 400 are
Data can be exchanged with each other via a network 112 such as Ethernet (registered trademark). Details of the process will be described later.

PLC100は、制御演算を実行するCPUユニット104と、1つ以上のIO(Input/Output)ユニット106とを含む。これらのユニットは、PLCシステムバス108を介して、データを互いに遣り取りできるように構成される。また、これらのユニットには、電源ユニット102によって適切な電圧の電源が供給される。 The PLC 100 includes a CPU unit 104 that executes a control operation and one or more IO (Input/Output) units 106. These units are configured to exchange data with each other via the PLC system bus 108. Further, the power supply unit 102 supplies power to these units with an appropriate voltage.

制御システム1において、PLC100は、(PLCシステムバス108を介して接続される)IOユニット106を介して、および/または、フィールドバス110を介して、各種のフィールド機器との間でデータを遣り取りする。これらのフィールド機器は、制御対象に対して何らかの処理を行うためのアクチュエータや、制御対象から各種情報を取得するためのセンサなどを含む。図1には、このようなフィールド機器の一例として、検出スイッチ10、リレー20およびモータ32を駆動するサーボモータドライバ30を含む。また、PLC100は、フィールドバス110を介してリモートIOターミナル200も接続されている。リモートIOターミナル200は、基本的には、IOユニット106と同様に、一般的な入出力処理に関する処理を行う。より具体的には、リモートIOターミナル200は、フィールドバス110でのデータ伝送に係る処理を行うための通信カプラ202と、1つ以上のIOユニット204とを含む。これらのユニットは、リモートIOターミナルバス208を介して、データを互いに遣り取りできるように構成される。 In the control system 1, the PLC 100 exchanges data with various field devices via the IO unit 106 (connected via the PLC system bus 108) and/or the field bus 110. .. These field devices include an actuator for performing some processing on the control target, a sensor for acquiring various information from the control target, and the like. FIG. 1 includes a detection switch 10, a relay 20, and a servo motor driver 30 that drives a motor 32 as an example of such a field device. The PLC 100 is also connected to the remote IO terminal 200 via the field bus 110. The remote IO terminal 200 basically performs processing related to general input/output processing, similar to the IO unit 106. More specifically, the remote IO terminal 200 includes a communication coupler 202 for performing processing relating to data transmission on the fieldbus 110, and one or more IO units 204. These units are configured to exchange data with each other via the remote IO terminal bus 208.

プログラマブル表示器300は、接続ケーブル114によってPLC100と通信可能に接続されている。プログラマブル表示器300は、PLC100から取得した各種の情報を画面に表示する。また、詳細については後述するが、ユーザは、プログラマブル表示器300を操作することにより、PLC100に格納されている入力変数の値を変更することができる。 The programmable display 300 is communicatively connected to the PLC 100 by a connection cable 114. The programmable indicator 300 displays various information acquired from PLC100 on a screen. Further, as will be described later in detail, the user can change the value of the input variable stored in the PLC 100 by operating the programmable display device 300.

<B.PLC100の構成>
(b1.ハードウェア構成)
図2は、本実施の形態に係るPLC100の主要部を示すハードウェア構成を示す模式図である。図2を参照して、PLC100のCPUユニット104のハードウェア構成について説明する。CPUユニット104は、プロセッサ120と、チップセット122と、システムクロック124と、主メモリ126と、不揮発性メモリ128と、Ethernetコネクタ130と、PLCシステムバスコントローラ140と、フィールドバスコントローラ150と、上位通信コントローラ160と、メモリカードインターフェイス170と、USBコネクタ(図示せず)とを含む。チップセット122と他のコンポーネントとの間は、各種のバスを介してそれぞれ結合されている。
<B. Configuration of PLC 100>
(B1. Hardware configuration)
FIG. 2 is a schematic diagram showing a hardware configuration showing a main part of PLC 100 according to the present embodiment. The hardware configuration of the CPU unit 104 of the PLC 100 will be described with reference to FIG. The CPU unit 104 includes a processor 120, a chipset 122, a system clock 124, a main memory 126, a non-volatile memory 128, an Ethernet connector 130, a PLC system bus controller 140, a fieldbus controller 150, and upper communication. It includes a controller 160, a memory card interface 170, and a USB connector (not shown). The chipset 122 and other components are coupled to each other via various buses.

プロセッサ120およびチップセット122は、典型的には、汎用的なコンピュータアーキテクチャに準じて構成される。すなわち、プロセッサ120は、チップセット122から内部クロックに従って順次供給される命令コードを解釈して実行する。チップセット122は、接続されている各種コンポーネントとの間で内部的なデータを遣り取りするとともに、プロセッサ120に必要な命令コードを生成する。システムクロック124は、予め定められた周期のシステムクロックを発生してプロセッサ120に提供する。チップセット122は、プロセッサ120での演算処理の実行の結果得られたデータなどをキャッシュする機能を有する。 The processor 120 and the chipset 122 are typically configured according to a general-purpose computer architecture. That is, the processor 120 interprets and executes the instruction code sequentially supplied from the chip set 122 according to the internal clock. The chipset 122 exchanges internal data with various connected components and generates an instruction code necessary for the processor 120. The system clock 124 generates a system clock having a predetermined cycle and provides it to the processor 120. The chipset 122 has a function of caching data obtained as a result of execution of arithmetic processing in the processor 120.

CPUユニット104は、記憶手段として、主メモリ126および不揮発性メモリ128を有する。主メモリ126は、揮発性の記憶領域であり、プロセッサ120で実行されるべき各種プログラムを保持するとともに、各種プログラムの実行時の作業用メモリとし
ても使用される。不揮発性メモリ128は、OS(Operating System)、システムプログラム、ユーザプログラム、ログ情報などを不揮発的に保持する。
The CPU unit 104 has a main memory 126 and a non-volatile memory 128 as storage means. The main memory 126 is a volatile storage area, holds various programs to be executed by the processor 120, and is also used as a working memory when the various programs are executed. The non-volatile memory 128 holds an OS (Operating System), a system program, a user program, log information and the like in a non-volatile manner.

Ethernetコネクタ130は、プログラマブル表示器300とCPUユニット104とを接続するためのインターフェイスである。なお、USBコネクタ(図示せず)は、サポート装置とCPUユニット104とを接続するためのインターフェイスである。典型的には、サポート装置から転送される実行可能なプログラムなどは、USBコネクタを介してCPUユニット104に取込まれる。 The Ethernet connector 130 is an interface for connecting the programmable display 300 and the CPU unit 104. The USB connector (not shown) is an interface for connecting the support device and the CPU unit 104. Typically, an executable program or the like transferred from the support device is loaded into the CPU unit 104 via the USB connector.

CPUユニット104は、通信手段として、PLCシステムバスコントローラ140、フィールドバスコントローラ150、および上位通信コントローラ160を有する。これらの通信回路は、データの送信および受信を行う。 The CPU unit 104 has a PLC system bus controller 140, a fieldbus controller 150, and a host communication controller 160 as communication means. These communication circuits transmit and receive data.

PLCシステムバスコントローラ140は、PLCシステムバス108を介したデータの遣り取りを制御する。より具体的には、PLCシステムバスコントローラ140は、バッファメモリ142と、PLCシステムバス制御回路144と、DMA(Dynamic Memory
Access)制御回路146とを含む。PLCシステムバスコントローラ140は、PLC
システムバスコネクタ148を介してPLCシステムバス108と接続される。
The PLC system bus controller 140 controls the exchange of data via the PLC system bus 108. More specifically, the PLC system bus controller 140 includes a buffer memory 142, a PLC system bus control circuit 144, and a DMA (Dynamic Memory).
Access) control circuit 146. The PLC system bus controller 140 is a PLC
It is connected to the PLC system bus 108 via the system bus connector 148.

フィールドバスコントローラ150は、バッファメモリ152と、フィールドバス制御回路154と、DMA制御回路156とを含む。フィールドバスコントローラ150は、フィールドバスコネクタ158を介してフィールドバス110と接続される。上位通信コントローラ160は、バッファメモリ162と、上位通信制御回路164と、DMA制御回路166とを含む。上位通信コントローラ160は、上位通信コネクタ168を介してネットワーク112と接続される。 The fieldbus controller 150 includes a buffer memory 152, a fieldbus control circuit 154, and a DMA control circuit 156. The fieldbus controller 150 is connected to the fieldbus 110 via the fieldbus connector 158. The host communication controller 160 includes a buffer memory 162, a host communication control circuit 164, and a DMA control circuit 166. The upper communication controller 160 is connected to the network 112 via the upper communication connector 168.

メモリカードインターフェイス170は、CPUユニット104に対して着脱可能なメモリカード172とプロセッサ120とを接続する。 The memory card interface 170 connects the memory card 172, which is removable from the CPU unit 104, and the processor 120.

(b2.ソフトウェア構成)
図3は、本実施の形態に係るPLC100が提供する各種機能を実現するためのソフトウェア構成を示す模式図である。これらのソフトウェアに含まれる命令コードは、適切なタイミングで読み出され、CPUユニット104のプロセッサ120によって実行される。
(B2. Software configuration)
FIG. 3 is a schematic diagram showing a software configuration for realizing various functions provided by the PLC 100 according to the present embodiment. The instruction code included in the software is read at an appropriate timing and executed by the processor 120 of the CPU unit 104.

図3を参照して、CPUユニット104で実行されるソフトウェアとしては、OS180と、システムプログラム188と、ユーザプログラム186とがある。 Referring to FIG. 3, the software executed by CPU unit 104 includes OS 180, system program 188, and user program 186.

OS180は、プロセッサ120がシステムプログラム188およびユーザプログラム186を実行するための基本的な実行環境を提供する。 The OS 180 provides a basic execution environment for the processor 120 to execute the system program 188 and the user program 186.

システムプログラム188は、PLC100としての基本的な機能を提供するためのソフトウェア群である。具体的には、システムプログラム188は、シーケンス命令プログラム190と、FTP処理プログラム192と、入出力処理プログラム194と、Toolインターフェイス処理プログラム196と、スケジューラ198とを含む。 The system program 188 is a software group for providing the basic functions of the PLC 100. Specifically, the system program 188 includes a sequence command program 190, an FTP processing program 192, an input/output processing program 194, a Tool interface processing program 196, and a scheduler 198.

これに対して、ユーザプログラム186は、制御対象に対する制御目的に応じて任意に作成されたプログラムである。すなわち、ユーザプログラム186は、制御システム1を用いて制御する対象に応じて、任意に設計される。 On the other hand, the user program 186 is a program arbitrarily created according to the control purpose for the controlled object. That is, the user program 186 is arbitrarily designed according to the object to be controlled using the control system 1.

ユーザプログラム186は、シーケンス命令プログラム190と協働して、ユーザにおける制御目的を実現する。すなわち、ユーザプログラム186は、シーケンス命令プログラム190によって提供される命令、関数、機能モジュールなどを利用することで、プログラムされた動作を実現する。そのため、ユーザプログラム186およびシーケンス命令プログラム190を「制御プログラム181」と総称する場合もある。 The user program 186 cooperates with the sequence command program 190 to realize the control purpose of the user. That is, the user program 186 realizes the programmed operation by using the instructions, functions, functional modules, etc. provided by the sequence instruction program 190. Therefore, the user program 186 and the sequence command program 190 may be collectively referred to as the “control program 181”.

稼働ログ184には、システムプログラム188およびユーザプログラム186の実行に伴って、予め定められた事象が発生した際に、当該発生した事象の情報が時刻情報と関連付けて格納される。すなわち、稼働ログ184には、システムプログラム188および/またはユーザプログラム186の実行に伴う各種情報がログ(履歴情報)として格納される。 When a predetermined event occurs in association with the execution of the system program 188 and the user program 186, the operation log 184 stores information on the occurred event in association with time information. That is, the operation log 184 stores various information associated with the execution of the system program 188 and/or the user program 186 as a log (history information).

以下、各プログラムについてより詳細に説明する。
シーケンス命令プログラム190は、ユーザプログラム186の実行に伴って、ユーザプログラム186内で指定されているシーケンス命令の実体を呼び出して、その命令の内容を実現するための命令コード群を含む。
Hereinafter, each program will be described in more detail.
The sequence command program 190 includes a command code group for calling the substance of the sequence command designated in the user program 186 and executing the contents of the command as the user program 186 is executed.

入出力処理プログラム194は、IOユニット106や各種のフィールド機器との間で、入力データの取得および出力データの送信を管理するためのプログラムである。 The input/output processing program 194 is a program for managing acquisition of input data and transmission of output data between the IO unit 106 and various field devices.

Toolインターフェイス処理プログラム196は、サポート装置との間でデータを遣り取りするためのインターフェイスを提供する。 The Tool interface processing program 196 provides an interface for exchanging data with the support device.

スケジューラ198は、予め定められた優先度やシステムタイマの値などに従って、制御プログラムを実行するためのスレッドやプロシージャを生成する。 The scheduler 198 creates a thread or a procedure for executing the control program according to a predetermined priority, a system timer value, or the like.

ユーザプログラム186は、上述したように、ユーザにおける制御目的に応じて作成される。ユーザプログラム186は、典型的には、CPUユニット104のプロセッサ120で実行可能なオブジェクトプログラム形式になっている。ユーザプログラム186は、サポート装置などにおいて、ラダー形式やファンクションブロック形式で記述されたソースプログラムがコンパイルされることで生成される。そして、生成されたオブジェクトプログラム形式のユーザプログラムは、サポート装置からCPUユニット104へ転送され、不揮発性メモリ128などに格納される。 The user program 186 is created according to the control purpose of the user, as described above. The user program 186 is typically in an object program format that can be executed by the processor 120 of the CPU unit 104. The user program 186 is generated by compiling a source program described in a ladder format or a function block format in a support device or the like. Then, the generated user program in the object program format is transferred from the support device to the CPU unit 104 and stored in the non-volatile memory 128 or the like.

FTP処理プログラム192は、ユーザプログラム186の実行に伴って、サーバ装置400と通信するために必要な処理を実現するための命令コード群を含む。FTP処理プログラム192は、ユーザプログラム186において指定可能な命令に対応する実行コードを含む。 The FTP processing program 192 includes an instruction code group for implementing the processing required to communicate with the server device 400 in accordance with the execution of the user program 186. The FTP processing program 192 includes an execution code corresponding to an instruction that can be designated by the user program 186.

<C.プログラマブル表示器300のハードウェア構成>
図4は、プログラマブル表示器300のハードウェア構成の一例を説明するための図である。図4を参照して、プログラマブル表示器300は、各種の演算を行なうCPU(Central Processing Unit)311と、ROM(Read Only Memory)312と、RAM(Random Access Memory)313と、各種のプログラムを不揮発的に格納するフラッシュRO
M314と、時計315と、操作キー316と、カメラ317と、タッチスクリーン318と、通信インターフェイス319とを備える。なお、これらの部位は、内部バスを介して互いに接続される。
<C. Hardware Configuration of Programmable Display 300>
FIG. 4 is a diagram for explaining an example of the hardware configuration of the programmable display device 300. Referring to FIG. 4, programmable display 300 includes a CPU (Central Processing Unit) 311 for performing various calculations, a ROM (Read Only Memory) 312, a RAM (Random Access Memory) 313, and various programs in a nonvolatile manner. Flash RO to store
An M314, a clock 315, operation keys 316, a camera 317, a touch screen 318, and a communication interface 319 are provided. Note that these parts are connected to each other via an internal bus.

タッチスクリーン318は、ディスプレイ381と、ディスプレイ381を覆うように設置されたタッチパネル382とを有する。通信インターフェイス319は、Ether
net(登録商標)用IF(InterFace)391と、シリアル用IF392と、USB(Universal Serial Bus)用IF393とを有する。
The touch screen 318 has a display 381 and a touch panel 382 installed so as to cover the display 381. Communication interface 319 is Ether
It has an IF (InterFace) 391 for net (registered trademark), a serial IF 392, and a USB (Universal Serial Bus) IF 393.

CPU311は、フラッシュROM314に格納されているプログラムをRAM313などに展開して実行する。ROM312は、一般的に、オペレーティングシステム(OS:Operating System)等のプログラムを格納している。RAM313は、揮発性メモリであり、ワークメモリとして使用される。 The CPU 311 expands the program stored in the flash ROM 314 into the RAM 313 or the like and executes it. The ROM 312 generally stores programs such as an operating system (OS). The RAM 313 is a volatile memory and is used as a work memory.

Ethernet用IF391は、Ethernetの通信プロトコルをサポートし、PLC100との間でデータ通信する。シリアル用IF392は、シリアル通信のプロトコルをサポートし、たとえばPC(Personal Computer)との間でデータ通信する。US
B用IF393は、USBの通信プロトコルをサポートし、たとえばUSBメモリとの間でデータ通信する。
The Ethernet IF 391 supports the Ethernet communication protocol and performs data communication with the PLC 100. The serial IF 392 supports a serial communication protocol, and performs data communication with, for example, a PC (Personal Computer). US
The B IF 393 supports a USB communication protocol and performs data communication with, for example, a USB memory.

なお、図4に示されるプログラマブル表示器300を構成する各構成要素は、一般的なものである。したがって、本発明の本質的な部分は、フラッシュROM314等のメモリに格納されたソフトウェア、あるいはネットワークを介してダウンロード可能なソフトウェアであるともいえる。なお、プログラマブル表示器300の各ハードウェアの動作は周知であるために、詳細な説明は繰り返さない。 It should be noted that the respective constituent elements of the programmable display device 300 shown in FIG. 4 are general ones. Therefore, it can be said that the essential part of the present invention is software stored in a memory such as the flash ROM 314 or software downloadable via a network. Since the operation of each hardware of programmable display 300 is well known, detailed description will not be repeated.

<D.サーバ装置400のハードウェア構成>
図5は、サーバ装置400のハードウェア構成を示す模式図である。サーバ装置400は、典型的には、汎用のコンピュータで構成される。
<D. Hardware configuration of server device 400>
FIG. 5 is a schematic diagram showing the hardware configuration of the server device 400. The server device 400 is typically composed of a general-purpose computer.

図5を参照して、サーバ装置400は、OSを含む各種プログラムを実行するCPU402と、BIOSや各種データを格納するROM(Read Only Memory)404と、CPU402でのプログラムの実行に必要なデータを格納するための作業領域を提供するメモリRAM406と、CPU402で実行されるプログラムなどを不揮発的に格納するハードディスク(HDD)408とを含む。 Referring to FIG. 5, the server device 400 stores a CPU 402 for executing various programs including an OS, a ROM (Read Only Memory) 404 for storing BIOS and various data, and data necessary for execution of the programs by the CPU 402. A memory RAM 406 that provides a work area for storing and a hard disk (HDD) 408 that stores programs executed by the CPU 402 in a nonvolatile manner are included.

サーバ装置400は、さらに、ユーザからの操作を受け付けるキーボード410およびマウス412と、情報をユーザに提示するためのモニタ414とを含む。さらに、サーバ装置400は、PLC100(CPUユニット104)などと通信するための通信インターフェイス(IF)418を含む。サーバ装置400は、通信IF418によってPLC100と通信可能に接続される。 Server device 400 further includes a keyboard 410 and a mouse 412 that receive an operation from the user, and a monitor 414 for presenting information to the user. Further, the server device 400 includes a communication interface (IF) 418 for communicating with the PLC 100 (CPU unit 104) and the like. The server device 400 is communicatively connected to the PLC 100 via the communication IF 418.

<E.制御システム1における処理の概要>
PLC100は、上述したようにFTPクライアント機能を有しており、FTPクライアント通信命令を用いることにより、FTPクライアントとなるPLC100から、イントラネット内のFTPサーバとなるサーバ装置400へ、メモリカード172内のファイルの転送(アップロード)をすることができる。また、サーバ装置400からPLC100へのファイルの転送(ダウンロード)も可能である。
<E. Outline of processing in control system 1>
The PLC 100 has the FTP client function as described above, and by using the FTP client communication command, the PLC 100 serving as the FTP client transfers the files in the memory card 172 to the server device 400 serving as the FTP server in the intranet. Can be transferred (uploaded). Further, it is also possible to transfer (download) a file from the server device 400 to the PLC 100.

図6は、FTPクライアント通信命令の種類を説明するための図である。図6を参照して、PLC100は、FTPクライアント機能として、FTPサーバのファイル一覧の取得機能と、FTPサーバへのファイルアップロード機能と、FTPサーバからのファイルダウンロード機能と、FTPサーバのファイルの削除機能と、FTPサーバのディレクトリの削除機能とを有する。 FIG. 6 is a diagram for explaining the types of FTP client communication commands. With reference to FIG. 6, the PLC 100 has, as FTP client functions, a function of acquiring a file list of an FTP server, a function of uploading a file to the FTP server, a function of downloading a file from the FTP server, and a function of deleting a file of the FTP server. And the function of deleting the directory of the FTP server.

FTPサーバのファイル一覧の取得機能、FTPサーバへのファイルアップロード機能、FTPサーバからのファイルダウンロード機能、FTPサーバのファイルの削除機能、およびFTPサーバのディレクトリの削除機能を各々を実現するための命令(FTPクライアント通信命令)の名称を、それぞれ、「FTPGetFileList命令」、「FTPPutFile命令」、「FTPGetFile命令」、「FTPRemoveFile命令」、「FTPRemoveDir命令」と称する。 Instructions for realizing each of the FTP server file list acquisition function, the FTP server file upload function, the FTP server file download function, the FTP server file deletion function, and the FTP server directory deletion function ( The names of the FTP client communication command) are referred to as "FTPGetFileList command", "FTP Put File command", "FTP Get File command", "FTPRemoveFile command", and "FTPRemoveDir command", respectively.

FTPGetFileList命令、FTPGetFile命令、FTPPutFile命令、FTPRemoveFile命令、およびFTPRemoveDir命令の各々は、ファンクションブロックとして提供される。ユーザは、ユー
ザプログラム186に各々の命令を含めることができる。PLC100は、当該ユーザプログラム186を実行することにより、FTPクライアント機能を実現する。
Each of the FTPGetFileList command, FTPGetFile command, FTPPutFile command, FTPRemoveFile command, and FTPRemoveDir command is provided as a function block. The user can include each instruction in the user program 186. The PLC 100 realizes the FTP client function by executing the user program 186.

図7は、ユーザプログラム186の一例を表した図である。図7を参照して、ユーザプログラム186は、FTPGetFileList命令のファンクションブロックと、FTPPutFile命令のファンクションブロックとを含んでいる。 FIG. 7 is a diagram showing an example of the user program 186. Referring to FIG. 7, the user program 186 includes a function block of an FTPGetFileList instruction and a function block of an FTPPutFile instruction.

同図に示したユーザプログラム186では、17時30分になり、かつ“Busy”でないことを条件に、FTPGetFileList命令が実行される。すなわち、PLC100は、サーバ装置400からファイル一覧を取得する処理を実行する。さらに、FTPGetFileList命令の実行が完了すると、FTPPutFile命令が実行される。すなわち、PLC100は、サーバ装置400にファイルを転送する処理を実行する。 In the user program 186 shown in the figure, the FTPGetFileList command is executed on the condition that it is 17:30 and is not "Busy". That is, the PLC 100 executes the process of acquiring the file list from the server device 400. Further, when the execution of the FTPGetFileList instruction is completed, the FTPPutFile instruction is executed. That is, the PLC 100 executes a process of transferring a file to the server device 400.

図8は、FTPGetFileList命令の入力変数および出力変数を説明するための図である。具体的には、図8(A)は、FTPGetFileList命令の複数の入力変数のうちの一部を説明する
ための図である。図8(B)は、FTPGetFileList命令の複数の出力変数のうちの一部を説
明するための図である。
FIG. 8 is a diagram for explaining input variables and output variables of the FTPGetFileList command. Specifically, FIG. 8A is a diagram for explaining a part of a plurality of input variables of the FTPGetFileList command. FIG. 8B is a diagram for explaining a part of a plurality of output variables of the FTPGetFileList command.

図8(A)を参照して、起動を意味する“Execute”は、FTPGetFileList命令の起動を
指定するための入力変数である。接続先のFTPサーバを意味する“ConnectSvr”は、FTPサーバのアドレスおよびポート番号と、ログイン用のユーザ名およびパスワードとを指定するための入力変数である。FTPサーバのディレクトリ名を意味する“SvrDirName”は、ファイル一覧を取得するFTPサーバのディレクトリを指定するための入力変数である。
Referring to FIG. 8(A), “Execute” meaning activation is an input variable for designating activation of the FTPGetFileList instruction. “ConnectSvr”, which means the FTP server of the connection destination, is an input variable for specifying the address and port number of the FTP server, and the login user name and password. “SvrDirName”, which means the directory name of the FTP server, is an input variable for designating the directory of the FTP server that acquires the file list.

図8(B)を参照して、完了を意味する“Done”は、正常終了(すなわち、読出しが完了)したことを表すための出力変数である。実行中を意味する“Busy”は、命令の実行中を表すための出力変数である。エラーを意味する“Error”は、異常終了したことを表す
ための出力変数である。
With reference to FIG. 8B, “Done” meaning completion is an output variable for indicating that the processing has ended normally (that is, reading has completed). "Busy", which means that the instruction is being executed, is an output variable for indicating that the instruction is being executed. “Error”, which means an error, is an output variable for indicating that an abnormal end has occurred.

図9は、FTPPutFile命令の入力変数および出力変数を説明するための図である。具体的には、図9(A)は、FTPPutFile命令の複数の入力変数のうちの一部を説明するための図
である。図9(B)は、FTPPutFile命令の複数の出力変数のうちの一部を説明するための
図である。
FIG. 9 is a diagram for explaining input variables and output variables of the FTPPutFile command. Specifically, FIG. 9A is a diagram for explaining a part of a plurality of input variables of the FTPPutFile command. FIG. 9B is a diagram for explaining a part of a plurality of output variables of the FTPPutFile command.

図9(A)を参照して、起動を意味する“Execute”は、FTPPutFile命令の起動を指定
するための入力変数である。接続先のFTPサーバを意味する“ConnectSvr”は、FTPサーバのアドレスおよびポート番号と、ログイン用のユーザ名およびパスワードとを指定するための入力変数である。FTPサーバのディレクトリ名を意味する“SvrDirName”は、ファイル一覧を取得するFTPサーバのディレクトリを指定するための入力変数である。
With reference to FIG. 9A, “Execute” meaning start is an input variable for specifying start of the FTPPutFile command. “ConnectSvr”, which means the FTP server of the connection destination, is an input variable for specifying the address and port number of the FTP server, and the login user name and password. “SvrDirName”, which means the directory name of the FTP server, is an input variable for designating the directory of the FTP server that acquires the file list.

ローカルディスレクトリ名を意味する“LocalDirName”は、FTPサーバへアップロー
ドするファイルを格納しているディレクトリ(PLC100のディレクトリ)を指定するための入力変数である。ファイル名を意味する“FileName”は、アップロードするファイルのファイル名を指定するための入力変数である。ファイル名の指定は、ワイルドカードを用いることも可能である。
“LocalDirName”, which means a local directory name, is an input variable for designating a directory (a directory of the PLC 100) storing a file to be uploaded to the FTP server. “FileName”, which means a file name, is an input variable for specifying the file name of the file to be uploaded. A wild card can be used to specify the file name.

FTP実行オプションを意味する“ExecOption”は、FTP実行に関するオプションを指定するための入力変数である。たとえば、“ExecOption”は、上書きを許可するか否かを指定するための入力変数“OverWrite”を含む(図11参照)。 “ExecOption”, which means an FTP execution option, is an input variable for specifying an option related to FTP execution. For example, “ExecOption” includes an input variable “OverWrite” for designating whether or not overwriting is permitted (see FIG. 11).

図9(B)を参照して、完了を意味する“Done”は、正常終了(すなわち、読出しが完了)したことを表すための出力変数である。実行中を意味する“Busy”は、命令の実行中を表すための出力変数である。エラーを意味する“Error”は、異常終了したことを表す
ための出力変数である。
With reference to FIG. 9B, “Done” meaning completion is an output variable for indicating that the process is completed normally (that is, the reading is completed). "Busy", which means that the instruction is being executed, is an output variable for indicating that the instruction is being executed. “Error”, which means an error, is an output variable for indicating that an abnormal end has occurred.

<F.機能的構成>
図10は、PLC100の機能的構成を説明するための図である。図10を参照して、PLC100は、通信部1010と、設定部1020と、変数記憶部1030と、制御プログラム実行部1040と、取得部1050と、データ管理部1060と、通信部1070と、メモリカード172とを備えている。
<F. Functional configuration>
FIG. 10 is a diagram for explaining the functional configuration of the PLC 100. With reference to FIG. 10, PLC 100 includes a communication unit 1010, a setting unit 1020, a variable storage unit 1030, a control program execution unit 1040, an acquisition unit 1050, a data management unit 1060, a communication unit 1070, and a memory. And a card 172.

取得部1050は、制御プログラム181(詳しくは、FTPクライアント通信命令以外の命令)を実行することによって各フィールド機器が制御されると、当該各フィールド機器から当該制御に基づくデータを周期的に取得する。 When each field device is controlled by executing the control program 181 (specifically, a command other than the FTP client communication command), the acquisition unit 1050 periodically acquires data based on the control from each field device. ..

データ管理部1060は、取得部1050によって取得されたデータをメモリカード172に書き込む。詳しくは、データ管理部1060は、取得部1050によって順次取得されたデータを、メモリカード172内に保存されている所定のファイルに順次書き込む。さらに詳しくは、データ管理部1060は、取得されたデータを予め定められた規則によって複数の互いに名称の異なるファイル(データ群)に分類することにより、当該データを管理する。これらはユーザが作成するユーザプログラムにおいて記述されることで実現される。 The data management unit 1060 writes the data acquired by the acquisition unit 1050 in the memory card 172. Specifically, the data management unit 1060 sequentially writes the data sequentially acquired by the acquisition unit 1050 into a predetermined file stored in the memory card 172. More specifically, the data management unit 1060 manages the acquired data by classifying the acquired data into a plurality of files (data groups) having mutually different names according to a predetermined rule. These are realized by being described in the user program created by the user.

変数記憶部1030は、ユーザプログラムで参照する変数を格納する。変数記憶部1030は、FTPを利用する際に用いる複数の入力変数(FTP設定用の入力変数)と、当該各入力変数の値とが対応付けて記憶されている。具体的には、変数記憶部1030は、“ConnectSvr”、“SvrDirName”、“LocalDirName”、“FileName”等の入力変数と、各入力変数の値とが記憶されている。なお、「値」とは、着目する変数に関し、当該変数が指すものに相当する表現である。すなわち、値は、数値のみならず、数値以外の文字列を含む。なお、本実施の形態では、入力変数“ConnectSvr”として、FTPサーバのIPアドレスが利用される。 The variable storage unit 1030 stores variables referred to by the user program. The variable storage unit 1030 stores a plurality of input variables (input variables for FTP setting) used when using FTP and the values of the respective input variables in association with each other. Specifically, the variable storage unit 1030 stores input variables such as “ConnectSvr”, “SvrDirName”, “LocalDirName”, and “FileName”, and the value of each input variable. Note that the “value” is an expression corresponding to what the variable indicates with respect to the variable of interest. That is, the value includes not only a numerical value but also a character string other than the numerical value. In the present embodiment, the IP address of the FTP server is used as the input variable “ConnectSvr”.

変数記憶部100は、外部の機器に参照公開する属性を持つ変数と、内部で使用される属性を有する変数を有していても良い。 Variable storage unit 103 0, a variable with the attribute that references published to an external device, may have a variable having an attribute that is used internally.

制御プログラム実行部1040は、制御プログラム181を実行する。制御プログラム実行部1040は、制御プログラム181のユーザプログラム186に含まれるFTP通信命令と、制御プログラム181に含まれるその他命令とを実行する。その際、制御プログラム181は、図7に示したとおり、変数記憶部1030に記憶されている変数を入力変数として含む。つまり、制御プログラム181は、変数記憶部1030に記憶されている変数の値を入力として利用する。さらに換言すれば、制御プログラム181は、変数を
入力変数としてデータをサーバ装置400に送信する命令を含む。また、制御プログラム実行部1040は、FTPクライアント通信命令の実行結果を、通信部1070に通知する。
The control program execution unit 1040 executes the control program 181. The control program execution unit 1040 executes the FTP communication command included in the user program 186 of the control program 181 and the other commands included in the control program 181. At that time, the control program 181 includes the variables stored in the variable storage unit 1030 as input variables, as shown in FIG. 7. That is, the control program 181 uses the value of the variable stored in the variable storage unit 1030 as an input. In other words, the control program 181 includes an instruction to transmit data to the server device 400 by using the variable as an input variable. The control program execution unit 1040 also notifies the communication unit 1070 of the execution result of the FTP client communication command.

通信部1070は、FTPサーバであるサーバ装置400と通信するためのインターフェイスである。通信部1070は、制御プログラム実行部1040の実行結果に応じた処理を実行する。たとえば、通信部1070は、FTPPutFile命令に基づくPut処理(FTPサーバにファイルを転送(アップロード)、FTPGetFile命令に基づくGet処理(FTPサーバからファイルを取得(ダウンロード))、FTPGetFilelist命令に基づくLs処理(FTPサーバからファイル一覧を取得を実行する。 The communication unit 1070 is an interface for communicating with the server device 400 that is an FTP server. The communication unit 1070 executes processing according to the execution result of the control program execution unit 1040. For example, the communication unit 1070 uses the FTPPutFile command based Put process (transfers a file to an FTP server (upload) ) , the FTPGetFile command based Get process (acquires a file from an FTP server (download)), and the FTPGetFilelist command based Ls process ( (Obtain a file list from the FTP server ) .

Put処理に着目すると、通信部1070は、変数記憶部1030に記憶された入力変数の値が入力されたときの制御プログラム181の実行結果に基づいて、入力変数“SvrDirName”により指定されたメモリカード172のディレクトリにおける、入力変数“FileName”により指定されたファイルを、入力変数“ConnectSvr”で指定されたFTPサーバ(本実施の形態ではサーバ装置400)の入力変数“SvrDirName”により指定されたディレクトリに転送(送信)する。このように、PLC100は、制御プログラム181の実行にあたり、命令が起動されると上記変数の値に基づいてデータをサーバ装置400に送信する。 Focusing on the Put process, the communication unit 1070 determines that the memory card specified by the input variable “SvrDirName” is based on the execution result of the control program 181 when the value of the input variable stored in the variable storage unit 1030 is input. The file designated by the input variable “FileName” in the directory 172 is changed to the directory designated by the input variable “SvrDirName” of the FTP server (the server device 400 in this embodiment) designated by the input variable “ConnectSvr”. Transfer (send). As described above, when executing the control program 181, the PLC 100 transmits data to the server device 400 based on the value of the variable when the instruction is activated.

Ls処理に着目すると、通信部1070は、変数記憶部1030に記憶された入力変数の値に対する制御プログラム181の実行結果に基づいて、入力変数“ConnectSvr”で指定されたFTPクライアント(本実施の形態ではサーバ装置400)の入力変数“SvrDirName”により指定されたディレクトリに含まれるファイル一覧を、当該FTPクライアントから取得する。 Focusing on the Ls processing, the communication unit 1070 determines that the FTP client specified in the input variable “ConnectSvr” (this embodiment) based on the execution result of the control program 181 for the value of the input variable stored in the variable storage unit 1030. Then, the file list included in the directory designated by the input variable “SvrDirName” of the server device 400) is acquired from the FTP client.

通信部1010は、プログラマブル表示器300と通信するためのインターフェイスである。設定部1020は、ユーザ操作に伴うプログラマブル表示器300からの指令に基づき、変数記憶部1030に記憶された入力変数の値を設定(更新)する。 The communication unit 1010 is an interface for communicating with the programmable display 300. The setting unit 1020 sets (updates) the value of the input variable stored in the variable storage unit 1030 based on a command from the programmable display device 300 accompanying a user operation.

以上の構成によれば、PLC100は、フィールド機器から取得したデータをFTPによりファイルとしてサーバ装置400に送信する際に、FTPに用いられる変数の値を制御プログラムの入力変数とすることが可能となる。それゆえ、PLC100によれば、制御プログラム181の実行中であっても、FTPを利用する際に用いる変数の値を変更することが可能となる。 According to the above configuration, the PLC 100 can use the value of the variable used for the FTP as the input variable of the control program when transmitting the data acquired from the field device as the file by the FTP to the server device 400. .. Therefore, according to the PLC 100, it is possible to change the value of the variable used when using the FTP even while the control program 181 is being executed.

(f1.オプション処理について)
次に、FTPPutFile命令における入力変数“ExexOption”(図9(A))において上書き処理が禁止されている場合には、以下の処理が行なわれる。
(F1. About optional processing)
Next, when the input variable "ExexOption" (FIG. 9A) in the FTPPutFile command prohibits the overwriting process, the following process is performed.

制御プログラム実行部1040は、通信部1070によるサーバ装置400との通信によって、データ管理部1060によって付与された名称と同一名称のファイルがサーバ装置400に存在するか否かを、サーバ装置400から取得したファイル一覧に基づき判断する。詳しくは、制御プログラム実行部1040は、FTPGetFilelist命令に基づき取得したファイル一覧を利用して、FTPPutFile命令の入力変数“SvrDirName”により指定されたディレクトリ(サーバ装置400のディレクトリ)に、FTPPutFile命令の入力変数“LocalDirName”により指定されたディレクトリに含まれるファイルと重複しているファイルが存在しないか否かを判断する。 The control program execution unit 1040 obtains, from the server device 400, whether or not a file having the same name as the name given by the data management unit 1060 exists in the server device 400 through the communication with the server device 400 by the communication unit 1070. Judgment based on the list of files. Specifically, the control program execution unit 1040 uses the file list acquired based on the FTPGetFilelist command, and in the directory (directory of the server device 400) designated by the input variable “SvrDirName” of the FTPPutFile command, the input variable of the FTPPutFile command. It is determined whether or not there is a file that duplicates the file included in the directory specified by "LocalDirName".

通信部1070は、入力に対する前記制御プログラムの実行結果に基づいて、メモリカ
ード172に記憶されているファイルのうち同一名称のファイルが存在すると判断されなかったファイルをサーバ装置400に送信する。詳しくは、通信部1070は、入力変数“LocalDirName”で指定されるディレクトリに含まれるファイルのうち、入力変数“SvrDirName”で指定されるディレクトリに同一名称のファイルが存在していないファイルを、サーバ装置400の入力変数“SvrDirName”で指定されるディレクトリに転送する。
The communication unit 1070 transmits, to the server device 400, a file that is not determined to have a file with the same name among the files stored in the memory card 172 based on the execution result of the control program for the input. More specifically, the communication unit 1070 uses the server device to identify a file that does not exist in the directory specified by the input variable “SvrDirName” among the files included in the directory specified by the input variable “LocalDirName”. Transfer to the directory specified by the input variable "SvrDirName" of 400.

(f2.入力変数の値の例)
図11は、FTPPutFile命令における複数の入力変数のうちの一部の入力変数の値を表した図である。なお、FTPPutFile命令を含むFTPクライアント通信命令における入力変数の値は、ユーザによって設定される。
(Example of f2. input variable value)
FIG. 11 is a diagram showing the values of some of the input variables in the FTPPutFile command. The value of the input variable in the FTP client communication command including the FTPPutFile command is set by the user.

図11を参照して、FTPサーバのIPアドレスを表す入力変数“ConnectSvr”の値、FTPサーバのディレクトリ名を表す入力変数“SvrDirName”の値、自装置(PLC100)のディレクトリ名を表す入力変数“LocalDirName”の値は、それぞれ、“192.168.250.1”、“\aaaaa\”、“\bbbbb\”である。 Referring to FIG. 11, a value of an input variable “ConnectSvr” that represents the IP address of the FTP server, a value of an input variable “SvrDirName” that represents the directory name of the FTP server, and an input variable “that represents the directory name of the own device (PLC100)”. The values of "LocalDirName" are "192.168.250.1", "\aaaaa\", and " \ bbbbb \ ", respectively.

また、転送するファイル名は、ワイルドカードを用いて指定されている。具体的には、転送するファイル名の値は、入力変数“LocalDirName”の値(“\bbbbb\”)に含まれる全てのテキストデータ(“*.txt”)を表している。 The file name to be transferred is specified using a wild card. Specifically, the value of the file name to be transferred represents all the text data (“*.txt”) included in the value (“ \ bbbbb \ ”) of the input variable “LocalDirName”.

入力変数“Overwrite”の値は、上書きを禁止する“False”となっている。なお、上書きを許可する場合には、入力変数“Overwrite”の値は“True”となる。 The value of the input variable “Overwrite” is “False” which prohibits overwriting. When overwriting is permitted, the value of the input variable “Overwrite” becomes “True”.

<G.制御構造>
図12は、FTPクライアント通信命令を実行するときに行なわれる処理流れの概略を表したフローチャートである。図12を参照して、ステップS2において、PLC100のプロセッサ120(図2)は、FTP用の入力変数の値を読み込む。ステップS4において、プロセッサ120は、入力変数の値に基づくユーザプログラム186の実行結果を出力する。ステップS6において、プロセッサ120は、クライアント通信命令をFTPに準拠した命令に変換(プロトコル変換)する。ステップS8において、プロセッサ120は、変換後の命令に応じた通信処理を実行する。
<G. Control structure>
FIG. 12 is a flowchart showing an outline of a processing flow performed when executing the FTP client communication command. With reference to FIG. 12, in step S2, the processor 120 (FIG. 2) of the PLC 100 reads the value of the FTP input variable. In step S4, the processor 120 outputs the execution result of the user program 186 based on the value of the input variable. In step S6, the processor 120 converts the client communication command into a command based on FTP (protocol conversion). In step S8, the processor 120 executes communication processing according to the converted instruction.

図13は、PLC100が図7に示したユーザプログラム186を実行する際の処理流れの概略を表したフローチャートである。すなわち、図13は、PLC100がFTPGetFilelist命令とFTPPutFile命令とをこの順に実行する際の処理の流れを表した図である。 FIG. 13 is a flowchart showing the outline of the processing flow when the PLC 100 executes the user program 186 shown in FIG. 7. That is, FIG. 13 is a diagram showing a flow of processing when the PLC 100 executes the FTPGetFilelist command and the FTPPutFile command in this order.

図13を参照して、ステップS102において、PLC100のプロセッサ120は、FTPGetFileList命令を実行する。具体的には、プロセッサ120は、入力変数“SvrDirName”で指定されたディレクトリ(以下、「ディレクトリDS」とも称する)に含まれるファイルのファイル一覧をサーバ装置400から取得する。なお、サーバ装置400は、入力変数“ConnectSvr”によって指定されたFTPサーバである。 Referring to FIG. 13, in step S102, the processor 120 of the PLC 100 executes the FTPGetFileList instruction. Specifically, the processor 120 acquires, from the server device 400, a file list of files included in the directory designated by the input variable “SvrDirName” (hereinafter, also referred to as “directory DS”). The server device 400 is an FTP server designated by the input variable “ConnectSvr”.

ステップS104において、プロセッサ120は、FTPPutFile命令の実行を開始する。ステップS106において、プロセッサ120は、入力変数“LocalDirName”で指定されたディレクトリ(以下、「ディレクトリDT」とも称する)に含まれるファイルのファイル一覧をメモリカード172から取得する。 In step S104, the processor 120 starts executing the FTPPutFile instruction. In step S106, the processor 120 acquires from the memory card 172 a file list of files included in the directory designated by the input variable “LocalDirName” (hereinafter, also referred to as “directory DT”).

ステップS108において、プロセッサ120は、予め規定された変数iの値を“1”とする。ステップS110において、プロセッサ120は、ディレクトリDTに含まれるi番目のファイルとファイル名が一致するファイルがサーバ装置400のディレクトリD
Sに存在するか否かを、取得された2つのファイル一覧に基づいて判断する。
In step S108, the processor 120 sets the value of the previously defined variable i to "1". In step S110, the processor 120 determines that the file whose file name matches the i-th file included in the directory DT is the directory D of the server device 400.
Whether or not it exists in S is determined based on the obtained two file lists.

プロセッサ120は、ファイルが存在しないと判断された場合(ステップS110においてNO)、ステップS112においてFTPによるファイル転送処理(Put処理)を実行する。ステップS114において、プロセッサ120は、転送済みのファイルとして当該ファイルのファイル名を、アップロードしたファイル結果を表す出力変数“PutFileResult”の値として出力する。プロセッサ120は、ファイルが存在すると判断された場
合(ステップS110においてYES)、ステップS120において、転送失敗のファイルとして当該ファイルのファイル名を出力変数“PutFileResult”の値として出力する。
When it is determined that the file does not exist (NO in step S110), the processor 120 executes a file transfer process (Put process) by FTP in step S112. In step S114, the processor 120 outputs the file name of the file as the transferred file as the value of the output variable "PutFileResult" representing the uploaded file result. When it is determined that the file exists (YES in step S110), the processor 120 outputs the file name of the file as the transfer-failed file as the value of the output variable “PutFileResult” in step S120.

ステップS116において、プロセッサ120は、変数iをインクリメントする。つまり、プロセッサ120は、iの値を1だけ増加させる。ステップS118において、プロセッサ120は、メモリカード172のディレクトリDTに含まれる全てのファイルのファイル名の出力処理が終了したか否かを判断する。すなわち、プロセッサ120は、FTPPutFile命令の実行が終了したか否かを判断する。プロセッサ120は、終了していないと判断した場合(ステップS118においてNO)、処理をステップS110に戻す。プロセッサ120は、終了したと判断した場合(ステップS118においてYES)、一連の処理を終了する。 In step S116, the processor 120 increments the variable i. That is, the processor 120 increases the value of i by 1. In step S118, the processor 120 determines whether the output processing of the file names of all the files included in the directory DT of the memory card 172 has been completed. That is, the processor 120 determines whether or not the execution of the FTPPutFile command is completed. If the processor 120 determines that it has not ended (NO in step S118), the process returns to step S110. If the processor 120 determines that the processing has ended (YES in step S118), the series of processing ends.

図14は、図13のステップS112における処理の詳細を表したフローチャートである。図14を参照して、ステップS202において、プロセッサ120は、各入力変数(ConnectSvr,SvrDirName,LocalDir,FileName等)の値を変数記憶部1030(図10)から読み出す。ステップS204において、プロセッサ120は、読み出した各変数の値が適正か否かを判断する。 FIG. 14 is a flowchart showing details of the process in step S112 of FIG. With reference to FIG. 14, in step S202, the processor 120 reads the value of each input variable (ConnectSvr, SvrDirName, LocalDir, FileName, etc.) from the variable storage unit 1030 (FIG. 10). In step S204, the processor 120 determines whether or not the read value of each variable is proper.

具体的には、PLC100は、ネットワークを構成するFTPサーバのIPアドレスを事前に認識しているため、プロセッサ120は、認識しているIPアドレスが入力されたか否かで、入力変数“ConnectSvr”で指定されるFTPサーバが存在するか否かを判断する。また、プロセッサ120は、上記FTPサーバが存在する場合において、入力変数“SvrDirName”で指定されるディレクトリが当該FTPサーバ内に存在するか否かを判断する。さらに、プロセッサ120は、入力変数“LocalDir”で指定されるディレクトリがメモリカード172に存在するか否かを判断する。また、プロセッサ120は、入力変数“Filename”で指定されるファイルが、入力変数“LocalDir”で指定されるディレクトリに存在するか否かを判断する。 Specifically, since the PLC 100 recognizes the IP address of the FTP server forming the network in advance, the processor 120 uses the input variable “ConnectSvr” depending on whether the recognized IP address is input. It is determined whether or not the designated FTP server exists. Further, when the FTP server exists, the processor 120 determines whether or not the directory designated by the input variable “SvrDirName” exists in the FTP server. Further, the processor 120 determines whether or not the directory designated by the input variable “LocalDir” exists in the memory card 172. The processor 120 also determines whether the file specified by the input variable “Filename” exists in the directory specified by the input variable “LocalDir”.

プロセッサ120は、適正であると判断された場合(ステップS204においてYES)、ステップS206において、ファイルの転送処理を実行し、一連の処理を終了する。プロセッサ120は、適正でないと判断された場合(ステップS204においてNO)、一連の処理を終了する。 If the processor 120 determines that it is appropriate (YES in step S204), the processor 120 executes the file transfer process in step S206, and ends the series of processes. If the processor 120 determines that it is not appropriate (NO in step S204), it ends the series of processes.

<H.プログラマブル表示器の操作画面>
図15は、プログラマブル表示器300のタッチスクリーン318に表示される操作画面(UI:UserInterface)を表した図である。図15(A)は、FTPサーバを指定す
るための操作画面である。図15(B)は、Put処理の設定を行なうための操作画面である。図15(C)は、Get処理の設定を行なうための操作画面である。
<H. Programmable display operation screen>
FIG. 15 is a diagram showing an operation screen (UI: User Interface) displayed on the touch screen 318 of the programmable display device 300. FIG. 15A is an operation screen for designating the FTP server. FIG. 15B is an operation screen for setting the Put process. FIG. 15C is an operation screen for setting Get processing.

図15(A)を参照して、プログラマブル表示器300は、FTPサーバを指定するために、入力変数“ConnectSvr”の値(具体的には、図8(A)および図9(A)に示したとおり、FTPサーバのIPアドレス、FTPサーバのポート番号、ユーザ名、パスワード)の入力を受け付ける入力ボックス811,812,813,814をタッチスクリー
ン318に表示する。ユーザは、各入力ボックス811〜814に値を入力した後に設定ボタン818を選択することにより、PLC100の変数記憶部1030(図10)に格納されている変数の値を設定(更新)することができる。
With reference to FIG. 15(A), the programmable display device 300 has a value of an input variable “ConnectSvr” (specifically, shown in FIGS. 8A and 9A) for designating an FTP server. As described above, the input boxes 811, 812, 813, 814 for receiving the input of the FTP server IP address, the FTP server port number, the user name, and the password) are displayed on the touch screen 318. The user can set (update) the value of the variable stored in the variable storage unit 1030 (FIG. 10) of the PLC 100 by selecting the setting button 818 after inputting the value in each of the input boxes 811 to 814. it can.

図15(B)を参照して、プログラマブル表示器300は、FTPクライアント(すわち、PLC100)におけるディレクトリ名とファイル名とを指定するために、入力変数“SvrDirName”および入力変数“LocalDirName”の値の入力を受け付ける入力ボックス821,822をタッチスクリーン318に表示する。また、プログラマブル表示器300は、FTPサーバのディレクトリ名を指定するために、入力変数“SvrDirName”の値の入力を受け付ける入力ボックス823を表示する。 Figure 15 Referring to (B), the programmable display device 300, FTP client (to such KazuSatoshi, the PLC 100) to specify the directory name and file name in the input variables "SvrDirName" and the input variables "LocalDirName" The input boxes 821 and 822 that accept the input of the value of are displayed on the touch screen 318. Further, the programmable display device 300 displays an input box 823 for accepting the input of the value of the input variable “SvrDirName” in order to specify the directory name of the FTP server.

ユーザは、各入力ボックス821〜823に値を入力した後に設定ボタン828を選択することにより、PLC100の変数記憶部1030(図10)に格納されている変数の値を設定(更新)することができる。また、ユーザは、転送ボタン829を選択することにより、PLC100にPut処理を実行させることができる。これはユーザプログラムにおいて、HMIからの入力を受け付けた際にFTP命令実行されることで実現される。 The user can set (update) the value of the variable stored in the variable storage unit 1030 (FIG. 10) of the PLC 100 by selecting the setting button 828 after inputting the value in each of the input boxes 821 to 823. it can. Further, the user can cause the PLC 100 to execute the Put process by selecting the transfer button 829. Which in the user program are implemented by FTP instruction is executed upon receiving an input from HMI.

図15(C)を参照して、プログラマブル表示器300は、FTPクライアント(すわち、PLC100)におけるディレクトリ名を指定するために、入力変数“LocalDirName”の値の入力を受け付ける入力ボックス831をタッチスクリーン318に表示する。また、プログラマブル表示器300は、FTPサーバのディレクトリ名とファイル名とを指定するために、入力変数“SvrDirName”および入力変数“FileName”の値の入力を受け付ける入力ボックス832,833を表示する。 Figure 15 Referring to (C), the programmable display device 300, FTP client (to such KazuSatoshi, the PLC 100) to specify the directory name in the input box 831 for accepting an input of the input variables "LocalDirName" Display on the touch screen 318. In addition, the programmable display device 300 displays input boxes 832 and 833 that accept input of the values of the input variable “SvrDirName” and the input variable “FileName” in order to specify the directory name and the file name of the FTP server.

ユーザは、各入力ボックス831〜833に値を入力した後に設定ボタン838を選択することにより、PLC100の変数記憶部1030(図10)に格納されている変数の値を設定(更新)することができる。また、ユーザは、転送ボタン839を選択することにより、PLC100にGet処理を実行させることができる。これはユーザプログラムにおいて、HMIからの入力を受け付けた際にFTP命令実行されることで実現される。 The user can set (update) the value of the variable stored in the variable storage unit 1030 (FIG. 10) of the PLC 100 by selecting the setting button 838 after inputting the value in each of the input boxes 831 to 833. it can. Further, the user can cause the PLC 100 to execute the Get process by selecting the transfer button 839. Which in the user program are implemented by FTP instruction is executed upon receiving an input from HMI.

上述した変数の値を設定(更新)は、PLC100の設定部1020により実現される。変数の値の設定(更新)は、上述したように、制御プログラム181の実行中であっても行なわれる。これにより、ユーザは、制御プログラムの実行を中断することなく、FTPクライアント通信命令を変更することが可能となる。 Setting (updating) of the values of the variables described above is realized by the setting unit 1020 of the PLC 100. As described above, the setting (updating) of the variable value is performed even while the control program 181 is being executed. This allows the user to change the FTP client communication command without interrupting the execution of the control program.

<I.再判断処理>
図16は、FTPPutFile命令を実行した場合に、転送に失敗したファイルを送信するための処理を説明するための図である。すなわち、図16は、ファイル名が重複するためにファイルの転送を意図的に行なわなかったファイルについて、再度、ファイルの転送が可能であるか否かを判断する処理を説明するための図である。
<I. Re-judgment process>
FIG. 16 is a diagram for explaining a process for transmitting a file that has failed to be transferred when the FTPPutFile command is executed. That is, FIG. 16 is a diagram for explaining a process of determining again whether or not a file can be transferred again for a file that has not been intentionally transferred due to a duplicate file name. ..

図16を参照して、FTPPutFile命令における入力変数“FileName”によって5つのファイル(X001.txt,X002.txt,X003.txt,X004txt,X005.txt)が指定されたとする。その
後、FTPputFile命令の実行により、3つのファイル(X001.txt,X003.txt,X005.txt)のサーバ装置400への転送が完了し、2つのファイル(X002.txt,X004txt)の転送が失
敗であったとする。この場合、プロセッサ120は、転送に失敗した2つのファイルのファイル名(X002.txt,X004.txt)が、再度、入力変数“FileName”としてFTPputFile命令のファンクションブロックに入力される。なお、上記のファイル名の再度の入力は、たと
えば、ユーザがサーバ装置400の転送対象ディレクトリに記憶されたファイルを取り除く作業等を行なった後に行なわれる。具体的には、ファイル名の再度の入力は、入力変数“SvrDirName”で指定されるディレクトリに記憶されているファイルを消去等した後に行なわれる。
Referring to FIG. 16, it is assumed that five files (X001.txt, X002.txt, X003.txt, X004txt, X005.txt) are designated by the input variable “FileName” in the FTPPutFile command. After that, by executing the FTPputFile command, the transfer of the three files (X001.txt, X003.txt, X005.txt) to the server device 400 is completed, and the transfer of the two files (X002.txt, X004txt) fails. Suppose In this case, the processor 120 inputs the file names (X002.txt, X004.txt) of the two files that failed to be transferred to the function block of the FTPputFile instruction as the input variable “FileName” again. It should be noted that the above-mentioned file name is input again after, for example, the user has performed an operation to remove the file stored in the transfer target directory of server device 400. Specifically, the file name is input again after deleting the file stored in the directory designated by the input variable “SvrDirName”.

すなわち、ユーザプログラム186は、複数のファイルのうち、同一名称のファイルがサーバ装置400の指定されたディレクトリに存在すると判断されなかったファイル(以下、「第1のファイル」とも称する)以外のファイル(以下、「第2のファイル」とも称する)の名称を入力としてさらに利用する。また、図10に示した制御プログラム実行部1040は、サーバ装置400との通信によって、第2のファイルと同一名称のファイルがサーバ装置400に存在するか否かを再度判断する。通信部1070は、制御プログラム実行部1040による再度の判断の結果、第2のファイルのうち同一名称のファイルが存在すると判断されなかったファイル(以下、「第3のファイル」とも称する)を、ユーザプログラム186の実行結果に基づいてサーバ装置400の指定されたディレクトリに送信する。 That is, the user program 186 includes files (except the file that is not determined to have the same name file in the specified directory of the server device 400 among the plurality of files (hereinafter, also referred to as “first file”)). Hereinafter, the name of “the second file” is also used as an input. Further, the control program execution unit 1040 illustrated in FIG. 10 again determines whether or not a file having the same name as the second file exists in the server device 400 by communicating with the server device 400. As a result of the determination made again by the control program execution unit 1040, the communication unit 1070 determines that a file (hereinafter, also referred to as “third file”) that is not determined to have a file with the same name among the second files is used by the user. Based on the execution result of the program 186, it is transmitted to the designated directory of the server device 400.

以上のように、PLC100が転送(送信)に失敗したファイルについて再度転送が可能か否かを自動的に行なうため、ユーザは、転送に失敗したファイルのファイル名を入力変数“FileName”の値として設定する必要がなくなる。 As described above, since the PLC 100 automatically determines whether or not a file that cannot be transferred (transmitted) can be transferred again, the user sets the file name of the file that failed to be transferred as the value of the input variable “FileName”. No need to set.

<J.ユーザプログラムの変形例>
制御プログラム181を構成するユーザプログラム186から、各入力変数の値を書き換えることも可能である。図17は、ユーザプログラム186から各入力変数の値を書き換える構成を有するユーザプログラム186を表した図である。以下、一例として、FTPサーバを指定する点に着目して説明する。
<J. Modified example of user program>
It is also possible to rewrite the value of each input variable from the user program 186 that constitutes the control program 181. FIG. 17 is a diagram showing a user program 186 configured to rewrite the value of each input variable from the user program 186. Hereinafter, as an example, description will be made focusing on the point of designating the FTP server.

図17を参照して、FTPPutFile命令の入力変数“ConnectSvr”には、FTPPutFile命令のファンクションブロックFB2の上のファンクションブロックFB1の出力変数“abc”
の値が入力される。また、ファンクションブロックFB1の入力変数として、FTPサーバのIPアドレス(“192.168.250.1”)が入力される。このように、制御プログラム1
81は、変数の値を設定するための記述であるファンクションブロックFB1を含む。なお、ファンクションブロックFB1には、IPアドレスとして、変数記憶部1030(図10)から読み出された値、またはプログラマブル表示器300から直接入力された値が入力される。
Referring to FIG. 17, the input variable “ConnectSvr” of the FTPPutFile command is set to the output variable “abc” of the function block FB1 above the function block FB2 of the FTPPutFile command.
The value of is input. Also, the IP address (“192.168.250.1”) of the FTP server is input as an input variable of the function block FB1. In this way, the control program 1
Reference numeral 81 includes a function block FB1 which is a description for setting the value of a variable. The value read from the variable storage unit 1030 (FIG. 10) or the value directly input from the programmable display device 300 is input to the function block FB1 as the IP address.

以上のように、PLC100は、FTPクライアント通信命令の入力変数の値として、当該FTPクライアント通信命令のファンクションブロックとは異なるファンクションブロックの出力変数を用いることができる。 As described above, the PLC 100 can use the output variable of the function block different from the function block of the FTP client communication command as the value of the input variable of the FTP client communication command.

<K.通信プロトコル>
なお、上記では、PLC100とサーバ装置400との間の通信に用いられる通信プロトコルの例として、FTPを例に挙げて説明したが、これに限定されるものではない。本発明は、PLC100とサーバ装置400との間のデータ通信に用いられる各種の通信プロトコルに適用可能である。
<K. Communication protocol>
In the above description, FTP has been described as an example of the communication protocol used for communication between the PLC 100 and the server device 400, but the present invention is not limited to this. The present invention can be applied to various communication protocols used for data communication between the PLC 100 and the server device 400.

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiments disclosed this time are to be considered as illustrative in all points and not restrictive. The scope of the present invention is shown not by the above description but by the claims, and is intended to include meanings equivalent to the claims and all modifications within the scope.

1 制御システム、10 検出スイッチ、20 リレー、30 サーボモータドライバ、32 モータ、100 PLC、102 電源ユニット、104 CPUユニット、106 IOユニット、108 PLCシステムバス、110 フィールドバス、112 ネットワーク、114 接続ケーブル、120 プロセッサ、122 チップセット、124 システムクロック、126 主メモリ、128 不揮発性メモリ、130 コネクタ、140 PLCシステムバスコントローラ、142,152,162 バッファメモリ、144 PLCシステムバス制御回路、146,156,166 DMA制御回路、148 PLCシステムバスコネクタ、150 フィールドバスコントローラ、154 フィールドバス制御回路、158 フィールドバスコネクタ、160 上位通信コントローラ、164 上位通信制御回路、168 上位通信コネクタ、170 メモリカードインターフェイス、172 メモリカード、180 OS、181 制御プログラム、184 稼働ログ、186 ユーザプログラム、188 システムプログラム、190 シーケンス命令プログラム、192 FTP処理プログラム、194 入出力処理プログラム、196 Toolインターフェイス処理プログラム、198 スケジューラ、200 リモートIOターミナル、202 通信カプラ、208 リモートIOターミナルバス、300 プログラマブル表示器、311,402 CPU、318 タッチスクリーン、319 通信インターフェイス、381 ディスプレイ、382 タッチパネル、400 サーバ装置、811〜814,821〜823,831〜833 入力ボックス、818,828,838 設定ボタン、829,839 転送ボタン、1010,1070 通信部、1020 設定部、1030 変数記憶部、1040 制御プログラム実行部、1050 取得部、1060 データ管理部、FB1,FB2 ファンクションブロック。 1 control system, 10 the detection switch, 20 relays, 30 a servo motor driver, 32 a motor, 100 PLC, 102 power supply unit, 104 CPU units, 1 06 IO unit, 108 PLC system bus, 110 Fieldbus, 112 network, 114 connected Cable, 120 processor, 122 chip set, 124 system clock, 126 main memory, 128 non-volatile memory, 130 connector, 140 PLC system bus controller, 142, 152, 162 buffer memory, 144 PLC system bus control circuit, 146 , 156 166 DMA control circuit, 148 PLC system bus connector 150 fieldbus controller, 154 fieldbus control circuits, 1 58 fieldbus connector 160 higher communication controller, 164 upper communication control circuit, 168 a higher communication connector 170 memory card interface, 172 memory card, 180 OS, 181 control program, 184 operation log, 186 user program, 188 system program, 190 sequence command program, 192 FTP processing program, 194 input/output processing program, 196 Tool interface processing program, 198 scheduler, 200 remote IO terminal, 202 communication coupler, 208 remote IO terminal bus, 300 programmable display, 311, 402 CPU, 318 touch screen, 319 communication interface, 381 display, 382 touch panel, 400 server device, 811-814, 821-823, 831 ~833 input box, 818,828,838 setting button, 829,839 transfer button, 1010,1070 communication unit, 102 0 setting tough, 1030 variable storage unit, 1040 a control program execution unit 1050 obtaining unit, 1060 data management unit , FB1, FB2 Function block.

Claims (4)

サーバ装置と通信するとともに、制御プログラムを実行することによって予め定められた機器を制御する制御装置であって、
前記制御プログラムを実行する実行手段と、
前記予め定められた機器から前記制御に基づくデータを取得する取得手段と、
予め定められた通信プロトコルを用いて前記サーバ装置と通信する第1の通信手段と、
前記通信プロトコルを利用する際に用いる変数と、前記変数の値とを記憶するための記憶手段とを備え、
前記制御プログラムは、前記変数を入力変数として含み、かつ前記入力変数は、前記取得手段により取得されたデータを含むデータ群の名称であり、
前記実行手段は、前記第1の通信手段によるサーバ装置との通信によって、前記データ群の名称と同一名称のデータ群が前記サーバ装置に存在するか否かを判断し、
前記第1の通信手段は、前記変数の値が入力されたときの前記制御プログラムの実行結果に基づいて、前記データ群のうち前記同一名称のデータ群が存在すると判断されなかった第1のデータ群を前記サーバ装置に送信
前記制御プログラムは、前記データ群のうち前記第1のデータ群以外の第2のデータ群の名称を入力として利用し、
前記実行手段は、前記サーバ装置との通信によって、前記第2のデータ群と同一名称のデータ群が前記サーバ装置に存在するか否かを再度判断し、
前記第1の通信手段は、前記実行手段による再度の判断の結果、前記第2のデータ群のうち前記同一名称のデータ群が存在すると判断されなかった第3のデータ群を、前記制御プログラムの実行結果に基づいて前記サーバ装置に送信する、制御装置。
A control device that communicates with a server device and controls a predetermined device by executing a control program,
Executing means for executing the control program;
An acquisition unit that acquires data based on the control from the predetermined device,
First communication means for communicating with the server device using a predetermined communication protocol;
A variable used when using the communication protocol, and storage means for storing the value of the variable,
The control program includes the variable as an input variable, and the input variable is the name of a data group including the data acquired by the acquisition means,
The execution means determines whether or not a data group having the same name as the name of the data group exists in the server device through communication with the server device by the first communication means,
The first communication means is the first data which has not been determined that the data group having the same name among the data groups exists based on the execution result of the control program when the value of the variable is input. send a group to the server device,
The control program uses the name of a second data group other than the first data group in the data group as an input,
The execution unit again determines whether or not a data group having the same name as the second data group exists in the server device by communicating with the server device,
As a result of the determination made again by the executing unit, the first communication unit sets a third data group, which is not determined to exist as the data group having the same name among the second data group, to the control program. A control device that transmits to the server device based on an execution result .
プログラマブル表示器と通信する第2の通信手段と、
前記プログラマブル表示器からの指令に基づき、前記変数の値を設定する設定手段とをさらに備える、請求項に記載の制御装置。
Second communication means for communicating with the programmable display;
Wherein based on a command from the programmable display device, further comprising setting means for setting the value of the variable control device according to claim 1.
前記データ群は、ファイルとして管理され、
前記通信プロトコルは、ファイル転送プロトコルである、請求項1または2に記載の制御装置。
The data group is managed as a file,
The communications protocol is a file transfer protocol, the control apparatus according to claim 1 or 2.
サーバ装置と通信するとともに、制御プログラムを実行することによって予め定められた機器を制御する制御装置における通信制御方法であって、
前記制御装置のプロセッサが、前記制御プログラムを実行するステップと、
前記プロセッサが、前記予め定められた機器から前記制御に基づくデータを取得するステップと、
前記プロセッサが、予め定められた通信プロトコルを用いて前記サーバ装置と通信するステップとを備え、
前記制御装置は、前記通信プロトコルを利用する際に用いる変数と、前記変数の値とを記憶しており、
前記制御プログラムは、前記変数を入力変数として含み、かつ前記入力変数は、前記取得するステップにより取得されたデータを含むデータ群の名称であり、
前記通信制御方法は、
前記プロセッサが、前記サーバ装置との通信によって、前記データ群の名称と同一名称のデータ群が前記サーバ装置に存在するか否かを判断するステップをさらに備え、
前記サーバ装置と通信するステップは、前記プロセッサが、前記変数の値が入力されたときの前記制御プログラムの実行結果に基づいて、前記データ群のうち前記同一名称のデータ群が存在すると判断されなかった第1のデータ群を前記サーバ装置に送信するステップを含
前記制御プログラムは、前記データ群のうち前記第1のデータ群以外の第2のデータ群の名称を入力として利用し、
前記通信制御方法は、
前記プロセッサが、前記サーバ装置との通信によって、前記第2のデータ群と同一名称のデータ群が前記サーバ装置に存在するか否かを再度判断するステップをさらに備え、
前記サーバ装置と通信するステップは、前記再度の判断の結果、前記第2のデータ群のうち前記同一名称のデータ群が存在すると判断されなかった第3のデータ群を、前記制御プログラムの実行結果に基づいて前記サーバ装置に送信するステップをさらに含む、通信制御方法。
A communication control method in a control device for controlling a predetermined device by communicating with a server device and executing a control program,
A processor of the control device executes the control program;
The processor obtaining data based on the control from the predetermined device;
The processor communicates with the server device using a predetermined communication protocol,
The control device stores a variable used when using the communication protocol and a value of the variable,
The control program includes the variable as an input variable, and the input variable is the name of a data group including the data acquired by the acquiring step,
The communication control method,
The processor further comprises a step of determining whether or not a data group having the same name as the name of the data group exists in the server device by communicating with the server device,
In the step of communicating with the server device, the processor is not determined to have the data group with the same name among the data groups based on the execution result of the control program when the value of the variable is input. the first data group viewing including the step of transmitting to said server apparatus,
The control program uses the name of a second data group other than the first data group in the data group as an input,
The communication control method,
The processor further comprises a step of determining again by communication with the server device whether or not a data group having the same name as the second data group exists in the server device,
In the step of communicating with the server device, as a result of the determination again, a third data group that has not been determined to exist as the data group having the same name among the second data groups is set as the execution result of the control program. The communication control method further comprising the step of transmitting to the server device based on the above .
JP2018027136A 2018-02-19 2018-02-19 Control device and communication control method Active JP6705464B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018027136A JP6705464B2 (en) 2018-02-19 2018-02-19 Control device and communication control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018027136A JP6705464B2 (en) 2018-02-19 2018-02-19 Control device and communication control method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2013270476A Division JP6357769B2 (en) 2013-12-26 2013-12-26 Control device and communication control method

Publications (2)

Publication Number Publication Date
JP2018088277A JP2018088277A (en) 2018-06-07
JP6705464B2 true JP6705464B2 (en) 2020-06-03

Family

ID=62493712

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018027136A Active JP6705464B2 (en) 2018-02-19 2018-02-19 Control device and communication control method

Country Status (1)

Country Link
JP (1) JP6705464B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003296217A (en) * 2002-04-03 2003-10-17 Canon Inc Communication terminal device and its control method
JP5358340B2 (en) * 2009-08-07 2013-12-04 株式会社キーエンス Programmable controller
JP5891891B2 (en) * 2012-03-27 2016-03-23 オムロン株式会社 Information processing apparatus, information processing method, and program

Also Published As

Publication number Publication date
JP2018088277A (en) 2018-06-07

Similar Documents

Publication Publication Date Title
JP6357770B2 (en) Control device and communication control method
WO2015136959A1 (en) Control system, method, program and information processing device
US9984244B2 (en) Controller, information processing apparatus, and recording medium
US10120030B2 (en) Trace data recording system, trace data recording server, trace data recording method, and information storage medium
CN112602025A (en) Automatic setting of digital twinning of industrial controllers
JP6493506B1 (en) INDUSTRIAL CONTROL SYSTEM, ITS SUPPORT DEVICE, CONTROL SUPPORT METHOD AND PROGRAM
CN105320054B (en) Communication system, programable display, information processing unit and its method, recording medium
JP6443190B2 (en) Programmable logic controller, control method of programmable logic controller, and control program
JP2002268707A (en) Controller and tool, and system constituted of the same
JP2017142767A (en) Controller system and variable coordination support device
JP6442131B2 (en) Control system and control device
JP6477178B2 (en) PLC control data generation device, PLC control data generation method, and PLC control data generation program
JP6680313B2 (en) Control device and communication control method
US20190306250A1 (en) Support apparatus, non-transitory computer-readable recording medium and setting method
JP6135247B2 (en) Information processing apparatus and information processing program
JP6705464B2 (en) Control device and communication control method
JP6171385B2 (en) Controller and information processing apparatus
WO2019244751A1 (en) Device control method, control apparatus, and system
US20190303319A1 (en) Support apparatus, non-transitory computer-readable recording medium and setting method
JP6357769B2 (en) Control device and communication control method
CN114127646A (en) Support device, support program, and setting method
JP2019197449A (en) Apparatus management system and tag name verification method
JP5951041B2 (en) Programmable display
WO2020026738A1 (en) Support device and support program
US20200374198A1 (en) Control method, control device, control system and recording medium

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180220

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180220

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190514

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190531

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20191023

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191113

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200427

R150 Certificate of patent or registration of utility model

Ref document number: 6705464

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250