Data transmission device, control device, setting device, and control method for data transmission device

文档序号:311276 发布日期:2021-11-26 浏览:5次 中文

阅读说明:本技术 数据传输装置、控制装置、设定装置以及数据传输装置的控制方法 (Data transmission device, control device, setting device, and control method for data transmission device ) 是由 丹羽祥実 于 2020-03-03 设计创作,主要内容包括:即便实施过采样,也可抑制在每个控制周期发送至控制装置的数据帧的数据尺寸。计数器单元(10)将表示第二次以后的计数值(Ct)的采样数据(Sd)的数据尺寸,压缩为可表达在一次采样处理中可计数的计数值的最大量(Vmax)的比特数。(Even if oversampling is performed, the data size of a data frame transmitted to the control device at each control cycle can be suppressed. A counter unit (10) compresses the data size of sample data (Sd) representing a count value (Ct) at the second and subsequent times to the number of bits that can express the maximum amount (Vmax) of count values that can be counted in one sampling process.)

1. A data transmission device that saves a plurality of sampling data indicating measurement results of respective sampling processes performed a plurality of times in one control cycle into one data frame and transmits to a control device in each of the control cycles, the data transmission device comprising:

an acquisition unit that acquires measurement results of the sampling processes executed a plurality of times; and

and a compression unit configured to compress, when a maximum amount of change between measurement results of two sampling processes continuously executed in one control cycle is predetermined, the measurement result of each of the sampling processes of a second time and subsequent times among the plurality of measurement results acquired by the acquisition unit into the sampling data having a data size capable of expressing the maximum amount.

2. The data transmission apparatus of claim 1, wherein

The sampling process is a process of counting the number of pulses of the pulse signal,

the measurement is the number of pulses counted.

3. The data transmission apparatus of claim 2, wherein

The data size capable of expressing the maximum amount is determined in advance depending on (1) the absolute value of the number of pulses that can be counted in one sampling process and (2) whether the pulse counting manner of the sampling process is bidirectional or unidirectional.

4. A data transmission arrangement according to any one of claims 1 to 3, wherein

The compression unit extracts a bit string that includes the lowest bit and is capable of expressing the maximum number of bits from bit strings indicating measurement results of the sampling processes at the second and subsequent times, and uses the extracted bit string as the sample data.

5. A data transmission arrangement according to any one of claims 1 to 3, wherein

The compression unit sets, as the sample data, a bit string indicating an amount of change in a measurement result of each of the second and subsequent sampling processes from a measurement result of the immediately preceding sampling process.

6. A control device, comprising:

a data frame receiving section that receives the data frame from the data transmission apparatus according to any one of claims 1 to 5 at each of the control periods; and

and a restoring unit configured to restore the measurement result of each of the sampling processes at the second time and subsequent times from the sample data compressed to the data size capable of expressing the maximum amount in the data frame received by the data frame receiving unit.

7. The control device of claim 6, wherein

The restoration unit restores, for each of the measurement results of the second and subsequent sampling processes, the measurement result using a bit string indicating the measurement result of the immediately preceding sampling process and a bit string stored in the data frame as the sample data indicating the measurement result of each of the second and subsequent sampling processes so that a change amount from the measurement result of the immediately preceding sampling process becomes equal to or less than the maximum amount.

8. A setting device comprising a setting portion that sets a data size capable of expressing the maximum amount for at least one of the data transmission device according to any one of claims 1 to 5 and the control device according to claim 6 or 7.

9. The setting device according to claim 8, further comprising:

a calculation unit that calculates a data size capable of expressing the maximum amount using setting information on the data transfer device including information indicating the number of times the sampling process is performed by the data transfer device in one control cycle,

the setting unit sets a data size capable of expressing the maximum amount calculated by the calculation unit for at least one of the data transmission device and the control device.

10. A control method of a data transmission apparatus that saves a plurality of sampling data indicating measurement results of respective sampling processes performed a plurality of times in one control cycle into one data frame and transmits to a control apparatus in each of the control cycles, the control method comprising:

an acquisition step of acquiring a measurement result of each of the sampling processes executed a plurality of times; and

a compression step of, when a maximum amount of change between measurement results of two sampling processes continuously executed in one control cycle is predetermined, compressing the measurement results of the second and subsequent sampling processes among the plurality of measurement results acquired in the acquisition step into the sampling data of a data size capable of expressing the maximum amount.

Technical Field

The present invention relates to a data transmission device and the like that saves a plurality of sampling data indicating measurement results of respective sampling processes performed a plurality of times in one control cycle into one data frame and transmits the data to a control device in each of the control cycles.

Background

Conventionally, it is known that in a production site such as a factory, oversampling (over sampling) is performed in order to improve the accuracy of control processing performed by a control device such as a Programmable Logic Controller (PLC). For example, patent document 1 below discloses a configuration in which: the counter unit measures the movement amount of the conveyor a plurality of times at intervals shorter than the communication interval (i.e., control cycle) with the controller, and transmits the measured movement amounts and the measurement timings of the movement amounts to the controller.

Documents of the prior art

Patent document

Patent document 1: japanese laid-open patent publication No. 2018-24045 "

Disclosure of Invention

Problems to be solved by the invention

However, the conventional technique as described above has a problem that the data size of the data frame transmitted to the control device in each control cycle becomes large by the implementation of oversampling.

An embodiment of the present invention has been made in view of the above problems, and an object thereof is to realize a data transmission device and the like capable of suppressing the data size of a data frame transmitted to a control device every control cycle even when oversampling is performed.

Means for solving the problems

In order to solve the problem, a data transmission device according to an embodiment of the present invention stores a plurality of sampling data indicating measurement results of respective sampling processes performed a plurality of times in one control cycle into one data frame and transmits the data frame to a control device in each of the control cycles, the data transmission device including: an acquisition unit that acquires measurement results of the sampling processes executed a plurality of times; and a compression unit configured to compress, when a maximum amount of change between measurement results of two sampling processes continuously executed in one control cycle is predetermined, the measurement result of each of the sampling processes of a second time and subsequent times among the plurality of measurement results acquired by the acquisition unit into the sample data having a data size capable of expressing the maximum amount.

In order to solve the problem, a control method of a data transmission device according to an embodiment of the present invention is a control method of a data transmission device that stores a plurality of sample data indicating measurement results of respective sampling processes performed a plurality of times in one control cycle into one data frame and transmits the data frame to a control device in each control cycle, the control method including: an acquisition step of acquiring a measurement result of each of the sampling processes executed a plurality of times; and a compression step of, when a maximum amount of change between measurement results of two sampling processes continuously executed in one control cycle is predetermined, compressing the measurement results of the second and subsequent sampling processes among the plurality of measurement results acquired in the acquisition step into the sample data of a data size capable of expressing the maximum amount.

ADVANTAGEOUS EFFECTS OF INVENTION

According to an embodiment of the present invention, the following effects are obtained: even if oversampling is performed, the data size of a data frame transmitted to the control device in each control cycle can be suppressed.

Drawings

Fig. 1 is a block diagram showing a main part configuration of a counter unit and the like according to embodiment 1 of the present invention.

Fig. 2 is a diagram showing an overview of the entire control system including the counter unit of fig. 1.

Fig. 3 is a diagram showing an application example of the control system of fig. 2.

Fig. 4 is a diagram for explaining an outline of data compression processing executed by the control system of fig. 2.

Fig. 5 is a table illustrating the effect achieved by the data compression process of fig. 4.

Fig. 6 is a diagram showing an outline of processing performed by the counter unit in fig. 1.

Fig. 7 is a diagram illustrating an outline of a data frame transmitted in each control cycle in the control system of fig. 2.

Fig. 8 is a diagram illustrating a data size of sample data indicating a measurement result measured by the second and subsequent sampling processes.

Fig. 9 is a diagram illustrating absolute values of measurement results measurable in one sampling process.

Fig. 10 is a diagram illustrating measurement results measurable in one sampling process.

Fig. 11 is a diagram showing an outline of processing executed by the PLC of fig. 1.

Fig. 12 is a diagram showing details of data recovery processing performed by the PLC of fig. 1.

Fig. 13 is a diagram showing an example of data recovery processing when the compression size is 1 byte and the pulse count scheme is bidirectional.

Fig. 14 is a diagram showing a specific example of carry/escape processing in the data recovery processing example in the case where the compression size is 1 byte and the pulse counting method is bidirectional.

Fig. 15 is a diagram showing an example of data recovery processing when the compression size is 2 bits and the pulse count scheme is bidirectional.

Fig. 16 is a diagram showing a specific example of carry/escape processing in the data recovery processing example in the case where the compression size is 2 bits and the pulse count scheme is bidirectional.

Fig. 17 is a diagram showing an example of data recovery processing when the compression size is 1 bit and the pulse count scheme is one-way.

Fig. 18 is a diagram showing an example of information used when the tool in fig. 1 calculates the compressed size.

Fig. 19 is a diagram showing a comparison between a case where the lower bit string is extracted and a case where the difference value is calculated, with respect to the data compression processing executed by the control system of fig. 2.

Fig. 20 is a diagram showing an example of information stored in a data frame transmitted in each control cycle in the control system of fig. 2.

Fig. 21 is a diagram showing an outline of processing executed by the simulation unit of fig. 1.

Fig. 22 is a diagram showing a connection example between the counter unit of fig. 1 and the PLC of fig. 1.

Detailed Description

[ embodiment mode 1 ]

An embodiment of one aspect of the present invention (hereinafter also referred to as "the present embodiment") will be described below with reference to fig. 1 to 22. In the drawings, the same or corresponding portions are denoted by the same reference numerals, and description thereof will not be repeated. In the present embodiment, for example, the counter unit 10 is described as a typical example of a data transmission device. The analog unit 60 is also an example of a data transmission device, and will be described in detail later. To facilitate understanding of the counter unit 10 according to an embodiment of the present invention, first, an outline of the control system 1 including the counter unit 10 will be described with reference to fig. 2.

In the following description, "n" represents an integer of "2" or more, and "m" represents an integer of "2" or more and "n" or less. Also, a value expressed in hexadecimal terms is preceded by "0 x" representing a hexadecimal number to represent a value expressed in hexadecimal terms, and a value expressed in binary terms is preceded by "b" representing a binary term to represent a value expressed in binary terms.

Application example § 1

(Overall overview of control System)

Fig. 2 is a diagram showing an overview of the entire control system 1 including the counter unit 10. As shown in fig. 2, the control system 1 includes: a counter unit 10 as a data transmission device, and a Programmable Logic Controller (PLC) 20 as a control device (Controller). The control system 1 may also comprise an analog unit 60 as data transmission means. The control system 1 is a master-slave control system, which comprises: a PLC20 as a master device, and a counter unit 10 and an analog unit 60 as slave devices connected to the master device via a network (field network 50). The PLC20 is referred to as a "host device" in the sense that it manages data transmission over the field network 50.

The PLC20 is a control device (controller) that controls the entire control system 1, and is communicably connected to each of the counter unit 10 and the simulation unit 60. The PLC20 acquires information from the encoder 40 and the sensor 70 as input devices (measuring devices) as input data via each of the counter unit 10 and the simulation unit 60. The PLC20 executes arithmetic processing using the acquired input data in accordance with a user program loaded in advance. The PLC20 executes the arithmetic processing, determines the control content for the control system 1, for example, determines the control content for an output device (not shown) such as an actuator, and outputs control data corresponding to the control content to the output device. For example, a display unit and an operation unit, not shown, may be connected to the PLC 20. The display unit includes a liquid crystal panel or the like that can display an image, and the operation unit typically includes a touch panel, a keyboard, a mouse, and the like.

The field network 50 transmits various data received by the PLC20 or transmitted by the PLC20, such as EtherCAT (registered trademark), PROFINET (registered trademark), MECHATROLINK (registered trademark) -III, Powerlink, SERCOS (registered trademark) -III, and CIP Motion. The field network 50 may be, for example, EtherNet/IP (registered trademark), DeviceNet, Componet (registered trademark), or the like. In the following, a control system 1 that transmits and receives data between the PLC20 and the slave device by sequentially transmitting data frames over the field network 50 will be described. That is, by sequentially transmitting data frames on the field network 50, data is transmitted and received between the PLC20 and the counter unit 10, and data is transmitted and received between the PLC20 and the simulation unit 60. Data may also be transceived between a plurality of slave devices, i.e., between the counter unit 10 and the analog unit 60, by sequentially transmitting data frames over the field network 50.

The counter unit 10 is a data transmission device (communication coupler) that receives the pulse signal generated by the encoder 40 and transmits data indicating the number of pulses (hereinafter also referred to as "count value Ct") of the received pulse signal per sampling period Smc to the PLC 20.

The counter unit 10 is a slave device in a network (field network 50) in which the PLC20 is a master device, and is communicably connected to the PLC20 via the field network 50. The counter unit 10 transmits and receives data (more specifically, data frames) to and from the PLC20 at regular communication cycles, specifically, at control cycles Sct of the PLC 20.

The counter unit 10 is communicably connected to the encoder 40, and receives as input a pulse signal generated by the encoder 40. The counter unit 10 performs a process of counting the number of pulses (count value Ct) per sampling period Smc of the pulse signal received from the encoder 40, that is, a sampling process. The counter unit 10 generates a plurality of sample data Sd each indicating a count value Ct for each sampling period Smc, stores the plurality of sample data Sd in one data frame, and transmits (transfers) the plurality of sample data Sd to the PLC 20.

Here, the sampling period Smc refers to "time interval per sampling process" executed by the counter unit 10, and is smaller than the control period Sct. The counter unit 10 performs sampling processing, in other words, oversampling, a plurality of times in one control period Sct. The counter unit 10 stores a plurality of sample data Sd each indicating a count value Ct measured in each sampling process in one data frame, and transmits the data Sd to the PLC20 for each control cycle Sct. The counter unit 10 stores n pieces of sample data Sd indicating the measurement results (count values Ct) of the respective sampling processes performed n times in one control cycle Sct in one data frame, and transmits the data to the PLC20 every control cycle Sct.

The encoder 40 is a device that outputs a measurement result to the counter unit 10, and specifically, is a pulse signal generating apparatus (measuring device) that outputs a pulse signal corresponding to a measurement amount to the counter unit 10. The encoder 40 is mounted on the conveyor, for example, and generates a pulse signal according to the movement amount of the conveyor, that is, according to the movement amount of the workpiece. The encoder 40 outputs a pulse wave to the counter unit 10 every time the conveyor (i.e., the workpiece) moves by a prescribed amount.

The analog unit 60 is a data transmission device (communication coupler) that receives the analog signal generated by the sensor 70 and transmits data indicating the value of the received analog signal Smc (hereinafter also referred to as "analog value Al") at each sampling period Smc to the PLC 20.

The simulation unit 60 is a slave device in a network (field network 50) in which the PLC20 is a master device, and is communicably connected to the PLC20 via the field network 50. The analog unit 60 transmits and receives data (more specifically, data frames) to and from the PLC20 at regular communication cycles, more specifically, at control cycles Sct of the PLC 20.

