SetNet Statement

Sets parameters for a TCP/IP port.

Syntax
(1) SetNet #portNumber, hostAddress[, TCP_IP_PortNum [, terminator [, SWFlow [, timeOut, [, protocol [, CloseNet timeout]]]]]]

(2) SetNet

Parameters

portNumber
Specify the port number of the TCP/IP port to set parameters. Valid values are 201 to 216.
hostAddress
Specify the host IP address.
TCP_IP_PortNum
Specify the TCP/IP port number.
terminator
Specify the line termination characters. Valid values are CR, LF, CRLF.
SWFlow
Specify the software control flow. Valid value is NONE.
timeOut
Specify the maximum time for transmit or receive in seconds. If this value is “0”, then there is no time out.
protocol
Specify the protocol (TCP/UDP/UDP_SEND/UDP_RECV) of communication.

  • TCP: TCP communication
  • UDP: UDP communication
  • UDP_SEND: UDP send
  • UDP_RECV: UDP receive
CloseNet timeOut
Specify the time before closing the socket with CloseNet in seconds. (Integer from 0 to 5)
When 0 is set, closes the socket without waiting for a response to the shutdown request.

Description
Parameters are stored to the Compact Flash inside the Controller. When you execute SetNet, the data is written to the Compact Flash. If a data is written to the Compact Flash frequently, it may shorten the Compact Flash life. Using SetNet only when changing the parameter is recommended.

See Also
OpenNet, WaitNet, CloseNet, SetCom

SetNet Statement Example

SetNet #201, "192.168.0.1", 2001, CRLF, NONE, 0, TCP, 5