56
5 MODULE DEDICATED INSTRUCTION
5.3 Serial Communication Instruction
[ST]
PLS(X20, Var_Flag_Inst); (* Transmission instruction pulse*)
IF (Var_Flag_Inst=TRUE) THEN
MOV(TRUE, H4241, D11); (* Sets send data *)
MOV(TRUE, H4443, D12);
MOV(TRUE, H4645, D13);
MOV(TRUE, H0047, D14);
MOV(TRUE, H0AD, D15);
MOV(TRUE, 1, Var_ControlData[0]); (* Sets transmission channel to 1 *)
MOV(TRUE, 5, Var_ControlData[2]); (* Sets number of send data to 5 words *)
G_OUTPUT(TRUE, H0, Var_ControlData, D11, Var_Result); (* Sends data *)
END_IF;
IF(Var_Result[0]=TRUE)THEN (* Execution finished *)
IF(Var_Result[1]=FALSE)THEN (* Normal completion *)
SET(TRUE, Var_Flag_Normal); (* Turns normal completion flag ON *)
ELSE (* Error completion *)
MOV(TRUE, Var_ControlData[1], Var_ErrorCode);(* Stores error code *)
SET(TRUE, Var_Flag_Error); (* Turns error completion flag ON *)
END_IF;
END_IF;
IF (X21=TRUE) THEN
RST( TRUE, Var_Flag_Normal ); (* Turns normal completion flag OFF *)
RST( TRUE, Var_Flag_Error ); (* Turns error completion flag OFF *)
END_IF;
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: ......