The analog unit 60 is communicably connected to the sensor 70, and receives as input an analog signal generated by the sensor 70. The analog unit 60 performs a process of measuring a value (analog value Al) of the analog signal received from the sensor 70 for each sampling period Smc, that is, performs a sampling process. The analog unit 60 generates a plurality of sample data Sd each representing an analog value Al of each sampling period Smc, saves the plurality of sample data Sd into one data frame, and transmits (transfers) the plurality of sample data Sd to the PLC 20.

Here, the sampling period Smc of the analog unit 60, that is, the "time interval per sampling process" performed by the analog unit 60 is smaller than the control period Sct. The analog unit 60 performs sampling processing, in other words, oversampling, a plurality of times in one control period Sct. The analog unit 60 stores a plurality of sample data Sd each indicating the analog value Al measured in each sampling process in one data frame, and transmits the data Sd to the PLC20 for each control cycle Sct. The analog unit 60 stores n pieces of sampling data Sd representing the measurement results (analog values Al) of the respective sampling processes performed n times in one control cycle Sct into one data frame, and transmits the data to the PLC20 every control cycle Sct.

The sensor 70 is a device that outputs a measurement result to the analog unit 60, specifically, an analog signal generating device (measuring device) that outputs an analog signal corresponding to a measurement amount to the counter unit 10, and is, for example, a length measuring sensor. The sensor 70 is mounted, for example, on the head of the conveyor, and generates an analog signal according to the distance from the workpiece mounted on the conveyor.

In the control system 1 illustrated in fig. 2, the tools 30(a) and 30(B) are connected to the PLC20 and the counter unit 10 via a communication cable, for example, a Universal Serial Bus (USB) cable. In the following description, when it is not necessary to distinguish between the tools 30(a) and 30(B), the tool is simply referred to as "tool 30".

The tool 30 is a setting device that generates various kinds of setting information and the like for the control system 1 and sets the generated setting information to each device constituting the control system 1. The tool 30 typically comprises a general purpose computer. For example, the information processing program executed by the tool 30 may be stored in a Compact Disk-Read Only Memory (CD-ROM) not shown and distributed. The program stored in the CD-ROM is read by a CD-ROM drive device, not shown, and stored in a hard disk or the like of the tool 30. Alternatively, the tool 30 may be configured to download a program similar to the program stored in the DVD-ROM from a host computer or the like via a network. Moreover, the tool 30 may also be implemented via a Human Machine Interface (HMI).

The tool 30 includes, for example, a display unit that displays predetermined information about the control system 1. The tool 30 receives a user operation from, for example, a user, and the tool 30 changes various settings of the control system 1 (for example, each of the PLC20, the counter unit 10, and the simulation unit 60) in accordance with the received user operation. The tool 30 generates setting information of each of the counter unit 10 and the simulation unit 60, that is, acquires setting information corresponding to the user operation, based on the received user operation.

The setting information includes, for example, "information indicating the number of times of sampling processing executed by each of the counter unit 10 and the analog unit 60 in one control cycle Sct". The "information indicating the number of times of sampling processing executed by each of the counter unit 10 and the analog unit 60 in one control period Sct" may be information indicating the sampling period Smc and the control period Sct of each of the counter unit 10 and the analog unit 60.

The setting information may include, for example, information indicating "the number of pulse signals that can be received by the counter unit 10 in one sampling process" and "the amount of change in the analog value Al that can be changed in one sampling period Smc". Here, the "number of pulse signals that can be received by the counter unit 10 in one sampling process" can be calculated in accordance with at least one of the specification and application (use application of the pulse signal generating apparatus) of the pulse signal generating apparatus such as the encoder 40. When counting the pulse signals from the pulse signal generator, the number of pulse signals that can be received by the counter unit 10 per unit time is predetermined according to the resolution and the number of revolutions (maximum number of revolutions) of the pulse signal generator. The maximum rotation speed may be determined according to the specification (spec, performance) of the pulse signal generating device, or may be determined according to the application. For example, if the application is "a low-speed application in which the pulse signal generating device rotates at 360-resolution and 60rpm at maximum", the maximum rotational speed is assumed to be 60rpm even if the pulse signal generating device can rotate at a higher speed in the specification. Therefore, the "number of pulse signals that can be received by the counter unit 10 in one sampling process" can be calculated from "the resolution and the maximum number of revolutions of the pulse signal generation device" that is predetermined in accordance with at least one of the specification and the application. Therefore, instead of the information indicating the number of pulse signals that can be received by the counter unit 10 in one sampling process, the setting information may include information indicating "the resolution and the maximum number of revolutions of the pulse signal generating apparatus" that is predetermined in accordance with at least one of the specification and the application.

Further, the setting information may include information indicating "a pulse counting method type indicating whether the pulse counting method of the counter unit 10 is unidirectional or bidirectional". The pulse counting type may indicate whether the pulse signal output from the pulse signal generating device such as the encoder 40 is a unidirectional pulse signal or a bidirectional pulse signal.

The tool 30 uses the acquired setting information to generate information about the data frame received by the PLC20 from each of the counter unit 10 and the analog unit 60, in particular, information indicating the data size of the sample data Sd. The tool 30 sets the generated "information related to the data frame" to at least one of the PLC20, the counter unit 10, and the simulation unit 60.

For example, the tool 30 acquires setting information of the counter unit 10 indicating "the number of pulse signals that the counter unit 10 can receive in one sampling process", the sampling period Smc of the counter unit 10, the pulse counting method, and the like. As described above, the information indicating "the number of pulse signals that the counter unit 10 can receive in one sampling process" may also be information indicating the resolution and the maximum rotation speed of the encoder 40.

The tool 30 generates information on the data frame transmitted from the counter unit 10 to the PLC20, in particular, information indicating the data size of the sample data Sd, based on the acquired setting information and control period Sct of the counter unit 10. For example, the tool 30 calculates the data size of each of the sample data Sd (2) to Sd (n) indicating the measurement result of "the sampling processing performed by the counter unit 10 for the second and subsequent times in the primary control period Sct". In the following description, the data size of each of the sample data Sd (2) to Sd (n) is also referred to as a "compressed size". The tool 30 sets (notifies) the calculated compression size to at least one of the PLC20 and the counter unit 10 as information on the data frame transmitted by the counter unit 10.

Similarly, the tool 30 acquires the setting information and the control period Sct of the simulation unit 60, and generates information on the data frame transmitted from the simulation unit 60 to the PLC20, based on the setting information and the control period Sct of the simulation unit 60. For example, the tool 30 calculates the data size (compressed size) of each of the sample data Sd (2) to Sd (n) indicating the measurement result of "the sampling process performed by the simulation unit 60 for the second and subsequent times in the primary control period Sct". Tool 30 sets the calculated compression size to at least one of PLC20 and simulation unit 60.

(example of application of control System)

Fig. 3 is a diagram showing an application example of the control system 1 illustrated in fig. 2. As shown in fig. 3 (a), the control system 1 is used, for example, for inspecting the shape of a workpiece 80 that is placed on and moved by a conveyor. The encoder 40 outputs a pulse signal corresponding to the position of the conveyor, i.e., the position of the workpiece 80, and the sensor 70 outputs an analog signal corresponding to the distance up to the workpiece 80.

When the conveyor speed is not fixed, as shown in fig. 3 (B), when the distance (negative direction) is taken as the vertical axis and the time is taken as the horizontal axis, the conveyor speed (i.e., the change per unit time in the position of the workpiece 80) changes, and thereby the measured shape of the workpiece 80 is deformed as shown in fig. 3 (C). On the other hand, as shown in fig. 3D, when the distance (negative direction) is taken as the vertical axis and the position is taken as the horizontal axis, the data is the same regardless of the workpiece position and the conveyor speed, and thus the pattern matching can be easily performed.

(function of data transmission device in control System)

As described above with reference to fig. 2 and 3, the counter unit 10 and the analog unit 60 each execute sampling processing a plurality of times (for example, n times) in one control period Sct. Each of the counter unit 10 and the analog unit 60 transmits a plurality of sample data Sd corresponding to the measurement result of each of the plurality of executed sampling processes to the PLC 20. That is, the counter unit 10 and the analog unit 60 each transmit the sample data Sd of the number of sampling times to the PLC20 for each control cycle Sct. For example, in the case where the sampling process is performed n times in one control cycle Sct, n pieces of sampling data Sd indicating n measurement results (for example, n count values Ct) measured in each of the n sampling processes are transmitted to the PLC20 for each control cycle Sct.

In the implementation of such oversampling, generally, the data size of the sampled data Sd becomes a problem in terms of the limitation within the system. In particular, when the counter unit 10 is used in combination with the analog unit 60 as in the control system 1, the data size of the data (more precisely, the data frame) transmitted over the field network 50 in one control cycle Sct becomes enormous.

For example, in the case where the control period Sct is 1ms and the sampling period Smc is 10 μ s, the counter unit 10 generates 100 count values Ct per control period Sct, and transmits 100 pieces of sampling data Sd per control period Sct to the PLC 20. If one sample data Sd is 4 bytes, the data size of the data frame repeatedly transmitted to the PLC20 by the counter unit 10 in each control cycle Sct is 400 bytes or more, which is 100 times larger.

Similarly, in the case where the control period Sct is 1ms and the sampling period Smc is 10 μ s, the analog unit 60 generates 100 count values Ct for each control period Sct, and transmits 100 pieces of sampling data Sd to the PLC20 for each control period Sct. If one sample data Sd is 2 bytes, the data size of the data frame repeatedly transmitted to the PLC20 by the analog unit 60 in each control cycle Sct becomes 200 bytes or more, which is 100 times the data size.

Here, in the control system 1, the upper limit of the data size of the data frame repeatedly transmitted to the PLC20 by each of the counter unit 10 and the analog unit 60 in each control cycle Sct is set to, for example, 1024 bytes at maximum. In addition, the data size of the data (more precisely, the data frame) repeatedly transmitted in each control cycle Sct over the field network 50 is also set to, for example, an upper limit of 5736 bytes at the maximum for the entire field network 50.

Therefore, the counter unit 10 and the analog unit 60 each compress the data size of the sample data Sd transmitted to the PLC20 in one control cycle Sct to alleviate the problem of data size limitation on the system.

(data compression)

Fig. 4 is a diagram for explaining an outline of data compression processing executed in the control system 1. As shown in fig. 4 (a), each of the counter unit 10 and the analog unit 60 performs sampling processing a plurality of times in one control period Sct (also referred to as "scan time"). The counter unit 10 acquires the count value Ct in each of the sampling processes performed a plurality of times in the one-time control period Sct, and the analog unit 60 acquires the analog value Al in each of the sampling processes performed a plurality of times in the one-time control period Sct.

As shown in fig. 4 (B), each of the counter unit 10 and the analog unit 60 compresses the sample data Sd transmitted to the PLC20 at each control cycle Sct. Specifically, the sample data Sd transmitted to the PLC20 by each of the counter unit 10 and the analog unit 60 in each control cycle Sct is only the first sample data Sd (1) which is full-size data. The remaining sample data Sd (2) to Sd (n) are data of a reduced size.

The full size is, for example, a data size of the sample data Sd directly stored as a measurement result of the first sampling process (for example, the count value Ct (1) or the analog value Al (1)), and is "4 bytes" unless otherwise specified in the following description.

In contrast, the "compressed size" which is the data size of the "remaining sample data Sd" is a data size (number of bits) sufficient to express the measurement result that can be changed within one sample period Smc. The counter unit 10 and the analog unit 60 each compress a bit string representing the measurement result of each sampling process after the second time to "a size sufficient to represent the measurement result that can be changed within one sampling period Smc (i.e., a compressed size)". Regarding the "compressed size", details will be described later using fig. 7 to 10.

That is, the counter unit 10 executes the sampling processing a plurality of times in one control cycle Sct, and transmits, to the PLC20, the sampling data Sd indicating the count value Ct counted in each of the executed plurality of sampling processing for each control cycle Sct. The counter unit 10 compresses the data size of "sample data Sd (2) to Sd (n)" each representing a count value Ct (2) to Ct (n) "into a compressed size, and transmits the compressed size to the PLC20 for each control cycle Sct.

Similarly, the analog unit 60 performs sampling processing a plurality of times in one control cycle Sct, and transmits, to the PLC20, sampling data Sd representing the analog value Al measured in each of the performed plurality of sampling processing, for each control cycle Sct. The simulation unit 60 compresses the data size of each of the "sampling data Sd (2) to Sd (n)" representing the simulation values Al (1) to Al (n), respectively, into a compressed size, and transmits the compressed size to the PLC20 for each control period Sct.

(Effect by data transfer device)

Fig. 5 is a table illustrating the effects achieved by each of the counter unit 10 and the analog unit 60. In fig. 5, the data size of the measurement result measured in one sampling process by each of the design counter unit 10 and the analog unit 60 is 4 bytes, that is, the full size of the sampling data Sd is 4 bytes. For example, when the control period Sct is 1ms and the sampling period Smc is 10 μ s, that is, when 100 pieces of sampling data Sd are transmitted to the PLC20 per control period Sct, the data size in the present embodiment is as follows with respect to the data size in the related art.

That is, conventionally, 100 pieces of 4-byte sample data Sd, that is, 400 bytes of data per channel (for example, per data frame) are repeatedly transmitted to the PLC20 every control cycle Sct.

In contrast, in the counter unit 10, the data size of the first sample data Sd (1) indicating the count value Ct (1) of the sampling process executed for the first time in the one-time control period Sct is still 4 bytes. Then, the counter section 10 compresses the data size of each of the remaining 99 pieces of sample data Sd (2) to Sd (99).

For example, in a case where the counter unit 10 compresses the data size of each of the remaining 99 sample data Sd to 1 byte, the data size of one data frame transmitted to the PLC20 by the counter unit 10 at each control cycle Sct is 103 bytes. This corresponds to about 26% of the conventional 400 bytes.

Further, in a case where the counter unit 10 compresses the data size of each of the remaining 99 sample data Sd to 2 bits, the data size of one data frame transmitted to the PLC20 by the counter unit 10 per control period Sct is about 29 bytes. This corresponds to about 7.25% of the conventional 400 bytes.

Construction example 2

The outline of the control system 1 has been described so far with reference to fig. 2 to 5. Next, details of the counter unit 10, the simulation unit 60, the PLC20, and the tool 30 will be described. The counter unit 10, the details of which will be described below with reference to fig. 1 and the like, is summarized first as follows.

The counter unit 10 (data transfer device) is a data transfer device that stores a plurality of sampling data Sd indicating the measurement results (count values Ct) of the respective sampling processes performed a plurality of times in one control cycle Sct into one data frame, and transmits the data to the PLC20 (control device) at each control cycle Sct. The counter unit 10 includes an acquisition section 120 and a compression section 130. The acquisition unit 120 acquires measurement results (for example, each of count values Ct (1) to Ct (n)) of each sampling process executed a plurality of times (for example, n times). When the maximum amount Vmax of the change between the measurement results (for example, the count value Ct (m) and the count value Ct (m-1)) of two sampling processes continuously executed in one control cycle Sct is determined in advance, the compression unit 130 executes the following compression process. That is, the compressing section 130 compresses the measurement results of the respective sampling processes of the second time and thereafter into the sample data Sd of a size that can express "the maximum amount Vmax of change between the measurement results of two sampling processes continuously executed in the primary control period Sct".

