7 SOCKET COMMUNICATION FUNCTION INSTRUCTION
7.3 Sending Data
263
7
Program example
• The following program sends data (1234, 5678, and 8901) to the external device using the socket communication function.
[Structured ladder/FBD]
[ST]
IF((Var_Flag_Inst=TRUE)&(SD1282.0=TRUE))THEN
MOVP(TRUE, 6, Var_SendData[0]); (* Sets data length by the byte *)
MOVP(TRUE, 1234, Var_SendData[1]); (* Sets send data *)
MOVP(TRUE, 5678, Var_SendData[2]);
MOVP(TRUE, 8901, Var_SendData[3]);
SP_SOCSND( TRUE, "00", 1, Var_ControlData, Var_SendData[0], Var_Result ); (* Sends data to the connection number 1 *)
END_IF;
IF(Var_Result[0]=TRUE)THEN (* Execution finished *)
IF(Var_Result[1]=FALSE)THEN (* Normal completion *)
SET(FALSE, Var_Flag_Normal); (* Turns normal completion flag ON *)
ELSE (* Error completion *)
SET(TRUE, Var_Flag_Error); (* Turns error completion flag OFF *)
END_IF;
END_IF;
Sets data length
by the byte
Sets send data
Sends data to
the connection
number 1
Turns normal
completion flag ON
Turns error
completion flag ON
Summary of Contents for MELSEC System Q
Page 1: ...MELSEC Q L Structured Programming Manual Special Instructions ...
Page 2: ......
Page 307: ...10 SFC CONTROL INSTRUCTION 10 2 SFC Transition Condition Comment Read 305 10 MEMO ...
Page 309: ...I 307 MEMO ...
Page 315: ......