beautypg.com

Applications – Rose Electronics Porter User Manual

Page 30

background image

26

PORTER INSTALLATION AND OPERATIONS MANUAL

Applications

Buffering
The switch may have a buffer of 16, 64, or 256 Kbytes of memory. The memory is

allocated evenly to each port. For the serial models half of the memory for each port

would be allocated to the transmit buffer and the other half to the receive buffer. For

example for an 8 channel serial model with 16k bytes of buffer each port would have 1k

for transmit and 1k for receive. For parallel models each port has only a transmit buffer

with the buffer being divided equally among all channels. For example a 4 channel

parallel model with 64k bytes of buffer would have 16k bytes allocated to each port.
When broadcast mode is used, the main port will go “busy” if any of the buffers

belonging to ports enabled for broadcast become full.
Chaining Multiple Porters Together
The units may be chained together in an unlimited fashion to connect 1 master port to

more than the number of peripheral ports available on one Porter unit by interconnecting

more than one Porter unit. The peripheral ports on a master unit are connected to the

master ports on the expansion units. In order to access ports on the expansion unit(s), a

different prefix code must be set into the expansion units. By sending the master unit’s

code followed by the expansion unit’s code, a peripheral port may be accessed.
For example, use the default prefix on the master unit. Set the prefix on the expansion

unit to %^. Connect peripheral port 2 on the master unit to the master port on the

expansion unit. To access port 5 on the expansion unit from the master port on the

master unit send the code ESC@2%^5. There is no limit to the number of expansion

units that may be added.
Writing Programs to Control the Porter
Procedure for sending Data
The procedure for sending data to multiple output devices using the Porter is

straightforward and easy to implement from a program.

1. Initialize the serial port connected to the Porter
2. Send the control code to connect to the first device.
3. Send the data to the first device.
4. Continue to step 2.

Procedure for Receiving Data
One common use of the Porter is to interrogate a group of devices to collect data from

them. A program that does this should use the following algorithm:

1. Initialize the serial port connected to the Porter, prepare to receive characters.

2. Use the any data available command and read the coded byte returned. If there is

any data available follow steps 3-5 below.

3. Send the control code to connect to the first device.

4. Receive and store data fro this device.

5. When the program wishes to change ports to listen to another device:

A. Either drop DTR (hardware handshake) or send an X-off (X-on/X-off).

B. Check the receiver to ensure that a character was not received while step 4a

was being carried out. Read and store the character if this happened.

C. Send the control code to connect to the next device

D. Carry out any steps needed to prepare to receive data from the next device.

E. Either raise DTR (hardware handshake) or send an X-on (X-on/X-off)

F. Proceed to step 3.