Functions, function blocks and types (from V3.0)

Functions, function blocks and types (from V3.0) 1:

All the functions, function blocks and data types present in the library are listed here.

You will find answers to frequently asked questions and notes on the use of the library, setting up, problem analysis and example projects in the Knowledge Base.

Some of the components listed here are not intended to be used by an application. Their presence, interface and behavior is therefore not guaranteed. Because, however, a TwinCAT PLC library is strictly open, it is not possible to hide these internal components. It is, nevertheless, essential to avoid calling these components, identified with (internal use only) or (not recommended), directly from an application. If one of these components would, in practice, be useful for you, please make contact with our Support Department. We will then examine the possibility of making the function block available to you, independently of the library, and for you to then take the responsibility for using it.

If the library contains function blocks, types or constants that are not listed in the documentation, then these are elements that have not yet been approved, and are the subject of current software maintenance and development work. These elements must never be directly used in an application, because they are, as a general rule, not yet tested.

Functions, function blocks and types (from V3.0) 2:

The hydraulic library only offers a restricted range of functions, even in connection with electrical drives. TwinCAT NC PTP, NC I and CNC offer a significantly broader spectrum and more comprehensive support for commissioning and diagnosis.

Functions, function blocks and types (from V3.0) 3:

A number of libraries are available, which deal with a typical axis configuration or special functionalities. These libraries require the TcPlcHydraulics library and have to be ordered separately.

Name

Description

TcPlcLibHydraulics_30_2R2Vgantry.LIB

in preparation

TcPlcLibHydraulics_30_4R3Vgantry.LIB

in preparation

PLC open Motion Control

The function blocks listed here are oriented towards:

Technical Specification

PLCopen - Technical Committee 2 - Task Force

Function blocks for motion control

Part 1 Version 1.1 and Part 2 Version 0.99F (definition not yet finalized)

The names of these function blocks begin with MC_ and end with _BkPlcMc.

Functions, function blocks and types (from V3.0) 4:
Functions, function blocks and types (from V3.0) 5:

Parts of the PLCopen definitions have not yet been finalized. Future versions of the library may be subject to modifications.
Such modifications may relate to

Administrative Function blocks

Name

Description

MC_CamTableSelect_BkPlcMc

The function block initializes a variable of type ST_TcPlcMcCamId, thereby preparing a cam plate for the coupling of two axes.

MC_Power_BkPlcMc

Function block to control an external actuator.

MC_ReadActualPosition_BkPlcMc

The actual position of an axis is determined.

MC_ReadActualTorque_BkPlcMc

The actual force or the actual pressure of an axis is determined.

MC_ReadActualVelocity_BkPlcMc

The actual velocity of an axis is determined.

MC_ReadAxisError_BkPlcMc

The current error code of an axis is found.

MC_ReadBoolParameter_BkPlcMc

The boolean parameters of an axis are read.

MC_ReadDigitalOutput_BkPlcMc

The current state of a digital output of a cam controller is determined.

MC_ReadParameter_BkPlcMc

The non-boolean parameters of an axis are read.

MC_ReadStatus_BkPlcMc

The state of the axis is decoded.

MC_Reset_BkPlcMc

The axis is placed in a state ready for operation.

MC_ResetAndStop_BkPlcMc

The axis is placed in a state ready for operation and is stationary.

MC_SetOverride_BkPlcMc

The axis override is set.

MC_SetPosition_BkPlcMc

The actual position of the axis is set.

MC_SetReferenceFlag_BkPlcMc

The referencing flag of the axis is defined. (Function is not defined by PLCopen)

MC_WriteBoolParameter_BkPlcMc

The boolean parameters of an axis are written.

MC_WriteDigitalOutput_BkPlcMc

The current state of a digital output of a cam controller is defined.

MC_WriteParameter_BkPlcMc

The non-boolean parameters of an axis are written.

Motion Function Blocks, Single Axis

Name

Description

MC_DigitalCamSwitch_BkPlcMc

Generation of software cams as a function of position, direction of movement and velocity of an axis.

MC_EmergencyStop_BkPlcMc

Stopping a movement without reaching the target position. (Function is not defined by PLCopen)

MC_Halt_BkPlcMc

Stopping a movement without reaching the target position.