Here, as described above, the "compression size" is "a data size (number of bits) sufficient to express a measurement result that can be changed within one sampling period Smc". In other words, the "compression size" is a size (number of bits) that can express "the maximum amount Vmax of change between the measurement results of two sampling processes continuously performed in one control period Sct".

That is, when the compression size is determined in advance, the compression unit 130 compresses the count values Ct (2) to Ct (n) into the respective sample data Sd (2) to Sd (n) of the compression size.

According to this configuration, when the maximum amount Vmax is predetermined, the counter unit 10 compresses the sample data Sd (2) to Sd (n) to a data size (that is, a compression size) in which the maximum amount Vmax can be expressed, and transmits the compressed sample data to the PLC 20.

Therefore, the counter unit 10 exerts the following effects: the data size of the data frame transmitted to the PLC20 at each control cycle Sct can be suppressed as compared with the case where the count values Ct (2) to Ct (n) are transmitted without being compressed.

Here, when the change may be positive or negative, for example, when the range of the change is between "-127" and "127", 1 byte, which is 8 bits obtained by adding 1 bit to 7 bits that can express "127", is the data size that can express the maximum amount Vmax. Similarly, for example, when the range of the variation is between "-1" and "1", 2 bits obtained by adding 1 bit to 1 bit that can express "1" are the data size that can express the maximum amount Vmax.

In addition, when the change is always positive or always negative, for example, when the range of the change is "0" or more and "255" or less, 1 byte, which is 8 bits and can express "255", has a data size capable of expressing the maximum amount Vmax. Similarly, for example, when the range of the variation is "0" or more and "1" or less, 1 bit which can express "1" becomes a data size which can express the maximum amount Vmax.

In the counter unit 10, the sampling process is a process of counting the number of pulses of the pulse signal, and the measurement result of the sampling process is the counted number of pulses (i.e., count value Ct).

According to the above configuration, when the maximum amount Vmax is predetermined, the counter section 10 compresses the sample data Sd indicating the count value Ct measured in each of the second and subsequent sampling processes to a data size capable of expressing the maximum amount Vmax. That is, when the maximum amount Vmax is predetermined, the counter section 10 compresses the sample data Sd (2) to Sd (n) indicating the respective count values Ct (2) to Ct (n) to a compressed size.

Here, in the sampling process of counting the number of pulses of the pulse signal, the number of pulses measurable in one sampling process is determined in advance, that is, in the case where the sampling process is a process of counting the number of pulses, the maximum amount Vmax is determined in advance.

More specifically, the number of pulse signals that the counter unit 10 can receive from "a pulse signal generating device that generates a pulse signal according to a detected amount, such as the encoder 40 or a flow meter" in one sampling process has been determined in advance. For example, when counting (i.e., counting) the pulse signals from the encoder 40, the number of pulse signals that can be received by the counter unit 10 per unit time is predetermined according to the resolution and the rotation speed (maximum rotation speed) of the encoder 40. The maximum rotation speed may be determined according to the specification (spec, performance) of the encoder 40, or may be determined according to the application (use application of the encoder 40). For example, if the application is "a low-speed application in which the encoder 40 rotates at a maximum of 60rpm (1 rotation per 1 second) with 360 resolution", the maximum rotation speed is assumed to be 60rpm even if the encoder 40 can rotate at a higher speed in the specification. That is, the number of pulse signals that can be received by the counter unit 10 in one sampling process is predetermined in accordance with at least one of the specification and application of the encoder 40 (pulse signal generation device).

Therefore, the counter unit 10 exerts the following effects: the sampling data Sd indicating the count value Ct measured in each sampling process at the second time and thereafter can be compressed to a data size in which the maximum amount Vmax can be expressed, and sent to the PLC 20.

In the counter unit 10, the data size that can express the maximum amount Vmax is predetermined depending on (1) the absolute value of the number of pulses countable in one sampling process and (2) whether the pulse counting manner of the sampling process is bidirectional or unidirectional.

According to the above configuration, in the counter unit 10, the data size that can express the maximum amount Vmax is determined in advance based on (1) the absolute value of the countable number of pulses in one sampling process and (2) the pulse counting method.

In the case where the pulse count manner is bidirectional, the change between the measurement results of two sampling processes continuously performed in one control period Sct may be either positive or negative. For example, in the case where "the absolute value of the countable number of pulses in one sampling process" is "127", the change between the measurement results of two sampling processes continuously performed in one control period Sct may be expressed as "-127 to 127". Therefore, the data size capable of expressing the maximum amount Vmax is the number of bits obtained by adding 1 bit to the number of bits capable of expressing "the absolute value of the number of pulses countable in one sampling process".

In the case where the pulse count mode is unidirectional, the change between the measurement results of two sampling processes continuously performed in one control period Sct is always positive or always negative. For example, in the case where "the absolute value of the countable number of pulses in one sampling process" is "255", the change between the measurement results of two sampling processes continuously performed in one control period Sct may be expressed as "0 to 255". Therefore, the data size that can express the maximum amount Vmax becomes the number of bits that can express "the absolute value of the number of pulses countable in one sampling process".

Therefore, the counter unit 10 exerts the following effects: since the maximum amount Vmax is determined in advance, the sample data Sd indicating the count value Ct measured in each of the second and subsequent sampling processes can be compressed to a data size in which the maximum amount Vmax can be expressed.

In the counter unit 10, the compression unit 130 extracts a bit string including the lowest-order bit and having the number of bits expressing the maximum amount Vmax from among bit strings indicating the measurement results of the second and subsequent sampling processes, and sets the extracted bit string as the sample data Sd. The compression unit 130 extracts, for example, a "bit string of a compressed size amount including the lowest bit" from "a bit string indicating each of the count values Ct (2) to Ct (n)", and stores the extracted bit string in the data frame as sample data Sd (2) to Sd (n).

According to the configuration, the counter unit 10 takes, as the sample data Sd, a bit string containing the number of bits expressible by the maximum amount Vmax of the lowermost bits, which is extracted from bit strings representing measurement results of the respective sampling processes at the second time and thereafter.

It is clear that the "bit string including the lowest bit and expressing the number of bits of the maximum amount Vmax" extracted from this bit string is smaller in data size than the bit string indicating the measurement result of each sampling process at the second time and thereafter.

Therefore, the counter unit 10 exerts the following effects: the bit string representing the measurement result of each sampling process at the second time or later can be compressed into "a bit string containing the lowest bits and expressing the number of bits of the maximum amount Vmax" extracted from this bit string.

For example, when the bit string indicating the measurement result of each sampling process is 4 bytes, if the range of the change is greater than or equal to "-127" and less than or equal to "127", the data size expressing the maximum amount Vmax is 1 byte, and therefore the counter unit 10 performs the following compression. That is, the counter unit 10 compresses a bit string of 4 bytes indicating the measurement result of each sampling process at the second time and thereafter into sample data Sd of 1 byte.

Similarly, if the range of the variation is "1" or more and "1" or less, the data size that can express the maximum amount Vmax is 2 bits, and therefore the counter unit 10 compresses the 4-byte bit string representing the measurement result of each sampling process for the second and subsequent times into 2 bits. Further, if the range of the change is "0" or more and "1" or less, the data size that can express the maximum amount Vmax is 1 bit, and therefore the counter unit 10 compresses the 4-byte bit string representing the measurement result of each of the sampling processes at the second and subsequent times to 1 bit.

The counter unit 10 and the like described in the summary so far are described below with reference to fig. 1, and the configuration thereof will be described in detail, and the processing performed by the counter unit 10 will be described below with reference to fig. 6.

(details of counter unit)

Fig. 1 is a block diagram showing the configuration of a main part such as a counter unit 10 included in a control system 1. As shown in fig. 1, the counter unit 10 includes, as functional blocks, a measurement section 110, an acquisition section 120, a compression section 130, and a transmission section 140.

The measurement section 110 performs sampling processing, that is, receives a pulse signal generated by the pulse signal generation device from a measurement device such as the encoder 40 (pulse signal generation device), and counts the number of pulses (count value Ct) of the received pulse signal. The measurement unit 110 executes sampling processing a plurality of times (for example, n times) in one control cycle Sct, and notifies the acquisition unit 120 of count values Ct (for example, count values Ct (1) to Ct (n)) measured in each sampling processing.

The transmission unit 140 repeatedly transmits the data frame to the PLC20 for each control cycle Sct. The transmission unit 140 stores a plurality of sample data Sd each indicating "count value Ct measured in each sampling process" in a data frame transmitted to the PLC20 for each control cycle Sct. For example, in the data frame, sample data Sd (1) to Sd (n) each indicating "count values Ct (1) to Ct (n)) measured in each sampling process from the first time to the nth time" is stored.

The acquisition unit 120 directly stores, as sample data Sd (1), a bit string indicating the count value Ct (1) measured in the first sampling process in the data frame for the count value Ct acquired from the measurement unit 110. The acquisition unit 120 transmits a bit string indicating the count value Ct measured in each of the second and subsequent sampling processes to the compression unit 130, and transmits a bit string indicating each of the count values Ct (2) to Ct (n), for example, to the compression unit 130.

The compression unit 130 compresses the "bit string indicating the count value Ct measured in each of the second and subsequent sampling processes" acquired from the acquisition unit 120 into a "compression-size" bit string. The compression unit 130 stores each of the plurality of bit strings compressed to the "compression size" in the data frame as sample data Sd indicating "a count value Ct measured in each of the second and subsequent sampling processes".

Specifically, the compression unit 130 compresses a bit string indicating the count value Ct (2) into a "compressed size" bit string, and stores the bit string as sample data Sd (2) in the data frame. The compression unit 130 compresses the bit string indicating the count value Ct (3) into a "compressed size" bit string, and stores the bit string as sample data Sd (3) in the data frame. Similarly, the compression unit 130 compresses the bit string indicating the count value ct (n) into a "compressed-size" bit string, and stores the bit string as sample data sd (n) in the data frame.

The compression unit 130 may compress the "bit string indicating the count value Ct measured in each of the second and subsequent sampling processes" by using a "compression size" set in advance by the tool 30.

The "compression size" is a data size (number of bits) sufficient to express "the count value Ct which is variable within one sampling period Smc". In other words, "the count value Ct that is changeable within one sampling period Smc" is "the maximum amount Vmax of the count value Ct that can be counted by the measurement section 110 in one sampling period Smc (i.e., the range of the count value Ct that can be counted in one sampling process)". That is, "the count value Ct changeable within one sampling period Smc" is "the maximum amount Vmax of the change between the count values Ct counted in two sampling processes continuously performed in one control period Sct". Therefore, the "compression size" is a number of bits that can express "the maximum amount Vmax of the change between the count values Ct counted by the measurement section 110 in two sampling processes continuously executed in one control cycle Sct".

The maximum amount Vmax, which is the "count value Ct that can be changed within one sampling period Smc", is determined based on the "absolute value of the number of pulses that can be counted by the measurement unit 110 in one sampling process" and the "pulse counting method by the measurement unit 110".

The "absolute value of the number of pulses countable in one sampling process" can be calculated as a value obtained by dividing the sampling period Smc by the shortest period of the pulse signal (the shortest pulse period Plcmin) "by a decimal point or less.

When the pulse counting method of the measurement unit 110 is bidirectional, the change from the count value Ct (m-1) of the m-1 th sampling process to the count value Ct (m) of the m-th sampling process may be positive or negative. For example, when "the absolute value of the countable pulse number in one sampling process" is "127", the maximum value Vmax, which is the maximum amount Vmax of the change from the count value Ct (m-1) to the count value Ct (m), may be expressed as "-127 to 127".

Therefore, when the pulse counting method of the measuring unit 110 is bidirectional, the number of bits obtained by adding 1 bit to the number of bits that can express "the absolute value of the number of pulses countable in one sampling process" becomes "the compression size".

When the pulse counting method of the measurement unit 110 is unidirectional, the change from the count value Ct (m-1) to the count value Ct (m) is always positive or always negative. For example, when "the absolute value of the number of pulses countable in one sampling process" is "255", the maximum amount Vmax, which is the maximum amount of change from count value Ct (m-1) to count value Ct (m), may be "0 to 255".

Therefore, when the pulse counting method of the measuring unit 110 is unidirectional, the number of bits that can express "the absolute value of the number of pulses countable in one sampling process" is "the compression size".

The compression unit 130 extracts, as the lower bit string Lb, a "bit string of a compression size amount including the lowest bit" from, for example, "a bit string indicating the count value Ct measured in each of the second and subsequent sampling processes. The compression unit 130 stores the extracted lower bit string Lb in the data frame as sample data Sd.

For example, when the compression size is 1 byte, the compression unit 130 extracts the lower bit strings Lb (2) to Lb (n) which are "bit strings of 1 byte containing the lowest bit" from among the bit strings indicating the respective count values Ct (2) to Ct (n). The compression unit 130 stores the extracted lower bit sequences Lb (2) to Lb (n) in the data frame as sample data Sd (2) to Sd (n).

In the following description, the "bit string of the compressed size amount including the lowest bit" indicating the bit string of the count value Ct is referred to as a lower bit string Lb indicating the bit string of the count value Ct. A bit string other than the "bit string of the compressed size amount including the lowest bit" of the bit string representing the count value Ct is referred to as an upper bit string Hb of the bit string representing the count value Ct. That is, the upper bit string Hb of the count value Ct is a bit string other than the lower bit string Lb that represents the bit string of the count value Ct.

Action example 3

Fig. 6 is a diagram showing an outline of processing performed by the counter unit 10, and particularly, fig. 6 (a) is a flowchart showing an example of data compression processing performed by the counter unit 10. The acquisition unit 120 acquires, from the measurement unit 110, a count value Ct (1) counted by the measurement unit 110 in the sampling process executed for the first time in the one-time control cycle Sct (S110). The acquisition unit 120 determines whether or not the count value Ct (p) acquired from the measurement unit 110 ("p" is an integer of "1" or more and "n" or less) is the second or subsequent count values Ct (2) to Ct (n) (S120).

If the acquisition unit 120 determines that the count value Ct (p) acquired from the measurement unit 110 is not the second or subsequent count values Ct (2) to Ct (n), that is, that the count value Ct (1) is acquired (no in S120), the following processing is executed. That is, the acquisition unit 120 directly stores the bit string indicating the count value Ct (1) as the sample data Sd (1) in the data frame, that is, updates the sample data Sd (1) with the bit string indicating the count value Ct (1) (S140).

When the acquisition unit 120 determines that the count value Ct (p) acquired from the measurement unit 110 is any of the second and subsequent count values Ct (2) to Ct (n) (yes in S120), the acquired count value Ct (p) is output to the compression unit 130. The compression unit 130 derives "a bit string of a compressed size amount including the lowest bit" as a "lower bit string lb (p)" (S130) from the count value ct (p) (more precisely, a bit string indicating "the count value ct (p)") acquired from the acquisition unit 120. The compression unit 130 stores the lower bit string lb (p) derived from the count value ct (p) as sample data sd (p) in a data frame, i.e., updates the corresponding sample data sd (p) with the lower bit string lb (p) (S140).

The acquisition unit 120 determines whether or not all count values Ct (1) to Ct (n) have been acquired from the measurement unit 110 (S150). When the acquisition unit 120 determines that all the count values Ct (1) to Ct (n) have been acquired (yes in S150), the process ends. If the acquisition unit 120 determines that all the count values Ct (1) to Ct (n) have not been acquired (no in S150), the next count value Ct (p +1) is acquired from the measurement unit 110 (S160).

