6 F 3 B 0 3 6 2

5.TCP open request (using the SEND instruction)

a.Function

This request opens (active/passive) any of the eight sockets.

Transmission protocol: TCP/IP

b.Transfer parameters

A

3100H

A+1

CMD = 0035H

A+2

SportNO

A+3

Kind

A+4

DIPAddress

A+5

 

 

 

A+6

DTCP_PORTNO

A+7

STCP_PORTNO

A+8

TimeCNT

Module designation

Command number

Socket identifier (1 to 8)

Open type

Remote port IP address

Remote port object socket TCP port number Local port specified socket TCP port number Open wait timeout time

Open type (1 or 2) 1: Active open (client side) 2: Passive open (server side)

Open wait timeout time: specified in 0.1 second units. (1 to 65535) If zero is specified, the system is set to an unlimited (infinite) wait state.

c.Status (See figure 4.3 for details on bits C, D, E and F.)

B B+1

F E D C B A 9 8 7 6 5 4 3 2 1 0

 

 

 

 

SportNO

TermSTS

Detailed information (Only valid when TermSTS = 0BH.)

SportNO: Socket identifier (1 to 8)

TermSTS: See tables 4.3 and 4.4.

Detail information: See table 4.5.

d.Important items

After this request completes normally, TCP send, receive or close requests can be sent to the socket.

An error is returned if an open request is issued for an already open socket.

Status: Transmission error (TermSTS = 0BH)

Detailed information: Already open (0080H)

An error is returned if a value other than 1 to 8 is specified as the socket identifier. Status: Transmission error (TermSTS = 0BH)

Detailed information: Illegal socket identifier (0082H)

An error will be returned if a value outside the range 1024 to 65535 is specified for the local port specified socket TCP port number.

Status: Transmission error (TermSTS = 0BH)

Detailed information: Port number error (0071H)

97

Page 98
Image 98
Toshiba T2N instruction manual 3 B 0 3 6 TCP open request using the Send instruction, Stcpportno