Mitsubishi Electric MELSEC-L Special Instructions Manual page 99

Melsec-q/l structured programming manual
Hide thumbs Also See for MELSEC-L:
Table of Contents

Advertisement

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
5 MODULE DEDICATED INSTRUCTION
5.3 Serial Communication Instruction
5
97

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-q

Table of Contents