By performing the processing shown in fig. 6 (a), the counter section 10 generates data frames in which only the sample data Sd (1) is full-size and the sample data Sd (2) to Sd (n) are respectively compressed-size, as shown in fig. 6 (B).

The processing performed by the counter unit 10 (in other words, the control method performed by the counter unit 10) described so far with reference to fig. 6 can be organized as follows. That is, the process (control method) performed by the counter unit 10 is a control method of a data transfer apparatus that saves a plurality of sampling data Sd representing the measurement results (for example, count values Ct) of the respective sampling processes performed a plurality of times in one control cycle Sct into one data frame and transmits to the PLC20 in each control cycle Sct. The processing performed by the counter unit 10 includes: an acquisition step (S110 and S160) of acquiring measurement results (for example, count values Ct (1) to Ct (n)) of each sampling process executed a plurality of times (for example, n times); and a compression step (S130) for compressing, when a maximum amount Vmax of a change between measurement results of two sampling processes continuously executed in one control cycle Sct has been determined in advance, the measurement results of the second and subsequent sampling processes among the plurality of measurement results acquired in the acquisition step into sample data Sd of a data size capable of expressing the maximum amount Vmax.

According to the above configuration, in the control method, when the maximum amount Vmax is predetermined, the sample data Sd indicating the measurement result of each of the second and subsequent sampling processes is compressed to a data size (that is, a compression size) in which the maximum amount Vmax can be expressed, and is transmitted to the PLC 20. That is, in the control method, when the maximum amount Vmax is predetermined, the sampling data Sd (2) to Sd (n) indicating the count values Ct (2) to Ct (n) are compressed to a data size that can express the maximum amount Vmax, and sent to the PLC 20.

Therefore, the control method has the following effects: the data size of the data frame transmitted to the PLC20 at each control cycle Sct can be suppressed as compared with the case where the measurement results of the second and subsequent sampling processes are not compressed.

Here, when the change may be either positive or negative, for example, when the range of the change is between "-127" and "127", 1 byte, which is 8 bits obtained by adding 1 bit to 7 bits that can express "127", is the data size that can express the maximum amount Vmax. Similarly, for example, when the range of the variation is "-1" or more and "1" or less, 2 bits obtained by adding 1 bit to 1 bit that can express "1" are the data size that can express the maximum amount Vmax.

In addition, when the change is always positive or always negative, for example, when the range of the change is "0" or more and "255" or less, 1 byte, which is 8 bits and can express "255", has a data size capable of expressing the maximum amount Vmax. Similarly, for example, when the range of the variation is "0" or more and "1" or less, 1 bit which can express "1" becomes a data size which can express the maximum amount Vmax.

(outline of data frame)

Fig. 7 is a diagram showing an outline of a data frame repeatedly transmitted to the PLC20 by each of the counter unit 10 and the analog unit 60 at each control cycle Sct. In the data frame transmitted to the PLC20 in each control cycle Sct, the transmission unit 140 sets only the first sample data Sd (1) to the full size, and sets the remaining sample data Sd (2) to Sd (n) to the compressed size.

For example, the measurement unit 110 performs the sampling process n times in one control cycle Sct. The measurement unit 110 generates a count value Ct (1) in the first sampling process, a count value Ct (2) in the second sampling process, and a count value Ct (3) in the third sampling process. Similarly, the measurement unit 110 generates a count value ct (n) in the nth sampling process.

That is, the measurement unit 110 executes the sampling process n times in one control cycle Sct, thereby generating n count values Ct from the count value Ct (1) to the count value Ct (n) corresponding to each sampling process. The counter section 10 generates sample data Sd (1) to Sd (n) corresponding to the count values Ct (1) to Ct (n), respectively.

The counter section 10 sets only the sample data Sd (1) as full-size data, and sets the remaining sample data Sd (i.e., each of the sample data Sd (2) to the sample data Sd (n)) as compressed-size data. Then, the counter unit 10 (particularly the transmission unit 140) repeatedly transmits the data frame in which the n pieces of sample data Sd from the sample data Sd (1) to the sample data Sd (n) are stored to the PLC20 for each control cycle Sct.

(compressed size)

Fig. 8 is a diagram illustrating the data size, i.e., the compression size, of each of the sample data Sd (2) to Sd (n) transmitted to the PLC20 by the counter unit 10 and the analog unit 60 in each control cycle Sct.

The compressed size of each of the sample data Sd (2) to Sd (n) indicating the count values Ct (2) to Ct (n) counted by the measurement unit 110 for each sampling period Smc is sufficient to represent the count value Ct that is variable within one sampling period Smc. That is, the compression size is a data size that can express the maximum amount Vmax of change between two count values Ct counted by the measurement section 110 in each of two sampling processes continuously executed in one control cycle Sct. In other words, the compression size is a data size that can express the maximum amount Vmax of the variation between the count value Ct (m) measured in the "m" th sampling process and the count value Ct (m-1) measured in the "m-1" th sampling process immediately before it.

When the maximum amount Vmax, which is the range of the change in the count value Ct that can be changed within one sampling period Smc, is, for example, — 127 "or more and" 127 "or less, 8 bits (1 byte) obtained by adding 1 bit to 7 bits that can express" 127 "is a compressed size. Similarly, when the range of the change in the count value Ct that can be changed within one sampling period Smc is, for example, between "-1" and "1", 2 bits obtained by adding 1 bit to 1 bit that can express "1" are set as the compressed size. When the range of the change in the count value Ct that can be changed within one sampling period Smc is, for example, "0" or more and "255" or less, 8 bits (1 byte) that can express "255" are a compressed size.

(Absolute value of countable number of pulses within one sampling period)

Fig. 9 is a diagram illustrating "the absolute value of the number of pulses countable by the counter unit 10 (particularly the measurement section 110) within one sampling period Smc". Even if the pulse counting method of the measuring unit 110 is bidirectional, the number of pulses counted by the measuring unit 110 changes by "1" each time a pulse signal is received (or changes by "-1" each time).

Therefore, the "absolute value of the number of pulses countable in one sampling process" depends on the sampling period Smc and the highest frequency of the pulse signal (highest pulse frequency). That is, since the "pulse period Plc" is "1/pulse frequency", the "shortest pulse period Pcmin" is "1/highest pulse frequency". Therefore, the "absolute value of the countable number of pulses in one sampling process" is "a value obtained by dividing the sampling period Smc by the shortest pulse period Plcmin (decimal point, up and down)".

(number of bits required for compressing data)

Fig. 10 is a diagram illustrating the maximum amount Vmax of the count value Ct that the counter unit 10 (particularly, the measurement section 110) can count within one sampling period Smc. When the pulse counting method of the measurement unit 110 includes a positive direction and a negative direction, that is, when the pulse counting method is bidirectional, the number of bits that can express "the maximum amount Vmax of the count value Ct that can be counted within one sampling period Smc" is as follows. That is, the number of bits that can express the maximum amount Vmax of the count value Ct that can be counted in one sampling period Smc becomes the number of bits obtained by adding 1 bit to the number of bits that can express "the absolute value of the number of pulses that can be counted in one sampling process". This is because, in addition to the number of bits that can express "the absolute value of the number of pulses countable in one sampling process", 1 bit for distinguishing whether it is a positive direction or a negative direction is necessary. Therefore, the number of bits not exceeding the half cycle (half) is required as the "absolute value of the number of pulses countable in one sampling process" as the compression size.

When the pulse count mode of the measurement unit 110 is unidirectional, "the maximum amount Vmax of the count value Ct countable within one sampling period Smc" is always positive or always negative. Therefore, the number of bits that can express the maximum amount Vmax of the count value Ct countable within one sampling period Smc becomes the number of bits that can express "the absolute value of the number of pulses countable in one sampling process".

(specific example of the number of bits required)

When the pulse counting method of the measurement unit 110 is bidirectional, if the absolute value of the number of pulses countable by the measurement unit 110 in one sampling period Smc is "127", the maximum amount Vmax is equal to or greater than "-127" and equal to or less than "127", and therefore, it can be expressed by 1 byte. Therefore, if the pulse counting manner is bidirectional and the absolute value of the countable number of pulses within one sampling period Smc is "127", the compression size is 1 byte.

Similarly, if the pulse counting manner is bidirectional and the absolute value of the countable number of pulses within one sampling period Smc is "32767", the compression size is 2 bytes. If the pulse counting manner is bidirectional and the absolute value of the countable number of pulses within one sampling period Smc is "1", the compression size is 2 bits.

When the pulse counting method of the measuring unit 110 is unidirectional, if the absolute value of the number of pulses countable by the measuring unit 110 in one sampling period Smc is "255", the compression size is 1 byte. If the pulse counting manner is one-way and the absolute value of the countable number of pulses within one sampling period Smc is "65535", the compression size is 2 bytes. If the pulse counting manner is unidirectional and the absolute value of the countable number of pulses within one sampling period Smc is "3", the compression size is 2 bits. If the pulse counting manner is unidirectional and the absolute value of the countable number of pulses within one sampling period Smc is "1", the compression size is 1 bit.

(details of PLC)

As shown in fig. 1, the PLC20 includes a data frame receiving section 210 and a restoring section 220 as functional blocks. The PLC20 may include an instruction unit or the like for controlling the control system 1 in addition to the above-described functional blocks, but in order to ensure the simplicity of description, a configuration that is not directly related to the present embodiment is omitted from the description and the block diagram. However, the PLC20 may also include the omitted configuration based on the actual implementation. The data frame receiving Unit 210 and the restoring Unit 220 can be realized by, for example, a Central Processing Unit (CPU) or the like reading out a program stored in a storage device realized by a Read Only Memory (ROM), a Non-Volatile Random Access Memory (NVRAM), or the like, into a Random Access Memory (RAM), or the like (not shown), and executing the program. The data frame receiving unit 210 and the recovery unit 220 in the PLC20 will be described below.

The data frame receiving unit 210 repeatedly receives the data frame transmitted from the counter unit 10 (particularly, the transmitting unit 140 of the counter unit 10) at each control cycle Sct. The data frame receiving unit 210 derives the sample data Sd (2) to Sd (n) compressed to a compressed size from the data frame received from the counter unit 10, and outputs the sample data Sd (2) to Sd (n) to the restoring unit 220. The data frame receiving unit 210 may derive the sample data Sd (1) that is not compressed to a compressed size from the data frame received from the counter unit 10, and directly store the sample data Sd (1) in a not-shown count value table.

The restoring unit 220 restores the respective sample data Sd (2) to Sd (n) compressed to the compressed size acquired from the data frame receiving unit 210 to the respective count values Ct (2) to Ct (n). The restoration unit 220 restores the count values Ct (2) to Ct (n) from the sample data Sd (2) to Sd (n) using, for example, the compression size notified (set) from the tool 30. The restoration unit 220 may restore the count values Ct (2) to Ct (n) from the sample data Sd (2) to Sd (n) using the compression size notified from the counter unit 10, for example.

The PLC20 including the data frame receiving unit 210 and the restoring unit 220 restores the measurement results (i.e., the count values Ct (2) to Ct (n)) of the second and subsequent sampling processes from the respective Sd (2) to Sd (n) compressed to the compressed size.

Thus, the PLC20 has the following effects: the count value Ct of each sampling process of the second time and later can be obtained from the sampling data Sd whose data size is suppressed as compared with the uncompressed state, similarly to the uncompressed state.

In the PLC20, the recovery unit 220 recovers the measurement result of each of the second and subsequent sampling processes so that the amount of change from the measurement result of the immediately preceding sampling process becomes equal to or less than the maximum amount Vmax, using the bit string indicating the measurement result of the immediately preceding sampling process and the bit string stored in the data frame as the sample data Sd indicating the measurement result of each of the second and subsequent sampling processes. The restoration unit 220 restores the count value Ct (m) so that the amount of change in the count value Ct (m) from the count value Ct (m-1) becomes the maximum amount Vmax or less, using the bit string indicating the count value Ct (m-1) and the bit string indicating the sample data sd (m).

With this configuration, the PLC20 recovers the measurement results of each sampling process after the second time by the following method. That is, the PLC20 restores the measurement result of each of the second and subsequent sampling processes using the bit string indicating the measurement result of the immediately preceding sampling process and the bit string stored in the data frame as the sampling data Sd. At this time, the PLC20 restores the "measurement result of each sampling process for the second time and subsequent times" so that the amount of change from the measurement result of the immediately preceding sampling process becomes equal to or less than the maximum amount Vmax.

Thus, the PLC20 has the following effects: the measurement results of the second and subsequent sampling processes can be accurately restored using the bit string stored in the data frame as the sampling data Sd.

For example, the PLC20 first acquires sample data sd (m) to be restored, and a bit string indicating a measurement result (count value Ct (m-1)) measured in a sampling process executed immediately before a sampling process for measuring a measurement result (count value Ct (m)) obtained by restoring the sample data sd (m).

Next, the PLC20 derives a lower bit string Lb (m-1) which is a "bit string including the lowest bit and capable of expressing the number of bits of the maximum amount Vmax" from the bit string indicating the count value Ct (m-1). The PLC20 compares the derived lower bit string Lb (m-1) with the sample data sd (m) to be restored.

When the PLC20 determines that the amount of change in the sample data sd (m) to be restored from the "lower bit string Lb (m-1) of the bit string indicating the count value Ct (m-1)" is equal to or less than the maximum amount Vmax, the following processing is executed.

That is, the PLC20 generates a bit string in which "the upper bit string Hb (m-1) indicating the bit string of the count value Ct (m-1)" and "the sample data sd (m) to be restored" are combined, as a bit string indicating the measurement result (i.e., the count value Ct (m)) restored from "the sample data sd (m) to be restored". Specifically, the PLC20 generates a bit string in which "the upper bit string Hb (m-1) indicating the bit string of the count value Ct (m-1)" is an upper bit and "the sample data sd (m) to be restored" is a lower bit, as a bit string indicating the restored measurement result (count value Ct (m)).

When the PLC20 determines that the sample data sd (m) to be restored has decreased from the "lower bit string Lb (m-1) of the bit string representing the count value Ct (m-1)" by more than the maximum amount Vmax, the following processing is executed.

That is, the PLC20 first determines that the sample data sd (m) to be restored does not represent a value that decreases from the "lower bit string Lb (m-1) representing the bit string of the count value Ct (m-1)", but represents a value that increases and carries a carry. The PLC20 generates a bit string indicating the measurement result (count value Ct (m)) restored from the "sample data sd (m) to be restored", using the upper bit string Hb' (m-1) obtained by adding 1 to the "upper bit string Hb (m-1) indicating the bit string of the count value Ct (m-1)". Specifically, the PLC20 generates a bit string in which the upper bit string Hb' (m-1) is the upper bit and "sample data sd (m) to be restored" is the lower bit, as a bit string indicating the count value ct (m).

When the PLC20 determines that the sample data sd (m) to be restored has increased from "the lower bit string Lb (m-1) of the bit string indicating the count value Ct (m-1)" by more than the maximum amount Vmax, the following processing is executed.

