[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

TWI376117B - - Google Patents

Download PDF

Info

Publication number
TWI376117B
TWI376117B TW96100367A TW96100367A TWI376117B TW I376117 B TWI376117 B TW I376117B TW 96100367 A TW96100367 A TW 96100367A TW 96100367 A TW96100367 A TW 96100367A TW I376117 B TWI376117 B TW I376117B
Authority
TW
Taiwan
Prior art keywords
slave
response time
master
time
response
Prior art date
Application number
TW96100367A
Other languages
Chinese (zh)
Other versions
TW200830775A (en
Inventor
Bo Erh Wei
Original Assignee
Moxa Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Moxa Technologies Co Ltd filed Critical Moxa Technologies Co Ltd
Priority to TW96100367A priority Critical patent/TW200830775A/en
Publication of TW200830775A publication Critical patent/TW200830775A/en
Application granted granted Critical
Publication of TWI376117B publication Critical patent/TWI376117B/zh

Links

Landscapes

  • Small-Scale Networks (AREA)
  • Selective Calling Equipment (AREA)

Description

九、發明說明: 【發明所屬之技術領域】 本發明係為提供一種主從端通訊協定下偵測回應時間之方 法,藉由從站裝置對預設個Mo d b u ε要求所得之回應時間 以計算得一精確回應時間,並將該精確回應時間套用於主/從 端之正式通訊時期,主站裝置將可於極精準的時間點下達執行 相關的指令或命令之功效者。 【先前技術】 按,隨著通訊技術的快速演進,其衍生的通訊網路亦隨之 映速發展,並依照其規模大小而可區分為區域網路以及廣域網 路,其中,區域網路則是由許多相同網路架構所完成的區域性 網路,而廣域網路則是由許多的區域網路所組成的大型網路, 且其服務與連線的範圍可遍及全國甚至全世界。 不論是區域網路或廣域網路,其中常見的基本架構,便是 乙太網路(Ethe rne t),而在乙太網路中則包括有利 用光纖或絞線為傳輸線路之集線器(Hub)、交換器( t c h)或路由器(RQuter)等網路#繼裝置, 而藉由網路巾繼裝置與傳輸線簡組合,可使獨戰的區域 網路、以及電腦或其他裝置,如監視系統、保全系統及自動化 等得以進行資料'指令的傳輸或控制。 再者,另-種常見於工業運用的網路架構則為 1376117IX. Description of the Invention: [Technical Field] The present invention provides a method for detecting response time under a master-slave communication protocol, which is calculated by the slave station device's response time to a preset Mo dbu ε request A precise response time is obtained, and the precise response time is applied to the official communication period of the master/slave end, and the master station device can issue the function of executing the relevant instruction or command at a very precise time point. [Prior Art] According to the rapid evolution of communication technology, its derivative communication network has also developed rapidly. According to its size, it can be divided into regional network and wide area network. The regional network is composed of Many of the same network architectures complete the regional network, while the WAN is a large network of many regional networks, and its services and connections can be spread across the country and even the world. Whether it is a regional network or a wide area network, the common basic architecture is the Ethernet (Ethernet), and in the Ethernet, there is a hub that uses fiber or stranded cable as the transmission line. Network, such as a switch (tch) or a router (RQuter), and by means of a network packet relay device and a transmission line, a unique regional network, as well as a computer or other device, such as a monitoring system, Security systems and automation are able to transmit or control data 'instructions'. In addition, another network architecture commonly used in industrial applications is 1376117.

Modbus,Modbus係為一種 於1 9 7 9年所開發的序列式 Α 及“ &翻1協定,碰QdbUs最初 係為運用於與可程式邏輯控 最斗 l〇glc c〇ntr〇; Pr〇grammable 0 1 1 e r S 或稱PLC s)上 =經過錢的演進,M〇dbus已逐漸成為工業Modbus, Modbus is a sequence type developed in 1979 and "& 1 protocol, touch QdbUs originally used for the most combat with programmable logic control l〇glc c〇ntr〇; Pr〇 Grammable 0 1 1 er S or PLC s) = After the evolution of money, M〇dbus has gradually become an industry

说查^爲準’且符合MQdbus架構下的裝置更成為普 一接各種工業電子裝置的工具,而其被各領域廣泛運用的第 一個理由為Mo d b u s標準係為一公開且是不需要支付權利 金’第一則為其該架構可以於短時間修改並運用於實體裳置上 ’而M 〇 d b U S架構可允許傳送原始態樣的位元(r a w b 1 t s)或是文字’且不需受限於所開發廠商則是 Mo db u s被廣泛運用的第三個理由。It is said that the device under the MQdbus architecture has become a tool for various industrial electronic devices, and the first reason for its widespread use in various fields is that the Modbus standard is open and does not need to be paid. The premium 'first' is that the architecture can be modified and applied to the entity in a short time' and the M 〇db US architecture allows the transfer of raw bits (rawb 1 ts) or text 'without Limited to the developers is the third reason why Mo db us is widely used.

然而,由於M〇dbuS係為一種具有主/從關連的通訊 協定,·主站裝置於_從姑置時必f逐―的檢視,而無 法同時_,再者’每-倾主师錢接賴置則配置 有獨-的紐以便從站裝置可以正確的與主站裝置相互溝通, 且僅有欲與主站裝置溝通的從站裝置才會處理线裝置所下達 的指命或命令,無論其它獅裝置是否有㈣該指命或命令。 由於Mo d b u s係為一種具有主/從關連的通訊協定, 且主站裝置於_從站裝置時必需逐—的檢視,因麟衍生的 問題則是如何正4得知從站裝置與主邮置所下達指令的回應 6 1376117 時間,一般而言,現行的Mo db u s從站回應時間的長短, 多由使用者根據經驗法則或錯誤驗證(t r丨a丨a n d e r r o r)等實作經驗或測試來決定,然而此種較不嚴謹的 驗證方式則容易產生所獲得之回應時間不夠精確、採用人工驗 證的高成本和耗時以及設定不適宜之回應時間造成系統無法運 行等問題,舉例而言’-般工業生產線(如:晶圓廠、塑料廠 )等,若無法精準獲得從站裝置所需的回應時間,而使得主站 裝置無法於正確的時_下達正確的齡,或是從站裝置無法 於正確的時間點執行线裝置的命令,财可能使生產線完全 中斷或是發生異常現象,並導虹業生產線上的顺產生靡疾 甚至損毀;再者,如樓宇控制中的溫度控制、逃生系統等,由 於這些動作都極需於正確的時_做正補喃,也因此如果 無法在正俩時_啟__應變措施,將無法助於降低災 害的發生機率與造成的損失。 緣此,上述習用技術之不足,便為從事此行業者所亟欲改 課而有待相關業者作進一步改良與創新設計之必要。 【發明内容】 今’發明人有鑑於上述主從端通訊龄下般回應時間之 方法的缺失與不足’故發明人彻此行業之多年研究發明經驗 ,斷改良與貫驗,終於發明出此種精準之主從端通訊協定 下偵測回應時間之方法。 7 本發明之主要目的乃在域诚騎算從站裝置於回翻 f裝置所發送之Mo d b u s要求所需的回應時間,主控端 二者將可於極精準的時間點下自動啟動相_應變措施,如 士宇的自動控制系統等,由於這些動作都具有_生以及正 時間點觸發的需求’也因此如果可⑽過計算從崎置正確的 回應時間,主控端或管理者將可於極精準的時 ,應變措施,而不至於在過早或過晚的時二 置有助於降低災害的發生機率與造成的損失:有裝 的方2爾散,且不^透過如利用經驗法則或錯誤驗證 力=來取得-概括的回應時間,並做出錯誤的時間點 功效者。 數二!!ΓΓ目的乃在於本發明可利用不同功能的函 .如取诚大、最小解均的從軸應日鋼 -延遲時間’使用者將 几配 的-定未 博疋的工業或技術領域來做精準 r:二 利用經驗法則或錯誤驗證的方法來取 仵一概括的回應時間之功效者。 成為之再—次要目的乃在於’ MG d b U s已逐漸 二=二通訊標準’因此藉由本發明之主從端通訊協定 2==時間之方法’將不需增加實趙的裝置或元件,且為 ==:dbu叫本發明僅需透過軟體設定 的方式卩可^鱗_鱗間轉,因《不需要浪 1376117 費實體裝置的購置成本。 【實施方式】 為達成上· 構造,並為使冑查委員能對於本發明 之目的及掀有更進-步之瞭解,故本發日撕_之技術手段 ’兹繪龍树敗概實_詳加_如下,翻完全瞭解However, since the M〇dbuS system is a master/slave-related communication protocol, the master station device must be viewed from the time of the _, and cannot be simultaneously _, and then The device is configured with a unique button so that the slave device can communicate with the master device correctly, and only the slave device that wants to communicate with the master device will process the command or command issued by the line device, regardless of Whether other lion devices have (4) the command or order. Since the Mo dbus system is a master/slave communication protocol, and the master station device must be viewed on a _ slave station device, the problem derived from the lining is how to learn the slave device and the main post. The response of the issued order 6 1376117 time, in general, the current Mo db us slave response time is mostly determined by the user based on empirical rules or tests such as empirical rules or error verification (tr丨a丨anderror) However, such a less rigorous verification method is prone to problems such as inaccurate response time, high cost and time-consuming manual verification, and unsuitable response time, which may cause the system to be inoperable. For example, Industrial production lines (such as fabs, plastics factories), etc., if the response time required by the slave device cannot be accurately obtained, so that the master station device cannot be at the correct time, or the slave device cannot The correct time to execute the command of the line device, the financial system may completely interrupt the production line or an abnormal phenomenon, and lead to dysentery or even damage in the production line of the rainbow industry. Destroy; in addition, such as temperature control in the building control, escape system, etc., because these actions are extremely necessary at the right time _ do positive tampon, and therefore if you can not be in the positive two _ _ _ contingency measures, will not be Help reduce the incidence and damage caused by disasters. Therefore, the above-mentioned deficiencies in the conventional technology are necessary for those who are engaged in this industry to change their courses and to be further improved and innovatively designed by the relevant industry. SUMMARY OF THE INVENTION Nowadays, the inventor has invented such a lack of methods and methods for responding to time in response to the above-mentioned master-slave communication age. Therefore, the inventor has invented the experience of many years of research and invention in this industry, and has finally invented such a method. A method of detecting response time under a precise master-slave communication protocol. 7 The main purpose of the present invention is to obtain the response time required by the domain controller to return the Mo dbus request sent by the slave device, and the master terminal can automatically start the phase at a very precise time. Strain measures, such as Shiyu's automatic control system, etc., because these actions have the requirements of _sheng and positive time-point triggering, so if the (10) can be calculated from the correct response time, the host or manager will be able to When it is extremely accurate, the contingency measures, rather than being too early or too late, can help reduce the probability of disasters and the losses caused: the installed side is scattered, and it is not through experience. The law or the wrong verification force = to get - the general response time, and make the wrong time point effect. The number two!! The purpose of the invention is that the invention can utilize different functions of the function. For example, the slave axis of the Chengda and the minimum solution should be the steel-delay time of the user's industrial or technical technology. The field is to be precise r: the use of empirical rules or false verification methods to take advantage of the general response time. The second purpose is to make the MG db U s gradually two = two communication standards. Therefore, the method of the master-slave communication protocol 2== time of the present invention will not require the addition of devices or components of the real Zhao. And ==:dbu is called the invention only needs to be set by the software to be able to switch between scales and scales, because "the cost of purchasing a physical device of 1376117 is not required." [Embodiment] In order to achieve the above structure, and in order to enable the members of the investigation committee to have a better understanding of the purpose and the purpose of the present invention, the technical means of tearing off the _ _ _ _ _ _ _ _ _ Add _ as follows, fully understand

首先本說明書先藉由說明本發明所實際運用之 M〇dbUS架構下之RTU及ASCU態樣,再進一步透 過步驟流糊及運算雜錢行綱本㈣具_實作技術, 以利審查委員能有更明確之瞭解。First of all, the specification first explains the RTU and ASCU aspects under the M〇dbUS architecture actually used in the present invention, and further implements the technique of implementing the miscellaneous money through the steps of the flow and the operation of the miscellaneous money (4), so that the review committee can Have a clearer understanding.

由上述習賴術我們已清楚得知M〇 d b u s係為一種具 有主/從關連的通訊協定,—般而言在同一網路中 Mo d b u s允許不同的從贼置連接於—主站裝置,然而於 Mo d b u s絲構下則包括了二種標準架構,第—義為具 有較精簡及利用二進位來呈現資料_Q d b u s rt^ 格’第二_為具有較Mq db u s RTU;^式較長以及具 人類易讀特性來呈現資料的Modbu s ASC I I規格, 而上述二者相同的特性係為二者皆是以序卿方式來進行傳輸 ,且主站裝置發送至從站裝置之要求,僅能於同一個時間點傳 送一要求,然而有關Modbus RTIJ/A S C I I二老 標準袼式的細部說明,再於本說明較後之部分進行詳述。 9 請參閱第一圖及第二圖所示,From the above, we have clearly learned that M〇dbus is a master/slave communication protocol. In general, Mo dbus allows different slaves to connect to the master device in the same network. Under the Mo dbus wire structure, there are two standard architectures. The first meaning is to be more streamlined and use binary to present data. _Q dbus rt^ Grid 'Second _ is more Mq db us RTU; ^ is longer And the Modbu s ASC II specification with human readability to present data, and the same characteristics of the two are transmitted in the order of the preamble, and the request of the master device to the slave device is only A request can be transmitted at the same time point, however, a detailed description of the Modbus RTIJ/ASCII second standard is described in more detail later in this description. 9 See the first and second figures,

MnHh ⑽不,係為本發明較佳實施例之MnHh (10) is not a preferred embodiment of the present invention.

Modbus RTU/As ^ ^ 系構不意圖及本發明 較佳實施例之MQdbus R 科月 ,,, 一 /ASCII通訊示意圖 由圖中所示可清楚看出,本 +發月係社崎置i連接有從站 t 2 ’而主/從的互動可由主站裝置1發出要求至從站裝置 而該要求則包括有—功能碼(Function cod 〇及請求資料(Data reQuest),而待從站裝 置2接收战健1所發出的要倾,若從师置2支援此要 求時,從站裝置2則相應具有功能碼(F u n ^ t i 〇 ^ C〇d〇及回覆資料(Data response)之回 應至主站裝置1’然而若從站裝置2不支援主站裝置丄之要求 時’從站裝置2齡喊具有例外功能碼(The Modbus RTU/As ^ ^ architecture is not intended to be the preferred embodiment of the present invention. The MQdbus R, the one-ASCII communication diagram is clearly shown in the figure. There is a slave station t 2 ' and the master/slave interaction can be issued by the master station device 1 to the slave station device and the request includes a function code (Function cod 〇 and request data (Data reQuest), and the slave station device 2 Receiving the threat from the war 1, if the slave 2 supports this request, the slave device 2 has a response to the function code (F un ^ ti 〇 ^ C〇d〇 and Data response). Master station device 1' However, if the slave station device 2 does not support the request of the master station device, the slave station device 2 years old has an exception function code (

Exception function code) 碼(Exception code)之回應至主站裝置丄。 複請參閱第-圖及第二圖並搭配第三圖所示,係為本發明 較佳實施例之Μ。d b u s R T U/A S C I I通訊架構示 意圖、本發明較佳實施例之Mo dbυ s RTU/ASCI I通訊示意圖及本發明較佳實施例之M〇 d b u s RTU/ A S C I I測試流程圖,由第三圖中所示可清楚看出,其測試 步驟如下: (1 0 0)開始偵測; (1〇1) -至從站裝置2, 主站裝置1發送MOD B u s要求 〔並紀錄發送時間(TSm); 2)=站裝置2接收到主站裝置^發送之m〇d β w 要求; 若否,執行( 1〇3)從轉置2觸是否支援此要求, 0 5); 結果回應,執行 (1 〇 4 )舰裝12執行要求並傳送正確‘ 10 6); :1〇5)從轉置2傳送例外回應,執 1〇6)=裝置1接收到正確/例相應,並記錄接收時 間(丁 R m); m=TRm-TSm. 10 7)計算回應時間r $ 1 執行(101 0 8)判斷是否進行下_次_,若是, )’ R S f = F η R S ν+1); (10 9)計算精確回應時間(r $ RSi » Rs2 , (11 ο)完成偵測。Exception function code) The response of the Exception code to the master device. Referring to the first and second figures, in conjunction with the third embodiment, it is a preferred embodiment of the present invention. Schematic diagram of the dbus RTU/ASCII communication architecture, the Mo dbυ s RTU/ASCI I communication diagram of the preferred embodiment of the present invention, and the M〇dbus RTU/ASCII test flow chart of the preferred embodiment of the present invention are shown in the third figure. It is clear that the test procedure is as follows: (1 0 0) start detection; (1〇1) - to the slave device 2, the master station device 1 sends a MOD B us request [and records the transmission time (TSm); 2) = station device 2 receives the m〇d β w request sent by the master station device; if not, the execution (1〇3) from the transposition 2 touch supports this request, 0 5); the result is echoed, executed (1 〇 4 Ship loading 12 performs the request and transmits the correct '10 6); :1〇5) transmits the exception response from transpose 2, executes 1〇6)=device 1 receives the correct/case corresponding, and records the receiving time (Dm m=TRm-TSm. 10 7) Calculate the response time r $ 1 Execute (101 0 8) to determine whether to perform the next_time_, if yes, ) 'RS f = F η RS ν+1); (10 9) Calculate the exact response time (r $ RSi » Rs2 , (11 ο) to complete the detection.

並記錄該接收時間(T R 簡而言之’本發明係首先係透過主站裝置i發送 M0D BUS要求至欲_之從站裝置2,並紀錄發送要求時 間(TSl) ’爾後,主站裝置1將接收到從站裝置2之回應 m 爪),並計算回應時間(Rs 1376117 TRm — TSm),然而於重複上述步驟n次,每次均可獲得 TSn+ι及TRn+i並計算回應時間RSn+1 ,最後將所獲得之 RSi,rs2,…’ rsn+1代入預先定義之函數Fn (RSi ,RS2,…,RSn+i)計算即可獲得精確回應時間RSf ; 然而,於上述主從端偵測回應時間之方法下所使用的函數中, 於實作上亦可利用平均回應時間加上延遲(d e 1 a y )時間 來計算’因此該F η ()則可為:And recording the reception time (TR in short, 'the invention first transmits the M0D BUS request to the slave station device 2 through the master station device i, and records the transmission request time (TS1)', then the master station device 1 The response m slave will be received from the slave device 2, and the response time (Rs 1376117 TRm - TSm) will be calculated. However, after repeating the above steps n times, TSn+ι and TRn+i can be obtained each time and the response time RSn is calculated. +1, and finally obtain the accurate response time RSf by substituting the obtained RSi, rs2, ...' rsn+1 into the predefined function Fn (RSi, RS2, ..., RSn+i); however, on the above-mentioned master-slave end In the function used to detect the response time, the average response time plus the delay (de 1 ay ) time can also be used to calculate 'so the F η () can be:

RSf =Fn (RSi,RS2,…,rSn+1) 况+1RSf =Fn (RSi,RS2,...,rSn+1)

YrSm M=\ \N^\) T Offset 再者’於上述主從端_回應時間之方法下所使用的函數 中,於實作上亦可利用最長時間加上延遲(d e i a y)時間 來計算’因此該F η ()則可為: RSf =Fn (RSl’RS2,…,RSn+〇YrSm M=\ \N^\) T Offset In addition, the function used in the above-mentioned master-slave_response time method can also use the longest time plus deiay time to calculate ' Therefore, the F η () can be: RSf =Fn (RSl'RS2,...,RSn+〇

MAX (RSl,rS2 ’ ...,MAX (RSl,rS2 ’ ...,

RS N+ 1RS N+ 1

SET TOff 一相的走符合Μ 〇 d b u ε RTU/ASCI I標準規範封包格式之要求,請參閱第四 圖及第四所示’係為MQdbus Rtu標準規範封包 格式不意圖及Mo d b u s δ 〇 r τ τ , DUS ASCH標準規範封包格式示 思圖八中’一者主要的差異係為編碼方式的不同, M〇dbUS ASCI1的從站位址、功能碼及資料攔位為 12 υΐΐ / 將Α4〇 d b u s RTU的相同攔位的各位元組(b y t e ) 的16進位值轉成兩個〇_9,a — f的ASCI I字元( c h a r)來表不,此外Mq d b u s RTu封包格式係包 括有一環狀的檢查和(cyclic redundancy checksum或稱CLC),其封包整體較為精簡, 而Mo dbu s ASC j j封包格式係包括有一線性的檢查 longitudinal redundancy a ecksum或稱lrc),-個紗字元及兩個結束 字元,其封包整體較為冗長,而R Tu/A s c r j二者最主 =^同特_為二者皆是以序列的方式來進行傳輸,因此尺 j s CI I皆可利用上述方式來進行回應時間之侦測, 卷月之主攸端通訊協定下偵測回應時The SET TOff phase is consistent with the requirements of the Μdbu ε RTU/ASCI I standard specification packet format, please refer to the fourth and fourth diagrams. 'The MQdbus Rtu standard specification packet format is not intended and Mo dbus δ 〇r τ τ , DUS ASCH standard specification packet format in the figure 8 'the main difference is the coding method, M〇dbUS ASCI1 slave address, function code and data block is 12 υΐΐ / will be 4〇dbus The 16-bit value of each tuple (byte) of the same block of the RTU is converted into two 〇_9, a-f ASCI I-characters (char), and the Mq dbus RTu packet format includes a ring. Check and (cyclic redundancy checksum or CLC), the overall package is more streamlined, and the Mo dbu s ASC jj packet format includes a linear check of the longitudinal redundancy a ecksum or lrc), a yarn character and two ends Characters, the overall package is rather verbose, and R Tu/A scrj are the most dominant = ^ the same _ both are transmitted in a sequence, so the rule js CI I can use the above method to respond Time detect When, in response to detection of the main terminal protocol Yau volume months

限制RTU/AS Γ τ T I I内含之功能碼(f υ n c t i 〇 n code)及内客广θ 響從站裝置的運行,可^用^,而在實作上為避免_時影 Γ知用返回詢問數據(r e t u r η query ή ά f ^ ta’功能碼為〇χ〇8,次功能碼( sub—funct· v 線IKreaci eQ ^ GQde)為 QX ⑽)、讀取 量輸入(read d S,功能碼〇X〇1)、讀取離散 碼0又0 2)、續取夕“1^161111)111:3’功能 ……二:存器(…“。1ding 功犯碼〇X〇3)、讀取輪入暫存器( 13 1376117 …d input regi s t … )或使用者自定之功能碼來做為M 1能碼〇x〇4 u D U s之^ 請參閱第五圖所示,係為本發明 / 應用於Modb u S主站裝置之干 剩從站之回應時間 技術内容及方法後,主站裝置合上述所說明的 回應時間(RSf )實際運用於正式通訊時期:求得的精確 ^裝置2於正式運作並傳輪資料或命令等=3 時期,因此主站裝置1於正式通訊時期將可利用 間(RL )來鱗靖㈣ 用韻確回應時 站穿置?祕料# 1於那—伽麵點可得到從 =置2所發运的回應’藉此,主站裝置丄不需再透過如習用 間^驗蝴输_鄉轉—輪的回應時 請參閱第六圖所示,係為本發明利用偵測從站之回庫時門 應用㈣〇dbus通訊閉道之示意圖,由圖令可清絲出寺間 Mo d b u s通訊閘道擔分別連接有從站裝 3,待利用上物她川_噴4及=1 ,應時間USF),並待Modbus通訊閉= 設定精確回應時間(RSf)後,即可將精確回應時間 )套用於遠端裝置3、通訊閘道4及從站裝置2之正式通訊時 期因此於一者的互動期間,Mo d b u s通訊間道4將可利 用該精確回應時間(RSf )來精準判斷通訊_於那一個 14 1376117 時間點可_從站裝置2所發送_應或進—步與遠端装置3 互動。 然而’上述說明所運用之主站裝置僅為本發明之主從端通 訊協定下侧回應時間之方法下所使用的較佳實施例,然而於 實作中更可為-Mo d b u s通訊閘道、具制功能之獨立設 備或其它具備發出職要求的伽懷置或巾職置等電子襄置 :再者’上述說明由主站裝所發出的要求,其要求的種類 於實作中可為如讀取多個暫存器(rea(1 hQl(Ung r e g i s t e r s )或返回詢問數據(r e t u『n Query d a t a )等不同要求的指令;再者,於上述說 明所運用的運算函數,於實射亦可為計算平均咖、最長時 門最短時間或上述任一時間再力口上一延遲時間之回應時間計 算方法,固舉凡上述具備發出測試要求的偵測裝置、不同種類 的要求指令及不同的運算函數等皆為本發明欲保護之範圍,且 上述之簡易修飾及等效結構變化,均應同理包含於本發明之專 利範圍内,合予陳明。 是以,本發明與習用之技術相較著實具下列優點: (―)一般於傳統樓宇自動化的應用之中,由於大部分皆採用 近/遠端或主/從裝置的概念來規劃,而所有的事件管 理與應變都會透過一傳輸介面與主控室的電腦連線,當 有狀況時則由主控室的人員或是電腦發佈指令給外部輪 15 出/入裝置去執行一些特定動作,例如:溫度過高則開 啟散熱風扇、安全異相啟時縣示娜亮或溫度 超過火災預設溫度咖啟動自峨水系鮮,由於這些 動作都具有即時性以及正確時_觸發的需求,也因此 如果可以透過計算從站裝置正確的回應_,主控端或 管理者將可於極精準的時_下自動啟動相_應變措 她,而不至於在過早或過晚的時間點觸發相關裝置,如 此將有助於降低災害的發生機率與造成的損失以及可有 效幫助人員的疏散’因此不再需要透過如習用技術般利 用經驗法則或錯誤驗證的方法來取得一概括的回應時間 ’並做出錯誤的時間點判斷。 (一)由於現行的Mo d b u s從站回應時間的長短,多由使 用者根據經驗法則或錯誤驗證(t r i a 1 and e i* r q 實作經驗或峨來決定,然齡b種較不 嚴謹的驗證方式則容易造成所獲得之回應時間不约精確 且若設定不適宜之喃_财可能造成祕無法運行 ’因此於—般工業生產線(如:晶圓廠、塑料廠)等, 若無法精準獲得從站裝置所需的回糾間,而使得主站 裝置無法於正確的時間點下達正確的指命,或是從站裝 置無法於正確的時間點執行主站裝置的命令,將有可能 使生產線完全巾斷或是發生異常現象,並導致工業生產 16 線上的機械產生癱瘓甚至損毀,因此藉由計算主/從端 的精確回應時間(RSf )並運用於裝置間之正式通訊 時期,主端將可精準判斷觸發事件的時間點,並藉此避 免事件觸發時間點的錯亂。 (三) 本發明可利用不同功能的函數功能:如取得最大、最小 或平均的從站回應時間,或進一步搭配一延遲時間,使 用者將可針對特定的工業或技術領域來做精準的設定, 而不需再透過如習用技術般利用經驗法則或錯誤驗證的 方法來取得一概括的回應時間。 (四) 由於世代的演進,Μ0 d b u s已逐漸成為工業領域的 通訊標準,且符合M 〇 d b u s架構下的裳置更成為普 遍連接各虹業電子Μ肛具,因此藉由本發明之I 從端通訊協定下偵測回應時間之方法,將不需增加實體 的裝置或元件,且輕合廣泛·_Q d b u s架構 ,本發明僅需it過倾蚊或絲的方切可完成精準 的回應時間取得,因此將不需要浪費實體裳置的講置成 本0 〔五)本發明係透過直接使用M〇db u s標準規範之命令, 無須定義其他特殊命令,因此所使用之命令將不影響從 站裝置的正常運作,再者,無論是利觀G d b 1^主 站裝置或Mo d b U 3通關道,將可透過軟體計算從 1376117 站的回應時間’使用者將不須手動設定從朗應時間, 避免因叹定不適宜細應時間所造成的祕運作問題, 影響客戶對產品的信心而退貨。 准以上所揭露者,僅是本發明之較佳實施例而已,自不 能以此而舰本發明之專·圍,因此,舉凡制本發明之專 利範圍所做之均錢化娜飾,減包含於本發割涵蓋之專 利範圍内。 、.’不上所述本發明之主從端通訊協定下偵測回應時間之方 法’確實錢到其功效及目的,故本發明誠為_實用性優異之 發明’為符合發明專利之巾請要件,誠符合產業湘性、新顆 性及進步性’爰依法提出申請,盼早日賜准本案以保 Ρ章發明人之辛苦發明’倘若鈞局審委有任何舰,請不吝來 函指示,發明人定當竭力配合,實感公便。Limit the function code (f υ nc ti 〇n code) contained in the RTU/AS Γ τ TII and the operation of the slave θ 响 slave station device, you can use ^, and in practice, to avoid _ Return to the query data (retur η query ή ά f ^ ta' function code is 〇χ〇8, sub-function code (sub-funct·v line IKreaci eQ ^ GQde) is QX (10)), read amount input (read d S, Function code 〇X〇1), read discrete code 0 and 0 2), continue to take the "1^161111" 111:3' function... 2: memory (...". 1ding gong 〇 code X〇3) Read the wheel register (13 1376117 ... d input regi st ... ) or the user-defined function code as the M 1 code 〇 x 〇 4 u DU s ^ See the fifth figure, After the technical content and method of the response time of the invention/applicable to the dry slave station of the Modb u S master station device, the response time (RSf) described above by the master station device is actually applied to the official communication period: obtained Accurate ^ device 2 in the official operation and transmission of data or command, etc. = 3 period, so the master station device 1 will use the room (RL) in the official communication period to scale (4) with the rhyme response Station to wear home? The secret material #1 in that - the gamma point can get the response from the = set 2 'by this, the main station device does not need to pass through the test room, such as the use of the test The six figures show the schematic diagram of the door-to-door (4) busdbus communication closed-circuit application of the detection slave station of the present invention, and the Modbus communication gateway between the temples can be connected with the slave station. 3, to use the material shechuan _ spray 4 and =1, should be time USF), and wait for Modbus communication to close = set the precise response time (RSf), then the exact response time can be applied to the remote device 3, communication The official communication period of gateway 4 and slave device 2 is therefore during the interaction of one, Modbus communication channel 4 will be able to use the precise response time (RSf) to accurately determine the communication _ at that time 14 1376117 time point _ The slave device 2 transmits a _ or step-by-step interaction with the remote device 3. However, the preferred embodiment of the primary station device used in the above description is only the method for the lower side response time of the master-slave communication protocol of the present invention. However, in practice, the -Mo dbus communication gateway can be used. Separate equipment with functional functions or other electronic devices such as Gai Huai or Towels, which have the requirements for issuing jobs: In addition, the above descriptions are issued by the main station, and the types of requirements may be as Read multiple registers (rea (1 hQl (Ung registers) or return query data (retu『n Query data) and other different requirements of the instructions; in addition, the operation function used in the above description, in the real shot can also In order to calculate the response time of the average coffee, the shortest time of the longest time gate, or the delay time of the above-mentioned one time, the above-mentioned detection device with the test request, different kinds of request instructions, different arithmetic functions, etc. The scope of the invention is intended to be protected, and the above-mentioned simple modifications and equivalent structural changes are equally included in the scope of the patent of the present invention, and are combined with Chen Ming. Compared with the conventional technology, it has the following advantages: (-) Generally used in traditional building automation applications, most of them are planned with near/distal or master/slave devices, and all event management and strain It will be connected to the computer in the main control room through a transmission interface. When there is a situation, the personnel in the main control room or the computer will issue commands to the external wheel 15 to perform some specific actions, for example, if the temperature is too high. When the cooling fan is turned on, the safety is out of phase, the county is brighter, or the temperature exceeds the fire preset temperature. The coffee starts from the water, because these actions are instantaneous and correct when the trigger is required, so if the slave device can be calculated The correct response _, the host or manager will automatically start the phase _ strain at very precise time _, without triggering the relevant device at a premature or late time point, which will help to reduce The probability of disasters and the losses they cause and the evacuation that can help people effectively eliminate the need to use empirical rules or false verification methods as in the case of conventional techniques. Obtain a general response time' and make a wrong time point judgment. (1) Due to the current response time of the Mo dbus slave, the user is often verified according to the rule of thumb or error (tria 1 and ei* rq) Experience or embarrassment to decide, the less stringent verification method of age b is easy to cause the response time obtained is not accurate and if it is not suitable for the arbitrarily, it may cause the secret to be unable to run. Therefore, the industrial production line (such as : fabs, plastics factories, etc., if the correct rectification space required by the slave device cannot be accurately obtained, the master station device cannot deliver the correct command at the correct time, or the slave device cannot be correct. At the time of the execution of the command of the master station, it is possible to completely smash the production line or cause an abnormal phenomenon, and cause mechanical defects or even damage on the industrial production line, so by calculating the precise response time (RSf) of the master/slave end. It is also used in the official communication period between devices. The master will be able to accurately determine the time point of the trigger event and avoid the confusion of the event trigger time. (iii) The present invention can utilize function functions of different functions: if the maximum, minimum or average slave response time is obtained, or further combined with a delay time, the user can make precise settings for a specific industrial or technical field. There is no need to use a rule of thumb or error verification as a conventional technique to achieve a general response time. (d) Due to the evolution of the generations, d0 dbus has gradually become the communication standard in the industrial field, and the singularity in accordance with the M 〇dbus architecture has become a universal connection to the various electronic industry Μ anus, so the I slave communication by the present invention The method of detecting the response time under the agreement will not require the addition of physical devices or components, and the lightness and wideness of the _Q dbus architecture. The present invention only needs to pass the mosquito or silk to complete the accurate response time acquisition. The cost of the implementation of the slave device will not be affected by the direct use of the command of the M〇db us standard specification. Therefore, the command used will not affect the normal operation of the slave device. In addition, whether it is the G db 1^ master station device or the Mo db U 3 gateway, the response time from the 1376117 station will be calculated by the software. The user will not need to manually set the time from the Lange, avoiding sighs. It is not appropriate to take care of the secret operation problems caused by the time, and affect the customer's confidence in the product and return it. The above disclosure is only a preferred embodiment of the present invention, and it is not possible to use the invention as a specialization. Therefore, the average amount of money made by the patent scope of the present invention is reduced. Within the scope of the patent covered by this release. The method of detecting the response time under the master-slave communication protocol of the present invention is indeed effective in terms of its efficacy and purpose, so the present invention is an invention that is excellent in practicality. The requirements are in line with the industry's Xiang nature, new nature and progressive ''application according to law, and hope to grant this case as soon as possible to protect the inventor's hard work of inventing'. If there is any ship in the bureau, please do not hesitate to instruct or invent People will try their best to cooperate and feel polite.

