[Software] 開發 Serial Port 不能或缺的工具 Virtual Serial Port & Serial Port Monitor

[Software] 開發 Serial Port 不能或缺的工具 Virtual Serial Port & Serial Port Monitor

Virtual Serial Port 是 Eltima 旗下的一個產品之一 :

http://www.eltima.com/products/vspdxp/

特性如下:

Full features list:
  • Any number of virtual serial ports pairs can be created
  • Virtual serial ports are absolutely the same copies of real ones - applications won't see the difference between real and virtual serial ports
  • Virtual serial ports can be controlled directly from your own application via Dynamic Link Library supplied with VSPD (for OEM License owners)
  • Link between virtual serial ports is much faster than real null-modem cable connection and solely depends on your processor speed (average transfer speed is about 5.5 Mbytes/sec)
  • Real serial ports are not occupied - you can even have no real ports in system at all
  • Strict baudrate emulation (for Windows NT4/2000/XP/2003/Server 2008/Vista/Windows 7)
  • All signal lines are available: DTR/DSR/CTS/RTS/DCD/RI
  • Full support of HandFlow control (Hardware and Xon/Xoff)
  • Virtual serial line connection break emulation (for Windows NT4/2000/XP/2003/Vista/Server 2008/Windows 7)
  • Different virtual null-modem schemes are available: standard/loopback/custom (for Windows NT4/2000/XP/2003/Vista/Server 2008/Windows 7)
  • Virtual serial port may have any name you like, even the same name as real port has
  • Ports are automatically re-created on system reboot (prior to user login)
  • Possibility to change names of virtual serial ports, created by VSPD, shown in Device Manager
  • Restriction of access to created virtual ports for various applications (for Windows 2000/XP/2003/Vista/Server 2008/Windows 7)
  • Virtual Serial Port Driver and all of its internal drivers are digitally signed
  • Complete information about current virtual serial port state, sent/received data, etc (for Windows NT4/2000/XP/2003/Vista/Server 2008/Windows 7)
  • Windows kernel driver technology support (WDM, WMI, Power Management, PnP, etc)
  • Printers can be assigned to any virtual serial port (available after Windows reboot)
  • Hyper-threading and VMware friendly
  • No reboot is required after VSPD installation, creation and reconfiguration of virtual serial ports

 

  • 它能做什麼?

我主要都是用它來模擬兩台電腦 COM Port 之間的通訊。

在以往若是要開發兩台電腦之間的 COM Port 通訊,我們可能需要兩條實體Serial COM Port,然後對特殊角位跳線,用來模擬通訊以便開發相關軟體,自從我多年前知道有這東西,就沒跳過線了,今天特地來分享這個東西給其他人知道。

 

  • 如何模擬COM Port之間的通訊?

當我們打開軟體後可以看到我們電腦的實體Serial COM Port

SNAGHTML1182a937[6]

 

 

選擇First Port & Second Port

 

SNAGHTML11855a7d

 

 

接下來我們就可以看到我們在電腦中已經有虛擬的 COM Port 了,就算這個軟體關掉也仍能保持虛擬 COM Port 的存在

SNAGHTML1186d11f

 

 

 

可以觀察這個Port是被哪一隻程式所佔用,發送以及接收的 Bytes 狀況,由此可能得知自行開發的軟體有沒有正常在工作。

SNAGHTML118e6a01

 

手動模擬斷線/復線

 

SNAGHTML11b34d9c

 

 

設定腳位跳線,雖然看起來是如此,但我改了設定也看不出什麼變化。

SNAGHTML1190f36b

 

這軟體基本上就只是模擬 COM Port 而已,無法模擬實際設備的接收的實際反應狀況,我們還是得為每一個不同的設備進行參數上的處理或是流程上的處理。

 


Serial Port Monitor 也是 Eltima 旗下的產品 http://www.eltima.com/products/serial-port-monitor/

特性如下:

Full features list:
  • Start/stop monitoring the serial port that is already opened by another application (available in Professional Edition only)
  • Serial Port Monitor is completely compatible with Windows 7 /Vista (both x32 and x 64)
  • Serial Port Monitor and all of its internal drivers are digitally signed
  • Any number of serial ports can be monitored simultaneously
  • Supports all COM-port types: standard on-board ports, extension board ports, software-based virtual COM ports, bluetooth serial ports, USB to SERIAL cradles, etc
  • Data transmission monitoring and logging
  • Advanced send dialog: easily send various types of data, apply aliases for faster typing and automation, send files and loop functions and commands, change serial port parameters on-the-fly (available in Professional Edition only)
  • Real-time data capturing
  • Various monitoring visualizers: table view, line view, dump view, terminal view
  • Incoming and outgoing data streams logging
  • Multi-colored commands display in table view
  • Any software/hardware that works with a serial port can be monitored
  • Intercept and record all serial input/output control codes (IOCTLs), tracking their full details and parameters
  • Customizable monitoring session logging (several timestamp formats, different scale of notation, customizable logging string length etc.)
  • Convenient and flexible monitoring session's management: saving and loading all monitored data, exporting and redirecting to file functions
  • Monitoring session exporting (HTML, ASCII text, UNICODE text, Exсel CSV) and automatic redirection to file (Serial Port Monitor will automatically append all monitored data to a file in real-time)
  • Supports copying all recorded data to clipboard
  • Supports adding data automatically before and after packet to be transmitted
  • Full duplex mode supported
  • Control lines status visualized
  • Unique stream filtering tools with presets
  • All baudrates supported
  • Flexible configuration: stopbits, flow control, parity control, data bits, highlighting, etc.
  • User-friendly flexible interface: the software is designed to provide easy access to serial ports, no programming skills are required

 

  • 它能做什麼?

我主要都是用它來觀察COM Port通訊的封包,瞭解封包的傳遞格式才能正確的處理資料。

 

  • 如何觀察 COM Port 封包?

開啟軟體後,定義自己想要監視的Port

SNAGHTML11a051de

 

 

按下箭頭後,就可以看到封包的傳遞(好多攪…)

SNAGHTML11a13307

 

除了監視封包外,也能傳送封包,讓你輕易的調試相關設備。

SNAGHTML12170d60


4種報表格式,讓你看的更多

SNAGHTML1181c0

 

 

這工具對於封包的觀察上有很大的幫助,有利於我們分析封包。


順帶一提:

有關Serial Port 上的開發 Bill 叔寫了一整個系列的文章,有在開發 Serial Port 的人一定不能錯過唷。

http://www.dotblogs.com.tw/billchung/category/5702.aspx?Show=All

 

若有謬誤,煩請告知,新手發帖請多包涵


Microsoft MVP Award 2010~2017 C# 第四季
Microsoft MVP Award 2018~2022 .NET

Image result for microsoft+mvp+logo