GPIB-RS232控制器設(shè)計(jì)與實(shí)現(xiàn)
發(fā)布時(shí)間:2018-01-11 19:43
本文關(guān)鍵詞:GPIB-RS232控制器設(shè)計(jì)與實(shí)現(xiàn) 出處:《武漢理工大學(xué)》2014年碩士論文 論文類(lèi)型:學(xué)位論文
更多相關(guān)文章: GPIB總線 GPIB協(xié)議 NAT9914 SCPI
【摘要】:目前,國(guó)內(nèi)的儀器大多帶有RS232接口,這就使得只有一臺(tái)儀器能與計(jì)算機(jī)相連,不利于將多臺(tái)儀器通過(guò)GPIB總線進(jìn)行擴(kuò)展連接。針對(duì)這一問(wèn)題,通常是在現(xiàn)有儀器的基礎(chǔ)上,進(jìn)行硬件添加或者軟件輔助來(lái)實(shí)現(xiàn)GPIB協(xié)議轉(zhuǎn)換;诖耍疚牟捎每删幊虒S媒涌谛酒⑴浜宪浖刂瞥绦,設(shè)計(jì)并實(shí)現(xiàn)了GPIB-RS232控制器。 首先,在硬件上,GPIB-RS232控制器主要分為三個(gè)部分:控制電路、RS232接口端以及最重要的GPIB接口端。為確保目標(biāo)板線路連接可靠,在確認(rèn)STM32F單片機(jī)最小系統(tǒng)正常工作的前提下,還需要注意NAT9914芯片的數(shù)據(jù)線、中斷線以及DMA功能線的連接,以方便后續(xù)軟件設(shè)計(jì)中對(duì)接口專用芯片內(nèi)部寄存器的操作以及接口功能的開(kāi)發(fā)。 其次,在軟件上,,也是主要分為三個(gè)部分:RS232接口通信、GPIB總線協(xié)議實(shí)現(xiàn)以及SCPI指令封裝、解析,其中后面兩者是本文設(shè)計(jì)的重難點(diǎn)。 第一,在GPIB總線協(xié)議實(shí)現(xiàn)部分,本文在傳統(tǒng)查詢法的基礎(chǔ)上進(jìn)行改進(jìn)創(chuàng)新,在完成NAT9914初始化之后,采用中斷方式來(lái)實(shí)現(xiàn)GPIB六種接口功能,即,T/SH功能、L/AH功能、SR功能、PP功能,從而完成GPIB系統(tǒng)中主從機(jī)之間的基本收發(fā)操作、服務(wù)請(qǐng)求與響應(yīng)。 第二,在SCPI指令封裝、解析部分,本文結(jié)合具體儀器功能,建立SCPI通用指令和部分特定控制指令的指令二叉樹(shù),并采用鏈?zhǔn)浇Y(jié)構(gòu)存儲(chǔ);然后,采用自頂向下的方式來(lái)遍歷指令樹(shù),完成對(duì)接收到的程控消息的匹配查詢。 最后,為了檢測(cè)開(kāi)發(fā)的接口功能和SCPI指令解析是否可行,本文結(jié)合公司的數(shù)字光衰DOA,組建一個(gè)簡(jiǎn)單的測(cè)試系統(tǒng),并采用兩種方式進(jìn)行測(cè)試:①基于Agilent Connection Expert軟件環(huán)境,在其IO交互界面發(fā)送SCPI指令,完成對(duì)儀器的操控;②在Visual Studio2010軟件平臺(tái)下調(diào)用VISA函數(shù)編寫(xiě)C語(yǔ)言測(cè)試程序,來(lái)控制儀器工作。 上述測(cè)試方法得到的結(jié)果表明,本文設(shè)計(jì)的GPIB-RS232控制器能可靠穩(wěn)定地完成數(shù)據(jù)傳輸、及時(shí)響應(yīng)設(shè)備服務(wù)要求,并且通過(guò)SCPI指令解析后,儀器能按照指令要求完成相應(yīng)操作。
[Abstract]:At present , most domestic instruments have RS232 interface , which makes only one instrument can be connected to the computer , which is not beneficial to the extension connection of multiple instruments through the interface . In order to ensure the reliable connection of the target board , we also need to pay attention to the connection between the data line , the interrupt wire and the DMA function line of NAT9914 chip , so as to facilitate the operation of the internal register of the interface special chip and the development of the interface function in the subsequent software design . Secondly , on the software , it is mainly divided into three parts : RS232 interface communication , bus protocol implementation and SCPI instruction encapsulation , analysis , the latter two are the key difficulties in this paper . First , on the basis of the traditional inquiry method , this paper carries out the improvement and innovation on the basis of the traditional inquiry method . After the initialization of NAT9914 , the functions of the six kinds of interface functions , i.e . , the T / SH function , the L / AH function , the SR function and the PP function , are realized by the interrupt mode , so that the basic transmitting - receiving operation , the service request and the response between the master and slave machines in the gI system are completed . secondly , an instruction binary tree of SCPI general instruction and part of a specific control instruction is established in the SCPI instruction package and the analysis part , and a chain type structure storage is adopted ; and then , a self - top down mode is adopted to traverse the instruction tree to finish matching query on the received program control message . Finally , in order to detect whether the interface function and SCPI instruction parse are feasible , this paper combines the digital light attenuation DOA of the company to form a simple test system , and the test is carried out in two ways : ( 1 ) based on the Agilent Connection Expert software environment , sending the SCPI instruction in the IO interactive interface , completing the manipulation of the instrument ; and 2 ) calling the Visa function under the Visual Studio 2010 software platform to write the C language test program to control the operation of the instrument . The results of the above test method show that the interface designed by this paper can reliably and stably complete the data transmission , respond to the equipment service requirement in time , and the instrument can complete the corresponding operation according to the instruction requirement after the SCPI instruction is resolved .
【學(xué)位授予單位】:武漢理工大學(xué)
【學(xué)位級(jí)別】:碩士
【學(xué)位授予年份】:2014
【分類(lèi)號(hào)】:TP332
【參考文獻(xiàn)】
相關(guān)期刊論文 前10條
1 季曉亮;譚業(yè)雙;;測(cè)試總線的發(fā)展及性能比較[J];電測(cè)與儀表;2006年04期
2 陳冠玲;;基于GPIB接口的功率測(cè)試系統(tǒng)開(kāi)發(fā)與設(shè)計(jì)[J];電測(cè)與儀表;2008年09期
3 周琴;;GPIB總線及應(yīng)用技術(shù)[J];低壓電器;2008年01期
4 黃君凱;吳延軍;;RS232-GPIB控制器的設(shè)計(jì)[J];電子技術(shù)應(yīng)用;2006年03期
5 黃崧,儲(chǔ)飛黃;GPIB總線及接口設(shè)計(jì)[J];國(guó)外電子測(cè)量技術(shù);2004年S1期
6 聶軍培;;單片機(jī)的GPIB接口電路設(shè)計(jì)[J];信息通信;2012年02期
7 袁海英,陳光
本文編號(hào):1410970
本文鏈接:http://sikaile.net/kejilunwen/jisuanjikexuelunwen/1410970.html
最近更新
教材專著