![Mitsubishi Electric MELSEC System Q Special Instructions Manual Download Page 67](http://html.mh-extra.com/html/mitsubishi-electric/melsec-system-q/melsec-system-q_special-instructions-manual_239154067.webp)
5 MODULE DEDICATED INSTRUCTION
5.3 Serial Communication Instruction
65
5
Setting data
Program example
• The following program clears the receive data in the Q series C24 side. (For the Q series C24 whose I/O signals are X/Y00
to X/Y1F)
Device
Item
Setting data
Setting range
Setting side
(s2)[0]
Execution type
Specify '0'.
0
User
(s2)[1]
Completion status
The instruction completion status is stored.
• 0: Normal completion
• Other than 0: Error completion (error code)
System
(s2)[2]
Request type
Specify the request.
4: Receive data clear request
4
User
(s2)[3]
(s2)[111]
For system
System
[Structured ladder/FBD]
[ST]
IF(X20=TRUE)THEN
MOVP(TRUE, 0, Var_ControlData[0]); (* Clears execution type to 0 *)
MOVP(TRUE, 4, Var_ControlData[2]); (* Sets request type *)
ZP_CSET(TRUE, "U0", 1, Var_ControlData, Var_Dummy, Var_Result); (* Clears 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;
Clears execution
type to 0
Sets request type
Clears data
Turns normal completion
flag ON
Turns error completion
flag ON
Stores error code
Turns normal completion
flag OFF
Turns error completion
flag OFF
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: ......