Mitsubishi Electric MELSEC-L Special Instructions Manual page 67

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

Advertisement

Setting data
Device
Item
(s2)[0]
Execution type
(s2)[1]
Completion status
(s2)[2]
Request type
(s2)[3]
For system
(s2)[111]
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)
[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;
Setting data
Specify '0'.
The instruction completion status is stored.
• 0: Normal completion
• Other than 0: Error completion (error code)
Specify the request.
4: Receive data clear request
Setting range
0
4
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
5 MODULE DEDICATED INSTRUCTION
5.3 Serial Communication Instruction
Setting side
User
System
User
System
5
65

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-q

Table of Contents