Mitsubishi Electronics MELSEC Q series MELSEC L series Home Theater Server User Manual


 
5-52
5.1 Analog Instruction
5.1.3 OGSTOR instruction
G_OGSTOR
Program Example
The following program restores the offset/gain setting value to the A/D converter module
mounted on the I/O numbers from X/Y10 to X/Y1F when the flag turns ON.
[Structured ladder/FBD]
[ST]
IF(Var_Flag_Inst=TRUE)THEN (* Instruction flag ON *)
SET(TRUE, Var_Flag_Exe); (* Turns execution flag ON *)
END_IF;
IF(Var_Flag_Exe=TRUE)THEN (* Execution flag ON *)
G_OGSTOR(TRUE, H01, Var_ControlData, Var_Result);(* Restores setting value *)
IF(Var_Result[0]=TRUE)THEN (* Execution finished *)
IF(Var_Result[1]=FALSE)THEN (* Normal completion *)
RST(TRUE, Var_Flag_Exe); (* Turns execution flag OFF *)
ELSE (* Error completion *)
END_IF;
END_IF;
END_IF;
Turns execution
flag ON
Restores setting value
Error completion
Normal completion
Turns execution
flag OFF
Process on error completion
(* Process on error completion *)