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
startType
DriveOutputStartTypenewValue
doubleRequired 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
deceleration
doubleDeceleration (must be greater than or equal to the original deceleration)
jerk
doubleJerk (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
startType
GroupAxisStartTypetargetPosition
doublerequireVelocity
doubleacceleration
double0 if internal TwinCAT acceleration should be used.
deceleration
double0 if internal TwiNCAT deceleration should be used.
jerk
double0 if internal TwinCAT jerk should be used.
NewEndPositionAxis(EndPositionType, double)
Set new end position (axis).
public void NewEndPositionAxis(EndPositionType endPositionType, double newEndPosition)
Parameters
endPositionType
EndPositionTypenewEndPosition
doubleNew 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
release
ushort
Reset()
Reset axis
public void Reset()
SetActualAxisPosition(ActualPositionType, double)
Set actual axis position
public void SetActualAxisPosition(ActualPositionType actualPositionType, double actualPosition)
Parameters
actualPositionType
ActualPositionTypeactualPosition
double
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
positionType
ActualPositionTypecontrolword
intControl double word, e.g. for "clearing the lag error
newActualPosition
double
SetExternalAxisError(uint)
Set external axis error (runtime error)
public void SetExternalAxisError(uint errorCode)
Parameters
errorCode
uint
StandardAxisStart(GroupAxisStartType, double, double)
Standard axis start.
public void StandardAxisStart(GroupAxisStartType startType, double endPosition, double velocity)
Parameters
startType
GroupAxisStartTypeendPosition
doublevelocity
double
StartDriveOutput(DriveOutputStartType, double)
Start drive output.
public void StartDriveOutput(DriveOutputStartType startType, double value)
Parameters
startType
DriveOutputStartTypevalue
double
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
startType
GroupAxisStartTypetargePosition1
doubletargetPosition2
doublevelocity
doubleidleSeconds
double
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
startType
GroupAxisStartTypevelocity1
doublevelocity2
doubletravelSeconds
doubleidleSeconds
doublerepetitionCount
uint
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
baseAmplitude
doublebaseFrequency
doublestartAmplitude
doublefeedConstantMotor
doublestartFrequency
doublestopFrequency
doublestepDurationSeconds
doublestepCycles
uint
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)