Mitsubishi Electronics MELSEC Q series MELSEC L series 사용자 설명서

다운로드
페이지 412
5-56
5.2 Positioning Instruction
5.2.1 ABRST instruction
Z_ABRST1
[ST]
PLS(SM400, Var_Flag_Inst);
(* Absolute position restoration pulse *)
IF((Var_Flag_Inst=TRUE) & (X0=FALSE))THEN
SET(TRUE, Var_Flag_Mem);
(* Turns absolute position restoration memory ON *)
MOV(TRUE, 0, Var_ControlData[4]);
(* Clears completion status *)
END_IF;
IF(Var_Result[0]=TRUE)THEN
(* Execution finished *)
IF(Var_Result[1]=FALSE)THEN
(* Normal completion *)
MOV(TRUE, Var_ControlData[3], K1Y50);
(* Turns the servo ON with the data to be sent to the servo amplifier *)
ELSE
(* Error completion *)
MOV(TRUE, Var_ControlData[4], Var_ErrorCode);
(* Sets completion status to error code *)
END_IF;
IF(Var_ControlData[4]=0)THEN
RST(TRUE, Var_Flag_Mem);
(* Turns absolute position restoration memory OFF *)
END_IF;
END_IF;
IF(Var_Flag_Mem=TRUE)THEN
(* absolute position restoration memory ON *)
(* Sets ABS data *)
BSET(X47, 0, Var_ControlData[2]);
(* Sets ABS data in data b0 received from the servo *)
BSET(X48, 1, Var_ControlData[2]);
(* Sets ABS data in data b1 received from the servo *)
BSET(X49, 2, Var_ControlData[2]);
(* Sets send data ready flag in data b2 received from the servo *)
Z_ABRST1(TRUE, "00", Var_ControlData, Var_Result);
(* Restores absolute position *)
END_IF;