18 1376117 【圖式簡單說明】 第一圖係為本發明較佳實施例之Mo d b u s RTV/ A S CI I通訊架構示意圖。 第二11係為本發明較佳實施例之Μ o d b u s R τ υκ A S CI I通訊示意圖β18 1376117 BRIEF DESCRIPTION OF THE DRAWINGS The first figure is a schematic diagram of a communication architecture of Mo d b u s RTV/ A S CI I according to a preferred embodiment of the present invention. The second 11 is a preferred embodiment of the present invention Μ o d b u s R τ υ κ A S CI I communication diagram β

第三圖係為本發明較佳實施例之Mo d b u s RTU/ A S C I I測試流程圖。 第四 係為]VI o d u s 圖。 R 丁 U標準規範封包格式示意The third figure is a flow chart of the Mo d b u s RTU/ A S C I I test of the preferred embodiment of the present invention. The quaternary system is a VI o d u s diagram. R D U standard specification packet format

第四A圖係為M〇db A 示意圖。 ASCI1鮮職封包格式 第五圖係為本發明利用谓測從站之回應時間應用於Μ 〇dbUs主站裝置之示意圖。The fourth A picture is a schematic diagram of M〇db A. The ASCI1 fresh job package format The fifth picture is a schematic diagram of the present invention using the response time of the slave station to be applied to the 〇 dbUs master station device.