MC_Home_BkPlcMc

Initiation and monitoring of homing.

MC_ImediateStop_BkPlcMc

Stopping a movement without reaching the target position. (Function is not defined by PLCopen)

MC_MoveAbsolute_BkPlcMc

Start and monitoring of a positioning process at a specifiable velocity to absolutely stated target co-ordinates.

MC_MoveJoySticked_BkPlcMc

Starting and controlling of an axis movement with a proportional control unit. (Function is not defined by PLCopen)

MC_MoveRelative_BkPlcMc

Start and monitoring of a positioning process at a specifiable velocity over an absolutely stated distance.

MC_MoveVelocity_BkPlcMc

Start and monitoring of a positioning process at a specifiable velocity but with no specified target.

MC_RampedStop_BkPlcMc

Stopping of a movement with a pure time ramp.

MC_Stop_BkPlcMc

Stopping a movement without reaching the target position.

Motion Function blocks, Multiple Axis

Name

Description

MC_CamIn_BkPlcMc

The function block starts and monitors a cam plates coupling between two axes.

MC_CamOut_BkPlcMc

The function block releases a cam plate coupling between two axes.

MC_GearIn_BkPlcMc

Start and monitoring of the gear coupling of two axes.

MC_GearInPos_BkPlcMc

On-the-fly gear coupling of two axes.

MC_GearOut_BkPlcMc

Cancelling the gear coupling of two axes.

System Function Blocks

Name

Description

MC_AxRtDrive_BkPlcMc

Preparation of the control value of the axis for output on a hardware module, mapping information.

MC_AxRtEncoder_BkPlcMc

Determination of the actual position of the axis from the input information of a hardware module, mapping information.

MC_AxRtFinish_BkPlcMc

Adaptation of the generated control value to the special features of the axis.

MC_AxRtFinishLinear_BkPlcMc

Adjustment of the generated control value to the special features of the axis, taking into account a characteristic curve.

MC_AxRuntime_BkPlcMc

Position value generation and position control of the axis.

MC_AxRtGenerator_BkPlcMc

Control value generation for the axis.

MC_AxRtController_BkPlcMc

Position control of the axis.

System function blocks, other actual values

Name

Description

MC_AxRtReadForceDiff_BkPlcMc

Determination of the differential actual force of an axis.

MC_AxRtReadForceSingle_BkPlcMc

Determination of the one-sided actual force of an axis.

MC_AxRtReadPressureDiff_BkPlcMc

Determination of the differential actual pressure of an axis.

MC_AxRtReadPressureSingle_BkPlcMc

Determination of the one-sided actual pressure of an axis.

System Function Blocks, Parameter

Name

Description

MC_AxAdsCommServer_BkPlcMc

The application is given the capacity to function as an ADS server.

MC_AxAdsReadDecoder_BkPlcMc

The function block decodes ADS read accesses for an ADS server.

MC_AxAdsWriteDecoder_BkPlcMc

The function block decodes ADS write accesses for an ADS server.

MC_AxAdsPtrArrCommServer_BkPlcMc

The application is given the capacity to function as an ADS server.

MC_AxParamAuxLabelsLoad_BkPlcMc

Loading the label texts for the client-specific axis parameters from a file.

MC_AxParamLoad_BkPlcMc

Load the parameters for an axis from a file.

MC_AxParamSave_BkPlcMc

Write the parameters for an axis into a file.

MC_AxParamDelayedSave_BkPlcMc

Delayed writing of the axis parameters.

MC_AxUtiReadCoeDriveTerm_BkPlcMc

Reading the contents of a register from the EL terminal, which is used as drive interface for the axis.

MC_AxUtiReadCoeEncTerm_BkPlcMc

Reading the contents of a register from the EL terminal, which is used as encoder interface for the axis.

MC_AxUtiReadRegDriveTerm_BkPlcMc

Reading the contents of a register from the KL terminal, which is used as drive interface for the axis.

MC_AxUtiReadRegEncTerm_BkPlcMc

Reading the contents of a register from the KL terminal, which is used as encoder interface for the axis.

MC_AxUtiUpdateRegDriveTerm_BkPlcMc

Writing a parameter set into the register of a KL terminal, which is used as drive interface for the axis.

MC_AxUtiUpdateRegEncTerm_BkPlcMc

