TW201312972A - System, gateway, and method for setting configuration by learning command - Google Patents

System, gateway, and method for setting configuration by learning command Download PDF

Info

Publication number
TW201312972A
TW201312972A TW100132531A TW100132531A TW201312972A TW 201312972 A TW201312972 A TW 201312972A TW 100132531 A TW100132531 A TW 100132531A TW 100132531 A TW100132531 A TW 100132531A TW 201312972 A TW201312972 A TW 201312972A
Authority
TW
Taiwan
Prior art keywords
communication
command
gateway
module
commands
Prior art date
Application number
TW100132531A
Other languages
Chinese (zh)
Other versions
TWI445359B (en
Inventor
Bo-Er Wei
Kuo-Wei Chu
Original Assignee
Moxa Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Moxa Inc filed Critical Moxa Inc
Priority to TW100132531A priority Critical patent/TWI445359B/en
Publication of TW201312972A publication Critical patent/TW201312972A/en
Application granted granted Critical
Publication of TWI445359B publication Critical patent/TWI445359B/en

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A system, a gateway, and a method for setting configuration by learning command are provided. By gather commands sent in a first network, storing a target data read/wrote by a first device in the first network based on the command into an address, and mapping an I/O module used to read/write the target data by a second device to the address, the system and the method can set configuration of gateway automatically, and can achieve the effect of enhancing the efficiency of setting configuration.

Description

學習命令以自動組態設定之系統、閘道器及其方法Learning command to automatically configure setting system, gateway and method thereof

一種組態設定系統、閘道器及方法,特別係指一種學習命令以自動組態設定之系統、閘道器及其方法。A configuration setting system, a gateway device and a method, in particular, a system for learning a command to automatically configure a setting, a gateway device and a method thereof.

在使用不同通訊協定之兩個網路中的裝置需要進行資料傳遞時,需要可以整合上述兩網路所使用之通訊協定的閘道器,也就是說,傳送資料的裝置需要將欲傳遞之目標資料傳送到閘道器,閘道器會依據傳送資料之裝置所使用的通訊協定取得目標資料,再使用接收資料的裝置所使用之通訊協定,將目標資料提供給接收資料的裝置。When devices in two networks using different communication protocols need to transmit data, it is necessary to integrate the gateways of the communication protocols used by the two networks, that is, the devices transmitting the data need to pass the target to be transmitted. The data is transmitted to the gateway, and the gateway obtains the target data according to the communication protocol used by the device transmitting the data, and then uses the communication protocol used by the device receiving the data to provide the target data to the device receiving the data.

為了要讓溝通異質網路的閘道器可以正確的由傳送資料之裝置所使用的通訊協定取得目標資料,以及使用接收資料的裝置所使用之通訊協定,將目標資料正確的提供給接收資料的裝置,閘道器需要經過使用者進行正確的設定。In order to allow the gateway of the heterogeneous network to correctly obtain the target data by the communication protocol used by the device transmitting the data, and the communication protocol used by the device receiving the data, the target data is correctly provided to the receiving data. The device and the gateway need to be properly set by the user.

目前設定溝通異質網路的閘道器方式,需要先查詢資料表(datasheet)了解各個傳送資料之裝置的識別碼、支援的命令、資料的儲存位置、資料的長度、以及輪詢(polling)的時間等命令參數,並依據命令參數,將傳送資料之裝置可能會使用到的通訊命令設定到閘道器中,接著,要配置閘道器的內部記憶體,將上述通訊命令所存取之資料對應到配置的儲存空間中,並配置接收資料之裝置存取內部記憶體的輸出入模組(I/O Module),之後,開始測試上述之設定是否正確,也就是測試資料是否正確的被傳遞,若否,則修改錯誤的設定,直到設定正確為止。At present, the gateway mode for communicating heterogeneous networks needs to first query the data sheet to know the identification code of each device that transmits data, the supported commands, the storage location of the data, the length of the data, and the polling. Time and other command parameters, and according to the command parameters, the communication command that the device transmitting the data may use is set to the gateway, and then the internal memory of the gateway is configured to access the data accessed by the communication command. Corresponding to the configured storage space, and the device that receives the data accesses the I/O Module of the internal memory, and then starts to test whether the above setting is correct, that is, whether the test data is correctly transmitted. If not, modify the wrong settings until the settings are correct.

在實務上,由於命令參數繁雜,且常需設定數十到一百組命令,上述的設定過程將可能花費數小時至數天,除了非常容易設定錯誤之外,還需要不斷的測試才能確定設定是否正確,這樣的設定方式除了浪費時間之外,也非常的不易設定使用。In practice, due to the complicated command parameters and the need to set tens to 100 sets of commands, the above setting process may take hours to days. In addition to the easy setting of errors, continuous testing is required to determine the settings. Whether it is correct or not, such a setting method is very difficult to set and use in addition to wasting time.

綜上所述,可知先前技術中長期以來一直存在異質網路閘道器設定費時且不易設定的問題,因此有必要提出改進的技術手段,來解決此一問題。In summary, it has been known in the prior art that heterogeneous network gateways have long been problematic and difficult to set up. Therefore, it is necessary to propose improved technical means to solve this problem.

有鑒於先前技術存在異質網路閘道器設定費時且不易設定的問題,本發明遂揭露一種學習命令以自動組態設定之系統、閘道器及其方法,其中:本發明所揭露之學習命令以自動組態設定之閘道器,至少包含:內部記憶體;第一通訊介面,用以使用第一通訊協定與第一網路連接,第一網路包含第一裝置;第二通訊介面,用以使用第二通訊協定與第二網路連接,第二網路包含第二裝置;設定模組,用以設定第一通訊介面使用第一通訊協定之通訊參數;條件判斷模組,用以判斷停止收集條件是否被滿足;命令收集模組,用以透過第一通訊介面收集於第一網路中被傳送之通訊命令,直到條件判斷模組判斷停止收集條件被滿足;資料對應模組,用以將通訊命令所讀寫之目標資料儲存於內部記憶體中,並將儲存目標資料之儲存位址對應至通訊輸出入模組,使第二裝置經由通訊輸出入模組存取目標資料。In view of the prior art, there is a problem that the heterogeneous network gateway setting is time-consuming and difficult to set, and the present invention discloses a system for automatically configuring a learning command, a gateway, and a method thereof, wherein: the learning command disclosed in the present invention The gateway configured by the automatic configuration includes at least: internal memory; the first communication interface is connected to the first network by using the first communication protocol, the first network includes the first device; the second communication interface, The second network includes a second device, the second network includes a second device, the setting module is configured to set a communication parameter of the first communication interface using the first communication protocol, and the condition determining module is configured to: Determining whether the collection condition is stopped; the command collection module is configured to collect the communication command transmitted in the first network through the first communication interface until the condition determination module determines that the collection condition is stopped; the data corresponding module, The target data read and written by the communication command is stored in the internal memory, and the storage address of the storage target data is corresponding to the communication output module, so that Device into the target data access modules via communication output.

本發明所揭露之學習命令以自動組態設定之系統,至少包含:設定模組,用以設定閘道器使用第一通訊協定之通訊參數;條件判斷模組,用以判斷停止收集條件是否被滿足;命令收集模組,用以透過第一通訊介面收集於第一網路中被傳送之通訊命令,直到條件判斷模組判斷停止收集條件被滿足;資料對應模組,用以將通訊命令所讀寫之目標資料儲存於閘道器之內部記憶體中,並將儲存目標資料之儲存位址對應至通訊輸出入模組,使第二裝置經由通訊輸出入模組存取目標資料。The system for automatically configuring the learning command disclosed by the present invention comprises at least: a setting module for setting a communication parameter of the gateway using the first communication protocol; and a condition determining module for determining whether the collection condition is stopped. The command collection module is configured to collect the communication command transmitted in the first network through the first communication interface until the condition determination module determines that the collection condition is stopped; the data corresponding module is used to send the communication command The target data of the reading and writing is stored in the internal memory of the gateway device, and the storage address of the storage target data is corresponding to the communication output module, so that the second device accesses the target data via the communication output module.

本發明所揭露之學習命令以自動組態設定之方法,其步驟至少包括:設定閘道器使用一第一通訊協定之通訊參數;連接閘道器及使用第一通訊協定之第一網路,第一網路包含至少一第一裝置;收集於第一網路中被傳送之通訊命令,直到停止收集條件被滿足;對應通訊命令所讀寫之目標資料之儲存位址至通訊輸出入模組,使使用第二通訊協定與閘道器連接之第二裝置經由通訊輸出入模組存取目標資料。The learning command disclosed in the present invention has an automatic configuration setting method, the method comprising the steps of: setting a gateway to use a first communication protocol communication parameter; connecting the gateway and using the first network of the first communication protocol, The first network includes at least one first device; the communication command transmitted in the first network is collected until the collection condition is stopped; and the storage address of the target data read and written by the corresponding communication command is sent to the communication output module. And the second device connected to the gateway using the second communication protocol accesses the target data via the communication output module.

本發明所揭露之系統與方法如上,與先前技術之間的差異在於本發明利用收集於第一網路中被傳送之通訊命令,並將通訊命令所讀寫之目標資料的儲存位址對應至第二裝置至閘道器存取目標資料之通訊輸出入模組,藉以解決先前技術所存在的問題,並可以達成提升閘道器組態設定之效率的技術功效。The system and method disclosed by the present invention are as above, and the difference from the prior art is that the present invention utilizes the communication command transmitted in the first network and associates the storage address of the target data read and written by the communication command to The second device to the gateway accesses the communication output module of the target data, thereby solving the problems existing in the prior art, and achieving the technical effect of improving the efficiency of setting the configuration of the gateway.

以下將配合圖式及實施例來詳細說明本發明之特徵與實施方式,內容足以使任何熟習相關技藝者能夠輕易地充分理解本發明解決技術問題所應用的技術手段並據以實施,藉此實現本發明可達成的功效。The features and embodiments of the present invention will be described in detail below with reference to the drawings and embodiments, which are sufficient to enable those skilled in the art to fully understand the technical means to which the present invention solves the technical problems, and The achievable effects of the present invention.

本發明如「第1圖」所示,可以讓連接異質網路的閘道器100主動收集在第一網路300中所使用的通訊命令,並建立各個通訊命令與第二網路400中之裝置存取閘道器100中之資料所使用之通訊輸出入模組的對應關係,使得閘道器100的組態能夠即時的自動設定。其中,第一網路300使用第一通訊協定,第二網路400使用第二通訊協定。The present invention, as shown in FIG. 1, allows the gateway 100 connected to the heterogeneous network to actively collect the communication commands used in the first network 300, and establish the respective communication commands and the second network 400. The correspondence between the communication input and output modules used by the device to access the data in the gateway 100 enables the configuration of the gateway 100 to be automatically set in real time. Among them, the first network 300 uses the first communication protocol, and the second network 400 uses the second communication protocol.

以下先以「第2A圖」本發明所提之學習命令以自動組態設定之閘道器之元件示意圖來說明本發明的運作。如「第2A圖」所示,本發明之閘道器100含有第一通訊介面111、第二通訊介面112、內部記憶體120、設定模組210、命令收集模組220、條件判斷模組230、及資料對應模組250。In the following, the operation of the present invention will be described with reference to the elemental schematic diagram of the gateway device of the automatically configured setting in the "2A" drawing of the present invention. As shown in FIG. 2A, the gateway device 100 of the present invention includes a first communication interface 111, a second communication interface 112, an internal memory 120, a setting module 210, a command collection module 220, and a condition determination module 230. And the data corresponding module 250.

第一通訊介面111負責使用第一通訊協定與第一網路300中之第一裝置(310、320、330)傳遞資料。The first communication interface 111 is responsible for communicating data with the first device (310, 320, 330) in the first network 300 using the first communication protocol.

第二通訊介面112負責使用第二通訊協定與第二網路400中之第二裝置(410、420)傳遞資料。The second communication interface 112 is responsible for communicating data with the second device (410, 420) in the second network 400 using the second communication protocol.

內部記憶體120包含輸入區塊(Input Block)以及輸出區塊(Output Block),其中,輸出區塊提供第二裝置(410、420)儲存寫入第一裝置(310、320、330)之目標資料,輸入區塊儲存寫入第二裝置之目標資料。The internal memory 120 includes an input block and an output block, wherein the output block provides the second device (410, 420) to store the target written to the first device (310, 320, 330). Data, the input block stores the target data written to the second device.

設定模組210負責設定第一通訊介面111所使用之第一通訊協定之通訊參數,使得閘道器100可以與第一網路300中之第一裝置310傳遞資料。在本發明中,第一通訊協定可為但不限於如Modbus、DF1、CANbus等以通訊命令來進行資料讀寫之現場總線(Fieldbus)協定。The setting module 210 is responsible for setting the communication parameters of the first communication protocol used by the first communication interface 111, so that the gateway 100 can transmit data with the first device 310 in the first network 300. In the present invention, the first communication protocol may be, but not limited to, a Fieldbus protocol such as Modbus, DF1, CANbus, etc. for reading and writing data by communication commands.

本發明所提之通訊參數包含但不限於運行模式、傳輸速度(baud rate)、奇偶校驗(parity)、停止位元(stop bit)、以及介面類型等。其中,運行模式在第一通訊協定為Modbus時可為Modbus RTU或Modbus ASCII,在第一通訊協定為DF1時可為全雙工(full-duplex)或半雙工(half-duplex)等,介面類型例如RS-232、RS-422、或RS-485等。The communication parameters proposed by the present invention include, but are not limited to, an operation mode, a baud rate, a parity, a stop bit, and an interface type. The operation mode may be Modbus RTU or Modbus ASCII when the first communication protocol is Modbus, and may be full-duplex or half-duplex when the first communication protocol is DF1, etc. Types such as RS-232, RS-422, or RS-485.

命令收集模組220負責透過閘道器100之第一通訊介面111收集在第一網路300中被傳送的通訊命令。命令收集模組220可以完整地記錄所接收到之通訊命令,在第一通訊協定為Modbus時,命令收集模組220所記錄之通訊命令的內容包含但不限於如通訊命令中之從站位址(slave address)、功能碼(function code)、資料起始位址(start address)、資料量(quantity)、以及資料等,而在第一通訊協定為DF1時,命令收集模組220所記錄之通訊命令的內容包含但不限於如通訊命令中之目標節點位址(destination node address)、來源節點位址(source node address)、命令碼(command code)、功能碼、記憶體位址(address of memory location)以及資料等。The command collection module 220 is responsible for collecting communication commands transmitted in the first network 300 through the first communication interface 111 of the gateway 100. The command collection module 220 can completely record the received communication command. When the first communication protocol is Modbus, the content of the communication command recorded by the command collection module 220 includes, but is not limited to, a slave address in the communication command. (slave address), function code, start address, quantity, and data, etc., and when the first protocol is DF1, the command collection module 220 records The content of the communication command includes, but is not limited to, a destination node address, a source node address, a command code, a function code, and an address of a memory in a communication command. Location) and information.

