Skip to main content

How to communicate using ASCII TCP between the BB-400 and a Linux or Windows system

This FAQ explains how to communicate using ASCII TCP between the BB-400 and a Windows system using TeraTerm or a Linux system using Telnet.

ASCII TCP

The ASCII protocol is a query-response/question-answer communication protocol in which a host PC uses ASCII characters to send commands to a device, and receive responses back from the device. The ASCII command set is used to configure devices, send data to devices and to read data and status information back from devices.

The BB-400 IO can be controlled over TCP/IP using simple ASCII commands. The default port number of the ASCII TCP server on the BB-400 is 9500.

For further information, the Brainboxes ASCII protocols page (FAQ ASCII protocol and commands) provides more detail regarding the various ASCII commands available.

With Windows using TeraTerm

TeraTerm is a Windows terminal program used to communicate with devices on the network. TeraTerm is available for download here: http://en.sourceforge.jp/projects/ttssh2/releases/.

Note: Brainboxes does not support using PuTTY as it may produce inconsistent results.

Connecting to the BB-400

The new connection pop-up window should open up when TeraTerm is started, however, if this window does not open up, it can be found by going to File > New connection.

Please make the following changes:

  1. Select TCP/IP as the protocol.
  2. Host should be the IP address of the device to be accessed.
  3. Select Telnet as the service.
  4. Enter the port number of the ASCII TCP server (the default is 9500).

Click on OK to connect:

Tera Term new connection dialog with TCP/IP, Telnet, and port 9500 settings highlighted

To make the output readable, go to Setup > Terminal and change New-line Settings to CR+LF in both Receive and Transmit. Also, make sure the Local echo  box is ticked, so that the typed-in commands are displayed in the terminal:

Tera Term terminal setup with CR+LF new-line and local echo settings highlighted

Start typing the commands in the terminal and hit Enter to get a response from the ASCII TCP server:

Tera Term terminal showing ASCII command @01 and response >AA55

With Linux using Telnet

To install Telnet on the Linux system, use the following command:

sudo apt-get install telnet

Syntax

Connect to the TCP server on the BB-400:

telnet <server-ip-address> <port-number>

The ASCII commands can then be used:

Linux terminal showing telnet connection to BB-400 on port 9500 with ASCII command @01

To exit the Telnet terminal press Ctrl+] and type quit.

The following examples show ASCII commands that can be used to retrieve and modify information regarding the BB-400 IO status.

Example 1: Reading the digital I/O status

ASCII command: @01

Linux telnet session showing @01 command with IO lines status response &gt;00FF

Example 2: Setting specified digital outputs. ASCII command: @01(data)

Linux telnet session showing @0155 write command and @01 read confirming output value 55AA

Example 3: Getting the count of an input ASCII command: #01(line-number)

Linux telnet session showing #010 and #012 input count commands with responses