丄344601 九、發明說明: 【發明所屬之技術領域】 本發明係有關一種主從式擴充板系統及其操作方法, 尤才日一種可以輪詢方式傳遞命令之主從式擴充板系統及其 操作方法。 一 【先前技術】丄344601 IX. Description of the Invention: [Technical Field] The present invention relates to a master-slave expansion board system and an operation method thereof, and a master-slave expansion board system capable of transmitting commands in a polling manner and its operation method. [Prior Art]
舀知之主從式擴充板系統係藉由線路相連接的數位輸 入輸出點(DI/0點),來達成彼此之間的訊號傳遞。例如一 種習知之主從式擴充板系統係將所有Dl/Ο點集中在一個電 路板上,然而這樣會造成配線紊亂問題。再者, 式貫施之主從式擴充板系統,DI/〇的點數早在產品設計時 就決定,對於所有下游使用者實際需求而言,不 此Γ成本之虞;就是有DI/0點數不足、不敷使 列傳輸做觸的輸“㈣,且其通财式採 = =工傳輸模式,此種方式在通訊傳輸時二: 遲上,勢必增加訊號不即時性的機率。 因此若能改進前述習知技術之缺失,則 之主板提供更有彈性及更有效率的遠端數位輪入二^ (DI/0點)連接。 询八輸出點 【發明内容】 因此本發明之目的即在於提供 輪詢方式傳遞 ” π促択—種 命令之主從式擴充板系統及其操作方法。 為達成上述目的,本發明提供 裡王攸式擴充板系統 6 1344601 ,其操作方法,該线式擴純具有— ==連接。該主板先發送具有-站號ί = 二只有Γ該站號資料之擴充板才會回應- ::二 息包含一起始封包、多數資料封 檢查封包。若該起始封包正確,則主板才會 =1—°ρ令至下—擴充板,否則持續接收封包,並判斷 :::正確起始封包,或判斷接收訊號是否為已經停止並 段時間,錢再發送下—命令。若回覆訊息之 h查封包不正確’社板將對應之訊息封包丢棄。藉 此輪詢之命令機制及站號資料的設置,該主板可用更有^ 广擴充板之數位輸入輸出點— 參見第-圖,為依據本發明之一較佳具體實例之主從 式擴充板系統示意圖,該主從式擴充板系統主要包含一主 板(MaSterCard)10及多數之擴充板(slaveCard靡、應 及20C,且主板1〇及多數之擴充板2〇Α、2〇β及2〇c係透 過一對連接線40, 42而達成串接。在此具體實例中,多數 之擴充板20A、20B及20C包含第-擴充板遍、第二擴 充板20B及第二擴充板20C三個擴充板,但須知本發明之 主從式擴充板系統可以在不同數目的擴充板上實施,而不 影響其專利範圍。 前述之連接線40,42包含用於傳送主板1〇命令之一 Τχ 連接線40及一傳送第一擴充板2〇α、第二擴充板2〇β及第 三擴充板20C回覆訊息之RX連接線42。該主板1〇主要包含 7 1344601 -近端處理器(脆ster process〇r)i2及與近端處理器以電連 •接之近端數位輸入輸出點14;而該擴充板,例如第—擴充 -板20A’包含-第-遠端處理器(f im sl· ρ··)22Α 及與第达知處理益22A電連接之第一遠端數位輸入輸出 點24A及與第一遠端處理器22A電連接之一第一站號開關 (first station number switch)26A。同樣的,第二擴充板 20B包含一第二遠端處理器22B及與第二遠端處理器22B 鲁電連接之苐一达端數位輸入輸出點24B及與第二遠端處理 器22B電連接之一第二站號開關26B ;第三擴充板2〇c包 含一第三遠端處理器22C及與第三遠端處理器電連接 — 之第三遠端數位輸入輸出點24C及與第三遠端處理器22(: 電連接之一第三站號開關26C。在上述的主從式擴充板系 統中’該站號開關26A-26C例如可以為指撥開.關(dp μ switch) ’以設定每一擴充板之站號資料。該近端處理哭l2 及該些遠端處理器22A-22C例如可以為可程式邏輯處理号 • (programmable logic device PLD)其具有硬體快速處理及軟 體維護容易的優點。 在上述的主從式擴充板系統中’該主板1〇可以藉由k 連接線40,而以輪詢(pooling)的方式傳送命令至第一把充 板20A、第二擴充板20B及第三擴充板20C ;並且藉由以 連接線42而得到第一擴充板20A、第二擴充板2〇B ^第^ 擴充板20C回覆Λ息,錯此控制运端之數位輪入约出點 (DI/0點)°再者第一擴充板20Α、第二擴充板2⑽及第 三擴充板20C可以藉由各自的站號開關26Α、26Β及26c 8 1344601 =在串接線路中的站號。主板10所發送的命令中帶有 因此可以讓擴充板知道是否所接收之命令是針 對本身的命令。 2第:圖,為依據本發明之主從式擴充板系統封包 輪為方式不思圖;主板10所發送的命令含有多數封包 (packet) ’由主板1〇所下達的一 s 值、告w 〃 通矾命令藉由Tx連接線40 ==各個擴充板2G纖。各擴充板接收該通訊命 Γί主=是否為自己所應接收之命令,並決定是否回 到Γ=Γ某一擴充板所回應的回覆封包時,例如 的回覆封包時,即先判斷是否可知道 ;二號-貝訊。如果該主板10能由回覆封包得知站號資 板Γ繼續接收剩餘封包訊息外,並啟動輪詢下 擴充板(亦即第二擴充板2⑽)的施 、_ 的輪詢時間,增加傳輸效率。 1 ’以縮短系統整體 式,及第三_,分別為主板之命令封包格 气及擴充板回覆訊息封包格式。 通訊命令主要包含一耜弘矛主板之 -個CRC於::L 、四個資料封包52A-52D及 要!封包54β參見第,擴充板回覆訊息主 要〇 3 起始封包60 '四個資料封~ β9Λ 查封包64。 1固貝枓封包62A-62D及一個CRC檢 資㈣i至第_ C ’分別為說明起始封包50、 圖:所_ ㉟查封包54之封包格式的示意圖。如第四 含=::::r_T 傳⑽ 口 <兀500,一個結束位元5〇8,八個 9 ^44601 資料位元分別被定義為辨識起頭碼5〇2 (3個位元),I、 邊瑪5〇4 ( ^個位元)’站號資料506 ( 3個位元)。如 斤示玄二貝料封包具有一個起始位元520 ,一個 元 , Λ 7m 一丄一 .· 保 第四圖 一 Λ « /ΓΤ判巴丹,一個起始位元520 ,一 ,D束1元524 ’八個訊息資料位元522。如第四圖匸所 不。玄CRC檢查封包54包含有一個起始位元540,-個結 束位元544 ,及CR「咨- r , Λ KL貝枓位兀542 ( 8個位元)。再者, 該擴充板回應之回霜封&女士 设封包亦有類似的資料結構,在此不在 贅述。如同上述圖形所 板的命令資料封包與擴充板 ===皆為等長度資料封包,因此可以簡化處 來 貝;;輸上的複雜性,並有助於傳輸時效。 操作;法:五Li::::本發明之主從式擴充板系統 程中,收Μ “起。封包步驟示意圖。#主板10接收過 誤),主极】㈣、期的起始封心夺(例如站號資料錯 包;或_所接直到收到正確— (―)之後=:::持續一段時間 參見第六圖,為說明依虔 操作方法中,處理CRC封主;!式擴充板系統 過程中,收刭n '、w圖。虽主板10在接收 收到不如預期的CRC檢杳 棄對應此CRC檢查封包64$ ^ —匕64夺,主板10將吾 所示,自第一擴幻反謝^ =_2D (亦即如該圖 —站的命令。、 之貝料),然後繼續發送下 >見第七圖,為說明本發明之主從 方法之流程圖,首先主 式、充板糸統操作 先主板發送命令至—擴充板(例如第 ^44601 :擴充板㈣並等待回應(步驟_ 一擴充板20A的回庫县Λ J即曰判斷該第 sno)〆在下士 包含一正確起始封包(步驟 . ^,-'' 起始封包,則主板〗〇發送命令至· =(步_2) ’例如第二擴充板應心=: 二:步驟S114)並賴是否收到正確封包?!: *"㈣正確封包,料行步驟S112 ,否則判駢 所接收之訊號是否已噔佟 臾JH斷 S118)。若是,則、隹: 持續靜默一段時間(步騾 )右疋,則進行步驟sn2 SU4)持續接收封包 和Θ (步驟 收的⑽檢杳封包正不=之後’主板1〇會判斯接 似—訂包正不正確(步驟⑽)。 =將對應的訊息封包去棄(步驟 =, 續輪詢其他擴充板(步驟S]3Q)。 #果正確’則繼 本發明之優點可以綜述如下·· 一、 藉由在擴充板上設定站號資訊,及 接,可以靈活的擴充數位輸出入點數。 接方式連 二、 主板會依序輪詢各擴充板,且主板 訊息内的起始封包正確,即 疋回设 整㈣統的輪詢時間,增加傳輸效率。廣充板,縮短 進步:上::發:=!明已具有產業利用性、新穎性與 用’完全符合發明專利申請 吏 【圖式簡單說q 友依專侃&出申請。 第圖為依據本發明之—較佳具體實例之主從式擴充The master-slave expansion board system realizes the signal transmission between each other through the digital input and output points (DI/0 points) connected by the line. For example, a conventional master-slave expansion board system concentrates all D1/defects on one circuit board, but this causes wiring disorder problems. In addition, the master-slave expansion board system, DI / 〇 points are determined as early as the product design, for the actual needs of all downstream users, not the cost; that is, there is DI / 0 Insufficient points, insufficient input to make the column transmission touch ("four), and its financial mode = = industrial transmission mode, this way in the transmission of communication two: late, is bound to increase the probability of the signal is not immediacy. If the above-mentioned lack of the prior art can be improved, the motherboard provides a more flexible and more efficient remote digital round-in (DI/0 point) connection. Inquiring eight output points [invention] Therefore, the object of the present invention That is, it provides a master-slave expansion board system and its operation method that provides a polling method to transmit "π". In order to achieve the above object, the present invention provides a system for operating a king-size expansion board system 6 1344601, which has a -== connection. The motherboard will first send an extension board with the - station number ί = two only the station number data - :: the binary contains a start packet, most data seal check packets. If the starting packet is correct, the motherboard will be =1-° ρ to the next-expansion board, otherwise the packet will continue to be received, and judge::: the packet is correctly started, or whether the received signal is stopped for a while, Money is sent again - command. If the reply message is checked, the packet is not correct. The community board will discard the corresponding message packet. By means of the polling command mechanism and the setting of the station number data, the main board can be used with a digital input/output point of a wider expansion board - see the figure - as a master-slave expansion board according to a preferred embodiment of the present invention. System schematic diagram, the master-slave expansion board system mainly includes a main board (MaSterCard) 10 and a majority of expansion boards (slaveCard靡, should be 20C, and the main board 1〇 and most of the expansion boards 2〇Α, 2〇β and 2〇 c is a series connection through a pair of connecting lines 40, 42. In this specific example, most of the expansion boards 20A, 20B and 20C comprise a first expansion board, a second expansion board 20B and a second expansion board 20C. Expansion board, but it should be understood that the master-slave expansion board system of the present invention can be implemented on different numbers of expansion boards without affecting the scope of the patent. The aforementioned connection lines 40, 42 include one for transmitting the motherboard 1 command. The line 40 and the RX connection line 42 for transmitting the first expansion board 2〇α, the second expansion board 2〇β and the third expansion board 20C replying to the message. The main board 1〇 mainly includes 7 1344601 - the near-end processor (brittle ster Process〇r)i2 and power with the near-end processor • The near-end digital input/output point 14; and the expansion board, for example, the first-expansion-board 20A' includes a -first-distal processor (f im sl· ρ··) 22Α and with the Dactical processing benefit 22A The first remote digit input/output point 24A electrically connected and the first station number switch 26A electrically connected to the first remote processor 22A. Similarly, the second expansion board 20B includes a second The remote processor 22B and the first digit input/output point 24B electrically connected to the second remote processor 22B and the second station number switch 26B electrically connected to the second remote processor 22B; The board 2C includes a third remote processor 22C and is electrically connected to the third remote processor - a third remote digital input/output point 24C and a third remote processor 22 (: one of the electrical connections) The three-station switch 26C. In the above-described master-slave expansion board system, the station number switches 26A-26C can be, for example, "dp μ switch" to set the station number data of each expansion board. The near-end processing cry l2 and the remote processors 22A-22C can be, for example, programmable logic processing numbers • (programmabl e logic device (PLD) has the advantages of fast hardware processing and easy software maintenance. In the above-mentioned master-slave expansion board system, the motherboard 1 can be in a pooling manner by k connecting lines 40. Sending a command to the first charging board 20A, the second expansion board 20B, and the third expansion board 20C; and obtaining the first expansion board 20A and the second expansion board 2〇B ^^ expansion board 20C by connecting the cable 42 Respond to the suffocation, the number of the control terminal is rounded to the exit point (DI/0 point). The first expansion board 20Α, the second expansion board 2(10) and the third expansion board 20C can be switched by the respective station number. 26Α, 26Β and 26c 8 1344601 = station number in the tandem line. The commands sent by the motherboard 10 are provided so that the expansion board can know whether the command received is a command for itself. 2: The figure is a schematic diagram of the master-slave expansion board system packet wheel according to the present invention; the command sent by the motherboard 10 contains a majority of packets 'a s value issued by the motherboard 1 、, 告〃 Through the command Tx cable 40 == each expansion board 2G fiber. Each expansion board receives the communication command ΓMain=whether it is the command that should be received by itself, and decides whether to return to the 回=Γ reply packet responded by an expansion board, for example, when replying to the packet, it is first determined whether it is known ; No. 2 - Beixun. If the motherboard 10 can learn from the reply packet that the station number board continues to receive the remaining packet message, and starts polling the polling time of the expansion board (ie, the second expansion board 2 (10)), increasing the transmission efficiency. . 1 ' to shorten the system as a whole, and the third _, respectively, the command envelope of the main board and the expansion board reply message packet format. The communication command mainly includes a honghong spear motherboard - a CRC at::L, four data packets 52A-52D and want! Packet 54β see the first, the expansion board reply message main 〇 3 start packet 60 'four data seals ~ β9 Λ check the package 64. 1 solid shell packet 62A-62D and a CRC check (4) i to _ C ' are schematic diagrams illustrating the packet format of the start packet 50 and the _35 check packet 54 respectively. For example, the fourth contains =::::r_T (10) port <兀500, an end bit 5〇8, and eight 9^44601 data bits are respectively defined as the identification start code 5〇2 (3 bits) , I, Bianma 5〇4 (^ bits) 'Station number information 506 (3 bits). Such as the Jin Xuan two shell material package has a starting position 520, a yuan, Λ 7m one 丄 one. · Guarantee fourth picture one Λ « / ΓΤ 巴 Badan, a starting position 520, one, D bundle 1 Element 524 'eight message data bits 522. As shown in the fourth picture. The CRC check packet 54 includes a start bit 540, an end bit 544, and a CR "consulting - r, Λ KL 枓 兀 542 (8 bits). Furthermore, the expansion board responds The defrosting seal & Ms. package also has a similar data structure, which is not described here. As with the above-mentioned graphics, the command data package and expansion board === are all equal length data packets, so it can simplify the location; The complexity of the input, and help to transfer the aging. Operation; Method: Five Li:::: In the master-slave expansion board system of the present invention, the collection starts. Schematic diagram of the packet step. #Mainboard 10 received the error), the main pole] (four), the beginning of the period of the seal (such as the station number information wrong package; or _ received until the correct receipt - (-) after =::: for a period of time see the sixth In the process of illustrating the CRC 虔 ; ; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 64$^—匕64, the motherboard 10 will show me, since the first expansion, thank you ^ =_2D (that is, as the figure - the order of the station., the shell material), and then continue to send the next > see the first Figure 7 is a flow chart for explaining the master-slave method of the present invention. First, the main board and the main board are operated to send a command to the expansion board (for example, the ^44601: expansion board (4) and wait for a response (step _ an expansion board) 20A's Huiku County Λ J immediately judges that the sno) 下 corporal contains a correct starting packet (step. ^,-'' starting packet, then the motherboard 〇 〇 send command to · = (step_2) ' For example, the second expansion board should be == 2: Step S114) and depends on whether the correct packet is received?!: *"(4) Correct packet, step S 112, otherwise judge whether the received signal has been JH off S118). If yes, then: continue to silence for a period of time (step) right, then proceed to step sn2 SU4) continue to receive packets and Θ (steps received (10) Checking the packet is not = after 'the motherboard 1〇 will judge the connection - the package is not correct (step (10)). = The corresponding message packet is discarded (step =, continue to poll other expansion boards (step S ] 3Q). #果正确' The advantages of the present invention can be summarized as follows: 1. By setting the station number information on the expansion board, and connecting, the number of digital input and output points can be flexibly expanded. The main board will poll each expansion board in sequence, and the starting packet in the main board message is correct, that is, the polling time of the whole (four) system is set back to increase the transmission efficiency. The wide charging board shortens the progress: upper:: hair:=! Ming has industrial applicability, novelty and the use of 'completely in line with the invention patent application 吏 图 简单 q q q q 友 友 侃 侃 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。 。