Serial port testing


Successful support of a serial device is dependent on the RS232 communications settings being correct, the com port being available (if it exists and is not in use by another driver) and that the data is being seen on the port in the correct data format.

The best way to test this is the case is to use an external process to prove the above is true before specifying the port name in the UPDD driver.

For a quick test of a RS232 port open up a terminal / command window, type the command shown and touch the screen:

 OS Terminal command 
 Windows  type com1:
 Linux  cat < /dev/ttySN' (or ttyUSBn if using a serial to usb adaptor)
 MacOS  cat < /dev/[port]

MacOS example

To test if a com port is working and receiving data type 'cat < /dev/[port]' in a Terminal program (Finder, Go, Utilities, Terminal) and use the serial device.

In the following example a Keyspan serial adaptor is listed and tested by touching an attached touch screen:

This does not show the actual data received just that data is being received. To view the actual data use a software datascope as described below.

Comprehensive testing

For all Operating Systems there is also a simple serial port terminal application program called CoolTerm that may also be of use.

CoolTerm example

In this Windows example CoolTerm is connected to Com3 (a keyspan serial to USB adapter) with a serial touch screen connected.


 

When capturing data it is important to match the Baudrate to that expected by the device. Setting the wrong Baudrate will result in strange garbled data being captured/displayed. The most common Baudrate is 9600, followed by 2400 and 19200:

 You should also view the Hex data 

This old serial device outputs a 'heartbeat' packet 'FF 80 00 00' and a 3 byte data packet when touched -  D5 58 30 (touching packet), 95 58 2F (lift off packet) in the example data captured below:

When sending serial data to Touch-Base for analysis please either send a screenshot of the captured HEX data or select Capture to text file

For Linux install instructions are included in the download package, 'Linux System Requirements.txt'. In theory it should just work on a 32 bit system but you may need to follow the instructions for a 64 bit implementation.

Alternatively for Windows you may also wish to use one of the many available software datascopes, such as Terminal.

Alternatively for Mac you may wish to use Serial application.

A customer also reported that the Cutecom utility is really simple to use  and made short work of determining port and baud rate.

This is available for Linux and MacOS and can be installed under Linux via the command 

sudo apt-get install cutecom

Search