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


 
5.1 Analog Instruction
5.1.1 OFFGAN instruction
5-3
5
MODULE DEDICATED
INSTRUCTION
G_OFFGAN
G_OFFGAN
Program Example
The following program converts the mode of the A/D converter module mounted on the I/O
numbers from X/Y00 to X/Y0F to the offset/gain setting mode when Var_Flag turns ON, and gets
it back to the normal mode when Var_Flag turns OFF.
[Structured ladder/FBD]
[ST]
(* Convert to the offset/gain setting mode *)
IF(Var_Flag=TRUE)THEN (* Var_Flag ON *)
MOVP(TRUE,1,Var_ControlData); (* Sets mode *)
G_OFFGAN(TRUE,H00,Var_ControlData); (* Converts mode *)
END_IF;
IF(X0A=TRUE)THEN
END_IF;
(* Convert to the normal mode *)
IF(Var_Flag=FALSE)THEN (* Var_Flag OFF *)
MOVP(TRUE,0,Var_ControlData); (* Sets mode *)
G_OFFGAN(TRUE,H00,Var_ControlData); (* Converts mode *)
END_IF;
IF(X0A=FALSE)THEN
END_IF;
Sets mode
when Var_Flag
turns ON
Converts mode
Sets mode
when Var_Flag
turns OFF
Converts mode
Process in offset/gain setting mode
Process in normal mode
(* Process in offset/gain setting mode *)
(* Process in normal mode *)