在部分的實施例中,命令收集模組220可以控制閘道器100進入第一通訊協定中之從站裝置(slave)的模式,藉以接收第一通訊協定中之主站裝置(master)對具有不同從站位址之各從站裝置所發送之各個通訊命令,或對具有不同目標節點位址之各目標節點(destination node)所發送之各個通訊命令,並在接收到各個通訊命令後,透過第一通訊介面111傳送回應(response)至發出通訊命令的主站裝置,以及記錄所接收到的通訊命令。而隨著閘道器100之第一通訊介面111之介面類型的不同,在另一部分的實施例中,命令收集模組220也可以控制閘道器100進入第一通訊協定中之探測裝置(sniffer)的模式,藉以探測第一通訊協定中之主站裝置/來源節點對從站裝置/目標節點所發送之通訊命令,並於探測到通訊命令後記錄所接收到的通訊命令。In some embodiments, the command collection module 220 can control the mode in which the gateway 100 enters the slave device in the first communication protocol, thereby receiving the master pair in the first communication protocol. Each communication command sent by each slave device of a different slave address, or each communication command sent by each destination node having a different target node address, and after receiving each communication command, The first communication interface 111 transmits a response to the primary station device that issued the communication command, and records the received communication command. In another embodiment, the command collection module 220 can also control the gateway 100 to enter the detection device in the first communication protocol (sniffer) according to the interface type of the first communication interface 111 of the gateway 100. a mode for detecting a communication command sent by the master device/source node in the first communication protocol to the slave device/target node, and recording the received communication command after detecting the communication command.

