Skip to Content

TeraTerm - Macro

以前介紹過 Windows 底下的 PuTTY (the Telnet and SSH client itself) 以及 Linux 底下的 minicom

  • Putty
  • 因為從 Windows 2003 開始 hyperterminal 就需要從新增移除程式去新增,到了 Windows 2008 之後就再也不提供這一隻程式了,很可惜在我們工作環境還是需要透過序列埠 Serial (Com) port 去和一些設備做溝通,所以介紹他們使用這一套我常用的 PuTTY (the Telnet and SSH client itself)

  • minicom
  • Linux 下常用的終端工具程式.

Tera Term

這邊為什麼還要介紹新的終端工具程式 Tera Term 呢!! 除了serial / SSH / telnet 外他還多了 Macro 這個功能, Macro 的功能就是可以依據 TerarTerm 終端視窗所顯示的字串來產生相對應的動作.

首先下載 Tera Term 來使用,不用擔心 Tera term 也是免費提供使用的.

Macro

先來看看兩個常用的 TTL Commands

waitrecv ‘ [string]' [string length] [start location]
waitrecv ‘1234567’ 7 1
在 Tera Term 的終端視窗,等待讀取字串,如果字串出現 1234567 且從頭 (1) 完成符合 (7) 個字串 ,就接下來的動作,通常會配合 sendln 送出相對應的動作.

sendln ‘ [string]’
sendln ‘Good’
sendln \n
    note: \n = “Enter”
sendln 3
    note: 3 = Ctrl+C (ASCII)
sendln  會在 Tera Term 的終端視窗送出相對應的字串或是

其他常用的 TTL command