-
Created by Unknown User (jarisav), last modified on 12.4.2016
FUNCTION_BLOCK AxleEnableAndErrorReset
VAR_INPUT
AxleIndex: INT;
END_VAR
VAR_OUTPUT
END_VAR
VAR
ErrorIdReadErrorAxis: UDINT;
fbReadErrorAxis: FB_AxisError;
mcAxisEnable: MC_Power;
END_VAR
VAR_IN_OUT
Axis: AXIS_REF;
END_VAR
q_eStopIndicatorLightOut:= NOT q_eStopOutMachineRunAllowed;
g_ResetToSafety:=restartInButton;
g_AckToSafety:=restartInButton;
g_saveForceCalibrU:=restartInButton;
g_saveForceCalibrD:=restartInButton;
g_saveFinestrainCalibr:=restartInButton;
g_savePositionCalibr:=restartInButton;
IF restartInButton=TRUE AND q_eStopOutMachineRunAllowed=TRUE THEN
g_AxleOnOut:=TRUE;
MachineActive:=TRUE;
MachineNotActive:=FALSE;
END_IF
IF StopInButton=TRUE OR q_eStopOutMachineRunAllowed =FALSE THEN
g_AxleOnOut:=FALSE;
MachineActive:=FALSE;
MachineNotActive:=TRUE;
END_IF
IF q_eStopOutMachineRunAllowed=FALSE THEN
MachineActive:=FALSE;
MachineNotActive:=TRUE;
END_IF
motorPowerOnOut:=g_AxleOnOut;//48V moottorille jännite
mcAxisEnable(
Enable:=g_AxleOnOut,
Enable_Positive:= TRUE,
Enable_Negative:= TRUE,
Override:= 100,
Axis:= Axis);
(*nollataan akselin virhetila servon aktivoinnin nousevalla reunalla*)
fbReadErrorAxis(
Reset:=restartInButton,
Ax:=Axis,
NC_Error=> ,
NC_ErrorID=> ,
Drive_Error=> ,
Drive_ErrorID=>ErrorIdReadErrorAxis,
Drive_ErrorText=> );
(*jos ollaan logiikan lukemalla rajalla ja halutaan pois, niin painetaan servon aktivointipainiketta ja
samanaikaisesti ajetaan käsiajolla pois rajalta*)
Axis.PlcToNc.ControlDWord:=AxisSetAcceptBlockedDriveSignal(Axis.PlcToNc.ControlDWord, restartInButton);
You must log in to comment.