Relay device, method and program
Patent Information
- Application Number
- JP2021177873
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-02-13
- Estimated Expiration
- 2041-10-29
AI Technical Summary
【0016】 本発明によれば、ユーザはModbusプロトコルを用いる中継装置を通じて、産業機械の情報を適切に取得することができ、中継装置の利便性が向上する。
Smart Images

Figure 0007629197000001 
Figure 0007629197000002 
Figure 0007629197000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a relay device, and a method and program for acquiring information from a machine. [Background technology]
[0002] The Modbus (registered trademark) TCP protocol is a communication protocol for using a serial communication protocol developed by Modicon for its PLCs (Programmable Logic Controllers) on TCP / IP.
[0003] There is known a relay device that collects information from industrial machines such as CNCs, lathes, and laser processing machines operating in factories and distributes the collected information at a timing desired by a user using the Modbus TCP protocol. Specifically, in Patent Document 1, a client device transmits request information to the relay device, and the relay device transmits acquired data stored in the memory unit of the relay device to the client device as a response to the request information. As a result, the client device holds the acquired data from the relay device in the memory unit. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2017-046250 A Summary of the Invention [Problem to be solved by the invention]
[0005] However, when a user operates a client device to collect information such as the operating status of an industrial machine through a relay device, even if the industrial machine is unable to communicate with the relay device, the user is unable to know this fact.
[0006] Furthermore, even if the address, which is location information in memory used to identify the information of the industrial machine that the user is attempting to obtain through the relay device by operating the client device, is specified to be different from the information of the industrial machine identified within the address range managed by the relay device, the user cannot know this.
[0007] Furthermore, in the above-mentioned Modbus protocol, the request information sent by the client device when obtaining information about an industrial machine through a relay device does not include a parameter for directly specifying the industrial machine desired by the user, which poses the problem that the information obtained may differ from the information desired by the user.
[0008] The present invention has been made in consideration of the above problems, and has an object to notify a user of whether communication with an industrial machine is possible when acquiring information from an industrial machine using a relay device that uses the Modbus protocol, and to notify the user that an attempt to acquire information from an industrial machine has been made by specifying an invalid address range. [Means for solving the problem]
[0009] In order to achieve the above object, a relay device according to one aspect of the present invention is a relay device that relays communication between an industrial machine and a client device in accordance with a Modbus (registered trademark) protocol, and transmits data related to the industrial machine to a client device. acquisition and an acquisition unit for acquiring acquisition The acquired data and the system number of the industrial machine The a storage unit that stores an industrial machine system correspondence table in which acquired data is associated with an address range in which acquired data is stored; a communication unit that receives a machine data acquisition request from the client device; and a determination unit that determines whether communication with the industrial machine is possible; , the machine data acquisition request The range of addresses included in The industrial machinery system correspondence table Whether the address is within the range defined in Judge A determination unit and a generation unit, Judgment section According to the notification of the judgment result, (a) if the judgment result indicates that communication with the industrial machine is impossible, Exception Codeand (b) if it is determined that communication with the industrial machine is possible, (a) if it is determined that the address range included in the machine data acquisition request is within the address range defined in the industrial machine system correspondence table, generating response data including the address specified by The above and (i) a generation unit that generates response data including the acquisition data, and when it is determined that the address range included in the machine data acquisition request is outside the address range defined in the industrial machinery system correspondence table, generates response data including the exception code, and the communication unit further transmits the response data generated by the generation unit to the client device.
[0010] According to this, the user can know that the data acquisition from the relay device has failed due to an incorrect address range being set in the client device for acquiring the desired machine data of the industrial machinery system, by receiving response data including an exception code. Also, even if the relay device cannot establish communication with the industrial machinery, the user can know that the data acquisition has failed by receiving response data including an exception code. Note that the "address range" referred to here is a higher-level concept including a combination of a data start address and an address range exemplified using FIG. 3 etc. in [Mode for Carrying Out the Invention].
[0011] In addition, the relay device may be connected to a plurality of industrial machines and have a plurality of communication ports corresponding to each of the plurality of industrial machines, the memory unit may further store a communication port number associated with each of the plurality of industrial machines, the machine data acquisition request may further include the communication port number, and the determination unit may further determine whether or not an industrial machine associated with the communication port number included in the machine data acquisition request is connected to the relay device, and (i) when it is determined that the industrial machine associated with the communication port number is not connected to the relay device, the determination unit may notify the generation unit of the determination result that communication with the industrial machine is impossible, and (ii) when it is determined that the industrial machine associated with the communication port number is connected to the relay device, the determination unit may notify the generation unit of the determination result that communication with the industrial machine is possible.
[0012] According to this, in a configuration in which a plurality of industrial machines are connected to one relay device, the relay device can identify, via a client device, which industrial machine's industrial machine system the user desires to acquire acquired data for, and can transmit response data including the appropriate acquired data to the client device, thereby enabling the user to know the appropriate acquired data.
[0013] Also, a method for providing information from an industrial machine to a client device according to the Modbus protocol according to an aspect of the present invention. teeth , data on said industrial machinery acquisition do acquisition Step Data acquired through the acquisition step and industrial machinery serial number The above storing an industrial machine system correspondence table in which the acquired data is associated with a range of addresses in which the acquired data is stored; and receiving a machine data acquisition request from the client device. Reception step, whether communication with the industrial machine is possible, and 、 The client device sent The above It is determined whether the address range included in the machine data acquisition request is within the address range defined in the industrial machine system correspondence table stored in the storage unit. judgement Steps and A generating step, in accordance with a notification of a determination result of the determining step, (a) generating response data including an exception code when it is determined in the determining step that communication with the industrial machine is impossible; death (b) in the determination step, when it is determined that communication with the industrial machine is possible, and (a) the address range included in the machine data acquisition request is within the address range defined in the industrial machine system correspondence table, the address is identified The above Generates response data that includes the acquired data death (a) generating response data including the exception code when it is determined that the address range included in the machine data acquisition request is outside the address range defined in the industrial machine system correspondence table; Generate Step In the generation step The generated response data The above Send to client device send The method includes the steps of:
[0014] According to this, the user can know by receiving response data including an exception code that data acquisition has failed due to an incorrect address range being set in the client device for acquiring machine data of a desired industrial machinery system. Also, even if the relay device cannot establish communication with the industrial machinery, the user can know by receiving response data including an exception code that data acquisition has failed.
[0015] Another aspect of the present invention is a program for causing a computer to execute the above-described method. Effect of the Invention
[0016] According to the present invention, a user can appropriately obtain information about an industrial machine through a relay device that uses the Modbus protocol, thereby improving the convenience of the relay device. [Brief description of the drawings]
[0017] [Figure 1] FIG. 1 is a schematic diagram showing an overview of a communication system according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a block diagram showing a functional configuration of a relay device according to an embodiment of the present invention. [Diagram 3] FIG. 3 is a diagram showing an example of a table showing the correspondence between the line number and the address range of the industrial machine according to the embodiment of the present invention. [Figure 4] FIG. 4 is an example of an acquired data correspondence table that is stored in advance in the relay device according to the embodiment of the present invention. [Diagram 5] FIG. 5 is a diagram showing another example of the acquired data correspondence table stored in advance in the relay device according to the embodiment of the present invention. [Figure 6] FIG. 6 is a flowchart showing the operation of the relay device according to the embodiment of the present invention. [Figure 7] FIG. 7 is a sequence diagram showing the flow of operations in the communication system according to the embodiment of the present invention when the line number and address range of the industrial machine specified by the client device are correct. [Figure 8] FIG. 8 is a sequence diagram showing the flow of operations in a case where the line number and address range of an industrial machine specified by a client device are incorrect in the communication system according to the embodiment of the present invention. [Figure 9] FIG. 9 is a sequence diagram showing an operation flow when the relay device cannot communicate with the industrial machine in the communication system according to the embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0018] Hereinafter, the embodiment will be specifically described with reference to the drawings. The embodiments described below each show a preferred specific example of the present invention. The numerical values, shapes, materials, components, the arrangement and connection of the components, steps, and the order of steps shown in the following embodiments are merely examples and are not intended to limit the present invention. Furthermore, among the components in the following embodiments, those components that are not described in the independent claims showing the highest concept of the present invention are described as any components that constitute a more preferred embodiment. Note that the same components are given the same reference numerals and descriptions may be omitted.
[0019] (Embodiment) In this embodiment, a communication system will be described which acquires data of an industrial machine by specifying an address range, which is location information in a memory for identifying information of the industrial machine that uses an industrial communication protocol.
[0020] FIG. 1 is a schematic diagram showing an overview of a communication system 100 according to an embodiment of the present invention. 1, the communication system 100 includes an industrial machine 101, a relay device 102, a network 103, and a client device 104. The communication system 100 is, for example, a communication system established in a factory.
[0021] In the present embodiment, the communication system 100 includes one industrial machine 101, but is not limited to this and may include a plurality of industrial machines 101. In the present embodiment, the communication system 100 includes one client device 104, but is not limited to this and may include a plurality of client devices.
[0022] Specifically, the industrial machine 101 is configured with a CNC (numerical control device), a cutting machine, etc. The industrial machine 101 is connected to the relay device 102 via a communication link 106. The communication link 106 is realized by wired communication conforming to the RS-232C, IEEE802.3 standard, etc., or wireless communication conforming to the IEEE802.11n, ac standard, etc., and is a communication path between the industrial machine 101 and the relay device 102. Note that the communication link 106 may be configured with a wired or wireless network when communication is performed between a plurality of industrial machines 101 and the relay device 102.
[0023] The relay device 102 is connected to the client device 104 via a network 103. The relay device 102 acquires data related to the industrial machine 101 via a communication link 106. In addition, the relay device 102 transmits the acquired data related to the industrial machine 101 to the client device 104 via the network 103.
[0024] The network 103 is a network in which communication is performed using, for example, TCP (Transport Control Protocol). The network 103 is realized by wired communication conforming to, for example, the IEEE802.3 standard or wireless communication conforming to, for example, the IEEE802.11n, ac standard. The network 103 is not limited to only the connection between the industrial machine 101 and the relay device 102, but is a general-purpose network to which any device conforming to the standard can be connected and communicated.
[0025] The client device 104 is connected to the relay device 102 via the network 103. The client device 104 transmits a request for data related to the industrial machine 101 to the relay device 102 via the network 103 in response to an operation by a user 105 or the like. The client device 104 is also a terminal device that receives data related to the industrial machine 101 collected by the relay device 102 via the network 103 and displays the data on a display unit (not shown) of the own device. Specifically, the client device 104 is a personal computer, a tablet computer, a smartphone, or the like.
[0026] 2 is a block diagram showing a functional configuration of relay device 102 according to the present embodiment. Relay device 102 includes an acquisition unit 201, a determination unit 202, a storage unit 203, a generation unit 204, and a communication unit 205.
[0027] The acquisition unit 201 acquires information about the industrial machine 101. The acquisition unit 201 collects information from the industrial machine 101 and stores it in the storage unit 203. Information that can be collected from the industrial machine 101 includes, for example, the model number of the industrial machine, the industrial machine system number, basic information about the industrial machine 101, and data that can be acquired by sensors built into the industrial machine. The information that can be collected also includes, but is not limited to, information about the operation of the industrial machine 101, such as the operating state of the CNC, the rotation speed of the machining shaft, and the rotation load of the machining shaft, and also includes information about the communication state between the relay device 102 and the industrial machine 101.
[0028] The determination unit 202 determines whether or not the address range of the information (hereinafter, also referred to as acquired data) acquired by the acquisition unit 201 from the industrial machine 101 stored in the storage unit 203 is within the address range based on the request information (hereinafter, also referred to as a machine data acquisition request) including the address range information acquired by the communication unit 205 from the client device 104. The determination unit 202 also determines whether or not communication with the industrial machine 101 connected to the relay device 102 is possible. The determination unit 202 notifies the generation unit 204 of the determination result. Note that the machine data acquisition request also includes information such as a device address for identifying the relay device 102 and a function code (e.g., 04 (Read input registers)) for controlling the operation of the relay device 102, in addition to the address range. The address range is, for example, a combination of a data start address 302 and an address range 303 in FIG. 3 described later, but is not limited thereto, and may be, for example, a combination of a data start address and a data end address.
[0029] The storage unit 203 stores data acquired by the acquisition unit 201 from the industrial machine 101, the system number to which the industrial machine 101 belongs, and the address range linked to the system to which the industrial machine 101 belongs. The storage unit 203 also stores an exception code that responds to a request from the client device 104 when the request is invalid. The exception code may be set by the user 105 (administrator) using a setting tool (not shown) or the like and stored in the storage unit 203, or may be stored in advance at the time of shipment from the factory. A specific example of the exception code is "02 (Illegal Data Address)". The storage unit 203 is realized by a non-volatile memory such as an eMMC (Embedded MultiMediaCard) (registered trademark) or an SSD (Solid State Drive). In the present embodiment, the storage unit 203 is described as a non-volatile memory, but some functions may be configured by a RAM (volatile memory).
[0030] The generation unit 204 generates response data including either the data acquired by the acquisition unit 201 from the industrial machine 101 or an exception code based on the judgment of the judgment unit 202. The generation unit 204 receives a notification of the judgment result of the validity of the address range related to the data acquired from the industrial machine 101 from the judgment unit 202, and generates response data. Specifically, if the data start address is valid, the generation unit 204 generates response data including the acquired data specified by that address, and if the data start address is invalid, the generation unit 204 generates response data including an exception code. Furthermore, if the generation unit 204 receives a notification of the judgment result from the judgment unit 202 that communication with the industrial machine is impossible, the generation unit 204 generates response data including an exception code.
[0031] The communication unit 205 receives a machine data acquisition request transmitted by the client device 104. The communication unit 205 also transmits to the client device 104 response data that includes either the data acquired from the industrial machine 101 or an exception code, which is generated by the generation unit 204 in response to the request from the client device 104.
[0032] FIG. 3 is an example of an industrial machine lineage correspondence table 300 in which lineage numbers (e.g., numbers for each CNC) of each industrial machine stored in advance in the storage unit 203 of the relay device 102 are associated with address ranges in which information on the industrial machines is stored. The industrial machine lineage correspondence table 300 is configured with data including an industrial machine lineage 301, a data start address 302, and an address range 303. More specifically, in the first row shown in FIG. 3, the industrial machine lineage 301 indicates "industrial machine lineage 1", and data that can be acquired from the industrial machine is stored from the start position "100" of the data start address 302 to the range "100" of the address range 303 (i.e., from the address position 100 to the address position 199). In this embodiment, the industrial machine lineage 1 and the industrial machine lineage 2 are stored, but the present invention is not limited to this. The industrial machine lineage 301 is information for individually identifying multiple CNCs that may be included in one industrial machine 101.
[0033] Fig. 4 shows an example of an acquired data correspondence table 400 in which each address (address start position) and the address range are associated with each piece of data (acquired data) that can be acquired from an industrial machine, the table being stored in advance by the relay device 102. Note that Fig. 4 shows an example in which an address and its range related to each piece of data of the industrial machine system 1 are stored. The acquired data correspondence table 400 is made up of data including acquired data 401, a data start address 402, and an address range 403. The data start address 402 indicates the start position of each piece of acquired data information indicated in the acquired data 401. The address range 403 stores information such as the number of bytes that specifies the range in which the data corresponding to the data start address 402 is stored, but is not limited thereto. More specifically, in the first row shown in FIG. 4, acquired data 401 is data indicating an “emergency stop state”, and data start address 402 stores data acquired from the industrial machine (data indicating an emergency stop state) from start position “100” to range “8” of address range 403 (i.e., addresses from 100 to 107).
[0034] Fig. 5 is another example of the acquired data correspondence table of Fig. 4. The acquired data correspondence table 500 shows a case where addresses and their ranges related to each data of the industrial machinery system 2 are stored. In this way, the acquired data correspondence table 400 can store, for each of a plurality of industrial machinery systems, the data start addresses and the address ranges of the data for each data (acquired data) acquired from the industrial machinery in association with each other.
[0035] [Industrial machinery and relay devices are controlled under a single industrial machinery system] Below, we will first explain the operation in a case where the industrial machinery 101 has only one industrial machinery system (industrial machinery system 1), and the relay device 102 acquires data related to the industrial machinery system 1 from the industrial machinery 101 and stores it in the memory unit 203 as shown in Figure 4.
[0036] FIG. 6 is a flowchart showing the operation of relay device 102 according to this embodiment. Step S601 is a step of receiving a machine data acquisition request transmitted by the client device 104 to the relay device 102 when the client device 104 attempts to acquire desired acquisition data from the industrial machine 101.
[0037] Step S602 is a step for determining whether the relay device 102 is capable of communicating with the industrial machine 101 via the communication link 106 or not.
[0038] Step S603 is a step for extracting information on the address range contained in the machine data acquisition request received in step S601.
[0039] Step S604 is a step of comparing the information of the data start address extracted in step S603 with the industrial machine system correspondence table 300 stored in the storage unit 203, and judging whether the range of the extracted address is within the address range defined by the data start address 302 and the address range 303 defined in the industrial machine system correspondence table 300. The judgment unit 202 judges whether a valid address range (the data start address 302 and the address range 303) is specified in response to the machine data acquisition request from the client device 104. When the judgment unit 202 judges that a valid address range is specified, it notifies the generation unit 204 accordingly (Yes in step S604). Specifically, for example, when the acquisition unit 201 acquires information related to the industrial machine system 1 provided in the industrial machine from the industrial machine 101, the relay device 102 recognizes that the relay device 102 is connected to the industrial machine belonging to the industrial machine system 1. 3, the data start address "100" and the address range "100" are defined as a combination for "industrial machinery system 1," and the relay device 102 stores this information in advance in the storage unit 203. Therefore, if the value of the data start address extracted in the above-mentioned step S603 is a value that falls within the range of the combination (e.g., 132), it is determined that the address range is valid. On the other hand, if the determination unit 202 determines that a valid address range has not been specified, it notifies the generation unit 204 of this effect (No in step S604).
[0040] Step S605 is a step in which the generating unit 204 generates response data including corresponding acquisition data based on the data start address and address range extracted in step S603, based on the notification from the determining unit 202 (Yes in step S604).
[0041] Step S606 is a step in which the generating unit 204 generates response data including an exception code based on the notification from the determining unit 202 (No in step S604).
[0042] In step S607, the communication unit 205 transmits to the client device 104 response data that includes either the acquired data or the exception code and that is generated by the generation unit 204 in step S605 or step S606.
[0043] [Repeater behavior when a client device specifies a valid address range] Next, the operation when the relay device 102 receives a machine data acquisition request specifying a valid address range from the client device 104 will be described with reference to FIG. 6 and FIG. 7, which is a sequence diagram showing an example of the operation of the communication system 100 in this embodiment.
[0044] In the example shown in this embodiment, the industrial machine 101 and the relay device 102 are connected in a one-to-one relationship by the communication link 106. In this configuration, the relay device 102 stores an industrial machine system correspondence table 300 in advance, so that it can grasp a plurality of industrial machine systems that the industrial machine 101 may have and the address ranges of the acquired data corresponding to the industrial machine systems (data start address 302 and address range 303). 101 The acquisition unit 201 recognizes the The data start address of the machine Since the address range is stored in advance in the memory unit 203, the client device 104 does not need to include the industrial machine system number in the machine data acquisition request. As long as at least the information on the data start address 402 and the information on the address range 403 are included in the machine data acquisition request, the relay device 102 can identify the acquisition data desired by the client device 104 using the above-mentioned information.
[0045] First, as shown in Fig. 7, when acquiring data of the industrial machinery system 1 provided in the industrial machinery 101, the client device 104 transmits a machine data acquisition request specifying an address range of 100 to 199 to the relay device 102 (step S701). For example, taking the acquired data correspondence table 400 in Fig. 4 as an example, the client device 104 specifies the data start address "100" and the address range of the desired data "8" in the machine data acquisition request to acquire acquired data indicating an "emergency stop state".
[0046] Next, the relay device 102 receives the machine data acquisition request (step S601), and extracts the data start address and address range information included in the machine data acquisition request (step S603).
[0047] Next, based on the industrial machinery lineage number 1 of the industrial machinery 101 acquired by the acquisition unit 201 from the industrial machinery 101 and pre-stored in the memory unit 203, and the corresponding address range (data start address 302 and address range 303), the relay device 102 determines that the address included in the machine data acquisition request extracted in step S603 is within the address range corresponding to the pre-stored industrial machinery lineage number (Yes in step S604 in Figure 6, i.e., step S7604 in Figure 7).
[0048] Next, after acquiring the acquisition data corresponding to the address specified by the client device 104, the relay device 102 generates response data (step S605) and transmits the response data to the client device 104 (step S607). For example, in the case of the data shown in Fig. 4, if the client device 104 has specified the address range from 100 to 108, the data corresponding to the address range is "emergency stop status". Finally, the client device 104 receives the response data (not shown).
[0049] [Repeater behavior when a client device specifies an invalid address range] Next, the operation of the relay device 102 when it receives a machine data acquisition request specifying an invalid address range from the client device 104 will be described with reference to FIGS.
[0050] First, as shown in FIG. 8, the client device 104 is provided in the industrial machine 101 to which the relay device 102 is connected. Industrial Machinery For example, assume that the client device 104 transmits a machine data acquisition request specifying an address range of 200 to 299 to the relay device 102 when the industrial machinery system is 1 (step S801). For example, taking the table in Fig. 4 as an example, the client device 104 specifies the address "200" and the desired data range "8" in the machine data acquisition request to acquire acquisition data indicating an "emergency stop state".
[0051] Next, the relay device 102 receives the machine data acquisition request (step S601), and extracts the data start address and address range information included in the machine data acquisition request (step S603).
[0052] Next, the relay device 102 determines, from the address range information corresponding to the prestored industrial machine line number and the industrial machine line number of the industrial machine 101 acquired by the acquisition unit 201, that the address range information acquired in step S603 (corresponding to the data start address and the address range) is outside the prestored address range of the industrial machine line 1 (No in step S604 in FIG. 6, i.e., step S8604 in FIG. 8).
[0053] Finally, the relay device 102 generates response data including the exception code (step S606), and transmits the response data to the client device 104 (step S607).
[0054] According to this, the user 105 can know by receiving response data including an exception code that data acquisition has failed from the relay device 102 because an incorrect address range was set in the client device 104 for the acquisition information of the industrial machine 101 of the desired industrial machinery system.
[0055] [Operation of the repeater when communication with industrial machines is not possible] Next, the operation when the relay device 102 cannot communicate with the industrial machine 101 will be described with reference to FIG. 6 and FIG.
[0056] 9, when the industrial system number of the industrial machine 101 to which the relay device 102 is connected is industrial machine system 1, the client device 104 transmits a machine data acquisition request specifying, for example, an address range of 100 to 199 to the relay device 102 (step S901). For example, taking the table in FIG. 4 as an example, the client device 104 specifies the data start address "100" and the address range of desired data "8" in the machine data acquisition request to acquire acquisition data indicating an "emergency stop state."
[0057] Next, the relay device 102 receives a machine data acquisition request (step S601).
[0058] Next, for example, if the power supply of the industrial machine 101 is turned off or the path of the communication link 106 is unavailable, the relay device 102 determines that communication with the industrial machine 101 is not possible (No in step S602 in FIG. 6, i.e., step S9602 in FIG. 9). Note that the method of determining whether communication with the industrial machine 101 is possible may be, for example, by checking a response using a PING protocol or by using an independently defined protocol.
[0059] Finally, the relay device 102 generates response data including the exception code (step S606), and transmits the response data to the client device 104 (step S607).
[0060] According to this, when the relay device 102 cannot establish communication with the industrial machine 101, the user 105 can know that data acquisition has failed by receiving response data including an exception code.
[0061] [Modification of the embodiment] Although the embodiment of the present invention has been described above, the present invention is not limited to this. In the following description, the components and symbols described in the above embodiment will be used, and a description of each component of this modified example will be omitted. This modification differs from the above embodiment in that data acquisition is performed by the relay device 102 for multiple systems of multiple industrial machines 101 in the communication system 100. Specifically, multiple industrial machines 101 may be connected to the relay device 102 via communication links 106, or one industrial machine may have multiple industrial machine systems. In this case, the relay device 102 assigns an arbitrary port number to each of the multiple industrial machines 101 connected to the relay device 102 and communicates with them. Furthermore, the relay device 102 includes an industrial machine system correspondence table 300 and an acquired data correspondence table 400 that are linked to each port number, for example.
[0062] The client device 104 acquires information related to the desired industrial machine 101 by specifying the port number to which the desired industrial machine 101 is connected and including information on the desired address range (data start address and address range) in a machine data acquisition request and sending it to the relay device 102.
[0063] A case where the relay device 102 acquires acquired data from a plurality of industrial machines 101 will be described below.
[0064] The client device 104 transmits a machine data acquisition request to the relay device 102, including information on the data start address and the address range.
[0065] The relay device 102 compares the industrial machine system correspondence table 300 associated with the specified port number with the address range (data start address and address range) included in the machine data acquisition request.
[0066] Specifically, for example, in the configuration of the communication system 100, when two industrial machines 101 are connected to the relay device 102, there are a plurality of industrial machine systems from which the relay device 102 acquires data via the communication link 106. The client device 104 transmits a machine data acquisition request including information on a data start address and an address range, in which the port number of the industrial machine 101 is specified in order to identify which data of the industrial machine system has the desired acquisition data. When the relay device 102 receives the machine data acquisition request, the relay device 102 determines whether or not there is an industrial machine 101 connected to the relay device 102 via the port number specified by the client device 104. If there is an industrial machine 101 connected to the relay device 102, the relay device 102 extracts information on the data start address and the address range included in the machine data acquisition request.
[0067] Then, the relay device 102 determines whether or not the address included in the extracted machine data acquisition request is within the address range corresponding to the pre-stored industrial machine lineage number, based on a combination of the pre-stored industrial machine lineage number of the industrial machine 101 and the corresponding address range (data start address 302 and address range 303). If it is determined that the address is within the address range corresponding to the pre-stored industrial machine lineage number, it transmits response data including acquisition data corresponding to the address included in the machine data acquisition request to the client device 104. On the other hand, if the relay device 102 determines that the address is outside the address range corresponding to the pre-stored industrial machine lineage number, it transmits response data including an exception code to the client device 104.
[0068] In addition, if the industrial machine 101 corresponding to the port number specified in the machine data acquisition request is not connected to the relay device 102 (including the case where the industrial machine 101 cannot be recognized), the relay device 102 transmits response data including an exception code to the client device 104.
[0069] According to this modification, in a configuration in which a plurality of industrial machines 101 are connected to one relay device 102 via communication links 106, the relay device 102 can identify acquired data related to an industrial machine system provided in the industrial machine 101 desired by the user 105 via the client device 104, and can transmit response data including the appropriate acquired data to the client device 104. This allows the user 105 to know the appropriate acquired data.
[0070] In the above embodiment, each component may be realized by a dedicated hardware or by executing a software program suitable for each component. Each component may be realized by a program execution unit such as a CPU or a processor reading and executing a software program recorded on a recording medium such as a hard disk or a semiconductor memory. [Industrial Applicability]
[0071] The present invention can be applied to a relay device or the like that communicates with each of industrial machines and client devices according to, for example, the Modbus communication protocol. [Explanation of symbols]
[0072] 100 Communication Systems 101 Industrial Machinery 102 Relay device 103 Network 104 client devices 105 users 106 Communication Links 201 Acquisition Department 202 Judgment section 203 Storage section 204 Generation part 205 Communications Department 300 Industrial Machinery System Compatible Table 301 Industrial Machinery 302 Data start address 303 Address Range 400 Acquired Data Correspondence Table 401 Acquired Data 402 Data start address 403 Address Range 500 Acquired Data Correspondence Table
Claims
1. A relay device that relays communication between an industrial machine and a client device in accordance with a Modbus (registered trademark) protocol, An acquisition unit that acquires data related to the industrial machine; a storage unit that stores an acquired data correspondence table that associates the acquired data acquired by the acquisition unit with an address range in which the acquired data is stored, and an industrial machine system correspondence table that associates the system number of the industrial machine with the address range; A communication unit for receiving a machine data acquisition request from the client device; A determination unit, a determination unit that determines whether communication with the industrial machine is possible and whether an address range included in the machine data acquisition request is within an address range defined in the industrial machine system correspondence table; A generation unit, According to the notification of the judgment result of the judgment unit, (a) generating response data including an exception code when a determination result indicates that communication with the industrial machine is impossible; (b) when the determination result indicates that communication with the industrial machine is possible, (A) when it is determined that the address range included in the machine data acquisition request is within the address range defined in the industrial machine system correspondence table, generating response data including the acquisition data identified by the address; (i) a generating unit that generates response data including the exception code when it is determined that the address range included in the machine data acquisition request is outside the address range defined in the industrial machine system correspondence table; and a plurality of communication ports connected to a plurality of industrial machines and corresponding to each of the plurality of industrial machines; Equipped with Further, the storage unit stores a communication port number associated with each of the plurality of industrial machines, The machine data acquisition request further includes the communication port number. The determination unit further determines whether or not an industrial machine associated with the communication port number included in the machine data acquisition request is connected to the relay device; (i) when it is determined that an industrial machine associated with the communication port number is not connected to the relay device, notifying the generation unit of a determination result that communication with the industrial machine is impossible; (ii) when it is determined that an industrial machine associated with the communication port number is connected to the relay device, notifying the generation unit of a determination result that communication with the industrial machine is possible; The communication unit transmits the response data generated by the generation unit to the client device. Relay device.
2. A method for providing information from an industrial machine to a client device in accordance with a Modbus protocol by a relay device that relays communication between the industrial machine and the client device, acquiring data relating to the industrial machine; a storage step of storing an acquired data correspondence table in which the acquired data acquired by the acquiring step corresponds to an address range in which the acquired data is stored, and an industrial machine system correspondence table in which an industrial machine system number corresponds to the address range; receiving a request to obtain machine data from the client device; a determining step of determining whether communication with the industrial machine is possible and whether an address range included in the machine data acquisition request transmitted by the client device is within an address range defined in the industrial machine system correspondence table stored in the storing step; Furthermore, in the storing step, a communication port number associated with each of the plurality of industrial machines is stored, The machine data acquisition request further includes the communication port number. In the determination step, it is further determined whether or not an industrial machine associated with the communication port number included in the machine data acquisition request is connected to the relay device; (i) when it is determined that the industrial machine associated with the communication port number is not connected to the relay device, notifying a determination result that communication with the industrial machine is impossible; (ii) when it is determined that an industrial machine associated with the communication port number is connected to the relay device, notifying a determination result that communication with the industrial machine is possible; A generating step, According to the notification of the judgment result of the judgment step, (a) generating response data including an exception code when a determination result indicates that communication with the industrial machine is impossible in the determining step; (b) a determination result that communication with the industrial machine is possible in the determination step, (A) when it is determined that the address range included in the machine data acquisition request is within the address range defined in the industrial machine system correspondence table, generating response data including the acquisition data identified by the address; (i) generating response data including the exception code when it is determined that the address range included in the machine data acquisition request is outside the address range defined in the industrial machine system correspondence table; a transmitting step of transmitting the response data generated in the generating step to the client device. method.
3. A program causing a computer to execute the method according to claim 2.
Citation Information
Patent Citations
Data item acquisition scheduling method for acquiring data of programmable logic controller
CN111240289A
Communication control device and method
JP2017034433A
Master device, slave device, and communication system
JP2017046250A
Relay communication system, relay station and relay method
JP2017098762A
Data diode device with specific packet relay function
JP2017123603A