5 MODULE DEDICATED INSTRUCTION
5.3 Serial Communication Instruction
53
5
• The communication status can be checked by the SPBUSY instruction.
Page 63 Communication status check
• Specify the capacity of the send data (stored in devices from D10 to D11 in the program example above)
and the number of send data within the user-defined buffer memory range assigned for the on-demand
function.
[ST]
PLS(X53, Var_Flag_Inst); (* On-demand transmission instruction pulse *)
IF(Var_Flag_Inst=TRUE)THEN (* Instruction flag ON *)
MOV(TRUE, 1, Var_ControlData[0]); (* Sets transmission channel to 1 *)
MOV(TRUE, 2, Var_ControlData[2]); (* Sets number of send data to 2 words *)
MOV(TRUE, H1234, D10); (* Sets send data to D10 to D11 *)
MOV(TRUE, H5678, D11);
RST(TRUE, Var_Flag_Normal); (* Turns normal completion flag OFF *)
RST(TRUE, Var_Flag_Error); (* Turns error completion flag OFF *)
SET(TRUE, Var_Flag_Exe); (* Turns execution flag ON *)
END_IF;
IF(Var_Flag_Exe=TRUE)THEN (* Execution flag ON *)
GP_ONDEMAND(TRUE, H0, Var_ControlData, D10, Var_Result); (* Performs on-demand function transmission *)
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 *)
SET(TRUE, Var_Flag_Error); (* Turns error completion flag ON *)
END_IF;
RST(TRUE, Var_Flag_Exe); (* Turns execution 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: ......