That is, the PLC20 first determines that the sample data sd (m) to be restored does not represent a value that increases from the "lower bit string Lb (m-1) representing the bit string of the count value Ct (m-1)", but represents a value that decreases and is set back. The PLC20 generates a bit string indicating the measurement result (count value Ct (m)) restored by the "sample data sd (m) to be restored", using the upper bit string Hb' (m-1) obtained by subtracting 1 from the "upper bit string Hb (m-1) indicating the measurement result of the count value Ct (m-1)". Specifically, the PLC20 generates a bit string in which the upper bit string Hb' (m-1) is the upper bit and "sample data sd (m) to be restored" is the lower bit, as a bit string indicating the count value ct (m).

The PLC20 may include a PLC storage unit, not shown, as a storage device for storing various data used by the PLC 20. The PLC storage unit may store, in a non-transitory manner, (1) a control program, (2) an Operating System (OS) program, (3) an application program for executing various functions of the PLC20, and (4) various data read when the application program is executed, which are executed by the PLC 20. The data (1) to (4) are stored in nonvolatile storage devices such as Read Only Memories (ROMs), flash memories, Erasable Programmable Read Only Memories (EPROMs), Electrically Erasable Programmable Read Only Memories (EEPROMs), Hard Disk Drives (HDDs) and the like. The PLC20 may also include PLC temporary storage. The PLC temporary storage unit is a so-called work Memory that temporarily stores data used for calculation, calculation results, and the like during various processes performed by the PLC20, and includes a volatile storage device such as a Random Access Memory (RAM). Which data is stored in which storage device is appropriately determined according to the purpose of use, convenience, cost, physical limitations, and the like of the PLC 20. The PLC storage unit may store a not-shown count value table. The count value table stores count values Ct (1) to Ct (n) corresponding to the respective sampling data Sd (1) to Sd (n).

(processing performed by PLC: recovery processing of compressed data)

Fig. 11 is a diagram showing an outline of processing performed by the PLC20, and particularly, fig. 11 (a) is a flowchart showing an example of data recovery processing performed by the PLC 20. In the following description, the PLC20 is configured to acquire information indicating "the maximum amount Vmax of the count value Ct that can be counted by the counter unit 10 in one sampling process" from at least one of the tool 30 and the counter unit 10. For example, the PLC20 obtains information that "the count value Ct (i.e., the maximum amount Vmax) that can be counted by the counter unit 10 in one sampling process is" 127 to 127 "from the tool 30 or the counter unit 10. In other words, the information indicating "the maximum amount Vmax of the count value Ct countable by the counter unit 10 in one sampling process" is information indicating the compression size.

The restoring unit 220 derives the first sample data Sd (1) from the "data frame received by the data frame receiving unit 210" (S210), and stores the sample data Sd (1) in the count value table as the first count value Ct (1) (S220). When the count value Ct (1) is stored in the count value table, the restoration unit 220 derives the next sample data Sd (2), that is, sample data Sd (p) assuming "p" to be 2, from the data frame (S230).

The restoration unit 220 derives a "bit string of the compression size amount including the lowest bit", that is, a lower bit string Lb (p-1), from the previous count value Ct (p-1) (S240). Then, the restoration unit 220 determines whether or not the change in the sample data sd (p) from the lower bit string Lb (p-1) exceeds the maximum amount Vmax (S250).

When the recovery unit 220 determines that "the change in the sample data sd (p) from the lower bit string Lb (p-1)" exceeds the maximum amount Vmax (yes in S250), the carry process or the bit-reversing process is executed. Specifically, the recovery unit 220 performs a carry process of adding "1" to the upper bit string Hb (p-1) of the previous count value Ct (p-1) or a retract process of subtracting "1" from the upper bit string Hb (p-1) (S260).

That is, when the recovery unit 220 determines that the sample data sd (p) has decreased from the lower bit string Lb (p-1) by more than the maximum amount Vmax, it executes carry processing for generating the upper bit string Hb' (p-1) by adding 1 to the upper bit string Hb (p-1). When it is determined that the sample data sd (p) has increased from the lower bit string Lb (p-1) by more than the maximum amount Vmax, the bit-reversing process for generating the upper bit string Hb' (p-1) obtained by subtracting 1 from the upper bit string Hb (p-1) is executed. Then, the restoration unit 220 generates a bit string in which the upper bit string Hb' (p-1) generated by the carry processing or the bit-reversing processing is used as an upper bit and the sample data sd (p) is used as a lower bit (S270).

When the recovery unit 220 determines that the change does not exceed the maximum amount Vmax (no in S250), it generates a bit string having the upper bit string Hb (p-1) as the upper bit and the sample data sd (p) as the lower bit (S270). The recovery unit 220 stores the bit string generated in S270 in the count value table as a bit string indicating the count value ct (p) (S280). The restoration unit 220 determines whether all the compressed data (i.e., all the sample data Sd (2) to Sd (n)) have been derived from the data frame (S290), and if it is determined that all the compressed data have been derived (yes in S290), the process ends. When the restoration unit 220 determines that all the compressed data have not been derived (no in S290), it derives the next sample data Sd (p +1) (S230), and executes the processing from S240 onward.

By executing the processing shown in fig. 11 (a), the PLC20 restores the count values Ct (1) to Ct (n) from the sample data Sd (1) to Sd (n), as shown in fig. 11 (B).

(details of recovery processing)

Fig. 12 is a diagram showing details of the data restoring process performed by the PLC20 (particularly, the restoring unit 220). The restoring unit 220 restores the count values Ct (p) from the sample data Sd (p) sent from the counter unit 10, and specifically restores the sample data Sd (2) to Sd (n) to the count values Ct (2) to Ct (n).

As shown in fig. 12, first, the restoring unit 220 derives the first data (i.e., the first sample data Sd (1): 0x43C2a267) as a count value Ct (1) from the data (data frame) transmitted from the counter unit 10. Second, the restoring unit 220 derives the next compressed data, specifically, the sample data Sd (2): 0x 69. Third, the recovery unit 220 uses the count value Ct (1): the lower bit string Lb of 0x43C2a 267: 0x67 and sample data Sd (2): 0x69 to perform a "carry/escape check".

Fourth, if the recovery unit 220 determines that there is no problem in the "carry/escape check", it generates a check value Ct (1): the lower bit string Lb of 0x43C2a 267: 0x67 is replaced with sample data Sd (2): a bit string of 0x 69. That is, the restoration unit 220 generates 0x43C2a269 as a bit string indicating the count value Ct (2) restored from the sample data Sd (2).

When the recovery unit 220 determines that there is a problem in the "carry/escape check", the ratio of the count value Ct (1): upper bit string Hb (1) of 0x43C2a 267: the 0x43C2a2 performs carry processing or escape processing (fifth processing).

The restoring unit 220 performs the second to fifth processes using the count value Ct (p) restored from the sample data Sd (p) and the next compressed data (sample data Sd (p +1)), and restores the count value Ct (p + 1). The restoration unit 220 performs the second to fifth processes on the respective sample data Sd (2) to Sd (n) to restore the respective count values Ct (2) to Ct (n).

(compressed data recovery example 1: compressed size is 1 byte and pulse count mode is bidirectional)

Fig. 13 is a diagram showing data recovery processing performed by the PLC20 (particularly, the recovery unit 220) when the compression size is 1 byte and the pulse counting method of the counter unit 10 is bidirectional. Since the compression size is 1 byte and the pulse counting method is bidirectional, the maximum amount Vmax is equal to or greater than "-127" and equal to or less than "127", as described with reference to fig. 8. The restoring unit 220 first derives the first data (i.e., first sample data Sd (1): 0x43C2a267) from the "data frame received by the data frame receiving unit 210" and stores the first data in the count value table as the count value Ct (1).

When the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (2): 0x69), the following bit string Lb (1) of the count value Ct (1): 0x67 and sample data Sd (2): 0x69 for comparison. The recovery unit 220 determines that the lower bit string Lb (1) of the count value Ct (1): 0x67 up to sample data Sd (2): the change "2" up to 0x69 does not exceed the maximum Vmax (i.e., "-127" or more and "127" or less).

Therefore, the recovery unit 220 generates a lower bit string Lb (1) of the count value Ct (1): 0x67 is replaced with sample data Sd (2): bit string of 0x 69: 0x43C2A 269. In other words, the recovery unit 220 generates the upper bit string Hb (1) of the count value Ct (1): 0x43C2a2 is an upper bit, and samples data Sd (2): bit string with 0x69 as the lower bits: 0x43C2A 269. The recovery unit 220 converts the generated bit string: the 0x43C2a269 is stored in the count value table as a bit string indicating the count value Ct (2) restored from the sample data Sd (2).

Similarly, when the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (3): 0x6E), the following bit sequence Lb (2) of the count value Ct (2): 0x69 and sample data Sd (3): 0x6E for comparison. The recovery unit 220 determines that the lower bit string Lb (2) of the count value Ct (2): 0x69 up to sample data Sd (3): the change "5" up to 0x6E does not exceed the maximum Vmax (i.e., "127" above and "127" below).

Therefore, the recovery unit 220 generates the lower bit string Lb (1) of the count value Ct (2): 0x69 is replaced with sample data Sd (3): bit string of 0x 6E: 0x43C2a 26E. In other words, the recovery unit 220 generates the upper bit string Hb (1) of the count value Ct (2): 0x43C2a2 is an upper bit, and samples data Sd (3): bit string with 0x6E as the lower bits: 0x43C2a 26E. The recovery unit 220 converts the generated bit string: the 0x43C2a26E is stored in the count value table as a bit string indicating the count value Ct (3) restored from the sample data Sd (3).

(case of carry/escape)

Fig. 14 is a diagram showing data recovery processing performed by the PLC20 when the compression size is 1 byte and the pulse count mode of the counter unit 10 is bidirectional, as in fig. 13, and particularly shows an example in which the PLC20 performs carry/escape processing. Since the compression size is 1 byte and the pulse counting manner is bidirectional, the maximum amount Vmax is "-127" or more and "127" or less as described above.

The restoring unit 220 first derives the first data (i.e., first sample data Sd (1): 0x43C2A2FF) from the "data frame received by the data frame receiving unit 210" and stores the first data in the count value table as the count value Ct (1).

When the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (2): 0x01), the following bit string Lb (1) of the count value Ct (1): 0xFF and sample data Sd (2): 0x01 for comparison. The recovery unit 220 determines that the sample data Sd (2): 0x01 is selected from the lower bit string Lb (1): 0xFF is reduced by "0 xFE", i.e., by more than a maximum amount Vmax (i.e., "-127" above and "127" below). Therefore, the restoration unit 220 determines that the sample data Sd (2): 0x01 does not indicate that the bit sequence b (1): 0xFF is a decreasing value, but represents a value that is incremented and carried out.

The recovery unit 220 generates an upper bit string Hb (1) that is to be used for the count value Ct (1): bit string of 0x43C2a2 plus 1: 0x43C2a3 is an upper bit, and samples data Sd (2): 0x01 as a bit string of the lower bits. That is, the recovery unit 220 generates a bit string: 0x43C2a301, and stores the bit string in the count value table as a bit string representing the count value Ct (2) restored from the sample data Sd (2).

Similarly, when the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (3): 0xFE), the following bit sequence Lb (2) of the count value Ct (2): 0x01 and sample data Sd (3): 0xFE for comparison. The recovery unit 220 determines that the sample data Sd (3): 0xFE is calculated from the lower bit string Lb (2): 0x01 is increased by "0 xFD", i.e., by more than a maximum amount Vmax (i.e., "-127" above and "127" below). Therefore, the restoration unit 220 determines that the sample data Sd (3): 0xFE does not indicate the bit sequence from the lower bit string Lb (2): 0x01 is an increasing value, but rather indicates a decreasing and back-shifted value.

The recovery unit 220 generates an upper bit string Hb (2) to be counted from the count value Ct (2): bit string of 0x43C2a3 minus 1: 0x43C2a2 is an upper bit, and samples data Sd (3): 0xFE as the bit string of the lower bits. That is, the recovery unit 220 generates a bit string: 0x43C2A2FE stores the bit string in the count value table as a bit string indicating the count value Ct (3) restored from the sample data Sd (3).

(compressed data recovery example 2: compressed size is 2 bits and pulse count mode is bidirectional)

Fig. 15 is a diagram showing data recovery processing performed by the PLC20 (particularly, the recovery unit 220) when the compression size is 2 bits and the pulse counting method of the counter unit 10 is bidirectional. Since the compression size is 2 bits and the pulse counting method is bidirectional, the maximum amount Vmax is equal to or greater than "-1" and equal to or less than "1", as described with reference to fig. 8. The restoring unit 220 first derives the first data (i.e., first sample data Sd (1): 0x43C2a267) from the "data frame received by the data frame receiving unit 210" and stores the first data in the count value table as the count value Ct (1). Count value Ct (1): the "bit string of the maximum amount Vmax (i.e., 2-bit amount) including the lowest bit" of 0x43C2a267, that is, the lower bit string Lb (1) is "b 11".

When the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (2): b10), the following bit sequence Lb (1) of the count value Ct (1): b11 and sample data Sd (2): b 10. The recovery unit 220 determines that the lower bit string Lb (1) of the count value Ct (1): b11 up to sample data Sd (2): the change "-1" up to b10 does not exceed the maximum amount Vmax (i.e., "-1" or more and "1" or less).

Therefore, the recovery unit 220 generates a lower bit string Lb (1) of the count value Ct (1): b11 is replaced with sample data Sd (2): bit string of b 10: 0x43C2a 266. The recovery unit 220 converts the generated bit string: the 0x43C2a266 is stored in the count value table as a bit string indicating the count value Ct (2) restored from the sample data Sd (2).

Similarly, when the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (3): b11), the following bit sequence Lb (2) of the count value Ct (2): b10 and sample data Sd (3): b 11. The recovery unit 220 determines that the lower bit string Lb (2) of the count value Ct (2): b10 up to sample data Sd (3): the change "1" up to b11 does not exceed the maximum amount Vmax (i.e., "-127" or more and "127" or less).

Therefore, the recovery unit 220 generates the lower bit string Lb (1) of the count value Ct (2): b10 is replaced with sample data Sd (3): bit string of b 11: 0x43C2A 267. The recovery unit 220 converts the generated bit string: the 0x43C2a267 is stored in the count value table as a bit string indicating the count value Ct (3) restored from the sample data Sd (3).

(case of carry/escape)

Fig. 16 is a diagram showing data recovery processing performed by the PLC20 when the compression size is 2 bits and the pulse count mode of the counter unit 10 is bidirectional, as in fig. 15, and particularly shows an example in which the PLC20 performs carry/escape processing. Since the compression size is 2 bits and the pulse counting method is bidirectional, the maximum amount Vmax is equal to or greater than "-1" and equal to or less than "1", as described above.

The restoring unit 220 first derives the first data (i.e., first sample data Sd (1): 0x43C2A2FF) from the "data frame received by the data frame receiving unit 210" and stores the first data in the count value table as the count value Ct (1). Count value Ct (1): the "bit string of the maximum amount Vmax (i.e., 2-bit amount) including the lowermost bit" of 0x43C2A2FF, that is, the lower bit string Lb (1) is "b 11".

