AH500 Programming Manual 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 received through the TCP socket, and no error occurs after the instruction is executed, the data is received, and the flag related to the data’s being received is ON. If the data is received successfully, the flag related to the data’s having been received is ON, and the flag related to the data’s being received is OFF. If an error occurs, the error flag is ON. 5. If the data is received through the UDP socket, and no error occurs after the instruction is executed, the flag related to the data’s being received is ON. After the data is received, the flag related to the data’s having been received is ON. If an error occurs, the error flag is ON.
6-514 API Instruction code Operand Function 2202 SRCVD P S , S 1 2 Receiving the data through the socket Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1 S 2 Pulse instruction 16-bit instruction (5 steps) 32-bit instruction AH500 AH500 - TCP socket number Being receiving the data Having received the Error flag data 1 SM1276 SM1271 SM1277 2 SM1284 SM1279 SM1285 3 SM1292 SM1287 SM1293 4 SM1300 SM1295 SM1301 5 SM1308 SM1303 SM1309 6 SM1316 SM1311 SM1317 7 SM1324 SM1319 SM1325 8 SM1332 SM1327 SM1333 UDP socket number Being receiving the data Having received the Error flag data 1 SM1337 SM1335 SM1338 2 SM1342 SM1340 SM1343 3 SM1347 SM1345 SM1348 4 SM1352 SM1350 SM1353 5 SM1357 SM1355 SM1358 6 SM1362 SM1360 SM1363 7 SM1367 SM1365 SM1368