摘 要:設計了基于虛擬儀器的鎖相放大器遠程實驗的軟件系統,用LabVIEW軟件編寫了客戶機與實驗機程序,實現了串口與單片機系統的通信、聲卡采集信號、TCP/IP網絡通信等功能。用Linux中的IPtables防火墻技術實現實驗機與服務器間的端口映射,使得互聯網上的所有用戶可以通過服務器訪問實驗機,進行遠程實驗。
關鍵詞:虛擬儀器; 鎖相放大器; 遠程實驗; 端口映射
中圖分類號:TN911.23; TP337 文獻標識碼:A
文章編號:1004-373X(2010)14-0148-04
Design of Lock-in-Amplifier Remote Experiment System Based on Virtual Instrument
DAI Zhi-chao1, XIANG YING1, WU Xian-qiu2
(1.Guangdong Polytechnic Normal University, Guangzhou 510665, China;
2 South China Normal University, Guangzhou 510631, China)
Abstract: The lock-in-amplifier (LIA) remote experiment system based on the virtual instrument was designed. The programs for the client computers and the experiment computer were written with virtual instrument software LabVIEW. And various functions were realized, including communication with the signal chip microcomputer (SCM) through the serial port, real-time acquisition of the voltage by the LIA via the sound card and Internet communication by using TCP/IP technology. The port mapping between the experiment computer and the server was realized with Iptables Netfilter technology in Linux system. So all the users in Internet can accomplish the remote experiment via visiting the experiment computer through server.
Keywords:virtual instrument; lock-in-amplifier; remote experiment; port mapping
0 引 言
20世紀80年代末美國成功研制了虛擬儀器,虛擬儀器的發展標志著自動測試與電子測量儀器領域技術發展的一個嶄新方向[1]。虛擬儀器是利用PC機的顯示模擬傳統儀器的控制面板,以多種形式表達輸出檢測結果,由PC機的強大軟件功能實現信號數據的運算、分析、處理,由I/O接口設備完成信號的采集、測量與調理,從而完成各種測試功能的一種計算機儀器系統[2]。
基于互聯網的遠程實驗是遠程教育的一個新的發展方向。遠程實驗從遠程計算機上進行實驗操作和觀察,所得到的實驗結果與本地得到的完全相同,如同在實驗室真實操作實驗設備一樣,突破了時空限制,極大地提高了實驗教育的靈活性。將虛擬儀器技術和網絡技術相結合,實現網絡化虛擬儀器,并結合電路其他元件的遠程控制,可實現基于虛擬儀器的遠程實驗[3]。
1 LabVIEW簡介
LabVIEW(laboratory virtual instrument engineering workbench)是美國NI公司推出的一種基于G語言(graphics language)的虛擬儀器軟件開發工具,具有各種功能強大的函數庫,包括數據采集、網絡通信、串口控制、數據顯示及數據存儲等[4]。……