How is Automatic Remote Line Terminate useful? When is it not useful? How does it affect data throughput?
The Automatic Remote Line Terminate feature unique to the Gypsy allows the initiator to provide data for multiple scan lines with a single Print command, for the Gypsy to send the data for each line separated by a Remote Line Terminate.
When an application wants to plot an image that is not the full width of the plotter's scan line, the application must do one of three things:
Option 1 requires the application to reserve extra memory for each scan line based upon the actual line width of the particular attached plotter. It also requires this additional data (all nulls) be passed to the Gypsy over the SCSI bus, and for the Gypsy to pass it to the plotter over the Versatec(tm) Plotter Interface.
In a situation where the application is placing multiple images beside each other, it may be most convenient for the application to go ahead and allocate a large memory buffer first, then place each image into the buffer one by one, and then to send the whole buffer over to the Gypsy.
For option 2, the application generates a single scan line which is not the full width of the plotter, sends it to the Gypsy via a Print command, then issues a Format command with the RLTER bit set to inform the plotter that all data for the current line has been sent. This sequence of Print and Format is repeated until all scan lines have been sent to the Gypsy.
This second option requires extra overhead on the SCSI bus due to small Print commands and superfluous Format commands. The SCSI command processing overhead is significant compared to the amount of time required for the data to flow across the SCSI bus. To improve performance, use option 3.
When implementing option 3, the initiator first sends a Mode Select command to set the "Automatic RLTER line length" in bytes. Then a single Print command may be issued for multiple scan lines. The data in each Print command needs to include "Automatic RLTER line length" bytes for each scan line, not the full plotter's line width.
To demonstrate how to use this feature, let's assume we want to plot an image 10 bytes wide, but the plotter's line width is 28. These numbers have been scaled down for demonstration purposes only. Real numbers might be 10 times larger.
For option 1 above, we might use the following sequence, presented using some pseudo-code:
image[10,10] = { 10 bytes for line 1, 10 bytes for line 2, ...
... , 10 bytes for line 10)
for line = 1 to 10
scanline[1..10] = image[line,1..10]
scanline[11..28] = nulls
SCSI Print (scanline)
next line
The plotter receives a full scanline from each print command, so the plotter will automatically advance the paper one line for each command.
For option 2, the loop shown above would be changed to:
fzor line = 1 to 10
scanline[1..10] = image[line,1..10]
SCSI Print (scanline)
SCSI Format (RLTER)
next line
In this case, the time for the data to be transmitted to the Gypsy is cut in half, but twice as many commands are being issued.
For option 3, the loop is reduced to a single SCSI Print command, but some setup needs to be performed first.
modedata = SCSI Mode Sense
modedata[0] = 0
modedata[10..11] = sizeof( image[1,1..10] )
SCSI Mode Select (modedata)
SCSI Print (image)
This shows that the gain of data transmission time being cut in half from option 2 is realized, but without twice as many commands being issued. Some fairly simple setup commands are required.
When using the automatic RLTER feature, a possibility arises that the amount of data sent for a single SCSI print command may not match an integral number of automatic RLTER line lengths. For example, using the parameters set in the pseudo code for option 3, a SCSI Print command with only 5 bytes of data would not fill the automatic RLTER line length. This causes a dilema within the Gypsy on what to do with the partial RLTER line length. The Gypsy has two options:
To let the application control which of the two options is performed by the Gypsy, another bit within the Mode Select data is provided. The field named exactRLTER provides this control. When this bit is clear, the Gypsy will always perform the automatic RLTER at the end of processing each print command (as in 1 above). When this bit is set, the Gypsy sends all data to the plotter, but only issues an automatic RLTER when the exact RLTER line length has been met, independent of the number of print commands required to provide the data.