4-4SectionApplication Procedure
45
4-4 Host Link Communications
4-4-1 Protocol
Host Link communications are executed by means of an exchange of com-
mands and responses between the host computer and the PC. The command or
response data that is transferred in one exchange is known as a frame and one
frame can contain up to 131 characters of data.
The frame formats for Host Link commands transmitted from the host computer
and responses returned from the PC are described below. The PC automatically
returns an ASCII-code response when it receives an ASCII-code command
from the host computer. The host computer must have a program that controls
the transmission and reception of the commands and responses.
When transmitting a command from the host computer, prepare the command
data in the format shown below.
x 10
1
@
FCS
x 10
0
↵
Node No. Header
code
Text Terminator
The header code and text depend on the Host Link command being transmitted.
When a compound command is transmitted, there will be a second sub-header
code.
The FCS (Frame Check Sequence) code is calculated at the host computer and
set in the command frame. The FCS calculation is described later in this section.
The command frame may be up to 131 characters long. A command of 132 char-
acters or more must be divided into more than one frame. To split the command,
use a carriage return delimiter (↵, CHR$(13)) instead of a terminator. A termina-
tor must be used at the end of the last frame.
When dividing commands such as WR, WL, WC, or WD that execute write op-
erations, be careful not to divide into separate frames data that is to be written
into a single word. You must divide frames so that they coincide with the divisions
between words.
Item Function
@ An “@” symbol must be placed at the beginning of every command.
Destination
Node No.
Identify the PCs by the Host Link node numbers (0 to 31) set in DM
6558 and DM 6553 of the PC Setup.
Header code Set the 2-character command code.
Text Set the command parameters.
FCS Set a 2-character Frame Check Sequence code.
Terminator Set two characters, “” and the carriage return (CHR$(13)) to
indicate the end of the command.
A normal response from the PC is returned in the format shown below. Prepare a
program at the host so that the response data can be interpreted and processed.
@
x 10
1
x 10
0
x 16
1
x 16
0
FCS
↵
Node No. Header
code
End code Text Terminator
The header code and text depend on the Host Link command that was received.
The end code indicates the completion status of the command (e.g., whether or
not an error has occurred).
Command Frame Format
Normal Response Frame
Format