Skip to main content

Administrative Function Blocks

Administrative function blocks are used to query information or change specific settings. However, they never trigger a movement.

A physical drive (referred to as a drive from here on) is represented in CODESYS SoftMotion by the software object AXIS_REF_SM3 (referred to as an axis from here on). Depending on the administrative function block being used, execution takes place either on the drive, on the axis, or on both.

Function Blocks

MC_Power

Controls the power stage of the drive

MC_Reset

Resets axis errors and drive errors

MC_SetPosition

Shifts the coordinate system of the axis to any value; for example, this can be helpful for referencing.

SMC3_BrakeControl

Controls the mechanical brake when the drive supports this function

SMC3_BrakeStatus

Reads the current status of the mechanical brake

SMC_ChangeDynamicLimits

Sets the dynamic limits (velocity, acceleration, deceleration, jerk, and torque) of an axis

For more information, see the following: Dynamic limits in Tab: General

SMC_ChangeAxisScalingLinear

Changes the scaling of a linear axis

SMC_ChangeAxisScalingRotary

Changes the scaling of a rotary axis

SMC_SetForecast

Sets the Forecast of an axis

SMC_GetForecast

Returns the set forecast of the axis

SMC_GetTravelTime

Returns the time when the axis reaches a specific position. This is especially helpful when combined with Forecast.

SMC_SetAdditionalConversionFactors

Sets additional factors for the conversion. For example, the factor for torques can be used to take a gearbox into consideration.

SMC_SetControllerMode

Sets a different operating mode for the axis when the drive supports this function

SMC_SetMovementType

Sets the movement type of a virtual axis to limited or modulo

For more information, see the following: Tab: General.

SMC_SetRampType

Sets the velocity ramp type of an axis

For more information, see the following: Velocity ramp type in the Tab: General chapter

SMC_SetSoftwareLimits

Sets position limits for limited axes and the corresponding reaction in case of error

For more information, see the following: Software limit switches and Software error reaction in the Tab: General chapter

MC_TouchProbe

Returns the drive position when a defined trigger event is raised

MC_AbortTrigger

Aborts functions which use trigger events (example: MC_TouchProbe)

SMC_ReadFBError

Returns the oldest entry from the function block error memory of the axis. This information can be used for display in a visualization, for example.

SMC_ClearFBError

Deletes the oldest entry from the function block error memory of the axis.

SMC_ReadSetPosition

Returns the set position of the axis

SMC_ReadSetValues

Returns the set position, set velocity, set acceleration, and set jerk. When Forecast is enabled, data can also be queried in the future.

For more information, see the following: SMC_SetForecast

MC_ReadActualPosition

Returns the actual position of the drive

MC_ReadActualVelocity

Returns the actual velocity of the drive

MC_ReadActualTorque

Returns the actual torque or the actual force of the drive

MC_ReadAxisError

Reads the error from the drive

MC_ReadStatus

Reads the current status of the axis

SMC_CheckAxisCommunication

Returns the communication state of the axis

SMC_CheckLimits

Checks whether the current set values exceed the set dynamic limits of the axis

For more information, see the following: SMC_ChangeDynamicLimits and Dynamic limits in Tab: General

SMC_GetTrackingError

Returns the lag of the axis (difference between the set position of the axis and the actual position of the drive)

SMC_InPosition

Returns whether the lag is within a configurable range

SMC_MeasureDistance

Returns the distance traveled by the axis since the block was started. This is especially helpful for modulo axes.

MC_ReadBoolParameter

Reads a Boolean value from the axis or drive

MC_ReadParameter

Reads a value from the axis or drive

MC_WriteBoolParameter

Writes a Boolean value to the axis or drive

MC_WriteParameter

Writes a value to the axis or drive

Diagnostic Function Blocks

SMC_AxisDiagnosticLog

Writes the set values and actual values (position, velocity, and acceleration) of the axis and drive cyclically to a file. This can be helpful for the diagnosis of errors and movement sequences in other tools.

SMC_GetMaxSetVelocity

Records the maximum value of the set velocity of the axis. This function block can be helpful for diagnostic purposes.

SMC_GetMaxSetAccDec

Records the maximum value of the set acceleration of the axis. This function block can be helpful for diagnostic purposes.

Persist

SMC3_PersistPosition

Persists the position of an axis with absolute encoder

For more information about "Persist", see the following: Persisting an Axis Position

SMC3_PersistPositionLogical

Persists the position of a logical axis

For more information about logical axes, see the following: Logical Drive