Mitsubishi Electric MELSEC-L Special Instructions Manual page 55

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

Advertisement

[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;
• 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.
5 MODULE DEDICATED INSTRUCTION
5.3 Serial Communication Instruction
5
53

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-q

Table of Contents