AH500 Programming Manual 
6-510 
API 
Instruction code
Operand  Function 
2201    SSEND  P 
S
1
, S
2
 
Sending the data through the socket
Device
X  Y  M  S  T  C  HC  D  L  SM  SR  E  PR  K  16#  “$”  DF 
  Pulse instruction
16-bit instruction (5 steps)
32-bit instruction
Symbol: 
S
1
:
Socket mode  Word 
S
2
:
Socket number  Word 
Explanation: 
1.  S
1
 is 1 if users want to open the TCP socket, and S
1
 is 0 if users want to open the UDP socket. 
S
2
 is the socket number.   
2.  The operand S
1
 should be either 0 or 1, and the operand S
2
 should be within the range between 
1 and 8. 
3.  Before using this instruction, users need to use the instruction SOPEN to open the socket. If the 
flag related to the connection’s being successful is ON, or the flag related to the connection’s 
having been started is ON, this instruction can be used. 
4.  If the data is sent through the TCP socket, and no error occurs after the instruction is executed, 
the data is sent, and the flag related to the data’s being sent is ON. If the data is sent 
successfully, the flag related to the data’s having been sent is ON, and the flag related to the 
data’s being sent is OFF. If an error occurs, the error flag is ON. 
5.  If the data is sent through the UDP socket, and no error occurs after the instruction is executed, 
the flag related to the data’s having been sent is ON. If an error occurs, the error flag is ON. 
6.  Generally, the pulse instruction SSENDP is used.