ASCII Encoding/Decoding Loopback Test (With Baseboard Blocks)

This example model shows how to send ASCII data over a serial link.

The ASCII Encode block generates a message with three different sub messages along with some extraneous 'junk' to show how the FIFO Read HDRS block can remain synchronized to the valid byte stream even in the presence of transmission errors.

The FIFO Read HDRS block can handle an arbitrary number of headers; just add them as strings to the cell array in the block parameters dialog box. The messages must share the same termination string. In this example, it is a carriage return followed by a line feed: "\r\n".

To test this model:

  1. The target computer must have two COM ports.

  2. Connect COM1 to COM2 with a null modem cable.

This example is configured to use baseboard serial ports (COM1 and COM2). You can also use COM3 and COM4 by changing the board setup in the Baseboard blocks. Other serial blocks could be used in place of the Baseboard blocks. For instance, a single Quatech® 4-port block could be used whereby you send on port 1 and receive on port 2.