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


 
5.1 Analog Instruction
5.1.2 OGLOAD instruction
5-27
5
MODULE DEDICATED
INSTRUCTION
G_OGLOAD
G_OGLOAD
Program Example
The following program reads out the offset/gain value of the A/D converter module mounted on
the I/O numbers from X/Y00 to X/Y0F 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_OGLOAD(TRUE, H00, Var_ControlData, Var_Result); (* Performs readout *)
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;
Specifies voltage
when instruction
flag turns ON
Performs readout
Normal completion
Turns execution flag OFF
Turns execution flag ON
Error completion
Process on error completion
MOV(TRUE,0,Var_ControlData[2]); (* Specifies voltage *)
(* Process on error completion *)