■Control data
Device
Item
(s2)+0
Execution/completion
type
(s2)+1
Completion status
(s2)+2
Application setting area
(s2)+3
Host Station Port No.
(s2)+4
Target device IP
*2
(s2)+5
address
(s2)+6
Target device port
*2
number
(s2)+7 to
(s2)+9
*1 The "Set by" column indicates the following.
User: The data must be set before executing the SP.SOCOPEN instruction.
System: The CPU module stores the execution result of the SP.SOCOPEN instruction.
*2 For the Unpassive open, the IP address and port number of the target device are ignored.
*3 Because host station port numbers, 1 to 1023 (0001H to 03FFH), are assigned for reserved port numbers and 61440 to 65534 (F000H
to FFFEH) are used for other communication functions, using 1024 to 5548, 5570 to 61439 (0400H to 15ACH, 15C2H to EFFFH) is
recommended. Do not specify 5549 to 5569 (15ADH to 15C1H) because these ports are used by the system.
Description
Specify which settings are used to open a connection,
parameter settings configured by an engineering tool or
control data settings (s2) +2 to (s2) +9.
0000H:
Connection is opened according to the settings set in
"External Device Configuration" of module parameter.
8000H:
Connection is opened according to the values specified for
control data (s2) +2 to (s2) +9.
Completion status is stored
0000H: Completed
Other than 0000H: Failed (Error code)
Refer to Page 150 Error Codes.
b15b14 b13 b11 b10 b9 b8 b7
to
(s2)+2
[4]
0
[3]
[2][1]
[1] Communication method (protocol)
0: TCP/IP
1: UDP/IP
[2] Socket communications function procedure
0: Communication protocol
1: Socket communications (No procedure)
[3] Communication protocol setting
0: Do not use the communication protocol support function
(use the socket communications function)
1: Use the protocol support function
[4] Open method
00: Active open or UDP/IP
10: Unpassive open
11: Fullpassive open
Specify the port number of the host station.
Specify the IP address of the target device.
Specify the port number of the target device.
Use prohibited
Setting range
0000H
8000H
Shown on left side
to
b0
0
1 to 5548, 5570 to 65534
(0001H to 15ACH, 15C2H to
*3
FFFEH)
1 to 3758096382
(00000001H to DFFFFFFEH)
1 to 65534 (0001H to FFFEH)
7 SOCKET COMMUNICATION FUNCTION
7.4 Socket Communication Function Instructions
*1
Set by
User
System
User
7
System
85