量 測 儀 表 聯 網
組員 : 陳冠宏 陳健儒 沈柏安 吳庭瑜
Web HMI and Integrated Testing System
Outline
Introduction
System
GPIB
Client
Cloud Server
Web API
Introduction
Stay up all night for R&D Testing ?
Routine Testing Tasks ?
 VB,VC++,C# coding ?
LabVIEW --> Powerful, lots of toolkits, need
Authorized License or HASP
Web HMI and Integrated Testing System
Our Solutions
Custom Design UI
Web HMI and Integrated Testing System
Open Source
Pyserial
Apache
Tornado ….
Our Solutions
Embedded Linux
System Concept
System Detail
Instruments w/ GPIB interface
Function Generator
 Tektronix AFG-320
Oscilloscope
 HP 54600B
DUT
 an OP Amp Circuit
Test Plan Setup
GPIB USB Controller
PROLOGIX GPIB-USB Controller
 Operate in GPIB Controller mode via USB port
 Support GPIB protocol
What is GPIB
GPIB : General Purpose Interface Bus
History
 Developed by HP in 1960s --> HP-IB
 IEEE standardized the bus --> ANSI/IEEE-488.1
 Commands and Protocol --> ANSI/IEEE-488.2
 IEEE/IEC revised in 2004 --> IEC-60488-1,-2
 Standard Commands for Programmable
Instruments --> SCPI-1999
GPIB Network
Star network,max 15 devices
Controller * 1,Listener * N, Talker * 1
GPIB Cables
24 lines
 8 Data lines, up to 8M bit/s
 5 Manage lines
 3 Handshake lines
 8 GND and Shield lines
GPIB Handshaking
GPIB/SCPI Commands
Set operation
 Address,On/Off,Mode,Value
Query operation
 Read --> Status,Data
Commands Hierarchy
:MEAS : CURR : AC ? n
Client – Control Flow
Server and Client - TCP/IP Packet
Cloud Server - Backend Data Flow
Cloud Server - Frontend Service
Web API – Single Test
Web API – Loop Testing
Web API – Chart
Conclusion
Reference
http://prologix.biz/gpib-usb-controller.html
https://en.wikipedia.org/wiki/IEEE-488
http://www.keysight.com/
https://webstore.iec.ch/publication/2245
https://en.wikipedia.org/wiki/SCPI
https://docs.python.org/3/tutorial/index.html
http://pythonhosted.org/pyserial/
http://www.w3schools.com/
http://canvasjs.com/javascript-charts/
http://httpd.apache.org/
http://blog.ittraining.com.tw/
Python Programming for Arduino (Pratik Desai)
Raspberry Pi 嵌入式Linux 系統實務 (范振泰)
電子實習與專題製作:感測器應用篇 ( 盧明智 許陳鑑)
Linux完全自學手冊:疑難排解全攻略 (酆士昌)
陳冠宏 Catfish.ep87@nctu.edu.tw
陳健儒 Billyou83462@gmail.com
Appendix - Device Under Test
BW
0.707 -3dB
1.0

量測儀表聯網

Editor's Notes

  • #6 本專題建構了一個以Web技術呈現HMI人機介面的測試系統。在一般的實驗室中若需要作自動化的儀器控制,通常是由PC搭配 LabVIEW 的IDE環境,將多台儀器一起作整合控制,我們的專題則是利用Embedded Linux的Pi 來與儀器溝通,使用python程式來處理資料與雲端連線,而使用者在遠端可利用網路連線到雲端,在瀏覽器畫面上就可remote access儀器的控制,取得實驗的數據。
  • #8 我們的系統概念主要分為三塊,分別為LAB內的儀器控制端Client,雲端Server,以及使用者端的Web Browser服務。Server端跟Client端是以 Rasp.Pi2的小機來實現各種功能
  • #9 系統的三個區域之間的溝通方式,分別為Web端的Http相關技術,Client跟Cloud之間的TCP/IP連線,以及Client與儀器之間的GPIB控制。 這裡我們使用了一個USB轉GPIB的裝置,以及兩台GPIB介面的儀器,分別是波型產生器提供電壓輸入,以及示波器量測輸出電壓
  • #10 待測物是一個放大器電路,我們將以它為標的物,在我們的專案內實現一些量測功能
  • #12 這裡要介紹一個USB COM Port轉GPIB介面的裝置,這個裝置會幫助我們實現與儀器之間的 GPIB Protocol,Pi 透過COM Port通訊,可作為GPIB Controller來直接與儀器對話,傳送和接收字串資料
  • #13 GPIB的起源…IEEE-488.1指定了物理和電氣匯流排,IEEE488.2指定了協議和數據格式,但是都沒有指定儀器的指令。 不同的製造商,甚至不同的型號、相同類型的儀器都需要使用不同的命令集。 SCPI創建了一個標準,可以在所有的製造商和所有型號中通用。 它需要使用的IEEE488.2數據格式,但不必非得是IEEE-488.1匯流排 SCPI於1990與IEEE 488.2協議一起面世。這套標準定義了可用於控制一切儀器的語法,命令結構以及數據格式。 比如,通用的命令,如配置儀器參數的命令CONFigure,測量命令MEASure等。這些命令可用於任一儀器,並且同一類的命令屬於同一子系統里。 SCPI同時也定義了若干儀器的種類。比如,任何可控制的電源都會實現DCPSUPPLY基本功能類型。儀器的類別規定了它們會去實現什麼樣的子系統,當然也包括針對儀器的特定功能。 需要注意的是,SCPI並未定義物理層的傳輸信道的實現方法。雖然它最開始是和IEEE 488.2(即GPIB)面世的,但SCPI控制命令也可用於串口(RS-232),乙太網,USB接口,VXIbus等若干硬體匯流排。
  • #14 Controller,Listener,Talker的作用與角色交換
  • #16 A byte cannot transfer in less than the time it takes for the following events to occur: 1. NRFD propagates to the Talker, all say READY 2. DAV signal propagates to all Listeners, (Not) ready for DATA , enable a Byte capture 3. Listeners accept the byte and assert NDAC, (Not) Data Accept 4. NDAC propagates back to the Talker 5. Talker allows time for settling (Byte 2) , and then assert DAV again
  • #18 在client端,先辨識是否為Server封包,再辨識Job的種類,然後將Command翻譯成GPIB端的對應控制命令。 等儀器回傳資料之後,跟該批次的key一起組成封包,回傳給Server
  • #19 Server ID跟Client ID有Mask的作用 , 而Job則是Operation-mode , Key則是用來區別各批次的命令以及該批命令的回傳值
  • #20 先解析JOB operation,若無新量測需求,則會直接以現存資料回應 json封包,若有新需求,則產生一個key當作serial number,跟command一起傳送給client端。 當client完成量測之後,數據匯入data array中,以key作不同資料的分類,等browser下次更新請求時,再一起送出
  • #21 用get而非POST的方式傳資料
  • #25 我們的系統實現了儀器聯網的功能,包含了Client端的儀器控制,Client跟雲端及雲端跟 Browser的TCP/IP,Http傳輸層通訊,將HMI整合到Web畫面上是屬於應用層的服務。當然,用LabVIEW來作溝通很方便,它也內建了各儀器的SCPI指令資料庫,但對於一些沒有連網功能的儀器,或是一些實驗室的小型應用,這個系統可提供一個快速的低成本解決方案
  • #27 低頻帶與中頻帶的響應平坦良好 高頻段會受到主動元件的極間電容以及線路中雜散電容之影響,使高頻響應受到限制,同時放大器增益也隨之往下降。 電容於高頻近似短路