HOST.pdf - 第19页
BM 122/ 123 /1 33/ 221/2 31 HOST COMPUTER SYSTEM 3.1 PanaP rot ocol Descri pti on E35HEC- 4A-151- B0 3.1- 2 3.1. 2 M essage Format Port 1: Used for comm unicati on of C comm ands (other than R comm ands). Port 2: Used fo…

BM122/123/133/221/231
HOST COMPUTER SYSTEM
3.1 PanaProtocol Description
E35HEC-4A-151-B0
3.1-1
3.1. PanaProtocol Description
E35HEC-4A-151-B0
3.1.1 PanaProtocol Description
This chapter describes the data format of PanaProtocol LAN communication.
Information in this chapter are not necessary if the customer uses our host system software, but they are
required when structuring customer’s own host system.
The PanaProtocol LAN uses the socket communications method. It is a widespread technology for
general-purpose OS such as Windows and UNIX.
The PanaProtocol LAN uses the Winsock standard to accomplish communication.
In socket communication, computers are classified into server and client.
To perform communication between host computer and machine, set the computer on the machine side as
server to wait access from the host computer set as client
Socket communication physically uses a single LAN cable, while the PanaProtocol LAN has two logical
connections dedicated to C commands and R commands respectively, and different port numbers are
assigned to them.
This enables any R commands occurred during C command communication to be notified correctly.
Also, to increase communications speed during program download/upload, all lines of a program are
transferred in block.
Item Description Remarks
Protocol TCP/IP Socket method
Port No. 2 ports used for C commands
and R commands respectively.
Must not duplicate with other socket applications.
Port 1 (for C commands): 49152
Port 2 (for R commands): 49153
Client/server ‘Client’ -- Host computer
‘Server’ -- Machine
Socket
communication
Messages conform to
Panaprotocol
STX, ETX and check sum are not used.

BM122/123/133/221/231
HOST COMPUTER SYSTEM
3.1 PanaProtocol Description
E35HEC-4A-151-B0
3.1-2
3.1.2 Message Format
Port 1: Used for communication of C commands (other than R commands).
Port 2: Used for communication of R commands.
Data structure 1 (without data)
Command
(
Fixed length)
Char [256]
*1 Commands less than 256 characters will be padded with blank
spaces.
Data size
(
Fixed length)
Long
*2 Size of transmitted data (entity) in bytes
(Big endian TCP/IP format)
0 Char
0 Char
0 Char
*4 Terminator
Data structure 2 (with data)
Command
(
Fixed length)
Char [256]
*1 Commands less than 256 characters will be padded with blank
spaces.
Data size
(
Fixed length)
Long
*2 Size of transmitted data (entity) in bytes
(Big endian TCP/I format)
Data
(
Variable-length)
Char [size]
*3 Defined separately.
Not to be set when the data size is 0.
0 Char
0 Char
0 Char
*4 Terminator
Packets of these data structures are used to exchange commands and data during communication.
=HINT=
Big endian is a method used in TCP/IP or SPARC CPU, which sends the most significant digit first
when transferring 4-byte long variables on a network.
On Windows, functions htonl() and ntohl() are used for conversion with X86 format.
Regarding the formats of command, data size and data fields, refer to Command Description.
Port 1
Port 2
Machine
Port 1
Port 2
Host

BM122/123/133/221/231
HOST COMPUTER SYSTEM
3.2 Command Description
E35HEC-4A-171-A0
3.2-1
3.2. Command Description
E35HEC-4A-171-A0
The commands are divided into 4 types. These are respectively divided into smaller types, and the actual
use is explained below.
3.2.1 C commands (C0, C1, C2, C3 and C5)
There are 5 types of remote control commands to the machine, C0, C1, C2, C3 and C5.
These commands are all effective only from the host computer controlling the machine.
C commands cannot be output from the machine to the host computer.
3.2.2 A commands (A0, A2, A3 and A4)
A (Acknowledge) commands are used when the host computer converses with the machine to acknowledge
that commands have been mutually received and that there are no errors.
These commands can be used both by the host computer and the machine.
Command to request the next data: A0
This command shows that the receiver has properly received the data transmitted by the sender, and is
usually used as a command requesting the next data.
Data transmission end command: A2
This is the command showing that the conversation between the host computer and the machine has been
completed without any trouble.
By this A2 command, the machine discontinues the conversation mode.
No requested data command: A3
Though C1 command is sent to the machine requesting data to be sent, if the name of the program is not
found, this command is used.
Received data invalid command: A4
This command is generated if any abnormality has occurred in sequence of command, or if the machine has
received commands when not in the condition to receive commands.
In this case, the machine invalidates the received data.
A4 command has the following 2 items.
A4E00 (Operation error)
The machine has received C command when it cannot receive commands.
Ex.:
If C5 command is sent when remote control has been disabled on the machine (set in the menu).
If command is sent while the machine is in the processing of program selection, program editing or
production information update.
Besides, if there are abnormalities in command code, or if a command which is invalid because of
unavailable option has been received, this command is sent.
A4E01 (Protocol error)
Another command has been received while sending data.
3.2.3 D command (D0)
Used when sending data in the program transfer mode.