40
1 FUNCTIONS
1.3 Communications Using the Predefined Protocol
Protocol communication type
The packets sent to the external device when a processing is executed and the external device's receive packets are
registered in the protocol.
The packet elements set with the predefined protocol support function are the data section of the packets that are actually
sent and received.
This section describes an example of the packet configuration. For details on the packet elements, refer to the following.
Page 395 Operation Image and Data Structure of Predefined Protocol
For TCP/IP
■Precautions for Passive open
• When the CPU module is connected to external device in Passive open state, the IP address of the connected external
device or port number of the external device can be obtained with the SP.SOCCINF instruction.
For UDP/IP
With the predefined protocol support function, data is exchanged with the external device with the procedures (communication
type) shown below.
For details on the communication type operation, refer to the following.
Page 395 Operation Image and Data Structure of Predefined Protocol
■Precautions for UDP/IP communications
• Use the SP.SOCCSET instruction to change the external device by the CPU module.
■Precautions for broadcast communications
• When the CPU module receives data by receiving the broadcast, the IP address of the external device which send data and
port number of the external device can be obtained with the SP.SOCCINF instruction.
Communication type Description
Send only The send packet is sent once.
Receive only If there is a packet that matches within the maximum of 16 registered receive packets, the packet is received.
Send & receive After sending the send packets, if there are packets that match the up to 16 registered receive packets, the packets are
received.
Maximum data length: 2046 bytesHeader
Ethernet header TCP/IP header
Destination
MAC address:
6 bytes
Sender's MAC
address:
6 bytes
Type:
2 bytes
IP:
20 bytes
TCP:
20 bytes
Data
Maximum data length: 2046 bytesHeader
Ethernet header UDP/IP header
Destination
MAC address:
6 bytes
Sender's
MAC address:
6 bytes
Type:
2 bytes
IP:
20 bytes
UDP:
8 bytes
Data