JP6587031B2 - Control device, data processing device, control system, control method, data processing method, control program, and data processing program - Google Patents

Control device, data processing device, control system, control method, data processing method, control program, and data processing program Download PDF

Info

Publication number
JP6587031B2
JP6587031B2 JP2018503941A JP2018503941A JP6587031B2 JP 6587031 B2 JP6587031 B2 JP 6587031B2 JP 2018503941 A JP2018503941 A JP 2018503941A JP 2018503941 A JP2018503941 A JP 2018503941A JP 6587031 B2 JP6587031 B2 JP 6587031B2
Authority
JP
Japan
Prior art keywords
script
sensor device
measurement data
data
control unit
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
JP2018503941A
Other languages
Japanese (ja)
Other versions
JPWO2017154166A1 (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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Publication of JPWO2017154166A1 publication Critical patent/JPWO2017154166A1/en
Application granted granted Critical
Publication of JP6587031B2 publication Critical patent/JP6587031B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q9/00Arrangements in telecontrol or telemetry systems for selectively calling a substation from a main station, in which substation desired apparatus is selected for applying a control signal thereto or for obtaining measured values therefrom

Description

本件は、制御装置、データ処理装置、制御システム、制御方法、データ処理方法、制御プログラム、及びデータ処理プログラムに関する。   The present invention relates to a control device, a data processing device, a control system, a control method, a data processing method, a control program, and a data processing program.

例えばセンサ機器の測定結果を無線通信によりパーソナルコンピュータ、スマートフォン、及びクラウドサーバなどに送信する技術が知られている。測定結果を受信した機器は、測定結果の表示やデータ処理などを行う。   For example, a technique for transmitting a measurement result of a sensor device to a personal computer, a smartphone, a cloud server, or the like by wireless communication is known. The device that has received the measurement result displays the measurement result and performs data processing.

このようなセンサ機器は、例えばI2C(Inter-Integrated Circuit)やSPI(Serial Parallel Interface)などの汎用インターフェースを介して制御用のマイクロコンピュータと接続される。マイクロコンピュータは、デバイスドライバと呼ばれるプログラムによりセンサ機器を制御する。デバイスドライバは、例えば、センサ機器に搭載されたセンサデバイスの追加や変更が行われる場合、センサデバイスにあわせて更新する必要がある。   Such a sensor device is connected to a control microcomputer via a general-purpose interface such as I2C (Inter-Integrated Circuit) or SPI (Serial Parallel Interface). The microcomputer controls the sensor device by a program called a device driver. For example, when a sensor device mounted on a sensor device is added or changed, the device driver needs to be updated according to the sensor device.

デバイスドライバを更新するためには、コンパイラやライブラリなどの開発環境、及びデバイスドライバをROM(Read only Memory)に書き込むためのROMライタなどの特別なツールを用意する必要がある。このため、デバイスドライバの更新には多くの手間がかかる。   In order to update the device driver, it is necessary to prepare a development environment such as a compiler and a library, and a special tool such as a ROM writer for writing the device driver into a ROM (Read Only Memory). For this reason, it takes much time to update the device driver.

これに対し、センサデバイスを制御するプログラムを、マイクロコンピュータの種類によらないスクリプトにより記述すれば(例えば特許文献1参照)、開発環境や特別なツールを必要とせずに、簡単にデバイスドライバを更新することができる。   On the other hand, if the program for controlling the sensor device is described by a script that does not depend on the type of microcomputer (see, for example, Patent Document 1), the device driver can be easily updated without the need for a development environment or special tools. can do.

国際公開第2005/003980号International Publication No. 2005/003980

しかし、マイクロコンピュータがスクリプトを実行するためには、スクリプトの記述内容をバイナリー形式のコードに解釈するプログラム(インタプリタなど)を実行する必要がある。このため、センサ機器の制御処理の負荷は、スクリプトを用いる場合、コンパイラにより生成したバイナリー形式のコードを直接用いる場合より高くなる。これに対し、例えば、高性能プロセッサによりセンサ機器を制御すれば、問題なく制御処理を行うことができるが、装置コストは増加してしまう。   However, in order for the microcomputer to execute the script, it is necessary to execute a program (such as an interpreter) that interprets the description content of the script into binary code. For this reason, the load of the control processing of the sensor device is higher when a script is used than when a binary code generated by a compiler is directly used. On the other hand, for example, if the sensor device is controlled by a high-performance processor, control processing can be performed without any problem, but the apparatus cost increases.

また、例えば、パーソナルコンピュータからセンサ機器に対してI2Cの読み書きのコマンドを送信することにより、マイクロコンピュータの制御処理をセンサデバイスに対するデータの読み書きに限定し、その他の処理をパーソナルコンピュータに割り当てることもできる。この場合、マイクロコンピュータの制御処理の負荷が低減されるが、その反面、パーソナルコンピュータとセンサ機器の間の通信が頻繁に行われるため、通信処理の負荷が増加し、通信の輻輳、処理の遅延、及び消費電力の増加などが生ずる。なお、この問題は、センサ機器の制御装置に限らず、他の機器の制御装置にも存在する。   Further, for example, by sending an I2C read / write command from the personal computer to the sensor device, the microcomputer control process can be limited to data read / write to the sensor device, and other processes can be assigned to the personal computer. . In this case, the load of control processing of the microcomputer is reduced, but on the other hand, since communication between the personal computer and the sensor device is frequently performed, the load of communication processing increases, communication congestion, processing delay. Increase in power consumption. In addition, this problem exists not only in the control apparatus of a sensor apparatus but in the control apparatus of another apparatus.

そこで本件は上記の課題に鑑みてなされたものであり、制御処理及び通信処理の負荷が低減された制御装置、データ処理装置、制御システム、制御方法、データ処理方法、制御プログラム、及びデータ処理プログラムを提供することを目的とする。   Therefore, the present case has been made in view of the above problems, and a control device, a data processing device, a control system, a control method, a data processing method, a control program, and a data processing program in which the load of control processing and communication processing is reduced. The purpose is to provide.

本明細書に記載の制御装置は、センサデバイスに接続される制御装置において、前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトを記憶する記憶部と、前記第1スクリプトを実行し、該実行結果として、前記センサデバイスの補正係数を取得し、前記第2スクリプトを実行し、該実行結果として、前記センサデバイスの測定データを取得する制御部と、前記補正係数に基づき前記測定データの補正を行うデータ処理装置に、前記補正係数及び前記測定データを送信する送信部とを有する。
Control devices described herein, in a control device connected to the sensor device, a storage unit for storing a first script and the second script includes a command to access the sensor device, and executing the first script as the execution result, and obtains a correction coefficient of said sensor device, executes the second script, as the execution result, and a control unit for acquiring the measurement data of the sensor device, the measurement data based on the correction factor The data processing apparatus that performs the correction includes the transmission unit that transmits the correction coefficient and the measurement data .

本明細書に記載のデータ処理装置は、センサデバイスに接続される制御装置と通信するデータ処理装置において、前記制御装置から、前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトの実行結果として、前記センサデバイスの補正係数及び測定データそれぞれ受信する受信部と、前記補正係数に基づき前記測定データの補正を行うデータ処理部とを有する。
The data processing apparatus described herein, in a data processing device communicating with a control device connected to the sensor device, from the control device, the execution of the first script and the second script includes a command for accessing to the sensor device as a result, it has a receiving unit for receiving the correction factor and measurement data of the sensor device, respectively, and a data processing unit for correcting the measurement data based on the correction coefficient.

本明細書に記載の制御システムは、センサデバイスに接続される制御装置と、前記制御装置と通信するデータ処理装置とを有し、前記制御装置は、前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトを記憶する記憶部と、前記第1スクリプトを実行し、該実行結果として、前記センサデバイスの補正係数を取得し、前記第2スクリプトを実行し、該実行結果として、前記センサデバイスの測定データを取得する制御部と、前記データ処理装置に前記補正係数及び前記測定データを送信する送信部とを有し、前記データ処理装置は、前記制御装置から前記第1スクリプト及び前記第2スクリプトの実行結果として、前記補正係数及び前記測定データそれぞれ受信する受信部と、前記補正係数に基づき前記測定データの補正を行うデータ処理部とを有する。
The control system described in the present specification includes a control device connected to a sensor device and a data processing device communicating with the control device, and the control device includes a first command including a command for accessing the sensor device . A storage unit for storing a script and a second script ; and executing the first script, obtaining a correction coefficient of the sensor device as the execution result , executing the second script, and executing the second script as the execution result. a control unit for acquiring the measurement data of the device, and a transmission unit that transmits the correction coefficient and the measured data to the data processing device, the data processing apparatus, the first script from the control device and the first as 2 result of the script execution, a receiver for receiving the correction factor and the measurement data, respectively, the measurement based on the correction factor And a data processing unit for correcting the data.

本明細書に記載の制御方法は、接続先のセンサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトを実行する工程と、前記第1スクリプトの実行結果として、前記センサデバイスの補正係数を取得し、前記第2スクリプトの実行結果として、前記センサデバイスの測定データを取得する工程と、前記補正係数に基づき前記測定データの補正を行うデータ処理装置に、前記補正係数及び前記測定データを送信する工程とを、コンピュータが実行する方法である。
The control method described in the present specification includes a step of executing a first script and a second script including a command for accessing a connected sensor device , and a correction coefficient of the sensor device as an execution result of the first script. Acquiring and transmitting the correction coefficient and the measurement data to a data processing apparatus that acquires the measurement data of the sensor device as the execution result of the second script and corrects the measurement data based on the correction coefficient Is a method in which a computer executes the step of performing.

本明細書に記載のデータ処理方法は、センサデバイスに接続される制御装置から、前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトの実行結果として、前記センサデバイスの補正係数及び測定データそれぞれ受信する工程と、前記補正係数に基づき前記測定データの補正を行う工程とを、コンピュータが実行する方法である。
The data processing methods described herein, the control device connected to the sensor device, as a result of the execution of the first script and the second script includes a command to access the sensor device, the correction coefficient of said sensor device and measurement a step of receiving data, respectively, and a step of correcting the measurement data based on the correction coefficient, a method executed by a computer.

本明細書に記載の制御プログラムは、接続先のセンサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトを実行し、前記第1スクリプトの実行結果として、前記センサデバイスの補正係数を取得し、前記第2スクリプトの実行結果として、前記センサデバイスの測定データを取得し、前記補正係数に基づき前記測定データの補正を行うデータ処理装置に、前記補正係数及び前記測定データを送信する、処理をコンピュータに実行させるプログラムである。
The control program described in the present specification executes a first script and a second script including a command for accessing a connected sensor device , and acquires a correction coefficient of the sensor device as an execution result of the first script. The process of acquiring the measurement data of the sensor device as the execution result of the second script and transmitting the correction coefficient and the measurement data to a data processing apparatus that corrects the measurement data based on the correction coefficient. A program to be executed by a computer.

本明細書に記載のデータ処理プログラムは、センサデバイスに接続される制御装置から、前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトの実行結果として、前記センサデバイスの補正係数及び測定データそれぞれ受信し、前記補正係数に基づき前記測定データの補正を行う、処理をコンピュータに実行させるプログラムである。
Data processing programs described herein, a control device connected to the sensor device, as a result of executing the first script and the second script includes a command to access the sensor device, the correction coefficient of said sensor device And measurement data are received, and the measurement data is corrected based on the correction coefficient .

制御処理及び通信処理の負荷を低減することができる。   The load of control processing and communication processing can be reduced.

制御システムの一例を示す構成図である。It is a block diagram which shows an example of a control system. 制御ユニットの一例を示す構成図である。It is a block diagram which shows an example of a control unit. API(Application Programming Interface)コマンドの一例を示す図である。It is a figure which shows an example of API (Application Programming Interface) command. パーソナルコンピュータの一例を示す構成図である。It is a block diagram which shows an example of a personal computer. 制御プログラムの一例を示すフローチャートである。It is a flowchart which shows an example of a control program. スクリプト処理プログラムの一例を示すフローチャートである。It is a flowchart which shows an example of a script processing program. 起動処理の一例を示すシーケンス図である。It is a sequence diagram which shows an example of a starting process. キャリブレーション処理の一例を示すシーケンス図である。It is a sequence diagram which shows an example of a calibration process. 測定処理の一例を示すシーケンス図である。It is a sequence diagram which shows an example of a measurement process. 測定処理の比較例を示すシーケンス図である。It is a sequence diagram which shows the comparative example of a measurement process. 測定処理の他例を示すシーケンス図である。It is a sequence diagram which shows the other example of a measurement process. 制御システムの他例を示す構成図である。It is a block diagram which shows the other example of a control system. 制御システムの他例を示す構成図である。It is a block diagram which shows the other example of a control system.

図1は、制御システムの一例を示す構成図である。制御システムは、データ処理装置の一例であるパーソナルコンピュータ(PC: Personal Computer)3と、センサ装置4とを有する。センサ装置4は、制御装置の一例である制御ユニット1と、その制御対象装置の一例であるセンサユニット2とを有する。   FIG. 1 is a configuration diagram illustrating an example of a control system. The control system includes a personal computer (PC) 3 that is an example of a data processing device and a sensor device 4. The sensor device 4 includes a control unit 1 that is an example of a control device, and a sensor unit 2 that is an example of the control target device.

本例では、制御ユニット1の制御対象装置として、センサデバイス20が実装されたセンサユニット2を挙げるが、これに限定されず、他の用途の機器であってもよい。センサデバイス20としては、例えば温湿度計、気圧計、9軸加速度計などが挙げられるが、限定はない。   In this example, the sensor unit 2 on which the sensor device 20 is mounted is exemplified as the control target device of the control unit 1, but the present invention is not limited to this and may be a device for other purposes. Examples of the sensor device 20 include a temperature / humidity meter, a barometer, and a nine-axis accelerometer, but are not limited thereto.

PC3と制御ユニット1は、例えば無線LAN(Local Area Network)などにより無線通信を行うが、これに限定されず、LANケーブルなどを介した有線通信を行ってもよい。制御ユニット1は、例えばマイクロコンピュータであり、ケーブル9を介しセンサユニット2と接続されている。制御ユニット1とセンサユニット2の間では、例えばI2Cのインターフェースに従い、バスを介したデータの入出力が行われる。   The PC 3 and the control unit 1 perform wireless communication using, for example, a wireless local area network (LAN), but are not limited thereto, and may perform wired communication via a LAN cable or the like. The control unit 1 is, for example, a microcomputer, and is connected to the sensor unit 2 via a cable 9. Data input / output is performed between the control unit 1 and the sensor unit 2 via a bus, for example, in accordance with an I2C interface.

また、図1には、PC3及び制御ユニット1の動作の流れが示されている。PC3は、制御ユニット1に、センサデバイス20のデバイスドライバを記述したスクリプトを送信する(符号SQ1)。スクリプトを用いると、マイクロコンピュータの種類によらず、開発環境や特別なツールを必要とせずに、簡単にデバイスドライバを更新することができる。スクリプトは、ユーザがPC3により作成したものであってもよいし、他の装置により作成されてPC3に保存されたものであってもよい。   FIG. 1 shows the flow of operations of the PC 3 and the control unit 1. The PC 3 transmits a script describing the device driver of the sensor device 20 to the control unit 1 (reference SQ1). If a script is used, the device driver can be easily updated regardless of the type of microcomputer without requiring a development environment or special tools. The script may be created by the user using the PC 3, or may be created by another device and stored in the PC 3.

スクリプトは、符号dで示されるように、例えば、インデックス(#1,#2,#3,・・・)が付与されたコマンド列、書き込みデータ列、及び処理データ列から構成されている。インデックスは、一例として、時系列に従い増加する数字で表される。   As indicated by the symbol d, the script is composed of, for example, a command sequence to which indexes (# 1, # 2, # 3,...) Are assigned, a write data sequence, and a processing data sequence. As an example, the index is represented by a number that increases with time.

コマンド列には、インデックス単位のコマンドCMDが並んでいる。書き込みデータ列には、インデックス単位の書き込みデータW_DTが並び、処理データ列には、インデックス単位の処理データP_DTが並んでいる。   In the command string, commands CMD in index units are arranged. In the write data string, index-based write data W_DT is arranged, and in the process data string, index-unit processed data P_DT is arranged.

コマンドCMDは、制御ユニット1がセンサデバイス20に対し実行する処理を示す。書き込みデータW_DTタは、センサデバイス20に対して書き込まれるデータである。処理データP_DTは、センサデバイス20から読み出したデータを加工してフラグチェックするためのデータである。   The command CMD indicates processing executed by the control unit 1 for the sensor device 20. The write data W_DT data is data written to the sensor device 20. The processing data P_DT is data for processing the data read from the sensor device 20 and checking the flag.

コマンド列には、例えばセンサデバイス20にアクセスするコマンドCMDが含まれる。コマンド列で実行される処理としては、例えば、センサデバイス20に対するデータの書き込み及び読み出し、センサデバイス20からデータを読み出した後、加工してセンサデバイス20に書き込む処理(以下、「ReadModifyWrite処理」と表記)、及び待機処理などが挙げられる。   The command string includes a command CMD for accessing the sensor device 20, for example. As processing executed by the command sequence, for example, writing and reading data to and from the sensor device 20, reading data from the sensor device 20, processing the data, and writing it into the sensor device 20 (hereinafter referred to as "ReadModifyWrite processing") ) And standby processing.

ReadModifyWrite処理は、例えば、センサデバイス20の動作モードや測定レンジなどの設定変更に用いられる。また、待機処理は、センサデバイス20に測定の開始を指示した後、測定データが読み出し可能となるまで待つ場合に用いられる。待機処理には、センサデバイス20に応じた時間だけ待機したり、センサデバイス20の特定のフラグが立つまでフラグチェックを繰り返したり、データの読み出し要求に対する許可応答が得られるまでその要求を繰り返す処理が含まれる。すなわち、待機処理は、センサデバイス20の応答を待つコマンドCMDにより実現される。   The ReadModifyWrite process is used, for example, to change settings such as the operation mode and measurement range of the sensor device 20. The standby process is used when the sensor device 20 is instructed to start measurement and waits until measurement data can be read out. The waiting process includes a process of waiting for a time corresponding to the sensor device 20, repeating a flag check until a specific flag of the sensor device 20 is set, and repeating the request until a permission response to a data read request is obtained. included. That is, the standby process is realized by a command CMD that waits for a response from the sensor device 20.

上記の処理のため、様々なコマンドCMDが用いられる。例えば、センサデバイス20に対するデータの書き込み、読み出し、読み出したデータの加工及びフラグチェック、指定時間の待機、分岐処理、条件付き分岐処理、及びスクリプトの実行終了を示すコマンドCMDが用いられる。もっとも、上記以外でも、スクリプトの実行を効率化するコマンドCMDや、センサデバイス20の規格に関して必要なコマンドCMDが用いられてもよい。   Various commands CMD are used for the above processing. For example, the command CMD indicating the writing of data to the sensor device 20, reading, processing of the read data and flag check, waiting for a specified time, branch processing, conditional branch processing, and script execution end are used. However, in addition to the above, a command CMD that makes script execution more efficient, or a command CMD necessary for the standard of the sensor device 20 may be used.

制御ユニット1は、PC3からスクリプトを受信するとROMに格納する。制御ユニット1は、所定のイベントが発生すると、スクリプトを実行する(符号SQ2参照)。これにより、制御ユニット1とセンサデバイス20の間でデータが入出力される。   When receiving the script from the PC 3, the control unit 1 stores it in the ROM. When a predetermined event occurs, the control unit 1 executes a script (see symbol SQ2). Thereby, data is input and output between the control unit 1 and the sensor device 20.

制御ユニット1は、スクリプトの実行結果として、センサデバイス20から測定データを取得し(符号SQ3)、PC3に送信する(符号SQ4)。PC3は、制御ユニット1から測定データを受信すると、測定データの換算や補正などのデータ処理を行う(符号SQ5)。PC3は、その処理済みデータを、所定のアプリケーションを用いてディスプレイなどに表示したり、解析したりする(符号SQ6)。なお、本例において、制御ユニット1へのスクリプトの送信と測定データのデータ処理は同一のPC3で行われるが、別々のPC3で行われてもよい。また、PC3に代えて、スマートフォンや、後述するようにサーバが用いられてもよい。   The control unit 1 acquires measurement data from the sensor device 20 as a script execution result (reference SQ3) and transmits it to the PC 3 (reference SQ4). When receiving measurement data from the control unit 1, the PC 3 performs data processing such as conversion and correction of the measurement data (reference SQ5). The PC 3 displays or analyzes the processed data on a display or the like using a predetermined application (reference SQ6). In this example, the transmission of the script to the control unit 1 and the data processing of the measurement data are performed by the same PC 3, but may be performed by different PCs 3. Moreover, it replaces with PC3 and a smart phone and a server may be used so that it may mention later.

このように、制御ユニット1は、センサデバイス20にアクセスするコマンドを含むスクリプトを記憶して実行し、その実行結果として測定データをPC3に送信する。PC3は、測定データの換算や補正などのデータ処理を行う。   As described above, the control unit 1 stores and executes a script including a command for accessing the sensor device 20, and transmits measurement data to the PC 3 as the execution result. The PC 3 performs data processing such as measurement data conversion and correction.

したがって、制御ユニット1は、測定データのデータ処理を行う必要がないため、スクリプトにより実行する制御処理が限定され、スクリプトが単純化される。したがって、制御ユニット1は、制御処理の負荷が低減される。   Therefore, since the control unit 1 does not need to perform data processing of measurement data, the control processing executed by the script is limited, and the script is simplified. Therefore, the control unit 1 reduces the load of control processing.

また、PC3は、制御ユニット1から測定データを受信してデータ処理を行うが、センサデバイス20へのアクセスは、スクリプトを実行する制御ユニット1により行われる。このため、PC3は、センサデバイス20に対するデータの書き込み及び読み出しのコマンドを制御ユニット1に送信する必要が無いため、コマンド送信を行う場合と比較すると、PC3と制御ユニット1の間の通信の頻度が低減される。したがって、制御ユニット1は、PC3との通信処理の負荷が低減される。   The PC 3 receives measurement data from the control unit 1 and performs data processing. Access to the sensor device 20 is performed by the control unit 1 that executes a script. For this reason, since it is not necessary for the PC 3 to transmit data write and read commands to the sensor device 20 to the control unit 1, the frequency of communication between the PC 3 and the control unit 1 is lower than when command transmission is performed. Reduced. Therefore, the control unit 1 reduces the load of communication processing with the PC 3.

さらに、スクリプトには、上述したように、待機処理のコマンドやReadModifyWrite処理のコマンドを含まれるため、制御ユニット1は、PC3との通信処理の負荷が効果的に低減される。   Further, as described above, since the script includes a standby process command and a ReadModifyWrite process command, the control unit 1 can effectively reduce the load of the communication process with the PC 3.

図2は、制御ユニット1の一例を示す構成図である。制御ユニット1は、CPU(Central Processing Unit)10、ROM(Read Only Memory)11、RAM(Random Access Memory)12、通信モジュール14、及びハードウェアインターフェース(ハードウェアINF)部15を有する。CPU10は、互いに信号の入出力ができるように、ROM11、RAM12、通信モジュール14、及びハードウェアINF部15と、バス19を介して接続されている。   FIG. 2 is a configuration diagram illustrating an example of the control unit 1. The control unit 1 includes a central processing unit (CPU) 10, a read only memory (ROM) 11, a random access memory (RAM) 12, a communication module 14, and a hardware interface (hardware INF) unit 15. The CPU 10 is connected to the ROM 11, the RAM 12, the communication module 14, and the hardware INF unit 15 via the bus 19 so that signals can be input and output with each other.

通信モジュール14は、例えば無線LANカードであり、PC3とリンクして無線通信を行う。ハードウェアINF部15は、ケーブルを介してセンサデバイス20と接続され、センサデバイス20との間でデータの入出力を行う。   The communication module 14 is a wireless LAN card, for example, and performs wireless communication by linking with the PC 3. The hardware INF unit 15 is connected to the sensor device 20 via a cable and inputs / outputs data to / from the sensor device 20.

ROM11は、CPU10を駆動するプログラムが格納されている。RAM12は、CPU10のワーキングメモリとして機能する。   The ROM 11 stores a program for driving the CPU 10. The RAM 12 functions as a working memory for the CPU 10.

ROM11は、記憶部の一例であり、制御プログラム110、スクリプト処理プログラム111、通信ドライバ112、及びスクリプト113を記憶する。制御プログラム110、スクリプト処理プログラム111、及び通信ドライバ112は、センサデバイス20の制御方法を実行する制御プログラムの一例である。   The ROM 11 is an example of a storage unit, and stores a control program 110, a script processing program 111, a communication driver 112, and a script 113. The control program 110, the script processing program 111, and the communication driver 112 are an example of a control program that executes a control method of the sensor device 20.

制御プログラム110は、制御ユニット1の動作を制御するものである。スクリプト処理プログラム111は、ROM11内のスクリプト113をバイナリー形式のコードに解釈して処理するものである。通信ドライバ112は、通信モジュール14による通信を制御するものである。スクリプト113は、PC3から送信されたものである。   The control program 110 controls the operation of the control unit 1. The script processing program 111 interprets and processes the script 113 in the ROM 11 into a binary code. The communication driver 112 controls communication by the communication module 14. The script 113 is transmitted from the PC 3.

CPU10は、ROM11からプログラムを読み込むと、機能として、通信処理部100、スクリプト処理部102、及び制御部103が形成される。通信処理部100はROM11内の通信ドライバ112に対応し、スクリプト処理部102はROM11内のスクリプト処理プログラム111に対応する。また、制御部103はROM11内の制御プログラム110に対応する。スクリプト処理部102及び通信処理部100は、制御部103の制御下で動作する。   When the CPU 10 reads the program from the ROM 11, the communication processing unit 100, the script processing unit 102, and the control unit 103 are formed as functions. The communication processing unit 100 corresponds to the communication driver 112 in the ROM 11, and the script processing unit 102 corresponds to the script processing program 111 in the ROM 11. The control unit 103 corresponds to the control program 110 in the ROM 11. The script processing unit 102 and the communication processing unit 100 operate under the control of the control unit 103.

通信処理部100は、PC3から通信モジュール14を介してスクリプト113を受信すると、制御部103に転送する。制御部103は、スクリプト113をROM11に格納する。ROM11内のスクリプト113は、その種類に応じた領域に格納される。   When receiving the script 113 from the PC 3 via the communication module 14, the communication processing unit 100 transfers the script 113 to the control unit 103. The control unit 103 stores the script 113 in the ROM 11. The script 113 in the ROM 11 is stored in an area corresponding to the type.

符号113aは、ROM11内のスクリプト113の格納領域の構成を示す。スクリプト113の格納領域は、初期化スクリプトが格納される初期化スクリプト格納領域、センシングスクリプトが格納される格納領域、及び任意実行スクリプトが格納される任意実行スクリプト格納領域に分かれる。各格納領域には、図1に示されたコマンドCMD、書き込みデータW_DT、及び処理データP_DTの組が書き込まれている。   Reference numeral 113 a indicates the configuration of the storage area of the script 113 in the ROM 11. The storage area of the script 113 is divided into an initialization script storage area in which an initialization script is stored, a storage area in which a sensing script is stored, and an arbitrary execution script storage area in which an arbitrary execution script is stored. In each storage area, a set of the command CMD, the write data W_DT, and the process data P_DT shown in FIG. 1 is written.

初期化スクリプトは、センサ装置4の起動時にセンサデバイス20の初期設定などを実行するものである。初期化スクリプト格納領域の先頭は、一例として、ROM11内のオフセットアドレス+0xAAに設定されている。このため、スクリプト処理部102は、初期化スクリプトを実行するとき、オフセットアドレス+0xAAからスクリプト113の読み出しを開始する。   The initialization script executes initial setting of the sensor device 20 when the sensor device 4 is activated. As an example, the start of the initialization script storage area is set to offset address + 0xAA in the ROM 11. Therefore, when executing the initialization script, the script processing unit 102 starts reading the script 113 from the offset address + 0xAA.

センシングスクリプトは、センサデバイス20に測定を指示し、センサデバイス20から測定データを取得するものである。センシングスクリプト格納領域の先頭は、一例として、ROM11内のオフセットアドレス+0xBBに設定されている。このため、スクリプト処理部102は、センシングスクリプトを実行するとき、オフセットアドレス+0xBBからスクリプト113の読み出しを開始する。   The sensing script instructs the sensor device 20 to perform measurement, and acquires measurement data from the sensor device 20. As an example, the top of the sensing script storage area is set to offset address + 0xBB in the ROM 11. Therefore, the script processing unit 102 starts reading the script 113 from the offset address + 0xBB when executing the sensing script.

任意実行スクリプトは、PC3からの指示に基づき任意のタイミングで実行されるものである。任意実行スクリプトにより実行される処理としては、例えば、センサデバイス20の固有の補正情報を取得するキャリブレーション処理が挙げられるが、これに限定されない。任意実行スクリプトにより実行される処理は複数種類があってもよく、この場合、ROM11内の格納領域は個別に設けられる。   The arbitrary execution script is executed at an arbitrary timing based on an instruction from the PC 3. Examples of the process executed by the arbitrary execution script include a calibration process for acquiring correction information unique to the sensor device 20, but the process is not limited to this. There may be a plurality of types of processing executed by the arbitrary execution script. In this case, the storage area in the ROM 11 is provided individually.

任意実行スクリプト格納領域の先頭は、一例として、ROM11内のオフセットアドレス+0xCCに設定されている。このため、スクリプト処理部102は、任意実行スクリプトを実行するとき、オフセットアドレス+0xCCからスクリプト113の読み出しを開始する。   As an example, the head of the arbitrary execution script storage area is set to offset address + 0xCC in the ROM 11. Therefore, the script processing unit 102 starts reading the script 113 from the offset address + 0xCC when executing the arbitrary execution script.

このように、スクリプト113は、その用途に応じた種類ごとにROM11内の格納領域に格納される。このため、PC3は、スクリプト113を送信する場合、制御ユニット1に対しAPI経由でスクリプト113の種類を指定する。   Thus, the script 113 is stored in the storage area in the ROM 11 for each type according to its use. Therefore, when transmitting the script 113, the PC 3 designates the type of the script 113 via the API to the control unit 1.

図3には、APIコマンドの一例が示されている。APIコマンドの「SendScript」は、PC3から制御ユニット1にスクリプト113を送信するものである。「SendScript」の引数には、カテゴリ、タイプ、サイズ、及びデータが含まれる。   FIG. 3 shows an example of the API command. The API command “SendScript” is used to transmit the script 113 from the PC 3 to the control unit 1. The arguments of “SendScript” include category, type, size, and data.

カテゴリは、初期化スクリプト、センシングスクリプト、及び任意実行スクリプトのうち、送信対象のスクリプト113の種類を指定する。なお、任意実行スクリプトは、1種類に限定されず、複数種類があってもよい。タイプは、コマンドCMD、書き込みデータW_DT、及び処理データP_DTのうち、送信対象のものを指定する。サイズはデータのサイズを示し、データはコマンドCMD、書き込みデータW_DT、及び処理データP_DTの何れかである。   The category specifies the type of the script 113 to be transmitted among the initialization script, the sensing script, and the arbitrary execution script. The arbitrary execution script is not limited to one type, and there may be a plurality of types. The type specifies a transmission target among the command CMD, the write data W_DT, and the processing data P_DT. The size indicates the size of the data, and the data is any one of command CMD, write data W_DT, and processing data P_DT.

なお、APIコマンドの「RunScript」は、任意実行スクリプトの実行を指示するものである。複数種類の任意実行スクリプトが存在する場合、識別情報により実行対象の任意実行スクリプトの種類を指定することができる。   The API command “RunScript” instructs execution of an arbitrary execution script. When there are a plurality of types of arbitrary execution scripts, the type of arbitrary execution script to be executed can be specified by the identification information.

再び図2を参照すると、制御部103は、PC3から受信したスクリプト113の種類をAPIコマンドにより識別し、その種類に応じたROM11内の格納領域にスクリプト113を格納する。制御部103は、スクリプト113を実行するイベントを検出すると、スクリプト処理部102に実行対象のスクリプト113の実行を指示する。   Referring to FIG. 2 again, the control unit 103 identifies the type of the script 113 received from the PC 3 by the API command, and stores the script 113 in a storage area in the ROM 11 corresponding to the type. When detecting an event for executing the script 113, the control unit 103 instructs the script processing unit 102 to execute the script 113 to be executed.

スクリプト処理部102は、スクリプト113の実行の指示を受けると、ROM11内の該当する格納領域からスクリプト113を読み出し、バイナリー形式のコードに解釈して実行する。スクリプト処理部102は、センシングスクリプトの場合、ハードウェアINF部15を介してセンサデバイス20に対しデータの書き込み及び読み出しを行う。また、センシングスクリプトには、単なる読み書きのコマンドだけではなく、上述したように、待機処理のコマンド及びReadModifyWrite処理のコマンドも含まれる。   When the script processing unit 102 receives an instruction to execute the script 113, the script processing unit 102 reads the script 113 from the corresponding storage area in the ROM 11, interprets it as a binary code, and executes it. In the case of a sensing script, the script processing unit 102 writes and reads data to and from the sensor device 20 via the hardware INF unit 15. The sensing script includes not only a read / write command but also a standby process command and a ReadModifyWrite process command as described above.

スクリプト処理部102は、センシングスクリプトを実行すると、その実行結果として、センサデバイス20からハードウェアINF部15を介して測定データが入力される。スクリプト処理部102は、センサデバイス20から読み出した測定データなどのデータを格納するための読み込みバッファ120をRAM12内に確保する。   When the script processing unit 102 executes the sensing script, measurement data is input from the sensor device 20 via the hardware INF unit 15 as the execution result. The script processing unit 102 secures a reading buffer 120 in the RAM 12 for storing data such as measurement data read from the sensor device 20.

スクリプト処理部102が、スクリプトの終了を示す終了コマンドを実行すると、制御部103は、読み込みバッファ120に格納されたデータを読み出し、通信処理部100に出力する。通信処理部100は、通信モジュール14を介してデータをPC3に送信する。   When the script processing unit 102 executes an end command indicating the end of the script, the control unit 103 reads the data stored in the read buffer 120 and outputs the data to the communication processing unit 100. The communication processing unit 100 transmits data to the PC 3 via the communication module 14.

なお、読み込みバッファ120のサイズは、スクリプト処理部102が必要分を算出してスクリプト情報に追加することで設定してもよいし、制御部103が予め規定された最大容量分をRAM12に確保してもよい。最大容量分の読み込みバッファ120を確保する場合、制御部103は、最大容量を超えるデータが読み出されたとき、スクリプト113の実行を停止するか、あるいはデータの読み捨てを行う。   Note that the size of the read buffer 120 may be set by the script processing unit 102 calculating the necessary amount and adding it to the script information, or the control unit 103 reserves a predetermined maximum capacity in the RAM 12. May be. When securing the read buffer 120 for the maximum capacity, the control unit 103 stops the execution of the script 113 or discards the data when data exceeding the maximum capacity is read.

また、制御部103は、RAM12内にワークエリア121、インデックスデータ領域122、及び補助データ領域123を確保する。ワークエリア121は、スクリプト113の実行時にワーク領域であり、インデックスデータ領域122は、コマンドのインデックスを示すデータの格納領域であり、補助データ領域123は、コマンド実行時の補助的なデータの格納領域である。   In addition, the control unit 103 secures a work area 121, an index data area 122, and an auxiliary data area 123 in the RAM 12. The work area 121 is a work area when the script 113 is executed, the index data area 122 is a data storage area indicating a command index, and the auxiliary data area 123 is an auxiliary data storage area when executing the command. It is.

センサデバイス20により測定を行う場合、制御部103は、スクリプト処理部102によりセンシングスクリプトを実行し、その実行結果として測定データを読み込みバッファ120から取得する。通信処理部100は、送信部の一例であり、測定データをPC3に送信する。   When the measurement is performed by the sensor device 20, the control unit 103 executes the sensing script by the script processing unit 102, and reads the measurement data as the execution result and acquires it from the buffer 120. The communication processing unit 100 is an example of a transmission unit, and transmits measurement data to the PC 3.

PC3は、上述したように、測定データのデータ処理を行うため、制御ユニット1には、データ処理を実行するスクリプトを用意する必要がない。   As described above, since the PC 3 performs data processing of measurement data, the control unit 1 does not need to prepare a script for executing data processing.

図4は、PC3の一例を示す構成図である。PC3は、CPU30、ROM31、RAM32、HDD(Hard Disk Drive)33、通信モジュール34、入力装置35、及び出力装置36を有する。CPU30は、互いに信号の入出力ができるように、ROM31、RAM32、HDD33、通信モジュール34、入力装置35、及び出力装置36と、バス39を介して接続されている。   FIG. 4 is a configuration diagram illustrating an example of the PC 3. The PC 3 includes a CPU 30, a ROM 31, a RAM 32, an HDD (Hard Disk Drive) 33, a communication module 34, an input device 35, and an output device 36. The CPU 30 is connected to a ROM 31, a RAM 32, an HDD 33, a communication module 34, an input device 35, and an output device 36 via a bus 39 so that signals can be input and output with each other.

ROM31は、CPU30を駆動するプログラムが格納されている。プログラムには、PC3を動作させるOS(Operating System)に加えて、センサ装置4の測定データのデータ処理を行うデータ処理方法を実行するデータ処理プログラムが含まれる。RAM32は、CPU30のワーキングメモリとして機能する。通信モジュール34は、例えば無線LANカードであり、制御ユニット1とリンクして無線通信を行う。   The ROM 31 stores a program that drives the CPU 30. The program includes a data processing program for executing a data processing method for performing data processing of measurement data of the sensor device 4 in addition to an OS (Operating System) for operating the PC 3. The RAM 32 functions as a working memory for the CPU 30. The communication module 34 is a wireless LAN card, for example, and performs wireless communication by linking with the control unit 1.

入力装置35は、PC3に情報を入力する装置である。入力装置35としては、例えばキーボード、マウス、及びタッチパネルなどが挙げられる。入力装置35は、入力された情報を、バス39を介しCPU30に出力する。   The input device 35 is a device that inputs information to the PC 3. Examples of the input device 35 include a keyboard, a mouse, and a touch panel. The input device 35 outputs the input information to the CPU 30 via the bus 39.

出力装置36は、PC3の情報を出力する装置である。出力装置36としては、例えばディスプレイ、タッチパネル、及びプリンタなどが挙げられる。出力装置36は、CPU30からバス39を介して情報を取得して出力する。   The output device 36 is a device that outputs information of the PC 3. Examples of the output device 36 include a display, a touch panel, and a printer. The output device 36 acquires information from the CPU 30 via the bus 39 and outputs the information.

CPU30は、ROM31からプログラムを読み込むと、機能として、管理部300、通信処理部301、データ処理部302、及びアプリケーション(APL)部303が形成される。また、HDD33には、スクリプト330、キャリブレーションデータ331、及び測定データ332が格納される。   When the CPU 30 reads the program from the ROM 31, a management unit 300, a communication processing unit 301, a data processing unit 302, and an application (APL) unit 303 are formed as functions. The HDD 33 stores a script 330, calibration data 331, and measurement data 332.

管理部300はセンサ装置4を管理する。通信処理部301、データ処理部302、及びAPL部303は、管理部300の制御下において動作する。   The management unit 300 manages the sensor device 4. The communication processing unit 301, the data processing unit 302, and the APL unit 303 operate under the control of the management unit 300.

通信処理部301は、通信モジュール34を制御する。通信処理部301は、管理部300の指示に従いセンサ装置4の制御ユニット1に対する通信を行う。   The communication processing unit 301 controls the communication module 34. The communication processing unit 301 performs communication with the control unit 1 of the sensor device 4 in accordance with an instruction from the management unit 300.

管理部300は、スクリプトの実行に先立ち、HDD33に格納されたスクリプト330を読み出し制御ユニット1に送信する。このとき、通信処理部301は、送信部の一例として、例えば、スクリプト330を、通信モジュール34を介し制御ユニット1に送信する。スクリプト330の送信は、例えば、図3に示された「SendScript」のようなAPIコマンドにより行われる。   Prior to execution of the script, the management unit 300 reads the script 330 stored in the HDD 33 and transmits it to the control unit 1. At this time, the communication processing unit 301 transmits, for example, a script 330 to the control unit 1 via the communication module 34 as an example of a transmission unit. The transmission of the script 330 is performed by an API command such as “SendScript” shown in FIG.

管理部300は制御ユニット1に対し各種のスクリプトの実行を指示する。実行指示は、例えば、図3に示された「RunScript」のようなAPIコマンドにより行われる。   The management unit 300 instructs the control unit 1 to execute various scripts. The execution instruction is issued by an API command such as “RunScript” shown in FIG.

より具体的には、管理部300は、任意実行スクリプト及びセンシングスクリプトの実行を指示する。なお、初期化スクリプトの実行は、管理部300の指示とは無関係に制御ユニット1の起動時に実行される。   More specifically, the management unit 300 instructs execution of an arbitrary execution script and a sensing script. Note that the initialization script is executed when the control unit 1 is started, regardless of the instruction of the management unit 300.

任意実行スクリプトは、例えばキャリブレーション処理に用いられる。管理部300は、キャリブレーション処理の任意実行スクリプトの実行を指示した場合、実行結果として、制御ユニット1からキャリブレーションデータ331を取得する。キャリブレーションデータ331には、センサデバイス20の補正係数などが含まれる。管理部300は、取得したキャリブレーションデータ331をHDD33に格納する。 The arbitrary execution script is used for calibration processing, for example. When the management unit 300 instructs execution of an arbitrary execution script for calibration processing, the management unit 300 acquires calibration data 331 from the control unit 1 as an execution result. The calibration data 331 includes a correction coefficient of the sensor device 20 and the like. Management unit 300 store the calibration data 331 acquired in HDD 33.

管理部300は、任意実行スクリプトの実行後、センシングスクリプトの実行を指示する。これにより、管理部300は、センシングスクリプトの実行結果として、制御ユニット1から測定データ332を取得してHDD33に格納する。このとき、通信処理部301は、受信部の一例として、通信モジュール34を介し制御ユニット1から測定データ332を受信する。管理部300は、データ処理部302に測定データの処理を指示する。   The management unit 300 instructs execution of the sensing script after execution of the arbitrary execution script. Thereby, the management unit 300 acquires the measurement data 332 from the control unit 1 and stores it in the HDD 33 as the execution result of the sensing script. At this time, the communication processing unit 301 receives the measurement data 332 from the control unit 1 via the communication module 34 as an example of a receiving unit. The management unit 300 instructs the data processing unit 302 to process measurement data.

データ処理部302は、管理部300の指示に従い、HDD33から測定データ332を読み出して処理する。データ処理としては、例えば測定データ332の換算処理や補正処理が挙げられるが、これに限定されない。データ処理部302は、例えば、HDD33に格納されたキャリブレーションデータ331に基づきデータ処理を行う。管理部300は、測定データ332のデータ処理の完了後、APL部303に処理を指示する。   The data processing unit 302 reads the measurement data 332 from the HDD 33 and processes it according to the instruction of the management unit 300. Examples of data processing include, but are not limited to, conversion processing and correction processing of measurement data 332. For example, the data processing unit 302 performs data processing based on calibration data 331 stored in the HDD 33. After completing the data processing of the measurement data 332, the management unit 300 instructs the APL unit 303 to perform the processing.

APL部303は、データ処理部302によりデータ処理された測定データ332の解析や表示を行う。APL部303は、測定データ332の表示を行う場合、測定データ332を所定の形式で出力装置36に出力する。   The APL unit 303 analyzes and displays the measurement data 332 data processed by the data processing unit 302. When displaying the measurement data 332, the APL unit 303 outputs the measurement data 332 to the output device 36 in a predetermined format.

このように、データ処理部302は、制御ユニット1から受信した測定データ332のデータ処理を行う。このため、制御ユニット1は、測定データのデータ処理の負荷が省かれる。また、PC3は、センサデバイス20に対するアクセス、つまりデータの書き込み及び読み出しのコマンドの実行を個別に制御ユニット1に指示することはないので、PC3と制御ユニット1の間の通信処理の負荷が軽減される。これにより、PC3と制御ユニット1の間において、通信の輻輳、処理の遅延、及び消費電力の増加などが防止される。   As described above, the data processing unit 302 performs data processing on the measurement data 332 received from the control unit 1. For this reason, the control unit 1 saves the data processing load of the measurement data. Further, since the PC 3 does not individually instruct the control unit 1 to access the sensor device 20, that is, to execute data write and read commands, the load of communication processing between the PC 3 and the control unit 1 is reduced. The This prevents communication congestion, processing delay, increase in power consumption, and the like between the PC 3 and the control unit 1.

また、PC3は、データ処理だけでなく、制御ユニット1にスクリプト330を送信する。このため、データ処理用のPC3とは別に、スクリプト330を送信するための機器を設ける必要がなくなり、制御システムの規模を低減することができる。   Further, the PC 3 transmits a script 330 to the control unit 1 as well as data processing. For this reason, it is not necessary to provide a device for transmitting the script 330 separately from the PC 3 for data processing, and the scale of the control system can be reduced.

図5は、制御プログラム110の一例を示すフローチャートである。制御プログラム110は、制御ユニット1の起動時に実行される。   FIG. 5 is a flowchart illustrating an example of the control program 110. The control program 110 is executed when the control unit 1 is activated.

制御部103は、通信モジュール14を初期化する(ステップSt1)。次に、制御部103は、ROM11内のオフセットアドレス+0xAAを参照して、初期化スクリプトが格納済みであるか否かを判定する(ステップSt2)。制御部103は、初期化スクリプトが格納済みである場合(ステップSt2のYes)、初期化スクリプトを実行する(ステップSt3)。制御部103は、初期化スクリプトが未格納である場合(ステップSt2のNo)、次のステップSt4の処理が実行される。   The control unit 103 initializes the communication module 14 (step St1). Next, the control unit 103 refers to the offset address + 0xAA in the ROM 11 and determines whether or not the initialization script has been stored (step St2). When the initialization script has been stored (Yes in step St2), the control unit 103 executes the initialization script (step St3). When the initialization script is not stored (No in step St2), the control unit 103 executes the process in the next step St4.

次に、制御部103は、通信モジュール14によりPC3との接続を行う(ステップSt4)。次に、制御部103は、PC3からスクリプトを受信したか否かを判定する(ステップSt5)。制御部103は、スクリプトを受信した場合(ステップSt5のYes)、スクリプトをROM11に格納する(ステップSt10)。スクリプトが未受信である場合(ステップSt5のNo)、次にステップSt6の処理が実行される。   Next, the control unit 103 connects to the PC 3 through the communication module 14 (step St4). Next, the control unit 103 determines whether a script is received from the PC 3 (step St5). When the control unit 103 receives the script (Yes in step St5), the control unit 103 stores the script in the ROM 11 (step St10). If the script has not been received (No in step St5), the process in step St6 is executed next.

次に、制御部103は、イベントの発生に備えて待機処理を実行する(ステップSt6)。イベントとは、例えば、PC3からのセンシングスクリプトまたは任意実行スクリプトの実行指示、あるいはスクリプトの受信である。また、センシングスクリプトについては、制御ユニット1が周期的に自発的に実行イベントを発生させてもよい。   Next, the control unit 103 executes standby processing in preparation for the occurrence of an event (step St6). The event is, for example, a sensing script or arbitrary execution script execution instruction from the PC 3 or a script reception. For the sensing script, the control unit 1 may periodically and spontaneously generate an execution event.

制御部103は、センシングスクリプトの実行指示の受信、つまりセンシングイベントが発生した場合(ステップSt7のYes)、ROM11内のオフセットアドレス+0xBBを参照して、センシングスクリプトが格納済みであるか否かを判定する(ステップSt8)。制御部103は、センシングスクリプトが格納済みである場合(ステップSt8のYes)、センシングスクリプトを実行する(ステップSt9)。制御部103は、センシングスクリプトが未格納である場合(ステップSt8のNo)、再度ステップSt5の処理が実行される。   When receiving the sensing script execution instruction, that is, when a sensing event occurs (Yes in step St7), the control unit 103 refers to the offset address + 0xBB in the ROM 11 to determine whether or not the sensing script has been stored. (Step St8). When the sensing script has been stored (Yes in step St8), the control unit 103 executes the sensing script (step St9). When the sensing script is not stored (No in step St8), the control unit 103 executes the process in step St5 again.

また、センシングイベントが未発生である場合(ステップSt7のNo)、制御部103は、任意実行イベントの発生の有無を判定する(ステップSt11)。任意実行イベントとは、例えば、PC3からキャリブレーション処理の任意実行スクリプトの実行指示である。任意実行イベントが未発生である場合(ステップSt11のNo)、再度ステップSt5の処理が実行される。   If no sensing event has occurred (No in step St7), the control unit 103 determines whether or not an arbitrary execution event has occurred (step St11). The arbitrary execution event is, for example, an instruction to execute an arbitrary execution script for calibration processing from the PC 3. If an arbitrary execution event has not occurred (No in step St11), the process in step St5 is executed again.

制御部103は、任意実行イベントが発生した場合(ステップSt11のYes)、ROM11内のオフセットアドレス+0xCCを参照して、任意実行スクリプトが格納済みであるか否かを判定する(ステップSt12)。制御部103は、任意実行スクリプトが格納済みである場合(ステップSt12のYes)、任意実行スクリプトを実行する(ステップSt13)。その後、再度ステップSt5の処理が実行される。制御部103は、任意実行スクリプトが未格納である場合(ステップSt12のNo)、再度ステップSt5の処理が実行される。このようにして、制御プログラム110は動作する。   When the arbitrary execution event occurs (Yes in step St11), the control unit 103 refers to the offset address + 0xCC in the ROM 11 and determines whether the arbitrary execution script has been stored (step St12). When the arbitrary execution script has been stored (Yes in step St12), the control unit 103 executes the arbitrary execution script (step St13). Thereafter, the process of step St5 is executed again. When the arbitrary execution script is not stored (No in Step St12), the control unit 103 executes the process in Step St5 again. In this way, the control program 110 operates.

図6は、スクリプト処理プログラム111の一例を示すフローチャートである。スクリプト処理プログラム111は、起動時の初期化、または上記のイベントの発生時に実行される。   FIG. 6 is a flowchart illustrating an example of the script processing program 111. The script processing program 111 is executed at the time of startup or when the above event occurs.

スクリプト処理部102は、変数i(=0,1,2,・・・)を0にセットする(ステップSt21)。次に、スクリプト処理部102は、該当するスクリプトのインデックス#iのコマンドCMDを取得する(ステップSt22)。次に、スクリプト処理部102は、取得したコマンドCMDが終了コマンドであるか否かを判定する(ステップSt23)。スクリプト処理部102は、取得したコマンドCMDが終了コマンドである場合(ステップSt23のYes)、処理を終了する。   The script processing unit 102 sets the variable i (= 0, 1, 2,...) To 0 (step St21). Next, the script processing unit 102 acquires the command CMD of the corresponding script index #i (step St22). Next, the script processing unit 102 determines whether or not the acquired command CMD is an end command (step St23). If the acquired command CMD is an end command (Yes in step St23), the script processing unit 102 ends the process.

スクリプト処理部102は、取得したコマンドCMDが終了コマンドではない場合(ステップSt23のNo)、コマンドCMDを実行する(ステップSt24)。次に、スクリプト処理部102は、取得したコマンドCMDが分岐コマンドであるか否かを判定する(ステップSt25)。   If the acquired command CMD is not an end command (No in step St23), the script processing unit 102 executes the command CMD (step St24). Next, the script processing unit 102 determines whether or not the acquired command CMD is a branch command (step St25).

スクリプト処理部102は、取得したコマンドCMDが分岐コマンドである場合(ステップSt25のYes)、変数iに1を加算する(ステップSt26)。その後、再度ステップSt22の処理が実行される。   If the acquired command CMD is a branch command (Yes in step St25), the script processing unit 102 adds 1 to the variable i (step St26). Thereafter, the process of step St22 is executed again.

スクリプト処理部102は、取得したコマンドCMDが分岐コマンドではない場合(ステップSt25のNo)、再度ステップSt22の処理を実行する。このようにして、スクリプト処理プログラム111は実行される。   If the acquired command CMD is not a branch command (No in step St25), the script processing unit 102 executes the process in step St22 again. In this way, the script processing program 111 is executed.

図7は、起動処理の一例を示すシーケンス図である。まず、PC3が起動し(符号SQ101)、制御ユニット1が起動する(符号SQ201)。このとき、制御ユニット1は、ROM11にスクリプトが格納されていないため、初期化スクリプトを実行することができない。次に、PC3と制御ユニット1は、各々の通信モジュール14,34により接続される。   FIG. 7 is a sequence diagram illustrating an example of the startup process. First, the PC 3 is activated (reference SQ101), and the control unit 1 is activated (reference SQ201). At this time, since the script is not stored in the ROM 11, the control unit 1 cannot execute the initialization script. Next, the PC 3 and the control unit 1 are connected by the respective communication modules 14 and 34.

次に、PC3の管理部300は、HDD33に格納されたスクリプトを読み出して、通信処理部301により制御ユニット1に送信する(符号SQ102)。制御ユニット1は、スクリプトを受信してROM11に格納する(符号SQ202)。このとき、制御ユニット1は、「SendScript」コマンドの引数「カテゴリ」からスクリプトの種類を識別し、スクリプトの種類に応じたROM11内の格納領域にスクリプトを格納する。   Next, the management unit 300 of the PC 3 reads the script stored in the HDD 33 and transmits it to the control unit 1 by the communication processing unit 301 (reference SQ102). The control unit 1 receives the script and stores it in the ROM 11 (reference SQ202). At this time, the control unit 1 identifies the script type from the argument “category” of the “SendScript” command, and stores the script in the storage area in the ROM 11 according to the script type.

次に、PC3は、制御ユニット1に再起動を指示する(符号SQ103)。制御ユニット1は、再起動の指示を受けて再起動する(符号SQ203)。   Next, the PC 3 instructs the control unit 1 to restart (reference SQ103). The control unit 1 is restarted in response to the restart instruction (reference SQ203).

次に、制御ユニット1の制御部103は、スクリプト処理部102により初期化スクリプトを実行する(符号SQ204)。なお、センサ装置4にセンサデバイス20が複数設けられている場合でも、1つの初期化スクリプトにより複数のセンサデバイス20を初期化する。初期化スクリプトは、制御ユニット1の起動時に自動的に実行される。   Next, the control unit 103 of the control unit 1 executes an initialization script by the script processing unit 102 (reference SQ204). Even when a plurality of sensor devices 20 are provided in the sensor device 4, the plurality of sensor devices 20 are initialized by one initialization script. The initialization script is automatically executed when the control unit 1 is activated.

スクリプト処理部102は、センサデバイス20に対し読み出しコマンドを発行する(符号SC1)。センサデバイス20は、読み出しコマンドに応じてデータを読み出す(符号SQ301)。スクリプト処理部102は、制御ユニット1から入力されたデータを取得する(符号SC2)。次に、スクリプト処理部102は、読み出したデータの内容(例えばフラグ設定)を変更する(符号SC3)。   The script processing unit 102 issues a read command to the sensor device 20 (reference numeral SC1). The sensor device 20 reads data in response to the read command (reference SQ301). The script processing unit 102 acquires data input from the control unit 1 (reference numeral SC2). Next, the script processing unit 102 changes the content (for example, flag setting) of the read data (reference SC3).

次に、スクリプト処理部102は、センサデバイス20に対し書き込みコマンドを発行する(符号SC4)。次に、スクリプト処理部102は、変更したデータをセンサデバイス20に出力する(符号SC5)。センサデバイス20は、スクリプト処理部102から入力されたデータの書き込みを行う(符号SQ302)。次に、スクリプト処理部102は、終了コマンドを発行する(符号SC6)。   Next, the script processing unit 102 issues a write command to the sensor device 20 (reference numeral SC4). Next, the script processing unit 102 outputs the changed data to the sensor device 20 (reference SC5). The sensor device 20 writes data input from the script processing unit 102 (reference SQ302). Next, the script processing unit 102 issues an end command (reference SC6).

制御ユニット1は、初期化スクリプトの実行後、PC3と接続する。このようにして、起動処理は実行される。   The control unit 1 connects to the PC 3 after executing the initialization script. In this way, the startup process is executed.

図8は、キャリブレーション処理の一例を示すシーケンス図である。PC3の管理部300は、起動処理の実行後、制御ユニット1に対しキャリブレーション処理を指示する(符号SQ111)。センサデバイス20は、出荷時のキャリブレーションの結果から得られた補正係数が書き込まれている。このため、PC3は、測定データの補正処理のために、補正係数を予め取得する。   FIG. 8 is a sequence diagram illustrating an example of the calibration process. After executing the startup process, the management unit 300 of the PC 3 instructs the control unit 1 to perform a calibration process (reference SQ111). In the sensor device 20, a correction coefficient obtained from a calibration result at the time of shipment is written. For this reason, the PC 3 acquires a correction coefficient in advance for the correction process of the measurement data.

制御ユニット1は、イベントの待機処理を実行中(符号SQ211)、PC3からキャリブレーション処理の指示を受けると、任意実行イベントを検出する(符号SQ212)。次に、制御ユニット1の制御部103は、スクリプト処理部102により任意実行スクリプトを実行する(符号SQ213)。なお、センサ装置4に複数のセンサデバイス20が設けられる場合、例えばIDなどにより任意実行スクリプトの実行対象となるセンサデバイス20を指定することもできる。   When the control unit 1 is executing the event waiting process (reference SQ211) and receives an instruction for the calibration process from the PC 3, the control unit 1 detects an arbitrary execution event (reference SQ212). Next, the control unit 103 of the control unit 1 executes an arbitrary execution script by the script processing unit 102 (reference SQ213). When a plurality of sensor devices 20 are provided in the sensor device 4, for example, the sensor device 20 that is an execution target of the arbitrary execution script can be specified by an ID or the like.

スクリプト処理部102は、センサデバイス20に対し補正係数要求コマンドを発行する(符号SC11)。センサデバイス20は、補正係数要求コマンドに応じ補正係数を読み出す(符号SQ311)。スクリプト処理部102は、センサデバイス20から補正係数が入力される(符号SC12)。次に、スクリプト処理部102は、終了コマンドを発行する(符号SC13)。   The script processing unit 102 issues a correction coefficient request command to the sensor device 20 (reference SC11). The sensor device 20 reads the correction coefficient in response to the correction coefficient request command (reference SQ311). The script processing unit 102 receives a correction coefficient from the sensor device 20 (reference numeral SC12). Next, the script processing unit 102 issues an end command (reference SC13).

次に、制御ユニット1は、任意実行スクリプトの実行結果として、補正係数をPC3に送信する(符号SQ214)。その後、制御ユニット1は、イベントの待機処理を行う(符号SQ215)。   Next, the control unit 1 transmits the correction coefficient to the PC 3 as an execution result of the arbitrary execution script (reference SQ214). Thereafter, the control unit 1 performs an event standby process (reference SQ215).

PC3の管理部300は、制御ユニット1から補正係数を受信する(符号SQ112)。次に、管理部300は、補正係数をキャリブレーションデータ331としてHDD33に格納する(符号SQ113)。このようにして、キャリブレーション処理は実行される。   The management unit 300 of the PC 3 receives the correction coefficient from the control unit 1 (reference SQ112). Next, the management unit 300 stores the correction coefficient as calibration data 331 in the HDD 33 (reference SQ113). In this way, the calibration process is executed.

図9は、測定処理の一例を示すシーケンス図である。PC3の管理部300は、キャリブレーション処理の実行後、制御ユニット1に対し測定処理を指示する(符号SQ121)。   FIG. 9 is a sequence diagram illustrating an example of the measurement process. After executing the calibration process, the management unit 300 of the PC 3 instructs the control unit 1 to perform the measurement process (reference SQ121).

制御ユニット1は、イベントの待機処理を実行中(符号SQ221)、PC3から測定処理の指示を受けると、センシングイベントを検出する(符号SQ222)。次に、制御ユニット1の制御部103は、スクリプト処理部102によりセンシングスクリプトを実行する(符号SQ223)。なお、センサ装置4に複数のセンサデバイス20が設けられる場合、例えばIDなどによりセンシングスクリプトの実行対象となるセンサデバイス20を指定することもできる。   When the control unit 1 is executing an event standby process (reference SQ221) and receives an instruction for a measurement process from the PC 3, it detects a sensing event (reference SQ222). Next, the control unit 103 of the control unit 1 executes a sensing script by the script processing unit 102 (reference SQ223). When a plurality of sensor devices 20 are provided in the sensor device 4, for example, the sensor device 20 that is the execution target of the sensing script can be specified by an ID or the like.

スクリプト処理部102は、センサデバイス20に対し、測定開始を指示する測定開コマンドを発行する(符号SC21)。センサデバイス20は、測定開始コマンドに応じて測定を行う(符号SQ321)。   The script processing unit 102 issues a measurement open command for instructing the sensor device 20 to start measurement (reference SC21). The sensor device 20 performs measurement in response to the measurement start command (reference SQ321).

スクリプト処理部102は、測定開始コマンドの発行後、所定時間(例えば10(ms))だけ待機する(符号SC22)。この待機時間は、センサデバイス20の測定データが読み出し可能となるまでの時間に基づき決定される。   After issuing the measurement start command, the script processing unit 102 waits for a predetermined time (for example, 10 (ms)) (reference SC22). This standby time is determined based on the time until the measurement data of the sensor device 20 can be read.

次に、スクリプト処理部102は、センサデバイス20に対し測定データ要求コマンドを発行する(符号SC23)。センサデバイス20は、測定データ要求コマンドに応じて測定データを読み出す(符号SQ321)。センサデバイス20は、一例として、測定データ#1,#2を読み出して制御ユニット1に出力する。   Next, the script processing unit 102 issues a measurement data request command to the sensor device 20 (reference SC23). The sensor device 20 reads the measurement data in response to the measurement data request command (reference SQ321). As an example, the sensor device 20 reads the measurement data # 1 and # 2 and outputs them to the control unit 1.

スクリプト処理部102は、測定データ#1が入力され(符号SC24)、測定データ#2が入力される(符号SC25)。次に、スクリプト処理部102は、終了コマンドを発行する(符号SC26)。   The script processing unit 102 receives the measurement data # 1 (reference SC24) and the measurement data # 2 (reference SC25). Next, the script processing unit 102 issues an end command (reference numeral SC26).

次に、制御部103は、測定データ#1、#2をRAM12内の読み込みバッファ120に格納する(符号SQ223a)。すなわち、制御部103は、センシングスクリプトを実行結果として、測定データ#1、#2を取得する。   Next, the control unit 103 stores the measurement data # 1 and # 2 in the reading buffer 120 in the RAM 12 (reference SQ223a). That is, the control unit 103 acquires the measurement data # 1 and # 2 using the sensing script as an execution result.

制御ユニット1は、通信モジュール14によりRAM12内の測定データ#1,#2をPC3に送信する(符号SQ224)。その後、制御ユニット1の制御部103は、イベントの待機処理を行う(符号SQ225)。   The control unit 1 transmits the measurement data # 1 and # 2 in the RAM 12 to the PC 3 through the communication module 14 (reference SQ224). Thereafter, the control unit 103 of the control unit 1 performs event standby processing (reference SQ225).

また、PC3は、通信モジュール34により、制御ユニット1から測定データ#1、#2を受信する(符号SQ122)。次に、PC3は、データ処理部302により測定データ#1,#2のデータ処理を行う(符号SQ123)。このようにして、測定処理は実行される。   Further, the PC 3 receives the measurement data # 1 and # 2 from the control unit 1 through the communication module 34 (reference SQ122). Next, the PC 3 performs data processing of the measurement data # 1 and # 2 by the data processing unit 302 (reference SQ123). In this way, the measurement process is executed.

このように、制御ユニット1は、センサデバイス20へアクセスするコマンドを含むセンシングスクリプトを実行し、その実行結果として、測定データ#1、#2を取得する。PC3は、測定データ#1、#2を受信して、測定データ#1、#2の受信処理を行う。   As described above, the control unit 1 executes the sensing script including the command for accessing the sensor device 20, and acquires the measurement data # 1 and # 2 as the execution result. The PC 3 receives the measurement data # 1 and # 2, and performs reception processing of the measurement data # 1 and # 2.

このため、PC3はセンサデバイス20にアクセスする必要がないので、PC3と制御ユニット1の間の通信処理の負荷が低減される。仮に、PC3が、センサデバイス20に対するデータの書き込み及び読み出しの個別のコマンドを発行した場合、以下の比較例のように、PC3と制御ユニット1の間の通信処理の負荷が増加する。   For this reason, since it is not necessary for the PC 3 to access the sensor device 20, the load of communication processing between the PC 3 and the control unit 1 is reduced. If the PC 3 issues separate commands for writing and reading data with respect to the sensor device 20, the load of communication processing between the PC 3 and the control unit 1 increases as in the following comparative example.

図10は、測定処理の比較例を示すシーケンス図である。PC3は、測定開始コマンドを制御ユニット1に送信する(符号SQ121a)。制御ユニット1は、測定開始コマンドをセンサデバイス20に転送する。センサデバイス20は、測定開始コマンドに応じて測定を行う(符号SQ321a)。   FIG. 10 is a sequence diagram illustrating a comparative example of measurement processing. The PC 3 transmits a measurement start command to the control unit 1 (reference SQ121a). The control unit 1 transfers a measurement start command to the sensor device 20. The sensor device 20 performs measurement in response to the measurement start command (reference SQ321a).

PC3は、測定開始コマンドの発行後、所定時間だけ待機して、センサデバイス20に対する測定データ要求コマンドを制御ユニット1に送信する(符号SQ122a)。制御ユニット1は、測定データ要求コマンドをセンサデバイス20に転送する。センサデバイス20は、測定データ要求コマンドに応じて測定データ#1、#2を読み出す(符号SQ322a)。センサデバイス20は、測定データ#1、#2を制御ユニット1に出力する。   After issuing the measurement start command, the PC 3 waits for a predetermined time and transmits a measurement data request command for the sensor device 20 to the control unit 1 (reference SQ122a). The control unit 1 transfers the measurement data request command to the sensor device 20. The sensor device 20 reads the measurement data # 1 and # 2 in response to the measurement data request command (reference SQ322a). The sensor device 20 outputs measurement data # 1 and # 2 to the control unit 1.

次に、制御ユニット1は、測定データ#1、#2をPC3に送信する。PC3は、制御ユニット1から測定データ#1、#2を受信する(符号SQ123a)。PC3は、測定データ#1、#2のデータ処理を行う(符号SQ124a)。   Next, the control unit 1 transmits the measurement data # 1 and # 2 to the PC 3. The PC 3 receives the measurement data # 1 and # 2 from the control unit 1 (reference SQ123a). The PC 3 performs data processing of the measurement data # 1 and # 2 (reference SQ124a).

このように、比較例において、PC3は、測定開始コマンド及び測定データ要求コマンドを個別に制御ユニット1に送信する。このため、PC3と制御ユニット1の通信頻度が、実施例の場合より増加する。   Thus, in the comparative example, the PC 3 individually transmits a measurement start command and a measurement data request command to the control unit 1. For this reason, the communication frequency of PC3 and the control unit 1 increases from the case of an Example.

これにより、PC3と制御ユニット1の消費電力が増加する。とりわけ、PC3と制御ユニット1が無線通信する場合、通信モジュール14,34の消費電力は、有線通信の場合と比べると、増加量が大きい。また、消費電力の増加は、制御ユニット1が内蔵バッテリにより駆動される場合、駆動時間を大きく低下させる。   Thereby, the power consumption of PC3 and the control unit 1 increases. In particular, when the PC 3 and the control unit 1 perform wireless communication, the power consumption of the communication modules 14 and 34 is larger than that in the case of wired communication. Also, the increase in power consumption greatly reduces the drive time when the control unit 1 is driven by the built-in battery.

また、通信頻度が増加すると、通信の遅延の影響も問題となる。このため、例えば、2つのコマンドの送信の時間間隔が規定されている場合、その規定時間が順守されない場合がある。図10の例において、測定開始コマンドと測定データ要求コマンドの送信間隔が10(ms)に規定されている場合、PC3が、測定開始コマンドを送信して10(ms)後に測定データ要求コマンドを送信しても、センサデバイス20に対する測定開始コマンド及び測定データ要求コマンドの送信間隔は10(ms)となる保証は無い。   Further, when the communication frequency increases, the influence of communication delay becomes a problem. For this reason, for example, when a time interval between two command transmissions is specified, the specified time may not be observed. In the example of FIG. 10, when the transmission interval between the measurement start command and the measurement data request command is defined as 10 (ms), the PC 3 transmits the measurement start command and transmits the measurement data request command 10 (ms) later. Even so, there is no guarantee that the transmission interval of the measurement start command and the measurement data request command to the sensor device 20 will be 10 (ms).

また、無線通信の場合、通信エラーが、有線通信の場合より多く発生するため、PC3及び制御ユニット1に通信エラー発生時の対応処理が必要となる。とりわけ、制御系のコマンドの送信エラーが発生した場合、通信エラーの対応処理を行うことなく、処理が進んでしまうと、センサデバイス20が、復旧が不可能な想定外の状態に遷移することが考え得る。このような状態遷移は、通信の遅延により、本来の順序とは異なる順序でコマンドが実行された場合も起こり得る。   Further, in the case of wireless communication, more communication errors occur than in the case of wired communication, and therefore, the PC 3 and the control unit 1 need to handle the communication error. In particular, when a control command transmission error occurs, the sensor device 20 may transition to an unexpected state that cannot be recovered if the process proceeds without performing a communication error handling process. I can think. Such a state transition may also occur when commands are executed in an order different from the original order due to communication delay.

これに対し、制御ユニット1が、PC3からコマンドを受信するたびに応答を返信すれば、確実に所定のシーケンスでコマンドが実行されるため、上記のような状態遷移を防止することができる。しかし、この場合、応答の返信により通信頻度が増加するだけでなく、応答自体の通信エラー及び遅延も考慮する必要が生ずるため、シーケンスが複雑化する。   On the other hand, if the control unit 1 returns a response each time it receives a command from the PC 3, the command is surely executed in a predetermined sequence, so that the state transition as described above can be prevented. However, in this case, not only the communication frequency increases due to the reply of the response, but also the communication error and delay of the response itself must be taken into account, so that the sequence becomes complicated.

実施例において、PC3は、制御ユニット1に対しスクリプトの実行指示を送信し、また、制御ユニット1から測定データを受信しているだけであるため、通信エラーが発生しても、指示や測定データが受信されないに留まり、センサデバイス20の制御自体には影響が生じない。さらに、指示や測定データは、通信エラーで未受信となっても、再送信処理により確実に受信することが可能である。なお、制御ユニット1とセンサデバイス20の間は、ケーブルを介した有線通信が行われるが、PC3と制御ユニット1の間の通信と比べると、短距離の通信であるうえ、通信速度も遅いため、通信エラー、消費電力、及び遅延の影響は極めて小さい。   In the embodiment, since the PC 3 only transmits a script execution instruction to the control unit 1 and receives only the measurement data from the control unit 1, even if a communication error occurs, the instruction and the measurement data Is not received, and the control of the sensor device 20 itself is not affected. Furthermore, even if the instruction or measurement data is not received due to a communication error, it can be reliably received by the retransmission process. In addition, although wired communication via a cable is performed between the control unit 1 and the sensor device 20, compared with communication between the PC 3 and the control unit 1, it is a short-range communication and a communication speed is also slow. The effects of communication error, power consumption, and delay are extremely small.

また、以下の実施例のように、制御ユニット1が、自律的にセンシングスクリプトを周期的に実行する場合、図9の例より通信処理の負荷を低減できる。   Moreover, when the control unit 1 autonomously executes a sensing script periodically as in the following embodiment, the load of communication processing can be reduced compared to the example of FIG.

図11は、測定処理の他例を示すシーケンス図である。図11において、図9と共通する処理については同一の符号を付し、その説明を省略する。   FIG. 11 is a sequence diagram illustrating another example of the measurement process. In FIG. 11, processes that are the same as those in FIG.

制御ユニット1は、イベントの待機中(符号SQ221)、PC3から測定開始の指示を受けると、測定周期タイマをスタートさせる(符号SQ221a)。測定周期タイマは、例えば制御部103内に形成され、所定の測定周期をカウントする。制御部103は、イベントとして、測定周期の到来を検出する。   When the control unit 1 is waiting for an event (reference SQ221) and receives a measurement start instruction from the PC 3, the control unit 1 starts a measurement cycle timer (reference SQ221a). The measurement cycle timer is formed in the control unit 103, for example, and counts a predetermined measurement cycle. The control unit 103 detects the arrival of the measurement cycle as an event.

制御ユニット1は、測定周期の到来のイベントを検出すると(符号SQ221b)、センシングスクリプトを実行する(符号SQ223)。なお、センシングスクリプトの処理内容は、上述した通りである。制御ユニット1は、測定データ#1、#2をRAM12に格納して(符号SQ223a)、PC3に送信する(符号SQ224)。PC3は、測定データ#1、#2を受信し(符号SQ122)、データ処理を行う(符号SQ123)。   When the control unit 1 detects the arrival event of the measurement cycle (reference SQ221b), it executes the sensing script (reference SQ223). The processing content of the sensing script is as described above. The control unit 1 stores the measurement data # 1 and # 2 in the RAM 12 (reference SQ223a) and transmits it to the PC 3 (reference SQ224). The PC 3 receives the measurement data # 1 and # 2 (reference SQ122) and performs data processing (reference SQ123).

測定周期の到来のイベントは、測定周期の期間Tごとに検出される。このため、制御ユニット1は、PC3から指示を受けることなく、期間Tをおいて測定処理を繰り返し実行することができる。このため、PC3と制御ユニット1の間の通信処理の負荷が低減される。   The arrival event of the measurement cycle is detected every period T of the measurement cycle. For this reason, the control unit 1 can repeatedly execute the measurement process after the period T without receiving an instruction from the PC 3. For this reason, the load of communication processing between the PC 3 and the control unit 1 is reduced.

本例において、PC3が、制御ユニット1にスクリプトを送信し、制御ユニット1から測定データを受信したが、これに限定されない。   In this example, the PC 3 transmits a script to the control unit 1 and receives measurement data from the control unit 1, but the present invention is not limited to this.

図12は、制御システムの他例を示す構成図である。制御システムは、サーバ60、ゲートウェイ装置7、及びセンサ装置4を有する。   FIG. 12 is a configuration diagram illustrating another example of the control system. The control system includes a server 60, a gateway device 7, and a sensor device 4.

サーバ60は、データ処理装置の他例であり、インターネットなどのネットワークNWと接続されている。ゲートウェイ装置7は、無線通信を介しセンサ装置4に接続され、また、ネットワークNWに接続されている。ゲートウェイ装置7は、サーバ60とセンサ装置4の間の通信を中継する。   The server 60 is another example of the data processing device, and is connected to a network NW such as the Internet. The gateway device 7 is connected to the sensor device 4 via wireless communication, and is connected to the network NW. The gateway device 7 relays communication between the server 60 and the sensor device 4.

サーバ60は、上記のPC3と同一の機能を備える。サーバ60は、ネットワークNWを介し、センサ装置4と通信する。すなわち、サーバ60は、制御ユニット1にスクリプトを送信し、制御ユニット1から測定データを受信してデータ処理する。なお、サーバ60としては、クラウドサーバが挙げられるが、これに限定されない。また、ネットワークNWがインターネットである場合、PC3は、インターネット接続機能を備えるため、ゲートウェイ装置7に代えて、通信の中継に利用することもできる。   The server 60 has the same function as the PC 3 described above. The server 60 communicates with the sensor device 4 via the network NW. That is, the server 60 transmits a script to the control unit 1, receives measurement data from the control unit 1, and processes the data. The server 60 includes a cloud server, but is not limited to this. When the network NW is the Internet, the PC 3 has an Internet connection function and can be used for relaying communication instead of the gateway device 7.

また、制御ユニット1にスクリプトを送信する機器と、制御ユニット1から測定データを受信してデータ処理する機器とを別々に設けてもよい。   Moreover, you may provide separately the apparatus which transmits a script to the control unit 1, and the apparatus which receives measurement data from the control unit 1 and processes data.

図13は、制御システムの他例を示す構成図である。図13において、図12と共通する構成については同一の符号を付し、その説明を省略する。   FIG. 13 is a configuration diagram illustrating another example of the control system. In FIG. 13, the same reference numerals are given to configurations common to FIG. 12, and description thereof is omitted.

制御システムは、サーバ61、ゲートウェイ装置7、センサ装置4、及びPC3aを有する。サーバ61は、データ処理装置の他例であり、インターネットなどのネットワークNWと接続されている。また、センサ装置4は、ゲートウェイ装置7またはPC3aと無線通信する。   The control system includes a server 61, a gateway device 7, a sensor device 4, and a PC 3a. The server 61 is another example of the data processing apparatus, and is connected to a network NW such as the Internet. The sensor device 4 communicates wirelessly with the gateway device 7 or the PC 3a.

PC3aは、上記のPC3と同様に、センサ装置4の制御ユニット1にスクリプトを送信する。センサ装置4は、制御ユニット1がPC3aから受信したスクリプトを格納すると、任意の方法で無線通信の通信相手をPC3aからゲートウェイ装置7に切り替える。   The PC 3a transmits a script to the control unit 1 of the sensor device 4 in the same manner as the PC 3 described above. When the control unit 1 stores the script received from the PC 3a, the sensor device 4 switches the communication partner of the wireless communication from the PC 3a to the gateway device 7 by an arbitrary method.

サーバ61は、ネットワークNWを介し、センサ装置4にスクリプトの実行を指示する。センサ装置4は、制御ユニット1がスクリプトを実行すると、その実行結果として、測定データをサーバ61に送信する。サーバ61は、PC3と同様に、データ処理装置として、測定データのデータ処理を行う。   The server 61 instructs the sensor device 4 to execute a script via the network NW. When the control unit 1 executes the script, the sensor device 4 transmits measurement data to the server 61 as the execution result. As with the PC 3, the server 61 is a data processing device and performs data processing of measurement data.

この構成によると、スクリプトの作成と測定データの処理を異なる拠点で行うことができる。   According to this configuration, script creation and measurement data processing can be performed at different locations.

なお、上述した処理機能は、コンピュータによって実現することができる。その場合、処理装置が有すべき機能の処理内容を記述したプログラムが提供される。そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体(ただし、搬送波は除く)に記録しておくことができる。   Note that the processing functions described above can be realized by a computer. In that case, a program describing the processing contents of the functions that the processing apparatus should have is provided. By executing the program on a computer, the above processing functions are realized on the computer. The program describing the processing contents can be recorded on a computer-readable recording medium (except for a carrier wave).

プログラムを流通させる場合には、例えば、そのプログラムが記録されたDVD(Digital Versatile Disc)、CD−ROM(Compact Disc Read Only Memory)などの可搬型記録媒体の形態で販売される。また、プログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。   When the program is distributed, for example, it is sold in the form of a portable recording medium such as a DVD (Digital Versatile Disc) or a CD-ROM (Compact Disc Read Only Memory) on which the program is recorded. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.

プログラムを実行するコンピュータは、例えば、可搬型記録媒体に記録されたプログラムもしくはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、サーバコンピュータからプログラムが転送されるごとに、逐次、受け取ったプログラムに従った処理を実行することもできる。   The computer that executes the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. Further, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.

上述した実施形態は本発明の好適な実施の例である。但し、これに限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々変形実施可能である。   The above-described embodiment is an example of a preferred embodiment of the present invention. However, the present invention is not limited to this, and various modifications can be made without departing from the scope of the present invention.

1 制御ユニット
2 センサユニット
3,3a パーソナルコンピュータ
4 センサ装置
10,30 CPU
60,61 サーバ
100,301 通信処理部
102 スクリプト処理部
103 制御部
302 データ処理部
DESCRIPTION OF SYMBOLS 1 Control unit 2 Sensor unit 3, 3a Personal computer 4 Sensor apparatus 10, 30 CPU
60, 61 Server 100, 301 Communication processing unit 102 Script processing unit 103 Control unit 302 Data processing unit

Claims (10)

センサデバイスに接続される制御装置において、
前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトを記憶する記憶部と、
前記第1スクリプトを実行し、該実行結果として、前記センサデバイスの補正係数を取得し、前記第2スクリプトを実行し、該実行結果として、前記センサデバイスの測定データを取得する制御部と、
前記補正係数に基づき前記測定データの補正を行うデータ処理装置に、前記補正係数及び前記測定データを送信する送信部とを有することを特徴とする制御装置。
In the control device connected to the sensor device ,
A storage unit for storing a first script and a second script including a command for accessing the sensor device ;
A controller that executes the first script, acquires the correction coefficient of the sensor device as the execution result , executes the second script, and acquires the measurement data of the sensor device as the execution result ;
A control apparatus comprising: a data processing device that corrects the measurement data based on the correction coefficient; and a transmission unit that transmits the correction coefficient and the measurement data .
前記第2スクリプトは、前記センサデバイスの応答を待つコマンド、及び前記センサデバイスからデータを読み出した後、前記データを加工して前記センサデバイスに書き込むコマンドの少なくとも一方を含むことを特徴とする請求項1に記載の制御装置。 Claim wherein the second script command waits for a response of the sensor device, and after reading the data from said sensor device, characterized in that it comprises at least one of the command by processing the data written to the sensor device The control apparatus according to 1. 前記制御部は、前記第2スクリプトを周期的に実行することを特徴とする請求項1または2に記載の制御装置。 The control device according to claim 1, wherein the control unit periodically executes the second script. センサデバイスに接続される制御装置と通信するデータ処理装置において、
前記制御装置から、前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトの実行結果として、前記センサデバイスの補正係数及び測定データそれぞれ受信する受信部と、
前記補正係数に基づき前記測定データの補正を行うデータ処理部とを有することを特徴とするデータ処理装置。
In a data processing device that communicates with a control device connected to a sensor device ,
From the control device, the first script and the execution result of the second script includes a command to access the sensor device, a receiver for receiving a correction factor and measurement data of the sensor device, respectively,
And a data processing unit that corrects the measurement data based on the correction coefficient .
前記第2スクリプトを格納する格納部と、
前記第2スクリプトを前記制御装置に送信する送信部とを有することを特徴とする請求項4に記載のデータ処理装置。
A storage unit for storing the second script;
The data processing apparatus according to claim 4, further comprising: a transmission unit configured to transmit the second script to the control apparatus.
センサデバイスに接続される制御装置と、
前記制御装置と通信するデータ処理装置とを有し、
前記制御装置は、
前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトを記憶する記憶部と、
前記第1スクリプトを実行し、該実行結果として、前記センサデバイスの補正係数を取得し、前記第2スクリプトを実行し、該実行結果として、前記センサデバイスの測定データを取得する制御部と、
前記データ処理装置に前記補正係数及び前記測定データを送信する送信部とを有し、
前記データ処理装置は、
前記制御装置から前記第1スクリプト及び前記第2スクリプトの実行結果として、前記補正係数及び前記測定データそれぞれ受信する受信部と、
前記補正係数に基づき前記測定データの補正を行うデータ処理部とを有することを特徴とする制御システム。
A control device connected to the sensor device ;
A data processing device in communication with the control device;
The control device includes:
A storage unit for storing a first script and a second script including a command for accessing the sensor device ;
A controller that executes the first script, acquires the correction coefficient of the sensor device as the execution result , executes the second script, and acquires the measurement data of the sensor device as the execution result ;
And a transmission unit that transmits the correction coefficient and the measured data to the data processing device,
The data processing device includes:
A receiving unit for receiving the correction coefficient and the measurement data , respectively , as execution results of the first script and the second script from the control device;
And a data processing unit that corrects the measurement data based on the correction coefficient .
接続先のセンサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトを実行する工程と、
前記第1スクリプトの実行結果として、前記センサデバイスの補正係数を取得し、前記第2スクリプトの実行結果として、前記センサデバイスの測定データを取得する工程と、
前記補正係数に基づき前記測定データの補正を行うデータ処理装置に、前記補正係数及び前記測定データを送信する工程とを、コンピュータが実行することを特徴とする制御方法。
Executing a first script and a second script including a command for accessing a connected sensor device ;
Obtaining a correction coefficient of the sensor device as an execution result of the first script, and obtaining measurement data of the sensor device as an execution result of the second script ;
A control method, wherein the computer executes the step of transmitting the correction coefficient and the measurement data to a data processing device that corrects the measurement data based on the correction coefficient .
センサデバイスに接続される制御装置から、前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトの実行結果として、前記センサデバイスの補正係数及び測定データそれぞれ受信する工程と、
前記補正係数に基づき前記測定データの補正を行う工程とを、コンピュータが実行することを特徴とするデータ処理方法。
A control device connected to the sensor device, as a result of the execution of the first script and the second script includes a command to access the sensor device, comprising: receiving a correction coefficient and the measurement data of the sensor device, respectively,
A data processing method, wherein a computer executes the step of correcting the measurement data based on the correction coefficient .
接続先のセンサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトを実行し、
前記第1スクリプトの実行結果として、前記センサデバイスの補正係数を取得し、前記第2スクリプトの実行結果として、前記センサデバイスの測定データを取得し、
前記補正係数に基づき前記測定データの補正を行うデータ処理装置に、前記補正係数及び前記測定データを送信する、処理をコンピュータに実行させることを特徴とする制御プログラム。
Execute the first script and the second script including the command to access the connected sensor device ,
As the execution result of the first script, the correction coefficient of the sensor device is acquired, and as the execution result of the second script, the measurement data of the sensor device is acquired,
A control program that causes a computer to execute a process of transmitting the correction coefficient and the measurement data to a data processing device that corrects the measurement data based on the correction coefficient .
センサデバイスに接続される制御装置から、前記センサデバイスにアクセスするコマンドを含む第1スクリプト及び第2スクリプトの実行結果として、前記センサデバイスの補正係数及び測定データそれぞれ受信し、
前記補正係数に基づき前記測定データの補正を行う、処理をコンピュータに実行させることを特徴とするデータ処理プログラム。
A control device connected to the sensor device, as a result of executing the first script and the second script includes a command for accessing said sensor device receives the correction coefficient and the measurement data of the sensor device, respectively,
A data processing program for causing a computer to execute processing for correcting the measurement data based on the correction coefficient .
JP2018503941A 2016-03-10 2016-03-10 Control device, data processing device, control system, control method, data processing method, control program, and data processing program Active JP6587031B2 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2016/057558 WO2017154166A1 (en) 2016-03-10 2016-03-10 Control device, data processing device, control system, control method, data processing method, control program, and data processing program

Publications (2)

Publication Number Publication Date
JPWO2017154166A1 JPWO2017154166A1 (en) 2018-10-04
JP6587031B2 true JP6587031B2 (en) 2019-10-09

Family

ID=59789232

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018503941A Active JP6587031B2 (en) 2016-03-10 2016-03-10 Control device, data processing device, control system, control method, data processing method, control program, and data processing program

Country Status (3)

Country Link
JP (1) JP6587031B2 (en)
TW (1) TWI631442B (en)
WO (1) WO2017154166A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6557760B1 (en) * 2018-06-19 2019-08-07 Jig−Saw株式会社 Device control method, control device and system
JP2021157751A (en) * 2020-03-30 2021-10-07 ブラザー工業株式会社 Control method for controller and terminal, controller, program, and storage medium
GB2616069A (en) * 2022-02-28 2023-08-30 Vodafone Group Services Ltd A method and device for reading data from a sensor

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002082703A (en) * 2000-09-07 2002-03-22 Ryosuke Hosoya Equipment with medium conveyance system, and method and device for its control
TW200416508A (en) * 2003-02-25 2004-09-01 Chung Shan Inst Of Science A real-time control system using web technology to implement Computer Numerical Controller and method thereof
JP2005130033A (en) * 2003-10-21 2005-05-19 Ipsquare Inc Monitoring system, control device, and imaging apparatus
JP2006344017A (en) * 2005-06-09 2006-12-21 Hitachi Ltd Sensor network system and data processing method for sensor network system
US7970871B2 (en) * 2007-05-02 2011-06-28 Synapse Wireless, Inc. Systems and methods for dynamically configuring node behavior in a sensor network
JP2009260778A (en) * 2008-04-18 2009-11-05 Hitachi High-Tech Control Systems Corp Sensor network gateway, and sensor network system
DE112014003065T5 (en) * 2014-04-25 2016-03-17 Mitsubishi Electric Corporation Programmable logic controller

Also Published As

Publication number Publication date
TWI631442B (en) 2018-08-01
TW201732477A (en) 2017-09-16
JPWO2017154166A1 (en) 2018-10-04
WO2017154166A1 (en) 2017-09-14

Similar Documents

Publication Publication Date Title
EP3276481B1 (en) Nvme networked storage implementation method, terminal, server, and system
JP4600518B2 (en) Information processing apparatus, information processing system, information processing method, and computer program
JP6587031B2 (en) Control device, data processing device, control system, control method, data processing method, control program, and data processing program
US20130007289A1 (en) Remote control system and remote control method of the same
US7908417B2 (en) Motherboard system, storage device for booting up thereof and connector
JP6250842B2 (en) Sharing non-USB sensor with another device using USB over IP
JP2015202544A (en) Robot control system, information communication module, robot controller, computer program and robot control method
JP5932947B2 (en) Host and system
KR100829788B1 (en) Command decoding system, flash memory command decoding system and methods using the same
CN103823447A (en) Communication method and communication system of upper and lower computers of semiconductor equipment
US7702820B2 (en) Hardware accelerator and data transmission system and method using the same
US20060184708A1 (en) Host controller device and method
US10664418B2 (en) Peripheral device controlling device, operation method thereof, and operation method of peripheral device controlling device driver
JP4809166B2 (en) Computer system constituting remote I / O and I / O data transfer method
JP4218034B2 (en) Data communication system, data communication method, and data communication program
JP5840586B2 (en) Power saving system and image forming apparatus
JP2011070259A (en) Data transfer device and data transfer method
TWI452471B (en) Full-duplex controller in an universal serial bus device and method thereof
JP4813823B2 (en) Test system and test method
JP2005085023A (en) Information processing system, reader/writer and information processing method
JP2008299747A (en) Usb host system and method for transferring transfer data
JP6138482B2 (en) Embedded system
KR101985890B1 (en) A network interface controller with data storage capability and a computing system including the same
JP4716929B2 (en) Program debug support processing apparatus, communication adapter, and program debug support processing program
JP6359192B2 (en) Duplex process control device

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180524

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180524

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190618

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190729

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190826

R150 Certificate of patent or registration of utility model

Ref document number: 6587031

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150