另外,命令收集模組220更可以判斷閘道器100是否支援所收集到之通訊命令,當閘道器100支援收集到之通訊命令時,記錄收集到之通訊命令,而當閘道器100不支援所收集到之通訊命令時,則僅記錄所收集到之通訊命令中的從站位址或節點位址等內容以及記錄收集到之不支援之通訊命令的次數。相似的,命令收集模組220也可以判斷所收集到之通訊命令是否合法,當收集到之通訊命令不合法時,命令收集模組220可以記錄收集到之不合法之通訊命令的次數。In addition, the command collection module 220 can further determine whether the gateway 100 supports the collected communication command. When the gateway 100 supports the collected communication command, the collected communication command is recorded, and when the gateway 100 does not When the collected communication command is supported, only the contents of the slave address or the node address in the collected communication command and the number of times the collected communication commands are not recorded are recorded. Similarly, the command collection module 220 can also determine whether the collected communication command is legal. When the collected communication command is illegal, the command collection module 220 can record the number of illegal communication commands collected.

條件判斷模組230負責判斷停止收集條件是否被滿足,在本發明中,命令收集模組220可以持續的收集通訊命令,直到條件判斷模組230判斷停止收集條件被滿足為止。本發明所提之停止收集條件可以由系統預定,例如收集通訊命令之時間達到特定系統周期、被收集之通訊命令數於特定時間內不再增加等,也可以由使用者自訂,例如使用者可以依據命令收集模組220所收集到之通訊命令的全部內容、所收集到之通訊命令的數量、命令收集模組220收集通訊命令的總時間等項目定義停止收集條件,但本發明所提之停止收集條件並不以上述為限,凡可以判斷已完成收集在第一網路300中之被傳送的通訊命令的方式都可以被本發明所使用。The condition determining module 230 is responsible for determining whether the stop collection condition is satisfied. In the present invention, the command collection module 220 can continuously collect the communication command until the condition determination module 230 determines that the stop collection condition is satisfied. The stop collection condition proposed by the present invention may be predetermined by the system, for example, the time for collecting the communication command reaches a specific system period, the number of collected communication commands is no longer increased within a specific time, or may be customized by the user, for example, the user. The collection condition may be stopped according to the item definition of the communication command collected by the command collection module 220, the number of collected communication commands, and the total time for the command collection module 220 to collect the communication command, but the present invention proposes The cessation of collection conditions is not limited to the above, and any manner in which it is judged that the transmitted communication commands collected in the first network 300 have been completed can be used by the present invention.

資料對應模組250負責在條件判斷模組230判斷停止收集條件被滿足後,也就是,命令收集模組220停止收集在第一網路300中傳遞之通訊命令後,將第一通訊介面111所接收到之通訊命令所讀寫的目標資料儲存在閘道器100的內部記憶體120中,並將儲存目標資料的儲存位址對應至第二網路400中之第二裝置410/420至閘道器100的內部記憶體120存取目標資料所使用之通訊輸出入模組(圖中未示),使該第二裝置410/420可以經由通訊輸出入模組所對應到之儲存位址存取目標資料。在本發明中,第二網路400所使用的第二通訊協定可為但不限於如PROFIBUS、PROFINET、Ethernet/IP及DeviceNet等以輸出輸入資料交換(I/O data exchange)來進行通訊之現場總線協定。The data correspondence module 250 is responsible for the first communication interface 111 after the condition determination module 230 determines that the stop collection condition is satisfied, that is, after the command collection module 220 stops collecting the communication commands transmitted in the first network 300. The target data read and written by the received communication command is stored in the internal memory 120 of the gateway 100, and the storage address of the storage target data is mapped to the second device 410/420 in the second network 400. The internal memory 120 of the tracker 100 accesses the communication output module (not shown) used by the target data, so that the second device 410/420 can store the storage address corresponding to the communication module. Take the target data. In the present invention, the second communication protocol used by the second network 400 may be, but is not limited to, a field for communication such as PROFIBUS, PROFINET, Ethernet/IP, and DeviceNet for outputting I/O data exchange. Bus protocol.

此外,本發明之閘道器100更可以包含顯示模組240,負責提供顯示被收集之通訊命令數、不支援之通訊命令數、不合法之通訊命令數、不支援之通訊命令的從站位址/目標節點位址、或不合法之通訊命令的從站位址/目標節點位址等統計資料。In addition, the gateway device 100 of the present invention may further include a display module 240, which is responsible for providing a slave station that displays the number of communication commands collected, the number of communication commands that are not supported, the number of illegal communication commands, and the communication commands that are not supported. Statistics such as the address of the address/destination node, or the address of the slave station/target node of the illegal communication command.

本發明之閘道器100也可以包含觸發模式判斷模組290,負責判斷命令收集模組220所收集之通訊命令是否為首次被收集,當觸發模式判斷模組290判斷命令收集模組220收集到之通訊命令為首次被命令收集模組220收集時,定義首次被收集之通訊命令的觸發模式為「資料改變」,而當命令收集模組220所收集到之通訊命令不是首次被收集時,觸發模式判斷模組290可以定義非首次被收集之通訊命令的觸發模式為「週期發送」。The gateway device 100 of the present invention may also include a trigger mode determining module 290, which is responsible for determining whether the communication command collected by the command collecting module 220 is collected for the first time, and when the trigger mode determining module 290 determines that the command collecting module 220 collects When the communication command is collected by the command collection module 220 for the first time, the trigger mode for defining the first collected communication command is "data change", and when the communication command collected by the command collection module 220 is not collected for the first time, the trigger is triggered. The mode determination module 290 can define that the trigger mode of the communication command that is not collected for the first time is "period transmission".

