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
Содержание MELSEC System Q
Страница 1: ...MELSEC Q L Structured Programming Manual Special Instructions ...
Страница 2: ......
Страница 307: ...10 SFC CONTROL INSTRUCTION 10 2 SFC Transition Condition Comment Read 305 10 MEMO ...
Страница 309: ...I 307 MEMO ...
Страница 315: ......