Class AxisFunctions
The AxisFunctions class provides a set of methods to control and manage the behavior of an axis in a TwinCAT NC system. It allows for operations such as resetting, stopping, referencing, and setting positions of the axis. Additionally, it supports advanced operations like controlled ramps, emergency stops, reversing operations, and sinus oscillation sequences. The class interacts with the TwinCAT system using an AdsClient to send commands and data to the specified axis.
public class AxisFunctions
- Inheritance
-
AxisFunctions
- Inherited Members
Methods
ActivateCompleteAxis()
Activate complete axis (enable)
public void ActivateCompleteAxis()
ActivateDriveOutput()
Activate drive output (enable).
public void ActivateDriveOutput()
ChangeDriveOutput(DriveOutputStartType, double)
Change the drive output.
public void ChangeDriveOutput(DriveOutputStartType startType, double newValue)
Parameters
startTypeDriveOutputStartTypenewValuedoubleRequired output value (e.g. %)
ClearAxisTask()
Clear axis (task)
public void ClearAxisTask()
DeactivateCompleteAxis()
Deactivate complete axis (disable)
public void DeactivateCompleteAxis()
DeactivateDriveOutput()
Deactivate drive output (disable).
public void DeactivateDriveOutput()
EmergencyStopWithControlledRamp(double, double)
Emergency stop with controlled ramp
public void EmergencyStopWithControlledRamp(double deceleration, double jerk)
Parameters
decelerationdoubleDeceleration (must be greater than or equal to the original deceleration)
jerkdoubleJerk (must greater than or equal to the original jerk)
ExtendedAxisStart(GroupAxisStartType, double, double, double, double, double)
Extended axis start.
public void ExtendedAxisStart(GroupAxisStartType startType, double targetPosition, double requireVelocity, double acceleration = 0, double deceleration = 0, double jerk = 0)
Parameters
startTypeGroupAxisStartTypetargetPositiondoublerequireVelocitydoubleaccelerationdouble0 if internal TwinCAT acceleration should be used.
decelerationdouble0 if internal TwiNCAT deceleration should be used.
jerkdouble0 if internal TwinCAT jerk should be used.
NewEndPositionAxis(EndPositionType, double)
Set new end position (axis).
public void NewEndPositionAxis(EndPositionType endPositionType, double newEndPosition)
Parameters
endPositionTypeEndPositionTypenewEndPositiondoubleNew end position (target position)
OrientedStop(double, double, double)
Oriented stop (oriented end position). Only for PTP axes.
public void OrientedStop(double moduloEndPosition, double deceleration, double jerk)
Parameters
ReferenceAxis()
Reference axis (calibration).
public void ReferenceAxis()
ReleaseParkingBrake(ushort)
Release parking brake? 0: automatic activation(default) 1: mandatorily always released Note: Reset to '0' when resetting the axis!
public void ReleaseParkingBrake(ushort release)
Parameters
releaseushort
Reset()
Reset axis
public void Reset()
SetActualAxisPosition(ActualPositionType, double)
Set actual axis position
public void SetActualAxisPosition(ActualPositionType actualPositionType, double actualPosition)
Parameters
actualPositionTypeActualPositionTypeactualPositiondouble
SetActualPositionOnTheFly(ActualPositionType, int, double)
Set actual axis position on the fly (in motion of the axis)
public void SetActualPositionOnTheFly(ActualPositionType positionType, int controlword, double newActualPosition)
Parameters
positionTypeActualPositionTypecontrolwordintControl double word, e.g. for "clearing the lag error
newActualPositiondouble
SetExternalAxisError(uint)
Set external axis error (runtime error)
public void SetExternalAxisError(uint errorCode)
Parameters
errorCodeuint
StandardAxisStart(GroupAxisStartType, double, double)
Standard axis start.
public void StandardAxisStart(GroupAxisStartType startType, double endPosition, double velocity)
Parameters
startTypeGroupAxisStartTypeendPositiondoublevelocitydouble
StartDriveOutput(DriveOutputStartType, double)
Start drive output.
public void StartDriveOutput(DriveOutputStartType startType, double value)
Parameters
startTypeDriveOutputStartTypevaluedouble
StartReversingOperation(GroupAxisStartType, double, double, double, double)
Start reversing operation for positioning (SERVO).
public void StartReversingOperation(GroupAxisStartType startType, double targePosition1, double targetPosition2, double velocity, double idleSeconds)
Parameters
startTypeGroupAxisStartTypetargePosition1doubletargetPosition2doublevelocitydoubleidleSecondsdouble
StartReversingOperationVelocityJumps(GroupAxisStartType, double, double, double, double, uint)
Start reversing operation with velocity jumps (SERVO): (can be used to determine the velocity step response)
public void StartReversingOperationVelocityJumps(GroupAxisStartType startType, double velocity1, double velocity2, double travelSeconds, double idleSeconds, uint repetitionCount)
Parameters
startTypeGroupAxisStartTypevelocity1doublevelocity2doubletravelSecondsdoubleidleSecondsdoublerepetitionCountuint
StartSinusOscillationSequence(double, double, double, double, double, double, double, uint)
Sine oscillation sequence
- used as single sinus oscillation(sinus generator)
- used as sinus oscillation sequence(e.g. for bode plot)
public void StartSinusOscillationSequence(double baseAmplitude, double baseFrequency, double startAmplitude, double feedConstantMotor, double startFrequency, double stopFrequency, double stepDurationSeconds, uint stepCycles)
Parameters
baseAmplitudedoublebaseFrequencydoublestartAmplitudedoublefeedConstantMotordoublestartFrequencydoublestopFrequencydoublestepDurationSecondsdoublestepCyclesuint
Stop()
Stop axis
public void Stop()
StopDriveOutput()
Stop drive output.
public void StopDriveOutput()
StopWithControlledRamp(double, double)
Parameterizable stop (with controlled ramp). Only for PTP axes.
public void StopWithControlledRamp(double deceleration, double jerk)