Omron CJ1W-ETN21 Parameters, Socket Option, UDP/TCP Socket No, Local UDP/TCP Port No

Models: CJ1W-ETN21

1 242
Download 242 pages 30.9 Kb
Page 141
Image 141

Using Socket Services by Manipulating Dedicated Control Bits

Section 6-7

R:Read by user for results at completion

---: Not used.

6-7-4 Parameters

Socket Option

For the TCP OPEN REQUEST (ACTIVE or PASSIVE) command, specifies whether or not the keep-alive function is to be used. When the keep-alive function is used, bit 8 is ON (set to 1).

UDP/TCP Socket No.

Specify the number of the UDP or TCP socket to open.

Local UDP/TCP Port No.

Specify the number of the UDP or TCP port for the socket to use for communications.

Do not specify the port being used as the FINS UDP port (default: 9600) in an open request for a UDP socket.

Do not specify FTP server TCP port numbers 20 and 21 in an open request for a TCP port.

Do not specify mail communications TCP port number 25.

As a rule, use port numbers 1,024 and higher.

If port number 0 is specified when for an active TCP open, the TCP port number will be automatically allocated and the number of the port that was opened will be stored in the local UDP/TCP port number in the Socket Service Parameter Area (i.e., the actual port number will be overwritten on the value of

0set by the user).

Remote IP Address

Specify the IP address of the remote device.

Offset +2 in the Socket Service Parameter Area contains the upper bytes of the Remote IP Address, and offset +3 contains the lower bytes. Example: The contents of offsets +2 and +3 would be as shown below when the Remote IP Address is 196.36.32.55 (C4.24.20.37 hexadeci- mal).

+2: C424

+3: 2037

This parameter is not used when making a receive request for a UDP socket. The remote IP address will be stored with the response data and will be written as the Remote IP Address in the Socket Service Parameter Area.

When opening a passive TCP socket, the combination of the remote IP address and the remote TCP port number can be used to affect process- ing as shown in the following table.

Remote IP

Remote TCP

Processing

Address

Port No.

 

 

 

 

0

0

All connection requests accepted.

 

 

 

0

Not 0

Connection requests accepted only for the same

 

 

port number.

 

 

 

Not 0

0

Connection requests accepted only for the same IP

 

 

address.

 

 

 

Not 0

Not 0

Connection requests accepted only for the same

 

 

port number and IP address.

 

 

 

117

Page 141
Image 141
Omron CJ1W-ETN21 operation manual Parameters, Socket Option, UDP/TCP Socket No, Local UDP/TCP Port No, Remote IP Address