觸發模式判斷模組290也可以在定義通訊命令的觸發模式為「週期發送」後,依據該通訊命令被命令收集模組220收集到之間隔時間計算該通訊命令的觸發週期,計算方式包含但不限於如當命令收集模組220收集到該通訊命令三次以上,則觸發模式判斷模組290將計算命令收集模組220收集到該通訊命令之間隔時間的平均值或中位數等統計值,並以計算出之統計值作為觸發週期。The trigger mode determining module 290 may also calculate the trigger period of the communication command according to the interval time collected by the command collection module 220 after the trigger mode for defining the communication command is “period transmission”, and the calculation manner includes but not When the command collection module 220 collects the communication command three times or more, the trigger mode determining module 290 collects the statistical value of the average or median interval of the communication command collection module 220, and The calculated statistical value is used as the trigger period.

在實務上,上述之設定模組210、命令收集模組220、條件判斷模組230、顯示模組240、資料對應模組250、以及觸發模式判斷模組290並不一定要以閘道器100之模組的方式運作,也可以如「第2B圖」所示,包含在公用程式內,在公用程式被執行後,產生之系統200包含上述之設定模組210、命令收集模組220、條件判斷模組230、顯示模組240、資料對應模組250、以及觸發模式判斷模組290。由於各模組的運作方式與上述相同,故不再贅述。In practice, the setting module 210, the command collecting module 220, the condition determining module 230, the display module 240, the data corresponding module 250, and the trigger mode determining module 290 are not necessarily required to be the gateway 100. The operation of the module may also be included in the utility as shown in "FIG. 2B". After the utility is executed, the system 200 generated includes the above-described setting module 210, command collection module 220, and conditions. The determination module 230, the display module 240, the data correspondence module 250, and the trigger mode determination module 290. Since each module operates in the same manner as described above, it will not be described again.

接著以一個實施例來解說本發明的運作系統與方法,並請參照「第3A圖」本發明所提之學習命令以自動組態設定之方法流程圖。在本實施例中,假設第一網路300所使用之第一通訊協定為Modbus協定,第二網路400所使用之第二通訊協定為PROFIBUS協定。Next, an operational system and method of the present invention will be described with reference to an embodiment, and reference is made to the flowchart of the method for automatically configuring the learning command proposed by the present invention in "3A". In this embodiment, it is assumed that the first communication protocol used by the first network 300 is a Modbus protocol, and the second communication protocol used by the second network 400 is a PROFIBUS protocol.

由於第一網路300與第二網路400所使用之通訊協定不同,因此,第一網路300與第二網路400之間需要透過閘道器100交換資料。若閘道器100包含本發明,則本發明之設定模組210可以提供使用者設定閘道器100之第一通訊介面111使用Modbus協定(第一通訊協定)所需之通訊參數(步驟501)。在本實施例中,使用者可以透過設定模組210設定第一通訊介面111之運行模式、傳輸速度、奇偶校驗、停止位元、以及介面類型。Since the communication protocol used by the first network 300 and the second network 400 is different, it is necessary to exchange data between the first network 300 and the second network 400 through the gateway 100. If the gateway 100 includes the present invention, the setting module 210 of the present invention can provide the communication parameters required by the user to set the first communication interface 111 of the gateway 100 to use the Modbus protocol (first communication protocol) (step 501). . In this embodiment, the user can set the operation mode, the transmission speed, the parity, the stop bit, and the interface type of the first communication interface 111 through the setting module 210.

在設定模組210提供使用者設定閘道器100之第一通訊介面111使用第一通訊協定之通訊參數(步驟501)後,第一通訊介面111可以連接閘道器100與第一網路300(步驟510)。在本實施例中,若第一通訊介面111之介面類型為RS-232,則表示第一網路300中僅有主站裝置,閘道器100將與第一網路300中的主站裝置連接,此時閘道器100為第一網路300中的從站裝置。而若第一通訊介面111之介面類型為RS-422或RS-485,則表示閘道器100分接(Multi-drop)於第一網路300上,此時,第一網路300中包含主站裝置以及一個以上的從站裝置,而閘道器100為第一網路300上的探測裝置。其中,主站裝置可以是可程式邏輯控制器(Programmable Logic Controller,PLC)、人機介面(HMI)或執行有測試軟體之電腦。After the setting module 210 provides the first communication interface 111 of the user setting gateway 100 to use the communication parameters of the first communication protocol (step 501), the first communication interface 111 can be connected to the gateway 100 and the first network 300. (Step 510). In this embodiment, if the interface type of the first communication interface 111 is RS-232, it means that there is only the primary station device in the first network 300, and the gateway 100 will be the primary station device in the first network 300. Connected, the gateway 100 is the slave device in the first network 300. If the interface type of the first communication interface 111 is RS-422 or RS-485, it means that the gateway 100 is multi-dropped on the first network 300. At this time, the first network 300 includes The master station device and more than one slave station device, and the gateway device 100 is a probe device on the first network 300. The master station device may be a Programmable Logic Controller (PLC), a Human Machine Interface (HMI), or a computer that executes test software.

在連接閘道器100以及第一網路300(步驟510)後,命令收集模組220可以透過第一通訊介面111收集在第一網路300中被傳送之各個通訊命令(步驟520)。其中,若閘道器100為第一網路300中的從站裝置,則命令收集模組220還會在接收到通訊命令後,透過第一通訊介面111發出回應至傳送所接收到之通訊命令的主站裝置。在本實施例中,命令收集模組220更可以如「第3B圖」之流程所示,在第一通訊介面111接收到通訊命令後,可以判斷閘道器100是否支援第一通訊介面111所接收到之通訊命令(步驟521),若閘道器100支援該通訊命令,則記錄該通訊命令(步驟529),也就是記錄通訊命令中的從站位址/目標節點位址與來源節點位址、命令碼、功能碼、資料起始位址/記憶體位址、資料量、以及目標資料等內容。而若閘道器100不支援該通訊命令,則命令收集模組220可以只記錄記錄通訊命令中的從站位址/目標節點位址(步驟525)。After connecting the gateway 100 and the first network 300 (step 510), the command collection module 220 can collect the respective communication commands transmitted in the first network 300 through the first communication interface 111 (step 520). If the gateway 100 is a slave device in the first network 300, the command collection module 220 also sends a response through the first communication interface 111 to the received communication command after receiving the communication command. Master station device. In this embodiment, the command collection module 220 can further determine whether the gateway 100 supports the first communication interface 111 after receiving the communication command on the first communication interface 111 as shown in the flow of FIG. 3B. Receiving the communication command (step 521), if the gateway 100 supports the communication command, recording the communication command (step 529), that is, recording the slave address/target node address and the source node in the communication command Address, command code, function code, data start address / memory address, data volume, and target data. If the gateway 100 does not support the communication command, the command collection module 220 can record only the slave address/target node address in the record communication command (step 525).

若在閘道器100中包含觸發模式判斷模組290,則在命令收集模組220收集到通訊命令後,觸發模式判斷模組290可以判斷所收集到之通訊命令的觸發模式。觸發模式判斷模組290可以如「第3C圖」之流程所示,先判斷命令收集模組220收集到之通訊命令是否為首次被收集(步驟532),若是,則觸發模式判斷模組290可以定義該通訊命令之觸發模式為「資料改變」(步驟534),若否,則觸發模式判斷模組290可以定義該通訊命令之觸發模式為「週期發送」(步驟536),並依據該通訊命令被命令收集模組220收集到之間隔時間計算該通訊命令的觸發週期(步驟538)。If the trigger mode determination module 290 is included in the gateway 100, after the command collection module 220 collects the communication command, the trigger mode determination module 290 can determine the trigger mode of the collected communication command. The trigger mode judging module 290 can first determine whether the communication command collected by the command collection module 220 is collected for the first time (step 532), as shown in the flow of the "3C" diagram. If so, the trigger mode judging module 290 can Defining the trigger mode of the communication command is "data change" (step 534). If not, the trigger mode determining module 290 can define that the trigger mode of the communication command is "period transmission" (step 536), and according to the communication command The trigger period of the communication command is calculated by the interval collected by the command collection module 220 (step 538).