When the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (2): b00), the following bit sequence Lb (1) of the count value Ct (1): b11 and sample data Sd (2): b 00. The recovery unit 220 determines that the sample data Sd (2): b00 is derived from the lower bit string Lb (1): b11 is reduced by "b 11", i.e., by more than a maximum amount Vmax (i.e., "-1" above and "1" below). Therefore, the restoration unit 220 determines that the sample data Sd (2): b00 does not indicate that the bit sequence b (1): b11 is a decreasing value, but rather represents a value that is incremented and carried.

The restoration unit 220 generates a bit string in which 1 is added to the upper bit string Hb (1) of the count value Ct (1) as an upper bit, and the sample data Sd (2) as a lower bit: 0x43C2a 300. The recovery unit 220 converts the generated bit string: the 0x43C2a300 is stored in the count value table as a bit string indicating the count value Ct (2) restored from the sample data Sd (2).

Similarly, when the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (3): b11), the following bit sequence Lb (2) of the count value Ct (2): b00 and sample data Sd (3): b 11. The recovery unit 220 determines that the sample data Sd (3): b11 is derived from the lower bit string Lb (2): b00 is increased by "b 11", i.e., by more than a maximum amount Vmax (i.e., "-1" above and "1" below). Therefore, the restoration unit 220 determines that the sample data Sd (3): b11 does not indicate that the bit sequence b (2): b00 is an increased value, but rather indicates a decreased and back-shifted value.

The restoration unit 220 generates, as upper bits, bit strings obtained by subtracting 1 from the upper bit string Hb (2) of the count value Ct (2), and converts the sample data Sd (3): b11 as a bit string of the lower bits: 0x43C2A2 FF. The recovery unit 220 converts the generated bit string: the 0x43C2A2FF is stored in the count value table as a bit string indicating the count value Ct (3) restored from the sample data Sd (3).

(compressed data recovery example 3: compressed size is 1 bit and pulse count mode is one-way)

Fig. 17 is a diagram showing data recovery processing performed by the PLC20 (particularly, the recovery unit 220) when the compression size is 1 bit and the pulse counting method of the counter unit 10 is one-way. Since the compression size is 1 bit and the pulse counting method is unidirectional, the maximum amount Vmax is equal to or greater than "0" and equal to or less than "1" as described with reference to fig. 8. The restoring unit 220 first derives the first data (i.e., first sample data Sd (1): 0x43C2a267) from the "data frame received by the data frame receiving unit 210" and stores the first data in the count value table as the count value Ct (1). Count value Ct (1): the "bit string of the maximum amount Vmax (i.e., 1 bit amount) including the lowest bit" of 0x43C2a267, that is, the lower bit string Lb (1) is "b 1".

When the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (2): b1), the following bit sequence Lb (1) of the count value Ct (1): b1 and sample data Sd (2): b 1. The recovery unit 220 determines that the lower bit string Lb (1) of the count value Ct (1): b1 up to sample data Sd (2): the change "0" up to b1 does not exceed the maximum amount Vmax (i.e., "-1" or more and "1" or less).

Therefore, the recovery unit 220 generates a lower bit string Lb (1) of the count value Ct (1): b1 is replaced with sample data Sd (2): bit string of b 1: 0x43C2A 267. The recovery unit 220 converts the generated bit string: the 0x43C2a267 is stored in the count value table as a bit string indicating the count value Ct (2) restored from the sample data Sd (2).

Similarly, when the recovery unit 220 derives the next compressed data from the data frame (sample data Sd (3): b0), the following bit sequence Lb (2) of the count value Ct (2): b1 and sample data Sd (3): b 0. The recovery unit 220 determines that the sample data Sd (3): b0 is derived from the lower bit string Lb (2): b1 is reduced, i.e., reduced, by more than a maximum amount Vmax (i.e., "0" or more and "1" or less). Therefore, the restoration unit 220 determines that the sample data Sd (3): b0 does not indicate that the bit sequence b (2): b1 is a decreasing value, but rather indicates a value that is increasing and is being retired.

The restoration unit 220 generates a bit string in which 1 is added to the upper bit string Hb (2) of the count value Ct (2) as an upper bit, and the sample data Sd (3) as a lower bit: 0x43C2a 268. The recovery unit 220 converts the generated bit string: the 0x43C2a268 is stored in the count value table as a bit string indicating the count value Ct (3) restored from the sample data Sd (3).

(details of the tool)

As shown in fig. 1, the tool 30 includes a calculation section 310 and a setting section 320 as functional blocks. The tool 30 may include, in addition to the above-described functional blocks, a control cycle Sct adjustment unit, not shown, for setting a control cycle Sct for the PLC 20. However, in order to ensure the simplicity of description, the configuration that is not directly related to the present embodiment is omitted from the description and the block diagram. However, the tool 30 may also include the omitted configuration based on the actual implementation.

The setting unit 320 sets a data size (number of bits) that can express the maximum amount Vmax, that is, a compression size, to at least one of the counter unit 10 and the PLC 20. According to this configuration, the tool 30 sets the compression size to at least one of the counter unit 10 and the PLC 20.

Thus, the tool 30 achieves the following effects: by setting the compression size to the counter unit 10, the counter unit 10 can transmit the sample data Sd compressed to the compression size set by the tool 30 to the PLC 20. Moreover, the tool 30 achieves the following effects: by setting the compression size to the PLC20, the PLC20 can restore the sample data Sd compressed to the compression size.

The calculation unit 310 calculates the compression size using the setting information on the counter unit 10 including the information indicating the number of times of sampling processing performed by the counter unit 10 in one control cycle Sct. The setting unit 320 sets the compression size calculated by the calculating unit 310 to at least one of the counter unit 10 and the PLC 20.

According to the configuration, the calculation section 310 of the tool 30 uses the setting information on the counter unit 10 to calculate the compression size, that is, the data size (that is, the compression size) that can express "the maximum amount Vmax of change between the measurement results of two sampling processes continuously executed in one control cycle Sct".

Here, the setting information may include, for example, the following information in addition to "information indicating the number of times of sampling processing performed in one control cycle Sct". That is, the setting information may include information indicating "the number of pulse signals that can be received by the counter unit 10 in one sampling process".

As described above, the "number of pulse signals that can be received by the counter unit 10 in one sampling process" can be calculated according to at least one of the specification and the application of the encoder 40 (pulse signal generation device). Specifically, the "number of pulse signals that can be received by the counter unit 10 in one sampling process" can be calculated from "the resolution and the maximum number of revolutions of the encoder 40" that is predetermined in accordance with at least one of the specification and the application.

Therefore, the setting information may include information indicating "the resolution and the maximum rotation speed of the encoder 40" predetermined in accordance with at least one of the specification and the application, instead of the information indicating "the number of receivable pulse signals".

The setting information may include a pulse counting method type indicating whether the pulse counting method of the counter unit 10 is unidirectional or bidirectional. The pulse counting type may indicate whether the pulse signal output from the encoder 40 that outputs the pulse signal to the counter unit 10 is a unidirectional pulse signal or a bidirectional pulse signal.

In the case where the pulse count manner is bidirectional, the change between the measurement results of two sampling processes continuously performed in one control period Sct may be either positive or negative. For example, in the case where "the absolute value of the countable number of pulses in one sampling process" is "127", the change between the measurement results of two sampling processes continuously performed in one control period Sct may be expressed as "-127 to 127". Therefore, the compression size is a bit number obtained by adding 1 bit to the number of bits that can express "the absolute value of the number of pulses countable in one sampling process".

In the case where the pulse count mode is unidirectional, the change between the measurement results of two sampling processes continuously performed in one control period Sct is always positive or always negative. For example, in the case where "the absolute value of the countable number of pulses in one sampling process" is "255", the change between the measurement results of two sampling processes continuously performed in one control period Sct may be expressed as "0 to 255". Therefore, the compression size becomes the number of bits that can express "the absolute value of the number of pulses countable in one sampling process".

The "absolute value of the number of pulses countable in one sampling process" is a value obtained by dividing the sampling period Smc indicating the period of each sampling process by the shortest pulse period Plcmin of the pulse signal "by a decimal point or less. When the control period Sct is known, the sampling period Smc can be calculated from "information indicating the number of times of sampling processing performed in one control period Sct" which includes setting information. Further, the "shortest pulse period Plcmin" can be calculated as the reciprocal of the "value obtained by multiplying the resolution by the value obtained by dividing the maximum rotational speed by 60". As described above, the maximum rotation speed may be determined according to the specifications (spec, performance) of the encoder 40, or may be determined according to the application (use application).

Thus, the tool 30 achieves the following effects: the compression size (i.e., the size that can express "the maximum amount Vmax of the variation between the measurement results of two sampling processes continuously performed in one control cycle Sct") can be accurately calculated using the setting information.

The tool 30 may include a tool storage unit, not shown, as a storage device for storing various data used by the tool 30. The tool storage unit may store, in a non-transitory manner, (1) a control program, (2) an OS program, (3) an application program for executing various functions of the tool 30, and (4) various data read out when the application program is executed, which are executed by the tool 30. The data (1) to (4) are stored in nonvolatile storage devices such as Read Only Memories (ROMs), flash memories, Erasable Programmable Read Only Memories (EPROMs), Electrically Erasable Programmable Read Only Memories (EEPROMs), Hard Disk Drives (HDDs) and the like. The tool 30 may also include a tool temporary storage. The tool temporary storage unit is a so-called work Memory that temporarily stores data used for calculation, calculation results, and the like during various processes executed by the tool 30, and includes a volatile storage device such as a Random Access Memory (RAM). Which data is stored in which storage device is appropriately determined according to the purpose of use, convenience, cost, physical limitations, and the like of the tool 30.

(information about tool utilization)

Fig. 18 is a diagram showing an example of information (setting information) used when the tool 30 (particularly, the calculation unit 310) calculates the compressed size. The calculation unit 310 calculates the compression size, that is, the number of bits that can express the maximum amount Vmax (the count value Ct that can be changed within one sampling period Smc) by, for example, obtaining the setting information illustrated in fig. 18. The tool 30 calculates the compression size using, for example, the control period Sct, the number of times of sampling processing performed by the counter unit 10 in one control period Sct, the pulse counting method of the counter unit 10, the resolution of the encoder 40, and the maximum rotation speed. As described above, the resolution and the maximum rotation speed of the encoder 40 are predetermined in accordance with at least one of the specifications (spec, performance) and the application (usage) of the encoder 40. The tool 30 calculates the compressed size using setting information indicating the setting of the counter unit 10 and the like.

The tool 30 may also acquire "the sampling period Smc of the counter unit 10" instead of the information indicating "the control period Sct" and "the number of times of sampling processing performed by the counter unit 10 in one control period Sct". That is, the tool 30 may acquire the sampling period Smc and the pulse count method of the counter unit 10 as the setting information.

Instead of the information indicating the pulse counting method of the counter unit 10, the tool 30 may acquire, as the setting information, information indicating whether the pulse signal output from the encoder 40 is one-way or two-way.

For example, when the control cycle Sct is "1 [ ms ]", and the number of times of sampling processing executed in one control cycle Sct is "10 [ times ]", the calculation unit 310 calculates that the sampling cycle Smc is "100 [ μ s ] (═ 1 ms/10)".

When the resolution indicating the number of pulses output from the encoder 40 when the shaft is rotated once is "360" and the maximum rotational speed indicating the rotational speed possible for the encoder 40 in one minute is "6000 [ rpm ], the calculation unit 310 calculates the shortest pulse period Plcmin as follows. That is, the calculation unit 310 calculates the shortest pulse period Plcmin to be about 27.78 μ s based on "1/{ (6000/60) _ 360 }".

The calculation unit 310 calculates the absolute value of the number of pulses counted in one sampling process as follows, based on the sampling period Smc (100 μ s) and the shortest pulse period Plcmin (27.78 μ s). That is, the calculation unit 310 calculates that the absolute value of the countable number of pulses in one sampling process is "4 (═ ROUNDUP (100/27.78))". Roundup (x) represents a function that steps down and up the decimal point of the argument x.

Since the number of bits that can express "4" is 3 bits, when the pulse counting method of the counter unit 10 is bidirectional, the calculation unit 310 calculates the compression size that is the number of bits that can express the maximum amount Vmax as "4 bits (═ 3 bits +1 bit)". The tool 30 sets the compression size (4 bits in the above example) calculated as described above using the setting information to at least one of the counter unit 10 and the PLC 20.

