Beruflich Dokumente
Kultur Dokumente
ETN
-004 Send via TCP Socket: _ETN004_SOCKET_TcpSend
Basic Issues a request to the specified Ethernet Unit to send using a TCP socket.
function
Symbol Start trigger
_ETN004_SOCKET_TcpSend
↑ (BOOL) (BOOL)
EN ENO
Busy Flag (INT) (BOOL) Busy Flag
Unit No. UnitNo BUSY
(INT) (BOOL) Normal end
TCP socket No. TCPSocketNo OK
(INT) (BOOL) Error end
No. of bytes to send SendBytes NG
(WORD) (WORD) Communications error code
Send data storage area type SendAreaID CmndErrorCode (May be omitted.)
(INT) (WORD) TCP error code
Send data first storage word address SendAreaNo TcpErrorCode (May be omitted.)
(INT) No. of bytes sent
Result (May be omitted.)
EN input Connect EN to an OR between an upwardly differentiated condition for the start trigger and the BUSY
condition output from the FB.
Restrictions • Always use an upwardly differentiated condition for EN.
Input • If the input variables are out of range, the ENO Flag will turn OFF and the FB will not be processed.
variables
Output • This FB requires multiple cycles to process. Always connect an OR including the BUSY output variable
variables to the EN input variable to ensure that the FB is processed to completion (see Symbol).
• Do not turn the BUSY output variable ON or OFF outside the FB.
_ETN004_SOCKET_TcpSend (2/3)
Application When bit A turns ON, a TCP socket send request is issued.
example Bit C will turn ON when the send request has been completed.
Bit A
_ETN004_SOCKET_TcpSend
↑ (BOOL) (BOOL)
EN ENO
Bit B Unit No. (INT) (BOOL) Busy Flag
&0 UnitNo BUSY Bit B
TCP socket No. (INT) (BOOL) Normal end
&1 TCPSocketNo OK Bit C
No. of bytes to send (INT) (BOOL) Error end
&100 SendBytes NG Bit D
Send data storage area type (WORD) (WORD)
Communications error code
P_DM SendAreaID CmndErrorCode
Send data first storage word address (INT) (WORD)
TCP error code
&15000 SendAreaNo TcpErrorCode
(INT) No. of bytes sent
Result D16000
Bit C
Processing after UDP socket send
Variable Tables
Input Variables
Name Variable name Data type Default Range Description
EN EN BOOL 1 (ON): FB started.
0 (OFF): FB not started.
Unit No. UnitNo INT &0 &0 to &15 The unit number of the Ethernet Unit.
TCP socket No. TCPSocketNo INT &1 &1 to &8
No. of bytes to SendBytes INT &1 &1 to
send &1980
Send data storage SendAreaID WORD #0082 P_CIO (#00B0): CIO Area
area type P_WR (#00B1): Work Area
P_HR (#00B2): Holding Area
P_DM (#0082): DM Area
P_EM0 (#0050) to P_EMC (#005C):
EM Area bank 0 to C
Send data first SendAreaNo INT &0
storage word
address
Output Variables
Name Variable name Data type Range Description
ENO ENO BOOL 1 (ON): FB processed normally.
(May be omitted.) 0 (OFF): FB not processed or ended in an error.
Busy Flag BUSY BOOL Automatically turns OFF when processing is
completed.
Normal end OK BOOL Turns ON for one cycle when processing ends
normally.
Error end NG BOOL Turns ON for one cycle when processing ends in an
error.
Communications CmndErrorCode WORD Outputs the error code when execution ends in an
error code error in the communications command level. Refer to
(May be omitted.) the FINS Command Reference Manual (W227) for
details on the error codes.
TCP error code TcpErrorCode WORD Outputs the error code when the TCP socket
(May be omitted.) operation ends in an error. Refer to 7-3
Command/Response Reference in the Ethernet Units
Construction of Networks Operation Manual (W420)
for details on the error codes.
No. of bytes sent Result INT The number of bytes that were actually sent.
(May be omitted.)
Version History
Version Date Contents
1.00 2004.6. Original production
Note
This manual is a reference that explains the function block functions.
It does not explain the operational limitations of Units, components, or combinations of Units and components. Always read
and understand the Operation Manuals for the system’s Units and other components before using them.