回到「第3A圖」,在命令收集模組220收集通訊命令(步驟520)時,條件判斷模組230也會判斷停止收集條件是否被滿足(步驟550),在本實施例中,假設停止收集條件為收集通訊命令之時間達到三個系統周期,則條件判斷模組230會在命令收集模組220收集通訊命令所經過之時間達到三個系統周期後,判斷停止收集條件被滿足,如此,命令收集模組220便會停止收集通訊命令。此時,閘道器100會根據命令收集模組220所收集到之通訊命令的內容,完成在第一網路300中被使用之各個通訊命令的設定,因而可以成為第一網路300之新主站裝置來取代原主站裝置390。若閘道器100原為分接於第一網路300上(閘道器100為探測裝置),則使用者需中斷原主站裝置390與第一網路300的連接,來避免後續閘道器100與從站裝置(第一裝置310/320/330)進行資料讀寫時,受到原主站裝置390的干擾。而若閘道器100原為與原主站裝置390對接(閘道器100為從站裝置),則使用者需將閘道器改與第一網路300中之第一裝置310/320/330(從站裝置)對接,以進行後續的資料讀寫。Returning to "FIG. 3A", when the command collection module 220 collects the communication command (step 520), the condition determination module 230 also determines whether the stop collection condition is satisfied (step 550). In the present embodiment, it is assumed to stop. The collection condition is that the time for collecting the communication command reaches three system cycles, and the condition determination module 230 determines that the collection condition is satisfied after the time elapsed after the command collection module 220 collects the communication command reaches three system cycles. The command collection module 220 will stop collecting communication commands. At this time, the gateway 100 completes the setting of each communication command used in the first network 300 according to the content of the communication command collected by the command collection module 220, and thus can become the new network 300. The primary station device replaces the original primary station device 390. If the gateway 100 is originally tapped on the first network 300 (the gateway 100 is a detecting device), the user needs to interrupt the connection of the original primary station device 390 with the first network 300 to avoid subsequent gateways. When the device 100 reads and writes data from the slave device (the first device 310/320/330), it is interfered by the original master station device 390. If the gateway 100 is originally docked with the original primary station device 390 (the gateway 100 is a secondary device), the user needs to change the gateway to the first device 310/320/ in the first network 300. 330 (slave device) docked for subsequent data reading and writing.

在閘道器100成為第一網路300之主站裝置後,也就是條件判斷模組230判斷停止收集條件被滿足,命令收集模組220停止收集通訊命令後,資料對應模組250可以將所收集的各通訊命令所讀寫之目標資料的儲存位址對應至第二裝置410存取目標資料之通訊輸出入模組(步驟570)。After the gateway 100 becomes the primary station device of the first network 300, that is, the condition determining module 230 determines that the stop collection condition is satisfied, and after the command collection module 220 stops collecting the communication command, the data corresponding module 250 can The storage address of the target data read and written by each collected communication command corresponds to the communication output module of the second device 410 for accessing the target data (step 570).

在本實施例中,假設在命令收集模組220收集通訊命令的過程中,收集到三個讀取之通訊命令,其中,所收集到之通訊命令表示使用者欲操作第二網路400中的第二裝置410讀取第一網路300中之第一裝置310的資料,則如「第4A圖」所示,閘道器100將傳送表示為讀取請求之通訊命令(第一通訊命令)至第一裝置310,第一裝置310在接收到讀取請求後,將會依據讀取請求傳回50字組(words)的目標資料,資料對應模組250將根據閘道器100所傳送之讀取請求中的功能碼以及資料量,計算讀取請求所讀取之目標資料的資料長度,並將第一裝置310所傳回之目標資料寫入閘道器100之內部記憶體120中的輸入區塊。相似的,閘道器100也將傳送讀取請求(第二通訊命令及第三通訊命令)至第一網路300中的其他第一裝置(320、330),若第一裝置320及第一裝置330分別傳回24字組與3位元組的目標資料,則資料對應模組250可以將第一裝置320及第一裝置330傳回之目標資料寫入內部記憶體120中,第一裝置310所傳回之目標資料之後的儲存空間。In this embodiment, it is assumed that during the process of collecting the communication command by the command collection module 220, three read communication commands are collected, wherein the collected communication command indicates that the user wants to operate the second network 400. The second device 410 reads the data of the first device 310 in the first network 300, and as shown in "FIG. 4A", the gateway 100 transmits a communication command (first communication command) indicated as a read request. To the first device 310, after receiving the read request, the first device 310 will return the target data of 50 words according to the read request, and the data corresponding module 250 will transmit according to the gateway 100. Reading the function code and the data amount in the request, calculating the data length of the target data read by the read request, and writing the target data returned by the first device 310 into the internal memory 120 of the gateway 100. Enter the block. Similarly, the gateway 100 will also transmit read requests (second communication commands and third communication commands) to other first devices (320, 330) in the first network 300, if the first device 320 and the first The device 330 returns the target data of the 24-word group and the 3-bit group respectively, and the data corresponding module 250 can write the target data returned by the first device 320 and the first device 330 into the internal memory 120, the first device. The storage space after the target data returned by 310.

接著,資料對應模組250可以配置PROFIBUS協定的通訊輸出入模組至儲存第一裝置310、第一裝置320及第一裝置330傳回之目標資料的儲存空間,由於目標資料一共有151位元組,因此,資料對應模組250可以配置64字組以及23位元組的通訊輸出入模組(使用最少的通訊輸出入模組)或配置50字組、24字組以及3位元組的通訊輸出入模組(使用與通訊命令對應的通訊輸出入模組)至儲存目標資料的儲存空間,之後,第二裝置410便可以透過已配置之通訊輸出入模組讀取儲存於內部記憶體120中的目標資料。Then, the data corresponding module 250 can be configured with the PROFIBUS protocol communication output module to store the storage space of the target data returned by the first device 310, the first device 320, and the first device 330. Since the target data has a total of 151 bits. Therefore, the data corresponding module 250 can be configured with a 64-word group and a 23-bit communication output module (using a minimum of communication output modules) or a 50-word group, a 24-word group, and a 3-byte group. The communication output module (using the communication input/output module corresponding to the communication command) is used to store the storage space of the target data, and then the second device 410 can be read and stored in the internal memory through the configured communication output module. Target data in 120.

