You are here

RealTerm - Serial Terminal

Realterm is a terminal program specially designed for capturing, controlling and debugging binary and other difficult data streams. It is far better for debugging comms than Hyperterminal. It has no support for dialing modems, BBS etc - that is what hyperterminal does.

Basic properties and capabilities

  • Text or Binary views of data
  • binary viewed as hex, 8 bit, 16 bit, little/big endian, signed, unsigned, special fonts
  • colorised: rx and tx data are different colors
  • ansi terminal or plain text or binary modes
  • protocol analyser / "spying" mode
  • fixed frame sizes/line lengths
  • sync patterns with masks and xors
  • data inversion
  • full remote control through active X
  • extensive command-line control
  • can be used for serial I/O component of other programs via activeX. Full support for minimize,hide,iconize, tooltray
  • special ascii+hex font to see hidden control chars
  • capture to file, settable capture size or capture duration
  • view and change control lines (cts,rts, dcd etc)
  • easy to send binary sequences
  • serial (comports) or telnet via tcp
  • arbitary baud rates
  • reset / power buttons for Pic Programmer
  • hideable to run in invisible or on tool-tray
  • can dump files to serial port

 

 

Display Formats

Reaterm displays data in meaningful forms
  • ASCII is plain text. Hex Font lets you see non-ascii values
  • ANSI is terminal emulation
  • data can be inverted (pager IC's do this)
  • Data can be in 1 or 2 byte binary views
  • 2 byte data can have either byte order

Hiding Controls / Fullscreen

If you don't want the control panel visible, or you want a bigger screen, then you can Hide Controls either from the popup menu, or the commandline or activeX interfaces. This is ideal for making a shortcut that sets up Realterm for your field staff or users, then hides all the controls, to make it less confusing.

Show / Hiding Everything

The popup menu (and ActiveX and Commandline) have a Show option that will completely hide Realterm. Unlike minimising, it disappears from the taskbar. Only the Tray Icon is left.

This is ideal where Realterm is being used by another program to work in the background, eg capturing data to a file, echoing a port to a remote machine.

If you want it to be totally hidden the activeX interface lets you hide even the Tray Icon. This is ideal if (like us) you have 16 Realterms running in the background at once, all the time.

Display Rows

You can set the display rows from the commandline to launch it the size you want.

 

Frame Sync

Binary data is arranged in frames. These frames are either

  • Fixed size N byte frames
  • variable length, delimited by a byte sequence

(of course Text is arranged as lines ending with LF or CR)

Fixed size frames are self evident. You will notice that the terminal resizes to always have a whole number of frames across.

Unfortunately frames will randomly begin somewhere on the line. GULP swallows a character each time it is pressed. Press it until the frames correctly sit on one line.

Delimited frames start a new line when they detect the sync sequence. A sync sequence can be any number of bytes long

Here sync is detected when 2 bytes match 0xA55A, or more accurately, when 0xA55A XOR 0x0000 AND 0xFFFF > 0. ["SyncIs" should be set to "Number"].

You can have as many bytes as you want in the sync word.

The XOR term allows you to invert some or all data bits. ($00 is normal $FF is inverted)

The AND term lets you ignore some of the bits. For example you could use this to use bit 7 as a sync bit, by setting the AND term to $80 $80. (Note hex numbers are preceded by $)

 

Baud Rates & Ports

Baudrates depend on the exact hardware port. Realterm accepts anything. Some ports complain about invalid baud rates, others just ignore them, some coerce to the nearest rate.

Most PC ports accept non-standard values that the chips divider is capable of generating.

Realterm can connect to both SERIAL ports (real uarts, as well as USB, and network virtual uarts) or TCP/Telnet ports.

  • Windows Serial Port# eg "2"
  • ip_address:port eg 192.168.20.1:23
  • port can be a number or service name eg "telnet"
  • server:port eg "server:telnet" or "server:9876"

USB serial ports appear at some port number. Look under "my_cmputer->properties->hardware->ports" to find where they are.

RS485

Enables hardware direction control by the RTS line.

Note that some specialist serial cards and USB-Serial adaptors can handle this in hardware, and don't require this to be set.

 

Hex Font

V1.99 seems to have a problem with non-displayable chars. Use V1.14 to see "non-printing" chars, or use "Hex+ASCII" format

Our Hex fonts are included. Go to the windows font installer in Control Panel to install it.

The hex font contains all 8 bit values. The non-ascii values <32 are shown as either HEX or CONTROL chars. (There are 3 different fonts in the .FNT file)

 

This is very useful for seeing control codes, invalid hidden codes and errors, in serial comms. It's equally useful in a programmers editor.

(Note that you won't see them in ANSI mode, as the control codes will be processed)

You can now get just the fonts from the downloads page. If you can convert these fonts for use with Linux or another OS, please do!

 

Pins & Status

Handshake Pins and comms status can be monitored.

Handshake outputs can be controlled directly (and from the command-line, and via activeX)

Pin states can be set manually. Set means data flow is enabled.

 

Capture

Incoming data can be captured to file. The capture can automatically stop after a certain time or number of chars. Realterm can be hidden, and capture controlled from the tray icon, popupmenu, and automation interfaces. Combine capture with filesend to make simple datalogging applications

Capture can be fully controlled through the ActiveX interface. Well behaved applications can read and process the files whilst RealTerm is writing them. (beware: Microsoft apps often try to lock the file, eg excel, notepad, word.)

This provides a very easy way to (say) collect serial data, and graph it live using Matlab.

It can either capture "direct" or via the terminal window. When you use DIRECT capture, the terminal window is turned off, and the echo port operation will cease. This means less processor load, screen draws etc. This is best for embedded type uses.

If you want to capture what you are seeing in the terminal, don't use Direct Capture.

RealTerm can also write LOG and TRACE files to help debugging difficult serial problems. For more information see Turbopower.com

Char Count and CPS (chars per sec) are displayed during capture.

 

Sending Char Sequences

Often you want to send special chars strings or strings repeatedly, or send them quickly.

Both ascii and binary strings can be sent. Sent chars aren't echoed to the terminal.

(V2) If half-duplex is set, then sent strings will be shown on the terminal. This also applies to strings/chars sent via the ActiveX interface.

When Sending ASCII, you can optionally end the line with CR and/or LF. You can also strip spaces from sent data. This is useful for the I2CChip adaptor. While it ignores spaces, they take time, and buffer space, and won't be used in the final application. (but they make it much easier to read!)

Sending Files

You can dump a file directly to the port. This has no "protocol" and just sends everything. (versions before 1.14 swallowed ^Z / 0x1A).

Padding File Dump with Delays

Two delay settings are provided to add delays after each char, and at the end of each line. (EOL is denoted by CR at present). This affects file dump, but not sending char sequences above.

Sending Repeatedly

You can set the number of repeats, and the delay after sending.

These are particularly useful from the commandline for data logging, when combined with capture.

For example you can make a simple, one line file that commands a multimeter to read a voltage. Set repeats to 0, so it will loop for ever, and delay to 1000ms, and Capture. Now the data will be read to file every 1 second.

Data Logging

Using Capture and SendFile from the commandline, you can log data and control intruments directly from the commandline, without extra software.

realterm.exe senddly=10000 sendrep=0 sendfile=commands.txt capture=results.txt

This will send "commands.txt" endlessly, with a 10sec pause between sends, and capture the replies to "results.txt". This is all you need to do to turn (say) and RS232 multimeter into a datalogger.

 

Echo Port: Redirect Ports across Network

The main port can be passed through or echoed to the Echo Port. This is partcularly useful when the echoport is a TCP port. This allows a real serial port to be aliased across the network. (the echo port can be a real comm port too)

Lets say the remote (unattended) machine (192.168.0.99) has a datalogger connected to COM1. It runs Realterm at startup with a command line like this:

realterm -port=1 -baud=9600 -echo=server:9876 -caption=Mirror_Multimeter_To_Internet

ie realterm connects to the datalogger on COM1 at 9600 bd, and presents a telnet server on port 9876 (or any other suitable number).

On the local (attended) machine run a copy of Realterm like this:

realterm -port=192.168.0.99:9876

This makes a telnet connection to the remote machine. Now you can sit at your desk, and control and monitor the remote serial device.

Note that as Realterm has a full ActiveX interface, you can use Windows remote DCOM to start,stop and control the remote Realterm, as well as the local copy.

When there is a connection, chars are echoed. When the connection is broken, or the buffers are full for some reason, it simply stops attempting to echo chars. When the connection is broken, the server end just waits for another connection. At the client end, the port need to be manully restarted.

If you are using the activeX interface you can check the open property to see if the link is up, and use it to re-establish a dropped link.

The Monitor checkbox lets the terminal window display both sides of the conversation (ie both the data received through the ain port, and the echo port)

 

Monitor RX and TX data: Protocol Analyser

Sometimes you just want to watch or spy on a conversation on a serial cable. Normally the terminal screen only shows you the RXD half of the conversation. You could just run a second copy of Realterm, but wouldn't it be nice to see the RXD and TXD data interleaved in the same terminal window?

The Echo port can be used to give you a second reciever. The data is put into the terminal screen, in a different color. Now you can see both sides of the conversation.

The interleaving on screen, only shows you when the data arrived at Realterms handlers. The indeterminate delays in Windows mean that you can't rely on the sequence being exactly as it happened. Obviously with slow data, or decent gaps between send and receive, it will work better than with very fast data streams.

Special Monitor Cable

You need a special adaptor with 2 plugs for the PC's 2 serial ports. Only connect RXD and GND on those plugs at the PC end.

Monitor and Echoing

You can select both Echo and Monitor. Now Realterm echos as normal, but the terminal window displays the data from both directions.

 

Command Line Parameters

Realterm doesn't save its settings. Instead it is set up from either the command line, for basic setups, or using its extensive ActiveX interface. It is also possible to send commands to a running instance of Realterm from the commandline.

These examples show the command-line params you can use. Generally they set the corresponding widgets. For radiobuttons and checkboxes, a number selects the state. For booleans (eg visible) use either 1 or 0. (n.b. No "/" or "-" before parameters) Errata: Quoted strings are not working properly, and may not work if you need spaces in parameters and filenames

  • realterm.exe baud=9600 port=1 flow=2 capfile=c:\temp\junk.dat visible=0 display=5 bigend=1 capcount=9876 framesize=7
  • realterm.exe port=server:telnet
  • realterm.exe port=127.0.0.1:21
  • realterm.exe RTS=1 DTR=0
  • realterm.exe tab=Send
  • realterm.exe echo=server:9876
  • realterm.exe capfile=junk.txt capsecs=10 capture
  • realterm.exe sendfile=junk.txt chardly=3 linedly=50
  • realterm.exe baud=1200 data=7E1
  • realterm.exe capture=in.txt sendrep=10 senddly=10000 sendquit=out.txt
BAUD # Set the baud rate. Non standard baudrates are fine
PORT   sets the port
DATA 7E1 Sets DataBits,Parity,StopBits. eg DATA=7E1 DataBits is 8-5, Parity is None,Even,Odd,Mark,Space, StopBits 1-2
FRAMESIZE   terminal frame size
CAPFILE   name of the capture file to use
CAPCOUNT   Length of capture in bytes (either CAPCOUNT or CAPSECS)
CAPSECS   Time of capture in SECS
CAPTURE 0/1/2

filename

Capture starts immediately. Stops at count OR secs. Can use CAPTURE=filename

Capture=0 is off; Capture=1 is ON; Capture=2 is APPEND

CAPQUIT   Capture (as above), but program quits when capture ends. If you manually stop capture, then Autoquit is cancelled. Can use CAPQUIT=filename
VISIBLE 0/1 starts hidden, only tray-icon is visible
DISPLAY # sets the display format (ascii, hex,int etc). eg DISPLAY=5
BIGEND   set big-endian checkbox
FLOW 0,1,2 sets hardware flow control mode
RTS 1/0 sets RTS pin
DTR 1/0 sets DTR pin
CLOSED 1/0 Starts with port closed (default is open)
TAB   Selects the opening tabsheet by name
ECHO   Sets the echo port, and enables echoing
EBAUD n Set the baud rate for echo port.
EDATA 7E1 Sets Echoport DataBits,Parity,StopBits. (not working properly yet)
HALF   Sets HALF Duplex
CAPTION   Sets window caption (can't accept spaces, use underscores)
SENDFILE   Sends the file immediately. (capture started before sending starts)
CONTROLS 1/0 Hide Controls and expand terminal window to full screen
MONITOR 1/0 Monitor Echo port RX onto terminal
CHARDLY # Sets delay (in ms) after each character when sending files and strings
LINEDLY # Sets delay (in ms) after each line when sending files and strings
ROWS # Set number of rows in terminal window.
SENDDLY # set delay (in ms) after file is sent, until next send begins. If Send Delay is set, SENDREP will be set to 0.
SENDREP # set number of times file will be sent. 0 sends for ever. Should follow after SENDDLY
SENDQUIT   quit when sendfile ends.If you manually stop send, then Autoquit is cancelled. Can use SENDQUIT=filename
FIRST   Sends commands to running (FIRST) instance of Realterm or stops more than one instance running. Brings FIRST instance of realterm to front, and quits. Should be first param.
LFNL 1/0 sets LF is Newline checkbox

Controlling a Running Instance

When you begin a line with the FIRST parameter, the parameters will be sent to the existing (first) running instance, and the second instance will terminate. This allows you to pass many of the above parameters (not all will do anything), and some special ones below. Note that ActiveX is a better way to do complicated tasks.

  • realterm.exe first LF sendstr="S42F0"
QUIT   Quits Realterm
EXIT   same as Quit
CAPTURE 0/1/filename Start/stop capture. 1 starts capture; 0 stops; filename starts and sets filename
SENDFILE 0/1/filename start/stop send file
SENDSTR "string" send string.
CR 0/1 send CR after string (sets for following strings)
LF 0/1 send LF after string
SENDNUM "numeric string" send numeric string as binary

The best idea is to create a special shortcut for each setup you want to use, and set the params in its properties. If you need other parameters added, contact us.

 

I2C Bus

The I2CChip Host adaptor provides a USB/RS232 interface to 3 I2C buses. Realterm is an easy way to use it. Using the ActiveX interface you can easily send strings from excel or other apps. Using the Echo port provides a way to make hardware devices that can be controlled over the internet.

Common commands you want to send to play with the adaptor are provided by the controls. Using this you can quickly try out an I2C adaptor or 1-wire device.

  • Read a Dallas 1-Wire ID chip
  • Write to 4 Digit LED Display
  • Read/write I2C Bus chips
  • Read SMBus Alert register

Refer to the datasheet for the BL233 chip used, where its commands are detailed.

Note that you can use it with SPI, Dallas 1-wire, and other serial IC's, as well as I2C

 

USB & RS232 Interface Hardware

Do you need to make a simple serial widget? Converts 5V logic level serial to USB / RS232

  • USB interface
  • plus RS232 interface with DB9F
  • optional 1500V galvanic isolation
  • onboard DC power socket and 5V regulator to power your widget
  • widget can be USB bus-powered
  • windows and linux

 

Controlling RealTerm from Scilab

Scilab is a free matlab like programming language, with good maths and plotting capabilities. However Scilab doesn't have any native serial port support, and doesn't have ActiveX support.

Scilab can be controlled using the commandline interface. Realterms FIRST parameter sends the commandline to the first instance of Realterm. This lets you control a running Realterm with more command lines.

  • Capture and Sendfile are the most important
  • SendRep and Senddly let you automatically repeat commands at regular intervals with no programming
  • SendString, CR and LF let you send simple commands without putting them into a file
  • Quit lets you shutdown Realterm

Download & Links


Related articles

Hodnocení článku: