Mitsubishi MELSEC-L series Programming Manual page 337

Hide thumbs Also See for MELSEC-L series:
Table of Contents

Advertisement

Program Example
The following program sends data (1234, 5678, and 8901) to the external device using the
socket communication function.
[Structured ladder]
[ST]
IF((LDP(TRUE, Var_Flag_Inst)) &(SD1282.0=TRUE))THEN
MOVP(TRUE, 6, Var_SendData[0]);
MOVP(TRUE, 1234, Var_SendData[1]);
MOVP(TRUE, 5678, Var_SendData[2]);
MOVP(TRUE, 8901, Var_SendData[3]);
SP_SOCSND(TRUE, "U0", 1, Var_ControlData, Var_SendData[0], Var_Result);
END_IF;
IF(Var_Result[0]=TRUE)THEN
IF(Var_Result[1]=FALSE)THEN
SET(TRUE, Var_Flag_Normal);
ELSE
SET(TRUE, Var_Flag_Error);
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
(* Sets data length by the byte *)
(* Sets send data *)
(* Sends data to the connection number 1 *)
(* Execution finished *)
(* Normal completion *)
(* Turns normal completion flag ON *)
(* Error completion *)
(* Turns error completion flag OFF *)
7.5 SOCSND Instruction
SP_SOCSND
7
7-15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-q series

Table of Contents