而若在命令收集模組220收集通訊命令的過程中,收集到二個寫入之通訊命令,其中,所收集到之通訊命令表示使用者希望將第二網路400中之第二裝置410的資料寫入第一網路300中之第一裝置310中,則如「第4B圖」所示,在資料對應模組250配置63字組以及7位元組的通訊輸出入模組後,第二裝置410可以透過通訊輸出入模組將目標資料寫入閘道器100之內部記憶體120的輸出區塊中,而在第二裝置410使用63字組以及7位元組的通訊輸出入模組將目標資料寫入內部記憶體120中分別與第一裝置310及第一裝置320對應的儲存位置後,閘道器100將依據寫入請求(第四通訊命令以及第五通訊命令)的觸發模式,傳送包含63字組及7位元組之目標資料的寫入請求至第一裝置310及第一裝置320,也就是根據觸發模式判斷模組290所計算出之觸發週期,週期性的傳送寫入請求,或於偵測到內部記憶體120之輸出區塊中的資料改變時傳送寫入請求。If the command collection module 220 collects the communication command, two written communication commands are collected, wherein the collected communication command indicates that the user desires to use the second device 410 in the second network 400. The data is written into the first device 310 in the first network 300. As shown in the "FIG. 4B", after the data corresponding module 250 is configured with 63 words and 7-bit communication output modules, The second device 410 can write the target data into the output block of the internal memory 120 of the gateway 100 through the communication output module, and use the 63-character and 7-bit communication output module in the second device 410. After the group writes the target data into the storage locations corresponding to the first device 310 and the first device 320 in the internal memory 120, the gateway 100 will trigger according to the write request (the fourth communication command and the fifth communication command). The mode transmits a write request including the target data of 63 words and 7 bytes to the first device 310 and the first device 320, that is, according to the trigger period calculated by the trigger mode determination module 290, and periodically transmits Write request, or detect internal A write request is transmitted when the data in the output block of the memory 120 changes.

在第一裝置310接收到寫入請求後,將會依據寫入請求儲存63字組的目標資料,相似的,第一裝置320在接收到寫入請求後,將會依據寫入請求儲存7位元組的目標資料。如此,第二裝置410便可以透過閘道器100將目標資料寫入使用不同通訊協定的第一裝置310、320中。After the first device 310 receives the write request, the target data of 63 words will be stored according to the write request. Similarly, after receiving the write request, the first device 320 will store 7 bits according to the write request. The target data of the tuple. In this manner, the second device 410 can write the target data to the first devices 310, 320 using different communication protocols through the gateway 100.

綜上所述,可知本發明與先前技術之間的差異在於具有利用收集於第一網路中被傳送之通訊命令,並將通訊命令所讀寫之目標資料的儲存位址對應至第二裝置至閘道器存取目標資料的通訊輸出入模組之技術手段,藉由此一技術手段可以解決先前技術所存在異質網路閘道器設定費時且不易設定的問題,進而達成提升閘道器組態設定之效率的技術功效。In summary, it can be seen that the difference between the present invention and the prior art is that there is a communication command transmitted by using the collected in the first network, and the storage address of the target data read and written by the communication command is corresponding to the second device. The technical means for accessing the communication data of the target data to the gateway device can solve the problem that the heterogeneous network gateway device set in the prior art is time-consuming and difficult to set, thereby achieving the lifting gateway device The technical efficiency of the efficiency of the configuration settings.

再者,本發明之學習命令以自動組態設定之方法,可實現於硬體、軟體或硬體與軟體之組合中,亦可在電腦系統中以集中方式實現或以不同元件散佈於若干互連之電腦系統的分散方式實現。Furthermore, the learning command of the present invention can be implemented in hardware, software or a combination of hardware and software by means of automatic configuration setting, or can be implemented in a centralized manner in a computer system or spread over several different components by different components. Even the decentralized way of implementing computer systems.

雖然本發明所揭露之實施方式如上,惟所述之內容並非用以直接限定本發明之專利保護範圍。任何本發明所屬技術領域中具有通常知識者,在不脫離本發明所揭露之精神和範圍的前提下,對本發明之實施的形式上及細節上作些許之更動潤飾,均屬於本發明之專利保護範圍。本發明之專利保護範圍,仍須以所附之申請專利範圍所界定者為準。While the embodiments of the present invention have been described above, the above description is not intended to limit the scope of the invention. Any modification of the form and details of the practice of the present invention, which is a matter of ordinary skill in the art to which the present invention pertains, is a patent protection of the present invention. range. The scope of the invention is to be determined by the scope of the appended claims.

100...閘道器100. . . Gateway

111...第一通訊介面111. . . First communication interface

112...第二通訊介面112. . . Second communication interface

120...內部記憶體120. . . Internal memory

200...系統200. . . system

210...設定模組210. . . Setting module

220...命令收集模組220. . . Command collection module

230...條件判斷模組230. . . Conditional judgment module

240...顯示模組240. . . Display module

250...資料對應模組250. . . Data corresponding module

290...觸發模式判斷模組290. . . Trigger mode judgment module

300...第一網路300. . . First network

310...第一裝置310. . . First device

320...第一裝置320. . . First device

330...第一裝置330. . . First device

390...主站裝置390. . . Master station

400...第二網路400. . . Second network

410...第二裝置410. . . Second device

420...第二裝置420. . . Second device

步驟501 設定閘道器使用第一通訊協定之通訊參數Step 501: setting the communication parameters of the gateway using the first communication protocol

步驟510 連接閘道器及使用第一通訊協定之第一網路,第一網路包含第一裝置Step 510: connecting the gateway and using the first network of the first communication protocol, the first network includes the first device

步驟520 收集於第一網路中被傳送之通訊命令Step 520 collect communication commands transmitted in the first network

步驟521 判斷閘道器是否支援通訊命令Step 521: Determine whether the gateway supports communication commands.

步驟525 記錄通訊命令中之從站位址或目標節點位址Step 525: Record the slave address or the target node address in the communication command.

步驟529 記錄通訊命令Step 529 Record communication commands

步驟532 判斷通訊命令是否首次被收集Step 532: Determine whether the communication command is collected for the first time.

步驟534 定義首次被收集之通訊命令之觸發模式為「資料改變」Step 534 defines that the trigger mode of the first collected communication command is "data change"

步驟536 定義非首次被收集之通訊命令之觸發模式為「週期發送」Step 536 defines that the trigger mode of the communication command that is not collected for the first time is "scheduled transmission"

步驟538 計算非首次被收集之通訊命令之觸發週期Step 538: Calculate the trigger period of the communication command that is not collected for the first time.

步驟550 判斷停止收集條件是否被滿足Step 550: determining whether the stop collection condition is satisfied

步驟570 對應通訊命令所讀寫之目標資料之儲存位址至通訊輸出入模組,使使用第二通訊協定與閘道器連接之第二裝置經由通訊輸出入模組存取目標資料Step 570: corresponding to the storage address of the target data read and written by the communication command to the communication output module, so that the second device connected to the gateway using the second communication protocol accesses the target data via the communication output module

第1圖為本發明所提之連接狀態示意圖。Figure 1 is a schematic view of the connection state of the present invention.

第2A圖為本發明所提之學習命令以自動組態設定之系統架構圖。FIG. 2A is a system architecture diagram of the learning command proposed by the present invention to automatically configure settings.

第2B圖為本發明所提之學習命令以自動組態設定之閘道器之元件示意圖。FIG. 2B is a schematic diagram of components of the gateway device with the learning command set by the present invention.

第3A圖為本發明所提之學習命令以自動組態設定之方法流程圖。Figure 3A is a flow chart of the method for automatically configuring the learning command of the present invention.

第3B圖為本發明所提之記錄通訊命令之詳細方法流程圖。FIG. 3B is a flow chart of a detailed method for recording a communication command according to the present invention.

第3C圖為本發明所提之判斷觸發模式之附加方法流程圖。FIG. 3C is a flow chart of an additional method for determining the trigger mode according to the present invention.

第4A圖為本發明實施例所提之資料傳遞示意圖。FIG. 4A is a schematic diagram of data transmission according to an embodiment of the present invention.

第4B圖為本發明實施例所提之資料傳遞示意圖。FIG. 4B is a schematic diagram of data transmission according to an embodiment of the present invention.

