Mitsubishi MELSEC-L series Programming Manual page 49

Hide thumbs Also See for MELSEC-L series:
Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-q series

Table of Contents