Tera Term Serial Macro Examples
I am testing some boards and the system used to test these is Tera Term. In Tera Term I use the Serial Port to send commands to the board in order to log in and run certain settings that I want.
How do I make Tera Term toggle DTR and RTS, or execute any of its custom commands in the Tera Term language (TTL)? I have an electronics project that uses an FTDI chip as the serial interface betw. Jul 24, 2018 - 1 Introduction; 2 Download; 3 Tera Term macros; 4 Macro editors; 5 Logging; 6 Support. It can be used to communicate with target hardware using a serial. Support for Tera Term terminal emulator as well as some example.
Instead of typing these commands each time I test a board I want to create a program that sends these commands without the requirement to type them again and again each time.
Also I need to set a delay between each command as the system needs to to load between them.
Question
How can automate the typing of commands and delay between subsequent commands in teraterm?
2 Answers
I used the Tera Term Language (TTL) and created a macro which solved my problem. I used code to wait for a prompt from the system and then print out the command I wanted.
Here's a link to the TTL syntax:
http://ttssh2.osdn.jp/manual/en/macro/syntax/
Don't use Tera Term for that. It is not made for scripting, but rather for interactive use. Try to get a command line serial terminal emulator.
Rogers dynasonic serial numbers 33219. If you are on Linux you can use screen
or there like.
If you are on Windows you can just write echo command > COM1
in a normal com.exe
-window, according to this link: https://batchloaf.wordpress.com/2013/02/12/simple-trick-for-sending-characters-to-a-serial-port-in-windows/(Replace COM1 with the name of your serial interface)
Make sure you don't have your Tera Term open while you use the echo-command, otherwise you'll get 'Access Denied'.
Not the answer you're looking for? Browse other questions tagged scriptingserial-portcommandteraterm or ask your own question.
I am using a Tera Term over a serial port to do some testing on a board. Recently I found out I can do some scripting in Tera Term so I have been doing research to help automate and make testing a little easier.
I know Tera Term has a site that lists example macros as well as a command list but I guess what I need is someone with experience scripting in Tera Term.
Tera Term uses a sort of Basic language called Tera Term Language (TTL) but I found it hard from the site to actually identify which commands I needed to use.
Tera term site: http://ttssh2.sourceforge.jp/ < -- Note: Site is in Japanese but I always have it auto translated..
I am trying to develop a script to play a set of tracks using a 'play x' command, where x is the track index. Ideally the track will play for ~3 seconds and then increment up to the next track. I have a very crude outline algorithm that I should describe it.
Algorithm:
If anyone has any insights or experience with Tera term I would be very appreciative.
If anything right now I need to figure out how to take an inputbox input and store it to a variable. I can probably figure out the rest..
Thanks
1 Answer
OK, I did some digging and found a moderately active forum: http://logmett.com/forum/
It is there that I found a nice thread called: TeraTerm Macro Language for dummies..http://logmett.com/forum/viewtopic.php?f=3&t=2133
That, and the command list on the actual TeraTerm project site is where I have been troubleshooting and solving 90% of my issues.
To take in a user defined input you use the 'inputbox' command, which follows the format:
inputbox 'message' 'title' [default]
(not entirely sure what default is supposed to be doing)
Tera Term Serial Macro Example
E.G.
inputbox 'Please type input' 'Input'
a dialog box will appear and prompt a response. This input is sent to a default variable inputstr
I have gotten this variable to work in some cases but I think the problem is that the variable is technically a string type so I can't do traditional loops. I need to figure out a way to use the str2int command to do an expression.
I think that answers my own immediate question as well as provide some reference for others..
Thanks