步驟501 設定閘道器使用第一通訊協定之通訊參數Step 501: setting the communication parameters of the gateway using the first communication protocol

步驟510 連接閘道器及使用第一通訊協定之第一網路,第一網路包含第一裝置Step 510: connecting the gateway and using the first network of the first communication protocol, the first network includes the first device

步驟520 收集於第一網路中被傳送之通訊命令Step 520 collect communication commands transmitted in the first network

步驟550 判斷停止收集條件是否被滿足Step 550: determining whether the stop collection condition is satisfied

步驟570 對應通訊命令所讀寫之目標資料之儲存位址至通訊輸出入模組,使使用第二通訊協定與閘道器連接之第二裝置經由通訊輸出入模組存取目標資料Step 570: corresponding to the storage address of the target data read and written by the communication command to the communication output module, so that the second device connected to the gateway using the second communication protocol accesses the target data via the communication output module

Claims (12)

一種學習命令以自動組態設定之方法,係應用於一閘道器,該方法至少包含下列步驟:設定該閘道器使用一第一通訊協定之通訊參數;連接該閘道器及使用該第一通訊協定之一第一網路,該第一網路包含至少一第一裝置;收集於該第一網路中被傳送之至少一通訊命令,直到停止收集條件被滿足;及對應一通訊命令所讀寫之目標資料之儲存位址至至少一通訊輸出入模組,使使用一第二通訊協定與該閘道器連接之一第二裝置經由該通訊輸出入模組存取該目標資料。A learning command for automatically configuring a setting is applied to a gateway device, the method comprising at least the steps of: setting a communication parameter of the first communication protocol for the gateway device; connecting the gateway device and using the first a first network of a communication protocol, the first network comprising at least one first device; collecting at least one communication command transmitted in the first network until the collection condition is stopped; and corresponding to a communication command The storage address of the read and write target data is to the at least one communication input and output module, so that the second device connected to the gateway by using a second communication protocol accesses the target data via the communication output module. 如申請專利範圍第1項所述之學習命令以自動組態設定之方法,其中該收集於該第一網路中被傳送之該些通訊命令之步驟為該閘道器作為第一通訊協定中之從站裝置(slave)/探測裝置(sniffer),藉以接收/探測第一通訊協定中之主站裝置(master)對具有不同從站位址(slave address)之各從站裝置或不同目標節點位址(destination node address)之各目標節點(destination node)所發送之各該通訊命令,並於接收/探測到各該通訊命令後記錄該些通訊命令。The method of automatically configuring the learning command as described in claim 1 of the patent application, wherein the step of collecting the communication commands transmitted in the first network is the gateway as the first communication protocol Slave/sniffer to receive/detect the master station in the first protocol to each slave device or different target node with different slave addresses Each of the communication commands sent by each destination node of the destination node address, and the communication commands are recorded after receiving/detecting each of the communication commands. 如申請專利範圍第1項所述之學習命令以自動組態設定之方法,其中該方法於該收集於該第一網路中被傳送之該些通訊命令之步驟後,更包含判斷各該通訊命令是否為首次被收集,當一該通訊命令為首次被收集時,定義該首次被收集之通訊命令之觸發模式為「資料改變」,當一該通訊命令不為首次被收集時,定義該非首次被收集之通訊命令之觸發模式為「週期發送」,並計算該非首次被收集之通訊命令之觸發週期之步驟。The method of automatically configuring a learning command as described in claim 1 of the patent application, wherein the method further comprises determining the communication after the step of collecting the communication commands transmitted in the first network Whether the command is collected for the first time. When a communication command is collected for the first time, the trigger mode for defining the first collected communication command is "data change". When the communication command is not collected for the first time, the non-first time is defined. The trigger mode of the collected communication command is "periodic transmission", and the step of triggering the trigger cycle of the communication command that is not collected for the first time is calculated. 如申請專利範圍第1項所述之學習命令以自動組態設定之方法,其中該收集於該第一網路中被傳送之該些通訊命令之步驟更包含判斷該閘道器是否支援該些通訊命令,當該閘道器支援該些通訊命令時,記錄該些通訊命令,當該閘道器不支援該些通訊命令時,記錄該些通訊命令中之從站位址或目標節點位址之步驟。The method of automatically configuring a learning command as described in claim 1 , wherein the step of collecting the communication commands transmitted in the first network further comprises determining whether the gateway supports the a communication command, when the gateway supports the communication commands, recording the communication commands, and when the gateway does not support the communication commands, recording the slave address or the target node address in the communication commands The steps. 如申請專利範圍第1項所述之學習命令以自動組態設定之方法,其中該停止收集條件為收集通訊命令之時間達到特定系統周期、被收集之通訊命令數於特定時間內不再增加、或依據已收到之通訊命令、已收到之通訊命令數、及/或收集通訊命令所經過之時間所定義。The method for automatically configuring the learning command as described in claim 1 of the patent scope, wherein the stopping collection condition is that the time for collecting the communication command reaches a specific system period, and the number of collected communication commands does not increase within a specific time, Or as defined by the communication commands received, the number of communication commands received, and/or the time elapsed between the collection of communication commands. 如申請專利範圍第1項所述之學習命令以自動組態設定之方法,其中該對應該通訊命令所讀寫之目標資料之儲存位址至至少一通訊輸出入模組,使使用一第二通訊協定與該閘道器連接之一第二裝置經由該通訊輸出入模組存取該目標資料之步驟為寫入該第一裝置回應一讀取命令所傳送之一目標資料至該閘道器之一內部記憶體後,依據該目標資料之資料長度配置至少一通訊輸出入模組,並提供該第二裝置透過該些通訊輸出入模組至該內部記憶體讀取相對應之目標資料。For example, the learning command described in claim 1 of the patent application is automatically configured, wherein the storage address of the target data read and written by the communication command is to at least one communication input and output module, so that a second is used. The step of accessing the target data by the second device connected to the gateway via the communication output module to write the target device to the gateway device in response to a read command sent by the first device After the internal memory is configured, at least one communication input/output module is configured according to the data length of the target data, and the second device is configured to output the corresponding target data through the communication output module to the internal memory. 一種學習命令以自動組態設定之系統,係應用於一閘道器,該閘道器透過一第一通訊介面使用一第一通訊協定與包含一第一裝置之一第一網路連接,及透過一第二通訊介面使用一第二通訊協定與包含一第二裝置之一第二網路連接,該系統至少包含:一設定模組,用以設定該閘道器使用一第一通訊協定之通訊參數;一條件判斷模組,用以判斷一停止收集條件是否被滿足;一命令收集模組,用以透過該第一通訊介面收集於該第一網路中被傳送之至少一通訊命令,直到該條件判斷模組判斷該停止收集條件被滿足;及一資料對應模組,用以將一該通訊命令所讀寫之一目標資料儲存於該閘道器之內部記憶體中,並將儲存該目標資料之儲存位址對應至至少一通訊輸出入模組,使該第二裝置經由該通訊輸出入模組存取該目標資料。A system for learning commands to automatically configure settings is applied to a gateway device that uses a first communication protocol to connect to a first network including a first device through a first communication interface, and Using a second communication protocol to connect to a second network including a second device through a second communication interface, the system includes at least: a setting module configured to set the gateway to use a first communication protocol a communication parameter; a condition determination module for determining whether a stop collection condition is satisfied; and a command collection module for collecting at least one communication command transmitted in the first network through the first communication interface, Until the condition determination module determines that the stop collection condition is satisfied; and a data corresponding module for storing a target data read and written by the communication command in the internal memory of the gateway, and storing The storage address of the target data corresponds to at least one communication input/output module, so that the second device accesses the target data via the communication output module. 一種學習命令以自動組態設定之閘道器,該閘道器至少包含:一內部記憶體;一第一通訊介面,用以使用一第一通訊協定與一第一網路連接,該第一網路包含至少一第一裝置;一第二通訊介面,用以使用一第二通訊協定與一第二網路連接,該第二網路包含至少一第二裝置;一設定模組,用以設定該第一通訊介面使用一第一通訊協定之通訊參數;一條件判斷模組,用以判斷一停止收集條件是否被滿足;一命令收集模組,用以透過該第一通訊介面收集於該第一網路中被傳送之至少一通訊命令,直到該條件判斷模組判斷該停止收集條件被滿足;及一資料對應模組,用以將一該通訊命令所讀寫之一目標資料儲存於該內部記憶體中,並將儲存該目標資料之儲存位址對應至至少一通訊輸出入模組,使該第二裝置經由該通訊輸出入模組存取該目標資料。A gateway for automatically configuring a setting command, the gateway comprising at least: an internal memory; a first communication interface for connecting to a first network using a first communication protocol, the first The network includes at least one first device; a second communication interface for connecting to a second network using a second communication protocol, the second network includes at least one second device; and a setting module for Setting a first communication interface to use a first communication protocol communication parameter; a condition determination module for determining whether a stop collection condition is satisfied; and a command collection module for collecting the first communication interface At least one communication command transmitted in the first network until the condition determining module determines that the stop collection condition is satisfied; and a data corresponding module for storing a target data read and written by the communication command In the internal memory, the storage address storing the target data is corresponding to the at least one communication input and output module, so that the second device accesses the target data via the communication output module. 如申請專利範圍第8項所述之學習命令以自動組態設定之閘道器,其中該命令收集模組是設定該閘道器為第一通訊協定中之從站裝置/探測裝置,藉以接收/探測第一通訊協定中之主站裝置對具有不同從站位址之各從站裝置或不同目標節點位址之各目標節點所發送之各該通訊命令,並於接收/探測到各該通訊命令後記錄該些通訊命令。For example, the learning command described in claim 8 is configured to automatically configure the gateway device, wherein the command collection module sets the gateway device as a slave device/detection device in the first communication protocol, thereby receiving / Detecting each of the communication commands sent by the primary station device in the first communication protocol to each of the target nodes having different slave addresses or different target node addresses, and receiving/detecting each of the communication commands Record these communication commands after the command. 如申請專利範圍第8項所述之學習命令以自動組態設定之閘道器,其中該閘道器更包含一觸發模式判斷模組,用以判斷各該通訊命令是否為首次被收集,當一該通訊命令為首次被收集時,定義該首次被收集之通訊命令之觸發模式為「資料改變」,當一該通訊命令不為首次被收集時,定義該非首次被收集之通訊命令之觸發模式為「週期發送」,並計算該非首次被收集之通訊命令之觸發週期。For example, the learning command described in claim 8 of the patent application is automatically configured to set the gateway, wherein the gateway further includes a trigger mode determining module for determining whether each communication command is collected for the first time. When the communication command is collected for the first time, the trigger mode for defining the first collected communication command is "data change", and when the communication command is not collected for the first time, the trigger mode of the non-first collected communication command is defined. It is "sent periodically" and calculates the trigger period of the communication command that is not collected for the first time. 如申請專利範圍第8項所述之學習命令以自動組態設定之閘道器,其中該命令收集模組更用以判斷該閘道器是否支援該些通訊命令,當該閘道器支援該些通訊命令時,記錄該些通訊命令,當該閘道器不支援該些通訊命令時,記錄該些通訊命令中之從站位址或目標節點位址。For example, the learning command described in claim 8 is configured to automatically configure the gateway device, wherein the command collection module is further configured to determine whether the gateway supports the communication commands, when the gateway supports the When the communication commands are used, the communication commands are recorded, and when the gateway does not support the communication commands, the slave address or the target node address in the communication commands are recorded. 如申請專利範圍第8項所述之學習命令以自動組態設定之閘道器,其中該停止收集條件為收集通訊命令之時間達到特定系統周期、被收集之通訊命令數於特定時間內不再增加、或依據已收到之通訊命令、已收到之通訊命令數、及/或收集通訊命令所經過之時間所定義。For example, the learning command described in claim 8 of the patent application is automatically configured to set the gateway, wherein the stop collection condition is that the time for collecting the communication command reaches a specific system period, and the number of collected communication commands is no longer in a specific time. Increased, or as defined by the communication command received, the number of communication commands received, and/or the time elapsed to collect the communication command.
TW100132531A 2011-09-09 2011-09-09 System, gateway, and method for setting configuration by learning command TWI445359B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW100132531A TWI445359B (en) 2011-09-09 2011-09-09 System, gateway, and method for setting configuration by learning command

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW100132531A TWI445359B (en) 2011-09-09 2011-09-09 System, gateway, and method for setting configuration by learning command