第六圖係為係為本發明利用侦測從站之回應時間應用於Μ 〇dbUS通觸道之示意圖。 【主要元 件符 1、主站裝置 2、從站裝置 4、 3、遠端裝置 成說明 通訊閘道 19The sixth figure is a schematic diagram of the present invention using the response time of the detecting slave to be applied to the 〇 dbUS passway. [Main component 1, master station device 2, slave device 4, 3, remote device, description, communication gateway 19

Claims (1)

13761171376117 十、申請專利範圍·· 1、一種主從端通訊協定下_回應時間之方法,尤指計曾符八 ==_定架構下之從站裝置__戶後 、 U S要求所需要時間之方法,職Q db U Sit .訊協定频Whs RTU及 M〇dbus Asc^ I其中之一,其方法包括: _裝置於同-個時間點發送一M〇 d b u s要 ,亚紀錄該發送時間;及 衣直 =^接收__發送之d b u s要求,並 產生回應’此回應包括有正確結果_及例外回應 偵測裝置接收到從站裝置之回應,並記錄 應之接收時間;及 谈罝所接收到回 ^二站裝置根樹貞測裝置之M 〇 d b u s要求所需之回應時 置於接收預設個-d , u s要求後所得之精確回 2、=ΓΖ圍第1項所述之主從端通訊協定下谓測回應時間 法’其中該回應時間即為Mo d b u 3標準規格 resP〇nse time-out。 3如申4專利細料項所述之主從端通訊協 之方法,其中該計算精確回應時間之 1 回應時間 ,間之购得 20 [j-a ij, 2 3 如申叫專利圍第2項所述之主從端通訊協定下谓測回應. =方法’其中求得計算精確回應時間之計算方法可加上—延遲 時間,或作其他運算。 5、如申請專利範圍第丄項所述之主從端通訊協定下偵測回應時間 之方法’其中計算該回應時間之方程式可為: R Sm = TRm-T Sm "中該RSm為回應時間’ TRm為細懷置接收到從站 =應的時_ ’ TSm為偵測裝置發送要求至從站裝置之時間 6利範圍第2項所述之主從端通訊協定下偵測回應時間 …其中該求得精確回應時間之平均時間之方程式;為: /Ul J]rsm :M=\ Sf n (RSi ’ RS2,...,rsn+1) ,(#+1) 盆中]7 n f N =S1,..為nRSF為從站裝置之精確回應時間, ,RSn+1為期間之回應時間。 7、如申物_第2項所述之主從物表下 之方法’其中該求得精確回應時間最大值之方程式可為了時間 仏…(RSi,RS2’...,RSn+i) ”、、. ,AX (RSl,RS2,.. JL 中 P ^ ^ N + 1 ) 八 n ()為―函數’ RSf為從喊置之籍禮m RSl,·..,RS置之精確回應時間’ 為期間之回應時間。 21 1376117X. The scope of application for patents··1. A method of _response time under the master-slave communication protocol, especially the method of calculating the time required by the station device under the ____ , Q Q db U Sit. One of the agreed frequency Whs RTU and M〇dbus Asc^ I, the method includes: _ device sends a M〇dbus at the same time point, sub-record the sending time; Straight = ^ Receive __ sent dbus request, and generate a response 'This response includes the correct result _ and the exception response detection device receives the response from the slave device, and records the receiving time; and the reception received back ^ The two-station device root tree detection device M 〇dbus requires the required response to be received after receiving the preset -d, us request, the exact return 2, = the primary and secondary communication protocol described in item 1. The next test response time method 'where the response time is the Mo dbu 3 standard specification resP〇nse time-out. 3 The method of the master-slave communication protocol as described in the patent application of claim 4, wherein the calculation accurately responds to the response time of 1 time, and the purchase between the two is 20 [ja ij, 2 3 In the master-slave communication protocol, the response is measured. = Method 'The calculation method for calculating the exact response time can be added - delay time, or other operations. 5. The method for detecting the response time under the master-slave communication protocol as described in the scope of the patent application, wherein the equation for calculating the response time may be: R Sm = TRm-T Sm " the RSm is the response time 'TRm is the time to receive the slave = when it is _ ' TSm is the time for the detection device to send the request to the slave device 6 Scope of the range of the primary and secondary communication protocol detection response time described in item 2... The equation for obtaining the average time of the exact response time is: /Ul J]rsm :M=\ Sf n (RSi ' RS2,...,rsn+1) ,(#+1) in the basin]7 nf N =S1,.. is the exact response time of the slave device for nRSF, and RSn+1 is the response time for the period. 7. For example, the method under the master-slave object described in the object _ item 2, wherein the equation for obtaining the maximum value of the exact response time can be used for time 仏... (RSi, RS2'..., RSn+i) ” , , . , AX (RSl, RS2,.. JL P ^ ^ N + 1 ) Eight n () is the "function" RSf is the exact response time from the call of the nickname m RSl, ·.., RS ' Response time for the period. 21 1376117 年 Θ 月 24 ; 申請修正日 8、 如申請專利範圍第1項所述之主從端通訊協定下偵測回應時間 之方法,其中若4站裝置若不支援主站裝置之M 0 d u s要 求’該從站裝置可進一步發送例外回應。 9、 如申請專利範圍第1項所述之主從端通訊協定下偵測回應時間 之方法,其中該偵測裝置所發出2M〇dbus要求可為返回 询問數據(功能碼〇x〇8,次功能碼〇χ〇〇)、讀取線圈 (功能碼0x01)、言賣取離散量輸人(功能碼〇又〇2) 、讀取多個暫存器(功能碼0χ03)或讀取輸入暫存器(功 能碼〇Χ〇4)之指令。 10、如申清專利範圍第i項所述之主從端通訊協定下债測回應時 間之方法,其中該精確回應時間可進一步套用於主/從站裝 置之正式通訊時期。 11如申租專利範圍第(項所述之主從端通訊協定下债測回應時 間之方法’其中該精確回應時間可進-步套用於主/從站裝 置及遠端裝置三者間之正式通訊時期。 12如申μ專利聋1圍第1項所述之主從端通訊協定下偵測回應時 間之方法’其中該偵測裝置可為M Q d b U S主站裝置、 M 〇 d b u s通訊閘道或具細功能之獨立設備。 門^專利知圍第1項所述之主從端通訊協定下偵測回應時 門之方法’其中該正確結果回應包括有功能碼及回覆資料。 申明專利酬第1項所述之主從端通訊龄"R貞測回麟 22 1376117 修正本 S9.1Z2 3 間之方法,其中該例外回應包括有例外功能碼及例外碼。Year Θ Month 24; Application for Amendment Date 8. Method for detecting response time under the master-slave communication protocol as described in item 1 of the patent application scope, if the 4-station device does not support the M 0 dus request of the master station device' The slave device can further send an exception response. 9. The method for detecting response time under the master-slave communication protocol described in claim 1 of the patent scope, wherein the 2M 〇dbus request sent by the detecting device is a return inquiry data (function code 〇x〇8, Secondary function code 〇χ〇〇), read coil (function code 0x01), sell and sell discrete input (function code 〇 〇 2), read multiple registers (function code 0χ03) or read input The instruction of the scratchpad (function code 〇Χ〇 4). 10. The method of claiming the response time under the master-slave communication protocol as described in item i of the patent scope, wherein the precise response time can be further applied to the official communication period of the master/slave device. 11 For example, the scope of the patent application scope (the method of the debt response time under the master-slave communication protocol described in the item), wherein the precise response time can be used for the formalization between the master/slave device and the remote device. The communication period. 12 The method for detecting the response time under the master-slave communication protocol as described in the first item of the application of the invention, wherein the detection device can be the MQ db US master device, the M 〇dbus communication gateway. Or a separate device with fine functions. The method of detecting the response time gate under the master-slave communication protocol described in Item 1 of the patent is as follows: The correct result response includes the function code and the reply data. The primary and secondary communication ages described in 1 item "R贞回回麟22 1376117 The method of correcting this S9.1Z2 3, wherein the exception response includes an exception function code and an exception code. 23 L37611723 L376117 X Η—、圖式: 24 fX Η—, pattern: 24 f MODBUSWS潲麵 MODBUSsemB 1376117MODBUSWS MODBUSsemB 1376117 13761.1713761.17 1376117 s Η1376117 s Η 1位元組 (lbyte) 從站位址 Slave address 1位元組i (lbyte) 功能碼 Function code S g .0窃 es 資料 Data 2位元組 Gbytes) 環狀檢查和 CRC 13761.17 嘁SAa 1字元 (lchar) 起始字元 Start char 2字元 (2chars) 從站位址 Slave address 2字元 (2chars) 功能碼 Function code 0-504字元 (0 up to 504 chars) 資料 Data 2字元 (2chars) 線性檢查和 LRC 2字元 (2chars) 結尾 End 1376117 被is L 厂1 byte (lbyte) Slave address Slave address 1 byte i (lbyte) Function code Function code S g .0 stealing data Data 2 byte Gbytes) Ring check and CRC 13761.17 嘁SAa 1 character (lchar) Start character Start char 2 characters (2chars) Slave address Slave address 2 characters (2chars) Function code Function code 0-504 characters (0 up to 504 chars) Data 2 characters (2chars) ) Linear check and LRC 2 characters (2chars) End End 1376117 is is L factory MODBUSh+s潲 Η MODBUS裔辞潲麵 L J J 1376117MODBUSh+s潲 Η MODBUS 潲 L L J J 1376117 遠端裝置 MODBUS通訊閘道 MODBUS從站裝置Remote device MODBUS communication gateway MODBUS slave device
TW96100367A 2007-01-04 2007-01-04 Method to detect the response time-out of client-server protocol TW200830775A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW96100367A TW200830775A (en) 2007-01-04 2007-01-04 Method to detect the response time-out of client-server protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW96100367A TW200830775A (en) 2007-01-04 2007-01-04 Method to detect the response time-out of client-server protocol

Publications (2)

Publication Number Publication Date
TW200830775A TW200830775A (en) 2008-07-16
TWI376117B true TWI376117B (en) 2012-11-01

Family

ID=44818378

Family Applications (1)

Application Number Title Priority Date Filing Date
TW96100367A TW200830775A (en) 2007-01-04 2007-01-04 Method to detect the response time-out of client-server protocol

Country Status (1)

Country Link
TW (1) TW200830775A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI492576B (en) * 2013-03-11 2015-07-11 Realtek Semiconductor Corp Master-slave detection method and master-slave detection circuit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI492576B (en) * 2013-03-11 2015-07-11 Realtek Semiconductor Corp Master-slave detection method and master-slave detection circuit
US9569387B2 (en) 2013-03-11 2017-02-14 Realtek Semiconductor Corp. Master-slave detection method and master-slave detection circuit

Also Published As

Publication number Publication date
TW200830775A (en) 2008-07-16

Similar Documents

Publication Publication Date Title
JP2006174423A5 (en)
JP2009520276A5 (en)
JP2019501551A5 (en) Cloud-based system and method for managing messages related to operation of cable test devices and computing devices
CN109699004A (en) Bluetooth key localization method, device, bluetooth equipment and storage medium
JP2007214654A5 (en)
US7234084B2 (en) System and method for associating a DLPDU received by an interface chip with a data measurement made by an external circuit
CN109040051A (en) A kind of BMC login method, system, equipment and computer readable storage medium
CN104270372A (en) Parameter self-adaption network security posture quantitative evaluation method
CN107835221A (en) Water leakage monitoring method and Internet of things system based on compound Internet of Things
TWI376117B (en)
JP2015033038A5 (en)
US6016558A (en) Communication event/message tracing method for RPC-based distribution processing program
CN110322578A (en) A kind of Work attendance method and device
US11080107B2 (en) Event notification method, server device, event notification apparatus, and medium
CN108092921A (en) Data exchange system and method
CN107862836A (en) Fuel gas leakage detection method and Internet of things system based on compound Internet of Things
EA009690B1 (en) Carrier data safety protection method and recording system device of pre-payment electric energy meter
JP2002340664A (en) Electronic balance
CN207782829U (en) The diagnostic device of PROFIBUS-DP communication networks
CN107347074B (en) A kind of method of determining network equipment safety
CN106059090A (en) Prompt system based on scheduling automation system and work method thereof
CN111382062A (en) Joint debugging test method and device for house property transaction system and external mechanism business system
JP2018092232A (en) Compound type measurement system
TWI323114B (en)
JP3539941B2 (en) Measurement system