5 MODULE DEDICATED INSTRUCTION
5.4 Network Dedicated Instruction
213
5
Program example
• The following program reads the open error code of the connection 1.
(The I/O signals of the Ethernet module are X/Y00 to X/Y1F)
(s)[4]
Error information
The read error information is stored.
0000H: No error
Other than 0000H: Error code
System
(s)[5]
(s)[7]
System area
[Structured ladder/FBD]
[ST]
IF((Var_Flag_Inst=TRUE) AND (Var_Flag_Exe=FALSE))THEN
MOVP(TRUE,H1,Var_ControlData[2]); (* Sets open error code of connection number 1 *)
MOVP(TRUE,H0,Var_ControlData[3]); (* Sets latest error information *)
SET(TRUE,Var_Flag_Exe); (* Turns execution flag ON*)
END_IF;
IF(Var_Flag_Exe=TRUE)THEN
ZP_ERRRD(TRUE,"00",Var_ControlData,Var_Result); (* Reads error information *)
END_IF;
IF(Var_Result[0]=TRUE)THEN (* Execution finished *)
IF(Var_Result[1]=FALSE)THEN (* Normal completion *)
MOVP(TRUE,Var_ControlData[4],Var_ErrorInfo); (* Stores error information*)
END_IF;
IF(Var_Result[1]=TRUE)THEN (* Error completion *)
MOVP(TRUE,Var_ControlData[1],Var_ErrorCode); (* Stores error code *)
END_IF;
RST(TRUE,Var_Flag_Exe); (* Turns execution flag OFF *)
END_IF;
Device
Item
Setting data
Setting
range
Setting
side
Sets open
error code
Turns execution
flag ON
Sets latest error
information
Turns execution
flag OFF
Error completion
Stores error code
Normal completion
Stores error
information
Reads error
information
Содержание MELSEC System Q
Страница 1: ...MELSEC Q L Structured Programming Manual Special Instructions ...
Страница 2: ......
Страница 307: ...10 SFC CONTROL INSTRUCTION 10 2 SFC Transition Condition Comment Read 305 10 MEMO ...
Страница 309: ...I 307 MEMO ...
Страница 315: ......