Publications (2)

Publication Number Publication Date
TW201312972A true TW201312972A (en) 2013-03-16
TWI445359B TWI445359B (en) 2014-07-11

Family

ID=48482706

Family Applications (1)

Application Number Title Priority Date Filing Date
TW100132531A TWI445359B (en) 2011-09-09 2011-09-09 System, gateway, and method for setting configuration by learning command

Country Status (1)

Country Link
TW (1) TWI445359B (en)

Also Published As

Publication number Publication date
TWI445359B (en) 2014-07-11

Similar Documents

Publication Publication Date Title
US9686131B2 (en) System, gateway, and method for automatic setting configuration by learning commands
US9015367B2 (en) Fieldbus gateway using virtual serial fieldbus port and data transmission method thereof
CN108693821B (en) Control device, storage medium, control method, and control system
US8886786B2 (en) Method for plant monitoring with a field bus of process automation technology
CN107770022B (en) Data acquisition method based on RTU protocol, electronic equipment and storage medium
CN106814657B (en) Embedded real-time EtherCAT main website construction method based on ARM
US10917706B2 (en) Configurable IoT device data collection
CA2746728C (en) Coupling a specialty system, such as a metering system, to multiple control systems
US11843514B2 (en) Computer-implemented method for restructuring a predefined distributed real-time simulation network
CN104881982A (en) Intelligent meter data acquiring system having self-adaptive meter reading strategy and acquiring method of intelligent meter data acquiring system
CN107689914A (en) A kind of communication means for the Multifunctional gateway for supporting TRDP agreements
CN109194751A (en) Equipment adding method, device, equipment and the readable storage medium storing program for executing of Internet of things system
CN102437952A (en) Method for managing multi-variety Modbus protocol message
CN102142977A (en) Method, network management equipment and system for remotely managing detached node
CN102520658B (en) Industrial human-computer interface configuration system and variable monitoring method thereof
CN104539494B (en) A kind of method and system for identifying wake-up signal
TWI445359B (en) System, gateway, and method for setting configuration by learning command
CN109716247A (en) Arithmetic unit and control system
US10281887B2 (en) Optimized communications with HART instruments
CN103001839B (en) Study order is with the system of automatic configuration setting, gateway and method thereof
CN105791240A (en) Multichannel and multiprotocol channel management method and system
CN108777638A (en) A kind of server log information backup method and system
WO2014020667A1 (en) Programmable logic controller
CN104615118B (en) A kind of power plant's fieldbus DPV1 management systems and method
CN103873299B (en) The method and its device of a kind of equipment state polling