Writing a parameter set into the register of a KL terminal, which is used as encoder interface for the axis.

MC_AxUtiWriteCoeDriveTerm_BkPlcMc

Writing the contents of a register into the EL terminal, which is used as drive interface for the axis.

MC_AxUtiWriteCoeEncTerm_BkPlcMc

Writing the contents of a register into the EL terminal, which is used as encoder interface for the axis.

MC_AxUtiWriteRegDriveTerm_BkPlcMc

Writing the contents of a register into the KL terminal, which is used as drive interface for the axis.

MC_AxUtiWriteRegEncTerm_BkPlcMc

Writing the contents of a register into the KL terminal, which is used as encoder interface for the axis.

MC_LinTableExportToAsciFile_BkPlcMc

The function block exports a linearization table to a file in ASCI format.

MC_LinTableExportToBinFile_BkPlcMc

The function block exports a linearization table to a file in binary format.

MC_LinTableImportFromAsciFile_BkPlcMc

The function block imports a linearization table from a file in ASCI format.

MC_LinTableImportFromBinFile_BkPlcMc

The function block imports a linearization table from a file in binary format.

System Function Blocks, Controllers

Name

Description

MC_AxCtrlAutoZero_BkPlcMc

Automatic zero balance.

MC_AxCtrlPressure_BkPlcMc

Controller for pressure build-up control.

MC_AxCtrlPressureFF_Ex_BkPlcMc

Extended controller for a pressure controller with a build-up action.

MC_AxCtrlPullbackOnPressure_BkPlcMc

Controller for pressure displacement control.

MC_AxCtrlSlowDownOnPressure_BkPlcMc

Controller for pressure relief control.

MC_AxCtrlStepperDeStall_BkPlcMc

Monitoring the movement of a stepper motor axis.

MC_AxCtrlVelocity_BkPlcMc

Controller for the axis velocity.

MC_AxCtrlVeloMoving_BkPlcMc

Controller for the axis velocity.

System Function blocks, TableFunctions

Name

Description

MC_AxTableFromAsciFile_BkPlcMc

Reading the content of table from a text file.

MC_AxTableFromBinFile_BkPlcMc

Reading the content of table from a binary file.

MC_AxTableReadOutNonCyclic_BkPlcMc

Function block for determining the slave values assigned to a master value with the aid of a table.

MC_AxTableToAsciFile_BkPlcMc

Writing the contents of a table to text file.

MC_AxTableToBinFile_BkPlcMc

Writing the contents of a table to a binary file.

System Function blocks, Message Logging

Name

Description

MC_AxRtLogAxisEntry_BkPlcMc

An axis-related message is entered in the LogBuffer of the library.

MC_AxRtLogClear_BkPlcMc

Clear and initialize all entries in the LogBuffer.

MC_AxRtLogEntry_BkPlcMc

A message is entered in the LogBuffer of the library.

MC_AxRtLoggerDespool_BkPlcMc

Ensure the minimum number of free messages in the LogBuffer of the library.

MC_AxRtLoggerRead_BkPlcMc

Reading a message from the LogBuffer of the library.

MC_AxRtLoggerSpool_BkPlcMc

Transferring messages from the LogBuffer of the library into the Windows event viewer.

System function blocks, runtime functions

Name

Description

MC_AxRtCheckSyncDistance_BkPlcMc

Monitoring of the distance between the referencing cam and zero pulse.

MC_AxRtCmdBufferExecute_BkPlcMc

Processing of the command buffer.

MC_AxRtCommandsLocked_BkPlcMc

The function simplifies setting and deleting of a protective function in the status double word of an axis.

MC_AxRtGoErrorState_BkPlcMc

(not recommended) The axis is placed into an error state.

MC_AxRtMoveChecking_BkPlcMc

Monitoring the movement of an axis.

MC_AxRtSetDirectOutput_BkPlcMc

Direct output of a control value.

MC_AxRtSetExtGenValues_BkPlcMc

Supplying an axis with command variables, which do not originate from the axis' own generator.

MC_AxStandardBody_BkPlcMc

Calls the usual sub-components for an axis (encoder, generator, finish, drive).

MC_AxUtiAutoIdent_BkPlcMc

Automatic determination of axis parameters.

