Initial Commit
This commit is contained in:
6
LastUser.set
Normal file
6
LastUser.set
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<ProjectSettings xmlns="http://br-automation.co.at/AS/ProjectSettings">
|
||||
<Print Header="%lProject: %n%c%x" Footer="%cPage: %p" />
|
||||
<ConfigurationManager ActiveConfigurationName="Config1" />
|
||||
</ProjectSettings>
|
||||
91
Logical/Axises/Axisctrl/Axisctrl.var
Normal file
91
Logical/Axises/Axisctrl/Axisctrl.var
Normal file
@@ -0,0 +1,91 @@
|
||||
(*//-----------------------------------------------------------------------------------------------------*)
|
||||
(*//MC FunctionBlocks*)
|
||||
VAR
|
||||
Axis_MC_BR_AxisErrorCollector : MC_BR_AxisErrorCollector;
|
||||
Axis_MC_ACP_ENCOD_REF : MC_ACP_ENCOD_REF := (0);
|
||||
Axis_MC_ACP_ENCOD_PARAM_REF : MC_ACP_ENCOD_PARAM_REF := (0);
|
||||
Axis_MC_GearIn : MC_GearIn := (0); (*Start electronic Gear coupling with master*)
|
||||
Axis_MC_GearInPos : MC_GearInPos := (0); (*Start electronic Gear coupling (Position mode) with master*)
|
||||
Axis_MC_GearOut : MC_GearOut := (0); (*Stop electronic Gear coupling*)
|
||||
Axis_MC_BR_BrakeControl : MC_BR_BrakeControl := (0);
|
||||
Axis_MC_BR_GetErrorText : MC_BR_GetErrorText := (0);
|
||||
Axis_MC_BR_HomeAcpEncoder : MC_BR_HomeAcpEncoder := (0);
|
||||
Axis_MC_BR_InitAxisPar : MC_BR_InitAxisPar := (0);
|
||||
Axis_MC_BR_JogVelocity : MC_BR_JogVelocity := (0);
|
||||
Axis_MC_BR_JogLimitPosition : MC_BR_JogLimitPosition := (0);
|
||||
Axis_MC_BR_JogTargetPosition : MC_BR_JogTargetPosition := (0);
|
||||
Axis_MC_BR_ReadDriveStatus : MC_BR_ReadDriveStatus := (0);
|
||||
Axis_MC_BR_Simulation : MC_BR_Simulation := (0);
|
||||
Axis_MC_BR_SetHardwareInputs : MC_BR_SetHardwareInputs := (0); (*Set HW-Inputs (Limits for Axises)*)
|
||||
Axis_MC_BR_TorqueControl : MC_BR_TorqueControl := (0); (*Continuous Movement with Cyclic Torque*)
|
||||
Axis_MC_BR_VelocityControl : MC_BR_VelocityControl := (0); (*Cyclic Velocity / Torque*)
|
||||
Axis_MC_Halt : MC_Halt := (0); (*Halt*)
|
||||
Axis_MC_Home : MC_Home := (0); (*Homing*)
|
||||
Axis_MC_BR_InitModPos : MC_BR_InitModPos := (0); (*Modulo Position*)
|
||||
Axis_MC_MoveAbsolute : MC_MoveAbsolute := (0); (*Absolute Movement*)
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop : MC_BR_MoveAbsoluteTriggStop := (0); (*Absolute Movement with Trigger Stop*)
|
||||
Axis_MC_MoveAdditive : MC_MoveAdditive := (0); (*Additive Movement*)
|
||||
Axis_MC_BR_MoveAdditiveTriggStop : MC_BR_MoveAdditiveTriggStop := (0); (*Additive Movement with Trigger Stop*)
|
||||
Axis_MC_MoveVelocity : MC_MoveVelocity := (0); (*Continuous Movement with Cyclic Velocity*)
|
||||
AXis_MC_BR_MoveVelocityTriggStop : MC_BR_MoveVelocityTriggStop := (0); (*Continuous Movement with Cyclic Velocity and Trigger Stop*)
|
||||
Axis_MC_Power : MC_Power := (0);
|
||||
Axis_MC_ReadActualPosition : MC_ReadActualPosition := (0);
|
||||
Axis_MC_ReadActualTorque : MC_ReadActualTorque := (0);
|
||||
Axis_MC_ReadActualVelocity : MC_ReadActualVelocity := (0);
|
||||
Axis_MC_BR_ReadAxisError : MC_BR_ReadAxisError := (0);
|
||||
Axis_MC_ReadStatus : MC_ReadStatus := (0);
|
||||
Axis_MC_Reset : MC_Reset := (0);
|
||||
Axis_MC_SetOverride : MC_SetOverride := (0);
|
||||
Axis_MC_Stop : MC_Stop := (0);
|
||||
END_VAR
|
||||
(*//Further Parameter - Cyclic*)
|
||||
VAR
|
||||
Axis_MC_BR_CyclicRead : MC_BR_CyclicRead := (0); (*Read Further Axis Parameter*)
|
||||
Axis_MC_BR_CyclicWrite : MC_BR_CyclicWrite := (0);
|
||||
END_VAR
|
||||
(*//Further Parameter*)
|
||||
VAR
|
||||
Axis_MC_BR_ReadParID : MC_BR_ReadParID := (0); (*Read Furhter Axis Parameter*)
|
||||
END_VAR
|
||||
(*//ParemeterTrace*)
|
||||
VAR
|
||||
Axis_MC_BR_WriteParID : MC_BR_WriteParID := (0); (*USER_R4_VAR1 used for Trace*)
|
||||
END_VAR
|
||||
(*//-----------------------------------------------------------------------------------------------------*)
|
||||
(*//Dynamic Vars*)
|
||||
VAR
|
||||
lAxis : REFERENCE TO typAxis; (*Axis Datastruct *)
|
||||
lAxisActPos : REFERENCE TO REAL;
|
||||
lAxisMaster : REFERENCE TO typAxis;
|
||||
lbSimulation : REFERENCE TO BOOL;
|
||||
rUser_Var1 : REFERENCE TO REAL; (*Value for Cyclic transmission to Acopos*)
|
||||
END_VAR
|
||||
(*//-----------------------------------------------------------------------------------------------------*)
|
||||
(*//Constants*)
|
||||
VAR CONSTANT
|
||||
uiTORQUE_NOT_REACHED : UINT := 0;
|
||||
END_VAR
|
||||
(*//-----------------------------------------------------------------------------------------------------*)
|
||||
(*//Retain*)
|
||||
(*//-----------------------------------------------------------------------------------------------------*)
|
||||
(*//Local Vars*)
|
||||
VAR
|
||||
bAxisInit : BOOL := FALSE; (*Devel - Init Axis*)
|
||||
bDisableCommands : BOOL := FALSE;
|
||||
bHomeAbs : BOOL := FALSE; (*Devel - Home Absolue Encoder*)
|
||||
bTest : BOOL := FALSE;
|
||||
usCamTableID : USINT;
|
||||
uiRestartDelay : UINT := 2500; (*Wait Cycles after Cold restart*)
|
||||
uiAbsStatus : UINT;
|
||||
uiAxisUserVar1 : UINT := 0;
|
||||
uiMCReadError : UINT := 0; (*Error in MC_Read_Paramaeter*)
|
||||
uiMCWriteError : UINT := 0; (*Error in MC_Write_Paramaeter*)
|
||||
udAxisMasterObj : UDINT;
|
||||
udAxisSlaveObj : UDINT;
|
||||
udAxisObj : UDINT;
|
||||
udEnableTorqueLimit : UDINT := 0;
|
||||
rOldVelocity : REAL := 0.0;
|
||||
rOldTorquelimit : REAL := 0.0; (*//Used to Trigger Sending Value to Axis*)
|
||||
rUser_VarTemp : REAL := 0.0;
|
||||
TON_HomingOk : TON;
|
||||
END_VAR
|
||||
716
Logical/Axises/Axisctrl/AxisctrlCyclic.st
Normal file
716
Logical/Axises/Axisctrl/AxisctrlCyclic.st
Normal file
@@ -0,0 +1,716 @@
|
||||
PROGRAM _CYCLIC
|
||||
|
||||
IF (uiRestartDelay > 0) THEN
|
||||
uiRestartDelay := uiRestartDelay - 1;
|
||||
END_IF
|
||||
|
||||
|
||||
//Devel Axis Initialisation
|
||||
Axis_MC_BR_InitAxisPar.Axis := udAxisObj;
|
||||
Axis_MC_BR_InitAxisPar.Execute := bAxisInit;
|
||||
Axis_MC_BR_InitAxisPar ();
|
||||
IF Axis_MC_BR_InitAxisPar.Done THEN
|
||||
bAxisInit := FALSE;
|
||||
END_IF
|
||||
|
||||
//Devel Absolute Encoder Homing
|
||||
Axis_MC_ACP_ENCOD_REF.Slot := 3;
|
||||
|
||||
Axis_MC_ACP_ENCOD_PARAM_REF.HomingMode := mcHOME_ABSOLUTE;
|
||||
Axis_MC_ACP_ENCOD_PARAM_REF.Offset := 0;
|
||||
Axis_MC_ACP_ENCOD_PARAM_REF.ReadOffset := FALSE;
|
||||
|
||||
Axis_MC_BR_HomeAcpEncoder.Execute := bHomeAbs;
|
||||
Axis_MC_BR_HomeAcpEncoder.AcpEncoder := Axis_MC_ACP_ENCOD_REF;
|
||||
Axis_MC_BR_HomeAcpEncoder.HomingParameters := Axis_MC_ACP_ENCOD_PARAM_REF;
|
||||
Axis_MC_BR_HomeAcpEncoder ();
|
||||
|
||||
IF Axis_MC_BR_HomeAcpEncoder.Done THEN
|
||||
bHomeAbs := FALSE;
|
||||
END_IF
|
||||
|
||||
//Set Hardware inputs
|
||||
//Direct map IO
|
||||
Axis_MC_BR_SetHardwareInputs.Enable := lAxis.Para.bSetHWInputs;
|
||||
Axis_MC_BR_SetHardwareInputs ();
|
||||
|
||||
//get axis information
|
||||
Axis_MC_BR_AxisErrorCollector ();
|
||||
|
||||
(***********************CHECK FOR ERRORS**************************)
|
||||
IF (lAxis.enStep < enAxSTATE_STOP_AFTER_ERROR) THEN
|
||||
IF (Axis_MC_BR_AxisErrorCollector.Errorstop) THEN
|
||||
lAxis.enStep := enAxSTATE_ERROR;
|
||||
ELSIF (Axis_MC_BR_AxisErrorCollector.FunctionBlockError) OR
|
||||
(Axis_MC_BR_AxisErrorCollector.AxisError) OR
|
||||
(Axis_MC_BR_AxisErrorCollector.AxisWarning) THEN
|
||||
lAxis.enStep := enAxSTATE_STOP_AFTER_ERROR;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
Axis_MC_BR_ReadAxisError ();
|
||||
|
||||
Axis_MC_ReadStatus ();
|
||||
IF Axis_MC_ReadStatus.Valid THEN
|
||||
lAxis.Status.bDisabled := Axis_MC_ReadStatus.Disabled;
|
||||
lAxis.Status.bStandstill := Axis_MC_ReadStatus.StandStill;
|
||||
lAxis.Status.bStopping := Axis_MC_ReadStatus.Stopping;
|
||||
lAxis.Status.bHoming := Axis_MC_ReadStatus.Homing;
|
||||
lAxis.Status.bMotionDiscrete := Axis_MC_ReadStatus.DiscreteMotion;
|
||||
lAxis.Status.bMotionContinous := Axis_MC_ReadStatus.ContinuousMotion;
|
||||
lAxis.Status.bMotionSynchronized := Axis_MC_ReadStatus.SynchronizedMotion;
|
||||
lAxis.Status.bErrorstop := Axis_MC_ReadStatus.Errorstop;
|
||||
END_IF
|
||||
|
||||
Axis_MC_BR_ReadDriveStatus ();
|
||||
TON_HomingOk.IN := lAxis.DriveStatus.bHomingOk AND NOT lAxis.Status.bHoming;
|
||||
IF EDGEPOS (lAxis.bHome) THEN
|
||||
TON_HomingOk.IN := FALSE;
|
||||
END_IF
|
||||
TON_HomingOk.PT := t#50ms;
|
||||
TON_HomingOk ();
|
||||
lAxis.Status.bHomingOkDelayed := TON_HomingOk.Q;
|
||||
|
||||
//Position
|
||||
Axis_MC_ReadActualPosition ();
|
||||
IF Axis_MC_ReadActualPosition.Valid THEN
|
||||
lAxis.rActPosition := Axis_MC_ReadActualPosition.Position;
|
||||
lAxisActPos := lAxis.rActPosition;
|
||||
END_IF
|
||||
|
||||
//Velocity
|
||||
Axis_MC_ReadActualVelocity ();
|
||||
IF Axis_MC_ReadActualVelocity.Valid THEN
|
||||
lAxis.rActVelocity := Axis_MC_ReadActualVelocity.Velocity;
|
||||
END_IF
|
||||
|
||||
//Torque
|
||||
IF lbSimulation OR lAxis.DriveStatus.bSimulation OR lAxis.bVAxis THEN
|
||||
Axis_MC_ReadActualTorque.Enable := FALSE; //Disable for Simulation (not Possible)
|
||||
END_IF
|
||||
Axis_MC_ReadActualTorque ();
|
||||
IF Axis_MC_ReadActualTorque.Valid THEN
|
||||
lAxis.rActTorque := Axis_MC_ReadActualTorque.Torque;
|
||||
END_IF
|
||||
|
||||
//Power OFF
|
||||
IF NOT lAxis.bPower AND lAxis.DriveStatus.bControllerStatus THEN
|
||||
lAxis.enStep := enAxSTATE_POWER_OFF;
|
||||
END_IF
|
||||
|
||||
CASE lAxis.enStep OF
|
||||
//==============================================
|
||||
//WAIT
|
||||
enAxSTATE_WAIT:
|
||||
//IF lAxis.Status.bDisabled AND lbSimulation AND NOT lAxis.DriveStatus.bSimulation THEN
|
||||
// lAxis.enStep := enAxSTATE_SIMULATION_ON;
|
||||
//ELSIF lAxis.Status.bDisabled AND NOT lbSimulation AND lAxis.DriveStatus.bSimulation THEN
|
||||
// lAxis.enStep := enAxSTATE_SIMULATION_OFF;
|
||||
IF lAxis.bPower THEN
|
||||
lAxis.enStep := enAxSTATE_POWER_ON;
|
||||
ELSE
|
||||
bDisableCommands := TRUE;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Simulation On
|
||||
enAxSTATE_SIMULATION_ON:
|
||||
Axis_MC_BR_Simulation.Execute := 1;
|
||||
Axis_MC_BR_Simulation.SimulationCommand := mcMOTOR;
|
||||
|
||||
IF Axis_MC_BR_Simulation.Done THEN
|
||||
Axis_MC_BR_Simulation.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_WAIT;
|
||||
ELSIF (Axis_MC_BR_Simulation.ErrorID <> 0) THEN
|
||||
lAxis.enStep := enAxSTATE_ERROR;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Simulation Off
|
||||
enAxSTATE_SIMULATION_OFF;
|
||||
Axis_MC_BR_Simulation.Execute := 1;
|
||||
Axis_MC_BR_Simulation.SimulationCommand := mcSIMULATION_OFF;
|
||||
|
||||
IF Axis_MC_BR_Simulation.Done THEN
|
||||
Axis_MC_BR_Simulation.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_WAIT;
|
||||
ELSIF (Axis_MC_BR_Simulation.ErrorID <> 0) THEN
|
||||
lAxis.enStep := enAxSTATE_ERROR;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Power On
|
||||
enAxSTATE_POWER_ON:
|
||||
Axis_MC_Power.Enable := TRUE;
|
||||
|
||||
IF Axis_MC_Power.Status THEN
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
ELSIF (Axis_MC_Power.ErrorID <> 0) THEN
|
||||
lAxis.enStep := enAxSTATE_ERROR;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Power Off
|
||||
enAxSTATE_POWER_OFF:
|
||||
Axis_MC_Power.Enable := FALSE;
|
||||
|
||||
IF Axis_MC_Power.Status THEN
|
||||
lAxis.enStep := enAxSTATE_WAIT;
|
||||
ELSIF (Axis_MC_Power.ErrorID <> 0) THEN
|
||||
lAxis.enStep := enAxSTATE_ERROR;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Ready, wait for commands
|
||||
enAxSTATE_READY:
|
||||
IF lAxis.bStop THEN
|
||||
lAxis.bStop := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
ELSIF lAxis.bHome THEN
|
||||
lAxis.enStep := enAxSTATE_HOME;
|
||||
ELSIF lAxis.Move.bBraketest THEN
|
||||
lAxis.Move.bBraketest := 0;
|
||||
lAxis.enStep := enAxSTATE_BRAKE_TEST;
|
||||
ELSIF lAxis.Move.bJogPos OR lAxis.Move.bJogNeg THEN
|
||||
//Movement will stopped when command is resetted
|
||||
lAxis.enStep := enAxSTATE_JOG;
|
||||
ELSIF lAxis.Move.bAbsolute AND NOT lAxis.Para.bTriggStop THEN
|
||||
//Movement will stopped when command is resetted
|
||||
lAxis.enStep := enAxSTATE_MOVE_ABSOLUTE;
|
||||
ELSIF lAxis.Move.bAbsolute AND lAxis.Para.bTriggStop THEN
|
||||
//Movement will stopped when command is resetted
|
||||
lAxis.enStep := enAxSTATE_MOVE_ABSOLUTE_TRIGSTP;
|
||||
ELSIF lAxis.Move.bAdditive AND NOT lAxis.Para.bTriggStop THEN
|
||||
//Movement will stopped when command is resetted
|
||||
lAxis.enStep := enAxSTATE_MOVE_ADDITIVE;
|
||||
ELSIF lAxis.Move.bAdditive AND lAxis.Para.bTriggStop THEN
|
||||
//Movement will stopped when command is resetted
|
||||
lAxis.enStep := enAxSTATE_MOVE_ADDITIVE_TRIGSTP;
|
||||
ELSIF lAxis.Move.bVelocity THEN
|
||||
lAxis.Move.bVelocity := 0;
|
||||
lAxis.Status.bTorqueLimitReached := 0;
|
||||
lAxis.enStep := enAxSTATE_MOVE_VELOCITY;
|
||||
ELSIF lAxis.Move.bVelocityControl THEN
|
||||
lAxis.Move.bVelocityControl := 0;
|
||||
lAxis.Status.bTorqueLimitReached := 0;
|
||||
lAxis.enStep := enAxSTATE_MOVE_VELOCITY_CTRL;
|
||||
ELSIF lAxis.Move.bTorqueControl THEN
|
||||
lAxis.Move.bTorqueControl := 0;
|
||||
lAxis.Status.bTorqueLimitReached := 0;
|
||||
lAxis.enStep := enAxSTATE_MOVE_TORQUE_CTRL;
|
||||
ELSIF lAxis.Move.bStartGearSlave THEN
|
||||
lAxis.Move.bStartGearSlave := 0;
|
||||
lAxis.enStep := enAxSTATE_MOVE_GEAR_START;
|
||||
ELSIF lAxis.Move.bStartGearPosSlave THEN
|
||||
lAxis.Move.bStartGearSlave := 0;
|
||||
lAxis.enStep := enAxSTATE_MOVE_GEARPOS_START;
|
||||
ELSIF lAxis.Move.bStopGearSlave THEN
|
||||
lAxis.Move.bStopGearSlave := 0;
|
||||
lAxis.enStep := enAxSTATE_MOVE_GEAR_STOP;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Drive Home
|
||||
enAxSTATE_HOME:
|
||||
Axis_MC_Home.Position := lAxis.Para.rHomePosition;
|
||||
Axis_MC_Home.HomingMode := lAxis.Para.usHomeingMode;
|
||||
Axis_MC_Home.Execute := 1;
|
||||
IF lAxis.bStop THEN
|
||||
Axis_MC_Home.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
lAxis.bHome := 0;
|
||||
ELSIF Axis_MC_Home.Done AND (lAxis.Para.udAxisModPosFactor > 0) AND (lAxis.Para.udAxisModPosPeriod > 0) THEN
|
||||
Axis_MC_Home.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_INIT_MOD_POS;
|
||||
lAxis.bHome := 0;
|
||||
ELSIF Axis_MC_Home.Done THEN
|
||||
Axis_MC_Home.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
lAxis.bHome := 0;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Test Brake
|
||||
enAxSTATE_BRAKE_TEST:
|
||||
Axis_MC_BR_BrakeControl.Command := mcBRAKE_TEST_START;
|
||||
Axis_MC_BR_BrakeControl.Configuration.BrakeTest.PositionLimit := lAxis.Para.rBraketestPosLimit;
|
||||
Axis_MC_BR_BrakeControl.Configuration.BrakeTest.TestTorque := lAxis.Para.rBraketestTorque;
|
||||
Axis_MC_BR_BrakeControl.Execute := 1;
|
||||
IF lAxis.bStop THEN
|
||||
Axis_MC_BR_BrakeControl.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
ELSIF Axis_MC_Home.Done THEN
|
||||
Axis_MC_BR_BrakeControl.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Initialize Modulo Position
|
||||
enAxSTATE_INIT_MOD_POS:
|
||||
Axis_MC_BR_InitModPos.Factor := lAxis.Para.udAxisModPosFactor;
|
||||
Axis_MC_BR_InitModPos.Period := lAxis.Para.udAxisModPosPeriod;
|
||||
Axis_MC_BR_InitModPos.Execute := 1;
|
||||
|
||||
IF Axis_MC_BR_InitModPos.Done THEN
|
||||
Axis_MC_BR_InitModPos.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Stop Movement (as long as Stop Command is set)
|
||||
enAxSTATE_STOP:
|
||||
Axis_MC_Stop.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_Stop.Execute := 1;
|
||||
|
||||
IF Axis_MC_Stop.Done AND NOT lAxis.bStop THEN
|
||||
Axis_MC_Stop.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
END_IF
|
||||
|
||||
IF (Axis_MC_Stop.Error OR Axis_MC_Stop.CommandAborted) AND NOT lAxis.bStop THEN
|
||||
Axis_MC_Stop.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
END_IF
|
||||
|
||||
|
||||
//==============================================
|
||||
//Jog Positive
|
||||
enAxSTATE_JOG:
|
||||
Axis_MC_BR_JogVelocity.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_BR_JogVelocity.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_BR_JogVelocity.Velocity := lAxis.Para.rJogVelocity;
|
||||
Axis_MC_BR_JogVelocity.JogPositive := lAxis.Move.bJogPos;
|
||||
Axis_MC_BR_JogVelocity.JogNegative := lAxis.Move.bJogNeg;
|
||||
Axis_MC_BR_JogVelocity.Enable := (lAxis.Para.JogMode = enAxJOG);
|
||||
|
||||
Axis_MC_BR_JogLimitPosition.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_BR_JogLimitPosition.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_BR_JogLimitPosition.Velocity := lAxis.Para.rJogVelocity;
|
||||
Axis_MC_BR_JogLimitPosition.JogPositive := lAxis.Move.bJogPos;
|
||||
Axis_MC_BR_JogLimitPosition.JogNegative := lAxis.Move.bJogNeg;
|
||||
Axis_MC_BR_JogLimitPosition.FirstPosition := lAxis.Para.rJogLimitLow;
|
||||
Axis_MC_BR_JogLimitPosition.LastPosition := lAxis.Para.rJogLimitHigh;
|
||||
Axis_MC_BR_JogLimitPosition.Enable := (lAxis.Para.JogMode = enAxJOG_Limits);
|
||||
|
||||
Axis_MC_BR_JogTargetPosition.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_BR_JogTargetPosition.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_BR_JogTargetPosition.Velocity := lAxis.Para.rJogVelocity;
|
||||
Axis_MC_BR_JogTargetPosition.TargetPosition:= lAxis.Para.rPosition;
|
||||
Axis_MC_BR_JogTargetPosition.JogToTarget := lAxis.Move.bJogPos OR lAxis.Move.bJogNeg;
|
||||
Axis_MC_BR_JogTargetPosition.JogPositive := FALSE;
|
||||
Axis_MC_BR_JogTargetPosition.JogNegative := FALSE;
|
||||
Axis_MC_BR_JogTargetPosition.Enable := (lAxis.Para.JogMode = enAxJOG_Target);
|
||||
|
||||
IF (NOT lAxis.Move.bJogPos AND NOT lAxis.Move.bJogNeg) OR lAxis.bStop THEN
|
||||
Axis_MC_BR_JogVelocity.Enable := 0;
|
||||
Axis_MC_BR_JogLimitPosition.Enable := 0;
|
||||
Axis_MC_BR_JogTargetPosition.Enable := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Move Absolute
|
||||
enAxSTATE_MOVE_ABSOLUTE:
|
||||
Axis_MC_MoveAbsolute.Position := lAxis.Para.rPosition;
|
||||
Axis_MC_MoveAbsolute.Velocity := lAxis.Para.rVelocity;
|
||||
Axis_MC_MoveAbsolute.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_MoveAbsolute.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_MoveAbsolute.Direction := lAxis.Para.usDirection; //Interesting on Periodic Axises
|
||||
Axis_MC_MoveAbsolute.Execute := 1;
|
||||
|
||||
IF lAxis.bStop OR NOT lAxis.Move.bAbsolute THEN
|
||||
;lAxis.bStop := 0;
|
||||
Axis_MC_MoveAbsolute.Execute := 0;
|
||||
lAxis.Move.bAbsolute := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
ELSIF Axis_MC_MoveAbsolute.Done THEN
|
||||
Axis_MC_MoveAbsolute.Execute := 0;
|
||||
lAxis.Move.bAbsolute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Move Absolute (Stopp with Trigger
|
||||
enAxSTATE_MOVE_ABSOLUTE_TRIGSTP:
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Position := lAxis.Para.rPosition;
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Velocity := lAxis.Para.rVelocity;
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Direction := lAxis.Para.usDirection; //Interesting on Periodic Axises
|
||||
//Triggerinput is configured in Init Up
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.TriggerDistance := lAxis.Para.rTriggDistance;
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.ForceTriggerDistance := mcOFF; // --> force Trigger Dist even if Dest Pos is Exeeded
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Execute := 1;
|
||||
|
||||
IF lAxis.bStop OR NOT lAxis.Move.bAbsolute THEN
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Execute := 0;
|
||||
lAxis.Move.bAbsolute := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
ELSIF Axis_MC_BR_MoveAbsoluteTriggStop.Done THEN
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Execute := 0;
|
||||
lAxis.Move.bAbsolute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Move Additive
|
||||
enAxSTATE_MOVE_ADDITIVE:
|
||||
Axis_MC_MoveAdditive.Distance := lAxis.Para.rDistance;
|
||||
Axis_MC_MoveAdditive.Velocity := lAxis.Para.rVelocity;
|
||||
Axis_MC_MoveAdditive.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_MoveAdditive.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_MoveAdditive.Execute := 1;
|
||||
|
||||
IF lAxis.bStop OR NOT lAxis.Move.bAdditive THEN
|
||||
lAxis.Move.bAdditive := 0;
|
||||
Axis_MC_MoveAdditive.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
ELSIF Axis_MC_MoveAdditive.Done THEN
|
||||
lAxis.Move.bAdditive := 0;
|
||||
Axis_MC_MoveAdditive.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Move Additive
|
||||
enAxSTATE_MOVE_ADDITIVE_TRIGSTP:
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.Distance := lAxis.Para.rDistance;
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.Velocity := lAxis.Para.rVelocity;
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.Deceleration := lAxis.Para.rDeceleration;
|
||||
//Triggerinput is configured in Init Up
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.TriggerDistance := lAxis.Para.rTriggDistance;
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.ForceTriggerDistance := mcOFF; // --> force Trigger Dist even if Dest Pos is Exeeded
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.Execute := 1;
|
||||
|
||||
IF lAxis.bStop OR NOT lAxis.Move.bAdditive THEN
|
||||
lAxis.Move.bAdditive := 0;
|
||||
Axis_MC_MoveAdditive.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
ELSIF Axis_MC_BR_MoveAdditiveTriggStop.Done THEN
|
||||
lAxis.Move.bAdditive := 0;
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Move Velocity
|
||||
enAxSTATE_MOVE_VELOCITY:
|
||||
Axis_MC_MoveVelocity.Velocity := lAxis.Para.rVelocity;
|
||||
Axis_MC_MoveVelocity.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_MoveVelocity.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_MoveVelocity.Direction := lAxis.Para.usDirection;
|
||||
Axis_MC_MoveVelocity.Execute := 1;
|
||||
|
||||
IF lAxis.bStop THEN
|
||||
Axis_MC_MoveVelocity.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Move Velocity Control (Only POWERLINK)
|
||||
//FixMe just prepared
|
||||
enAxSTATE_MOVE_VELOCITY_CTRL:
|
||||
Axis_MC_BR_VelocityControl.CyclicVelocityCorrection := 0;
|
||||
Axis_MC_BR_VelocityControl.CyclicVelocity := lAxis.Para.rVelocity;
|
||||
Axis_MC_BR_VelocityControl.CyclicTorque := lAxis.Para.rTorqueLimit;
|
||||
Axis_MC_BR_VelocityControl.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_BR_VelocityControl.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_BR_VelocityControl.TorqueMode := mcLIMIT;
|
||||
Axis_MC_BR_VelocityControl.Enable := 1;
|
||||
|
||||
//==============================================
|
||||
//Move Torque Control
|
||||
enAxSTATE_MOVE_TORQUE_CTRL:
|
||||
Axis_MC_BR_TorqueControl.StartSignal := NOT lAxis.bStop;
|
||||
Axis_MC_BR_TorqueControl.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_BR_TorqueControl.PosMaxVelocity := lAxis.Para.rVelocity;
|
||||
Axis_MC_BR_TorqueControl.NegMaxVelocity := -lAxis.Para.rVelocity;
|
||||
Axis_MC_BR_TorqueControl.Mode := mcCHECK_HOMING_OFF;
|
||||
//mcV_LIMIT_OFF; //(No Speed Limit)
|
||||
//mcV_LIMIT_CALC; //(No Speed Overrrun)
|
||||
//mcTIME_LIMIT; //(Enable Timelimit)
|
||||
Axis_MC_BR_TorqueControl.TimeLimit := 0;
|
||||
Axis_MC_BR_TorqueControl.StartParID := 0; //Not Used by now
|
||||
Axis_MC_BR_TorqueControl.TorqueRamp := 0; //Ramp Disabled
|
||||
Axis_MC_BR_TorqueControl.Torque := lAxis.Para.rTorqueLimit;
|
||||
//Axis_MC_BR_TorqueControl.TorqueParID := 0; //Alternative Torque Source
|
||||
Axis_MC_BR_TorqueControl.Enable := 1;
|
||||
|
||||
//Trigger Parameter rewrite
|
||||
Axis_MC_BR_TorqueControl.InitData := (lAxis.Para.rVelocity <> rOldVelocity) OR
|
||||
(lAxis.Para.rTorqueLimit <> rOldTorquelimit);
|
||||
rOldVelocity := lAxis.Para.rVelocity;
|
||||
rOldTorquelimit := lAxis.Para.rTorqueLimit;
|
||||
|
||||
lAxis.Status.bTorqueLimitReached := Axis_MC_BR_TorqueControl.InTorque AND
|
||||
NOT Axis_MC_BR_TorqueControl.AxisLimitActive;
|
||||
|
||||
IF lAxis.bStop THEN
|
||||
Axis_MC_BR_TorqueControl.Enable := 0;
|
||||
lAxis.Status.bTorqueLimitReached := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Move GEAR START
|
||||
enAxSTATE_MOVE_GEAR_START:
|
||||
Axis_MC_GearIn.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_GearIn.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_GearIn.RatioNumerator := lAxis.Para.iGearRatioNumerator;
|
||||
Axis_MC_GearIn.RatioDenominator := lAxis.Para.uiGearRatioDenominator;
|
||||
Axis_MC_GearIn.Execute := 1;
|
||||
|
||||
IF Axis_MC_GearIn.InGear THEN
|
||||
Axis_MC_GearIn.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
ELSIF lAxis.bStop THEN
|
||||
Axis_MC_GearIn.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
ELSIF lAxis.Move.bStopGearSlave THEN
|
||||
lAxis.Move.bStopGearSlave := 0;
|
||||
Axis_MC_GearIn.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_MOVE_GEAR_STOP;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Move GEAR POS START
|
||||
enAxSTATE_MOVE_GEARPOS_START:
|
||||
Axis_MC_GearInPos.Acceleration := lAxis.Para.rAcceleration;
|
||||
Axis_MC_GearInPos.RatioNumerator := lAxis.Para.iGearRatioNumerator;
|
||||
Axis_MC_GearInPos.RatioDenominator := lAxis.Para.uiGearRatioDenominator;
|
||||
Axis_MC_GearInPos.MasterSyncPosition := lAxis.Para.rGearMasterSyncPos;
|
||||
Axis_MC_GearInPos.SlaveSyncPosition := lAxis.Para.rGearSlaveSyncPos;
|
||||
Axis_MC_GearInPos.Velocity := lAxis.Para.rGearSyncVelocity;
|
||||
Axis_MC_GearInPos.Acceleration := lAxis.Para.rGearSyncAcceleration;
|
||||
Axis_MC_GearInPos.SyncMode := mcSHORTEST_WAY;
|
||||
Axis_MC_GearInPos.Execute := 1;
|
||||
|
||||
IF Axis_MC_GearInPos.InSync THEN
|
||||
Axis_MC_GearIn.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
ELSIF lAxis.bStop THEN
|
||||
Axis_MC_GearInPos.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_STOP;
|
||||
ELSIF lAxis.Move.bStopGearSlave THEN
|
||||
lAxis.Move.bStopGearSlave := 0;
|
||||
Axis_MC_GearInPos.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_MOVE_GEAR_STOP;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Move GEAR STOP
|
||||
enAxSTATE_MOVE_GEAR_STOP:
|
||||
Axis_MC_GearOut.Execute := 1;
|
||||
|
||||
IF Axis_MC_GearOut.Done THEN
|
||||
Axis_MC_GearOut.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_READY;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Stop after an Error
|
||||
enAxSTATE_STOP_AFTER_ERROR:
|
||||
|
||||
IF (lAxis.Status.bMotionContinous) OR
|
||||
(lAxis.Status.bMotionDiscrete) OR
|
||||
(lAxis.Status.bMotionSynchronized) OR
|
||||
(lAxis.Status.bHoming) THEN
|
||||
Axis_MC_Stop.Deceleration := lAxis.Para.rDeceleration;
|
||||
Axis_MC_Stop.Execute := TRUE;
|
||||
IF Axis_MC_Stop.Done OR Axis_MC_Stop.Error THEN
|
||||
Axis_MC_Stop.Execute := FALSE;
|
||||
lAxis.enStep := enAxSTATE_ERROR;
|
||||
END_IF
|
||||
ELSE
|
||||
lAxis.enStep := enAxSTATE_ERROR;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Error
|
||||
enAxSTATE_ERROR:
|
||||
bDisableCommands := TRUE;
|
||||
IF Axis_MC_BR_ReadAxisError.Valid THEN
|
||||
IF (Axis_MC_BR_ReadAxisError.ErrorRecord.Number <> 0) THEN
|
||||
lAxis.Error.uiID := Axis_MC_BR_ReadAxisError.ErrorRecord.Number;
|
||||
END_IF
|
||||
|
||||
IF lAxis.Error.bAcknowledge THEN
|
||||
lAxis.Error.bAcknowledge := FALSE;
|
||||
IF (Axis_MC_BR_ReadAxisError.ErrorRecord.Number <> 0) THEN
|
||||
Axis_MC_BR_ReadAxisError.Acknowledge:=TRUE;
|
||||
END_IF
|
||||
lAxis.enStep := enAxSTATE_ERROR_CHECK;
|
||||
END_IF
|
||||
|
||||
ELSIF (Axis_MC_BR_ReadAxisError.ErrorID = 29294) THEN
|
||||
IF lAxis.Error.bAcknowledge THEN
|
||||
lAxis.Error.bAcknowledge := FALSE;
|
||||
lAxis.enStep := enAxSTATE_ERROR_RESET;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
|
||||
//==============================================
|
||||
//Error Axis
|
||||
enAxSTATE_ERROR_CHECK:
|
||||
IF (Axis_MC_BR_ReadAxisError.Valid) THEN
|
||||
IF (Axis_MC_BR_ReadAxisError.ErrorRecord.Number = 0) THEN
|
||||
lAxis.Error.uiID := 0;
|
||||
(* reset axis state IF the axis is in state ErrorStop *)
|
||||
IF lAxis.Status.bErrorstop AND Axis_MC_ReadStatus.Valid THEN
|
||||
lAxis.enStep := enAxSTATE_ERROR_RESET;
|
||||
ELSE
|
||||
lAxis.enStep := enAxSTATE_WAIT;
|
||||
END_IF
|
||||
ELSE
|
||||
lAxis.enStep := enAxSTATE_ERROR;
|
||||
END_IF
|
||||
Axis_MC_BR_ReadAxisError.Acknowledge := FALSE;
|
||||
END_IF
|
||||
|
||||
//==============================================
|
||||
//Reset DONE
|
||||
enAxSTATE_ERROR_RESET:
|
||||
Axis_MC_Reset.Execute := 1;
|
||||
|
||||
IF Axis_MC_Power.Error THEN
|
||||
Axis_MC_Power.Enable := 0;
|
||||
END_IF
|
||||
|
||||
IF Axis_MC_Reset.Done THEN
|
||||
Axis_MC_Reset.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_WAIT;
|
||||
ELSIF (Axis_MC_Reset.ErrorID <> 0) THEN
|
||||
lAxis.Error.uiID := Axis_MC_Reset.ErrorID;
|
||||
Axis_MC_Reset.Execute := 0;
|
||||
lAxis.enStep := enAxSTATE_ERROR;
|
||||
END_IF
|
||||
END_CASE
|
||||
|
||||
|
||||
IF bDisableCommands THEN
|
||||
//reset power
|
||||
Axis_MC_Power.Enable := 0;
|
||||
//reset all fb execute inputs we use
|
||||
Axis_MC_Home.Execute := 0;
|
||||
Axis_MC_BR_BrakeControl.Execute := 0;
|
||||
Axis_MC_BR_Simulation.Execute := 0;
|
||||
Axis_MC_Stop.Execute := 0;
|
||||
Axis_MC_MoveAbsolute.Execute := 0;
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Execute := 0;
|
||||
Axis_MC_MoveAdditive.Execute := 0;
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.Execute := 0;
|
||||
Axis_MC_MoveVelocity.Execute := 0;
|
||||
Axis_MC_MoveVelocity.Execute := 0;
|
||||
Axis_MC_BR_VelocityControl.Enable := 0;
|
||||
Axis_MC_BR_TorqueControl.Enable := 0;
|
||||
Axis_MC_GearIn.Execute := 0;
|
||||
Axis_MC_GearInPos.Execute := 0;
|
||||
Axis_MC_GearOut.Execute := 0;
|
||||
Axis_MC_Reset.Execute := 0;
|
||||
|
||||
//reset user commands
|
||||
lAxis.bStop := 0;
|
||||
lAxis.bHome := 0;
|
||||
lAxis.Move.bBraketest := 0;
|
||||
lAxis.Move.bJogPos := 0;
|
||||
lAxis.Move.bJogNeg := 0;
|
||||
lAxis.Move.bVelocity := 0;
|
||||
lAxis.Move.bVelocityControl := 0;
|
||||
lAxis.Move.bAbsolute := 0;
|
||||
lAxis.Move.bAdditive := 0;
|
||||
lAxis.Move.bTorqueControl := 0;
|
||||
lAxis.Move.bStartGearSlave := 0;
|
||||
lAxis.Move.bStartGearPosSlave := 0;
|
||||
lAxis.Move.bStopGearSlave := 0;
|
||||
|
||||
bDisableCommands := FALSE;
|
||||
END_IF
|
||||
|
||||
//--------------------------------------------
|
||||
//Override Velocity and Acceleration
|
||||
Axis_MC_SetOverride.Enable := (lAxis.Para.rOverrideVelocity <> 1.0) OR (lAxis.Para.rOverrideAcceleration <> 1.0);
|
||||
Axis_MC_SetOverride.VelFactor := lAxis.Para.rOverrideVelocity;
|
||||
Axis_MC_SetOverride.AccFactor := lAxis.Para.rOverrideAcceleration;
|
||||
Axis_MC_SetOverride ();
|
||||
|
||||
//--------------------------------------------
|
||||
//Call Function Blocks
|
||||
Axis_MC_Power ();
|
||||
Axis_MC_BR_Simulation ();
|
||||
Axis_MC_Home ();
|
||||
Axis_MC_BR_BrakeControl ();
|
||||
Axis_MC_BR_InitModPos();
|
||||
Axis_MC_BR_JogVelocity ();
|
||||
Axis_MC_BR_JogLimitPosition ();
|
||||
Axis_MC_BR_JogTargetPosition ();
|
||||
Axis_MC_MoveAbsolute ();
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop();
|
||||
Axis_MC_MoveAdditive ();
|
||||
Axis_MC_BR_MoveAdditiveTriggStop ();
|
||||
Axis_MC_MoveVelocity ();
|
||||
AXis_MC_BR_MoveVelocityTriggStop ();
|
||||
Axis_MC_GearIn ();
|
||||
Axis_MC_GearInPos ();
|
||||
Axis_MC_GearOut ();
|
||||
Axis_MC_Stop ();
|
||||
Axis_MC_Reset ();
|
||||
Axis_MC_BR_TorqueControl ();
|
||||
|
||||
|
||||
//--------------------------------------------
|
||||
//Cyclic Parameter Read
|
||||
Axis_MC_BR_CyclicRead.Enable := 0;
|
||||
//Axis_MC_BR_CyclicRead.ParID ;= 4160 ; 4160 User Variable0 I2
|
||||
//Axis_MC_BR_CyclicRead.DataAddress = adr ()
|
||||
//Axis_MC_BR_CyclicRead.DataType = ncPAR_TYP_INT
|
||||
Axis_MC_BR_CyclicRead ();
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
//Read individual Parameter
|
||||
|
||||
IF Axis_MC_BR_ReadParID.Done THEN
|
||||
END_IF
|
||||
IF Axis_MC_BR_ReadParID.Error THEN
|
||||
uiMCReadError := Axis_MC_BR_ReadParID.ErrorID;
|
||||
END_IF
|
||||
Axis_MC_BR_ReadParID.Execute := 0;
|
||||
Axis_MC_BR_ReadParID.ParID := 4128;
|
||||
Axis_MC_BR_ReadParID.DataAddress := ADR (lAxis);
|
||||
Axis_MC_BR_ReadParID.DataType := ncPAR_TYP_REAL;
|
||||
Axis_MC_BR_ReadParID ();
|
||||
|
||||
|
||||
//--------------------------------------------
|
||||
//Write individual Parameter
|
||||
|
||||
//Write UserParam1 on change
|
||||
(*
|
||||
rUser_Var1 access lAxis.Para.udAdrParamUserVar1
|
||||
if (rUser_VarTemp <> rUser_Var1) and\
|
||||
not Axis_MC_BR_WriteParID.Busy then
|
||||
Axis_MC_BR_WriteParID.Execute = 1
|
||||
rUser_VarTemp = rUser_Var1
|
||||
END_IF
|
||||
if Axis_MC_BR_WriteParID.Done or Axis_MC_BR_WriteParID.Error then
|
||||
if Axis_MC_BR_WriteParID.Error then
|
||||
uiMCWriteError = Axis_MC_BR_WriteParID.ErrorID
|
||||
END_IF
|
||||
Axis_MC_BR_WriteParID.Execute := 0;
|
||||
END_IF
|
||||
Axis_MC_BR_WriteParID.ParID = 586 ;USER_R4_VAR1
|
||||
Axis_MC_BR_WriteParID.DataAddress = adr (rUser_VarTemp)
|
||||
Axis_MC_BR_WriteParID.DataType = ncPAR_TYP_REAL
|
||||
Axis_MC_BR_WriteParID fub MC_BR_WriteParID ()
|
||||
*)
|
||||
|
||||
//-----------------------------------------------
|
||||
//Cyclick write of Parameter
|
||||
Axis_MC_BR_CyclicWrite.Enable := 0;
|
||||
Axis_MC_BR_CyclicWrite.DataAddress := ADR (rUser_VarTemp);
|
||||
Axis_MC_BR_CyclicWrite.DataType := ncPAR_TYP_REAL;
|
||||
Axis_MC_BR_CyclicWrite.ParID := 586; //USER_R4_VAR1
|
||||
Axis_MC_BR_CyclicWrite ();
|
||||
END_PROGRAM
|
||||
90
Logical/Axises/Axisctrl/AxisctrlInit.st
Normal file
90
Logical/Axises/Axisctrl/AxisctrlInit.st
Normal file
@@ -0,0 +1,90 @@
|
||||
|
||||
PROGRAM _INIT
|
||||
(* init program *)
|
||||
//Which Axis
|
||||
lAxis ACCESS ADR (gAxis[0]);
|
||||
lAxisActPos ACCESS ADR (gAxisActPos[0]);
|
||||
lAxisMaster ACCESS ADR (gAxis[0]);
|
||||
lbSimulation ACCESS ADR (gMachine.bSimulation);
|
||||
rUser_Var1 ACCESS ADR (grDummy);
|
||||
lAxis.bVAxis := FALSE;
|
||||
|
||||
//Configure Trigger for Triggermovements (Absolute/Additive/Velocity)
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.TriggerInput.InputSource := ncTRIGGER1; //ncTrigger2
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.TriggerInput.Edge := ncP_EDGE; //ncN_Edge
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.TriggerInput.InputSource := ncTRIGGER1; //ncTrigger2
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.TriggerInput.Edge := ncP_EDGE; //ncN_Edge
|
||||
AXis_MC_BR_MoveVelocityTriggStop.TriggerInput.InputSource := ncTRIGGER1; //ncTrigger2
|
||||
AXis_MC_BR_MoveVelocityTriggStop.TriggerInput.Edge := ncP_EDGE; //ncN_Edge
|
||||
|
||||
//Access global ACP10 Axis Objects
|
||||
udAxisObj := ADR (gAxShaft1);
|
||||
//This Axis is always slave (in case OF CAM/Gear)
|
||||
udAxisMasterObj := ADR (gAxShaft1);
|
||||
udAxisSlaveObj := udAxisObj;
|
||||
|
||||
//Initial Step
|
||||
lAxis.enStep := enAxSTATE_WAIT;
|
||||
|
||||
|
||||
//Overhand Axis Obj to FunctionBlocks
|
||||
Axis_MC_BR_AxisErrorCollector.Axis := udAxisObj;
|
||||
Axis_MC_BR_ReadDriveStatus.Axis := udAxisObj;
|
||||
Axis_MC_BR_ReadDriveStatus.AdrDriveStatus := ADR (lAxis.DriveStatus);
|
||||
Axis_MC_BR_JogVelocity.Axis := udAxisObj;
|
||||
Axis_MC_BR_JogLimitPosition.Axis := udAxisObj;
|
||||
Axis_MC_BR_JogTargetPosition.Axis := udAxisObj;
|
||||
Axis_MC_BR_Simulation.Axis := udAxisObj;
|
||||
Axis_MC_BR_SetHardwareInputs.Axis := udAxisObj;
|
||||
Axis_MC_BR_TorqueControl.Axis := udAxisObj;
|
||||
Axis_MC_BR_VelocityControl.Axis := udAxisObj;
|
||||
Axis_MC_ACP_ENCOD_REF.Axis := udAxisObj;
|
||||
Axis_MC_GearIn.Master := udAxisMasterObj;
|
||||
Axis_MC_GearIn.Slave := udAxisSlaveObj;
|
||||
Axis_MC_GearInPos.Master := udAxisMasterObj;
|
||||
Axis_MC_GearInPos.Slave := udAxisSlaveObj;
|
||||
Axis_MC_GearOut.Slave := udAxisSlaveObj;
|
||||
Axis_MC_Home.Axis := udAxisObj;
|
||||
Axis_MC_BR_InitModPos.Axis := udAxisMasterObj;
|
||||
Axis_MC_MoveAbsolute.Axis := udAxisObj;
|
||||
Axis_MC_BR_MoveAbsoluteTriggStop.Axis := udAxisObj;
|
||||
Axis_MC_MoveAdditive.Axis := udAxisObj;
|
||||
Axis_MC_BR_MoveAdditiveTriggStop.Axis := udAxisObj;
|
||||
Axis_MC_MoveVelocity.Axis := udAxisObj;
|
||||
AXis_MC_BR_MoveVelocityTriggStop.Axis := udAxisObj;
|
||||
Axis_MC_Power.Axis := udAxisObj;
|
||||
Axis_MC_ReadActualPosition.Axis := udAxisObj;
|
||||
Axis_MC_ReadActualVelocity.Axis := udAxisObj;
|
||||
Axis_MC_ReadActualTorque.Axis := udAxisObj;
|
||||
Axis_MC_BR_ReadAxisError.Axis := udAxisObj;
|
||||
Axis_MC_BR_ReadAxisError.Mode := mcTEXT;
|
||||
Axis_MC_BR_ReadAxisError.Configuration.DataAddress := ADR (lAxis.Error.Text);
|
||||
Axis_MC_BR_ReadAxisError.Configuration.DataLength := SIZEOF (lAxis.Error.Text);
|
||||
Axis_MC_BR_ReadAxisError.Configuration.DataObjectName := 'acp10etxde';
|
||||
Axis_MC_BR_ReadAxisError.Configuration.Format := mcWRAP + mcNULL;
|
||||
Axis_MC_BR_ReadAxisError.Configuration.LineLength := SIZEOF (lAxis.Error.Text[0]);
|
||||
Axis_MC_ReadStatus.Axis := udAxisObj;
|
||||
Axis_MC_Reset.Axis := udAxisObj;
|
||||
Axis_MC_SetOverride.Axis := udAxisObj;
|
||||
Axis_MC_Stop.Axis := udAxisObj;
|
||||
|
||||
|
||||
|
||||
//Parameter
|
||||
Axis_MC_BR_CyclicRead.Axis := udAxisObj;
|
||||
Axis_MC_BR_CyclicWrite.Axis := udAxisObj;
|
||||
Axis_MC_BR_ReadParID.Axis := udAxisObj;
|
||||
Axis_MC_BR_WriteParID.Axis := udAxisObj;
|
||||
|
||||
|
||||
//Enable Fubs
|
||||
Axis_MC_BR_AxisErrorCollector.Enable := TRUE;
|
||||
Axis_MC_BR_ReadAxisError.Enable := TRUE;
|
||||
Axis_MC_ReadStatus.Enable := TRUE;
|
||||
Axis_MC_ReadActualPosition.Enable := TRUE;
|
||||
Axis_MC_ReadActualVelocity.Enable := TRUE;
|
||||
Axis_MC_ReadActualTorque.Enable := TRUE; //Not for Stepper Axises
|
||||
Axis_MC_BR_ReadDriveStatus.Enable := TRUE;
|
||||
|
||||
|
||||
END_PROGRAM
|
||||
9
Logical/Axises/Axisctrl/IEC.prg
Normal file
9
Logical/Axises/Axisctrl/IEC.prg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Program xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File Description="Initialization code">AxisctrlInit.st</File>
|
||||
<File Description="Cyclic code">AxisctrlCyclic.st</File>
|
||||
<File Description="Local variables" Private="true">Axisctrl.var</File>
|
||||
</Files>
|
||||
</Program>
|
||||
191
Logical/Axises/GlobalAxis.typ
Normal file
191
Logical/Axises/GlobalAxis.typ
Normal file
@@ -0,0 +1,191 @@
|
||||
|
||||
TYPE
|
||||
typAxis_Move : STRUCT (*Achsbewegungen*)
|
||||
bAbsolute : BOOL; (*Absolute Bewegung*)
|
||||
bAdditive : BOOL; (*Inkrementelle Bewegung*)
|
||||
bVelocity : BOOL; (*Bewegung mit konstanter Geschwindigkeit*)
|
||||
bVelocityControl : BOOL; (*Bewegung mit konstanter Geschwindigkeit / Drehmomentbegrenzt (Nur EPL)*)
|
||||
bTorqueControl : BOOL; (*Bewegung mit konstanter Geschwindigkeit / Drehmomentregelung*)
|
||||
bJogPos : BOOL; (*Tipp Vorw<72>rts*)
|
||||
bJogNeg : BOOL; (*Tipp R<>ckw<6B>rts*)
|
||||
bBraketest : BOOL; (*Bremstest*)
|
||||
bStartGearSlave : BOOL; (*Elektronisches Getriebe Slave (Geschwindigkeit)*)
|
||||
bStartGearPosSlave : BOOL; (*Elektronisches Getriebe Slave (Positon)*)
|
||||
bStopGearSlave : BOOL; (*Eektronisches Getriebe Slave Stoppen*)
|
||||
END_STRUCT;
|
||||
typAxis_Error : STRUCT (*Achsfehler*)
|
||||
bAcknowledge : BOOL;
|
||||
uiID : UINT;
|
||||
Text : ARRAY[0..3]OF STRING[79];
|
||||
END_STRUCT;
|
||||
error_typ : STRUCT (*error structure *)
|
||||
AxisErrorCount : UINT; (*number of active axis errors*)
|
||||
AxisWarningCount : UINT; (*number of active axis warinings*)
|
||||
FunctionBlockErrorCount : UINT; (*number of active function block errors*)
|
||||
ErrorRecord : MC_ERRORRECORD_REF; (*error record information*)
|
||||
ErrorText : ARRAY[0..3]OF STRING[79]; (*description of first active error or warning*)
|
||||
END_STRUCT;
|
||||
typAxis_Status : STRUCT (*Acopos Status*)
|
||||
bDisabled : BOOL; (*Disabled*)
|
||||
bStandstill : BOOL; (*Standstill*)
|
||||
bStopping : BOOL; (*Stopping*)
|
||||
bHoming : BOOL; (*Homing*)
|
||||
bMotionDiscrete : BOOL; (*Motion Discrete*)
|
||||
bMotionContinous : BOOL; (*Motion Continous*)
|
||||
bMotionSynchronized : BOOL; (*Motion Synchronized*)
|
||||
bErrorstop : BOOL; (*Error Stop*)
|
||||
bTorqueLimitReached : BOOL; (*Torquelimit from Move.bTorqueControl *)
|
||||
bHomingOkDelayed : BOOL;
|
||||
END_STRUCT;
|
||||
typAxis_DriveStatus : STRUCT (*Acopos Drive Statos*)
|
||||
bSimulation : BOOL; (*Axis Simulation*)
|
||||
bNetworkInit : BOOL;
|
||||
bHomeSwitch : BOOL;
|
||||
bPosHWSwitch : BOOL;
|
||||
bNegHWSwitch : BOOL;
|
||||
bTrigger1 : BOOL;
|
||||
bTrigger2 : BOOL;
|
||||
bDriveEnable : BOOL;
|
||||
bControllerReady : BOOL;
|
||||
bControllerStatus : BOOL;
|
||||
bHomingOk : BOOL;
|
||||
bAxisError : BOOL;
|
||||
bLagWarning : BOOL;
|
||||
END_STRUCT;
|
||||
typAxis_Para : STRUCT (*Achsparameter*)
|
||||
bTriggStop : BOOL; (*Use Trigger Stop for Move Absolute/Additive/Velocity*)
|
||||
bSetHWInputs : BOOL := 0; (*Set HW Inputs (e.g. for ACPMulti when need Limit/Ref)*)
|
||||
usDirection : USINT; (*Direction for Move Velocity*)
|
||||
usHomeingMode : USINT := mcHOME_DEFAULT;
|
||||
udAxisModPosPeriod : UDINT := 0; (*For Modulo Position - Axis period*)
|
||||
udAxisModPosFactor : UDINT := 0; (*For Modulo Position - Axis Factor*)
|
||||
udAdrParamUserVar1 : UDINT; (*Address: Cyclic to Acopos transmitted Value*)
|
||||
rPosition : REAL; (*Position for Absolute Movement (And Jog Target)*)
|
||||
rDistance : REAL; (*Distance for Additive Movement*)
|
||||
rTriggDistance : REAL; (*Distance for Trigger Movements (Absolue/Additive/Velocity)*)
|
||||
rVelocity : REAL; (*Velocity for Movements*)
|
||||
rOverrideVelocity : REAL := 1.0; (*Overridevalue for Velicity*)
|
||||
rAcceleration : REAL; (*Acceleration for Movements*)
|
||||
rOverrideAcceleration : REAL := 1.0; (*Overridevalue for Acceleration*)
|
||||
rDeceleration : REAL; (*Deceleration for Movements*)
|
||||
rHomePosition : REAL; (*Homeposition for Homing*)
|
||||
JogMode : enAxisJogMode := (0); (*Tippbetriebsart*)
|
||||
rJogLimitLow : REAL; (*Unteres Limit f<>r Jog Limits*)
|
||||
rJogLimitHigh : REAL; (*Oberes Limit f<>r Jog Limits*)
|
||||
rJogVelocity : REAL; (*Velocity for Jog*)
|
||||
rTorqueLimit : REAL; (*Torquelimit for TorqueControl*)
|
||||
rBraketestTorque : REAL; (*Tourque for Braketest*)
|
||||
rBraketestPosLimit : REAL; (*Tourque for Braketest*)
|
||||
iGearRatioNumerator : INT := 1; (*CAM/Gear*)
|
||||
uiGearRatioDenominator : UINT := 1; (*CAM/Gear*)
|
||||
rGearMasterSyncPos : REAL; (*Pos Gear *)
|
||||
rGearSlaveSyncPos : REAL; (*Pos Gear *)
|
||||
rGearMasterStartDistance : REAL; (*Pos Gear*)
|
||||
rGearSyncVelocity : REAL; (*Pos Gear*)
|
||||
rGearSyncAcceleration : REAL; (*Pos Gear*)
|
||||
END_STRUCT;
|
||||
typAxis : STRUCT (*Acopos Achse*)
|
||||
enStep : enAxisStep; (*Achs Schritt*)
|
||||
bVAxis : BOOL; (*Achse ist Virtuell*)
|
||||
bPower : BOOL; (*Achse Einschalten*)
|
||||
bHome : BOOL; (*Achse referenzieren*)
|
||||
bHalt : BOOL; (*Achse anhalten (kann durch andres Kommando abgebr. werden)*)
|
||||
bStop : BOOL; (*Achse stoppen (solange Kommando gesetzt ist)*)
|
||||
rActPosition : REAL; (*Aktuelle Position*)
|
||||
rActVelocity : REAL; (*Aktuelle Geschwindigkeit*)
|
||||
rActTorque : REAL; (*Aktuelles Drehmoment*)
|
||||
rReachedTorque : REAL; (*Erreichtes Drehmoment bei Stop mit M-Limit*)
|
||||
diPositionReachedTorque : DINT; (*Position bei Erreichen des Drehmoments*)
|
||||
Move : typAxis_Move; (*Achsbewegungen*)
|
||||
Error : typAxis_Error;
|
||||
Status : typAxis_Status;
|
||||
DriveStatus : typAxis_DriveStatus;
|
||||
Para : typAxis_Para;
|
||||
END_STRUCT;
|
||||
typMultAx_Trace : STRUCT (*MultiaxTrace*)
|
||||
sStep : STRING[25];
|
||||
bStartSave : BOOL; (*Activate Trace*)
|
||||
bLoadConfig : BOOL; (*Load Trace Config*)
|
||||
bStop : USINT; (*Stop Trace*)
|
||||
uiTraceStep : USINT; (*Step of Trace*)
|
||||
uiTraceState : UINT; (*Status of Trace*)
|
||||
uiTraceError : UINT; (*Error of Trace*)
|
||||
Trace_Config : MC_PARTRACECONFIG_REF; (*Configuration of Trase*)
|
||||
Trace_DatObj_Refercence : MC_DATOBJ_REF; (*Parameter for Save the Trace-Config*)
|
||||
Trace_Error_Record : MC_ERRORRECORD_REF; (*Fehlerspeicher*)
|
||||
END_STRUCT;
|
||||
enAxisJogMode :
|
||||
(
|
||||
enAxJOG, (*Tippbetrieb un<75>berwacht*)
|
||||
enAxJOG_Limits, (*Tippbetrieb innerhalb Limits*)
|
||||
enAxJOG_Target (*Tippbetrieb auf Ziel*)
|
||||
);
|
||||
enAxisStep :
|
||||
( (*Acopos Schritt*)
|
||||
enAxSTATE_WAIT, (*Waruten*)
|
||||
enAxSTATE_SIMULATION_ON, (*Simulation einschalten*)
|
||||
enAxSTATE_SIMULATION_OFF, (*Simulation ausschalten*)
|
||||
enAxSTATE_POWER_ON, (*Achse einschalten*)
|
||||
enAxSTATE_POWER_OFF, (*Achse einschalten*)
|
||||
enAxSTATE_READY, (*Achse Bereit*)
|
||||
enAxSTATE_HOME, (*Achse referenzieren*)
|
||||
enAxSTATE_BRAKE_TEST, (*Bremstest durchf<68>hren*)
|
||||
enAxSTATE_INIT_MOD_POS, (*Modulo Posiotion initialisieren*)
|
||||
enAxSTATE_STOP, (*Achse stopppen*)
|
||||
enAxSTATE_JOG, (*Axhse tippen*)
|
||||
enAxSTATE_MOVE_ABSOLUTE, (*Achse absolut positionieren*)
|
||||
enAxSTATE_MOVE_ABSOLUTE_TRIGSTP, (*Achse absolut positionieren Stop mit Trigger*)
|
||||
enAxSTATE_MOVE_ADDITIVE, (*Achse inkrementell positionieren*)
|
||||
enAxSTATE_MOVE_ADDITIVE_TRIGSTP, (*Achse inkrementell positionieren Stop mit Trigger*)
|
||||
enAxSTATE_MOVE_VELOCITY, (*Achse mit konstanter Geschwindigkeit bewegen*)
|
||||
enAxSTATE_MOVE_VELOCITY_CTRL, (*Achse Geschwindigkeitsregeln (M-Regelung)*)
|
||||
enAxSTATE_MOVE_TORQUE_CTRL, (*Achse Drehmomentregeln*)
|
||||
enAxSTATE_MOVE_GEAR_START, (*Elektronisches Getriebe Starten*)
|
||||
enAxSTATE_MOVE_GEARPOS_START, (*Elektronisches Getriebe (Positionsmodus) Starten*)
|
||||
enAxSTATE_MOVE_GEAR_STOP, (*Elektronisches Getriebe Stoppen*)
|
||||
enAxSTATE_STOP_AFTER_ERROR, (*Stoppen nach Fehler*)
|
||||
enAxSTATE_ERROR, (*Fehler*)
|
||||
enAxSTATE_ERROR_CHECK, (*Fehler pr<70>fen*)
|
||||
enAxSTATE_ERROR_RESET (*Achsfehler quittieren*)
|
||||
);
|
||||
typPS_Command : STRUCT (*command structure for power supply modules*)
|
||||
bPower : BOOL; (*switch on the controller of the psm*)
|
||||
bStartPowerMeter : BOOL; (*start the power evaluation of psm*)
|
||||
bStopPowerMeter : BOOL; (*stop the power evaluation of psm*)
|
||||
bRestartInterval : BOOL; (*restart the interval of power evaluation*)
|
||||
END_STRUCT;
|
||||
typPS_Parameter : STRUCT (*parameter structure for psm*)
|
||||
uiIntervalTime : UINT; (*interval time for the power evaluation*)
|
||||
END_STRUCT;
|
||||
typPS_Status : STRUCT (*status structure for psm*)
|
||||
mcPowerData : MC_POWERDATA_REF; (*evaluated power data*)
|
||||
uiMissedInterval : UINT; (*MissedIntervals with power evaluation*)
|
||||
END_STRUCT;
|
||||
typPS_Energy : STRUCT
|
||||
rConsumedEnergy : REAL; (*Verbrauchte Energie [Ws]*)
|
||||
rRegeneratedEnergy : REAL; (*R<>ckgespeiste Energie [Ws]*)
|
||||
END_STRUCT;
|
||||
typPS : STRUCT (*substructure for psm*)
|
||||
enStep : enPSStep; (*Achs Schritt*)
|
||||
Command : typPS_Command; (*command structure for psm*)
|
||||
Parameter : typPS_Parameter; (*parameter structure for psm*)
|
||||
Status : typPS_Status; (*status structure for psm*)
|
||||
Energy : typPS_Energy;
|
||||
AxisState : typAxis_Status; (*axis state structure*)
|
||||
DriveStatus : typAxis_DriveStatus;
|
||||
Error : typAxis_Error; (*error structure*)
|
||||
END_STRUCT;
|
||||
enPSStep :
|
||||
(
|
||||
enPSSTATE_WAIT, (*Waruten*)
|
||||
enPSSTATE_READY,
|
||||
enPSSTATE_POWER_OFF,
|
||||
enPSSTATE_POWER_ON,
|
||||
enPSSTATE_POWERMETER_START,
|
||||
enPSSTATE_POWERMETER_STOP,
|
||||
enPSSTATE_RESTART_INTERVAL,
|
||||
enPSSTATE_ERROR, (*Fehler bei FUB ausf<73>hrung*)
|
||||
enPSSTATE_ERROR_AXIS, (*Achsfehler*)
|
||||
enPSSTATE_ERROR_RESET (*Achsfehler quittieren*)
|
||||
);
|
||||
END_TYPE
|
||||
14
Logical/Axises/GlobalAxis.var
Normal file
14
Logical/Axises/GlobalAxis.var
Normal file
@@ -0,0 +1,14 @@
|
||||
VAR
|
||||
gAxis : ARRAY[0..6] OF typAxis; (*Axis Datasructure / Controlinterface*)
|
||||
gMAxTrace : typMultAx_Trace; (*Multiaxtrace*)
|
||||
gAxisActPos : ARRAY[0..6] OF REAL;
|
||||
grDummy : REAL; (*Dummy Real to be accessed from Axistasks*)
|
||||
END_VAR
|
||||
(*//ACP/SDC Axobjects*)
|
||||
VAR
|
||||
gAxShaft1 : ACP10AXIS_typ;
|
||||
END_VAR
|
||||
(*//-----------------------------------------------------------------------------------------------------*)
|
||||
VAR RETAIN
|
||||
grAxisABSOffShaft1 : REAL;
|
||||
END_VAR
|
||||
9
Logical/Axises/MAxTrace/IEC.prg
Normal file
9
Logical/Axises/MAxTrace/IEC.prg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Program xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File Description="Initialization code">MAxTraceInit.ab</File>
|
||||
<File Description="Cyclic code">MAxTraceCyclic.ab</File>
|
||||
<File Description="Local variables" Private="true">MAxTrace.var</File>
|
||||
</Files>
|
||||
</Program>
|
||||
11
Logical/Axises/MAxTrace/MAxTrace.var
Normal file
11
Logical/Axises/MAxTrace/MAxTrace.var
Normal file
@@ -0,0 +1,11 @@
|
||||
(*//-----------------------------------------------------------------------------------------------------*)
|
||||
(*//MC FunctionBlocks*)
|
||||
VAR
|
||||
Axis_MC_BR_ParTrace : MC_BR_ParTrace := (0); (*Parameter Trace*)
|
||||
Axis_MC_BR_ReadParTraceStatus : MC_BR_ReadParTraceStatus := (0); (*Parameter Trace Status*)
|
||||
END_VAR
|
||||
(*//-----------------------------------------------------------------------------------------------------*)
|
||||
(*//Dynamic Vars*)
|
||||
VAR
|
||||
lMAxTrace : REFERENCE TO typMultAx_Trace; (*Axis Datastruct *)
|
||||
END_VAR
|
||||
107
Logical/Axises/MAxTrace/MAxTraceCyclic.ab
Normal file
107
Logical/Axises/MAxTrace/MAxTraceCyclic.ab
Normal file
@@ -0,0 +1,107 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT --
|
||||
********************************************************************
|
||||
* Program: MAxTrace
|
||||
* File: MAxTraceCyclic.ab
|
||||
* Author: michi
|
||||
* Created: July 18, 2012
|
||||
********************************************************************
|
||||
* Implementation of program MAxTrace
|
||||
********************************************************************)
|
||||
|
||||
PROGRAM _CYCLIC
|
||||
;STATE Machine Trace
|
||||
SELECT lMAxTrace.uiTraceStep
|
||||
;==============================================
|
||||
;READY
|
||||
STATE AxTraceSTATE_READY
|
||||
strcpy (ADR (lMAxTrace.sStep), "AxTraceSTATE_READY")
|
||||
|
||||
WHEN (lMAxTrace.bLoadConfig = 1)
|
||||
lMAxTrace.bLoadConfig = 0
|
||||
NEXT AxTraceSTATE_LOAD_CONFIG
|
||||
|
||||
WHEN (lMAxTrace.bStartSave = 1)
|
||||
lMAxTrace.bStartSave = 0
|
||||
NEXT AxTraceSTATE_START_SAVE
|
||||
|
||||
Axis_MC_BR_ParTrace.Execute = 0
|
||||
//Axis_MC_BR_ParTraceConfig.Execute = 0
|
||||
Axis_MC_BR_ReadParTraceStatus.Enable = 0
|
||||
|
||||
;==============================================
|
||||
;Load Trace Config
|
||||
STATE AxTraceSTATE_LOAD_CONFIG
|
||||
strcpy (ADR (lMAxTrace.sStep), "AxTraceSTATE_LOAD_CONFIG")
|
||||
//Axis_MC_BR_ParTraceConfig.Command = mcLoad
|
||||
//Axis_MC_BR_ParTraceConfig.AdrTraceConfig = adr (lMAxTrace.Trace_DatObj_Refercence)
|
||||
//Axis_MC_BR_ParTraceConfig.Execute = 1
|
||||
|
||||
;check if loading is finished
|
||||
//when (Axis_MC_BR_ParTrace.Done)
|
||||
// Axis_MC_BR_ParTraceConfig.Execute = 0
|
||||
//next AxTraceSTATE_READY
|
||||
|
||||
;check for error occured
|
||||
//when (Axis_MC_BR_ParTraceConfig.Error)
|
||||
// Axis_MC_BR_ParTraceConfig.Execute = 0
|
||||
// Axis_MC_BR_ParTraceConfig.ErrorRecord
|
||||
//next AxTraceSTATE_ERROR
|
||||
|
||||
;==============================================
|
||||
;Start and Save Trace
|
||||
STATE AxTraceSTATE_START_SAVE
|
||||
strcpy (ADR (lMAxTrace.sStep), "AxTraceSTATE_START_SAVE")
|
||||
Axis_MC_BR_ParTrace.Configuration = lMAxTrace.Trace_Config
|
||||
Axis_MC_BR_ParTrace.Command = mcSTART + mcSAVE
|
||||
Axis_MC_BR_ParTrace.Execute = 1
|
||||
|
||||
;check if Trace is finished
|
||||
WHEN (Axis_MC_BR_ParTrace.Done)
|
||||
Axis_MC_BR_ParTrace.Execute = 0
|
||||
NEXT AxTraceSTATE_READY
|
||||
|
||||
;check for error occured
|
||||
WHEN (Axis_MC_BR_ParTrace.Error)
|
||||
Axis_MC_BR_ParTrace.Execute = 0
|
||||
lMAxTrace.uiTraceError = Axis_MC_BR_ParTrace.ErrorID
|
||||
lMAxTrace.Trace_Error_Record = Axis_MC_BR_ParTrace.ErrorRecord
|
||||
NEXT AxTraceSTATE_ERROR
|
||||
|
||||
WHEN (lMAxTrace.bStop = 1)
|
||||
Axis_MC_BR_ParTrace.Execute = 0
|
||||
lMAxTrace.bStop = 0
|
||||
NEXT AxTraceSTATE_STOP
|
||||
|
||||
;==============================================
|
||||
;Stop Trace
|
||||
STATE AxTraceSTATE_STOP
|
||||
strcpy (ADR (lMAxTrace.sStep), "AxTraceSTATE_STOP")
|
||||
Axis_MC_BR_ParTrace.Command = mcSTOP
|
||||
Axis_MC_BR_ParTrace.Execute = 1
|
||||
|
||||
;check if Trace is finished
|
||||
WHEN (Axis_MC_BR_ParTrace.Done)
|
||||
Axis_MC_BR_ParTrace.Execute = 0
|
||||
NEXT AxTraceSTATE_READY
|
||||
|
||||
;check for error occured
|
||||
WHEN (Axis_MC_BR_ParTrace.Error)
|
||||
Axis_MC_BR_ParTrace.Execute = 0
|
||||
;Axis_MC_BR_ParTrace.ErrorRecord
|
||||
NEXT AxTraceSTATE_ERROR
|
||||
|
||||
;==============================================
|
||||
;Error
|
||||
STATE AxTraceSTATE_ERROR
|
||||
strcpy (ADR (lMAxTrace.sStep), "AxTraceSTATE_ERROR")
|
||||
WHEN (1 = 1)
|
||||
NEXT AxTraceSTATE_READY
|
||||
|
||||
ENDSELECT
|
||||
|
||||
Axis_MC_BR_ParTrace FUB MC_BR_ParTrace ()
|
||||
//Axis_MC_BR_ParTraceConfig fub MC_BR_ParTraceConfig ()
|
||||
Axis_MC_BR_ReadParTraceStatus FUB MC_BR_ReadParTraceStatus ()
|
||||
|
||||
END_PROGRAM
|
||||
17
Logical/Axises/MAxTrace/MAxTraceInit.ab
Normal file
17
Logical/Axises/MAxTrace/MAxTraceInit.ab
Normal file
@@ -0,0 +1,17 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT --
|
||||
********************************************************************
|
||||
* Program: MAxTrace
|
||||
* File: MAxTraceInit.ab
|
||||
* Author: michi
|
||||
* Created: July 18, 2012
|
||||
********************************************************************
|
||||
* Implementation of program MAxTrace
|
||||
********************************************************************)
|
||||
|
||||
PROGRAM _INIT
|
||||
|
||||
lMAxTrace ACCESS ADR (gMAxTrace);
|
||||
|
||||
END_PROGRAM
|
||||
|
||||
12
Logical/Axises/Package.pkg
Normal file
12
Logical/Axises/Package.pkg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Package xmlns="http://br-automation.co.at/AS/Package">
|
||||
<Objects>
|
||||
<Object Type="File" Description="Achsdatentypen">GlobalAxis.typ</Object>
|
||||
<Object Type="File" Description="Package variables">GlobalAxis.var</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Controller">PressCtrl</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Multi Axis Trace">MAxTrace</Object>
|
||||
<Object Type="Program" Language="IEC" Description="AxisCtrl (Master)">Axisctrl</Object>
|
||||
<Object Type="DataObject" Language="Ett">acp10etxde</Object>
|
||||
</Objects>
|
||||
</Package>
|
||||
46
Logical/Axises/PressCtrl/HomeAxis.st
Normal file
46
Logical/Axises/PressCtrl/HomeAxis.st
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
FUNCTION HomeAxis
|
||||
IF (enInStep = enHomeOffsetPerm) THEN
|
||||
//Home with permanent Stored Offset
|
||||
//---------------------------
|
||||
InAxis.Para.rHomePosition := rInPermanentOffset;
|
||||
InAxis.bHome := TRUE;
|
||||
enInStep := enHomeOffsetPermDone;
|
||||
ELSIF (enInStep = enHomeOffsetPermDone) THEN
|
||||
//Home with permanent Stored Offset
|
||||
//---------------------------
|
||||
IF InAxis.Status.bHomingOkDelayed AND NOT InAxis.bHome THEN
|
||||
enInStep := enHomeIdle;
|
||||
END_IF
|
||||
ELSIF (enInStep = enHomeOffset0) THEN
|
||||
//Home with Stored 0
|
||||
//---------------------------
|
||||
InAxis.Para.rHomePosition := 0.0;
|
||||
InAxis.bHome := TRUE;
|
||||
enInStep := enHomeOffset0Done;
|
||||
ELSIF (enInStep = enHomeOffset0Done) THEN
|
||||
//Home with Stored 0
|
||||
//---------------------------
|
||||
IF InAxis.Status.bHomingOkDelayed AND NOT InAxis.bHome THEN
|
||||
enInStep := enHomeStorePos;
|
||||
END_IF
|
||||
ELSIF (enInStep = enHomeOffset0NoStore) THEN
|
||||
//Home with Stored 0
|
||||
//---------------------------
|
||||
InAxis.Para.rHomePosition := 0.0;
|
||||
InAxis.bHome := TRUE;
|
||||
enInStep := enHomeOffset0DoneNoStore;
|
||||
ELSIF (enInStep = enHomeOffset0DoneNoStore) THEN
|
||||
//Home with Stored 0
|
||||
//---------------------------
|
||||
IF InAxis.Status.bHomingOkDelayed AND NOT InAxis.bHome THEN
|
||||
enInStep := enHomeIdle;
|
||||
END_IF
|
||||
ELSIF (enInStep = enHomeStorePos) THEN
|
||||
//Store Axis Position
|
||||
//---------------------------
|
||||
rInPermanentOffset := - InAxis.rActPosition + rInOffset;
|
||||
ERRxwarning (50001, 0 , ADR ('Permanenter Geberoffset einer Spindel wurde ver<65>ndert'));
|
||||
enInStep := enHomeOffsetPerm;
|
||||
END_IF
|
||||
END_FUNCTION
|
||||
12
Logical/Axises/PressCtrl/IEC.prg
Normal file
12
Logical/Axises/PressCtrl/IEC.prg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Program xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File Description="Implementation code">PressCtrl.st</File>
|
||||
<File Description="InitCode">PressCtrlInit.st</File>
|
||||
<File Description="Local data types" Private="true">PressCtrl.typ</File>
|
||||
<File Description="Local variables" Private="true">PressCtrl.var</File>
|
||||
<File Description="Home an Absoulte Encoder Axis">HomeAxis.st</File>
|
||||
<File Private="true">PressCtrl.fun</File>
|
||||
</Files>
|
||||
</Program>
|
||||
9
Logical/Axises/PressCtrl/PressCtrl.fun
Normal file
9
Logical/Axises/PressCtrl/PressCtrl.fun
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
FUNCTION HomeAxis : BOOL (*Home an Absoulte Encoder Axis*)
|
||||
VAR_INPUT
|
||||
InAxis : REFERENCE TO typAxis; (*Achsreferenz*)
|
||||
rInPermanentOffset : REFERENCE TO REAL; (*Referenz auf permanenten Offset*)
|
||||
rInOffset : REAL;
|
||||
enInStep : REFERENCE TO typ_enHome; (*Step*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
308
Logical/Axises/PressCtrl/PressCtrl.st
Normal file
308
Logical/Axises/PressCtrl/PressCtrl.st
Normal file
@@ -0,0 +1,308 @@
|
||||
PROGRAM _CYCLIC
|
||||
//SIMULATION
|
||||
|
||||
bSafetyOk := TRUE; //Safety for Acopos is OK
|
||||
|
||||
bSafetyOkFP := EDGEPOS (bSafetyOk);
|
||||
|
||||
IF EDGEPOS (bBlink0_1) THEN
|
||||
udSteptime := udSteptime + 100;
|
||||
udCycletime := udCycletime + 100;
|
||||
END_IF
|
||||
|
||||
//Calculate Force
|
||||
rForce := lAxisShaft1.rActTorque * rTorqueForceFactor;
|
||||
|
||||
//Store Max Values
|
||||
IF lAxisShaft1.rActTorque > rMaxTorque THEN
|
||||
rMaxTorque := lAxisShaft1.rActTorque;
|
||||
END_IF
|
||||
|
||||
IF rForce > rMaxForce THEN
|
||||
rMaxForce := rForce;
|
||||
END_IF
|
||||
|
||||
IF ManualCommands.bJogPosShaft1 THEN
|
||||
rMaxTorque := 0;
|
||||
rMaxForce := 0;
|
||||
END_IF
|
||||
|
||||
//Set Override
|
||||
IF (rOverrideVelocity < 1) THEN
|
||||
rOverrideVelocity := 1;
|
||||
ELSIF rOverrideVelocity > 100 THEN
|
||||
rOverrideVelocity := 100;
|
||||
END_IF
|
||||
|
||||
lAxisShaft1.Para.rOverrideVelocity := rOverrideVelocity * 0.01;
|
||||
|
||||
|
||||
//Power Up Axises
|
||||
lAxisShaft1.bPower := gMachine.bMachineON AND lAxisShaft1.DriveStatus.bControllerReady AND bSafetyOk AND
|
||||
NOT (((gMachine.enMode = enMACH_AUTOMATIC) OR (gMachine.enMode = enMACH_MANUAL)) AND (enStepPress = enPressStep_WAIT_START)) AND
|
||||
NOT ((gMachine.enMode = enMACH_HOMEPOS) AND (enStepPressHoming = enPressStepHoming_WAIT_START));
|
||||
|
||||
lAxisShaft1.bStop := bStop;
|
||||
|
||||
|
||||
|
||||
bPressIsInHomepos := (lAxisShaft1.rActPosition = rPressPosHomeIWIS); //rPressPosHome
|
||||
|
||||
|
||||
//Move Conditions
|
||||
MoveConditions.bEnableNegShaft1 := ((lAxisShaft1.rActPosition > rPressPosMin) OR gMachine.bSetupMode);
|
||||
MoveConditions.bEnablePosShaft1 := ((lAxisShaft1.rActPosition < rPressPosMax) OR gMachine.bSetupMode);
|
||||
//Load Referencepos
|
||||
MoveConditions.bEnableReferencePressABS := lAxisShaft1.DriveStatus.bControllerReady;
|
||||
|
||||
//Status Control vor Visual Component Controls
|
||||
StatusVCControls.usJogNegShaft1 := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnableNegShaft1), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT ((gMachine.enMode <> enMACH_JOG) OR (genAccessLevel < enACCESSLEVEL_4)), VC_HIDE_BITPOS);
|
||||
StatusVCControls.usJogPosShaft1 := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnablePosShaft1), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT ((gMachine.enMode <> enMACH_JOG) OR (genAccessLevel < enACCESSLEVEL_4)), VC_HIDE_BITPOS);
|
||||
StatusVCControls.usReferencePress := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnableReferencePress), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT ((gMachine.enMode <> enMACH_JOG) OR (genAccessLevel < enACCESSLEVEL_4)) , VC_HIDE_BITPOS);
|
||||
StatusVCControls.usReferencePressABS := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnableReferencePressABS), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT (gMachine.enMode <> enMACH_JOG) , VC_HIDE_BITPOS);
|
||||
//Home
|
||||
|
||||
IF (gMachine.bMachineON OR (gMachine.enMode = enMACH_JOG) OR (gMachine.enMode = enMACH_HOMEPOS)) AND bHome THEN
|
||||
IF (enStepHomeShaft1 = enHomeIdle) AND (NOT lAxisShaft1.DriveStatus.bHomingOk OR bHome) AND lAxisShaft1.DriveStatus.bControllerReady THEN
|
||||
enStepHomeShaft1 := enHomeOffsetPerm;
|
||||
END_IF
|
||||
END_IF
|
||||
bHome :=FALSE;
|
||||
HomeAxis (ADR (lAxisShaft1),
|
||||
ADR (grAxisABSOffShaft1),
|
||||
rHOMEPOS,
|
||||
ADR (enStepHomeShaft1));
|
||||
|
||||
IF (gMachine.enMode <> enMACH_HOMEPOS) THEN
|
||||
enStepPressHoming := 0;
|
||||
END_IF
|
||||
IF (gMachine.enMode <> enMACH_AUTOMATIC) AND (gMachine.enMode <> enMACH_MANUAL) THEN
|
||||
enStepPress := 0;
|
||||
END_IF
|
||||
|
||||
//Jog Mode
|
||||
//==========================================================================================
|
||||
IF gMachine.enMode = enMACH_JOG THEN
|
||||
//Clear Commands
|
||||
lAxisShaft1.Move.bAbsolute := FALSE;
|
||||
|
||||
//Uncritical Movements
|
||||
IF gMachine.bSetupMode THEN
|
||||
lAxisShaft1.Para.JogMode := enAxJOG;
|
||||
ELSE
|
||||
lAxisShaft1.Para.JogMode := enAxJOG_Limits;
|
||||
lAxisShaft1.Para.rJogLimitLow := rPressPosMin;
|
||||
lAxisShaft1.Para.rJogLimitHigh := rPressPosMax;
|
||||
END_IF
|
||||
lAxisShaft1.Move.bJogNeg := ManualCommands.bJogNegShaft1 AND MoveConditions.bEnableNegShaft1;
|
||||
lAxisShaft1.Move.bJogPos := ManualCommands.bJogPosShaft1 AND MoveConditions.bEnablePosShaft1;
|
||||
|
||||
IF ManualCommands.bReferencePressABS THEN
|
||||
bHome :=TRUE;
|
||||
lAxisShaft1.Para.usHomeingMode := mcHOME_ABSOLUTE;
|
||||
ManualCommands.bReferencePressABS := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
//Home Machine
|
||||
IF (ABS (lAxisShaft1.rActTorque) > 0.5) THEN
|
||||
lAxisShaft1.Para.rJogVelocity := rSpeedPress;
|
||||
ELSE
|
||||
lAxisShaft1.Para.rJogVelocity := rSpeedJog;
|
||||
END_IF
|
||||
|
||||
IF EDGEPOS (ManualCommands.bReferencePress) THEN
|
||||
lAxisShaft1.Para.usHomeingMode := mcHOME_BLOCK_TORQUE;
|
||||
lAxisShaft1.Para.rTorqueLimit := 0.5;
|
||||
lAxisShaft1.bHome := 1;
|
||||
ELSIF ManualCommands.bReferencePress THEN
|
||||
IF lAxisShaft1.Status.bStandstill AND (lAxisShaft1.enStep = enAxSTATE_READY) THEN
|
||||
enStepHomeShaft1 := enHomeOffset0;
|
||||
bReferenedShaft1 := TRUE;
|
||||
END_IF
|
||||
|
||||
IF bReferenedShaft1 THEN
|
||||
ManualCommands.bReferencePress := FALSE;
|
||||
bReferenedShaft1 := FALSE;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
//Homing Mode
|
||||
//==========================================================================================
|
||||
ELSIF (gMachine.enMode = enMACH_HOMEPOS) THEN
|
||||
//Press
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
CASE enStepPressHoming OF
|
||||
//Init
|
||||
//---------------------------
|
||||
enPressStepHoming_INIT:
|
||||
enStepPressHoming := enPressStepHoming_WAIT_START;
|
||||
|
||||
//Wait for Start
|
||||
//---------------------------
|
||||
enPressStepHoming_WAIT_START:
|
||||
IF bSafetyOk AND gMachine.bRequestHoming THEN
|
||||
enStepPressHoming := enPressStepHoming_MOVE_HOME;
|
||||
END_IF
|
||||
|
||||
//Press up to Home
|
||||
//---------------------------
|
||||
enPressStepHoming_MOVE_HOME:
|
||||
lAxisShaft1.Para.rPosition := rPressPosHomeIWIS; //rPressPosHome
|
||||
lAxisShaft1.Para.rVelocity := rSpeedHandling;
|
||||
IF MoveConditions.bEnablePosShaft1 THEN
|
||||
lAxisShaft1.Move.bAbsolute :=TRUE;
|
||||
enStepPressHoming := enPressStepHoming_MOVE_HOME_WAIT;
|
||||
END_IF
|
||||
|
||||
//Press up to Home (Wait)
|
||||
//---------------------------
|
||||
enPressStepHoming_MOVE_HOME_WAIT:
|
||||
lAxisShaft1.Move.bAbsolute := NOT bPressIsInHomepos;
|
||||
IF bPressIsInHomepos AND lAxisShaft1.Status.bStandstill THEN
|
||||
enStepPressHoming := enPressStepHoming_DONE;
|
||||
lAxisShaft1.Move.bAbsolute := 0;
|
||||
END_IF
|
||||
|
||||
|
||||
//Homing Done
|
||||
//---------------------------
|
||||
enPressStepHoming_DONE:
|
||||
gMachine.bRequestHoming := FALSE;
|
||||
enStepPressHoming := enPressStepHoming_INIT;
|
||||
END_CASE
|
||||
|
||||
//(Semi) - Automaticmode
|
||||
//==========================================================================================
|
||||
ELSIF (gMachine.enMode = enMACH_MANUAL) OR (gMachine.enMode = enMACH_AUTOMATIC) THEN
|
||||
bEnableNextStep := EDGEPOS (ManualCommands.bNextManStep) OR (gMachine.enMode = enMACH_AUTOMATIC);
|
||||
//Press
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
CASE enStepPress OF
|
||||
//Init
|
||||
//---------------------------
|
||||
enPressStep_INIT:
|
||||
bTransitionCondition := FALSE;
|
||||
IF bPressIsInHomepos THEN
|
||||
enStepPress := enPressStep_WAIT_START;
|
||||
ELSE
|
||||
enStepPress := enPressStep_MOVEHOMEPOS;
|
||||
END_IF
|
||||
|
||||
//Press up to Home
|
||||
//---------------------------
|
||||
enPressStep_MOVEHOMEPOS:
|
||||
lAxisShaft1.Para.rPosition := rPressPosHomeIWIS; //rPressPosHome
|
||||
lAxisShaft1.Para.rVelocity := rSpeedHandling;
|
||||
IF MoveConditions.bEnablePosShaft1 THEN
|
||||
lAxisShaft1.Move.bAbsolute :=TRUE;
|
||||
enStepPress := enPressStep_MOVEHOMEPOS_WAIT;
|
||||
END_IF
|
||||
|
||||
//Press up to Home (Wait)
|
||||
//---------------------------
|
||||
enPressStep_MOVEHOMEPOS_WAIT:
|
||||
IF bPressIsInHomepos AND lAxisShaft1.Status.bStandstill THEN
|
||||
enStepPress := enPressStep_INIT;
|
||||
lAxisShaft1.Move.bAbsolute := 0;
|
||||
rMaxForce := 0;
|
||||
rMaxTorque := 0;
|
||||
END_IF
|
||||
|
||||
|
||||
//Wait for Start
|
||||
//---------------------------
|
||||
enPressStep_WAIT_START:
|
||||
udCycletime := 0;
|
||||
bTransitionCondition := (EDGEPOS (gbInStartProcess) OR (gMachine.enMode = enMACH_MANUAL)) AND bSafetyOk ;
|
||||
|
||||
IF (bSafetyOkFP OR (bTransitionCondition AND (bEnableNextStep OR gbInStartProcess))) THEN
|
||||
enStepPress := enPressStep_PRESS_PRESSPOS;
|
||||
gMAxTrace.bStartSave := 1;
|
||||
lAxisShaft1.Status.bTorqueLimitReached := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
//Press down to Presspos
|
||||
//---------------------------
|
||||
enPressStep_PRESS_PRESSPOS:
|
||||
// lAxisShaft1.Para.rPosition := lPressParamActTool1.rPosPress;
|
||||
lAxisShaft1.Para.rVelocity := rSpeedPress;
|
||||
lAxisShaft1.Para.rTorqueLimit := rParamForce / rTorqueForceFactor;
|
||||
bTransitionCondition := MoveConditions.bEnableNegShaft1;
|
||||
IF bTransitionCondition THEN
|
||||
lAxisShaft1.Move.bTorqueControl := TRUE;
|
||||
//lAxisShaft1.Move.bAbsolute := TRUE;
|
||||
enStepPress := enPressStep_PRESS_PRESSPOS_WAIT;
|
||||
END_IF
|
||||
|
||||
//Press down to Presspos (WAIT)
|
||||
//---------------------------
|
||||
enPressStep_PRESS_PRESSPOS_WAIT:
|
||||
bTransitionCondition := lAxisShaft1.Status.bTorqueLimitReached OR
|
||||
(lAxisShaft1.rActPosition <= rPressPosStopIWIS);
|
||||
|
||||
IF bTransitionCondition THEN
|
||||
enStepPress := enPressStep_WAIT_PRESSED;
|
||||
lAxisShaft1.Move.bTorqueControl := FALSE;
|
||||
lAxisShaft1.bStop := 1;
|
||||
udSteptime := 0;
|
||||
END_IF
|
||||
|
||||
//Wait Pressed
|
||||
//---------------------------
|
||||
enPressStep_WAIT_PRESSED:
|
||||
bTransitionCondition := FALSE;
|
||||
IF udSteptime > udPresstime THEN
|
||||
enStepPress := enPressStep_PRESS_HOMEPOS;
|
||||
END_IF
|
||||
|
||||
//Press up to Home
|
||||
//---------------------------
|
||||
enPressStep_PRESS_HOMEPOS:
|
||||
lAxisShaft1.Para.rPosition := rPressPosHomeIWIS; //rPressPosHome
|
||||
lAxisShaft1.Para.rVelocity := rSpeedHandling;
|
||||
bTransitionCondition := MoveConditions.bEnablePosShaft1;
|
||||
IF bTransitionCondition THEN
|
||||
lAxisShaft1.Move.bAbsolute :=TRUE;
|
||||
enStepPress := enPressStep_PRESS_HOMEPOS_WAIT;
|
||||
END_IF
|
||||
|
||||
//Press up to Home (Wait)
|
||||
//---------------------------
|
||||
enPressStep_PRESS_HOMEPOS_WAIT:
|
||||
bTransitionCondition := bPressIsInHomepos AND lAxisShaft1.Status.bStandstill;
|
||||
IF bTransitionCondition THEN
|
||||
enStepPress := enPressStep_WAIT_START;
|
||||
lAxisShaft1.Move.bAbsolute := 0;
|
||||
END_IF
|
||||
END_CASE
|
||||
END_IF;
|
||||
|
||||
gbEnableNextStepBtn := bTransitionCondition AND (gMachine.enMode = enMACH_MANUAL);
|
||||
|
||||
//Set Ouputs
|
||||
|
||||
IF bSafetyOkFP THEN
|
||||
FOR usi:=100 TO 126 DO
|
||||
// gMachineAlarms.Alarm[usi] := FALSE;
|
||||
END_FOR
|
||||
END_IF
|
||||
|
||||
gStatusVCControls.usBtnErrorReset := (lAxisShaft1.Error.uiID = 0);
|
||||
|
||||
gbOuLEDStart := (enStepPress = enPressStep_WAIT_START);
|
||||
|
||||
TOF_ResetAxisErrors.IN := bSafetyOk;
|
||||
TOF_ResetAxisErrors.PT := t#3s;
|
||||
TOF_ResetAxisErrors ();
|
||||
|
||||
IF EDGEPOS (gVCCommands.bErrorReset) OR (TOF_ResetAxisErrors.Q AND bBlink0_1) OR EDGEPOS (FALSE) THEN
|
||||
lAxisShaft1.Error.bAcknowledge := (lAxisShaft1.Error.uiID > 0);
|
||||
usErrorReset := 0;
|
||||
END_IF
|
||||
END_PROGRAM
|
||||
56
Logical/Axises/PressCtrl/PressCtrl.typ
Normal file
56
Logical/Axises/PressCtrl/PressCtrl.typ
Normal file
@@ -0,0 +1,56 @@
|
||||
(**)
|
||||
|
||||
TYPE
|
||||
typ_enStepPress :
|
||||
( (*Absolutoffset einstellen*)
|
||||
enPressStep_INIT := 0, (*Grundstellung pr<70>fen*)
|
||||
enPressStep_MOVEHOMEPOS, (*Presse auf Ruheposition fahren*)
|
||||
enPressStep_MOVEHOMEPOS_WAIT, (*Presse auf Ruheposition fahren*)
|
||||
enPressStep_WAIT_START, (*Auf Startbefehl warten (mit Teil)*)
|
||||
enPressStep_PRESS_PRESSPOS, (*Presse auf Pressposition fahren*)
|
||||
enPressStep_PRESS_PRESSPOS_WAIT, (*Presse auf Pressposition fahren*)
|
||||
enPressStep_WAIT_PRESSED, (*Ruhezeit*)
|
||||
enPressStep_PRESS_HOMEPOS, (*Presse auf Ruheposition fahren*)
|
||||
enPressStep_PRESS_HOMEPOS_WAIT (*Presse auf Ruheposition fahren*)
|
||||
);
|
||||
typ_enStepHoming :
|
||||
( (*Grundstellungsfahrt*)
|
||||
enPressStepHoming_INIT, (*Auf Start warten*)
|
||||
enPressStepHoming_WAIT_START, (*Auf Startbefehl warten*)
|
||||
enPressStepHoming_REF_PRESS, (*Referenzwerte Laden*)
|
||||
enPressStepHoming_MOVE_HOME, (*Presse abfahren*)
|
||||
enPressStepHoming_MOVE_HOME_WAIT, (*Presse referenziert (auf Block)*)
|
||||
enPressStepHoming_DONE (*GST-Fahrt abgeschlossen*)
|
||||
);
|
||||
typ_enHome :
|
||||
(
|
||||
enHomeIdle,
|
||||
enHomeOffsetPerm, (*Mit permanet gesp. Offset*)
|
||||
enHomeOffsetPermDone, (*Mit permanet gesp. Offset*)
|
||||
enHomeOffset0, (*Mit Offset 0 referenzieren*)
|
||||
enHomeOffset0Done, (*Mit Offset 0 referenzieren*)
|
||||
enHomeOffset0NoStore, (*Mit Offset 0 referenzieren*)
|
||||
enHomeOffset0DoneNoStore, (*Mit Offset 0 referenzieren*)
|
||||
enHomeStorePos (*Aktuelle Pos als Offset (zum Allg Offset) speichern*)
|
||||
);
|
||||
typStatusPressVCControls : STRUCT (*Controlbytes f<>r Visu*)
|
||||
usJogNegShaft1 : USINT;
|
||||
usJogPosShaft1 : USINT;
|
||||
usReferencePress : USINT; (*Presse Referenzieren*)
|
||||
usReferencePressABS : USINT; (*Presse Referenzieren mit gespeicherten Absolutwerten*)
|
||||
END_STRUCT;
|
||||
typManualCommnands : STRUCT (*Kommandos f<>r Hand / Automatikbetrieb*)
|
||||
bNextManStep : BOOL; (*N<>chster Schritt (Semi) Automatic*)
|
||||
bToggleAutoRepCycle : BOOL; (*Reperaturzyklus antriggern*)
|
||||
bJogNegShaft1 : BOOL;
|
||||
bJogPosShaft1 : BOOL;
|
||||
bReferencePress : BOOL; (*Presse Referenzieren*)
|
||||
bReferencePressABS : BOOL; (*Presse Referenzieren mit gespeicherten Absolutwerten*)
|
||||
END_STRUCT;
|
||||
typMoveConditions : STRUCT (*Bewegungsfreigaben*)
|
||||
bEnableNegShaft1 : BOOL;
|
||||
bEnablePosShaft1 : BOOL;
|
||||
bEnableReferencePress : BOOL; (*Presse Referenzieren*)
|
||||
bEnableReferencePressABS : BOOL; (*Presse Referenzieren*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
82
Logical/Axises/PressCtrl/PressCtrl.var
Normal file
82
Logical/Axises/PressCtrl/PressCtrl.var
Normal file
@@ -0,0 +1,82 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT --
|
||||
********************************************************************
|
||||
* Program: AxCtrl
|
||||
* File: AxCtrl.var
|
||||
* Author: michi
|
||||
* Created: July 17, 2012
|
||||
********************************************************************
|
||||
* Local variables of program AxCtrl
|
||||
********************************************************************)
|
||||
(*//-----------------------------------------------------------------------------------------------------*)
|
||||
(*//Dynamic Vars*)
|
||||
VAR
|
||||
lAxisShaft1 : REFERENCE TO typAxis; (*Axis Datastruct *)
|
||||
END_VAR
|
||||
(*//Local Vars*)
|
||||
VAR
|
||||
bTransitionCondition : BOOL;
|
||||
bSafetyOk : BOOL;
|
||||
bSafetyOkFP : BOOL;
|
||||
bReferenedShaft1 : BOOL;
|
||||
bHome : BOOL := FALSE;
|
||||
bStop : BOOL;
|
||||
bHalt : BOOL;
|
||||
bEnableNextStep : BOOL; (*N<>chsten Schritt (Semiautomatik) Freigeben*)
|
||||
bPressIsInHomepos : BOOL;
|
||||
usi : USINT;
|
||||
usErrorReset : USINT;
|
||||
udSteptime : UDINT; (*[0.1s]*)
|
||||
udCycletime : UDINT := 0; (*ms*)
|
||||
udCycletimeLast : UDINT := 0; (*ms*)
|
||||
StatusVCControls : typStatusPressVCControls;
|
||||
ManualCommands : typManualCommnands; (*Kommandos Betriebsart Hand*)
|
||||
MoveConditions : typMoveConditions;
|
||||
enStepHomeShaft1 : typ_enHome;
|
||||
enStepPress : typ_enStepPress;
|
||||
enStepPressHoming : typ_enStepHoming;
|
||||
rOverrideVelocity : REAL := 100.0; (*[0.1mm]*)
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
rSpeedJog : REAL := 20.0; (*[0.1mm]*)
|
||||
END_VAR
|
||||
VAR RETAIN
|
||||
rSpeedPress : REAL := 3.33; (*[0.1mm]*)
|
||||
rSpeedHandling : REAL := 40.0; (*[0.1mm]*)
|
||||
END_VAR
|
||||
VAR
|
||||
rMaxTorque : REAL; (*Maximales Drehmoment*)
|
||||
rMaxForce : REAL; (*Maximale Kraft*)
|
||||
rAveragePos : REAL;
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
rPressPosMin : REAL := 32.0; (*Presse Oben Pos Min [0.1mm]*)
|
||||
rPressPosStopIWIS : REAL := 750.0; (*Presse Oben Pos Min (IWIS Werkzeug) [0.1mm]*)
|
||||
rPressPosMax : REAL := 1725.0; (*Press Unten Pos Max [0.1mm]*)
|
||||
rPressPosHome : REAL := 1725.0; (*Grundstellung*)
|
||||
rPressPosHomeIWIS : REAL := 950.0; (*Grundstellung (IWIS Werkzeug)*)
|
||||
rHOMEPOS : REAL := 1750.0; (*Referenzierpos[0.1mm]*)
|
||||
END_VAR
|
||||
(*//Pressparams*)
|
||||
VAR
|
||||
rParamForce : REAL := 16.0; (*[kN]*)
|
||||
END_VAR
|
||||
VAR RETAIN
|
||||
udPresstime : UDINT := 500; (*[ms]*)
|
||||
END_VAR
|
||||
(*//Calculate Force*)
|
||||
VAR
|
||||
rForce : REAL; (*Skalierte Kraft*)
|
||||
rTorqueForceFactor : REAL; (*Umrechnungsfaktor Drehmoment > Kraft*)
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
rGearFactor : REAL := 25.0; (*i Getriebe*)
|
||||
rThreadPitch : REAL := 0.01; (*Steigung Spindel [m]*)
|
||||
END_VAR
|
||||
(*//FUBS*)
|
||||
VAR
|
||||
FUB_AsArLogWrite : AsArLogWrite;
|
||||
TOF_ResetAxisErrors : TOF;
|
||||
TON_Slay1Up : TON;
|
||||
TON_Slay2Up : TON;
|
||||
END_VAR
|
||||
43
Logical/Axises/PressCtrl/PressCtrlInit.st
Normal file
43
Logical/Axises/PressCtrl/PressCtrlInit.st
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
PROGRAM _INIT
|
||||
lAxisShaft1 ACCESS ADR (gAxis[0]);
|
||||
|
||||
|
||||
//Prepare Trace (later from Dataobject)
|
||||
strcpy (ADR (gMAxTrace.Trace_Config.DatObj.Device), ADR ('logfiles'));
|
||||
strcpy (ADR (gMAxTrace.Trace_Config.DatObj.Name), ADR ('ParTrace'));
|
||||
gMAxTrace.Trace_Config.DatObj.Type := mcFILE + mcADD_DATE_TIME;
|
||||
//gMAxTrace.Trace_Config.DatObj.Type := mcDATOBJ;
|
||||
|
||||
//Setup Trace
|
||||
gMAxTrace.Trace_Config.ParTrace.Parameter[0].Axis := ADR (gAxShaft1);
|
||||
gMAxTrace.Trace_Config.ParTrace.Parameter[0].ParID := ACP10PAR_SCTRL_SPEED_ACT;
|
||||
gMAxTrace.Trace_Config.ParTrace.Parameter[1].Axis := ADR (gAxShaft1);
|
||||
gMAxTrace.Trace_Config.ParTrace.Parameter[1].ParID := ACP10PAR_TORQUE_ACT;
|
||||
gMAxTrace.Trace_Config.ParTrace.Parameter[2].Axis := ADR (gAxShaft1);
|
||||
gMAxTrace.Trace_Config.ParTrace.Parameter[2].ParID := ACP10PAR_PCTRL_LAG_ERROR;
|
||||
gMAxTrace.Trace_Config.ParTrace.Parameter[3].Axis := ADR (gAxShaft1);
|
||||
gMAxTrace.Trace_Config.ParTrace.Parameter[3].ParID := ACP10PAR_PCTRL_S_ACT ;
|
||||
gMAxTrace.Trace_Config.ParTrace.Trigger.Axis := ADR (gAxShaft1);
|
||||
gMAxTrace.Trace_Config.ParTrace.Trigger.ParID := ACP10PAR_PCTRL_V_SET;
|
||||
gMAxTrace.Trace_Config.ParTrace.Trigger.Event:= mcOUT_WINDOW;
|
||||
gMAxTrace.Trace_Config.ParTrace.Trigger.Threshold := 1;
|
||||
gMAxTrace.Trace_Config.ParTrace.Trigger.Window := 1;
|
||||
gMAxTrace.Trace_Config.ParTrace.Type := mcMULTI_AXIS_TRACE;
|
||||
gMAxTrace.Trace_Config.ParTrace.TracingTime := 40;
|
||||
gMAxTrace.Trace_Config.ParTrace.SamplingTime := 0.02;
|
||||
gMAxTrace.Trace_Config.ParTrace.Delay := 0.0;
|
||||
gMAxTrace.Trace_Config.ParTrace.NetTriggerDelay := 0;
|
||||
|
||||
FUB_AsArLogWrite.ident := arlogBASE_USER_LOG_IDENT;
|
||||
|
||||
lAxisShaft1.Para.rAcceleration := 500;
|
||||
lAxisShaft1.Para.rDeceleration := 500;
|
||||
lAxisShaft1.Para.rJogVelocity := 40; // [0.1mm/s]
|
||||
lAxisShaft1.Para.rVelocity := 20; // [0.1mm/s]
|
||||
|
||||
//Calculate ForceFactor [kN] p=98%
|
||||
rTorqueForceFactor := -2 * brmPI * rGearFactor * 0.98 / rThreadPitch / 1000;
|
||||
|
||||
lAxisShaft1.Para.usHomeingMode := mcHOME_ABSOLUTE;
|
||||
END_PROGRAM
|
||||
7
Logical/Axises/acp10etxde/Ett.dob
Normal file
7
Logical/Axises/acp10etxde/Ett.dob
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<DataObject xmlns="http://br-automation.co.at/AS/DataObject">
|
||||
<Files>
|
||||
<File>acp10etxde.ett</File>
|
||||
</Files>
|
||||
</DataObject>
|
||||
3843
Logical/Axises/acp10etxde/acp10etxde.ett
Normal file
3843
Logical/Axises/acp10etxde/acp10etxde.ett
Normal file
File diff suppressed because it is too large
Load Diff
8
Logical/Common/GlobalCommon.typ
Normal file
8
Logical/Common/GlobalCommon.typ
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
TYPE
|
||||
typAlarm : STRUCT
|
||||
Alarm : ARRAY[0..127]OF BOOL;
|
||||
Ack : ARRAY[0..127]OF BOOL;
|
||||
Bypass : ARRAY[0..127]OF BOOL;
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
24
Logical/Common/GlobalComon.var
Normal file
24
Logical/Common/GlobalComon.var
Normal file
@@ -0,0 +1,24 @@
|
||||
VAR
|
||||
bBlink0_1 : BOOL;
|
||||
bBlink0_5 : BOOL;
|
||||
bBlink1_0 : BOOL;
|
||||
bBlink2_0 : BOOL;
|
||||
bBlink5_0 : BOOL;
|
||||
gdtCurrentTime : DATE_AND_TIME; (*Current Date and Time*)
|
||||
gDTstrucCurrentTime : DTStructure := (0); (*Current Date and Time as DTStructure*)
|
||||
gsCurrentTime : STRING[25] := ''; (*Current Date and Time as String*)
|
||||
gTCurrentTime : TIME := T#0ms; (*Current Time*)
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
gAInNull : INT := 0; (*O FOR Analog Input*)
|
||||
gTrue : BOOL := TRUE; (*Konstant TRUE*)
|
||||
gFalse : BOOL := FALSE; (*Konstant False*)
|
||||
gInNull : BOOL := FALSE; (*FALSE FOR Input *)
|
||||
END_VAR
|
||||
VAR
|
||||
gOuNull : BOOL; (*DUMMY for Output*)
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
iAIVoltageOverflow : INT := 16#7FFF; (* Analog Input Voltage Mode,Overflow *)
|
||||
iAIVoltageUnderflow : INT := -32767; (* Analog Input Voltage Underflow *)
|
||||
END_VAR
|
||||
10
Logical/Common/Package.pkg
Normal file
10
Logical/Common/Package.pkg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Package xmlns="http://br-automation.co.at/AS/Package">
|
||||
<Objects>
|
||||
<Object Type="File">GlobalCommon.typ</Object>
|
||||
<Object Type="File">GlobalComon.var</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Current Date_And_Time / DT Struct">get_dt</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Blinker 0,1 -0,5s">blinker</Object>
|
||||
</Objects>
|
||||
</Package>
|
||||
9
Logical/Common/blinker/IEC.prg
Normal file
9
Logical/Common/blinker/IEC.prg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Program xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File Description="Local variables" Private="true">blinker.var</File>
|
||||
<File Description="Initialization code">blinkerInit.ab</File>
|
||||
<File Description="Cyclic code">blinkerCyclic.ab</File>
|
||||
</Files>
|
||||
</Program>
|
||||
13
Logical/Common/blinker/blinker.var
Normal file
13
Logical/Common/blinker/blinker.var
Normal file
@@ -0,0 +1,13 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT -- kA
|
||||
********************************************************************
|
||||
* Program: blinker
|
||||
* File: blinker.var
|
||||
* Author: michi
|
||||
* Created: November 23, 2009
|
||||
********************************************************************
|
||||
* Local variables of program blinker
|
||||
********************************************************************)
|
||||
VAR
|
||||
iCount : USINT;
|
||||
END_VAR
|
||||
30
Logical/Common/blinker/blinkerCyclic.ab
Normal file
30
Logical/Common/blinker/blinkerCyclic.ab
Normal file
@@ -0,0 +1,30 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT -- kA
|
||||
********************************************************************
|
||||
* Program: blinker
|
||||
* File: blinkerCyclic.ab
|
||||
* Author: michi
|
||||
* Created: November 23, 2009
|
||||
********************************************************************
|
||||
* Implementation of program blinker
|
||||
********************************************************************)
|
||||
|
||||
PROGRAM _CYCLIC
|
||||
(* cyclic program *)
|
||||
;Has to be taskclass 100ms
|
||||
bBlink0_1 = not bBlink0_1
|
||||
inc (iCount)
|
||||
if ((iCount mod 5) = 0) then
|
||||
bBlink0_5 = not bBlink0_5
|
||||
endif
|
||||
if ((iCount mod 10) = 0) then
|
||||
bBlink1_0 = not bBlink1_0
|
||||
endif
|
||||
if ((iCount mod 20) = 0) then
|
||||
bBlink2_0 = not bBlink2_0
|
||||
endif
|
||||
if ((iCount mod 50) = 0) then
|
||||
bBlink5_0 = not bBlink5_0
|
||||
iCount = 0
|
||||
endif
|
||||
END_PROGRAM
|
||||
16
Logical/Common/blinker/blinkerInit.ab
Normal file
16
Logical/Common/blinker/blinkerInit.ab
Normal file
@@ -0,0 +1,16 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT -- kA
|
||||
********************************************************************
|
||||
* Program: blinker
|
||||
* File: blinkerInit.ab
|
||||
* Author: michi
|
||||
* Created: November 23, 2009
|
||||
********************************************************************
|
||||
* Implementation of program blinker
|
||||
********************************************************************)
|
||||
|
||||
PROGRAM _INIT
|
||||
iCount = 0
|
||||
|
||||
END_PROGRAM
|
||||
|
||||
9
Logical/Common/get_dt/IEC.prg
Normal file
9
Logical/Common/get_dt/IEC.prg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Program xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File>get_dtCyclic.ab</File>
|
||||
<File Private="true">get_dt.var</File>
|
||||
<File>get_dtInit.ab</File>
|
||||
</Files>
|
||||
</Program>
|
||||
6
Logical/Common/get_dt/get_dt.var
Normal file
6
Logical/Common/get_dt/get_dt.var
Normal file
@@ -0,0 +1,6 @@
|
||||
VAR
|
||||
sTemp : STRING[10] := '';
|
||||
lDTStructureGetTime : DTStructureGetTime := (0);
|
||||
lDTGetTime : DTGetTime := (0);
|
||||
lTimeStructure : TIMEStructure := (0);
|
||||
END_VAR
|
||||
44
Logical/Common/get_dt/get_dtCyclic.ab
Normal file
44
Logical/Common/get_dt/get_dtCyclic.ab
Normal file
@@ -0,0 +1,44 @@
|
||||
PROGRAM _CYCLIC
|
||||
(* cyclic program *)
|
||||
|
||||
lDTGetTime.enable = true
|
||||
lDTGetTime FUB DTGetTime()
|
||||
gdtCurrentTime = lDTGetTime.DT1
|
||||
|
||||
lDTStructureGetTime.enable = true
|
||||
lDTStructureGetTime FUB DTStructureGetTime ()
|
||||
lDTStructureGetTime.pDTStructure = adr (gDTstrucCurrentTime)
|
||||
|
||||
ascDTStructure (adr (gDTstrucCurrentTime), adr (gsCurrentTime), 25)
|
||||
strcpy (adr (gsCurrentTime), "")
|
||||
itoa (gDTstrucCurrentTime.year, adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), "/")
|
||||
itoa (gDTstrucCurrentTime.month, adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), "/")
|
||||
itoa (gDTstrucCurrentTime.day, adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), " ")
|
||||
itoa (gDTstrucCurrentTime.hour, adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), ":")
|
||||
itoa (gDTstrucCurrentTime.minute, adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), ":")
|
||||
itoa (gDTstrucCurrentTime.second, adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), ".")
|
||||
itoa (gDTstrucCurrentTime.millisec, adr (sTemp))
|
||||
strcat (adr (gsCurrentTime), adr (sTemp))
|
||||
|
||||
lTimeStructure.day = gDTstrucCurrentTime.day
|
||||
lTimeStructure.hour = gDTstrucCurrentTime.hour
|
||||
lTimeStructure.minute = gDTstrucCurrentTime.minute
|
||||
lTimeStructure.second = gDTstrucCurrentTime.second
|
||||
lTimeStructure.millisec = gDTstrucCurrentTime.millisec
|
||||
lTimeStructure.microsec = gDTstrucCurrentTime.microsec
|
||||
gTCurrentTime = TIMEStructure_TO_TIME (adr (lTimeStructure))
|
||||
|
||||
END_PROGRAM
|
||||
|
||||
4
Logical/Common/get_dt/get_dtInit.ab
Normal file
4
Logical/Common/get_dt/get_dtInit.ab
Normal file
@@ -0,0 +1,4 @@
|
||||
PROGRAM _INIT
|
||||
(* init program *)
|
||||
END_PROGRAM
|
||||
|
||||
13
Logical/Global.typ
Normal file
13
Logical/Global.typ
Normal file
@@ -0,0 +1,13 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT --
|
||||
********************************************************************
|
||||
* File: Global.typ
|
||||
* Author: michi
|
||||
* Created: March 15, 2013
|
||||
********************************************************************
|
||||
* Global data types of project franz_boerdel
|
||||
********************************************************************)
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
13
Logical/GlobalVar/Global.typ
Normal file
13
Logical/GlobalVar/Global.typ
Normal file
@@ -0,0 +1,13 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT -- kA
|
||||
********************************************************************
|
||||
* File: Global.typ
|
||||
* Author: michi
|
||||
* Created: August 14, 2009
|
||||
********************************************************************
|
||||
* Global data types of project schrauber
|
||||
********************************************************************)
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
12
Logical/GlobalVar/Global.var
Normal file
12
Logical/GlobalVar/Global.var
Normal file
@@ -0,0 +1,12 @@
|
||||
(*//ST 2*)
|
||||
VAR
|
||||
gbInEStopPressed : BOOL;
|
||||
gbInStartProcess : BOOL;
|
||||
gbInEStopOk : BOOL; (*Nothaltkreis Ok*)
|
||||
gbInSafetyChainOk : BOOL; (*Sicherheitskreis gesamt Ok*)
|
||||
END_VAR
|
||||
(*//ST3*)
|
||||
VAR
|
||||
gbOuLEDEStop : BOOL;
|
||||
gbOuLEDStart : BOOL;
|
||||
END_VAR
|
||||
8
Logical/GlobalVar/Package.pkg
Normal file
8
Logical/GlobalVar/Package.pkg
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Package xmlns="http://br-automation.co.at/AS/Package">
|
||||
<Objects>
|
||||
<Object Type="File" Description="Global data types">Global.typ</Object>
|
||||
<Object Type="File" Description="Global variables">Global.var</Object>
|
||||
</Objects>
|
||||
</Package>
|
||||
14
Logical/Libraries/Acp10_MC/Binary.lby
Normal file
14
Logical/Libraries/Acp10_MC/Binary.lby
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library Version="2.37.0" xmlns="http://br-automation.co.at/AS/Library" Description="PLCopen Motion Control function blocks">
|
||||
<Files>
|
||||
<File>acp10_mc.var</File>
|
||||
<File>acp10_mc.typ</File>
|
||||
<File>acp10_mc.fun</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="Sys_lib" FromVersion="0.00.0" />
|
||||
<Dependency ObjectName="Brsystem" FromVersion="0.00.0" />
|
||||
<Dependency ObjectName="Acp10man" FromVersion="2.37.0" ToVersion="2.37.0" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
BIN
Logical/Libraries/Acp10_MC/SG3/acp10_mc.br
Normal file
BIN
Logical/Libraries/Acp10_MC/SG3/acp10_mc.br
Normal file
Binary file not shown.
5835
Logical/Libraries/Acp10_MC/SG3/acp10_mc.h
Normal file
5835
Logical/Libraries/Acp10_MC/SG3/acp10_mc.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Logical/Libraries/Acp10_MC/SG3/libacp10_mc.a
Normal file
BIN
Logical/Libraries/Acp10_MC/SG3/libacp10_mc.a
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10_MC/SG4/acp10_mc.br
Normal file
BIN
Logical/Libraries/Acp10_MC/SG4/acp10_mc.br
Normal file
Binary file not shown.
6244
Logical/Libraries/Acp10_MC/SG4/acp10_mc.h
Normal file
6244
Logical/Libraries/Acp10_MC/SG4/acp10_mc.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Logical/Libraries/Acp10_MC/SG4/libacp10_mc.a
Normal file
BIN
Logical/Libraries/Acp10_MC/SG4/libacp10_mc.a
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10_MC/SGC/acp10_mc.br
Normal file
BIN
Logical/Libraries/Acp10_MC/SGC/acp10_mc.br
Normal file
Binary file not shown.
5835
Logical/Libraries/Acp10_MC/SGC/acp10_mc.h
Normal file
5835
Logical/Libraries/Acp10_MC/SGC/acp10_mc.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Logical/Libraries/Acp10_MC/SGC/libacp10_mc.a
Normal file
BIN
Logical/Libraries/Acp10_MC/SGC/libacp10_mc.a
Normal file
Binary file not shown.
6321
Logical/Libraries/Acp10_MC/acp10_mc.fun
Normal file
6321
Logical/Libraries/Acp10_MC/acp10_mc.fun
Normal file
File diff suppressed because it is too large
Load Diff
1638
Logical/Libraries/Acp10_MC/acp10_mc.typ
Normal file
1638
Logical/Libraries/Acp10_MC/acp10_mc.typ
Normal file
File diff suppressed because it is too large
Load Diff
197
Logical/Libraries/Acp10_MC/acp10_mc.var
Normal file
197
Logical/Libraries/Acp10_MC/acp10_mc.var
Normal file
@@ -0,0 +1,197 @@
|
||||
VAR CONSTANT
|
||||
mc5TH_ORDER_POLYNOMIAL : UINT := 4; (*motion rule*)
|
||||
mcABOVE_WINDOW : USINT := 40; (*trigger event mode*)
|
||||
mcABSOLUTE : USINT := 0; (*start mode*)
|
||||
mcABSOLUTE_NO_RESET : USINT := 2; (*definition for the shift input of MC_BR_Offset and MC_BR_Phasing*)
|
||||
mcACKNOWLEDGE_ALL : UINT := 2; (*acknowledge all error records immediately*)
|
||||
mcACT_CFG : UINT := 1;
|
||||
mcADD_DATE_TIME : UINT := 1; (*additional data object type*)
|
||||
mcALL_AXES : UDINT := 16#FFFFFFFF;
|
||||
mcALL_EVENTS : USINT := 255; (*event index*)
|
||||
mcALL_PARAMS : USINT := 0; (*parameter index*)
|
||||
mcALL_STATES : USINT := 255; (*state index*)
|
||||
mcAUTOMAT_POS : USINT := 100; (*additional movement direction*)
|
||||
mcAVERAGE : UINT := 2;
|
||||
mcAVERAGE_WEIGHTED : UINT := 4;
|
||||
mcAXIS_ERROR : USINT := 0;
|
||||
mcAXIS_WARNING : USINT := 1;
|
||||
mcBASIS_PARAMETERS : REAL := 2.0; (*Option for DefaultMoveParameter*)
|
||||
mcBELOW_WINDOW : USINT := 50; (*trigger event mode*)
|
||||
mcBESTFIT_5TH_ORDER : UINT := 1024; (*interpolation rule*)
|
||||
mcBESTFIT_6TH_ORDER : UINT := 1280; (*interpolation rule*)
|
||||
mcBLANK : UINT := 0;
|
||||
mcBRAKE_CONTROL_INIT : USINT := 8; (*brake command*)
|
||||
mcBRAKE_TEST_INIT : USINT := 2; (*brake command*)
|
||||
mcBRAKE_TEST_START : USINT := 4; (*brake command*)
|
||||
mcCALCULATION : UINT := 11; (*setup mode*)
|
||||
mcCATCH_UP : USINT := 4; (*synchronization mode*)
|
||||
mcCHECK : UINT := 1; (*mode for automat compensation check*)
|
||||
mcCHECK_HOMING_OFF : USINT := 1; (*disable homing check*)
|
||||
mcCLOSE : USINT := 0;
|
||||
mcCONTINUE_CONTROLLER_OFF : UINT := 128; (* continue if controller is off *)
|
||||
mcCORRECT_CURRENT_CYCLE : UINT := 32768; (*additive StartMode for MC_BR_CrossCutterControl*)
|
||||
mcCUBIC_SPLINE : UINT := 256; (*interpolation rule*)
|
||||
mcCURRENT_DIR : USINT := 2; (*movement direction*)
|
||||
mcCYCLIC : UINT := 2; (*event move mode*)
|
||||
mcCYCLIC_ALL_EVENTS : UINT := 3; (*event move mode*)
|
||||
mcDATOBJ : UINT := 0; (*data object type*)
|
||||
mcDIRECT : USINT := 7; (*start mode*)
|
||||
mcDISTANCE_BASED : UINT := 0; (*basis for cam movement (e.g. for MC_BR_CamTransition)*)
|
||||
mcDITHER : USINT := 32; (*setup mode*)
|
||||
mcEDGE_SENSITIVE : USINT := 4; (*additional mode for trigger event*)
|
||||
mcENCODER : USINT := 0; (*setup mode*)
|
||||
mcEQUAL : UINT := 2;
|
||||
mcEVERY_RECORD : UINT := 1; (*mode for MC_BR_CyclicRead*)
|
||||
mcEXCEED_PERIOD : USINT := 8; (*movement direction*)
|
||||
mcFB_ERROR : USINT := 2;
|
||||
mcFB_INPUTS : REAL := 255.0; (*option for DefaultMoveParameters*)
|
||||
mcFF : USINT := 32; (*setup, torque mode*)
|
||||
mcFF_NEG_MOVE : UINT := 34; (*setup mode*)
|
||||
mcFF_POS_MOVE : UINT := 33; (*setup mode*)
|
||||
mcFILE : UINT := 1; (*data object type*)
|
||||
mcFILE_BIN : UINT := 0; (*binary format*)
|
||||
mcFILE_CSV : UINT := 1; (*CSV format*)
|
||||
mcFILE_TXT : UINT := 2; (*text format*)
|
||||
mcFIRST_TRIGGER : UINT := 2;
|
||||
mcFLUX : USINT := 1; (*setup mode*)
|
||||
mcGE : UINT := 6;
|
||||
mcGET_BRAKE_STATUS : USINT := 16; (*brake command*)
|
||||
mcGREATER : UINT := 4;
|
||||
mcHARMONIC_COMBINATION : UINT := 8; (*motion rule*)
|
||||
mcHOLDOFF_DISTANCE : UINT := 16384;
|
||||
mcHOME_ABS_SWITCH : USINT := 2; (*homing mode*)
|
||||
mcHOME_ABSOLUTE : USINT := 4; (*homing mode*)
|
||||
mcHOME_ABSOLUTE_CORR : USINT := 6; (*homing mode*)
|
||||
mcHOME_AXIS_REF : USINT := 12; (*homing mode *)
|
||||
mcHOME_BLOCK_DS : USINT := 14; (*homing mode *)
|
||||
mcHOME_BLOCK_TORQUE : USINT := 13; (*homing mode *)
|
||||
mcHOME_DCM : USINT := 9; (*homing mode*)
|
||||
mcHOME_DCM_CORR : USINT := 10; (*homing mode*)
|
||||
mcHOME_DEFAULT : USINT := 0; (*homing mode*)
|
||||
mcHOME_DIRECT : USINT := 1; (*homing mode*)
|
||||
mcHOME_LIMIT_SWITCH : USINT := 3; (*homing mode*)
|
||||
mcHOME_REF_PULSE : USINT := 5; (*homing mode*)
|
||||
mcHOME_RESTORE_POS : USINT := 11; (*homing mode*)
|
||||
mcHOME_SET_PHASE : USINT := 7; (*homing mode*)
|
||||
mcHOME_SWITCH_GATE : USINT := 8; (*homing mode*)
|
||||
mcHORIZONTAL : USINT := 0; (*setup option for controller setup*)
|
||||
mcIDENTIFICATION : UINT := 10; (*setup mode *)
|
||||
mcIMMEDIATE : UINT := 0; (*mode for MC_BR_RegMarkCalc001, StartMode for MC_BR_CrossCutterControl, *)
|
||||
mcIN_WINDOW : USINT := 20; (*trigger event mode*)
|
||||
mcINCLINED_SINE_CURVE : UINT := 5; (*motion rule*)
|
||||
mcINTERVAL_EVENT : UINT := 16;
|
||||
mcIPL_LINEAR : USINT := 1; (*interpolation mode*)
|
||||
mcIPL_OFF : USINT := 0; (*interpolation mode*)
|
||||
mcIPL_QUADRATIC : USINT := 2; (*interpolation mode*)
|
||||
mcIPL_QUADRATIC_NO_OVERSHOOT : USINT := 4; (*interpolation mode*)
|
||||
mcISQ_F1_NOTCH : UINT := 128; (*setup mode*)
|
||||
mcISQ_F2_NOTCH : UINT := 256; (*setup mode*)
|
||||
mcISQ_F3_NOTCH : UINT := 512; (*setup mode*)
|
||||
mcISQ_RIPPLE : UINT := 20; (*setup mode*)
|
||||
mcLAST_POINT : UINT := 0; (*motion rule*)
|
||||
mcLEAD_IN : UINT := 2;
|
||||
mcLEAD_OUT : UINT := 4;
|
||||
mcLENGTH_ONLY : UINT := 32;
|
||||
mcLIMIT : USINT := 40; (*torque mode*)
|
||||
mcLIMIT_PARAMETERS : REAL := 1.0; (*option for DefaultMoveParameters*)
|
||||
mcLINEAR_CAM : USINT := 253; (*predefined 1:1 cam profile for MC_BR_CamDwell*)
|
||||
mcLINEAR_CAM_NON_PERIODIC : USINT := 254; (*for predifined 1:1 cam profile*)
|
||||
mcLINEAR_CAM_PERIODIC : USINT := 255; (*for predefined 1:1 cam profile*)
|
||||
mcLOAD : UINT := 276; (*trace command*)
|
||||
mcMANUAL_SEARCH : UINT := 64;
|
||||
mcMASTER_DISTANCE_BASED : UINT := 3; (*basis for movement profile (e.g. for MC_BR_Offset or MC_BR_Phasing)*)
|
||||
mcMASTER_POSITION : UINT := 256; (*additional basis for movement profile (e.g. for MC_BR_Offset), StartMode for MC_BR_CrossCutterControl*)
|
||||
mcMASTER_POSITION_BASED : UINT := 2; (*basis for movement profile (e.g. for MC_BR_Offset or MC_BR_Phasing)*)
|
||||
mcMAX_IV_TIME : USINT := 8; (*additional mode for power evaluation*)
|
||||
mcMAX_SLAVE_COMP_DISTANCE_NEG : UINT := 4; (*mode for automat compensation check*)
|
||||
mcMAX_SLAVE_COMP_DISTANCE_POS : UINT := 3; (*mode for automat compensation check*)
|
||||
mcMIDDLE : USINT := 5;
|
||||
mcMIN_MASTER_COMP_DISTANCE : UINT := 2; (*mode for automat compensation check*)
|
||||
mcMODIFIED_ACCEL_TRAPEZOID : UINT := 6; (*motion rule*)
|
||||
mcMODIFIED_SINE_CURVE : UINT := 7; (*motion rule*)
|
||||
mcMOTOR : UINT := 258; (*switch on simulation mode*)
|
||||
mcMULTI_AXIS_TRACE : UDINT := 0; (*parameter trace type*)
|
||||
mcN_EDGE : USINT := 1;
|
||||
mcNEGATIVE_DIR : USINT := 1; (*movement direction*)
|
||||
mcNET_TRACE_GLOBAL : UDINT := 0; (*network trace type*)
|
||||
mcNO_CHANGE_COMP : USINT := 2;
|
||||
mcNO_EVENTS : USINT := 253; (*event index*)
|
||||
mcNO_PARAMS : USINT := 253; (*parameter index*)
|
||||
mcNO_POSITION : USINT := 0;
|
||||
mcNO_START_COMP : USINT := 1;
|
||||
mcNO_TEXT : UINT := 0; (*no error text determination active*)
|
||||
mcNON_PERIODIC : BOOL := FALSE; (*cam profile mode*)
|
||||
mcNOT_AXIS_RELATED : UDINT := 16#FFFFFFFF;
|
||||
mcNULL : UINT := 1;
|
||||
mcOFF : BOOL := FALSE;
|
||||
mcON : BOOL := TRUE;
|
||||
mcONCE : UINT := 1;
|
||||
mcONE_RECORD : UINT := 0; (*mode for MC_BR_CyclicRead*)
|
||||
mcONLY_EVENTS : USINT := 254; (*event index*)
|
||||
mcONLY_PSM : USINT := 1; (*power evaluation mode*)
|
||||
mcOPEN : USINT := 1;
|
||||
mcOPTIMIZED_ACCELERATION : UINT := 768; (*interpolation rule*)
|
||||
mcOPTIMIZED_VELOCITY : UINT := 512; (*interpolation rule*)
|
||||
mcOUT_WINDOW : USINT := 30; (*trigger event mode*)
|
||||
mcP_EDGE : USINT := 0;
|
||||
mcPERIODIC : BOOL := TRUE; (*cam profile mode*)
|
||||
mcPOSITION : USINT := 1; (*setup mode*)
|
||||
mcPOSITIVE_DIR : USINT := 0; (*movement direction*)
|
||||
mcQUADRATIC_PARABOLA : UINT := 2; (*motion rule*)
|
||||
mcQUEUED : UINT := 1;
|
||||
mcRELATIVE : USINT := 1; (*start mode*)
|
||||
mcRESET : UINT := 320; (*trace command*)
|
||||
mcRESTART : UINT := 273; (*StartMode for MC_BR_CrossCutterControl*)
|
||||
mcREVERSE : UINT := 8;
|
||||
mcSATURATION : USINT := 30; (*setup mode*)
|
||||
mcSAVE : UINT := 341; (*trace command*)
|
||||
mcSE : UINT := 3;
|
||||
mcSET_OFFSET : USINT := 34; (*setup mode*)
|
||||
mcSHIFT_FROM_EXPECTED : UINT := 50; (*input for MC_BR_TouchProbe*)
|
||||
mcSHIFT_FROM_RESULT : UINT := 49; (*input for MC_BR_TouchProbe*)
|
||||
mcSHORTEST_WAY : USINT := 3; (*synchronization mode, movement direction*)
|
||||
mcSIMPLE_SINE_CURVE : UINT := 3; (*motion rule*)
|
||||
mcSIMULATION_OFF : UINT := 259; (*switch off simulation mode*)
|
||||
mcSLAVE_POSITION : UINT := 0; (*additional basis for movement profile (e.g. for MC_BR_Offset)*)
|
||||
mcSLOW_DOWN : USINT := 5; (*synchronization mode*)
|
||||
mcSMALLER : UINT := 1;
|
||||
mcSPEED : USINT := 2; (*setup mode*)
|
||||
mcSTART : UINT := 260;
|
||||
mcSTART_ONLY : USINT := 3; (*power evaluation mode*)
|
||||
mcSTEPPER : USINT := 31; (*setup mode*)
|
||||
mcSTOP : UINT := 261;
|
||||
mcSTRAIGHT_LINE : UINT := 1; (*motion rule*)
|
||||
mcSW_END_ACTIVE : REAL := 0.0; (*SW end monitoring mode*)
|
||||
mcSW_END_IGNORE : REAL := 1.0; (*SW end monitoring mode*)
|
||||
mcSW_END_SPF : REAL := 2.0; (*SW end monitoring mode*)
|
||||
mcSWITCH_OFF : UINT := 259; (*trace command*)
|
||||
mcSWITCH_ON : UINT := 258; (*trace command*)
|
||||
mcT_FILTER : UINT := 64; (*setup mode*)
|
||||
mcTEST : UINT := 31; (*setup mode*)
|
||||
mcTEXT : UINT := 1; (*error text determination active*)
|
||||
mcTIME_BASED : UINT := 1; (*basis for movement profile (e.g. for MC_BR_Offset or MC_BR_Phasing)*)
|
||||
mcTIME_LIMIT : USINT := 8; (*enable time dependent switch off of function*)
|
||||
mcTRACE_DELAY : USINT := 6; (*trace status*)
|
||||
mcTRACE_FINISHED : USINT := 1; (*trace status*)
|
||||
mcTRACE_REST : USINT := 5; (*trace status*)
|
||||
mcTRACE_RING : USINT := 4; (*trace status*)
|
||||
mcTRACE_STARTED : USINT := 20; (*trace status*)
|
||||
mcTRACE_TIME : USINT := 2; (*trace status*)
|
||||
mcTRACE_TRIGGER : USINT := 3; (*trace status*)
|
||||
mcTRANSITION_OFF : UINT := 0;
|
||||
mcTRANSITION_ON : UINT := 1;
|
||||
mcUNEQUAL : UINT := 5;
|
||||
mcUPDATE_PERIOD : UINT := 16#8000; (*input for MC_BR_TouchProbe*)
|
||||
mcUSE_AXIS_PERIOD : UINT := 16#4000; (*input for MC_BR_TouchProbe*)
|
||||
mcUSE_FILTER_PAR : UINT := 4; (*setup mode *)
|
||||
mcUSE_FIRST_TRIGGER_POS : UINT := 64; (*additional input for MC_BR_TouchProbe*)
|
||||
mcUSE_STOP_COMP : USINT := 4;
|
||||
mcV_LIMIT_CALC : USINT := 4; (*recalculate speed limit depending on user setting*)
|
||||
mcV_LIMIT_OFF : USINT := 2; (*disable speed limit*)
|
||||
mcVELOCITY_CONTROL : UINT := 4; (*basis for movement profile (e.g. for MC_BR_Offset or MC_BR_Phasing)*)
|
||||
mcVERTICAL : USINT := 1; (*setup option for controller setup*)
|
||||
mcWITH_PARAM : USINT := 2; (*power evaluation mode*)
|
||||
mcWITHIN_PERIOD : USINT := 6; (*synchronization mode*)
|
||||
mcWITHOUT_PERIOD : UINT := 4; (*input for MC_BR_TouchProbe*)
|
||||
mcWRAP : UINT := 2;
|
||||
END_VAR
|
||||
1537
Logical/Libraries/Acp10man/Acp10err-de.txt
Normal file
1537
Logical/Libraries/Acp10man/Acp10err-de.txt
Normal file
File diff suppressed because it is too large
Load Diff
1537
Logical/Libraries/Acp10man/Acp10err-en.txt
Normal file
1537
Logical/Libraries/Acp10man/Acp10err-en.txt
Normal file
File diff suppressed because it is too large
Load Diff
1044
Logical/Libraries/Acp10man/Acp10man.typ
Normal file
1044
Logical/Libraries/Acp10man/Acp10man.typ
Normal file
File diff suppressed because it is too large
Load Diff
1913
Logical/Libraries/Acp10man/Acp10par-de.txt
Normal file
1913
Logical/Libraries/Acp10man/Acp10par-de.txt
Normal file
File diff suppressed because it is too large
Load Diff
1913
Logical/Libraries/Acp10man/Acp10par-en.txt
Normal file
1913
Logical/Libraries/Acp10man/Acp10par-en.txt
Normal file
File diff suppressed because it is too large
Load Diff
11
Logical/Libraries/Acp10man/Binary.lby
Normal file
11
Logical/Libraries/Acp10man/Binary.lby
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library Version="2.37.0" xmlns="http://br-automation.co.at/AS/Library" Description="Motion Control Manager">
|
||||
<Files>
|
||||
<File>Acp10man.typ</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="Acp10par" FromVersion="2.37.0" ToVersion="2.37.0" />
|
||||
<Dependency ObjectName="Ncglobal" FromVersion="2.37.0" ToVersion="2.37.0" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
BIN
Logical/Libraries/Acp10man/SG3/CAN/acp10man.br
Normal file
BIN
Logical/Libraries/Acp10man/SG3/CAN/acp10man.br
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/SG3/CAN/acp10sys.br
Normal file
BIN
Logical/Libraries/Acp10man/SG3/CAN/acp10sys.br
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/SG3/Powerlink/acp10man.br
Normal file
BIN
Logical/Libraries/Acp10man/SG3/Powerlink/acp10man.br
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/SG3/Powerlink/acp10sys.br
Normal file
BIN
Logical/Libraries/Acp10man/SG3/Powerlink/acp10sys.br
Normal file
Binary file not shown.
1202
Logical/Libraries/Acp10man/SG3/acp10man.h
Normal file
1202
Logical/Libraries/Acp10man/SG3/acp10man.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Logical/Libraries/Acp10man/SG3/libacp10man.a
Normal file
BIN
Logical/Libraries/Acp10man/SG3/libacp10man.a
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/SG4/CAN/acp10man.br
Normal file
BIN
Logical/Libraries/Acp10man/SG4/CAN/acp10man.br
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/SG4/CAN/acp10sys.br
Normal file
BIN
Logical/Libraries/Acp10man/SG4/CAN/acp10sys.br
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/SG4/Powerlink/acp10man.br
Normal file
BIN
Logical/Libraries/Acp10man/SG4/Powerlink/acp10man.br
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/SG4/Powerlink/acp10sys.br
Normal file
BIN
Logical/Libraries/Acp10man/SG4/Powerlink/acp10sys.br
Normal file
Binary file not shown.
1202
Logical/Libraries/Acp10man/SG4/acp10man.h
Normal file
1202
Logical/Libraries/Acp10man/SG4/acp10man.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Logical/Libraries/Acp10man/SG4/libacp10man.a
Normal file
BIN
Logical/Libraries/Acp10man/SG4/libacp10man.a
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/SGC/CAN/acp10man.br
Normal file
BIN
Logical/Libraries/Acp10man/SGC/CAN/acp10man.br
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/SGC/CAN/acp10sys.br
Normal file
BIN
Logical/Libraries/Acp10man/SGC/CAN/acp10sys.br
Normal file
Binary file not shown.
1202
Logical/Libraries/Acp10man/SGC/acp10man.h
Normal file
1202
Logical/Libraries/Acp10man/SGC/acp10man.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Logical/Libraries/Acp10man/SGC/libacp10man.a
Normal file
BIN
Logical/Libraries/Acp10man/SGC/libacp10man.a
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10man/acp10bsl.br
Normal file
BIN
Logical/Libraries/Acp10man/acp10bsl.br
Normal file
Binary file not shown.
1550
Logical/Libraries/Acp10par/Acp10par.var
Normal file
1550
Logical/Libraries/Acp10par/Acp10par.var
Normal file
File diff suppressed because it is too large
Load Diff
7
Logical/Libraries/Acp10par/Binary.lby
Normal file
7
Logical/Libraries/Acp10par/Binary.lby
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library Version="2.37.0" xmlns="http://br-automation.co.at/AS/Library" Description="ACOPOS Parameters">
|
||||
<Files>
|
||||
<File>Acp10par.var</File>
|
||||
</Files>
|
||||
</Library>
|
||||
BIN
Logical/Libraries/Acp10par/SG3/acp10par.br
Normal file
BIN
Logical/Libraries/Acp10par/SG3/acp10par.br
Normal file
Binary file not shown.
1558
Logical/Libraries/Acp10par/SG3/acp10par.h
Normal file
1558
Logical/Libraries/Acp10par/SG3/acp10par.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Logical/Libraries/Acp10par/SG3/libacp10par.a
Normal file
BIN
Logical/Libraries/Acp10par/SG3/libacp10par.a
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10par/SG4/acp10par.br
Normal file
BIN
Logical/Libraries/Acp10par/SG4/acp10par.br
Normal file
Binary file not shown.
1558
Logical/Libraries/Acp10par/SG4/acp10par.h
Normal file
1558
Logical/Libraries/Acp10par/SG4/acp10par.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Logical/Libraries/Acp10par/SG4/libacp10par.a
Normal file
BIN
Logical/Libraries/Acp10par/SG4/libacp10par.a
Normal file
Binary file not shown.
BIN
Logical/Libraries/Acp10par/SGC/acp10par.br
Normal file
BIN
Logical/Libraries/Acp10par/SGC/acp10par.br
Normal file
Binary file not shown.
1558
Logical/Libraries/Acp10par/SGC/acp10par.h
Normal file
1558
Logical/Libraries/Acp10par/SGC/acp10par.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Logical/Libraries/Acp10par/SGC/libacp10par.a
Normal file
BIN
Logical/Libraries/Acp10par/SGC/libacp10par.a
Normal file
Binary file not shown.
133
Logical/Libraries/AsArLog/AsArLog.fun
Normal file
133
Logical/Libraries/AsArLog/AsArLog.fun
Normal file
@@ -0,0 +1,133 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT -- Bernecker + Rainer
|
||||
********************************************************************
|
||||
* Library: AsArLog
|
||||
* File: AsArLog.fun
|
||||
* Author: B+R
|
||||
********************************************************************
|
||||
* Functions and function blocks of library AsArLog
|
||||
********************************************************************)
|
||||
|
||||
FUNCTION_BLOCK AsArLogCreate (*creates an AR logger user module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pName : UDINT; (*name of the AR logger user module to be created give as a pointer, e.g. "vclog".*)
|
||||
len : UDINT; (*length of the log data area*)
|
||||
memType : UDINT; (*memory type on the target: arlogDRAM, arlogUSRRAM, arlogUSRROM*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
ident : UDINT; (*ident of the AR logger basis module to be generated*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
FUNCTION_BLOCK AsArLogDelete (*deletes an AR logger user module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*ident of the AR logger user module to be deleted*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
FUNCTION_BLOCK AsArLogWrite (*writes a log entry to a AR logger user module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*ident for the AR logger module to be written (user module or base module)*)
|
||||
logLevel : UDINT; (*log level of the log entry*)
|
||||
errornr : UDINT; (*error number of the entry*)
|
||||
mem : UDINT; (*binary log data given as a pointer*)
|
||||
len : UDINT; (*length of the binary log data in bytes*)
|
||||
asciiString : UDINT; (*log-specific zero-terminated ASCII string give as a pointer*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : UDINT; (*internal variable*)
|
||||
intTaskName : ARRAY[0..35] OF USINT; (*internal variable*)
|
||||
intRtkTime : ARRAY[0..3] OF UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
FUNCTION_BLOCK AsArLogRead (*reads a log entry from a AR logger module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*ident for the AR logger module to be read (user module or base module)*)
|
||||
index : UDINT; (*index of the log entry to be read*)
|
||||
arlogRead : UDINT; (*specifies read structure (given as a pointer) where the header data for the log entry can be copied*)
|
||||
memBin : UDINT; (*buffer for binary log data given as a pointer (if NULL, no binary log data is copied)*)
|
||||
lenBin : UDINT; (*number of binary log data bytes to be read (if NULL, no binary log data is copied)*)
|
||||
memAscii : UDINT; (*buffer for ASCII string given as a pointer*)
|
||||
lenAscii : UDINT; (*number of bytes to be read for the ASCII string*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
FUNCTION_BLOCK AsArLogClear (*deletes or reinitializes the log data in an AR logger user module; asynchronous execution*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
ident : UDINT; (*ident of the AR logger user module to be reinitialized*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
|
||||
FUNCTION_BLOCK AsArLogGetInfo (*reads information from a self-generated AR logger user module or AR logger base user module*)
|
||||
VAR_INPUT
|
||||
enable : BOOL; (*enables execution*)
|
||||
pName : UDINT; (*name of the AR logger user module (e.g. "vclog") given as a pointer*)
|
||||
END_VAR
|
||||
|
||||
VAR
|
||||
intResult : UDINT; (*internal variable*)
|
||||
intState : UDINT; (*internal variable*)
|
||||
intRes : UDINT; (*internal variable*)
|
||||
END_VAR
|
||||
|
||||
VAR_OUTPUT
|
||||
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
|
||||
ident : UDINT; (*ident of the AR logger BR module*)
|
||||
len : UDINT; (*length of the log data area*)
|
||||
memType : UDINT; (*memory type on the target*)
|
||||
actualIndex : UDINT; (*current entry index in the specified AR logger BR module*)
|
||||
FormatVer : UDINT; (*version of de log data format*)
|
||||
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
29
Logical/Libraries/AsArLog/AsArLog.typ
Normal file
29
Logical/Libraries/AsArLog/AsArLog.typ
Normal file
@@ -0,0 +1,29 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT -- Bernecker + Rainer
|
||||
********************************************************************
|
||||
* Library: AsArLog
|
||||
* File: AsArLog.typ
|
||||
* Author: B+R
|
||||
********************************************************************
|
||||
* Data types of library AsArLog
|
||||
********************************************************************)
|
||||
|
||||
TYPE
|
||||
asarlogRead : STRUCT
|
||||
len : UDINT; (*length of the entire log entry (header + binary log data + ASCII string)*)
|
||||
lenBin : UDINT; (*length of the binary log data*)
|
||||
lenAscii : UDINT; (*length of the ASCII log data*)
|
||||
logLevel : UDINT; (*log level of the log entry*)
|
||||
errornr : UDINT; (*error number of the entry*)
|
||||
taskName : ARRAY[0..35] OF USINT; (*task name*)
|
||||
errYear : UDINT; (*year (date of error)*)
|
||||
errMonth : UDINT; (*month (date of error)*)
|
||||
errDay : UDINT; (*day (date of error)*)
|
||||
errHour : UDINT; (*hour (time of error)*)
|
||||
errMinute : UDINT; (*minute (time of error)*)
|
||||
errSecond : UDINT; (*second (time of error)*)
|
||||
errMilliSec : UDINT; (*millisecond (time of error)*)
|
||||
errMicroSec : UDINT; (*microsecond (time of error)*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
|
||||
53
Logical/Libraries/AsArLog/AsArLog.var
Normal file
53
Logical/Libraries/AsArLog/AsArLog.var
Normal file
@@ -0,0 +1,53 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT -- Bernecker + Rainer
|
||||
********************************************************************
|
||||
* Library: AsArLog
|
||||
* File: AsArLog.var
|
||||
* Author: B+R
|
||||
********************************************************************
|
||||
* Local variables of library AsArLog
|
||||
********************************************************************)
|
||||
|
||||
VAR CONSTANT
|
||||
arlogDRAM : USINT := 65; (*temporary AR log modules (DRAM)*)
|
||||
arlogUSRRAM : USINT := 3; (*USERRAM*)
|
||||
arlogUSRROM : USINT := 2; (*USERROM (USER FLASH)*)
|
||||
|
||||
arlogLEVEL_INFO : UDINT := 1; (*log level INFO*)
|
||||
arlogLEVEL_WARNING : UDINT := 2; (*log level WARNING*)
|
||||
arlogLEVEL_FATAL : UDINT := 3; (*log level FATAL*)
|
||||
|
||||
arlogMIN_LOGDATA_SIZE : UINT := 4096; (*minimum log data size of 4 KB*)
|
||||
|
||||
arlogBASE_SYSTEM_LOG_IDENT : UDINT := 0; (*fixed ID for the "$arlogsys" base system module*)
|
||||
arlogBASE_USER_LOG_IDENT : UDINT := 1; (*fixed ID for the "$arlogusr" base user module*)
|
||||
arlogBASE_FIELDBUS_LOG_IDENT : UDINT := 2; (*fixed ID for the "fieldbus" logger module*)
|
||||
arlogBASE_SAFETY_LOG_IDENT : UDINT := 3; (*fixed ID for the "safety" logger module*)
|
||||
|
||||
arlogERR_ILL_NAME : UINT := 31400; (*incorrect or invalid name*)
|
||||
arlogERR_ILL_MEMTYPE : UINT := 31401; (*incorrect memory type*)
|
||||
arlogERR_ILL_LOGLEVEL : UINT := 31402; (*invalid log level (only arlogLEVEL_INFO, arlogLEVEL_WARNING, and arlogLEVEL_FATAL valid)*)
|
||||
arlogERR_ILL_PARAM : UINT := 31403; (*invalid parameters specified*)
|
||||
arlogERR_ILL_LEN : UINT := 31404; (*incorrect log data length. Must be >= arlogMIN_LOGDATA_SIZE (4096 bytes)*)
|
||||
arlogERR_EXISTING : UINT := 31405; (*log module already exists*)
|
||||
arlogERR_CREATE : UINT := 31406; (*general create error (create failed)*)
|
||||
arlogERR_INSTALL : UINT := 31407; (*install error for AsArLogCreate*)
|
||||
arlogERR_ACCESS_DENIED : UINT := 31408; (*cannot access the "$arlogsys" and "$arlogusr" base log modules*)
|
||||
arlogERR_IN_ACCESS : UINT := 31409; (*access denied since other critical FBK simultaneously active*)
|
||||
arlogERR_INVALID_IDENT : UINT := 31410; (*invalid ident specified*)
|
||||
arlogERR_DELETE : UINT := 31411; (*general delete error (delete failed)*)
|
||||
|
||||
arlogERR_NOMEMORY : UINT := 31412; (*not enough buffer to copy*)
|
||||
arlogERR_NOTEXISTING : UINT := 31416; (*AR log module doesn't exist*)
|
||||
|
||||
arlogERR_WRITE : UINT := 31417; (*general write error (write failed)*)
|
||||
arlogERR_WRITE_CALC_DATA : UINT := 31418; (*error calculating referencing index*)
|
||||
|
||||
arlogERR_READ : UINT := 31419; (*general read error (read failed)*)
|
||||
arlogERR_READ_BUFFER : UINT := 31420; (*invalid buffer specified*)
|
||||
arlogERR_INVALID_INDEX : UINT := 31421; (*invalid index (smaller than the reference index and larger than the current index)*)
|
||||
arlogERR_INVALID_ENTRY : UINT := 31422; (*invalid log entry read*)
|
||||
arlogERR_READ_BINARY_BUFFER : UINT := 31423; (*buffer length for binary data too small*)
|
||||
arlogERR_READ_ASCII_BUFFER : UINT := 31424; (*buffer length for ASCII data too small*)
|
||||
arlogERR_NO_MORE_ENTRY : UINT := 31425; (*FBK still working*)
|
||||
END_VAR
|
||||
12
Logical/Libraries/AsArLog/Binary.lby
Normal file
12
Logical/Libraries/AsArLog/Binary.lby
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Library Description="The AsArLog library can be used to collect additional error information and for further processing." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>AsArLog.var</File>
|
||||
<File>AsArLog.typ</File>
|
||||
<File>AsArLog.fun</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="runtime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
234
Logical/Libraries/AsArLog/SG4/AsArLog.h
Normal file
234
Logical/Libraries/AsArLog/SG4/AsArLog.h
Normal file
@@ -0,0 +1,234 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASARLOG_
|
||||
#define _ASARLOG_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#include <runtime.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define arlogERR_NO_MORE_ENTRY 31425U
|
||||
#define arlogERR_READ_ASCII_BUFFER 31424U
|
||||
#define arlogERR_READ_BINARY_BUFFER 31423U
|
||||
#define arlogERR_INVALID_ENTRY 31422U
|
||||
#define arlogERR_INVALID_INDEX 31421U
|
||||
#define arlogERR_READ_BUFFER 31420U
|
||||
#define arlogERR_READ 31419U
|
||||
#define arlogERR_WRITE_CALC_DATA 31418U
|
||||
#define arlogERR_WRITE 31417U
|
||||
#define arlogERR_NOTEXISTING 31416U
|
||||
#define arlogERR_NOMEMORY 31412U
|
||||
#define arlogERR_DELETE 31411U
|
||||
#define arlogERR_INVALID_IDENT 31410U
|
||||
#define arlogERR_IN_ACCESS 31409U
|
||||
#define arlogERR_ACCESS_DENIED 31408U
|
||||
#define arlogERR_INSTALL 31407U
|
||||
#define arlogERR_CREATE 31406U
|
||||
#define arlogERR_EXISTING 31405U
|
||||
#define arlogERR_ILL_LEN 31404U
|
||||
#define arlogERR_ILL_PARAM 31403U
|
||||
#define arlogERR_ILL_LOGLEVEL 31402U
|
||||
#define arlogERR_ILL_MEMTYPE 31401U
|
||||
#define arlogERR_ILL_NAME 31400U
|
||||
#define arlogBASE_SAFETY_LOG_IDENT 3U
|
||||
#define arlogBASE_FIELDBUS_LOG_IDENT 2U
|
||||
#define arlogBASE_USER_LOG_IDENT 1U
|
||||
#define arlogBASE_SYSTEM_LOG_IDENT 0U
|
||||
#define arlogMIN_LOGDATA_SIZE 4096U
|
||||
#define arlogLEVEL_FATAL 3U
|
||||
#define arlogLEVEL_WARNING 2U
|
||||
#define arlogLEVEL_INFO 1U
|
||||
#define arlogUSRROM 2U
|
||||
#define arlogUSRRAM 3U
|
||||
#define arlogDRAM 65U
|
||||
#else
|
||||
_IEC_CONST unsigned short arlogERR_NO_MORE_ENTRY = 31425U;
|
||||
_IEC_CONST unsigned short arlogERR_READ_ASCII_BUFFER = 31424U;
|
||||
_IEC_CONST unsigned short arlogERR_READ_BINARY_BUFFER = 31423U;
|
||||
_IEC_CONST unsigned short arlogERR_INVALID_ENTRY = 31422U;
|
||||
_IEC_CONST unsigned short arlogERR_INVALID_INDEX = 31421U;
|
||||
_IEC_CONST unsigned short arlogERR_READ_BUFFER = 31420U;
|
||||
_IEC_CONST unsigned short arlogERR_READ = 31419U;
|
||||
_IEC_CONST unsigned short arlogERR_WRITE_CALC_DATA = 31418U;
|
||||
_IEC_CONST unsigned short arlogERR_WRITE = 31417U;
|
||||
_IEC_CONST unsigned short arlogERR_NOTEXISTING = 31416U;
|
||||
_IEC_CONST unsigned short arlogERR_NOMEMORY = 31412U;
|
||||
_IEC_CONST unsigned short arlogERR_DELETE = 31411U;
|
||||
_IEC_CONST unsigned short arlogERR_INVALID_IDENT = 31410U;
|
||||
_IEC_CONST unsigned short arlogERR_IN_ACCESS = 31409U;
|
||||
_IEC_CONST unsigned short arlogERR_ACCESS_DENIED = 31408U;
|
||||
_IEC_CONST unsigned short arlogERR_INSTALL = 31407U;
|
||||
_IEC_CONST unsigned short arlogERR_CREATE = 31406U;
|
||||
_IEC_CONST unsigned short arlogERR_EXISTING = 31405U;
|
||||
_IEC_CONST unsigned short arlogERR_ILL_LEN = 31404U;
|
||||
_IEC_CONST unsigned short arlogERR_ILL_PARAM = 31403U;
|
||||
_IEC_CONST unsigned short arlogERR_ILL_LOGLEVEL = 31402U;
|
||||
_IEC_CONST unsigned short arlogERR_ILL_MEMTYPE = 31401U;
|
||||
_IEC_CONST unsigned short arlogERR_ILL_NAME = 31400U;
|
||||
_IEC_CONST unsigned long arlogBASE_SAFETY_LOG_IDENT = 3U;
|
||||
_IEC_CONST unsigned long arlogBASE_FIELDBUS_LOG_IDENT = 2U;
|
||||
_IEC_CONST unsigned long arlogBASE_USER_LOG_IDENT = 1U;
|
||||
_IEC_CONST unsigned long arlogBASE_SYSTEM_LOG_IDENT = 0U;
|
||||
_IEC_CONST unsigned short arlogMIN_LOGDATA_SIZE = 4096U;
|
||||
_IEC_CONST unsigned long arlogLEVEL_FATAL = 3U;
|
||||
_IEC_CONST unsigned long arlogLEVEL_WARNING = 2U;
|
||||
_IEC_CONST unsigned long arlogLEVEL_INFO = 1U;
|
||||
_IEC_CONST unsigned char arlogUSRROM = 2U;
|
||||
_IEC_CONST unsigned char arlogUSRRAM = 3U;
|
||||
_IEC_CONST unsigned char arlogDRAM = 65U;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Datatypes and datatypes of function blocks */
|
||||
typedef struct asarlogRead
|
||||
{ unsigned long len;
|
||||
unsigned long lenBin;
|
||||
unsigned long lenAscii;
|
||||
unsigned long logLevel;
|
||||
unsigned long errornr;
|
||||
unsigned char taskName[36];
|
||||
unsigned long errYear;
|
||||
unsigned long errMonth;
|
||||
unsigned long errDay;
|
||||
unsigned long errHour;
|
||||
unsigned long errMinute;
|
||||
unsigned long errSecond;
|
||||
unsigned long errMilliSec;
|
||||
unsigned long errMicroSec;
|
||||
} asarlogRead;
|
||||
|
||||
typedef struct AsArLogCreate
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
unsigned long len;
|
||||
unsigned long memType;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogCreate_typ;
|
||||
|
||||
typedef struct AsArLogDelete
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogDelete_typ;
|
||||
|
||||
typedef struct AsArLogWrite
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long logLevel;
|
||||
unsigned long errornr;
|
||||
unsigned long mem;
|
||||
unsigned long len;
|
||||
unsigned long asciiString;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
unsigned char intTaskName[36];
|
||||
unsigned long intRtkTime[4];
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogWrite_typ;
|
||||
|
||||
typedef struct AsArLogRead
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
unsigned long index;
|
||||
unsigned long arlogRead;
|
||||
unsigned long memBin;
|
||||
unsigned long lenBin;
|
||||
unsigned long memAscii;
|
||||
unsigned long lenAscii;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogRead_typ;
|
||||
|
||||
typedef struct AsArLogClear
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long ident;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogClear_typ;
|
||||
|
||||
typedef struct AsArLogGetInfo
|
||||
{
|
||||
/* VAR_INPUT (analog) */
|
||||
unsigned long pName;
|
||||
/* VAR_OUTPUT (analog) */
|
||||
unsigned short status;
|
||||
unsigned long ident;
|
||||
unsigned long len;
|
||||
unsigned long memType;
|
||||
unsigned long actualIndex;
|
||||
unsigned long FormatVer;
|
||||
/* VAR (analog) */
|
||||
unsigned long intResult;
|
||||
unsigned long intState;
|
||||
unsigned long intRes;
|
||||
/* VAR_INPUT (digital) */
|
||||
plcbit enable;
|
||||
} AsArLogGetInfo_typ;
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
void AsArLogCreate(struct AsArLogCreate* inst);
|
||||
void AsArLogDelete(struct AsArLogDelete* inst);
|
||||
void AsArLogWrite(struct AsArLogWrite* inst);
|
||||
void AsArLogRead(struct AsArLogRead* inst);
|
||||
void AsArLogClear(struct AsArLogClear* inst);
|
||||
void AsArLogGetInfo(struct AsArLogGetInfo* inst);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASARLOG_ */
|
||||
|
||||
|
||||
81
Logical/Libraries/AsBrMath/AsBrMath.fun
Normal file
81
Logical/Libraries/AsBrMath/AsBrMath.fun
Normal file
@@ -0,0 +1,81 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT -- Bernecker + Rainer
|
||||
********************************************************************
|
||||
* Library: AsBrMath
|
||||
* File: AsBrMath.fun
|
||||
* Author: B+R
|
||||
********************************************************************
|
||||
* Functions and function blocks of library AsBrMath
|
||||
********************************************************************)
|
||||
|
||||
FUNCTION brmatan2 : REAL (*calculates the arc tangent of y/x*)
|
||||
VAR_INPUT
|
||||
y :REAL; (*y*)
|
||||
x :REAL; (*x*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmceil : REAL (*calculates the smallest integer value which is greater than or equal to the input value*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmcosh : REAL (*calculates the hyperbolic cosine of x*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmfloor : REAL (*calculates the largest integer value which is less than or equal to the input value*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmfmod : REAL (*calculates the remainder of the division x/y*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*numerator*)
|
||||
y :REAL; (*denominator*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmfrexp : REAL (*calculates the mantissa and the exponent of a floating point number*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*input value*)
|
||||
pExp :UDINT; (*address of the exponent (address of DINT) (base 2)*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmldexp : REAL (*calculates a floating point number from mantissa x and exponent exp*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*mantissa*)
|
||||
exp_val :DINT; (*exponent (base 2)*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmmodf : REAL (*separates a floating point number into an integer and decimal part*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*input value*)
|
||||
plp :UDINT; (*address of the integer part (address of a REAL value)*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmpow : REAL (*calculates x raised to the power of y*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*base*)
|
||||
y :REAL; (*exponent*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmsinh : REAL (*calculates the hyperbolic sine of x*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
|
||||
FUNCTION brmtanh : REAL (*calculates the hyperbolic tangent of x*)
|
||||
VAR_INPUT
|
||||
x :REAL; (*input value*)
|
||||
END_VAR
|
||||
END_FUNCTION
|
||||
34
Logical/Libraries/AsBrMath/AsBrMath.var
Normal file
34
Logical/Libraries/AsBrMath/AsBrMath.var
Normal file
@@ -0,0 +1,34 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT -- Bernecker + Rainer
|
||||
********************************************************************
|
||||
* Library: AsBrMath
|
||||
* File: AsBrMath.var
|
||||
* Author: B+R
|
||||
********************************************************************
|
||||
* Local variables of library AsBrMath
|
||||
********************************************************************)
|
||||
|
||||
VAR CONSTANT
|
||||
brm2_SQRTPI : REAL := 1.12838; (*2/(square root from PI)*)
|
||||
brmSQRT1_2 : REAL := 0.707107; (*square root from 1/2*)
|
||||
brmSQRTPI : REAL := 1.77245; (*square root from PI*)
|
||||
brmLOG2_E : REAL := 0.693147; (*log with the base 2 from E*)
|
||||
brmLOG10E : REAL := 0.434294; (*log with the base 10 from E*)
|
||||
brmIVLN10 : REAL := 0.434294; (*1/(ln from 10)*)
|
||||
brmINVLN2 : REAL := 1.4427; (*1/(ln from 2)*)
|
||||
brmTWOPI : REAL := 6.28319; (*2 PI*)
|
||||
brmSQRT3 : REAL := 1.73205; (*square root from 3*)
|
||||
brmSQRT2 : REAL := 1.41421; (*square root from 2*)
|
||||
brmLOG2E : REAL := 1.4427; (*log with the base 2 from E*)
|
||||
brmLN2LO : REAL := 1.90821e-010; (*log with the base 2 from LOW*)
|
||||
brmLN2HI : REAL := 0.693147; (*log with the base 2 from HIGH*)
|
||||
brm3PI_4 : REAL := 2.35619; (*3/4 PI*)
|
||||
brmPI_4 : REAL := 0.785398; (*PI/4*)
|
||||
brmPI_2 : REAL := 1.5708; (*PI/2*)
|
||||
brmLN10 : REAL := 2.30259; (*ln from 10*)
|
||||
brm2_PI : REAL := 0.63662; (*2/PI*)
|
||||
brm1_PI : REAL := 0.31831; (*1/PI*)
|
||||
brmLN2 : REAL := 0.693147; (*ln from 2*)
|
||||
brmPI : REAL := 3.14159; (*PI*)
|
||||
brmE : REAL := 2.71828; (*E*)
|
||||
END_VAR
|
||||
8
Logical/Libraries/AsBrMath/Binary.lby
Normal file
8
Logical/Libraries/AsBrMath/Binary.lby
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=4.0.14.207?>
|
||||
<Library Description="This library integrates mathematical functions such as angle functions, rounding off, etc. into the program." xmlns="http://br-automation.co.at/AS/Library">
|
||||
<Files>
|
||||
<File>AsBrMath.var</File>
|
||||
<File>AsBrMath.fun</File>
|
||||
</Files>
|
||||
</Library>
|
||||
90
Logical/Libraries/AsBrMath/SG3/AsBrMath.h
Normal file
90
Logical/Libraries/AsBrMath/SG3/AsBrMath.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASBRMATH_
|
||||
#define _ASBRMATH_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define brm2_SQRTPI 1.12838
|
||||
#define brmSQRT1_2 0.707107
|
||||
#define brmSQRTPI 1.77245
|
||||
#define brmLOG2_E 0.693147
|
||||
#define brmLOG10E 0.434294
|
||||
#define brmIVLN10 0.434294
|
||||
#define brmINVLN2 1.4427
|
||||
#define brmTWOPI 6.28319
|
||||
#define brmSQRT3 1.73205
|
||||
#define brmSQRT2 1.41421
|
||||
#define brmLOG2E 1.4427
|
||||
#define brmLN2LO 1.90821e-010
|
||||
#define brmLN2HI 0.693147
|
||||
#define brm3PI_4 2.35619
|
||||
#define brmPI_4 0.785398
|
||||
#define brmPI_2 1.5708
|
||||
#define brmLN10 2.30259
|
||||
#define brm2_PI 0.63662
|
||||
#define brm1_PI 0.31831
|
||||
#define brmLN2 0.693147
|
||||
#define brmPI 3.14159
|
||||
#define brmE 2.71828
|
||||
#else
|
||||
_IEC_CONST float brm2_SQRTPI = 1.12838;
|
||||
_IEC_CONST float brmSQRT1_2 = 0.707107;
|
||||
_IEC_CONST float brmSQRTPI = 1.77245;
|
||||
_IEC_CONST float brmLOG2_E = 0.693147;
|
||||
_IEC_CONST float brmLOG10E = 0.434294;
|
||||
_IEC_CONST float brmIVLN10 = 0.434294;
|
||||
_IEC_CONST float brmINVLN2 = 1.4427;
|
||||
_IEC_CONST float brmTWOPI = 6.28319;
|
||||
_IEC_CONST float brmSQRT3 = 1.73205;
|
||||
_IEC_CONST float brmSQRT2 = 1.41421;
|
||||
_IEC_CONST float brmLOG2E = 1.4427;
|
||||
_IEC_CONST float brmLN2LO = 1.90821e-010;
|
||||
_IEC_CONST float brmLN2HI = 0.693147;
|
||||
_IEC_CONST float brm3PI_4 = 2.35619;
|
||||
_IEC_CONST float brmPI_4 = 0.785398;
|
||||
_IEC_CONST float brmPI_2 = 1.5708;
|
||||
_IEC_CONST float brmLN10 = 2.30259;
|
||||
_IEC_CONST float brm2_PI = 0.63662;
|
||||
_IEC_CONST float brm1_PI = 0.31831;
|
||||
_IEC_CONST float brmLN2 = 0.693147;
|
||||
_IEC_CONST float brmPI = 3.14159;
|
||||
_IEC_CONST float brmE = 2.71828;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
float brmatan2(float y, float x);
|
||||
float brmceil(float x);
|
||||
float brmcosh(float x);
|
||||
float brmfloor(float x);
|
||||
float brmfmod(float x, float y);
|
||||
float brmfrexp(float x, unsigned long pExp);
|
||||
float brmldexp(float x, signed long exp_val);
|
||||
float brmmodf(float x, unsigned long plp);
|
||||
float brmpow(float x, float y);
|
||||
float brmsinh(float x);
|
||||
float brmtanh(float x);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASBRMATH_ */
|
||||
|
||||
91
Logical/Libraries/AsBrMath/SG4/AsBrMath.h
Normal file
91
Logical/Libraries/AsBrMath/SG4/AsBrMath.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASBRMATH_
|
||||
#define _ASBRMATH_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define brm2_SQRTPI 1.12838
|
||||
#define brmSQRT1_2 0.707107
|
||||
#define brmSQRTPI 1.77245
|
||||
#define brmLOG2_E 0.693147
|
||||
#define brmLOG10E 0.434294
|
||||
#define brmIVLN10 0.434294
|
||||
#define brmINVLN2 1.4427
|
||||
#define brmTWOPI 6.28319
|
||||
#define brmSQRT3 1.73205
|
||||
#define brmSQRT2 1.41421
|
||||
#define brmLOG2E 1.4427
|
||||
#define brmLN2LO 1.90821e-010
|
||||
#define brmLN2HI 0.693147
|
||||
#define brm3PI_4 2.35619
|
||||
#define brmPI_4 0.785398
|
||||
#define brmPI_2 1.5708
|
||||
#define brmLN10 2.30259
|
||||
#define brm2_PI 0.63662
|
||||
#define brm1_PI 0.31831
|
||||
#define brmLN2 0.693147
|
||||
#define brmPI 3.14159
|
||||
#define brmE 2.71828
|
||||
#else
|
||||
_IEC_CONST float brm2_SQRTPI = 1.12838;
|
||||
_IEC_CONST float brmSQRT1_2 = 0.707107;
|
||||
_IEC_CONST float brmSQRTPI = 1.77245;
|
||||
_IEC_CONST float brmLOG2_E = 0.693147;
|
||||
_IEC_CONST float brmLOG10E = 0.434294;
|
||||
_IEC_CONST float brmIVLN10 = 0.434294;
|
||||
_IEC_CONST float brmINVLN2 = 1.4427;
|
||||
_IEC_CONST float brmTWOPI = 6.28319;
|
||||
_IEC_CONST float brmSQRT3 = 1.73205;
|
||||
_IEC_CONST float brmSQRT2 = 1.41421;
|
||||
_IEC_CONST float brmLOG2E = 1.4427;
|
||||
_IEC_CONST float brmLN2LO = 1.90821e-010;
|
||||
_IEC_CONST float brmLN2HI = 0.693147;
|
||||
_IEC_CONST float brm3PI_4 = 2.35619;
|
||||
_IEC_CONST float brmPI_4 = 0.785398;
|
||||
_IEC_CONST float brmPI_2 = 1.5708;
|
||||
_IEC_CONST float brmLN10 = 2.30259;
|
||||
_IEC_CONST float brm2_PI = 0.63662;
|
||||
_IEC_CONST float brm1_PI = 0.31831;
|
||||
_IEC_CONST float brmLN2 = 0.693147;
|
||||
_IEC_CONST float brmPI = 3.14159;
|
||||
_IEC_CONST float brmE = 2.71828;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
float brmatan2(float y, float x);
|
||||
float brmceil(float x);
|
||||
float brmcosh(float x);
|
||||
float brmfloor(float x);
|
||||
float brmfmod(float x, float y);
|
||||
float brmfrexp(float x, unsigned long pExp);
|
||||
float brmldexp(float x, signed long exp_val);
|
||||
float brmmodf(float x, unsigned long plp);
|
||||
float brmpow(float x, float y);
|
||||
float brmsinh(float x);
|
||||
float brmtanh(float x);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASBRMATH_ */
|
||||
|
||||
|
||||
90
Logical/Libraries/AsBrMath/SGC/AsBrMath.h
Normal file
90
Logical/Libraries/AsBrMath/SGC/AsBrMath.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/* Automation Studio generated header file */
|
||||
/* Do not edit ! */
|
||||
|
||||
#ifndef _ASBRMATH_
|
||||
#define _ASBRMATH_
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <bur/plctypes.h>
|
||||
|
||||
#ifndef _IEC_CONST
|
||||
#define _IEC_CONST _WEAK const
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
#ifdef _REPLACE_CONST
|
||||
#define brm2_SQRTPI 1.12838
|
||||
#define brmSQRT1_2 0.707107
|
||||
#define brmSQRTPI 1.77245
|
||||
#define brmLOG2_E 0.693147
|
||||
#define brmLOG10E 0.434294
|
||||
#define brmIVLN10 0.434294
|
||||
#define brmINVLN2 1.4427
|
||||
#define brmTWOPI 6.28319
|
||||
#define brmSQRT3 1.73205
|
||||
#define brmSQRT2 1.41421
|
||||
#define brmLOG2E 1.4427
|
||||
#define brmLN2LO 1.90821e-010
|
||||
#define brmLN2HI 0.693147
|
||||
#define brm3PI_4 2.35619
|
||||
#define brmPI_4 0.785398
|
||||
#define brmPI_2 1.5708
|
||||
#define brmLN10 2.30259
|
||||
#define brm2_PI 0.63662
|
||||
#define brm1_PI 0.31831
|
||||
#define brmLN2 0.693147
|
||||
#define brmPI 3.14159
|
||||
#define brmE 2.71828
|
||||
#else
|
||||
_IEC_CONST float brm2_SQRTPI = 1.12838;
|
||||
_IEC_CONST float brmSQRT1_2 = 0.707107;
|
||||
_IEC_CONST float brmSQRTPI = 1.77245;
|
||||
_IEC_CONST float brmLOG2_E = 0.693147;
|
||||
_IEC_CONST float brmLOG10E = 0.434294;
|
||||
_IEC_CONST float brmIVLN10 = 0.434294;
|
||||
_IEC_CONST float brmINVLN2 = 1.4427;
|
||||
_IEC_CONST float brmTWOPI = 6.28319;
|
||||
_IEC_CONST float brmSQRT3 = 1.73205;
|
||||
_IEC_CONST float brmSQRT2 = 1.41421;
|
||||
_IEC_CONST float brmLOG2E = 1.4427;
|
||||
_IEC_CONST float brmLN2LO = 1.90821e-010;
|
||||
_IEC_CONST float brmLN2HI = 0.693147;
|
||||
_IEC_CONST float brm3PI_4 = 2.35619;
|
||||
_IEC_CONST float brmPI_4 = 0.785398;
|
||||
_IEC_CONST float brmPI_2 = 1.5708;
|
||||
_IEC_CONST float brmLN10 = 2.30259;
|
||||
_IEC_CONST float brm2_PI = 0.63662;
|
||||
_IEC_CONST float brm1_PI = 0.31831;
|
||||
_IEC_CONST float brmLN2 = 0.693147;
|
||||
_IEC_CONST float brmPI = 3.14159;
|
||||
_IEC_CONST float brmE = 2.71828;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
float brmatan2(float y, float x);
|
||||
float brmceil(float x);
|
||||
float brmcosh(float x);
|
||||
float brmfloor(float x);
|
||||
float brmfmod(float x, float y);
|
||||
float brmfrexp(float x, unsigned long pExp);
|
||||
float brmldexp(float x, signed long exp_val);
|
||||
float brmmodf(float x, unsigned long plp);
|
||||
float brmpow(float x, float y);
|
||||
float brmsinh(float x);
|
||||
float brmtanh(float x);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* _ASBRMATH_ */
|
||||
|
||||
1738
Logical/Libraries/AsIecCon/AsIecCon.fun
Normal file
1738
Logical/Libraries/AsIecCon/AsIecCon.fun
Normal file
File diff suppressed because it is too large
Load Diff
10
Logical/Libraries/AsIecCon/Binary.lby
Normal file
10
Logical/Libraries/AsIecCon/Binary.lby
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library xmlns="http://br-automation.co.at/AS/Library" Description="This library contains function interfaces for IEC 1131-3 conversion functions.">
|
||||
<Files>
|
||||
<File>AsIecCon.fun</File>
|
||||
</Files>
|
||||
<Dependencies>
|
||||
<Dependency ObjectName="AsTime" />
|
||||
</Dependencies>
|
||||
</Library>
|
||||
49
Logical/Libraries/AsIecCon/SG3/AsIecCon.h
Normal file
49
Logical/Libraries/AsIecCon/SG3/AsIecCon.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* Automation Studio Generated Header File, Format Version 1.00 */
|
||||
/* do not change */
|
||||
#ifndef ASIECCON_H_
|
||||
#define ASIECCON_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <bur/plc.h>
|
||||
|
||||
|
||||
|
||||
/* Constants */
|
||||
|
||||
|
||||
/* Datatypes */
|
||||
|
||||
|
||||
/* Datatypes of function blocks */
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
signed short H_TO_NINT(signed short IN);
|
||||
unsigned short H_TO_NUINT(unsigned short IN);
|
||||
signed long H_TO_NDINT(signed long IN);
|
||||
unsigned long H_TO_NUDINT(unsigned long IN);
|
||||
float H_TO_NREAL(float IN);
|
||||
plctime H_TO_NTIME(plctime IN);
|
||||
DATE_AND_TIME H_TO_NDT(DATE_AND_TIME IN);
|
||||
signed short N_TO_HINT(signed short IN);
|
||||
unsigned short N_TO_HUINT(unsigned short IN);
|
||||
signed long N_TO_HDINT(signed long IN);
|
||||
unsigned long N_TO_HUDINT(unsigned long IN);
|
||||
float N_TO_HREAL(float IN);
|
||||
plctime N_TO_HTIME(plctime IN);
|
||||
DATE_AND_TIME N_TO_HDT(DATE_AND_TIME IN);
|
||||
signed short swapINT(signed short IN);
|
||||
unsigned short swapUINT(unsigned short IN);
|
||||
signed long swapDINT(signed long IN);
|
||||
unsigned long swapUDINT(unsigned long IN);
|
||||
float swapREAL(float IN);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* ASIECCON_H_ */
|
||||
|
||||
62
Logical/Libraries/AsIecCon/SG4/AsIecCon.h
Normal file
62
Logical/Libraries/AsIecCon/SG4/AsIecCon.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* Automation Studio Generated Header File, Format Version 1.00 */
|
||||
/* do not change */
|
||||
#ifndef ASIECCON_H_
|
||||
#define ASIECCON_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <bur/plc.h>
|
||||
|
||||
|
||||
|
||||
/* Constants */
|
||||
|
||||
|
||||
/* Datatypes */
|
||||
|
||||
|
||||
/* Datatypes of function blocks */
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
signed short H_TO_NINT(signed short IN);
|
||||
unsigned short H_TO_NUINT(unsigned short IN);
|
||||
signed long H_TO_NDINT(signed long IN);
|
||||
unsigned long H_TO_NUDINT(unsigned long IN);
|
||||
float H_TO_NREAL(float IN);
|
||||
plctime H_TO_NTIME(plctime IN);
|
||||
DATE_AND_TIME H_TO_NDT(DATE_AND_TIME IN);
|
||||
DATE H_TO_NDATE(DATE IN);
|
||||
TOD H_TO_NTOD(TOD IN);
|
||||
signed short N_TO_HINT(signed short IN);
|
||||
unsigned short N_TO_HUINT(unsigned short IN);
|
||||
signed long N_TO_HDINT(signed long IN);
|
||||
unsigned long N_TO_HUDINT(unsigned long IN);
|
||||
float N_TO_HREAL(float IN);
|
||||
plctime N_TO_HTIME(plctime IN);
|
||||
DATE_AND_TIME N_TO_HDT(DATE_AND_TIME IN);
|
||||
DATE N_TO_HDATE(DATE IN);
|
||||
TOD N_TO_HTOD(TOD IN);
|
||||
signed short swapINT(signed short IN);
|
||||
unsigned short swapUINT(unsigned short IN);
|
||||
WORD swapWORD(WORD IN);
|
||||
signed long swapDINT(signed long IN);
|
||||
unsigned long swapUDINT(unsigned long IN);
|
||||
DWORD swapDWORD(DWORD IN);
|
||||
TIME swapTIME(TIME IN);
|
||||
DATE_AND_TIME swapDT(DATE_AND_TIME IN);
|
||||
DATE swapDATE(DATE IN);
|
||||
TOD swapTOD(TOD IN);
|
||||
float swapREAL(float IN);
|
||||
|
||||
/* The interface declarations of the AsIecCon functions are not included here
|
||||
* because they are inline in IEC languages. The x_TO_STRING and the
|
||||
* STRING_TO_x functions are not available for C programms. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* ASIECCON_H_ */
|
||||
|
||||
62
Logical/Libraries/AsIecCon/SGC/AsIecCon.h
Normal file
62
Logical/Libraries/AsIecCon/SGC/AsIecCon.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* Automation Studio Generated Header File, Format Version 1.00 */
|
||||
/* do not change */
|
||||
#ifndef ASIECCON_H_
|
||||
#define ASIECCON_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <bur/plc.h>
|
||||
|
||||
|
||||
|
||||
/* Constants */
|
||||
|
||||
|
||||
/* Datatypes */
|
||||
|
||||
|
||||
/* Datatypes of function blocks */
|
||||
|
||||
|
||||
/* Prototyping of functions and function blocks */
|
||||
signed short H_TO_NINT(signed short IN);
|
||||
unsigned short H_TO_NUINT(unsigned short IN);
|
||||
signed long H_TO_NDINT(signed long IN);
|
||||
unsigned long H_TO_NUDINT(unsigned long IN);
|
||||
float H_TO_NREAL(float IN);
|
||||
plctime H_TO_NTIME(plctime IN);
|
||||
DATE_AND_TIME H_TO_NDT(DATE_AND_TIME IN);
|
||||
DATE H_TO_NDATE(DATE IN);
|
||||
TOD H_TO_NTOD(TOD IN);
|
||||
signed short N_TO_HINT(signed short IN);
|
||||
unsigned short N_TO_HUINT(unsigned short IN);
|
||||
signed long N_TO_HDINT(signed long IN);
|
||||
unsigned long N_TO_HUDINT(unsigned long IN);
|
||||
float N_TO_HREAL(float IN);
|
||||
plctime N_TO_HTIME(plctime IN);
|
||||
DATE_AND_TIME N_TO_HDT(DATE_AND_TIME IN);
|
||||
DATE N_TO_HDATE(DATE IN);
|
||||
TOD N_TO_HTOD(TOD IN);
|
||||
signed short swapINT(signed short IN);
|
||||
unsigned short swapUINT(unsigned short IN);
|
||||
WORD swapWORD(WORD IN);
|
||||
signed long swapDINT(signed long IN);
|
||||
unsigned long swapUDINT(unsigned long IN);
|
||||
DWORD swapDWORD(DWORD IN);
|
||||
TIME swapTIME(TIME IN);
|
||||
DATE_AND_TIME swapDT(DATE_AND_TIME IN);
|
||||
DATE swapDATE(DATE IN);
|
||||
TOD swapTOD(TOD IN);
|
||||
float swapREAL(float IN);
|
||||
|
||||
/* The interface declarations of the AsIecCon functions are not included here
|
||||
* because they are inline in IEC languages. The x_TO_STRING and the
|
||||
* STRING_TO_x functions are not available for C programms. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif /* ASIECCON_H_ */
|
||||
|
||||
9
Logical/Libraries/NcGlobal/Binary.lby
Normal file
9
Logical/Libraries/NcGlobal/Binary.lby
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.0.0?>
|
||||
<Library Version="2.37.0" xmlns="http://br-automation.co.at/AS/Library" Description="Global NC functions">
|
||||
<Files>
|
||||
<File>Ncglobal.fun</File>
|
||||
<File>Ncglobal.typ</File>
|
||||
<File>Ncglobal.var</File>
|
||||
</Files>
|
||||
</Library>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user