![Mitsubishi Electric MELSEC System Q Special Instructions Manual Download Page 99](http://html.mh-extra.com/html/mitsubishi-electric/melsec-system-q/melsec-system-q_special-instructions-manual_239154099.webp)
5 MODULE DEDICATED INSTRUCTION
5.3 Serial Communication Instruction
97
5
Program example
• This instruction executes the protocol specified in Var_ControlData[2] when X20 turns ON.
[Structured ladder/FBD]
[ST]
IF((X20=TRUE) & (X1D=TRUE))THEN
MOV(TRUE, 0, Var_ControlData[1]; (* Store the set value to the send data storage area *)
MOV(TRUE, 1, Var_ControlData[2]; (* Designate protocol number 1 *)
GP_CPRTCL(TRUE, H00, 2, 1, Var_ControlData, Var_Result); (* Execute the protocol Communicate in CH2 *)
END_IF;
IF(Var_Result[0]=TRUE)THEN
IF(Var_Result[1]=FALSE)THEN
SET(TRUE, Var_Flag_Normal); (* Normal completion flag ON *)
ELSE
SET(TRUE, Var_Flag_Abnormal); (* Abnormal completion flag ON *)
MOV(TRUE, Var_ControlData[0], Var_ErrorCode); (* Store the error code *)
END_IF;
END_IF;
Store the set value to the send
data storage area
Designate protocol number 1
Execute the protocol
Communicate in CH2
Normal completion flag ON
Abnormal completion flag ON
Store the error code
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: ......