The tool 30 may further calculate the data size of a data frame, and set the calculated data size of a data frame to at least one of the counter unit 10 and the PLC 20. For example, if the full size is 4 bytes, since the counter unit 10 performs the sampling process 10 times in one control cycle Sct in the above example, the data size of the data frame is about 9 bytes (═ 4 bytes + ROUNDUP ((9 × 4/8)). the data size of one data frame calculated by the tool 30 (4 bytes in the above example) may be set in at least one of the counter unit 10 and the PLC 20.

However, the operation of calculating the compressed size by the tool 30 and setting the calculated compressed size to at least one of the counter unit 10 and the PLC20 is not necessarily required. The counter unit 10 may calculate the compression size using setting information related to the setting of its own device or the like, and notify the PLC20 of the calculated compression size. The PLC20 may calculate the compression size using the setting information of the counter unit 10 and the like, and notify the counter unit 10 of the calculated compression size.

Modification example 4

(modification of compression method: setting sample data as difference data)

Fig. 19 is a diagram showing an example of a method for compressing the measurement result (for example, count value Ct) measured in the sampling process into sample data Sd of a compressed size. In particular, fig. 19 shows a case where the lower bit string Lb is extracted ((1) of fig. 19) and a case where the difference is calculated ((2) of fig. 19) in comparison with each other in the data compression processing.

The following example has been described as a method in which the compression unit 130 compresses "a bit string indicating a count value Ct measured in each of the second and subsequent sampling processes" into sample data Sd of a compressed size. That is, the following examples are explained: the compression unit 130 extracts "a bit string of a compression size amount including the lowest bit" as a lower bit string Lb from the bit strings indicating the count value Ct, and stores the extracted lower bit string Lb as sample data Sd in a data frame. However, the method of compressing the "bit string indicating the count value Ct measured in each of the second and subsequent sampling processes" into the sample data Sd of the compressed size by the compression unit 130 is not limited to the method of extracting the lower bit string Lb.

In (1) of fig. 19, a method is disclosed: the compression unit 130 sets the sample data sd (m) (compressed data) of the compressed size (2 bytes) as the lower bit string lb (m) of the count value ct (m). According to the method shown in (1) of fig. 19, the ratio of the count value Ct (1): the 0x43C2a267 directly generates the sampling data Sd (1). From count value Ct (2): in the 0x43C2a269, the compression unit 130 extracts the lower bit string Lb (2) of the compressed size (2 bytes): 0x69, the extracted lower bit string Lb (2): 0x69 becomes sample data Sd (2). From count value Ct (3): in the 0x43C2a275, the lower bit string Lb (3) of the compressed size (2 bytes) is extracted by the compression unit 130: 0x75, the extracted lower bit string Lb (3): 0x75 becomes sample data Sd (3). From count value Ct (4): in the 0x43C2a294, the compression unit 130 extracts the lower bit string Lb (4) of the compressed size (2 bytes): 0x94, the extracted lower bit string Lb (4): 0x94 becomes sample data Sd (4). From count value Ct (5): in the 0x43C2A2B8, the compression unit 130 extracts the lower bit string Lb (5) of the compressed size (2 bytes): 0xB8, extracted lower bit string Lb (5): 0xB8 becomes sample data Sd (5).

In (2) of fig. 19, a method is disclosed: the compression unit 130 sets the compressed sample data sd (m) (compressed data) as a difference value from the immediately preceding count value Ct (m-1) of the count value Ct (m). According to the method shown in (2) of fig. 19, the ratio of the count value Ct (1): the 0x43C2a267 directly generates the sampling data Sd (1). From count value Ct (2): 0x43C2a269, and the compression unit 130 calculates a value indicating the sum of count value Ct (1): bit string of compressed size (2 bytes) of varying amount counted at 0x43C2a 267: 0x02 and 0x02 become sample data Sd (2). From count value Ct (3): 0x43C2a275, and the compression unit 130 calculates a value indicating the sum of count value Ct (2): bit string of compressed size (2 bytes) of varying amount counted 0x43C2a 269: 0x0C and 0x0C become sample data Sd (3). From count value Ct (4): 0x43C2a294, which is calculated by the compression unit 130 from the count value Ct (3): bit string of compressed size (2 bytes) of varying amount counted as 0x43C2a 275: 0x1F, 0x1F becomes sample data Sd (4). From count value Ct (5): 0x43C2A2B8, and the compression unit 130 calculates a secondary count value Ct (4): bit string of compressed size (2 bytes) of varying amount counted 0x43C2a 294: 0x24 and 0x24 become sample data Sd (5).

As shown in fig. 19 (2), the compression unit 130 may compress the count value Ct (m) into the compressed sample data sd (m) by setting the difference between the count value Ct (m) and the immediately preceding count value Ct (m-1) as the sample data sd (m). The compression unit 130 calculates differences from the respective Ct (1) to Ct (n-1) with respect to the respective count values Ct (2) to Ct (n).

That is, in the counter unit 10, the compression unit 130 may set, as the sample data Sd, a bit string indicating the amount of change in the measurement result of each of the second and subsequent sampling processes from the measurement result of the immediately preceding sampling process.

According to the above configuration, the counter section 10 sets, as the sample data Sd, a bit string indicating the amount of change in the measurement result of each of the sampling processes after the second time from the measurement result of the immediately preceding sampling process.

Here, as described earlier, the data size of the sampling data Sd is a data size that can express the maximum amount Vmax of variation between the measurement results of two sampling processes that are continuously performed in one control cycle Sct. Therefore, the data size of the amount of change of the measurement result of each of the sampling processes second and subsequent from the measurement result of the immediately preceding sampling process is equal to or smaller than the data size in which the maximum amount Vmax of the change can be expressed, that is, equal to or smaller than the data size of the sampling data Sd.

Therefore, the counter unit 10 exerts the following effects: a bit string indicating the amount of change in the measurement result of each of the sampling processes at the second time and thereafter from the measurement result of the immediately preceding sampling process may be transmitted as sample data Sd to the PLC 20.

When the respective sample data Sd (2) to Sd (n) is a difference value from the respective count values Ct (2) to Ct (n) of the respective count values Ct (2) to Ct (n-1), the PLC20 restores the count values Ct (2) to Ct (n) as follows. That is, the restoration unit 220 of the PLC20 adds the sample data sd (m) to the count value Ct (m-1) immediately before, thereby restoring the count value Ct (m).

(information stored in data frame)

Fig. 20 is a diagram showing an example of information stored in a data frame which the counter unit 10 repeatedly transmits to the PLC20 for each control cycle Sct. As shown in fig. 20, in the data frame transmitted from the counter unit 10 to the PLC20, the following information may be stored in addition to the sampling data Sd (1) to Sd (n) corresponding to the respective count values Ct (1) to Ct (n).

That is, in the data frame, information indicating the number of times of sampling processing (that is, the number of samples) performed by the counter unit 10 in one control cycle Sct may be stored. For example, in the data frame, a bit string indicating that the counter unit 10 performs sampling processing 5 times in one control cycle Sct may be stored: 0x 0005.

In addition, in the data frame, information indicating the compression size (number of bits) may be stored, and for example, a bit string indicating the compression size of 8 bits (that is, 1 byte) may be stored: 0x 08.

Further, in the data frame, information indicating the pulse direction of the pulse signal output from the encoder 40, that is, information indicating the pulse counting method of the counter unit 10 may be stored. For example, it may be: bit string: 0x00 indicates that the pulse count mode is one-way (positive only), bit string: 0x01 indicates that the pulse count mode is bidirectional.

(modification of sampling processing: measurement of analog value)

Fig. 21 shows an example in which the simulation unit 60 compresses the measurement results (simulation values Al (1) to Al (n)) measured in the respective sampling processes executed a plurality of times in the one-time control period Sct into the sampling data Sd (1) to Sd (n) of the compressed size. The analog unit 60 has the same configuration as the counter unit 10, and the measurement unit 110 of the analog unit 60 performs sampling processing a plurality of times in one control cycle Sct and notifies the acquisition unit 120 of the analog value Al measured in each sampling processing.

The compression unit 130 of the analog unit 60 compresses the "analog value Al measured in each sampling process for the second time and subsequent times" into the number of bits that can express the "analog value Al that can change within one sampling period Smc", similarly to the compression unit 130 of the counter unit 10. In other words, the "analog value Al variable in one sampling period Smc" is the "amount of change in the analog value Al variable in one sampling period Smc". That is, the compression size is a data size that can express the maximum amount Vmax of the change between the two analog values Al counted in each of the two sampling processes that the analog unit 60 continuously performs in one control cycle Sct. In other words, the compression size is a data size that can express the maximum amount Vmax of variation between the analog value Al (m) measured in the "m" th sampling processing and the analog value Al (m-1) measured in the "m-1" th sampling processing immediately before it.

When the range of the change in the analog value Al that can be changed within one sampling period Smc is, for example, — 127 "or more and" 127 "or less, 1 byte, which is 8 bits obtained by adding 1 bit to 7 bits that can express" 127 ", is a compressed size. Similarly, when the range of the change in the analog value Al that can be changed within one sampling period Smc is, for example, — 1 "or more and" 1 "or less, 2 bits obtained by adding 1 bit to 1 bit that can express" 1 "are set as the compressed size. When the range of the change in the analog value Al that can be changed within one sampling period Smc is, for example, "0" or more and "255" or less, 1 byte, which is 8 bits that can express "255", is a compressed size.

That is, the analog unit 60 (data transmission means) is a data transmission means that saves a plurality of sampling data Sd representing the measurement results (analog values Al) of the respective sampling processes performed a plurality of times in one control cycle Sct into one data frame and transmits the data to the PLC20 at each control cycle Sct. The simulation unit 60 includes an acquisition unit 120 and a compression unit 130. The acquisition unit 120 acquires the measurement results (analog values Al) of the respective sampling processes executed a plurality of times. The compressing unit 130 compresses, when the maximum amount Vmax of change between the measurement results (analog values Al) of two sampling processes continuously executed in one control cycle Sct is predetermined, the measurement results (i.e., the respective analog values Al (2) to Al (n)) of the second and subsequent sampling processes among the plurality of measurement results (analog values Al) acquired by the acquiring unit 120 into the sampling data Sd of a data size (i.e., a compression size) in which the maximum amount Vmax can be expressed.

According to this configuration, when the maximum amount Vmax is predetermined, the simulation unit 60 compresses each of the sample data Sd (2) to Sd (n) to a data size (that is, a compression size) in which the maximum amount Vmax can be expressed, and transmits the data to the PLC 20.

Therefore, the simulation unit 60 exerts the following effects: the data size of the data frame transmitted to the PLC20 at each control cycle Sct can be suppressed as compared with the case where the analog values Al (2) to Al (n) are transmitted without being compressed.

The compression unit 130 of the analog unit 60 may extract the lower bit string Lb (2) to Lb (n) of each analog value Al (2) to Al (n) to generate each sample data Sd (2) to Sd (n), similarly to the compression unit 130 of the counter unit 10. The compression unit 130 of the simulation means 60 may set the respective simulation values Al (2) to Al (n) as the respective sample data Sd (2) to Sd (n) as differences from the respective simulation values Al (1) to Al (n-1).

(example of connection of counter Unit and PLC)

The counter unit 10 and the PLC20 may be communicably connected so as to be able to transmit and receive signals (data) to and from each other at regular communication cycles, and the connection method of the counter unit 10 and the PLC20 is not particularly limited. Similarly, the analog unit 60 and the PLC20 may be communicably connected so as to be able to transmit and receive signals (data) to and from each other at regular communication cycles, and the connection method of the analog unit 60 and the PLC20 is not particularly limited.

Fig. 22 is a diagram showing an example of connection between the counter unit 10 and the PLC 20. The counter unit 10 and the PLC20 are communicably connected to each other, and particularly, repeatedly transmit and receive data to and from each other at a predetermined communication cycle (for example, a control cycle Sct of the PLC 20). The counter unit 10 may be in periodic communication with the PLC20, and the bus/network structure between the counter unit 10 and the PLC20 is not particularly limited.

That is, as shown in fig. 22 (a), the counter unit 10 and the PLC20 may be communicatively connected to each other via a PLC direct bus. That is, the counter unit 10 may be configured integrally with the PLC20 (in other words, as a functional unit of the PLC 20), and the counter unit 10 and the PLC20 (particularly, a CPU unit of the PLC 20) may be connected by an internal bus.

As shown in fig. 22 (B), the counter unit 10 and the PLC20 may be communicatively connected to each other via the field network 50. As the field network 50 connecting the counter unit 10 and the PLC20, various industrial ethernet (registered trademark) networks can be typically used. As the industrial ethernet (registered trademark), for example, EtherCAT (registered trademark), Profinet IRT, MECHATROLINK (registered trademark) -III, Powerlink, SERCOS (registered trademark) -III, CIP Motion, and the like are known, and any of these can be used. Further, a field network other than the industrial ethernet (registered trademark) may be used. For example, if the motion control is not performed, DeviceNet, complenet/IP (registered trademark), or the like may be used. In the example shown in fig. 22 (B), in the master-slave control system in which the PLC20 is the master device, the counter unit 10, which is the slave device, is connected to the PLC20 via the field network 50.

Further, as shown in fig. 22 (C), the counter unit 10 and the PLC20 may be communicatively connected to each other via an IO terminal internal bus. More specifically, the counter unit 10 and the coupler unit (communication coupler) may be communicatively connected to each other via an IO terminal internal bus (internal bus) to form an IO unit as a single unit. In the master-slave control system using the PLC20 as a master device, the IO unit including the counter unit 10 and the coupler unit may be connected to the PLC20 as a slave device via the field network 50.

[ implementation by software ]

Each of the functional blocks of the counter Unit 10, the PLC20, and the tool 30 (specifically, the measurement Unit 110, the acquisition Unit 120, the compression Unit 130, the transmission Unit 140, the data frame reception Unit 210, the restoration Unit 220, the calculation Unit 310, and the setting Unit 320) may be implemented by a logic circuit (hardware) formed on an integrated circuit (ic) chip or the like, or may be implemented by software using a Central Processing Unit (CPU).

In the latter case, each of the counter unit 10, the PLC20, and the tool 30 includes a CPU that executes instructions of a program that is software for realizing each function, a Read Only Memory (ROM) or a storage device (these are referred to as "recording media") in which the program and various data are recorded so as to be readable by a computer (or CPU), a Random Access Memory (RAM) in which the program is developed, and the like. And, the object of the present invention is achieved by reading and executing the program from the recording medium by a computer (or CPU). As the recording medium, "a tangible medium that is not temporary" may be used, and for example, a tape (tape), a disk (disk), a card (card), a semiconductor memory, a programmable logic circuit, or the like may be used. Further, the program may be supplied to the computer via an arbitrary transmission medium (a communication network, a broadcast wave, or the like) that can transmit the program. The present invention can also be realized in the form of a data signal embedded in a carrier wave, the data signal embodying the program by electronic transmission.

(matters attached to notes)

A data transmission device of an embodiment of the present invention saves a plurality of sampling data indicating measurement results of respective sampling processes performed a plurality of times in one control cycle into one data frame and transmits the data frame to a control device in each of the control cycles, the data transmission device including: an acquisition unit that acquires measurement results of the sampling processes executed a plurality of times; and a compression unit configured to compress, when a maximum amount of change between measurement results of two sampling processes continuously executed in one control cycle is predetermined, the measurement result of each of the sampling processes of a second time and subsequent times among the plurality of measurement results acquired by the acquisition unit into the sample data having a data size capable of expressing the maximum amount.

According to this configuration, when the maximum amount is determined in advance, the data transmission device compresses the sample data indicating the measurement result of each of the second and subsequent sampling processes into a data size capable of expressing the maximum amount, and transmits the data size to the control device.

Therefore, the data transmission device has the following effects: the data size of the data frame transmitted to the control device at each control cycle can be suppressed as compared with a case where the measurement results of the respective sampling processes at the second and subsequent times are not compressed.

Here, when the change may be either positive or negative, for example, when the range of the change is between "-127" and "127", 1 byte, which is 8 bits obtained by adding 1 bit to 7 bits that can express "127", is a data size that can express the maximum amount. Similarly, for example, when the range of the variation is between "-1" and "1", 2 bits obtained by adding 1 bit to 1 bit that can express "1" are used as the data size that can express the maximum amount.

In addition, when the change is always positive or always negative, for example, when the range of the change is "0" or more and "255" or less, 1 byte, which is 8 bits and can express "255", has a data size capable of expressing the maximum amount. Similarly, for example, when the range of the variation is "0" or more and "1" or less, 1 bit which can express "1" becomes a data size which can express the maximum amount.

In the data transmission device according to an embodiment of the present invention, the sampling process may be a process of counting a number of pulses of a pulse signal, and the measurement result may be the counted number of pulses.

According to this configuration, when the maximum amount is determined in advance, the data transmission device compresses the sample data indicating the number of pulses measured in each of the second and subsequent sampling processes into a data size capable of expressing the maximum amount.

Here, in the sampling process of counting the number of pulses of the pulse signal, the number of pulses measurable in one sampling process is determined in advance, that is, in the case where the sampling process is a process of counting the number of pulses, the maximum amount is determined in advance.

More specifically, the number of pulse signals that the data transmission device can receive from "a pulse signal generation device that generates a pulse signal based on a detected amount, such as an encoder or a flow meter" in one sampling process is predetermined. For example, in the case of counting (i.e., counting) the pulse signals from the encoder, the number of pulse signals that the data transmission apparatus can receive per unit time is predetermined according to the resolution and the rotation speed (maximum rotation speed) of the encoder. The maximum rotation speed may be determined according to the specification (spec, performance) of the encoder, or may be determined according to the application (use application of the encoder). For example, if the application is "low-speed application in which the encoder is 360-resolution and rotates at 60rpm at maximum (1 rotation per 1 second)", the maximum rotation speed is assumed to be 60rpm even if the encoder can be rotated at a higher speed in terms of the specification. That is, the number of pulse signals that the data transmission device can receive in one sampling process is predetermined in accordance with at least one of the specification and application of an encoder (pulse signal generation device).

Therefore, the data transmission device has the following effects: the sampling data indicating the number of pulses measured in each of the sampling processes at the second time and thereafter may be compressed into a data size in which the maximum amount can be expressed and transmitted to the control device.

In the data transfer device according to an embodiment of the present invention, the data size capable of expressing the maximum amount may be determined in advance based on (1) an absolute value of the number of pulses countable in one sampling process and (2) whether a pulse counting method of the sampling process is bidirectional or unidirectional.

According to the above configuration, in the data transfer apparatus, the data size in which the maximum amount can be expressed is determined in advance based on (1) the absolute value of the number of pulses countable in one sampling process and (2) the pulse counting manner.

In the case where the pulse count manner is bidirectional, a change between measurement results of two sampling processes performed consecutively in one control cycle may be either positive or negative. For example, in the case where "the absolute value of the number of pulses countable in one sampling process" is "127", the variation between the measurement results of two sampling processes continuously performed in one control period may be expressed as "-127 to 127". Therefore, the data size that can express the maximum amount becomes the number of bits that can express "the absolute value of the number of pulses countable in one sampling process" plus the number of bits of 1 bit.

In the case where the pulse count manner is unidirectional, a change between measurement results of two sampling processes continuously performed in one control cycle is always positive or always negative. For example, in the case where "the absolute value of the number of pulses countable in one sampling process" is "255", the variation between the measurement results of two sampling processes continuously performed in one control period may be represented as "0 to 255". Therefore, the data size that can express the maximum amount becomes the number of bits that can express "the absolute value of the number of pulses countable in one sampling process".

Therefore, the data transmission device has the following effects: since the maximum amount is predetermined, the sample data indicating the number of pulses measured in each of the sampling processes at the second time and thereafter can be compressed to a data size that can express the maximum amount.

In the data transmission device according to an embodiment of the present invention, the compression unit may extract a bit string that includes the lowest bit and can express the maximum number of bits from among bit strings indicating measurement results of the sampling processes at the second and subsequent times, and may use the extracted bit string as the sample data.

According to this configuration, the data transmission device sets, as the sample data, a bit string that includes the number of bits that can express the maximum number of the least significant bits, which is extracted from bit strings that represent measurement results of the respective sampling processes at the second time and thereafter.

It is clear that the "bit string containing the lowest bits and expressing the maximum number of bits" extracted from this bit string is smaller in data size than the bit string representing the measurement result of each of the sampling processes at the second and subsequent times.

Therefore, the data transmission device has the following effects: the bit string indicating the measurement result of each of the sampling processes at the second time and thereafter may be compressed into "a bit string containing the lowest bits and expressing the maximum number of bits" extracted from this bit string.

For example, when the bit string indicating the measurement result of each sampling process is 4 bytes, if the range of the variation is greater than or equal to "-127" and less than or equal to "127", it can be said that the maximum amount of data size is 1 byte, and therefore the data transfer device performs the following compression. That is, the data transmission device compresses a bit string of 4 bytes indicating the measurement result of each of the sampling processes at the second time and thereafter into the sampling data of 1 byte.

Similarly, if the range of the variation is "1" or more and "1" or less, the data size that can express the maximum amount is 2 bits, and therefore the data transmission apparatus compresses a 4-byte bit string representing the measurement result of each of the sampling processes at the second and subsequent times into 2 bits. Further, if the range of the variation is "0" or more and "1" or less, the data size that expresses the maximum amount is 1 bit, and therefore the data transmission device compresses a 4-byte bit string that represents the measurement result of each of the sampling processes at the second and subsequent times into 1 bit.

In the data transmission device according to an embodiment of the present invention, the compression unit may use, as the sample data, a bit string indicating an amount of change in a measurement result of each of the second and subsequent sampling processes from a measurement result of the immediately preceding sampling process.

According to the above configuration, the data transmission device sets, as the sample data, a bit string indicating an amount of change in a measurement result of each of the sampling processes after the second time from a measurement result of the immediately preceding sampling process.

Here, as described above, the data size of the sampling data is a data size that can express the maximum amount of variation between the measurement results of two sampling processes performed consecutively in one control cycle. Therefore, the data size of the amount of change of the measurement result of each of the sampling processes after the second time from the measurement result of the immediately preceding sampling process is equal to or smaller than the data size in which the maximum amount of change can be expressed, that is, equal to or smaller than the data size of the sample data.

Therefore, the data transmission device has the following effects: a bit string indicating an amount of change in the measurement result of each of the sampling processes at the second time and thereafter from the measurement result of the immediately preceding sampling process may be transmitted to the control device as the sampling data.

The control device of an embodiment of the present invention may also include: a data frame receiving unit configured to receive the data frame from the data transmission device according to the embodiment of the present invention every control cycle; and a restoring unit that restores the measurement result of each of the sampling processes at the second time and subsequent times from the sample data compressed to the data size capable of expressing the maximum amount in the data frame received by the data frame receiving unit.

According to the configuration, the control means restores the measurement results of the respective sampling processes after the second time from the sampling data compressed to the data size expressing the maximum amount.

Therefore, the control device has the following effects: the measurement results of the second and subsequent sampling processes can be obtained from the sample data whose data size is suppressed as compared with the case of not being compressed, as in the case of not being compressed.

In the control device according to an embodiment of the present invention, the restoration unit may perform restoration such that a change amount from a measurement result of an immediately preceding sampling process becomes equal to or less than the maximum amount, using a bit string indicating a measurement result of an immediately preceding sampling process and a bit string stored in the data frame as the sampling data indicating a measurement result of each of the second and subsequent sampling processes, with respect to a measurement result of each of the second and subsequent sampling processes.

According to the above configuration, the control device restores the measurement result of each of the sampling processes after the second time by the following method. That is, the control device performs restoration on the measurement result of each of the second and subsequent sampling processes using a bit string indicating the measurement result of the immediately preceding sampling process and a bit string stored in the data frame as the sample data. In this case, the control device restores the "measurement result of each of the second and subsequent sampling processes" so that the amount of change from the measurement result of the immediately preceding sampling process becomes equal to or smaller than the maximum amount.

Therefore, the control device has the following effects: the measurement results of the second and subsequent sampling processes can be accurately restored using the bit string stored in the data frame as the sample data.

For example, the control device first acquires sample data to be restored, and a bit string indicating a measurement result measured in a sampling process performed immediately before the sampling process for measuring the measurement result obtained by restoring the sample data.

Next, the control device derives a "bit string including the lowest bit and capable of expressing the maximum number of bits" from among bit strings indicating the measurement results of the immediately preceding sampling process, and compares the derived bit string with sample data to be restored. Here, the "bit string that includes the lowest bit and can express the maximum number of bits" is referred to as a "lower bit string". A bit string other than the "bit string including the lowest bit and capable of expressing the maximum number of bits" of the bit string indicating the measurement result of the immediately preceding sampling process is referred to as an "upper bit string" indicating the bit string of the measurement result of the immediately preceding sampling process. That is, the "upper bit string of the bit string indicating the measurement result of the immediately preceding sampling process" is a bit string other than the lower bit string of the bit string indicating the measurement result of the immediately preceding sampling process.

When the control device determines that the amount of change in the sample data to be restored from the "lower bit string of the bit string indicating the measurement result of the immediately preceding sampling process" is equal to or less than the maximum amount, the following process is executed.

That is, the control device generates a bit string in which "the upper bit string of the bit string indicating the measurement result of the immediately preceding sampling process" and "the sample data to be restored" are combined as a bit string indicating the measurement result restored from the "sample data to be restored". Specifically, the control device generates, as a bit string indicating the restored measurement result, a bit string in which "an upper bit string indicating a bit string of the measurement result of the immediately preceding sampling process" is an upper bit and "sample data to be restored" is a lower bit.

If the control device determines that the sample data to be restored has decreased from the "lower bit string of the bit string indicating the measurement result of the sampling process immediately before" by more than the maximum amount, the following process is executed.

That is, the control device first determines that the sample data to be restored does not indicate a value that decreases from the "lower bit string of the bit string indicating the measurement result of the immediately preceding sampling process", but indicates a value that increases and carries out a carry. The control device generates a bit string indicating a measurement result restored from "sample data to be restored", by using a bit string obtained by adding 1 to "an upper bit string indicating a measurement result of the immediately preceding sampling process". Specifically, the control device generates a bit string in which "1 is added to an upper bit string of a bit string indicating a measurement result of the immediately preceding sampling process" as an upper bit, and "sample data to be restored" as a lower bit.

If the control device determines that the sample data to be restored has increased more than the maximum amount from the "lower bit string of the bit string indicating the measurement result of the sampling process immediately before", the following process is executed.

That is, the control device first determines that the sample data to be restored does not indicate a value that increases from the "lower bit string of the bit string indicating the measurement result of the immediately preceding sampling process", but indicates a value that decreases and is set back. The control device generates a bit string indicating a measurement result restored from the "sample data to be restored", using a bit string obtained by subtracting 1 from the "upper bit string indicating the bit string of the measurement result of the immediately preceding sampling process". Specifically, the control device generates a bit string in which 1 is subtracted from "an upper bit string of a bit string indicating a measurement result of the immediately preceding sampling process" as an upper bit, and "sample data to be restored" as a lower bit.

The setting device according to an embodiment of the present invention may further include a setting unit that sets a data size that can express the maximum amount, for at least one of the data transmission device according to an embodiment of the present invention and the control device according to an embodiment of the present invention.

According to the structure, the setting means sets the data size that can express the maximum amount to at least one of the data transmission means and the control means. Therefore, the setting means has an effect that the data transmission means can transmit the sample data compressed to the "data size expressible of the maximum amount" set by the setting means to the control means. Alternatively, the setting device has the following effects: the control means may be capable of restoring the sample data compressed to the "data size expressible of the maximum amount" set by the setting means.

The setting device according to an embodiment of the present invention may further include: and a calculation unit that calculates a data size capable of expressing the maximum amount using setting information about the data transmission device including information indicating the number of times the sampling process is performed by the data transmission device in one control cycle, wherein the setting unit sets the data size capable of expressing the maximum amount calculated by the calculation unit for at least one of the data transmission device and the control device.

According to this configuration, the setting means uses the setting information to calculate the maximum amount, that is, a data size that can express "the maximum amount of change between the measurement results of two sampling processes that are continuously executed in one control cycle".

Here, the setting information may include, for example, the following information in addition to the "information indicating the number of times of the sampling process performed in one control cycle". That is, the setting information may include information indicating "the number of pulse signals that the data transmission device can receive in one sampling process".

Here, as described above, the "number of pulse signals that can be received by the data transmission device in one sampling process" can be calculated according to at least one of the specification and the application of a pulse signal generation device such as an encoder. Specifically, the "number of pulse signals that the data transmission device can receive in one sampling process" can be calculated from "the resolution and the maximum number of revolutions of the pulse signal generation device" that is predetermined in accordance with at least one of the specification and the application.

Therefore, the setting information may include information indicating "the resolution and the maximum rotation speed of the pulse signal generating device" predetermined in accordance with at least one of the specification and the application, instead of the information indicating "the number of receivable pulse signals".

The setting information may include information indicating "a pulse counting method type indicating whether the pulse counting method of the data transmission device as the counter unit is one-way or two-way". The pulse counting type may indicate whether the pulse signal output from a pulse signal generating device such as an encoder that outputs a pulse signal to the data transmission device as a counter unit is a unidirectional pulse signal or a bidirectional pulse signal.

In the case where the pulse count manner is bidirectional, a change between measurement results of two sampling processes performed consecutively in one control cycle may be either positive or negative. For example, in the case where "the absolute value of the number of pulses countable in one sampling process" is "127", the change between the measurement results of two sampling processes continuously performed in one control period may be expressed as "-127 to 127". Therefore, the data size that can express the maximum amount becomes the number of bits that can express "the absolute value of the number of pulses countable in one sampling process" plus the number of bits of 1 bit.

In the case where the pulse count manner is unidirectional, a change between measurement results of two sampling processes continuously performed in one control cycle is always positive or always negative. For example, in the case where "the absolute value of the number of pulses countable in one sampling process" is "255", the variation between the measurement results of two sampling processes continuously performed in one control period may be represented as "0 to 255". Therefore, the data size that can express the maximum amount becomes the number of bits that can express "the absolute value of the number of pulses countable in one sampling process".

Further, the "absolute value of the number of pulses countable in one sampling process" is a value obtained by dividing a sampling period indicating a period of each sampling process by the shortest period of the pulse signal "by a decimal point. If the control cycle is known, the sampling cycle may be calculated based on "information indicating the number of times of the sampling process performed in one control cycle" including the setting information. Further, the "shortest cycle of the pulse signal" may be calculated as a reciprocal of a value obtained by multiplying a value obtained by dividing the maximum number of revolutions by 60 by the resolution. As described above, the maximum rotation speed may be determined according to the specifications (spec, performance) of a pulse signal generation device such as an encoder, and may be determined according to the application (use application).

Therefore, the setting device has the following effects: the setting information may be used to accurately calculate a data size that can express the maximum amount.

In a control method of a data transfer apparatus according to an embodiment of the present invention, the data transfer apparatus stores a plurality of sample data indicating measurement results of respective sampling processes performed a plurality of times in one control cycle into one data frame and transmits the data frame to a control apparatus in each control cycle, the control method includes: an acquisition step of acquiring a measurement result of each of the sampling processes executed a plurality of times; and a compression step of, when a maximum amount of change between measurement results of two sampling processes continuously executed in one control cycle is predetermined, compressing the measurement results of the second and subsequent sampling processes among the plurality of measurement results acquired in the acquisition step into the sample data of a data size capable of expressing the maximum amount.

According to the above configuration, when the maximum amount is determined in advance, the control method compresses the sample data indicating the measurement result of each of the second and subsequent sampling processes into a data size capable of expressing the maximum amount, and transmits the data size to the control device.

Therefore, the control method has the following effects: the data size of the data frame transmitted to the control device at each control cycle can be suppressed as compared with a case where the measurement results of the respective sampling processes at the second and subsequent times are not compressed.

Here, when the change may be either positive or negative, for example, when the range of the change is between "-127" and "127", 1 byte, which is 8 bits obtained by adding 1 bit to 7 bits that can express "127", is a data size that can express the maximum amount. Similarly, for example, when the range of the variation is between "-1" and "1", 2 bits obtained by adding 1 bit to 1 bit that can express "1" are used as the data size that can express the maximum amount.

In addition, when the change is always positive or always negative, for example, when the range of the change is "0" or more and "255" or less, 1 byte, which is 8 bits and can express "255", has a data size capable of expressing the maximum amount. Similarly, for example, when the range of the variation is "0" or more and "1" or less, 1 bit which can express "1" becomes a data size which can express the maximum amount.

The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope shown in the claims, and embodiments obtained by appropriately combining technical components disclosed in different embodiments are also included in the technical scope of the present invention.

Description of the symbols

10: counter unit (data transmission device)

20: PLC (control device)

30: tool (setting device)

40: encoder (measuring equipment)

60: analog unit (data transmission device)

70: sensor (measuring equipment)

120: acquisition unit

130: compression part

210: data frame receiving part

220: recovery part

310: calculating part

320: setting part

Al: analog value (measurement result)

Ct: count value (measurement result)

Sct: control period

Sd: sampling data

Vmax: maximum amount of

S110: obtaining step

S160: obtaining step

S130: step of compression

58页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:电路安装品和设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类