MC_AxUtiAutoIdentSlave_BkPlcMc

in preparation: Automatic determination of slave axis parameters.

MC_AxUtiAverageDerivative_BkPlcMc

Determination of the derivative of value through numeric differentiation over than one cycle.

MC_AxUtiPT1_BkPlcMc

Calculation of a first-order low-pass.

MC_AxUtiPT2_BkPlcMc

Calculation of a second-order low-pass.

MC_AxUtiSlewRateLimitter_BkPlcMc

Generation of a rise-limited ramp.

MC_AxUtiSlidingAverage_BkPlcMc

Determination of a sliding average value.

MC_AxUtiStandardInit_BkPlcMc

Initialization and monitoring of axis components.

MC_FunctionGeneratorFD_BkPlcMc

A function generator.

MC_FunctionGeneratorSetFrq_BkPlcMc

Updates the operating frequency of a time base for one or several function generators.

MC_FunctionGeneratorTB_BkPlcMc

Updates a time base for one or several function generators.

Data types: Enumerations

Name

Description

E_TcMcCurrentStep

This enumeration returns codes for the internal states of the control value generators.

E_TcMcDriveType

The constants in this enumeration are used to identify the hardware used to output the control values for an axis.

E_TcMcEncoderType

The constants in this enumeration are used to identify the hardware used to acquire the actual values for an axis.

E_TcMCFbState

This enumeration supplies codes for the current state of an axis.

E_TcMcHomingType

This enumeration supplies codes for the referencing method used by an axis.

E_TcMCParameter

The constants listed here are used for numbering parameters.

E_TcMcPressureReadingMode

The constants in this list determine which actual value in the ST_TcHydAxRtData structure of the axis is to be updated with the result of a pressure or force measurement.

E_TcMcProfileType

The constants listed here are used for identifying control value generators.

E_TcPlcBufferedCmdType_BkPlcMc

In preparation: The constants in this list are used to identify buffered axis commands.

MC_BufferMode_BkPlcMc

The constants in this list are used for controlling blending according to PLC Open.

MC_Direction_BkPlcMc

This enumeration supplies codes for the direction of movement if this information is not contained in other data or cannot be in determined on the basis of the situation.

MC_HomingMode_BkPlcMc

This enumeration returns codes for specification of the referencing method.

MC_StartMode_BkPlcMc

The constants in this list are used for identifying the modes during axis startups.

Data types: Structures

Name

Description

Axis_Ref_BkPlcMc

A variable of this type contains all the necessary variables or pointers to variables that are associated with an axis.

CAMSWITCH_REF_BkPlcMc

A variable of this type is transferred to an MC_DigitalCamSwitch_BkPlcMc function block.

MC_CAM_ID_BkPlcMc

A variable of this type contains the description of a cam plate prepared for coupling.

MC_CAM_REF_BkPlcMc

A variable of this type contains the description of a provided cam plate.

OUTPUT_REF_BkPlcMc

A variable of this type contains output data of an MC_DigitalCamSwitch_BkPlcMc function block.

ST_FunctionGeneratorFD_BkPlcMc

A variable of this type contains parameters for defining the output signals of a function generator.

ST_FunctionGeneratorTB_BkPlcMc

A variable of this type contains parameter for defining a time base for a function generator.

ST_TcMcAutoIdent

A variable of this type contains the parameters for an MC_AxUtiAutoIdent_BkPlcMc function block.

ST_TcMcAuxDataLabels

A variable of this type contains label texts for the client-specific axis parameters.

ST_TcHydAxParam

A variable of this type contains all the parameters for an axis.

ST_TcHydAxRtData

A variable of this type contains the runtime data for an axis.

ST_TcPlcMcLogBuffer

A variable with this structure forms the LogBuffer of the library.

ST_TcPlcMcLogEntry

A variable with this structure contains a message of the LogBuffer of the library.

ST_TcPlcDeviceInput

This structure contains the input image variables of an axis.

ST_TcPlcDeviceOutput

This structure contains the output image variables of an axis.

ST_TcPlcRegDataItem

This structure contains a parameter set for a KL terminal.

ST_TcPlcRegDataTable

This structure contains a parameter for a KL terminal.

TRACK_REF_BkPlcMc

In preparation.