Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the following notes and explanations are followed when installing and commissioning these components.

The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly under development.
For that reason the documentation is not in every case checked for consistency with performance data, standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and without warning.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE® and XFC® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.

Patent Pending

The TwinCAT Technology is covered, including but not limited to the following patent applications and patents:
EP0851348, US6167425 with corresponding applications or registrations in various other countries.

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.


TcPlcHydraulics

TS5810 | TwinCAT PLC Hydraulics

Overview

The TcPlcHydraulics PLC library brings together a range of blocks and functions relevant to hydraulic axes, along with the data types they use. It extends the support for this type of drive technology by making it possible to operate axes whose properties (limit frequency, highly scattered behaviour) is not suitable for positional control, or whose tasks differ sharply from those that are usual for electrical servos.

The function block are designed according to the definitions of the user group of IEC61131 (PLCopen) and are certified to be complient.

Hint: The documentation of Version V2.1 of the library will be supported.

Functions by group | Remark
Administrative functions | Function blocks for administration and accessing of axes.
Single axis motion | Starting and monitoring of single axis motion functions.
Multiple axis functions | Starting and monitoring of multiple axis motion functions.
Drives | Blocks for calculation of setpoint values for output devices.
Encoders | Blocks for calculation of actual process values form input data supplied from peripheral devices.
Parameter handling | Blocks for reading, writing and communicating parameters.
Profile generators | Setpoint generators for active axis movements.
Controllers | Variants of controllers for position, velocity, pressure.
Table functions | Table lookup functions.
Message logging | Blocks for message logging and handling.
Runtime | A set of runtime functions.
Data types | Enummerations and structured types used by the library.


TcPlcLibHydraulics: PLCopen Motion Control: Funktions, blocks and Types

Functions, blocks and types

Note: All the functions, 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 and problem analysis in the Knowledge Base.

Some of the components listed here are not intended to be used by an application. Their presence, interface and behaviour 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 block available to you, independently of the library, and for you to then take the responsibility for using it.

If the library contains 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.

Note: 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.

Note: There is a range of libraries that do target specific arangements of axes of special functionalities. These libraries are based on the TcPlcHydraulics library and have to be ordered separately.

Name | Beschreibung
TcPlcLibHydraulics_30_2R2Vgantry.LIB | under construction
TcPlcLibHydraulics_30_4R3Vgantry.LIB | under construction

PLC open Motion Control

The blocks listed here are oriented towards:

Technical Specification

PLCopen - Technical Comittee 2 - Task Force

Function blocks for motion control

Part 1 Version 1.1 and Part 2 Version 0.99F (Definition not yet finalised)

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

Note: Parts of the PLCopen definitions are not yet finalised. There may be changes in future releases of this library. These changes may affect

  • names, behaviour or even existence of functions, function blocks or derived data types
  • names, behaviour, types or presence of input or output signals

Administrative Function Blocks

Name | Description
MC_CamTableSelect_BkPlcMc | Initialises a variable of type ST_TcPlcMcCamId and prepaires a camming table for being used in a 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 rsp. 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 actual state of an output of a digital cam 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 override of the axis is set.
MC_SetPosition_BkPlcMc | The actual position of the axis is set.
MC_SetReferenceFlag_BkPlcMc | The reference flag for the axis is placed in defined. (Block is not defined by PLCopen)
MC_WriteBoolParameter_BkPlcMc | The boolean parameters of an axis are written.
MC_WriteDigitalOutput_BkPlcMc | The actual state of an output of a digital cam is written.
MC_WriteParameter_BkPlcMc | The non-boolean parameters of an axis are written.

Motion Function Blocks, Single Axis

Name | Description
MC_DigitalCamSwitch_BkPlcMc | Position controlled software cam signals are created.
MC_EmergencyStop_BkPlcMc | Stopping a movement without reaching the target position. (Block is not defined by PLCopen)
MC_Halt_BkPlcMc | Stopping a movement without reaching the target position.
MC_Home_BkPlcMc | Initiation and monitoring of a reference travel.
MC_ImediateStop_BkPlcMc | Stopping a movement without reaching the target position. (Block 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 | Start and monitoring of a joystick controlled positioning process. (Block 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_Stop_BkPlcMc | Stopping a movement without reaching the target position.

Motion Function Blocks, Multiple Axis

Name | Description
MC_CamIn_BkPlcMc | Starts and monitors a a coupling of two axes by using a camming table.
MC_CamOut_BkPlcMc | Releases a camming table coupling of two axes.
MC_GearIn_BkPlcMc | Start and monitor the coupling of two axes.
MC_GearInPos_BkPlcMc | Start the coupling of two axes on the fly.
MC_GearOut_BkPlcMc | Release the coupling of two axes.

System Function Blocks

Name | Description
MC_AxRtDrive_BkPlcMc | Preparation of the control value for the axis for it to be output on a hardware module, Mapping Hints.
MC_AxRtEncoder_BkPlcMc | Determination of the actual position of the axis from the input information of a hardware module, Mapping Hints.
MC_AxRtFinish_BkPlcMc | Adaptation of the generated control value to the special features of the axis.
MC_AxRtFinishLinear_BkPlcMc | Adaptation of the generated control value to the special features of the axis using a linearisation table.
MC_AxRuntime_BkPlcMc | Control value generation for the axis.

System Function Blocks, other actual values

Name | Description
MC_AxRtReadForceDiff_BkPlcMc | Determination of the actual force of the axis from the input data of two analog input terminals.
MC_AxRtReadForceSingle_BkPlcMc | Determination of the actual force of the axis from the input data of an analog input terminal.
MC_AxRtReadPressureDiff_BkPlcMc | Determination of the actual pressure of the axis from the input data of two analog input terminals.
MC_AxRtReadPressureSingle_BkPlcMc | Determination of the actual pressure of the axis from the input data of an analog input terminal.

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 | Load the text labels of the customer 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_AxUtiReadCoeDriveTerm_BkPlcMc | Loads a parameter from a EL terminal that is used to interface the drive unit of an axis.
MC_AxUtiReadCoeEncTerm_BkPlcMc | Loads a parameter from a EL terminal that is used to interface the encoder unit of an axis.
MC_AxUtiReadRegDriveTerm_BkPlcMc | Loads a parameter from a KL terminal that is used to interface the drive unit of an axis.
MC_AxUtiReadRegEncTerm_BkPlcMc | Loads a parameter from a KL terminal that is used to interface the encoder of an axis.
MC_AxUtiUpdateRegDriveTerm_BkPlcMc | Writes a parameter set to a KL terminal that is used to interface the drive of an axis.
MC_AxUtiUpdateRegEncTerm_BkPlcMc | Writes a parameter set to a KL terminal that is used to interface the encoder of an axis.
MC_AxUtiWriteCoeDriveTerm_BkPlcMc | Writes a parameter to a EL terminal that is used to interface the drive unit of an axis.
MC_AxUtiWriteCoeEncTerm_BkPlcMc | Writes a parameter to a EL terminal that is used to interface the encoder of an axis.
MC_AxUtiWriteRegDriveTerm_BkPlcMc | Writes a parameter to a KL terminal that is used to interface the drive unit of an axis.
MC_AxUtiWriteRegEncTerm_BkPlcMc | Writes a parameter to a KL terminal that is used to interface the encoder of an axis.
MC_LinTableExportToAsciFile_BkPlcMc | under construction
MC_LinTableExportToBinFile_BkPlcMc | under construction
MC_LinTableImportFromAsciFile_BkPlcMc | under construction
MC_LinTableImportFromBinFile_BkPlcMc | under construction

System Function Blocks, Controllers

Name | Description
MC_AxCtrlAutoZero_BkPlcMc | Automatic adjustment of the offset compensation.
MC_AxCtrlPressure_BkPlcMc | A block for closing a pressure control loop.
MC_AxCtrlPressureCompensation_BkPlcMc | A block for adapting the output values of a valve according to the valves pressure drop.
MC_AxCtrlPullbackOnPressure_BkPlcMc | A block for correcting the position setpoint of the axis to keep the actual pressure from exceeding a requested setpoint.
MC_AxCtrlSlowDownOnPressure_BkPlcMc | A block for slowing down an axis as much as is needed to keep the actual pressure from exceeding a requested setpoint.
MC_AxCtrlStepperDeStall_BkPlcMc | A block for monitoring the movement of a stepper motor, that is combined with an encoder.
MC_AxCtrlVelocity_BkPlcMc | A block for closing a velocity control loop.
MC_AxCtrlVeloMoving_BkPlcMc | A block for closing a velocity control loop while the axis is actively moved.

System Function Blocks, TableFunctions

Name | Description
MC_AxTableFromAsciFile_BkPlcMc | A block for reading the content of a table from an ASCII file.
MC_AxTableFromBinFile_BkPlcMc | A block for reading the content of a table from a binary file.
MC_AxTableReadOutNonCyclic_BkPlcMc | A block for determining the slave values corresponding to a master value by using a data table.
MC_AxTableToAsciFile_BkPlcMc | A block for writing the content of a table to an ASCII file.
MC_AxTableToBinFile_BkPlcMc | A block for writing the content of a table to a binary file.

System Function Blocks, Message Logging

Name | Beschreibung
MC_AxRtLogAxisEntry_BkPlcMc | An axis related message is entered into the LogBuffer of the library.
MC_AxRtLogClear_BkPlcMc | All entrys of the LogBuffer are cleared and initialised.
MC_AxRtLogEntry_BkPlcMc | A message is entered into the LogBuffer of the library.
MC_AxRtLoggerDeSpool_BkPlcMc | A block that keeps the librarys logging buffer from overrunning.
MC_AxRtLoggerRead_BkPlcMc | Reading a message from the LogBuffer of the library.
MC_AxRtLoggerSpool_BkPlcMc | A block that forwardings messages from the librarys buffer to the Windows event logger.

System Function Blocks, Runtime

Name | Description
MC_AxRtCheckSyncDistance_BkPlcMc | Monitoring of the distance between reference cam and sync pulse.
MC_AxRtCmdBufferExecute_BkPlcMc | under construction
MC_AxRtCommandsLocked_BkPlcMc | under construction
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 | Direkte Ausgabe eines Stellwerts.
MC_AxRtSetExtGenValues_BkPlcMc | Supplies control values to an axis that are not created from the internal setpoint generator.
MC_AxStandardBody_BkPlcMc | Calls the usual sub-components for an axis (encoder, generator, finish, drive).
MC_AxUtiAutoIdentSlave_BkPlcMc | Identifies of some basic parameters for a slave axis.
MC_AxUtiAutoIdent_BkPlcMc | Identifies of some basic parameters of the axis.
MC_AxUtiAverageDerivative_BkPlcMc | Calculates the derivative of a value by numerical differentiation over multiple cycles.
MC_AxUtiCancelMonitoring_BkPlcMc | Aborts the monitoring of a function.
MC_AxUtiPT1_BkPlcMc | Calculates a low pass filter of first order.
MC_AxUtiPT2_BkPlcMc | Calculates a low pass filter of second order.
MC_AxUtiSlewRateLimitter_BkPlcMc | Performes the calculation of a slew rate limited (i.e. ramped) value.
MC_AxUtiSlidingAverage_BkPlcMc | Performes the calculation of a sliding average.
MC_AxUtiStandardInit_BkPlcMc | Initialises and monitors the components of the axis.
MC_FunctionGeneratorFD_BkPlcMc | A function generator.
MC_FunctionGeneratorSetFrq_BkPlcMc | Updates the working frequency of the timebase for one or more function generator.
MC_FunctionGeneratorTB_BkPlcMc | Updates the timebase for one or more function generator.

Data types: Enumerations

Name | Description
E_TcMcCurrentStep | The constants in this enumeration are used to identify the internal states of the setpoint 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 listed here are used for numbering parameters.
E_TcMcProfileType | The constants listed here are used for identifying control value generators.
E_TcPlcBufferedCmdType_BkPlcMc | under construction.
MC_BufferMode_BkPlcMc | This enumeration supplies codes for controlling the blending methods of concatenated move commands.
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 supplies codes for the referencing methode of the axis.
MC_StartMode_BkPlcMc | The constants listed here are used to identify the starting method of the axes.

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 used to call a MC_DigitalCamSwitch_BkPlcMc.htm block.
MC_CAM_ID_BkPlcMc | This structure contains the decription of a camming table, that is ready for use.
MC_CAM_REF_BkPlcMc | This structure contains the raw decription of a camming table.
OUTPUT_REF_BkPlcMc | A variable of this type is used to hold output data of a MC_DigitalCamSwitch_BkPlcMc.htm block.
ST_FunctionGeneratorFD_BkPlcMc | A variable of this type contains parameters for the definition of the output signals of a function generator.
ST_FunctionGeneratorTB_BkPlcMc | A variable of this type contains parameters for the definition of the timebase of a function generator.
ST_TcMcAutoIdent | A variable of this type contains all parameters for a MC_AxUtiAutoIdent_BkPlcMc function block.
ST_TcMcAuxDataLabels | A variable of this type contains text labels for the customer specific parameters of the axis.
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 of this type contains the logging buffer of the library.
ST_TcPlcMcLogEntry | A variable of this type contains one message of the logging buffer of the library.
ST_TcPlcDeviceInput | A variable of this type contains the input data for an axis.
ST_TcPlcDeviceOutput | A variable of this type contains the output data for an axis.
ST_TcPlcRegDataItem | A variable of this type contains an element of a parameter set for a KL terminal.
ST_TcPlcRegDataTable | A variable of this type contains a parameter set for a KL terminal.
TRACK_REF_BkPlcMc | Under construction.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_Power_BkPlcMc

FUNCTION_BLOCK MC_Power_BkPlcMc (starting with V3.0)

The block is used to control an external device. For more see FAQ #9.

VAR_INPUT
        Enable:         BOOL;
        Enable_Positive:        BOOL;
        Enable_Negative:        BOOL;
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Status:         BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: A TRUE at this input activates an external device of an axis.

Enable_Positive: A TRUE at this input activates the directional enable of an external device of an axis for movements in a positive direction.

Enable_Negative: A TRUE at this input activates the directional enable of an external device of an axis for movements in a positive direction.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

Status: Readiness for operation is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded error message is provided here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

This block is used to control external devices. These can be modules for valve control (the valve's onboard power stage or some switch cabinet assembly), frequency converters or servoamplifiers. These devices usually require a digital signal to enable the output of energy through a power stage. Depending on the design of the device, it is also possible for the "positive" and "negative" movement directions to be individually activated.

The block's input signals are passed on through the interface to the peripheral device. Enable also activates error monitoring.

The block checks the axis interface that has been passed to it every time it is called. A number of problems can be detected and reported during this process:

  • If the value iTcMc_DriveAx2000_B200 or iTcMc_DriveAx2000_B900 is set as nDrive_Type in Axis_Ref_BkPlcMc.stAxParams:
    • The pointers pStDeviceInput and pStDeviceOutput in Axis_Ref_BkPlcMc are checked. If these pointers have not been initialised, the block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcDriveIn or dwTcHydErrCdPtrPlcDriveOut. Status is then FALSE.
    • If a problem is detected in the communication to the AX device or a fault is detected in the pStDeviceInput interface the block responds with Error and ErrorID defined in the Global Constants. Status is then FALSE, and the axis is placed into a fault state with a reported error code dwTcHydErrCdDriveNotReady.
    • Otherwise, the value of Enable is returned as the Status.
  • If the value iTcMc_DriveKL2531 or iTcMc_DriveKL2541 is set as nDrive_Type in Axis_Ref_BkPlcMc.stAxParams:
    • The pointers pStDeviceInput and pStDeviceOutput in Axis_Ref_BkPlcMc are checked. If these pointers have not been initialised, the block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcDriveIn or dwTcHydErrCdPtrPlcDriveOut. Status is then FALSE.
    • If a problem is detected in the communication to the I/O device or a fault is detected in the pStDeviceInput interface the block responds with Error and ErrorID defined in the Global Constants. Status is then FALSE, and the axis is placed into a fault state with a reported error code dwTcHydErrCdDriveNotReady.
    • Enable is used to enable or disable the output stage of the terminal by defining a bit in pStDeviceOutput.bTerminalCtrl.
    • The ready signal from pStDeviceInput.bTerminalState of the terminal is returned as the Status.
  • Otherwise the pointers pStDeviceInput and pStDeviceOutput in Axis_Ref_BkPlcMc are checked. If these pointers have not been initialised, the block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcDriveIn or dwTcHydErrCdPtrPlcDriveOut. Status is then FALSE.
    • Otherwise, the value of bPowerOk from pStDeviceInput is returned as the Status.
  • If the drive interface is operating without error, the value of Enable is entered with the mask dwTcHydDcDwCtrlEnable in the nDeCtrlDWord of stAxRtData.
  • If the drive interface is operating without error, the value of Enable_Positive is entered with the mask dwTcHydDcDwFdPosEna in the nDeCtrlDWord of stAxRtData.
  • If the drive interface is operating without error, the value of Enable_Negative is entered with the mask dwTcHydDcDwFdNegEna in the nDeCtrlDWord of stAxRtData.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_ReadActualPosition_BkPlcMc

FUNCTION_BLOCK MC_ReadActualPosition_BkPlcMc (starting with V3.0)

This function block reads the actual position of an axis.

VAR_INPUT
        Enable:         BOOL;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Valid:          BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Position:               LREAL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: Updating of the position value is initiated by a rising edge at this input.

Busy: A pending command is indicated here.

Valid: Successful determination of the actual position is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Position: The actual position.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Enable, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If the axis is already in a fault state, and if the cause lies with an encoder problem, it responds with Error and ErrorID:=the encoder's error code.

The actual position is determined and reported with Valid if these checks can be carried out without problems.

A falling edge at Enable clears all the pending output signals.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_ReadActualTorque_BkPlcMc

FUNCTION_BLOCK MC_ReadActualTorque_BkPlcMc (starting with V3.0)

This function block reads the actual force rsp. pressure of an axis.

VAR_INPUT
        Enable:         BOOL;
END_VAR

VAR_OUTPUT
        Valid:          BOOL;
        Busy:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Torque:         LREAL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: Updating of the position value is initiated by a rising edge at this input.

Valid: Successful determination of the actual position is indicated here.

Busy: This output is set to TRUE during the execution of the command.

Erro: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Torque: The actual force rsp. pressure.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Enable, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If the axis is already in a fault state, and if the cause lies with an encoder problem, it responds with Error and ErrorID:=the encoder's error code.

The actual force rsp. pressure is determined and reported with Valid if these checks can be carried out without problems.

A falling edge at Enable clears all the pending output signals.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_ReadActualVelocity_BkPlcMc

FUNCTION_BLOCK MC_ReadActualVelocity_BkPlcMc (starting with V3.0)

This function block reads the actual velocity of an axis.

VAR_INPUT
        Enable:         BOOL;
END_VAR

VAR_OUTPUT
        Valid:          BOOL;
        Busy:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Velocity:               LREAL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: Updating of the position value is initiated by a rising edge at this input.

Valid: Successful determination of the actual position is indicated here.

Busy: This output is set to TRUE during the execution of the command.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Velocity: The actual velocity.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Enable, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If the axis is already in a fault state, and if the cause lies with an encoder problem, it responds with Error and ErrorID:=the encoder's error code.

The actual velocity is determined and reported with Valid if these checks can be carried out without problems.

A falling edge at Enable clears all the pending output signals.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_ReadAxisError_BkPlcMc

FUNCTION_BLOCK MC_ReadAxisError_BkPlcMc (starting with V3.0)

This function block determines the current error code of an axis.

VAR_INPUT
        Enable:         BOOL;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        AxisErrorID:    UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable : Updating of the error code is activated by TRUE at this input.

Busy: A pending command is indicated here.

Done : Successful determination of the actual position is indicated here.

Error: A TRUE here will signal any kind of problem while executing the functionality of the block.

ErrorID : In case of any kind of problem while executing the blocks functionality an encoded indication of the cause is provided here.

AxisErrorID : The actual error code of the axis is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

A TRUE at Enable will activate the block. It will investigate the axis interface that has been passed to it and will report the actual error code of the axis. A FALSE at Enable clears all the pending output signals.

Note: The execution of this blocks commands will not take any time or preconditions. The outputs Error and Busy will become TRUE under no circumstances and are supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_ReadBoolParameter_BkPlcMc

FUNCTION_BLOCK MC_ReadBoolParameter_BkPlcMc (starting with V3.0)

This function block reads the boolean parameters of an axis. The block MC_ReadParameter_BkPlcMc is available for non-boolean parameters.

VAR_INPUT
        Enable:         BOOL;
        ParameterNumber:        INT;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Value:          BOOL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: A reading process is initiated by a rising edge at this input.

ParameterNumber : This code number specifies the parameter that is to be read. Only named constants from E_TcMCParameter should be used.

Busy: A pending command is indicated here.

Done: Successful execution of the reading process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Value: The value of the parameter is made available here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Enable, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If an unsupported value is given to ParameterNumber the block responds with Error and ErrorID:=dwTcHydErrCdNotSupport.

The desired parameter value is made available at Value, and Done is asserted if these checks can be carried out without problems.

A falling edge at Enable clears all the pending output signals.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_ReadDigitalOutput_BkPlcMc

FUNCTION_BLOCK MC_ReadDigitalOutput_BkPlcMc (starting with V3.0)

This function block reads the actual state of an output of a digital cam.

VAR_INPUT
        Enable:         BOOL;
        OutputNumber:   INT;
END_VAR

VAR_OUTPUT
        Valid:          BOOL;
        Busy:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Value:          BOOL;
END_VAR

VAR_INOUT
        Output:         OUTPUT_REF_BkPlcMc;
END_VAR

Enable: Updating of the state is initiated by a rising edge at this input.

OutputNumber: The number of the requested output.

Valid: Successful determination of the actual state is indicated here.

Busy: This output is set to TRUE during the execution of the command.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Value: The actual state.

Output: The address of a variable of type OUTPUT_REF_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a TRUE Enable, and investigates the parameters that has been passed to it. A problem can be detected and reported during this process:

  • If OutputNumber is not in the accepted range [0..31], the block responds with Error and ErrorID:=dwTcHydErrCdIllegalOutputNumber.

The actual state is determined and reported with Valid if these checks can be carried out without problems.

A falling edge at Enable clears all the pending output signals.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_ReadParameter_BkPlcMc

FUNCTION_BLOCK MC_ReadParameter_BkPlcMc (starting with V3.0)

This function block reads the non-boolean parameters of an axis. The block MC_ReadBoolParameter_BkPlcMc is available for boolean parameters.

VAR_INPUT
        Enable:         BOOL;
        ParameterNumber:        INT;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Value:          LREAL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: A reading process is initiated by a rising edge at this input.

ParameterNumber: This code number specifies the parameter that is to be read. Only named constants from E_TcMCParameter should be used.

Busy: A pending command is indicated here.

Done: Successful execution of the reading process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Value: The value of the parameter is made available here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Enable, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If an unsupported value is given to ParameterNumber the block responds with Error and ErrorID:=dwTcHydErrCdNotSupport.

The desired parameter value is made available at Value, and Done is asserted if these checks can be carried out without problems.

A falling edge at Enable clears all the pending output signals.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_ReadStatus_BkPlcMc

FUNCTION_BLOCK MC_ReadStatus_BkPlcMc (starting with V3.0)

This function block determines the current error code of an axis.

VAR_INPUT
        Enable:                 BOOL;
END_VAR

VAR_OUTPUT
        Busy:                   BOOL;
        Done:                   BOOL;
        Error:                  BOOL;
        ErrorID:                        UDINT;
        Errorstop:              BOOL;
        Disabled:                       BOOL;
        Stopping:                       BOOL;
        StandStill:             BOOL;
        DiscreteMotion:         BOOL;
        ContinousMotion:                BOOL;
        SynchronizedMotion:     BOOL;
        Homing:                 BOOL;
        ConstantVelocity:               BOOL;
        Accelerating:           BOOL;
        Decelerating:           BOOL;
END_VAR

VAR_INOUT
        Axis:                   Axis_Ref_BkPlcMc;
END_VAR

Enable: A TRUE state at this input causes the block to update.

Busy: A pending command is indicated here.

Done: Successful determination of the actual position is indicated here.

Error: A TRUE here will signal any kind of problem while executing the functionality of the block.

ErrorID: In case of any kind of problem while executing the blocks functionality an encoded indication of the cause is provided here.

Errorstop: This signal indicates that the axis associated with an error has been placed in a state in which it is not able to operate. This state can only be cleared by activating either a MC_Reset_BkPlcMc or a MC_ResetAndStop_BkPlcMc block.

Disabled: This signal indicates the activity of the MC_Power_BkPlcMc block of the axis.

Stopping: This signal indicates that an active movement of the axis is being stopped by a MC_Stop_BkPlcMc or by a MC_ResetAndStop_BkPlcMc block. This signal is cleared as soon as the axis is stationary.

StandStill: This signal indicates that the axis is neither in a fault state nor is it active.

DiscreteMotion: This signal indicates that the axis is executing an autonomous movement (not resulting from a coupling) with a defined target.

ContinousMotion: This signal indicates that the axis is executing an autonomous movement (not resulting from a coupling) with a defined velocity but not with a specified target.

SynchronizedMotion: This signal indicates that the axis is being controlled by a gear coupling.

Homing: This signal indicates that the axis is executing a reference travel.

ConstantVelocity: This signal indicates that the axis is being moved with constant velocity.

Accelerating: This signal indicates that the velocity of an axis is reaching a specified value. Note: This does not always mean that the velocity is increasing: when an axis that is already in movement is started, it can happen that the axis accelerates in the direction opposite the current sense of the velocity in order to achieve a specified velocity in the other direction. From the point of view of the original movement this is a deceleration, although from the point of the current (new) movement it is still an acceleration.

Decelerating: This signal indicates that the axis is reducing its velocity in order to continue a movement with a velocity lower than the current velocity, or in order to end it.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

If TRUE is asserted at Enable the block starts to analise the axis interface and decodes the internal status information. A FALSE state at Enable clears all the pending output signals.

Note: The execution of this blocks commands will not take any time or preconditions. The outputs Error and Busy will become TRUE under no circumstances and are supported for compatibility reasons only.

Attention : The outputs Error and ErrorID are reporting the status of the block, not the status of the axis. To read the actual error code of the axis use a MC_ReadAxisError_BkPlcMc() block.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_Reset_BkPlcMc

FUNCTION_BLOCK MC_Reset_BkPlcMc (starting with V3.0)

This function block is reseting a fault state and is placing the axis in a functional state.

VAR_INPUT
        Execute:                BOOL;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : An axis reset is initiated by a rising edge at this input.

Busy: A pending command is indicated here.

Done : Successful execution of the axis reset is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On a rising edge at Execute the axis reset is executed. The axis is placed, as far as possible, into a state in which it is ready to operate, and the Done signal is given. If this is not possible, the block reacts with Error and ErrorID:= the ErrorCode of the axis.

A falling edge at Execute clears all the pending output signals.

Note: For some drive types the reset operation includes the exchange of signals with an external device. The block cannot respond with a final result (Done or Error) while this communication is still under progress. To signal this situation it will set Busy until the operation is finished.


TcPlcLibHydraulics: PLCopen Motion Control: Administrative: MC_ResetAndStop_BkPlcMc

FUNCTION_BLOCK MC_ResetAndStop_BkPlcMc (starting with V3.0)

This function block is placing an axis in a fault state in an operable state. If the axis is running a motion command this command will be aborted. The stop operation is monitored.

VAR_INPUT
        Execute:                BOOL;
        Deceleration:   LREAL;  (starting with 3.0.5)
        Jerk:           LREAL;  (starting with 3.0.5)
        RampTime:       LREAL;  (starting with 3.0.5)
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute: An axis reset and a stop operation are initiated by a rising edge at this input.

Deceleration: The requested deceleration.

Jerk: The requested jerk level.

RampTime: The requested ramp time.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

Done: Successful execution of the axis reset is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If it is not possible to successfully clear an existing fault state for an axis through a reset operation, the block reacts with Error and ErrorID:= the ErrorCode for the axis.
  • If the axis is placed into an error state in the course of a stop operation that may have been necessary, the block reacts with Error and ErrorID:= the ErrorCode for the axis.

Successful completion of both operations is reported with Done. The axis is then without error and stationary.

A falling edge at Execute clears all the pending output signals.

Note: If the axis is moving it will be decellerated completely. For some drive types a reset operation includes the exchange of signals with an external device. The block cannot respond with a final result (Done or Error) while these activities are still under progress. To signal this situation it will set Busy until the operation is finished.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_SetOverride_BkPlcMc

FUNCTION_BLOCK MC_SetOverride_BkPlcMc (starting with V3.0)

This function block sets the override for the axis.

Attention : This block is working only in combination with profile type iTcMc_ProfileCtrlBased.

VAR_INPUT
        Enable:         BOOL;
        VelFactor:      LREAL;
END_VAR

VAR_OUTPUT
        Enabled:                BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: The command is active if this input is TRUE.

VelFactor: The requested value for the override of the axis.

Enabled: This output marks the activity of the block.

Done : Successful processing of the command is indicated here.

Busy: This output is set to TRUE during the execution of the command.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

If a TRUE is applied at Enable the value of VelOverride is limited to the range 0.0 to 1.0 and placed at Axis.pStAxParams^.fOverride. Enabled is set to TRUE.

A falling edge on Enable will clear all the pending output signals.

All velocity changes caused by a change of the override are limited according the maximum acceptable accelerations and decelerations defined by the axis parameters.

Hint: To guarantee a reproducible behaviour in the targeting operation the override will not reduce the moving speed below pStAxParams.fCreepSpeed. Because of this an axis cannot be stopped over in an active move by applying a 0.0 as the override.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_SetPosition_BkPlcMc

FUNCTION_BLOCK MC_SetPosition_BkPlcMc (starting with V3.0)

This function block sets the actual position for the axis.

VAR_INPUT
        Execute:                BOOL;
        Position:               LREAL;
        Mode:           BOOL;
END_VAR

VAR_OUTPUT
        Done:           BOOL;
        Busy:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The command is initiated by a rising edge at this input.

Position : The requested value for the actual position of the axis.

Mode: This parameter defines the rules for the command. For Mode=TRUE the actual position is changed for Position, for Mode=FALSE the actual position is set to Position.

Done : Successful processing of the command is indicated here.

Busy: This output is set to TRUE during the execution of the command.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • Depending on the encoder type specified in Axis.pStAxParams^.nEnc_Type either ST_TcHydAxRtData.fEnc_RefShift or ST_TcHydAxParam.fEnc_ZeroShift are modified to change the actual position to the requested value. If the encoder type is unknown or the encoder is not supporting this functionality the block will react by asserting Error with ErrorID:=dwTcHydErrCdEncType.
  • If ST_TcHydAxParam.fEnc_ZeroShift is changed Axis_Ref_BkPlcMc.ST_TcHydAxRtData.bParamsUnsave is set to TRUE.

If these checks can be carried out without problems the block will update all related elements in ST_TcHydAxRtData automatically. Therefor the block can be used even for an axis that is active moving. The succesfull execution of the block is signaled with Done. A falling edge on Execute will clear all the pending output signals.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_SetReferenceFlag_BkPlcMc

FUNCTION_BLOCK MC_SetReferenceFlag_BkPlcMc (starting with V3.0)

(Block is not defined by PLCopen) This function block defines the reference flag for the axis.

VAR_INPUT
        Execute:                BOOL;
        ReferenceFlag:  BOOL;
END_VAR

VAR_OUTPUT
        Done:           BOOL;
        Busy:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The command is initiated by a rising edge at this input.

ReferenceFlag: The new state of the reference flag of the axis.

Done : Successful processing of the command is indicated here.

Busy: This output is set to TRUE during the execution of the command.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute and will update the reference flag in ST_TcHydAxRtData.nStateDWord automatically. The bit is set or reset depending on ReferenceFlag by use of dwTcHydNsDwReferenced. The succesfull execution of the block is signaled with Done. A falling edge on Execute will clear all the pending output signals.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_WriteBoolParameter_BkPlcMc

FUNCTION_BLOCK MC_WriteBoolParameter_BkPlcMc (starting with V3.0)

This function block writes the boolean parameters of an axis. The block MC_WriteParameter_BkPlcMc is available for non-boolean parameters.

VAR_INPUT
        Enable:         BOOL;
        ParameterNumber:        INT;
        Value:          BOOL;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable : A write process is initiated by a rising edge at this input.

ParameterNumber : This code number specifies the parameter that is to be read. Only named constants from E_TcMCParameter should be used.

Value : The value of the parameter is to be provided here.

Busy: A pending command is indicated here.

Done : Successful execution of the writing process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Enable, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If an unsupported value is given to ParameterNumber the block responds with Error and ErrorID:=dwTcHydErrCdNotSupport.

The desired parameter value can be written with Value and Done is asserted if these checks can be carried out without problems. If the parameter is changed Axis_Ref_BkPlcMc.ST_TcHydAxRtData.bParamsUnsave is set to TRUE.

A falling edge at Enable clears all the pending output signals.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_WriteDigitalOutput_BkPlcMc

FUNCTION_BLOCK MC_WriteDigitalOutput_BkPlcMc (starting with V3.0)

This function block reads the actual state of an output of a digital cam.

VAR_INPUT
        Execute:                BOOL;
        OutputNumber:   INT;
        Value:          BOOL;
END_VAR

VAR_OUTPUT
        Done:           BOOL;
        Busy:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Output:         OUTPUT_REF_BkPlcMc;
END_VAR

Execute: Updating of the state is initiated by a rising edge at this input.

OutputNumber: The number of the requested output.

Value: The requested state.

Done: Successful execution of the command is indicated here.

Busy: This output is set to TRUE during the execution of the command.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Output: The address of a variable of type OUTPUT_REF_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge on Execute, and investigates the parameters that has been passed to it. A problem can be detected and reported during this process:

  • If OutputNumber is not in the accepted range [0..31], the block responds with Error and ErrorID:=dwTcHydErrCdIllegalOutputNumber.

The state is defined and reported with Done if these checks can be carried out without problems.

A falling edge at Execute clears all the pending output signals.


TcPlcHydraulics: PLCopen Motion Control: Administrative: MC_WriteParameter_BkPlcMc

FUNCTION_BLOCK MC_WriteParameter_BkPlcMc (starting with V3.0)

This function block writes the non-boolean parameters of an axis. The MC_WriteBoolParameter_BkPlcMc block is available for boolean parameters.

VAR_INPUT
        Enable:         BOOL;
        ParameterNumber:        INT;
        Value:          LREAL;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: A write process is initiated by a rising edge at this input.

ParameterNumber: This code number specifies the parameter that is to be read. Only named constants from E_TcMCParameter should be used.

Value: The value of the parameter is to be provided here.

Busy: A pending command is indicated here.

Done: Successful execution of the writing process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Enable, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If an unsupported value is given to ParameterNumber the block responds with Error and ErrorID:=dwTcHydErrCdNotSupport.

The desired parameter value can be written with Value and Done is asserted if these checks can be carried out without problems. If the parameter is changed significantly Axis_Ref_BkPlcMc.ST_TcHydAxRtData.bParamsUnsave is set to TRUE.

A falling edge at Enable clears all the pending output signals.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_CamIn_BkPlcMc

FUNCTION_BLOCK MC_CamIn_BkPlcMc (starting with V3.0)

This function block starts and monitors a a coupling of two axes by using a camming table. The coupling can be released by using a MC_CamOut_BkPlcMc block.

VAR_INPUT
        Execute:                BOOL;
        MasterOffset:   LREAL:=0.0;
        SlaveOffset:    LREAL:=0.0;
        MasterScaling:  LREAL:=0.0;
        SlaveScaling:   LREAL:=0.0;
        StartMode:      MC_StartMode_BkPlcMc:=MC_StartMode_Absolute;
        CamTableId:     MC_CAM_ID_BkPlcMc;
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
ND_VAR

VAR_OUTPUT
        Busy:           BOOL;
        InSync:         BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        EndOfProfile:   BOOL;
END_VAR

VAR_INOUT
        Master:         Axis_Ref_BkPlcMc;
        Slave:          Axis_Ref_BkPlcMc;
END_VAR

Execute: The comand is initiated by a rising edge at this input.

MasterOffset, MasterScaling: These values are used for translating the masters actual position before it is searching for in the master row of the camming table.

SlaveOffset, SlaveScaling: These values are used for translating the slave position from the camming table.

StartMode: A value from MC_StartMode_BkPlcMc, that is determining the behaviour of the slave axis at the start of the coupling.

CamTableId: The address of a variable of type MC_CAM_ID_BkPlcMc is to be passed here. The variable has to be initialised by a block of type MC_CamTableSelect_BkPlcMc.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

InSync: Here the first succesful synchrinisation of the axes is signaled. This signal will not change if the synchronicity is lost later.

CommandAborted : Abortion of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

EndOfProfile: This flag signals, that the end of the camming table is reached.

Master, Slave: The addresses of variables of type Axis_Ref_BkPlcMc are to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If CamTableId.bValidated is not initialised by a block of type MC_CamTableSelect_BkPlcMc, the block responds with Error and ErrorID:=dwTcHydErrCdTblNoInit.
  • If either the master or the slave are not in the idle state, the block responds with Error and ErrorID:=dwTcHydErrCdNotStartable.
  • If StartMode is set to MC_StartMode_RampIn, the block responds with Error and ErrorID:=dwTcHydErrCdNotSupport.

The coupling is initiated if these checks can be carried out without problems. Depending on StartMode the base position for the slave axis is set to 0.0 or the actual position of the Slave. The axis is now in the McState_Synchronizedmotion state, and the block begins to calculate and monitor the coupling.

The setpoints for the slaves position and velocity are caclulated depending on the actual position and velocity setpoint of the master and the table.

If the slave is reaching the velocity requested from the coupling InSync is set. Because the coupling can be activated only in idle state this will occur imediately. If the slave cannot follow the requested motion later InSync will not change.

If the movement algorithm reports an error code while the coupling is being executed, the block responds with Error and ErrorID:=the movement algorithm's error code.

A falling edge at Execute will not stop the calculation nor the monitoring. This can be acheaved only by releasing the coupling by use of a block of type MC_CamOut_BkPlcMc or by an error condition. This will clear all pending output signals as well.

Note: This block takes over the task of the setpoint generation during part of its activity. This is signaled with Busy not only while going into the synchronous operation but allso during the complete lifetime of the coupling.

Attention : This block has to be called cyclically as long as Busy is TRUE. After that the block has to be called at least once with Execute:=FALSE.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_CamOut_BkPlcMc

FUNCTION_BLOCK MC_CamOut_BkPlcMc (starting with V3.0)

This function block releases a camming table coupling of two axes, that has been started by a block of type MC_CamIn_BkPlcMc.

VAR_INPUT
        Execute:                BOOL;
ND_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Slave:          Axis_Ref_BkPlcMc;
END_VAR

Execute: The comand is initiated by a rising edge at this input.

Busy: A pending command is indicated here.

Done: Successful processing of the command is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Slave: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If the pointer pStAxParams in Axis_Ref_BkPlcMc is not initialised, the block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcMc.
  • If the pointer pStAxRtData in Axis_Ref_BkPlcMc is not initialised, the block responds with Error and ErrorID:=dwTcHydErrCdPtrMcPlc.
  • If the axis is not coupled the block will respond by signaling Done without any further checking or activity.
  • If the current velocity of the axis is lower than the velocity specified by pStAxParams.fCreepSpeed the axis is imediately placed in McState_Standstill state and is braking from any remaining velocity. Done is signaled and there will be no further checking or other activities.

If these checks can be carried out without problems and Done is not allready signaled for one of the reasons discussed obove the coupling is converted into an endless move with the same velocity and direction, but independend from the masters activities. If this conversion is successfull Done is signaled, otherwise the block will respond with Error and ErrorID:=the movement algorithm's error code.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_CamTableSelect_BkPlcMc

FUNCTION_BLOCK MC_CamTableSelect_BkPlcMc (starting with V3.0)

This function block initialises a variable of type MC_CAM_ID_BkPlcMc and is prepairing a camming table for being used in a coupling of two axes.

VAR_INPUT
        Execute:                BOOL;
        Periodic:               BOOL;
        MasterAbsolute: BOOL;
        SlaveAbsolute:  BOOL;
ND_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        CamTableId:     MC_CAM_ID_BkPlcMc;
END_VAR

VAR_INOUT
        Master:         Axis_Ref_BkPlcMc;
        Slave:          Axis_Ref_BkPlcMc;
        CamTable:               MC_CAM_REF_BkPlcMc;
END_VAR

Execute: The comand is initiated by a rising edge at this input.

Periodic: Not supported: Apply FALSE here.

MasterAbsolute: Not supported: Apply TRUE here.

SlaveAbsolute: Not supported: Apply TRUE here.

Busy: A pending command is indicated here.

Done: Successful processing of the initialisation is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

CamTableId: The address of a variable of type MC_CAM_ID_BkPlcMc is returned here. This variable can now be used for a block of type MC_CamIn_BkPlcMc.

Master, Slave: The addresses of variables of type Axis_Ref_BkPlcMc are to be passed here.

CamTable: The address of a variable of type MC_CAM_REF_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If CamTable.pTable is not initialised, the block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcMc.
  • If CamTable.nLastIdx is not bigger than CamTable.nFirstIdx, the block responds with Error and ErrorID:=dwTcHydErrCdTblEntryCount.
  • If CamTable.nFirstIdx and CamTable.nLastIdx define a table that holds more than 100 lines, the block responds with Error and ErrorID:=dwTcHydErrCdTblLineCount.
  • If MasterAbsolute or SlaveAbsolute are set to FALSE or Periodic is set to TRUE, the block responds with Error and ErrorID:=dwTcHydErrCdNotSupport.

If these checkings can be done without any problems the block will initialise CamTableId. The data from CamTable and the input data of the block are copied. CamTableId is marked as valid and changed. Done is set to signal the execution of the comand.

A falling edge on Execute will clear all pending outputs.

Note: The execution of this blocks commands will not take any time. The output Busy will become TRUE under no circumstances and is supported for compatibility reasons only.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_DigitalCamSwitch_BkPlcMc

FUNCTION_BLOCK MC_DigitalCamSwitch_BkPlcMc (starting with V3.0)

This block is creating position controlled software cam signals.

VAR_INPUT
        Enable:         BOOL;
        EnableMask:     DWORD;
END_VAR

VAR_OUTPUT
        InOperation:    BOOL;
        Busy:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
        Switches:               CAMSWITCH_REF_BkPlcMc;
        Outputs:                OUTPUT_REF_BkPlcMc;
        TrackOptions:   TRACK_REF_BkPlcMc;
END_VAR

Enable: This input is controlling all activities of the block.

EnableMask: The bits in this mask are controlling the bits in Outputs.

InOperation: This output is set to TRUE while the block is actively executing its operation.

Busy: This output is set to TRUE during the execution of the command.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Switches: Hier ist ein Array vom Typ CAMSWITCH_REF_BkPlcMc zu übergeben.

Outputs: The address of a variable of type OUTPUT_REF_BkPlcMc is to be passed here.

TrackOptions: The address of a variable of type TRACK_REF_BkPlcMc is to be passed here.

Behaviour of the block:

A set of index switches is controlled by the actual position of the axis. There are position controlled (defined by a start and end position) and time controlled (defined by trigger position and duration) signals. The moving direction of the axis can be taken into account.

The signals are assigned to tracks. These tracks may have ON and OFF delay times and a hysteresis as well. A negative delay setting can be used to create a look ahead signal. The hysteresis can be used to avoid spurious signals when the axis is about a trigger setpoint is is not perfectly stable.

Example:

Used CAMSWITCH_REF_BkPlcMc:

Parameter | Switch[1] | Switch[2] | Switch[3] | Switch[4] | ... | Switch[n]
TrackNumber | 1 | 1 | 1 | 2 |  |
FirstOnPosition | 2000.0 | 2500.0 | -1000.0 | 3000.0 |  |
LastOnPosition | 3000.0 | 3000.0 | 1000.0 |  |  |
AxisDirection | 1 | 2 | 0 | 0 |  |
CamSwitchMode | 0 | 0 | 0 | 1 |  |
Duration |  |  |  | 1.35 |  |
..... |  |  |  |  |  |

Used TRACK_REF_BkPlcMc:

Parameter | Track[1] | Track[2] | ... | Track[n]
OnCompensation | -0.125 | 0.0 |  |
OffCompensation | 0.250 | 0.0 |  |
Hysteresis | 0.0 | 0.0 |  |

Signal trace on a move from 0.0mm to 5000.0mm and back:

The following scope view details the output signals versus the axis position. The signal are displayed in normal way (rising upwards) while the axis is moving in positive direction and inverse (rising downwards) while the axis is moving negative. The cursor lines mark the positions 1000mm and 3000mm.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_EmergencyStop_BkPlcMc

FUNCTION_BLOCK MC_EmergencyStop_BkPlcMc (starting with V3.0.5)

This function block cancels an active motion operation and monitors the emergency stop operation of an axis.

VAR_INPUT
        Execute:                BOOL;
        RampTime:               LREAL;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Active:         BOOL;
        CommandAborted: BOOL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : A rising edge at this input ends a movement being carried out by the axis.

RampTime: The requested ramp time.

Busy: A pending command is indicated here.

Done : Successful processing of the operation is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Active: A pending command is indicated here.

CommandAborted: The abortion of the command by another command is indicated here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • The stop can only be executed if the axis is actively carrying out a movement. If it is stationary, the block immediately asserts the Done signal.
  • If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If the axis is already in a state where it is controlled by a coupling to another axis or by a comparable mechanism, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.

The Stop operation begins if these checks can be carried out without problems. RampTime and the reference velocity are used to calculate a deceleration. If a jerk limiting setpoint generator is selected MaxJerk from the axis parameters is used. If RampTime is not set to a value resonably higher than 0 fEmergencyRamp from the axis parameters is used.

The braking operation is performed by an MC_Stop_BkPlcMc block called internally. When the setpoint output is reaching 0 all controll outputs of the axis are bound to 0 an long as the Execute input is TRUE.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_GearIn_BkPlcMc

FUNCTION_BLOCK MC_GearIn_BkPlcMc (starting with V3.0)

This function block starts and monitors the coupling of two axes. To release the coupling use a MC_GearOut_BkPlcMc block.

VAR_INPUT
        Execute:                BOOL;
        RatioNumerator: INT;
        RatioDenominator:       INT;
        Acceleration:   LREAL;
        Deceleration:   LREAL;
        Jerk:           LREAL;
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        InGear:         BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Active:         BOOL;
END_VAR

VAR_INOUT
        Master:         Axis_Ref_BkPlcMc;
        Slave:          Axis_Ref_BkPlcMc;
END_VAR

Execute : The coupling is initiated by a rising edge at this input.

RatioNumerator, RatioDenominator: These parameters describe the coupling in the form of a gear box.

Acceleration : The required acceleration of the movement in the actual position units used by the axis per second squared.

Deceleration : The required deceleration of the movement in the actual position units used by the axis per second squared.

Jerk: The requested jerk level.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

InGear: Here the first succesful synchronisation of the axes is signaled. This signal will not change if the synchronicity is lost later.

CommandAborted : Abortion of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Active: Same as Busy.

Master, Slave: The addresses of variables of type Axis_Ref_BkPlcMc are to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • The possibility that RatioDenominator is set to 0 is checked next. In this case the block will react by asserting Error with ErrorID:=dwTcHydErrCdIllegalGearFactor.
  • By now the coupling cannot be activated if either master or slave is not in idle state. If this is not true the block responds with Error and ErrorID:=dwTcHydErrCdNotStartable.
  • If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If the movement algorithm is already indicating an error code, the block responds with Error and ErrorID:= the movement algorithm's error code.

The coupling is initiated if these checks can be carried out without problems. The axis is now in the McState_Synchronizedmotion state, and the block begins to monitor the coupling.

When the slave axis is reaching the requested velocity for the first time InGear is signaled. Because of the fact that the coupling can be activated only in idle state this will happen imediately. If the slave axis is not able to follow the master InGear will remain unchanged.

If the movement algorithm reports an error code while the coupling is being executed, the block responds with Error and ErrorID:=the movement algorithm's error code.

A falling edge at Execute clears all the pending output signals. If, while the coupling is still active, Execute is set to FALSE, execution of the coupling continues unaffected. The signals provided at the end of the movement (Error, ErrorID, CommandAborted, InGear) are made available for one cycle.

Note: At current Active is a copy of Busy.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_GearOut_BkPlcMc

FUNCTION_BLOCK MC_GearOut_BkPlcMc (starting with V3.0)

This function block releases the coupling of two axes that has been established by a MC_GearIn_BkPlcMc or MC_GearInPos_BkPlcMc block before.

VAR_INPUT
        Execute:                BOOL;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Slave:          Axis_Ref_BkPlcMc;
END_VAR

Execute : The coupling is released by a rising edge at this input.

Busy: A pending command is indicated here.

Done : Successful processing of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Slave: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If the axis is not in a coupled state the block is imediately reponding with Done and will not do any further checking or perform any activities.
  • If the current velocity of the axis is lower than the velocity specified by pStAxParams.fCreepSpeed the axis is imediately placed in McState_Standstill state and is braking from any remaining velocity. Done is signaled and there will be no further checking or other activities.

If these checks can be carried out without problems and Done is not allready signaled for one of the reasons discussed obove the coupling is converted into an endless move with the same velocity and direction, but independend from the masters activities. If this conversion is successfull Done is signaled, otherwise the block will respond with Error and ErrorID:=the movement algorithm's error code.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_Halt_BkPlcMc

FUNCTION_BLOCK MC_Halt_BkPlcMc (starting with V3.0)

This function block cancels an active motion operation and monitors the stopping operation of an axis.

Note: The stop operation initiated from this block can be overiden by other blocks. If the axis should be not allowed to start over during the stop operation a MC_Stop_BkPlcMc block has to be used.

VAR_INPUT
        Execute:                BOOL;
        Deceleration:   LREAL;  (starting with 3.0.5)
        Jerk:           LREAL;  (starting with 3.0.5)
        RampTime:               LREAL;  (starting with 3.0.5)
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Active:         BOOL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : A rising edge at this input ends a movement being carried out by the axis.

Deceleration: The requested deceleration.

Jerk: The requested jerk level.

RampTime: The requested ramp time.

Jerk: The requested jerk level.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

Done: Successful processing of the operation is indicated here.

CommandAborted:^This output signals that the operation has been interupted by another block.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Active: A pending command is indicated here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

This block behaves like the MC_Stop_BkPlcMc block except that its operation can be interupted by other blocks.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_Home_BkPlcMc

FUNCTION_BLOCK MC_Home_BkPlcMc (starting with V3.0)

This function block starts and monitors the reference travel of an axis.

VAR_INPUT
        Execute:                BOOL;
        Position:               LREAL;
        HomingMode:     MC_HomingMode_BkPlcMc;
        CalibrationCam: BOOL;
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute: The reference travel is initiated by a rising edge at this input.

Position: The reference position.

HomingMode: The methode to be used for referencing is specified here.

CalibrationCam: The referencing index (cam9 can be provided here.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

Done: Successful processing of the reference travel is indicated here.

CommandAborted: Abortion of the reference travel is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • A reference travel can only be started from a stationary condition without errors. If that is not the case, the block will react by asserting Error with ErrorID:=dwTcHydErrCdNotStartable or with the error code that is passed to it.
  • If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If one of the velocities stated in the axis parameters is too small (less than 1% of the reference velocity) the block responds with Error and ErrorID:=dwTcHydErrCdSetVelo.

The reference travel begins if these checks are carried out without problems. The precise process of the referencing operation is specified by HomingMode. If the movement algorithm reports an error code while the reference travel is being executed, the block responds with Error and ErrorID:=the movement algorithm's error code. If completion of the reference travel is prevented by the activity of another block, the block responds with CommandAborted. Successful completion of the reference travel is reported with Done.

A falling edge at Execute clears all the pending output signals. If, while the reference travel is still active, Execute is set to FALSE, execution of the reference travel that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, CommandAborted, Done) are made available for one cycle.

Note: fEnc_DefaultHomePosition in pStAxParams is provided for circumstances in which the application does not itself specify a reference position and a value saved with the machine data is to be loaded for use instead. If different values are required, depending on the situation, use should be made of fCustomerData[] in pStAxParams.

MC_DefaultHomingMode_BkPlcMc

The referencing methode is not specified by the application but by Axis_Ref_BkPlcMc.stAxParams.nEnc_HomingType. The following rules are applied here:

nEnc_HomingType | MC_HomingMode_BkPlcMc
iTcMc_HomingOnBlock | MC_Block_BkPlcMc
iTcMc_HomingOnIndex | MC_AbsSwitch_BkPlcMc
iTcMc_HomingOnSync | MC_RefPulse_BkPlcMc
iTcMc_HomingOnExec | MC_Direct_BkPlcMc

MC_AbsSwitch_BkPlcMc

The axis is started according Axis_Ref_BkPlcMc.stAxParams.fEnc_RefIndexVelo and bEnc_RefIndexPositive. If CalibrationCam or the reference cam bit (Bit 5, dwTcHydDcDwRefIndex) in Axis_Ref_BkPlcMc.stAxRtData.nDeCtrlDWord become TRUE the axis stops. Now the axis is started according fEnc_RefSyncVelo and bEnc_RefSyncPositive. When the cam signal becomes FALSE the actual position of the axis is set to Position and is stopped.

MC_LimitSwitch_BkPlcMc

Not supported.

MC_RefPulse_BkPlcMc

The axis is started according Axis_Ref_BkPlcMc.stAxParams.fEnc_RefIndexVelo and bEnc_RefIndexPositive. If CalibrationCam or the reference cam bit (Bit 5, dwTcHydDcDwRefIndex) in Axis_Ref_BkPlcMc.stAxRtData.nDeCtrlDWord become TRUE the axis stops. Now the axis is started according fEnc_RefSyncVelo and bEnc_RefSyncPositive. The hardware latch of the I/O device is activated and the axis is traveling on until the latch becomes valid. After stopping the axis the actual position of the axis is set to a value that is calculated from Position and the distance that has been made good from the sync pulse of the encoder.

MC_Direct_BkPlcMc

The actual position of the axis is set to Position imediately.

MC_Absolute_BkPlcMc

Not supported.

MC_Block_BkPlcMc

The axis is started according Axis_Ref_BkPlcMc.stAxParams.fEnc_RefIndexVelo and bEnc_RefIndexPositive. If there hasn't been a progress of the actual position the block is regarded to be found. Now the actual position is set to Position.

MC_FlyingSwitch_BkPlcMc

Not supported.

MC_FlyingRefPulse_BkPlcMc

Not supported.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_ImediateStop_BkPlcMc

FUNCTION_BLOCK MC_ImediateStop_BkPlcMc (starting with V3.0.5)

This function block cancels an active motion operation of an axis.

VAR_INPUT
        Execute:                BOOL;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Active:         BOOL;
        CommandAborted: BOOL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : A rising edge at this input ends a movement being carried out by the axis.

Busy: A pending command is indicated here.

Done : Successful processing of the operation is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Active: A pending command is indicated here.

CommandAborted: The abortion of the command by another command is indicated here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • The stop can only be executed if the axis is actively carrying out a movement. If it is stationary, the block immediately asserts the Done signal.
  • If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If the axis is already in a state where it is controlled by a coupling to another axis or by a comparable mechanism, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.

The Stop operation begins if these checks can be carried out without problems. Therefore the output values of the axis are set to 0 without any ramp. All controll outputs of the axis are bound to 0 an long as the Execute input is TRUE.


TcPlcLibHydraulics: PLCopen Motion Control: Motion: MC_MoveAbsolute_BkPlcMc

FUNCTION_BLOCK MC_MoveAbsolute_BkPlcMc (starting with V3.0)

This function block starts and monitors the movement of an axis.

VAR_INPUT
        Execute:                BOOL;
        Position:               LREAL;
        Velocity:               LREAL;
        Acceleration:   LREAL;
        Deceleration:   LREAL;
        Direction:      MC_Direction_BkPlcMc:=MC_Shortest_Way_BkPlcMc;
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The movement is initiated by a rising edge at this input.

Position : The target of the movement in the actual position units appropriate to the axis.

Velocity : The required velocity of the movement in the actual position units used by the axis per second.

Acceleration : The required acceleration of the movement in the actual position units used by the axis per second squared.

Deceleration : The required deceleration of the movement in the actual position units used by the axis per second squared.

Jerk: reserved.

Direction: reserved. This input was added for compatibility reasons. It has to be left open or supplied the constant value MC_Shortest_Way_BkPlcMc.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

Done : Successful processing of the movement is indicated here.

CommandAborted : Abortion of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • The possibility that Position is located behind an active software limit switch is checked next. In this case the block will react by asserting Error with ErrorID:=dwTcHydErrCdSoftEnd.
  • Depending on the movement algorithm specified in Axis.pStAxParams^.nProfile the axis may either only be able to begin the movement initiated here when stationary, or may be able to begin from another movement that has not yet been completed. If it is unable at the present time to accept this new order, the block responds with Error and ErrorID:=dwTcHydErrCdNotStartable.
  • If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If Velocity is too small (less than 1% of the reference velocity) the block reacts with Error and ErrorID:=dwTcHydErrCdSetVelo.
  • If Acceleration is too small (the Velocity cannot be reached within 100 seconds) the block reacts with Error and ErrorID:=dwTcHydErrCdAcc.
  • If Deceleration is too small (the Velocity cannot be reached within 100 seconds) the block reacts with Error and ErrorID:=dwTcHydErrCdDec.
  • If the movement algorithm is already indicating an error code, the block responds with Error and ErrorID:= the movement algorithm's error code.

The movement begins if these checks can be carried out without problems. This is done by limiting the parameters Position, Velocity, Acceleration and Deceleration to the maximum permissible values and passing them to the movement algorithm. The axis is now in the McState_DiscreteMotion state, and the block begins to monitor the movement.

If the movement algorithm reports an error code while the movement is being executed, the block responds with Error and ErrorID:=the movement algorithm's error code. If completion of the movement is prevented by the activity of another block, the block responds with CommandAborted. If the movement algorithm achieves the target conditions for the axis, the block reacts with Done.

A falling edge at Execute clears all the pending output signals. If, while the movement is still active, Execute is set to FALSE, execution of the movement that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, CommandAborted, Done) are made available for one cycle.

Hint: The monitoring of the movement may be aborted by calling a block of type MC_AxUtiCancelMonitoring_BkPlcMc. This will cause the block to signal CommandAborted. A subsequent call with Execute=FALSE will place the block in its idle state..


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_MoveJoySticked_BkPlcMc

FUNCTION_BLOCK MC_MoveJoySticked_BkPlcMc (starting with V3.0)

This function block starts and monitors the movement of an axis.

Note: This function is supported only for axes that are controlled by blocks of type MC_AxRuntimeCtrlBased_BkPlcMc or MC_AxRunTimeTimeRamp_BkPlcMc. The selection of these blocks is done by placing the appropriate constant from E_TcMcProfileType in nProfileType in ST_TcHydAxParam.

VAR_INPUT
        Execute:                BOOL;
        JoyStick:               LREAL;
        Acceleration:   LREAL;
        Deceleration:   LREAL;
        Jerk:           LREAL;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:Axis_Ref_BkPlcMc;
END_VAR

Execute: The movement is initiated by a rising edge at this input.

JoyStick: A controling speed override value from the input device. The value has to be normalised to the range on ±1.

Acceleration : The required acceleration of the movement in the actual position units used by the axis per second squared.

Deceleration : The required deceleration of the movement in the actual position units used by the axis per second squared.

Jerk: reserved.

Busy: A pending command is indicated here.

CommandAborted : Abortion of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If the movement algorithm is already indicating an error code, the block responds with Error and ErrorID:= the movement algorithm's error code.
  • Depending on the movement algorithm specified in Axis.pStAxParams^.nProfile the axis may be unable to support the requested function. In this case the block responds with Error and ErrorID:=dwTcHydErrCdNotCompatible.

If these checks can be carried out without problems the movement algorithm is switched into iTcHydStateExtGenerated state and the axis is placed in McState_Synchronizedmotion. Now the function block is controlling the speed of the axis according to JoyStick und ST_TcHydAxParam.fRefVelo. Any change of velocity is done acording to ST_TcHydAxParam.fMaxAcc. If the axis is approaching an active software limit the speed is limited in a way that keeps the axis from exceeding the limit.

On a falling edge at Execute the movement algorithms state is changed to iTcHydStateTcDecP or iTcHydStateTcDecM and the axis is placed in McState_Standstill state. If the axis is moving the movement will be canceled according to ST_TcHydAxParam.fStopRamp. Then the axis state is changed to iTcHydStateIdle.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_MoveRelative_BkPlcMc

FUNCTION_BLOCK MC_MoveRelative_BkPlcMc (starting with V3.0)

This function block starts and monitors the movement of an axis.

VAR_INPUT
        Execute:                BOOL;
        Distance:               LREAL;
        Velocity:               LREAL;
        Acceleration:   LREAL;
        Deceleration:   LREAL;
        Jerk:           LREAL;
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        InVelocity:     BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute: The movement is initiated by a rising edge at this input.

Distance: The distance to the target of the movement in the actual position units appropriate to the axis.

Velocity: The required velocity of the movement in the actual value position used by the axis per second.

Acceleration: The required acceleration of the movement in the actual position units used by the axis per second squared.

Deceleration: The required deceleration of the movement in the actual position units used by the axis per second squared.

Jerk: reserved.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

Done : Successful processing of the movement is indicated here.

CommandAborted: Abortion of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • The possibility that moving through Distance will lead to a conflict with an active software limit switch is checked next. In this case the block will react by asserting Error with ErrorID:=dwTcHydErrCdSoftEnd.
  • Depending on the movement algorithm specified in Axis.pStAxParams^.nProfile the axis may either only be able to begin the movement initiated here when stationary, or may be able to begin from another movement that has not yet been completed. If it is unable at the present time to accept this new order, the block responds with Error and ErrorID:=dwTcHydErrCdNotStartable.
  • If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If Velocity is too small (less than 1% of the reference velocity) the block reacts with Error and ErrorID:=dwTcHydErrCdSetVelo.
  • If Acceleration is too small (the Velocity cannot be reached within 100 seconds) the block reacts with Error and ErrorID:=dwTcHydErrCdAcc.
  • If Deceleration is too small (the Velocity cannot be reached within 100 seconds) the block reacts with Error and ErrorID:=dwTcHydErrCdDec.
  • If the movement algorithm is already indicating an error code, the block responds with Error and ErrorID:= the movement algorithm's error code.

The movement begins if these checks can be carried out without problems. This is done by limiting the parameters Distance, Velocity, Acceleration and Deceleration to the maximum permissible values and passing them to the movement algorithm. The axis is now in the McState_DiscreteMotion state, and the block begins to monitor the movement.

If the movement algorithm reports an error code while the movement is being executed, the block responds with Error and ErrorID:=the movement algorithm's error code. If completion of the movement is prevented by the activity of another block, the block responds with CommandAborted. If the movement algorithm achieves the target conditions for the axis, the block reacts with Done.

A falling edge at Execute clears all the pending output signals. If, while the movement is still active, Execute is set to FALSE, execution of the movement that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, CommandAborted, Done) are made available for one cycle.

Note: Internaly the block is using a target position that is far from the starting point or (if enabled) the software end of travel according to the requested direction.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_MoveVelocity_BkPlcMc

FUNCTION_BLOCK MC_MoveVelocity_BkPlcMc (starting with V3.0)

This function block starts and monitors the movement of an axis.

VAR_INPUT
        Execute:                BOOL;
        Velocity:               LREAL;
        Acceleration:   LREAL;
        Deceleration:   LREAL;
        Direction:      MC_Direction_BkPlcMc;
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        InVelocity:     BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The movement is initiated by a rising edge at this input.

Velocity : The required velocity of the movement in the actual position units used by the axis per second.

Acceleration : The required acceleration of the movement in the actual position units used by the axis per second squared.

Deceleration : The required deceleration of the movement in the actual position units used by the axis per second squared.

Direction : A specification of direction encoded in accordance with MC_Direction_BkPlcMc.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

InVelocity: This output will become TRUE when the axis reaches the requested velocity for the first time.

CommandAborted : Abortion of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • Depending on the movement algorithm specified in Axis.pStAxParams^.nProfile the axis may either only be able to begin the movement initiated here when stationary, or may be able to begin from another movement that has not yet been completed. If it is unable at the present time to accept this new order, the block responds with Error and ErrorID:=dwTcHydErrCdNotStartable.
  • If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If Velocity is too small (less than 1% of the reference velocity) the block reacts with Error and ErrorID:=dwTcHydErrCdSetVelo.
  • If the movement algorithm is already indicating an error code, the block responds with Error and ErrorID:= the movement algorithm's error code.

The movement begins if these checks can be carried out without problems. This is done by selecting a value for the target position depending on Direction and the parameters for the software limit switches. The parameters Velocity, Acceleration and Deceleration are then limited to the maximum permissible values and are passed to the movement algorithm. The axis is now in the McState_Continuousmotion state, and the block begins to monitor the movement.

If the movement algorithm reports an error code while the movement is being executed, the block responds with Error and ErrorID:=the movement algorithm's error code. If completion of the movement is prevented by the activity of another block, the block responds with CommandAborted. If the movement algorithm achieves the requested velocity, the block reacts by setting InVelocity.

A falling edge at Execute clears all the pending output signals. If, while the movement is still active, Execute is set to FALSE, execution of the movement that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, CommandAborted, InVelocity) are made available for one cycle.

Hint: The monitoring of the movement may be aborted by calling a block of type MC_AxUtiCancelMonitoring_BkPlcMc. This will cause the block to signal CommandAborted. A subsequent call with Execute=FALSE will place the block in its idle state..


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_Stop_BkPlcMc

FUNCTION_BLOCK MC_Stop_BkPlcMc (starting with V3.0)

This function block cancels an active motion operation and monitors the stopping operation of an axis.

Note: The stop operation initiated from this block cannot be overiden by other blocks. If the axis should be allowed to start over during the stop operation a MC_Halt_BkPlcMc block has to be used.

VAR_INPUT
        Execute:                BOOL;
        Deceleration:   LREAL;  (starting with 3.0.5)
        Jerk:           LREAL;  (starting with 3.0.5)
        RampTime:               LREAL;  (starting with 3.0.5)
        BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;        (starting with 3.0.8)
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        Active:         BOOL;
        CommandAborted: BOOL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : A rising edge at this input ends a movement being carried out by the axis.

Deceleration: The requested deceleration.

Jerk: The requested jerk level.

RampTime: The requested ramp time.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

Busy: A pending command is indicated here.

Done : Successful processing of the operation is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Active: A pending command is indicated here.

CommandAborted: The abortion of the command by another command is indicated here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • The stop can only be executed if the axis is actively carrying out a movement. If it is stationary, the block immediately asserts the Done signal.
  • If the axis is already in a fault state, or if it is in the process of carrying out a stop operation, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If the axis is already in a state where it is controlled by a coupling to another axis or by a comparable mechanism, it responds with Error and ErrorID:=dwTcHydErrCdNotReady.

The Stop operation begins if these checks can be carried out without problems. The Deceleration is used if it is set to a value that is resonably higher then 0. Otherwise RampTime and the reference velocity are used to calculate a deceleration. If a jerk limiting setpoint generator is selected Jerk is used if this value is resonably higher than 0. If none of the parameters is usable MaxDec and MaxJerk from the axis parameters are used.

In consideration of the current velocity setpoint and the choosen parameters a minimum distance is calculated and a new target position is activated. When the axis is reaching this position it is placed into the idle state in a regular way.

Note: RampTime is defining the time for braking from reference velocity to standstill. In case of a lower velocity the braking time will be adapted. For setpoint generators using a creep mechanism when targeting the creepinf time will add.

If the movement algorithm reports an error code while the movement is being executed, the block responds with Error and ErrorID:=the movement algorithm's error code. If completion of the movement is prevented by the activity of another block, the block responds with CommandAborted. Successful completion of the operation is reported with Done.

A falling edge at Execute clears all the pending output signals. If, while the stop operation is still active, Execute is set to FALSE, execution of the operation that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, Done) are made available for one cycle.

Note: At current Active is a copy of Busy.


TcPlcLibHydraulics: PLCopen Motion Control: Data types: Axis_Ref_BkPlcMc

TYPE Axis_Ref_BkPlcMc (starting with V3.0)

The variables in this structure are integrating all subcomponents of the axis. A variable of this typ is supplied to most of the function blocks of the library. So this type is comparable to the AXIS_REF data typ of the PlcOpen.

TYPE Axis_Ref_BkPlcMc:
STRUCT
        sAxisName:      STRING(83) := 'NoName';
        pStAxLogBuffer: POINTER TO ST_TcMcLogBuffer:=0;
        pStDeviceInput: POINTER TO ST_TcPlcDeviceInput:=0;
        pStDeviceOutput:        POINTER TO ST_TcPlcDeviceOutput:=0;
        pStAxAuxLabels: POINTER TO ST_TcMcAuxDataLabels:=0;
        pStAxAutoParams:        POINTER TO ST_TcMcAutoIdent:=0;
        pStAxCommandBuf:        POINTER TO ST_TcPlcCmdBuffer_BkPlcMc:=0;        (* starting with V3.0.8 *)
        nActiveRequest: UDINT:=0;
        nNextRequest:   UDINT := 1;     (* starting with V3.0.8 *)
        bParamsEnable:  BOOL:=FALSE;
        bAlign_1:       ARRAY [1..3] OF BYTE; (* neu, wegen CX9000 *)
        nState:         E_TcMCFbState:=McState_Standstill;
        nInitState:     INT:=0;
        nInitError:     DINT:=0;
        nInterfaceType: UINT := 16#FFFF;
        nDeviceInType:  UINT := 16#FFFF;
        nDeviceOutType: UINT := 16#FFFF;
        nRtDataType:    UINT := 16#FFFF;
        nParamType:     UINT := 16#FFFF;
        nLogBufferType: UINT := 16#FFFF;
        nAxAutoIdentType: UINT := 16#FFFF;
        nCmdBufferType: UINT := 16#FFFF;        (* starting with V3.0.8 *)
        nLogLevel:      DINT := 0;
        nDebugTag:      UDINT := 16#00000000;
        stAxParams:     ST_TcHydAxParam;
        stAxRtData:     ST_TcHydAxRtData;
END_STRUCT
END_TYPE

sAxisName: The text name of the axes.

pStAxLogBuffer: The address of a variable of type ST_TcMcLogBuffer. This variable contains the LogBuffer of the library.

pStDeviceInput: The address of a variable of type ST_TcPlcDeviceInput. This variable contains the input interface of the axis.

pStDeviceOutput: In the address of a variable of type ST_TcPlcDeviceOutput. This variable contains the output interface of the axis.

pStAxAuxLabels: The address of a variable of type ST_TcMcAuxDataLabels. This variable contains the text labels for the applacation parameters in ST_TcHydAxParam:fCustomerData[..].

pStAxAutoParams: The address of a variable of type ST_TcMcAutoIdent. This variable contains the parameters for a MC_AxUtiAutoIdent block.

pStAxCommandBuf: Starting with V3.0.8 a range of blocks support an input BufferMode that was added to the definitions of PLCopen. The functionality controlled by this signal is currently under construction. Part of this development is the implementation of this command buffer.

nActiveRequest: Every block sets a code here that starts a function on this axis. After this, the block monitors this variable to see if it is changed by another block that is taking over control through another function. In this way any block can tell whether a function that it has started has been interrupted by another block, and can generate appropriate signals.

nNextRequest: Used for generating nActiveRequest values.

bParamsEnable: This variable is only TRUE if the parameters have been placed into a valid state by being loaded from the file. Saving the parameters will also assert this signal, because this also ensures consistency between the data in the parameter structure and in the file. The axis is not ready to operate while this variable is not TRUE. Note: At run-time, write accesses to the parameter structure temporarily set this variable to FALSE, after which it is returned to its previous state.

nState: The current state of the axis is stored here, encoded in accordance with E_TcMCFbState.

nInitState: The current state of the initialising process.

nInitError: An encoded error message from the initialising process is provided here.

nInterfaceType: The type code of the Axis_Ref_BkPlcMc structure type in use.

nDeviceInType: The type code of the ST_TcPlcDeviceInput structure type in use.

nDeviceOutType: The type code of the ST_TcPlcDeviceOutput structure type in use.

nRtDataType: The type code of the ST_TcHydAxRtData structure type in use.

nParamType: The type code of the ST_TcHydAxParam structure type in use.

nLogBufferType: The type code of the ST_TcMcLogBuffer structure type in use.

nAxAutoIdentType: The type code of the ST_TcMcAutoIdent structure type in use.

nCmdBufferType: The type code of the ST_TcPlcCmdBuffer_BkPlcMc structure type in use.

nLogLevel: The treshold level for adding messages to the ST_TcMcLogBuffer structure.

nDebugTag: Each FB will save this value on entry and replace it by its own individual tag code. On exit the FB will restore the old value.

stAxParams: This variable of type ST_TcHydAxParam contains the parameters of the axis.

stAxRtData: This variable of type ST_TcHydAxRtData contains the runtime data of the axis.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: CAMSWITCH_REF_BkPlcMc

TYPE CAMSWITCH_REF_BkPlcMc (starting with V3.0)

TYPE CAMSWITCH_REF_BkPlcMc :
STRUCT
        Switch:         ARRAY [ciBkPlcMc_CamSwitchRef_MinIdx..ciBkPlcMc_CamSwitchRef_MaxIdx] OF CAMSWITCH_REFTYPE_BkPlcMc;
END_STRUCT
END_TYPE

TYPE CAMSWITCH_REFTYPE_BkPlcMc:
STRUCT
        TrackNumber:    INT;
        FirstOnPosition:        LREAL;
        LastOnPosition: LREAL;
        AxisDirection:  INT;
        CamSwitchMode:  INT;
        Duration:       LREAL;
        (* private members, do not touch *)
        nCurrentState:  SINT:=0;
        bTriggered:     BOOL:=FALSE;
        fTimer:         LREAL;
        (**)
END_STRUCT
END_TYPE

TrackNumber: This is an index into an ARRAY [ciBkPlcMc_TrackRef_MinIdx..ciBkPlcMc_TrackRef_MaxIdx] OF TRACK_REF_BkPlcMc, passed to a block of type MC_DigitalCamSwitch_BkPlcMc.

FirstOnPosition: The starting position of the cam. For time controlled cams this is the trigger position.

LastOnPosition: The end position of the cam. Not effective for time controlled cams.

AxisDirection: This value controles the direction, that is activating the cam: 0 = both directions, 1 = positive direction, 2 = negative direction.

CamSwitchMode: The working mode of the cam: set to 0 for position controlled cams and to 1 for time controlled cams.

Duration: For time controlled cams the signalling duration has to be placed hier.

nCurrentState, bTriggered, fTimer: These elements are runtime variables and must not be changed or used by the application.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: E_TcMcCurrentStep

TYPE E_TcMcCurrentStep (starting with V3.0)

The constants listed here are used to identify the internal states of the setpoint generators.

Hinweis: Not all states are used and supported by all setpoint generators.

TYPE E_TcMcCurrentStep :(
iTcHydStateIdle,
iTcHydStateTcAccP,
iTcHydStateTcAccM,
iTcHydStatePcAccP,
iTcHydStatePcAccM,
iTcHydStateConstVeloP,
iTcHydStateConstVeloM,
iTcHydStatePcDecP,
iTcHydStatePcDecM,
iTcHydStateCreepVeloP,
iTcHydStateCreepVeloM,
iTcHydStateTcDecP,
iTcHydStateTcDecM,
iTcHydStateFeedStopPos,
iTcHydStateFeedStopNeg,
iTcHydStateDoBrake,
iTcHydStateCoupling := 1000,
iTcHydStateCoupled,
iTcHydStateExtCoupled,
iTcHydStateExtGenerated := 2000,
iTcHydStateEmergencyBreak := 9000,
iTcHydStateFault := 9999
);
END_TYPE

iTcHydStateIdle: The axis is not performing an active move operation. Its behaviour is determined by ST_TcHydAxParam.fLagAmp, ST_TcHydAxParam.fTargetClamping and ST_TcHydAxParam.fReposDistance.

iTcHydStateTcAccP: The axis is raising a positive setpoint according to ST_TcHydAxRtData.fDestAcc. This internal parameter is set to the parameters of a motion command by a starting function block. If the setpoint is coming up to the requested value the state is changed to iTcHydStateConstVeloP. If the braking operation is to be started before coming up to the requested value the state is changed to iTcHydStatePcDecP. If the feed enable is dropped the state is changed to iTcHydStateFeedStopPos.

iTcHydStateTcAccM: The axis is raising a negative setpoint according to ST_TcHydAxRtData.fDestAcc. This internal parameter is set to the parameters of a motion command by a starting function block. If the setpoint is coming up to the requested value the state is changed to iTcHydStateConstVeloM. If the braking operation is to be started before coming up to the requested value the state is changed to iTcHydStatePcDecM. If the feed enable is dropped the state is changed to iTcHydStateFeedStopNeg.

iTcHydStatePcAccP: The axis is in a position controlled acceleration state of a move in positive direction. The setpoint is raised according to ST_TcHydAxRtData.fDestAcc. When the setpoint has been coming up to the requested value from the motion command the state is changed to iTcHydStateConstVeloP.

iTcHydStatePcAccM: The axis is in a position controlled acceleration state of a move in negative direction. The setpoint is raised according to ST_TcHydAxRtData.fDestAcc. When the setpoint has been coming up to the requested value from the motion command the state is changed to iTcHydStateConstVeloM.

iTcHydStateConstVeloP: The axis is moving in positive direction. The constant setpoint is defined by the values of the motion command.

iTcHydStateConstVeloM: The axis is moving in negative direction. The constant setpoint is defined by the values of the motion command.

iTcHydStatePcDecP: The axis is in a position controlled deceleration state of a move in positive direction. The setpoint is decreased according to ST_TcHydAxRtData.fDestDec. When the setpoint has been reaching ST_TcHydAxParam.fCreepSpeed the state is changed to iTcHydStateCreepVeloP.

iTcHydStatePcDecM: The axis is in a position controlled deceleration state of a move in negative direction. The setpoint is decreased according to ST_TcHydAxRtData.fDestDec. When the setpoint has been reaching ST_TcHydAxParam.fCreepSpeed the state is changed to iTcHydStateCreepVeloM.

iTcHydStateCreepVeloP: The axis is moving in positive direction. The constant setpoint is defined by ST_TcHydAxParam.fCreepSpeed.

iTcHydStateCreepVeloM: The axis is moving in negative direction. The constant setpoint is defined by ST_TcHydAxParam.fCreepSpeed.

iTcHydStateTcDecP: The axis is running a regular stop operation from a move in positive direction. The setpoint is decreased according to ST_TcHydAxParam.fStopRamp. When the setpoint is reaching zero the state is changed to iTcHydStateIdle.

iTcHydStateTcDecM: The axis is running a regular stop operation from a move in negative direction. The setpoint is decreased according to ST_TcHydAxParam.fStopRamp. When the setpoint is reaching zero the state is changed to iTcHydStateIdle.

iTcHydStateFeedStopPos: The axis is running an intermediate stop operation from a move in positive direction because in ST_TcHydAxRtData.nDeCtrlDWord the feed enable dwTcHydDcDwFdPosEna is dropped to FALSE. The setpoint is decreased according to ST_TcHydAxParam.fStopRamp. When the setpoint is reaching zero the axis is waiting for the feed enable changing to TRUE.

iTcHydStateFeedStopNeg: The axis is running an intermediate stop operation from a move in negative direction because in ST_TcHydAxRtData.nDeCtrlDWord the feed enable dwTcHydDcDwFdNegEna is dropped to FALSE. The setpoint is decreased according to ST_TcHydAxParam.fStopRamp. When the setpoint is reaching zero the axis is waiting for the feed enable changing to TRUE.

iTcHydStateDoBrake: The axis is executing a delay time. This has to be done because of the timing of a activated or deactivated brake or switching valve.

iTcHydStateCoupling: The axis is in an internediate state and will change state to iTcHydStateCoupled.

iTcHydStateCoupled: The setpoint of the axis is calculated from the setpoint of another axis according the rules of a gear box functionality.

iTcHydStateExtCoupled: The setpoint is calculated by a variable gear mechanism like MC_GearInPos_BkPlcMc.

iTcHydStateExtGenerated: The setpoint of the axis is generated by some other function block. This can be a function block from the library or from the application.

iTcHydStateEmergencyBreak: The axis is running an emergency stop operation from a move in any direction. The setpoint is decreased according to ST_TcHydAxParam.fEmergencyRamp. When the setpoint is reaching zero the presence of a fault state (ST_TcHydAxRtData.nErrorCode unequal to 0) is checked. In this case the state is changed to iTcHydStateFault, otherwise the new state is iTcHydStateIdle.

iTcHydStateFault: The axis is in a fault state. It is not performing any kind of controlled movement and will not accept motion commands. Use a MC_Reset_BkPlcMc or MC_ResetAndStop_BkPlcMc function block to put the axis into a functional state.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: E_TcMcDriveType

TYPE E_TcMcDriveType (starting with V3.0)

The constants listed here are used to identify the hardware used to output the control values for an axis.

TYPE E_TcMcDriveType :(
(*
The existing sequence may not be changed.
New types must be added at the end.
If a type is to be omitted, it must be replaced by a dummy,
so that the numerical assignments are still guaranteed.
*)
(* last modification: 10.12.2009 *)
iTcMc_Drive_Customized,
iTcMc_DriveLowCostStepper,
iTcMc_DriveKL2521,
iTcMc_DriveKL4032,
iTcMc_DriveAx2000_B900R,
iTcMc_DriveM2400_D1,
iTcMc_DriveM2400_D2,
iTcMc_DriveM2400_D3,
iTcMc_DriveM2400_D4,
iTcMc_DriveLowCostStepperHS,
iTcMc_DriveLowCostStepperFS,
iTcMc_DriveIx2512_1Coil,
iTcMc_DriveIx2512_2Coil,
iTcMc_DriveKL2531,
iTcMc_DriveKL2541,
iTcMc_DriveEL4132,
iTcMc_DriveAx2000_B200R,
iTcMc_DriveAx2000_B110R,
iTcMc_DriveKL2532,
iTcMc_DriveKL2542,
iTcMc_DriveKL2535_1Coil,
iTcMc_DriveKL2535_2Coil,
iTcMc_DriveKL2545_1Coil,
iTcMc_DriveKL2545_2Coil,
iTcMc_DriveLowCostInverter,
iTcMc_Drive_CoE_DS408,
iTcMc_DriveAx2000_B110A,
iTcMc_DriveAx5000_B110A,
iTcMc_DriveAx2000_B750A,
iTcMc_Drive_CoE_DS402,
iTcMc_DriveAx5000_B110SR,
iTcMc_DriveEL4x22,
iTcMc_DriveEL2521
);
END_TYPE

iTcMc_Drive_Customized: The control value for the drive has not been prepared for output on any particular hardware. This process must be carried out by the PLC application itself.

iTcMc_DriveAx2000_B110A: The set value for the drive has been appropriately processed for output via the EtherCAT fieldbus to an AX2000 device running an absolute multiturn encoder motor.

iTcMc_DriveAx2000_B110R: The set value for the drive has been appropriately processed for output via the EtherCAT fieldbus to an AX2000 device running a resolver motor.

iTcMc_DriveAx2000_B200R: The set value for the drive has been appropriately processed for output via the Beckhoff II/O fieldbus to an AX2000 device running a resolver motor.

iTcMc_DriveAx2000_B750A: The set value for the drive has been appropriately processed for output via the Sercos fieldbus to an AX2000 device running an absolute multiturn encoder motor.

iTcMc_DriveAx2000_B900R: The set value for the drive has been appropriately processed for output via the Beckhoff RealTime Ethernet to an AX2000 device running a resolver motor.

iTcMc_DriveAx5000_B110A: The set value for the drive has been appropriately processed for output via the EtherCAT fieldbus to an AX5000 device running an absolute multiturn encoder motor.

iTcMc_DriveAx5000_B110SR: The set value for the drive has been appropriately processed for output via the EtherCAT fieldbus to an AX5000 device running an absolute singleturn encoder or resolver motor.

iTcMc_DriveEL4132: The set value for the drive has been appropriately processed for output on a ±10 V EL4132 analog output terminal.

iTcMc_DriveEL4x22: under construction.

iTcMc_DriveEL2521: under construction.

iTcMc_DriveIx2512_1Coil: The set value for the drive has been appropriately processed for output on a fieldbus box IP/IE2512. The rules for one coil valves are applied.

iTcMc_DriveIx2512_2Coil: The set value for the drive has been appropriately processed for output on a fieldbus box IP/IE2512. The rules for two coil valves are applied.

iTcMc_DriveKL2521: The set value for the drive has been appropriately processed for output on a KL2521 Pulse Train terminal.

iTcMc_DriveKL2531: The set value for the drive has been appropriately processed for output on a KL2531 direct stepper terminal.

iTcMc_DriveKL2532: The set value for the drive has been appropriately processed for output on a KL2532 DC motor terminal.

iTcMc_DriveKL2535_1Coil: The set value for the drive has been appropriately processed for output on a KL2535 PWM current output terminal.

iTcMc_DriveKL2535_2Coil: The set value for the drive has been appropriately processed for output on a KL2535 PWM current output terminal.

iTcMc_DriveKL2541: The set value for the drive has been appropriately processed for output on a KL2541 direct stepper terminal.

iTcMc_DriveKL2542: The set value for the drive has been appropriately processed for output on a KL2542 DC motor terminal.

iTcMc_DriveKL2545_1Coil: The set value for the drive has been appropriately processed for output on a KL2545 PWM current output terminal.

iTcMc_DriveKL2545_2Coil: The set value for the drive has been appropriately processed for output on a KL2545 PWM current output terminal.

iTcMc_DriveKL4032: The set value for the drive has been appropriately processed for output on a ±10 V KL4032 analog output terminal.

iTcMc_DriveLowCostInverter: The set value for the drive has been appropriately processed for output digital output terminals that are connected to a frequency inverter running on programmed working frequencies.

iTcMc_DriveLowCostStepper: Incremental changes to the set position are generated as the digital output signals for a directly driven stepper motor. This code continues to be supported for reasons of compatibility, and has the same meaning as iTcMc_DriveLowCostStepperHS.

iTcMc_DriveLowCostStepperHS: Incremental changes to the set position are generated as the digital output signals for a directly driven stepper motor. Half-stepping is being used.

iTcMc_DriveLowCostStepperFS: Incremental changes to the set position are generated as the digital output signals for a directly driven stepper motor. Full-stepping is being used.

iTcMc_DriveM2400_D1: The set value for the drive has been appropriately processed for output on the first channel of an M2400 Box on the Beckhoff II/O.

iTcMc_DriveM2400_D2: The set value for the drive has been appropriately processed for output on the second channel of an M2400 Box on the Beckhoff II/O.

iTcMc_DriveM2400_D3: The set value for the drive has been appropriately processed for output on the third channel of an M2400 Box on the Beckhoff II/O.

iTcMc_DriveM2400_D4: The set value for the drive has been appropriately processed for output on the fourth channel of an M2400 Box on the Beckhoff II/O.

iTcMc_Drive_CoE_DS402: under construction.

iTcMc_Drive_CoE_DS408: The set value for the drive has been appropriately processed for output via the EtherCAT fieldbus to a proportional valve.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: E_TcMcEncoderType

TYPE E_TcMcEncoderType (starting with V3.0)

The constants listed here are used to identify the hardware used to acquire the actual values for an axis.

TYPE E_TcMcEncoderType :(
(*
The existing sequence may not be changed.
New types must be added at the end.
If a type is to be omitted, it must be replaced by a dummy,
so that the numerical assignments are still guaranteed.
*)
(* last modification: 10.12.2009 *)
iTcMc_EncoderSim,
iTcMc_EncoderDigIncrement,
iTcMc_EncoderLowCostStepper,
iTcMc_EncoderKL2521,
iTcMc_EncoderKL3042,
iTcMc_EncoderKL5001,
iTcMc_EncoderKL5101,
iTcMc_EncoderAx2000_B900R,
iTcMc_EncoderDigCam,
iTcMc_EncoderIx5009,
iTcMc_EncoderM2510,
iTcMc_EncoderKL3002,
iTcMc_EncoderKL2531,
iTcMc_EncoderKL5111,
iTcMc_EncoderAbs32,
iTcMc_EncoderM3120,
iTcMc_EncoderKL2541,
iTcMc_EncoderEL3102,
iTcMc_EncoderEL3142,
iTcMc_EncoderEL5001,
iTcMc_EncoderEL5101,
iTcMc_EncoderEL5111,
iTcMc_EncoderKL3062,
iTcMc_EncoderKL3162,
iTcMc_EncoderAx2000_B200R,
iTcMc_EncoderAx2000_B110R,
iTcMc_EncoderEL3162,
iTcMc_EncoderKL2542,
iTcMc_EncoderKL2545,
iTcMc_EncoderAx2000_B110A,
iTcMc_EncoderAx5000_B110A,
iTcMc_EncoderAx2000_B750A,
iTcMc_EncoderCoE_DS406,
iTcMc_EncoderCoE_DS402SR,
iTcMc_EncoderAx5000_B110SR,
iTcMc_EncoderCoE_DS402A,
iTcMc_EncoderEL2521
);
END_TYPE

iTcMc_EncoderAbs32: The absolute actual position is formed from the 32 bit value from a nonspecialised input device.

iTcMc_EncoderAx2000_B110A: The absolute actual position is determined via EtherCAT fieldbus from an AX2000 device running an absolute multiturn encoder motor.

iTcMc_EncoderAx2000_B110R: The incremental actual position is determined via EtherCAT fieldbus from an AX2000 device running a resolver motor.

iTcMc_EncoderAx2000_B200R: The incremental actual position is determined via Beckhoff II/O fieldbus from an AX2000 device running a resolver motor.

iTcMc_EncoderAx2000_B750A: The absolute actual position is determined via Sercos fieldbus from an AX2000 device running an absolute multiturn encoder motor.

iTcMc_EncoderAx2000_B900R: The incremental actual position is determined via Beckhoff RealTime Ethernet fieldbus from an AX2000 device running a resolver motor.

iTcMc_EncoderAx5000_B110A: The absolute actual position is determined via EtherCAT fieldbus from an AX5000 device running an absolute multiturn encoder motor.

iTcMc_EncoderAx5000_B110SR: under construction.

iTcMc_EncoderDigCam: The position cams byte is formed from four digital input signals.

iTcMc_EncoderDigIncrement: The incremental actual value of the axis is formed by evaluating two digital input bits. These represent the A and B tracks of an incremental encoder, and are evaluated, in accordance with the principle of a quadrature decoder, using quadruple evaluation. Warning: Only one of the input bits may change its state in each PLC cycle. This means that the maximum velocity is one increment per TCycle.

iTcMc_EncoderEL2521: under construction.

iTcMc_EncoderEL3102: The absolute actual position is formed from the A/D converter value from an EL3102 ±10V analog input terminal.

iTcMc_EncoderEL3142: The absolute actual position is formed from the A/D converter value from an EL3142 0..20mA analog input terminal.

iTcMc_EncoderEL3162: The absolute actual position is formed from the A/D converter value from an EL3162 0..10V analog input terminal.

iTcMc_EncoderEL5001: The absolute actual position is formed from the counter value from an EL5001 SSI input terminal.

iTcMc_EncoderEL5101: The incremental actual position is formed from the counter value from an EL5101 input terminal.

iTcMc_EncoderEL5111: The incremental actual position is formed from the counter value from an EL5111 input terminal.

iTcMc_EncoderCoE_DS402A: under construction.

iTcMc_EncoderCoE_DS402SR: under construction.

iTcMc_EncoderCoE_DS406: An encoder connected via EtherCAT fieldbus.

iTcMc_EncoderIx5009: The absolute actual position is formed from the counter value from a IP/IE5009 SSI fieldbus box.

iTcMc_EncoderKL2521: The incremental actual position is generated from the pulse counter of a KL2521 Pulse Train terminal.

iTcMc_EncoderKL2531: The incremental actual position is generated from the pulse counter of a KL2531 stepper motor terminal.

iTcMc_EncoderKL2541: The incremental actual position is generated from the pulse counter (motor or encoder pulses) of a KL2541 stepper motor terminal.

iTcMc_EncoderKL3002: The absolute actual position is formed from the A/D converter value from a KL3002 ±10V analog input terminal.

iTcMc_EncoderKL3042: The absolute actual position is formed from the A/D converter value from a KL3042 0..20 mA analog input terminal.

iTcMc_EncoderKL3062: The absolute actual position is formed from the A/D converter value from a KL3062 0..10V analog input terminal.

iTcMc_EncoderKL3162: The absolute actual position is formed from the A/D converter value from a KL3162 0..10V analog input terminal.

iTcMc_EncoderKL5001: The absolute actual position is formed from the counter value from a KL5001 SSI input terminal.

iTcMc_EncoderKL5101: The incremental actual position is formed from the counter value from a KL5101 input terminal.

iTcMc_EncoderKL5111: The incremental actual position is formed from the counter value from a KL5111 input terminal.

iTcMc_EncoderLowCostStepper: Incremental changes to the actual position are generated from the output signals for a digitally operated stepper motor.

iTcMc_EncoderM2510: The absolute actual position is formed from the A/D converter value from a M2510 ±10V analog input box.

iTcMc_EncoderM3120: The incremental actual position is formed from the counter value from a M3120 Lightbus box.

iTcMc_EncoderSim: The virtual actual position of the axis is a copy of the set position. Warning: On a real machine this type must only be used for virtual axes. Otherwise the axis will carry out uncontrolled and unpredictable movements.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: E_TcMCFbState

TYPE E_TcMCFbState (starting with V3.0)

The constants listed here are used to identify the runtime states of the axes.

TYPE E_TcMCFbState :
(
McState_Standstill := 0,
McState_DiscreteMotion,
McState_Continousmotion,
McState_Synchronizedmotion,
McState_Stopping,
McState_Errorstop,
McState_Homing,
McState_Disabled
);
END_TYPE

McState_Standstill: The axis does not have a motion command. Active position control, automatic reposit monitoring, the output of a press control value or none of these will be carried out, depending on the parameterisation.

McState_DiscreteMotion: The axis executes a movement with a defined destination position and velocity.

McState_Continousmotion: The axis executes a movement without any defined destination position. Only the velocity is specified.

McState_Synchronizedmotion: The axis executes a movement that is defined in dependency of the movement of another axis.

McState_Stopping: The axis is carrying out a stop.

McState_Errorstop: The axis has been stopped because of a problem. It cannot at present be started, and requires a reset before it will be in a condition from which it can start.

McState_Homing: The axis executes a homing operation.

McState_Disabled: The controller enable of the axis has been set to FALSE.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: E_TcMcHomingType

TYPE E_TcMcHomingType (starting with V3.0)

The constants listed here are used to identify the referencing method of the axes.

TYPE E_TcMcHomingType :(
iTcMc_HomingOnBlock,
iTcMc_HomingOnIndex,
iTcMc_HomingOnSync,
iTcMc_HomingOnMultiSync,
iTcMc_HomingOnExec
);
END_TYPE

iTcMc_HomingOnBlock: The axis is moved in the direction specified by ST_TcHydAxParam.bEnc_RefIndexPositive with ST_TcHydAxParam.fEnc_RefIndexVelo. If no movement is detected over a period of 2 seconds, the fixed stop (block) is considered to have been reached. The actual value for the axis is set to the value of the reference position.

iTcMc_HomingOnIndex: The axis is moved in the direction specified by ST_TcHydAxParam.bEnc_RefIndexPositive with ST_TcHydAxParam.fEnc_RefIndexVelo. The axis is stopped if the reference cam (bit 5, dwTcHydDcDwRefIndex) is detected in ST_TcHydAxRtData.nDeCtrlDWord. It is then moved with ST_TcHydAxParam.fEnc_RefSyncVelo in the direction specified by ST_TcHydAxParam.bEnc_RefSyncPositive until the reference cam has again been left. The actual value for the axis is set to the value of the reference position.

iTcMc_HomingOnSync: The axis is moved in the direction specified by ST_TcHydAxParam.bEnc_RefIndexPositive with ST_TcHydAxParam.fEnc_RefIndexVelo. The axis is stopped if the reference cam (bit 5, dwTcHydDcDwRefIndex) is detected in ST_TcHydAxRtData.nDeCtrlDWord. It is then moved with ST_TcHydAxParam.fEnc_RefSyncVelo in the direction specified by ST_TcHydAxParam.bEnc_RefSyncPositive until the reference cam has again been left. The encoder's hardware latch is then activated, and the axis is moved on until the latch becomes valid. After the axis has stopped, the actual value for the axis is set to a value that is calculated from the reference position and from the distance covered since the encoder's sync pulse was detected.

iTcMc_HomingOnMultiSync: The encoder's hardware latch is activated. Now the axis is moved with ST_TcHydAxParam.fEnc_RefSyncVelo in the direction specified by ST_TcHydAxParam.bEnc_RefSyncPositive until the latch has become valid for two times. If the end of travel is detected bevor the latching is achieved the procedure is restarted in the oposite direction. If this is not successfull too the homing is aborted. Otherwise the actual position is calculated from the two latched values and fEnc_BaseDistance.

iTcMc_HomingOnExec: The actual value for the axis is set to the value of the reference position imediately.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: E_TcMCParameter

TYPE E_TcMCParameter (starting with V3.0)

The constants listed here are used for numbering parameters.

TYPE E_TcMCParameter :
(
(*
=================================================================
= W A R N I N G =
=================================================================
= These codes are also used to identify parameters =
= in the files. Changing the code would =
= make the files (not detectably) incompatible and could =
= lead to a system crash! =
=================================================================
= THE ONLY possibility therefore is to add new codes! =
=================================================================
= These codes are also used for ADS communication =
=================================================================
*)
McPara_CommandedPosition:=1,            (* Commanded target position / Zielposition des letzten Kommandos *)
McPara_SWLimitPos,                      (* Upper software endswitch / Oberer Software-Endschalter *)
McPara_SWLimitNeg,                      (* Lower software endswitch / Unterer Software-Endschalter *)
McPara_EnableLimitPos,                  (* Enable for upper software endswitch / Freigabe des oberern Software-Endschalters *)
McPara_EnableLimitNeg,                  (* Enable for lower software endswitch / Freigabe des unterern Software-Endschalters *)
McPara_EnablePosLagMonitoring,          (* Enable for position lag monitoring / Freigabe der Schleppfehler-Überwachung *)
McPara_MaxPositionLag,                  (* Threshold of position lag monitoring / Schwellwert der Schleppfehler-Überwachung *)
McPara_MaxVelocitySystem,                       (* Reference velocity / Bezugsgeschwindigkeit *)
McPara_MaxVelocityAppl,                 (* Velocity limit / Zugelassene Geschwindigkeit *)
McPara_ActualVelocity,                  (* Actual velocity / Istgeschwindigkeit *)
McPara_CommandedVelocity,                       (* Commanded velocity / Sollgeschwindigkeit des letzten Kommandos *)
McPara_MaxAccelerationSystem,           (* Maximum acceleration / Maximal-Beschleunigung *)
McPara_MaxAccelerationAppl,             (* Acceleration limit / Zugelassene Beschleunigung *)
McPara_MaxDecelerationSystem,           (* Maximum deceleration / Maximal-Verzögerung *)
McPara_MaxDecelerationAppl,             (* Deceleration limit / Zugelassene Verzögerung *)
McPara_MaxJerk,                         (* Maximum jerk / Maximal-Ruck *)
(* ============================================================== *)
McPara_BkPlcMc_ProfilType:=1000,                (* Profile type / Profil-Typ *)
McPara_BkPlcMc_EnvCycletime,            (* PLC task cycle time / Zykluszeit der PLC-Task *)
McPara_BkPlcMc_AxName,                  (* Axis name / Achs-Name *)
McPara_BkPlcMc_TimeBased,                       (* Enable for time based operation / Freigabe für zeitgeführte Sollwertgenerierung *)
McPara_BkPlcMc_JerkEnabled,             (* Jerk enable bit mask / Steuerbitmaske für Ruckbegrenzung *)
McPara_BkPlcMc_LogLevel,                        (* Logging level threshold / Schwellwert für Meldungsaufzeichnung *)
McPara_BkPlcMc_CycleDivider,            (* reserved / reserviert *)
McPara_BkPlcMc_ParamFileName,           (* Parameter file name / Name der Parameter-Datei *)
(* Encoder-Parameter *)
McPara_BkPlcMc_EncoderType:=1100,               (* Encoder type / Enkoder-Typ *)
McPara_BkPlcMc_EncoderHomingType,               (* Homing method / Referenzierverfahren *)
McPara_BkPlcMc_EncoderZeroShift,                (* Encoder zero shift / Enkoder-Nullpunktverschiebung *)
McPara_BkPlcMc_EncoderIncWeighting,             (* Encoder increment weighting / Enkoder-Gewichtung *)
McPara_BkPlcMc_EncoderIncInterpolation, (* Encoder interpolation / Enkoder-Zwischenteilung *)
McPara_BkPlcMc_EncoderRefIndexVelo,             (* Index search speed for homing / Index-Suchgeschwindigkeit der Referenzfahrt *)
McPara_BkPlcMc_EncoderRefIndexPositive, (* Enable for index search in positive direction / Freigabe für Index-Suche in positiver Richtung *)
McPara_BkPlcMc_EncoderRefSyncVelo,              (* Sync pulse search speed for homing / Nullimpuls-Suchgeschwindigkeit der Referenzfahrt *)
McPara_BkPlcMc_EncoderRefSyncPositive,  (* Enable for sync pulse search in positive direction / Freigabe für Nullimpuls-Suche in positiver Richtung *)
McPara_BkPlcMc_EncoderDefaultHomePosition,      (* Default homing position / Standard-Referenzposition *)
McPara_BkPlcMc_EncoderReversed,         (* Enable for encoder inversion / Freigabe für negierte Istwertermittlung *)
McPara_BkPlcMc_EncoderBaseDistance,             (* Base distance for distance coded encoders / Basisabstand für abstandscodierte Enkoder *)
McPara_BkPlcMc_EncoderModuloBase,               (* reserved / reserviert *)
McPara_BkPlcMc_EncoderEnableLatch,              (* Enable of sync pulse latch / Freigabe der Nullimpuls-Erfassung *)
McPara_BkPlcMc_EncoderLatchedPos,               (* Latched sync pulse position / Erfasste Nullimpuls-Position *)
McPara_BkPlcMc_EncoderRefShift,         (* Encoder homing offset / Referenzoffset des Enkoders *)
McPara_BkPlcMc_EncoderRefFlag,          (* Encoder homing state / Referenzierstatus des Enkoders *)
McPara_BkPlcMc_EncoderPotiRgToRl,               (* Encoder ptentiometer linearisation / Enkoder-Potilinearisierung *)
McPara_BkPlcMc_EncoderOverrunMask,              (* Encoder overrun monitoring / Enkoder-Überlaufüberwachung *)
McPara_BkPlcMc_EncoderPositionMask,             (* Encoder counter mask / Enkoder-Zählermaske *)
(* Ventil-Parameter *)
McPara_BkPlcMc_ValveOverlapCompP:=1200, (* Nondirectional or positive valve overlap compensation / Ungerichtete oder positive Überdeckungskompensation *)
McPara_BkPlcMc_ValveBendPointVelo,              (* Valve bendpoint compensation velocity / Knickkompensations-Geschwindigkeit *)
McPara_BkPlcMc_ValveBendPointOutput,    (* Valve bendpoint compensation output / Knickkompensations-Ausgabe *)
McPara_BkPlcMc_ValveResponseTime,               (* Valve deadtime / Ventil-Totzeit *)
McPara_BkPlcMc_ValveOverlapCompM,               (* Negative valve overlap compensation / Negative Überdeckungskompensation *)
McPara_BkPlcMc_CylinderArreaA:=1280,    (* Active cylinder arrea on A side / Aktive Zylinderfläche der A-Seite *)
McPara_BkPlcMc_CylinderArreaB,          (* Active cylinder arrea on B side / Aktive Zylinderfläche der B-Seite *)
(* Achs-Parameter *)
McPara_BkPlcMc_DriveType:=1300,         (* Drive type / Antriebs-Typ *)
McPara_BkPlcMc_AreaRatio,                       (* Directional velocity compensation / Kompensation der Richtungsabhängigkeit der Geschwindigkeit *)
McPara_BkPlcMc_DriveReversed,           (* Enable for setpoint output inversion / Freigabe für negierte Stellwertausgabe *)
McPara_BkPlcMc_DriveDefaultPowerOk,             (* Enable for PowerOk feedback bypass / Freigabe für Überbrückung der PowerOk-Rückmeldung *)
McPara_BkPlcMc_DriveAbsoluteOutput,             (* Enable for nondirectional (allways positive) setpoint output / Freigabe für die Ausgabe eines Absolut-Stellwerts (immer positiv) *)
McPara_BkPlcMc_DriveIncWeighting,               (* Weighting factor for drive adaption / Gewichtungsfaktor der Antriebsanpassung *)
McPara_BkPlcMc_DriveIncInterpolation,   (* Interpolating factor for drive adaption / Zwischenteilung der Antriebsanpassung *)
(* Beschleunigungsphase *)
McPara_BkPlcMc_StartRamp:=1400,         (* Acceleration ramping time / Zeitkonstante der Startrampe *)
McPara_BkPlcMc_PosCtrlAccEna,           (* reserved / reserviert *)
McPara_BkPlcMc_StartAccDistance,                (* reserved / reserviert *)
(* Bremsphase *)
McPara_BkPlcMc_StopRamp:=1500,          (* Deceleration ramping time / Zeitkonstante der Stoprampe *)
McPara_BkPlcMc_EmergencyRamp,           (* Emergency break ramping time / Zeitkonstante der Notstoprampe *)
(* Bremssteuerung *)
McPara_BkPlcMc_BrakeOn,                 (* Delay for brake activation / Brems-Einfallverzögerung *)
McPara_BkPlcMc_BrakeOff,                        (* Delay for brake deactivation / Brems-Öffnungsverzögerung *)
McPara_BkPlcMc_BrakeSafety,             (* Startover safety delay for brake / Durchstart-Bremssicherheitsverzögerung *)
(* Zielannäherung *)
McPara_BkPlcMc_CreepSpeedP:=1600,               (* Nondirectional or positive creep speed setpoint / Ungerichtete oder positive Schleichgeschwindigkeit *)
McPara_BkPlcMc_CreepDistanceP,          (* Nondirectional or positive creep distance / Ungerichtete oder positive Schleichstrecke *)
McPara_BkPlcMc_BrakeDistanceP,          (* Nondirectional or positive brake distance / Ungerichteter oder positiver Bremsweg *)
McPara_BkPlcMc_BrakeDeadTimeP,          (* Nondirectional or positive brake deadtime / Ungerichtete oder positive Bremstotzeit *)
McPara_BkPlcMc_CreepSpeedM,             (* Negative creep speed setpoint / Negative Schleichgeschwindigkeit *)
McPara_BkPlcMc_CreepDistanceM,          (* Negative creep creep distance / Negative Schleichstrecke *)
McPara_BkPlcMc_BrakeDistanceM,          (* Negative creep brake distance / Negativer Bremsweg *)
McPara_BkPlcMc_BrakeDeadTimeM,          (* Negative creep brake deadtime / Negative Bremstotzeit *)
McPara_BkPlcMc_AsymetricalTargeting,    (* Enable for asymetrical (directional) targeting / Freigabe für asymetrische (richtungsabhängige) Zielanfahrt *)
(* Ruhezustand *)
McPara_BkPlcMc_LagAmp:=1700,            (* Amplification factor of position lag controller / Verstärkung des Schleppreglers *)
McPara_BkPlcMc_LagAmpAdaptLimit,                (* reserved / reserviert *)
McPara_BkPlcMc_LagAmpAdaptFactor,               (* reserved / reserviert *)
McPara_BkPlcMc_ZeroCompensation,                (* Output offset compensation / Offset-Kompensation der Ausgabe *)
McPara_BkPlcMc_TargetClamping,          (* Target clamping setpoint / Sollwert der Klemmausgabe *)
McPara_BkPlcMc_ReposDistance,           (* Threshold for automatic repositioning / Schwellwert der automatischen Repositionierung *)
McPara_BkPlcMc_AutoBrakeDistance,               (* Enable for automatic brake distance calculation / Freigabe der automatische Bremswegberechnung *)
McPara_BkPlcMc_EnableControlLoopOnFault,        (* Enable of the fault state control loop activation / Freigabe für die Lageregelung im Fehlerfall *)
McPara_BkPlcMc_LagAmpDx,                        (* Threshold of position lag controller / Schwellwert des Schleppreglers *)
McPara_BkPlcMc_LagAmpTi,                        (* Integration time constant of position lag controller / Integrationszeit des Schleppreglers *)
McPara_BkPlcMc_LagAmpWuLimit,           (* Output clipping of integrating part of position lag controller / Ausgabebegrenzung des I-Anteils im Schleppreglers *)
McPara_BkPlcMc_LagAmpOutLimit,          (* Output clipping of position lag controller / Ausgabebegrenzung des Schleppreglers *)
McPara_BkPlcMc_VeloAmp,                 (* Amplification factor of velocity lag controller / Verstärkung des Geschwindigkeitsreglers *)
McPara_BkPlcMc_VeloAmpDx,                       (* Threshold of velocity lag controller / Schwellwert des Geschwindigkeitsreglers *)
McPara_BkPlcMc_VeloAmpTi,                       (* Integration time constant of velocity lag controller / Integrationszeit des Geschwindigkeitsreglers *)
McPara_BkPlcMc_VeloAmpWuLimit,          (* Output clipping of integrating part of velocity lag controller / Ausgabebegrenzung des I-Anteils im Geschwindigkeitsreglers *)
McPara_BkPlcMc_VeloAmpOutLimit,         (* Output clipping of velocity lag controller / Ausgabebegrenzung des Geschwindigkeitsreglers *)
(* Diverse Signale *)
McPara_BkPlcMc_MonPositionRange:=1800,  (* Position range limit for target monitoring / Positionsbereich für Zielfenster-Überwachung *)
McPara_BkPlcMc_MonTargetRange,          (* Target range limit for target monitoring / Zielbereich für Zielfenster-Überwachung *)
McPara_BkPlcMc_MonTargetFilter,         (* Filter time for target monitoring / Filterzeit für Zielfenster-Überwachung *)
McPara_BkPlcMc_MonPositionLagFilter,    (* Filter time for position lag monitoring / Filterzeit der Schleppüberwachung *)
McPara_BkPlcMc_MonDynamicLagLimit,              (* Dynamic part of position lag threshold / Dynamic-Anteil der Schleppgrenze *)
McPara_BkPlcMc_MonPehEnable,            (* Enable for PEH monitoring / Freigabe für PEH-Monitoring *)
McPara_BkPlcMc_MonPehTimeout,           (* Timeout limit for PEH monitoring / Zeitgrenze für PEH-Überwachung *)
(* Handfahrt *)
McPara_BkPlcMc_JogVeloFast:=1900,               (* Velocity for slow manual jog / Langsame Handfahrt-Geschwindigkeit *)
McPara_BkPlcMc_JogVeloSlow,             (* Velocity for fast manual jog / Schnelle Handfahrt-Geschwindigkeit *)
(* Kundendaten *)
McPara_BkPlcMc_CustomerData:=2000,              (* Customer application data array / Feld für Daten der Kundenanwendung *)
(**)
(* ---------------------------------------------------------- *)
McRtData_BkPlcMc_ActualPosition:=10000, (* Actual position / Istposition *)
McRtData_BkPlcMc_ActualAcceleration,    (* (dummy) Actual acceleration / (Dummy) Istbeschleunigung *)
McRtData_BkPlcMc_PosError,                      (* Position lag / Schleppfehler *)
McRtData_BkPlcMc_DistanceToTarget,              (* Distance to commanded target / Entfernung zur Zielposition *)
McRtData_BkPlcMc_ActPressure,           (* Actual pressure / Istdruck *)
McRtData_BkPlcMc_ActPressureA,          (* Actual pressure on A side / Istdruck der A-Seite *)
McRtData_BkPlcMc_ActPressureB,          (* Actual pressure on B side / Istdruck der B-Seite *)
McRtData_BkPlcMc_ActForce,                      (* Actual force / Istkraft *)
McRtData_BkPlcMc_ValvePressure,         (* Valve pressure drop / Ventil-Druckabfall *)
McRtData_BkPlcMc_SupplyPressure,                (* Supply pressure / Versorgungsdruck *)
McRtData_BkPlcMc_SetPosition,           (* Position setpoint / Sollposition *)
McRtData_BkPlcMc_SetVelocity,           (* Velocity setpoint / Sollgeschwindigkeit *)
McRtData_BkPlcMc_SetAcceleration,               (* Acceleration setpoint / Sollbeschleunigung *)
McRtData_BkPlcMc_SetPressure,           (* Pressure setpoint / Solldruck *)
McRtData_BkPlcMc_SetOverride,           (* Active override / Aktiver Override *)
McRtData_BkPlcMc_LatchPosition,         (* Compensated (actual) reference position/ Verrechnete Referenzposition *)
McRtData_BkPlcMc_CtrlOutLag,            (* Lag controller output / Schleppreglerausgabe *)
McRtData_BkPlcMc_CtrlOutClamping,               (* Clamping output / Klemmausgabe *)
McRtData_BkPlcMc_CtrlOutOverlapComp,    (* Overlap compensation output / Ausgabe der Überdeckungskompensation *)
McRtData_BkPlcMc_TargetPosition,                (* Commanded target position / Zielposition *)
McRtData_BkPlcMc_NSDW:=11000,           (* Axis state bit mask (DWORD) / Achszustandsbitmaske (DWORD) *)
McRtData_BkPlcMc_DCDW,                  (* Axis control bit mask (DWORD) / Achssteuerbitmaske (DWORD) *)
McRtData_BkPlcMc_ErrCode,                       (* Error code / Fehlernummer *)
McRtData_BkPlcMc_FbState,                       (* PLCopen state / Status nach PLCopen *)
McRtData_BkPlcMc_CurStep,                       (* Library internal state / Bibliotheksinterner Status *)
McRtData_BkPlcMc_ParamsUnsave,          (* Warning: unsaved parameter change / Warnung: Nicht gesicherte Parameteränderung *)
(* ---------------------------------------------------------- *)
(**)
McPara_BkPlcMc_
);
END_TYPE


TcPlcHydraulics: PLCopen Motion Control: Datentypen: E_TcMcProfileType

TYPE E_TcMcProfileType (starting with V3.0)

The constants listed here are used to identify the rules used to generate the control value for an axis.

TYPE E_TcMcProfileType :
(
iTcMc_ProfileConstAcc,
iTcMc_ProfileTimePosCtrl,
iTcMc_ProfileCosine,
iTcMc_ProfileCtrlBased,
iTcMc_ProfileTimeRamp,
iTcMc_ProfileJerkBased,
iTcMc_Profile_TestOnly:=100
);
END_TYPE

iTcMc_ProfileConstAcc: Listed vor compatibility, only. Is replaced by iTcMc_ProfileCtrlBased.

iTcMc_ProfileTimePosCtrl: Attention: Listed vor compatibility, will not be supported in the future. The control value for the drive is assembled from sections of constant acceleration and deceleration. Time (acceleration, stop) and distance (acceleration, positioning) function as controlling values.

iTcMc_ProfileCosine: Attention: Listed vor compatibility, will not be supported in the future. The control value for the drive is assembled from sections of acceleration and deceleration having cosine curves. Time (starting, stop) and distance (acceleration, positioning) function as controlling values.

iTcMc_ProfileCtrlBased: The control value for the drive is assembled from sections of constant acceleration and deceleration. Time (acceleration, change of velocity, stop) and distance (positioning) function as controlling values. Note: This generator type can optional be set to work completely time based, constantly activating a closed lag control loop.

iTcMc_ProfileTimeRamp: The control value for the drive is assembled from ramping functions. Time (acceleration, change of velocity, stop) and distance (breaking, stopping) function as controlling values. Note: This generator type is targeting axes that are replacing digital cam switches for the encoder.

iTcMc_ProfileJerkBased: The control value for the drive is assembled from sections of constant acceleration and deceleration. The deceleration to the target is relieved by using a constant jerk. This constant jerk can optionaly be activated for the rise of the acceleration. Time (acceleration, change of velocity, stop) and distance (positioning) function as controlling values. Note: This generator type can optional be set to work completely time based, constantly activating a closed lag control loop.

iTcMc_Profile_TestOnly: Attention: This type is supported only for tests of not yet released function block prototypes. It cannot be set by using the PlcMcManager.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: E_TcMcPressureReadingMode

TYPE E_TcMcPressureReadingMode (starting with V3.0)

The constants listed here are supplied to blocks for reading actual values for force or pressure. They select the target variable in the ST_TcHydAxRtData structure of the axis that has to be updated.

TYPE E_TcMcPressureReadingMode :
(
        iTcHydPressureReadingDefault,
        iTcHydPressureReadingActPressure,
        iTcHydPressureReadingActPressureA,
        iTcHydPressureReadingActPressureB,
        iTcHydPressureReadingActForce,
        iTcHydPressureReadingSupplyPressure,
        iTcHydPressureReadingValvePressure
);
END_TYPE

iTcHydPressureReadingDefault: The target variable is defined by the function block internaly.

iTcHydPressureReadingActPressure: The target variable is fActPressure. Some blocks will update fActPressureA and fActPressureB automatically.

iTcHydPressureReadingActPressureA: The target variable is fActPressureA.

iTcHydPressureReadingActPressureB: The target variable is fActPressureB.

iTcHydPressureReadingActForce: The target variable is fActForce. Some blocks will update fActPressure, fActPressureA and fActPressureB automatically.

iTcHydPressureReadingSupplyPressure: The target variable is fSupplyPressure.

iTcHydPressureReadingValvePressure: The target variable is fValvePressure.


TcPlcHydraulics: PLCopen Motion Control: Data types: MC_CAM_ID_BkPlcMc

TYPE MC_CAM_ID_BkPlcMc (starting with V3.0)

(internal use only) .

TYPE MC_CAM_ID_BkPlcMc:
STRUCT
        stCamRef:               MC_CAM_REF_BkPlcMc;
        bValidated:     BOOL:=FALSE;
        bPeriodic:      BOOL:=FALSE;
        bMasterAbs:     BOOL:=FALSE;
        bSlaveAbs:      BOOL:=FALSE;
        bIsChanged:     BOOL:=TRUE;
END_STRUCT
END_TYPE

stCamRef: A copy of the MC_CAM_REF_BkPlcMc structure.

bValidated: Here the struktur is marked as valid if it is initialised by a block of type MC_CamTableSelect_BkPlcMc.

bPeriodic: Reserved.

bMasterAbs: This flag marks the data in the master row of the table as absolute or as relative to the masters position at coupling.

bSlaveAbs: This flag marks the data in the slave row of the table as absolute or as relative to the slaves position at coupling.

bIsChanged: Reserved.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: MC_CAM_REF_BkPlcMc

TYPE MC_CAM_REF_BkPlcMc (starting with V3.0)

(internal use only) .

TYPE MC_CAM_REF_BkPlcMc:
STRUCT
        pTable:         POINTER TO LREAL:=0;
        nFirstIdx:      UDINT:=1;
        nLastIdx:               UDINT:=1;
        bEquiDistant:   BOOL:=FALSE;
END_STRUCT
END_TYPE

pTable: The adresse of the camming data table.

nFirstIdx: The index of the first table line.

nLastIdx: The index of the last table line.

bEquiDistant: Reserved.


TcPlcHydraulics: PLCopen Motion Control: Data types: MC_Direction_BkPlcMc

TYPE MC_Direction_BkPlcMc (starting with V3.0)

The constants listed here are used to identify the direction in which axes are moving.

TYPE MC_Direction_BkPlcMc:
(
MC_Positive_Direction_BkPlcMc := 1,
MC_Shortest_Way_BkPlcMc,
MC_Negative_Direction_BkPlcMc,
MC_Current_Direction_BkPlcMc
);
END_TYPE

MC_Positive_Direction_BkPlcMc: The movement is in the direction of rising values of position.

MC_Shortest_Way_BkPlcMc: The direction of movement is selected so that the distance covered is as short as possible.

MC_Negative_Direction_BkPlcMc: The movement is in the direction of falling values of position.

MC_Current_Direction_BkPlcMc: The movement is in the same direction as the most recently executed movement.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: MC_HomingMode_BkPlcMc

TYPE MC_HomingMode_BkPlcMc (starting with V3.0)

The codes in this enumeration are used for specifying the referencing methode of the axis.

TYPE MC_HomingMode_BkPlcMc:
(
        MC_DefaultHomingMode_BkPlcMc,
        MC_AbsSwitch_BkPlcMc,
        MC_LimitSwitch_BkPlcMc,
        MC_RefPulse_BkPlcMc,
        MC_Direct_BkPlcMc,
        MC_Absolute_BkPlcMc,
        MC_Block_BkPlcMc,
        MC_FlyingSwitch_BkPlcMc,
        MC_FlyingRefPulse_BkPlcMc
);
END_TYPE

MC_DefaultHomingMode_BkPlcMc: The homing method is defined by the axis parameters.

MC_AbsSwitch_BkPlcMc: The method iTcMc_HomingOnIndex is applied.

MC_LimitSwitch_BkPlcMc: Not supported.

MC_RefPulse_BkPlcMc: The method iTcMc_HomingOnSync is applied.

MC_Direct_BkPlcMc: The method iTcMc_HomingOnExec is applied.

MC_Absolute_BkPlcMc: Not supported.

MC_Block_BkPlcMc: The method iTcMc_HomingOnBlock is applied.

MC_FlyingSwitch_BkPlcMc: Not supported.

MC_FlyingRefPulse_BkPlcMc: Not supported.


TcPlcHydraulics: PLCopen Motion Control: Data types: MC_StartMode_BkPlcMc

TYPE MC_StartMode_BkPlcMc (starting with V3.0)

The constants listed here are used to identify the starting method of the axes.

TYPE MC_StartMode_BkPlcMc:
(
        MC_StartMode_Absolute:=1,
        MC_StartMode_Relative,
        MC_StartMode_RampIn
);
END_TYPE

MC_StartMode_Absolute: Slave setpoints calculated by blocks of type MC_CamIn_BkPlcMc are assumed to be absolute.

MC_StartMode_Relative: Slave setpoints calculated by blocks of type MC_CamIn_BkPlcMc are assumed to be relative to the coupling point.

MC_StartMode_RampIn: Not suported.


TcPlcHydraulics: PLCopen Motion Control: Data types: OUTPUT_REF_BkPlcMc

TYPE OUTPUT_REF_BkPlcMc (starting with V3.0)

A structure of this type is supplied to blocks of the types
MC_ReadDigitalOutput_BkPlcMc(),
MC_WriteDigitalOutput_BkPlcMc()
and MC_DigitalCamSwitch_BkPlcMc().

TYPE OUTPUT_REF_BkPlcMc:
STRUCT
        OutputBits: UDINT:=0;
END_STRUCT
END_TYPE

OutputBits: The output signals adressed by this structure.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: ST_FunctionGeneratorFD_BkPlcMc

TYPE ST_FunctionGeneratorFD_BkPlcMc (starting with V3.0.31)

This structure contains the parameters for the definition of the output signals of a function generator. A structure of this type is supplied to MC_FunctionGeneratorFD_BkPlcMc() blocks.

TYPE ST_FunctionGeneratorFD_BkPlcMc :
STRUCT
        Sin_Amplitude:  LREAL:=0.0;
        Sin_Phase:      LREAL:=0.0;
        Sin_Offset:     LREAL:=0.0;

        Cos_Amplitude:  LREAL:=0.0;
        Cos_Phase:      LREAL:=0.0;
        Cos_Offset:     LREAL:=0.0;

        Rect_Amplitude: LREAL:=0.0;
        Rect_Phase:     LREAL:=0.0;
        Rect_Ratio:     LREAL:=0.5;
        Rect_Offset:    LREAL:=0.0;

        Saw_Amplitude:  LREAL:=0.0;
        Saw_Phase:      LREAL:=0.0;
        Saw_Ratio:      LREAL:=0.5;
        Saw_Offset:     LREAL:=0.0;

END_STRUCT
END_TYPE

Sin_Amplitude, Cos_Amplitude, Rect_Amplitude, Saw_Amplitude: The peek value of the signals.

Sin_Phase, Cos_Phase, Rect_Phase, Saw_Phase: The phase shift of the signals.

Sin_Offset, Cos_Offset, Rect_Offset, Saw_Offset: The offset of the signals.

Rect_Ratio, Saw_Ratio: The ON/OFF ration of the rectangle and sawtooth signal.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: ST_FunctionGeneratorTB_BkPlcMc

TYPE ST_FunctionGeneratorTB_BkPlcMc (starting with V3.0.31)

This structure contains the parameters of the timebase for one or more function generators. A structure of this type is supplied to MC_FunctionGeneratorTB_BkPlcMc(), MC_FunctionGeneratorFD_BkPlcMc() and MC_FunctionGeneratorSetFrq_BkPlcMc() blocks.

TYPE ST_FunctionGeneratorTB_BkPlcMc :
STRUCT
        Frequency:      LREAL:=0.000001;
        Freeze:         BOOL:=FALSE;

        CycleCount:     DINT:=0;
        CurrentTime:    LREAL:=0.0;
        CurrentRatio:   LREAL:=0.0;
END_STRUCT
END_TYPE

Frequency: The working frequency in Herz of the timebase supported by a MC_FunctionGeneratorTB_BkPlcMc() block.

Freeze: If this variable is set to TRUE a MC_FunctionGeneratorTB_BkPlcMc() block will not access the structure.

CycleCount: The number of completed signal cycles.

CurrentTime: The elapsed time within the currently generated signal period.

CurrentRatio: The normalised progress within the currently generated signal period.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: ST_TcPlcMcLogBuffer

TYPE ST_TcMcAutoIdent (starting with V3.0.4)

A variable of this structured type is used to hold the parameters for a MC_AxUtiAutoIdent_BkPlcMc block. For details see the blocks description.

TYPE ST_TcMcAutoIdent :
(* last modification: 15.09.2009 *)
STRUCT
        EnableEndOfTravel:              BOOL:=FALSE;
        (**)
        EnableOverlap:                  BOOL:=FALSE;
        EnableZeroAdjust:                       BOOL:=FALSE;
        (**)
        EnableArreaRatio:                       BOOL:=FALSE;
        (**)
        EndOfTravel_Negativ:            LREAL:=0.0;
        EndOfTravel_Positiv:            LREAL:=0.0;
        EndOfIncrements_Negativ:                DINT:=0;
        EndOfIncrements_Positiv:                DINT:=0;
        (**)
        EndOfTravel_NegativLimit:               LREAL:=0.0;
        EndOfTravel_PositivLimit:               LREAL:=0.0;
        (**)
        EndOfTravel_PositivDone:                BOOL:=FALSE;
        EndOfTravel_NegativDone:                BOOL:=FALSE;
        (**)
        DecelerationFactor:             LREAL:=1.0;     (* starting with V3.0.31 *)
        (**)
        EnableValveCharacteristic:              BOOL:=FALSE;
        ValveCharacteristicTable:               ARRAY[1..100,1..2] OF LREAL;
        ValveCharacteristicTblCount:    INT:=0;
        ValveCharacteristicLowEnd:              LREAL:=0.0;
        ValveCharacteristicHighEnd:     LREAL:=0.0;
        ValveCharacteristicRamp:                LREAL:=0.0;
        ValveCharacteristicSettling:    LREAL:=0.0;     (* starting with V3.0.32 *)
        ValveCharacteristicRecovery:    LREAL:=0.0;
        ValveCharacteristicMinCycle:    LREAL:=0.0;
END_STRUCT
END_TYPE


TcPlcHydraulics: PLCopen Motion Control: Datentypen: ST_TcHydAxParam

TYPE ST_TcHydAxParam (starting with V3.0)

This structure is containing all parameters of the axis.

Note: The parameter order in the structure may be changed without notice.

TYPE ST_TcHydAxParam :
(* last modification: 26.11.2010 *)
STRUCT
        (* ===========================================================================
        this section isn't saved / dieser Bereich wird nicht gesichert
        =========================================================================== *)
        sParamFileName:         STRING := 'DefAxParmFile.dat';

        (* ===========================================================================
        from this point all parameters are saved / von hier an werden alle Parameter gesichert
        =========================================================================== *)
        fAcc:                   LREAL := 2000.0; (* Acceleration, unit mm/second^2 / Beschleunigung, Einheit mm/Sekunde^2 *)
        fAreaRatio:             LREAL := 1.0; (* Ratio of cylinder areas, unit none / Verhältnis der Zylinderflächen, Einheit ohne *)
        fBrakeDistance:         LREAL := 0.03;*) (* up to V3.0.7: braking distance / Bremsweg *)
        fBrakeDistanceM:                LREAL := 0.1; (* starting with V3.0.8: braking distance, negative direction / Bremsweg, negative Richtung *)
        fBrakeDistanceP:                LREAL := 0.1; (* starting with V3.0.8: braking distance, positive direction / Bremsweg, positive Richtung *)
        fBrakeDeadTime:         LREAL := 0.0;*) (* up to V3.0.7: braking dead time / Bremstotzeit *)
        fBrakeDeadTimeM:                LREAL := 0.0; (* starting with V3.0.8: braking dead time, negative direction / Bremstotzeit, negative Richtung *)
        fBrakeDeadTimeP:                LREAL := 0.0; (* starting with V3.0.8: braking dead time, positive direction / Bremstotzeit, positive Richtung *)
        fBrakeOffDelay:         LREAL := 0.0;
        fBrakeOnDelay:          LREAL := 0.0;
        fBrakeSafetyDelay:      LREAL := 0.0;
        fCreepSpeed:            LREAL := 80.0; (* up to V3.0.7: creeping speed, positive direction / Kriechgeschwindigkeit, positive Richtung *)
        fCreepSpeedM:           LREAL := 80.0; (* starting with V3.0.8: creeping speed, negative direction / Kriechgeschwindigkeit, negative Richtung *)
        fCreepSpeedP:           LREAL := 80.0; (* starting with V3.0.8: creeping speed, positive direction / Kriechgeschwindigkeit, positive Richtung *)
        fCreepDistance:         LREAL := 1.0; (* up to V3.0.7: creeping distance, positive direction / Kriechstrecke, positive Richtung *)
        fCreepDistanceM:                LREAL := 1.0; (* starting with V3.0.8: creeping distance, negative direction / Kriechstrecke, negative Richtung *)
        fCreepDistanceP:                LREAL := 1.0; (* starting with V3.0.8: creeping distance, positive direction / Kriechstrecke, positive Richtung *)
        fCustomerData:          ARRAY [1..iTcHydfCustDataMaxIdx] OF LREAL;
        fCycletime:             LREAL := 0.010; (* Cycle time of calling PLC task / Zykluszeit der aufrufenden PLC Task *)
        fCylinder_ArreaA:               LREAL := 1.0; (* Cylinder arrea A side / Zylinderfläche A-Seite *)
        fCylinder_ArreaB:               LREAL := 1.0; (* Cylinder arrea B side / Zylinderfläche B-Seite *)
        fCylinder_Mass:         LREAL := 1.0; (* Cylinder mass incl. load mass / Zylindermasse inkl. Lastmasse *)
        fCylinder_Stroke:               LREAL := 1.0; (* Cylinder travel / Zylinderfahrweg *)
        fDec:                   LREAL := 2000.0; (* Deceleration / Verzögerung *)
        fDrive_IncInterpolation:        LREAL := 1.0; (* V3.0.24: Increment interpolation / Inkrement-Unterteilung *)
        fDrive_IncWeighting:    LREAL := 0.001; (* V3.0.24: Increment weighting factor / Inkrement-Bewertung *)
        fEmergencyRamp:         LREAL := 0.1;
        fEnc_BaseDistance:      LREAL := 0.001; (* Base distance for distance codes sync pulses / Grundabstand für Abstandskodierte Sync-Pulse *)
        fEnc_DefaultHomePosition:       LREAL := 0.0; (* / *)
        fEnc_IncInterpolation:  LREAL := 1.0; (* Increment interpolation / Inkrement-Unterteilung *)
        fEnc_IncWeighting:      LREAL := 0.001; (* Increment weighting factor / Inkrement-Bewertung *)
        fEnc_ModuloBase:                LREAL := 0.001; (* / *)
        fEnc_PotiRgToRl:                LREAL := 0.0; (* Analog pot total to load resistance / Analog-Potentiometer Gesamt- zu Lastwiderstand *)
        fEnc_RefIndexVelo:      LREAL := 0.1; (* Speed for index search / Geschwindigkeit für Nockensuche *)
        fEnc_RefSyncVelo:               LREAL := 0.1; (* Speed for sync pulse search / Geschwindigkeit für Referenzpulssuche *)
        fEnc_ZeroShift:         LREAL := 0.0; (* Zero shift / Nullpunktverschiebung *)
        fJogVeloFast:           LREAL := 100.0; (* Jog velocity fast, unit mm/sec / Schnelle Handfahrgeschwindigkeit, Einheit mm/sek *)
        fJogVeloSlow:           LREAL := 25.0; (* Jog velocity slow, unit mm/sec / Langsame Handfahrgeschwindigkeit, Einheit mm/sek *)
        fFeedForward:           LREAL := 1.0;
        fLagAmp:                        LREAL := 0.05; (* lag error amplification / Lagereglerverstärkung *)
        fLagAmpDx:              LREAL := 0.0;
        fLagAmpTi:              LREAL := 0.0;
        fLagAmpOutL:            LREAL := 0.0;
        fLagAmpWuL:             LREAL := 0.0;
        fMaxAcc:                        LREAL := 500.0; (* Max. enabled acceleration, unit mm/sec^2 / Zugelassene Beschleunigung, Einheit mm/sek^2 *)
        fMaxDec:                        LREAL := 500.0; (* Max. enabled deceleration, unit mm/sec^2 / Zugelassene Verzögerung, Einheit mm/sek^2 *)
        fMaxDynamicLag:         LREAL := 0.0; (* Max. acceptable dynamic position lag, unit mm/(mm/s) / Max. zulässiger dynamischer Schleppabstand, Einheit mm/(mm/s) *)
        fMaxJerk:               LREAL := 1000.0; (* Max. enabled jerk, unit mm/sec^3 / Zugelassener Ruck, Einheit mm/sek^3 *)
        fMaxLag:                        LREAL := 0.0; (* Max. acceptable position lag, unit mm / Max. zulässiger Schleppabstand, Einheit mm *)
        fMaxLagFilter:          LREAL := 0.0; (* Max. acceptable position lag filter time, unit s / Max. zulässiger Schleppabstandsfilterzeit, Einheit s *)
        fMaxVelo:               LREAL := 500.0; (* Max. enabled velocity, unit mm/sec / Zugelassene Maximalgeschwindigkeit, Einheit mm/sek *)
        fMonPositionRange:      LREAL := 1.0;
        fMonTargetFilter:               LREAL := 1.0;
        fMonTargetRange:                LREAL := 1.0;
        fPEH_Timeout:           LREAL := 0.0; (* starting with 3.0.20 *)
        fRefVelo:               LREAL := 500.0; (* Reference velocity, unit mm/sec / Bezugsgeschwindigkeit, Einheit mm/sek *)
        fReposDistance:         LREAL := 0.0; (* distance from target to reposition *)
        fSoftEndMax:            LREAL := 10000.0; (* Upper logical end of path, unit mm / Obere Software-Endlage, Einheit mm *)
        fSoftEndMin:            LREAL := 0.0; (* Lower logical end of path, unit mm / Untere Software-Endlage, Einheit mm *)
        fStartAccDistance:      LREAL := 1.0; (* Displacement, unit mm / Abstand, Einheit mm *)
        fStartRamp:             LREAL := 1.0; (* time to ref speed, unit second / Zeit bis zur Refferenzgeschwindigkeit, Einheit Sekunde *)
        fStopRamp:              LREAL := 1.0;
        fTargetClamping:                LREAL := 0.0; (* clamping output at target / Anpressdruck im Ziel *)
        fValve_BendPointOutput: LREAL := 0.0;
        fValve_BendPointVelo:   LREAL := 0.0;
        fValve_OverlapComp:     LREAL := 0.0; (* up to V3.0.7: Valve overlap compensation / Überdeckungskompensation *)
        fValve_OverlapCompM:    LREAL := 0.0; (* starting with V3.0.8: Valve overlap compensation / Überdeckungskompensation *)
        fValve_OverlapCompP:    LREAL := 0.0; (* starting with V3.0.8: Valve overlap compensation / Überdeckungskompensation *)
        fValve_ResponseTime:    LREAL := 0.0;
        fVeloAmp:               LREAL := 0.0;
        fVeloAmpDx:             LREAL := 0.0;
        fVeloAmpTi:             LREAL := 0.0;
        fVeloAmpOutL:           LREAL := 0.0;
        fVeloAmpWuL:            LREAL := 0.0;
        fZeroCompensation:      LREAL := 0.0; (* offset compensation / Offsetabgleich *)

        nEnc_ZeroSwap:          DINT := 0;
        nCycleDivider:          INT := 1;
        nDrive_Type:            E_TcMcDriveType := iTcMc_Drive_Customized;
        nEnc_Type:              E_TcMcEncoderType := iTcMc_EncoderSim;
        nEnc_HomingType:                E_TcMcHomingType := iTcMc_HomingOnBlock;
        nEnc_OverrunMask:               DWORD := 0;
        nEnc_PositionMask:      DWORD := 0;
        nJerkEnabled:           WORD := 16#0101;
        nProfileType:           E_TcMcProfileType := iTcMc_ProfileCtrlBased;

        bAsymetricalTargeting:  BOOL := FALSE; (* starting with V3.0.8: creeping&braking P&M is not same / Schleichen und Bremsen P&M ist nicht gleich *)
        bDrive_AbsoluteOutput:  BOOL := FALSE; (* Drive takes absolute velocity / Antrieb benötigt Absolut-Geschwindigkeit *)
        bDrive_DefaultPowerOk:  BOOL := FALSE; (* PowerOk feedback ignored / PowerOk-Rückmeldung wird ignoriert *)
        bDrive_Reversed:                BOOL := FALSE; (* Drive is reversed / Antrieb fährt umgekehrt *)
        bEnableAutoBrakeDistance:       BOOL := FALSE;
        bEnableControlLoopOnFault:      BOOL := FALSE;
        bEnc_RefIndexPositive:  BOOL := FALSE; (* Direction for index search is positive / Richtung für Nockensuche ist positiv *)
        bEnc_RefSyncPositive:   BOOL := FALSE; (* Direction for sync pulse search is positive / Richtung für Referenzpulssuche ist positiv *)
        bEnc_Reversed:          BOOL := FALSE; (* Encoder is reversed / Enkoder zählt umgekehrt *)
        bMaxLagEna:             BOOL := FALSE; (* Enable for position lag monitoring / Freigabe für Schleppabstandsüberwachung *)
        bPEH_Enable:            BOOL := FALSE; (* starting with 3.0.20 *)
        bPosCtrlAccEna:         BOOL := FALSE; (* obsolete, will be removed *)
        bSoftEndMaxEna:         BOOL := FALSE; (* Enable for upper logical end of path / Freigabe für obere Software-Endlage *)
        bSoftEndMinEna:         BOOL := FALSE; (* Enable for lower logical end of path / Freigabe für untere Software-Endlage *)
        bTimeBased:             BOOL := FALSE;
        bLinTabAvailable:               BOOL := FALSE; (* Linearisation table is available / Linearisierungstabelle ist verfuegbar *)
        (*-------------------------------------------------------------------------------------------------------------*)
END_STRUCT
END_TYPE

bAsymetricalTargeting: Starting withV3.0.8: If this parameter is set to TRUE directional parameters for the targeting and the overlap compensation become effective.

bDrive_AbsoluteOutput: Set this parameter to TRUE to have nondirectional (allways positive) setpoints written to the output device.

bDrive_DefaultPowerOk: With this parameter set the PowerOk feedback signal in the ST_TcPlcDeviceOutput structure of the axis is ignored.

bDrive_Reversed: This parameter will invert the setpoint at the output device.

bEnableAutoBrakeDistance: Under construction: fCreepDistanceM and fCreepDistanceP are automatically calculated from fCreepSpeedM and fCreepSpeedP by using fLagAmp if this parameter is TRUE.

bEnableControlLoopOnFault: Under construction: This parameter will activate the position control loop even in fault situations. Preconditions: The control loop is applicable and the axis is in an adequate situation.

bEnc_RefIndexPositive: This parameter on TRUE will start the index search of a referencing in the positive directions. Otherwise the search would start in negative direction.

bEnc_RefSyncPositive: This parameter on TRUE will start the sync pulse search of a referencing in the positive directions. Otherwise the search would start in negative direction.

bEnc_Reversed: If this parameter is set the actual position is inverted.

bLinTabAvailable: reserved.

bMaxLagEna: This parameter will activate lag monitoring.

bPEH_Enable: This parameter will activate PEH monitoring.

bPosCtrlAccEna: obsolete, will be removed.

bSoftEndMaxEna: This parameter will activate the upper Software endswitch.

bSoftEndMinEna: This parameter will activate the lower Software endswitch.

bTimeBased: reserved.

fAcc: The absolute acceleration limit for the axis.

fAreaRatio: The directional dependency of the axis velocity can be compensated here.

fBrakeDistance: Up to V3.0.7: The active profile defined setpoint generation is stopped in this nondirectional distance to the target. A lag control loop or any other mechanism will be activated according to other parameters.

fBrakeDistanceM: Starting withV3.0.8: For bAsymetricalTargeting = TRUE the active profile defined setpoint generation is stopped in this negative distance to the target. A lag control loop or any other mechanism will be activated according to other parameters.

fBrakeDistanceP: Starting withV3.0.8: The active profile defined setpoint generation is stopped in this nondirectional or (for bAsymetricalTargeting = TRUE) positive distance to the target. A lag control loop or any other mechanism will be activated according to other parameters.

fBrakeDeadTime: Up to V3.0.7:

fBrakeDeadTimeM: Starting withV3.0.8:

fBrakeDeadTimeP: Starting withV3.0.8:

fBrakeOffDelay: For any value greater than 0 the setpoint generator will insert a delay between the rising edge of the ST_TcPlcDeviceOutput.bBrakeOff and the start of the acceleration phase.

fBrakeOnDelay: For any value greater than 0 the setpoint generator will insert a delay between the end of the active profile generation and the falling edge of the ST_TcPlcDeviceOutput.bBrakeOff.

fBrakeSafetyDelay: For any value greater than 0 the setpoint generator will insert a delay between the falling edge of the ST_TcPlcDeviceOutput.bBrakeOff at the end of an active profile generation and the rising edge at the start of the next command execution.

fCreepSpeed: Up to V3.0.7: This velocity is used for the last phase of the profile defined setpoint generation for any direction.

fCreepSpeedM: Starting withV3.0.8: If bAsymetricalTargeting = TRUE this velocity is used for the last phase of the profile defined setpoint generation for negative direction.

fCreepSpeedP: Starting withV3.0.8: This velocity is used for the last phase of the profile defined setpoint generation for any or at least (if bAsymetricalTargeting = TRUE) for positive direction.

fCreepDistance: Up to V3.0.7: Within this nondirectional distance to the target fCreepSpeed is used as a velocity command for the final phase of the profile defined setpoint generation.

fCreepDistanceM: Starting withV3.0.8: If bAsymetricalTargeting = TRUE fCreepSpeedM is used as a velocity command for the final phase of the profile defined setpoint generation within this positive distance to the target.

fCreepDistanceP: Starting withV3.0.8: Within this nondirectional or (if bAsymetricalTargeting = TRUE) positive distance to the target fCreepSpeedP is used as a velocity command for the final phase of the profile defined setpoint generation.

fCustomerData: These 20 LREAL parameters are reserved for the application. They are loaded and saved as part of the axis parameters. No block from the library will make use of these values without being commanded to do so by the application.

fCycletime: The cycle time of the PLC task that is calling the library blocks. Note: Usually this value is determined automatically by a MC_AxUtiStandardInit_BkPlcMc() block and may be used but must not be modified by the application.

fCylinder_ArreaA: The active cylinder arrea that is applied pressure for traveling in positive direction.

fCylinder_ArreaB: The active cylinder arrea that is applied pressure for traveling in negative direction.

fCylinder_Mass: reserved.

fCylinder_Stroke: reserved.

fDec: The absolute deceleration limit for the axis.

fDrive_IncInterpolation: This parameter is used in the conversion of the setpoint for some drive types.

fDrive_IncWeighting: This parameter is used in the conversion of the setpoint for some drive types.

fEmergencyRamp: A time to decelerate from fRefVelo to standstill. This parameter is used by some setpoint generators to respond to unsheduled emergency stop requests: removed control enable, fault conditions, commands from the application.

fEnc_BaseDistance: This parameter is used for reading encoders supporting distance coded sync pulses.

fEnc_DefaultHomePosition: A value to be used as a reference position by a MC_Home_BkPlcMc() block can be stored here. For any homing operation triggered by the PlcMcManager this value will be used. In case this is what should happen for homming commands from the application as well this parameter has to be supplied to the block in use.

fEnc_IncInterpolation: This parameter defines the resolution of the position feedback of the axis.

fEnc_IncWeighting: This parameter defines the resolutionof the position feedback of the axis.

fEnc_PotiRgToRl: This parameter is used by some blocks for the linearisation of a position feedback that has been red from a simple omic loaded potentiometer.

fEnc_RefIndexVelo: During a homing operation this velocity is used when searching the reference index (camm).

fEnc_RefSyncVelo: During a homing operation this velocity is used when searching the sync pulse.

fEnc_ZeroShift: For absolute encoders this parameter is shifting the zero point.

fJogVeloFast: Setpoint for fast manual travel.

fJogVeloSlow: Setpoint for slow manual travel.

fLagAmp: The proportional amplification factor of the position lag control loop.

fLagAmpDx: Under construction: The threshold of the position lag control loop.

fLagAmpTi: Under construction: The integration time constant of the position lag control loop.

fLagAmpOutL: Under construction: The output limit of the position lag control loop.

fLagAmpWuL: Under construction: The limit for the integrating part of the position lag control loop.

fMaxAcc: The maximum acceleration that can be commanded by the application blocks. This parameter is limited to fAcc.

fMaxDec: The maximum deceleration that can be commanded by the application blocks. This parameter is limited to fDec.

fMaxDynamicLag: This is a parameter for the position lag monitoring.

fMaxJerk: The absolute jerk limit for the axis. This parameter is effective only if the profile type is set to iTcMc_ProfileJerkBased.

fMaxLag: This is a parameter for the position lag monitoring.

fMaxLagFilter: This is a parameter for the position lag monitoring.

fMaxVelo: The maximum velocity that can be commanded by the application. Any velocity command supplied to a block will be limited without any further notice. Note: This parameter is limited to fRefVelo.

fMonPositionRange: This is a parameter for the target monitoring.

fMonTargetFilter: This is a parameter for the target monitoring.

fMonTargetRange: This is a parameter for the target monitoring.

fPEH_Timeout: This is a parameter for the PEH monitoring.

fRefVelo: The absolute maximum velocity of the axis.

fReposDistance: if this parameter is set to any value greater than 0 and the axis is out of a commanded target for at least the specified distance an automatic repositioning is triggered.

fSoftEndMax: The upper (positive) Software endswitch.

fSoftEndMin: The lower (negative) Software endswitch.

fStartAccDistance: obsolete, will be removed.

fStartRamp: The time that is used by a iTcMc_ProfileTimeRamp setpoint generator when accelerating to fRefVelo.

fStopRamp: The time that is used when decelerating from fRefVelo. This parameter is used by a iTcMc_ProfileTimeRamp setpoint generator for the targeting operation. Some other generator types are using this setting value for unsheduled stop operations (removed control enable, fault conditions, function block calls).

fTargetClamping: If this setting value is greater than 0 it will be written to the output device at the end of an travel with the matching polarity. There will be no lag control loop in this case.

fValve_BendPointOutput: For valves with a bendpoint this parameter can be used to create a simple linearisation.

fValve_BendPointVelo: For valves with a bendpoint this parameter can be used to create a simple linearisation.

fValve_OverlapComp: Up to V3.0.7: Compensation of a nondirectional valve overlap.

fValve_OverlapCompM: Starting withV3.0.8: This parameter is used for a negative valve overlap compensation if bAsymetricalTargeting = TRUE.

fValve_OverlapCompP: Starting withV3.0.8: Compensation of a nondirectional or (if bAsymetricalTargeting = TRUE) positive valve overlap.

fValve_ResponseTime: This parameter can be used for a valve deadtime compensation.

fVeloAmp: Under construction: The proportional amplification factor of a nested velocity lag control loop.

fVeloAmpDx: Under construction: The threshold of a nested velocity lag control loop.

fVeloAmpTi: Under construction: The integration time constant of a nested velocity lag control loop.

fVeloAmpOutL: Under construction: The output limit of a nested velocity lag control loop.

fVeloAmpWuL: Under construction: The limit for the integrating part of a nested velocity lag control loop.

fZeroCompensation: An analog offset voltage on the velocity output can be compensated here.

nCycleDivider: reserviert.

nDrive_Type: The drive type in use.

nEnc_Type: The encoder type in use.

nEnc_HomingType: In case a MC_Home_BkPlcMc() block is called using MC_DefaultHomingMode_BkPlcMc as HomingMode the methode defined by this parameter will be applied.

nEnc_ZeroSwap: reserved.

nJerkEnabled: This bit mask parameter defines the profile transitions that have to be applied jerk limiting. The parameter is effective for profile type iTcMc_ProfileJerkBased only.

nProfileType: The profile generator type in use.

sParamFileName: This file name is used for storing the axis parameters as a DAT file.

Notes on setting up an axis can be found under Setup.


TcPlcLibHydraulics: PLCopen Motion Control: Data types: ST_TcHydAxRtData

TYPE ST_TcHydAxRtData (starting with V3.0)

The variables in this structure are detailing the runtime state of the axis.

Note: The parameter order in the structure may be changed without notice.

TYPE ST_TcHydAxRtData :
(* last modification: 04.01.2011 *)
STRUCT
        (*-------------------------------*)
        fActForce:              LREAL := 0.0;
        fActiveOverlap:         LREAL := 0.0;
        fActPos:                        LREAL := 0.0;
        fActPressure:           LREAL := 0.0;
        fActPressureA:          LREAL := 0.0;
        fActPressureB:          LREAL := 0.0;
        fActVelo:               LREAL := 0.0;
        fBrakeOffTimer:         LREAL := 0.0;
        fBrakeOnTimer:          LREAL := 0.0;
        fBrakeSafetyTimer:      LREAL := 0.0;
        fClampingOutput:                LREAL := 0.0;
        fDestAcc:               LREAL := 0.0;
        fDestCreepDistance:     LREAL := 0.0;   (* up to V3.0.7 *)
        fDestCreepSpeed:                LREAL := 0.0;   (* up to V3.0.7 *)
        fDestCreepDistanceM:    LREAL := 0.0;   (* starting with V3.0.8 *)
        fDestCreepDistanceP:    LREAL := 0.0;   (* starting with V3.0.8 *)
        fDestCreepSpeedM:               LREAL := 0.0;   (* starting with V3.0.8 *)
        fDestCreepSpeedP:               LREAL := 0.0;   (* starting with V3.0.8 *)
        fDestDec:               LREAL := 0.0;
        fDestJerk:              LREAL := 0.0;
        fDestPos:               LREAL := 0.0;
        fDestRampEnd:           LREAL := 0.0;
        fDestSpeed:             LREAL := 0.0;
        fDistanceToTarget:      LREAL := 0.0;
        fEnc_RefShift:          LREAL := 0.0;
        fEnc_ZeroSwap:          LREAL := 0.0;
        fGearActive:            LREAL := 0.0;
        fGearSetting:           LREAL := 0.0;
        fLagCtrlOutput:         LREAL := 0.0;
        fLatchedPos:            LREAL := 0.0;
        fOilRequirred_A:                LREAL := 0.0;   (* starting with V3.0.33 *)
        fOilRequirred_B:                LREAL := 0.0;   (* starting with V3.0.33 *)
        fOilUsed_A:             LREAL := 0.0;   (* starting with V3.0.33 *)
        fOilUsed_B:             LREAL := 0.0;   (* starting with V3.0.33 *)
        fOutput:                        LREAL := 0.0;
        fOverride:              LREAL := 1.0;
        fParamAccTime:          LREAL := 0.0;
        fPosError:              LREAL:=0.0;
        fSetAcc:                        LREAL := 0.0;
        fSetPos:                        LREAL := 0.0;
        fSetPressure:           LREAL := 0.0;
        fSetSpeed:              LREAL := 0.0;
        fSetSpeedOld:           LREAL := 0.0;
        fSetVelo:               LREAL := 0.0;
        fStartPos:              LREAL := 0.0;
        fStartRamp:             LREAL := 0.0;
        fStartRampAnchor:               LREAL := 0.0;
        fSupplyPressure:                LREAL := 0.0;
        fTargetPos:             LREAL := 0.0;
        fTimerPEH:              LREAL := 0.0;
        fTimerTPM:              LREAL := 0.0;
        fValvePressure:         LREAL := 0.0;
        fVeloError:             LREAL := 0.0;
        (*-------------------------------*)
        nAxisState:             DWORD := 0;
        nCalibrationState:      DWORD := 0;
        nDeCtrlDWord:           DWORD := 0;
        nErrorCode:             DWORD := 0;
        nStateDWord:            DWORD := 0;
        (*-------------------------------*)
        iCurrentStep:           E_TcMcCurrentStep;
        (*-------------------------------*)
        bActPosCams:            BYTE := 0;
        bBrakeOff:              BOOL := FALSE;
        bBrakeOffInverted:      BOOL := FALSE;
        bControllable:          BOOL := FALSE;
        bCountedCycles:         BYTE := 1;
        bCycleCounter:          BYTE := 0;
        bDriveResponse:         BOOL := FALSE;
        bEncDoLatch:            BOOL := FALSE;
        bEncoderResponse:               BOOL := FALSE;
        bEncLatchValid:         BOOL := FALSE;
        bLocked_Estop:          BOOL := FALSE;
        bParamsUnsave:          BOOL := FALSE;
        bReloadParams:          BOOL := FALSE;
        bTargeting:             BOOL := FALSE;
        (*-------------------------------*)
        pMasterRtData:          DWORD := 0;
        pMasterParam:           DWORD := 0;
        (*-------------------------------*)
        udiSercDeviceID:                UDINT := 0;
        uiSercBoxAddr:          UINT := 0;
        uiSercPort:             UINT := 0;
        (*-------------------------------*)
        stPosCtrlr:             stbkplcinternal_cplxctrl;
        stVeloCtrlr:            stbkplcinternal_cplxctrl;
        (*-------------------------------*)
        sTopBlockName:          STRING := '';
        (*-------------------------------*)
        bDriveStartup:          BOOL := FALSE;
        bEncAlignRefShift:      BOOL := FALSE;  (* starting with V3.0.32 *)
        bDrvWcsError:           BOOL := FALSE;
        bEncWcsError:           BOOL := FALSE;
        bFirstWcs:              BOOL := FALSE;
        bReserve:               ARRAY [6..8] OF BOOL := FALSE;
        nReserve:               ARRAY [1..8] OF DWORD := 0;
        nDrvWcCount:            INT:=0;
        nEncWcCount:            INT:=0;
        nDrvDeviceState:                INT:=0;
        nEncDeviceState:                INT:=0;
        fActPosDelta:           LREAL;
        fReserve:               ARRAY [2..10] OF LREAL := 0.0;
        (*-------------------------------*)
END_STRUCT
END_TYPE

bBrakeOff: The control signal for an external brake device. An output signal from the profile generators.

bBrakeOffInverted: The inverted bBrakeOff signal.

bEncAlignRefShift: reserved.

bEncDoLatch: This signal is used in the communication between MC_Home_BkPlcMc and MC_AxRtEncoder_BkPlcMc blocks during a homing operation.

bEncLatchValid: This signal is used in the communication between MC_Home_BkPlcMc and MC_AxRtEncoder_BkPlcMc blocks during a homing operation.

bLocked_Estop: A TRUE here will lock the profile generator in the iTcHydStateEmergencyBreak / McState_Errorstop state even when the output to the drive has fallen to 0. Is used by MC_EmergencyStop_BkPlcMc and MC_ImediateStop_BkPlcMc blocks.

bParamsUnsave: The MC_WriteParameter_BkPlcMc and MC_WriteBoolParameter_BkPlcMc block will set this flag if they are changing a parameter setting. An MC_AxParamSave_BkPlcMc block will clear this flag after successfully saving the parameters. In the Online Mode of the PlcMcManager this flag is used for the status line.

fActForce: The actual force of the cylinder. This value is usually determined by a read out block for force or pressure.

fActiveOverlap: The output of the overlap compensation. An output signal from the profile generators.

fActPos: The actual position of the axis. Usually this value is determined and defined by an encoder block.

bActPosCams: The actual position camm information of the axis. This value is in use only for encoder type iTcMc_EncoderDigCam.

fActPressure: The actual pressure of the cylinder. This value is usually determined by a read out block for force or pressure.

fActPressureA: The actual pressure of the cylinder A side. This value is usually determined by a read out block for force or pressure.

fActPressureB: The actual pressure of the cylinder B side. This value is usually determined by a read out block for force or pressure.

fActVelo: The actual velocity of the axis. Usually this value is determined and defined by an encoder block.

nAxisState: The motion state of the axis.

fClampingOutput: An output signal from the profile generators.

fDestAcc: The acceleration requested by the active or the last executed command.

fDestCreepDistance: Up to V3.0.7: the creep distance.

fDestCreepSpeed: Up to V3.0.7: the creep speed.

fDestCreepDistanceP: Starting with V3.0.7: the creep distance in positive direction.

fDestCreepSpeedP: Starting with V3.0.7: the creep speed in positive direction.

fDestCreepDistanceM: Starting with V3.0.7: the creep distance in negative direction.

fDestCreepSpeedM: Starting with V3.0.7: the creep speed in negative direction.

fDestDec: The deceleration requested by the active or the last executed command.

fDestJerk: The jerk requested by the active or the last executed command.

fDestPos: The currently active target position.

fDestSpeed: The velocity requested by the active or the last executed command.

fDistanceToTarget: The actual remaining travel of the axis. Usually this value is determined and defined by a generator block.

fEnc_RefShift: The offset between the scalled (optionally extended) counter of an incremental encoder terminal and the actual position of the axis. This offset is determined by a MC_Home_BkPlcMc block during a homing operation or manipulated by using a MC_SetPosition_BkPlcMc block.

fLatchedPos: The position where a homing did take place or the components of the position read out equipment (encoder, IO hardware) have been energised. Any active offsets are applied.

fLagCtrlOutput: The output of the lag controller. An output signal from the profile generators.

fOilRequirred_A: The requirred oil quantity on the A side of the cylinder calculated by using the commanded velocity.

fOilRequirred_B: The requirred oil quantity on the B side of the cylinder calculated by using the commanded velocity.

fOilUsed_A: The requirred oil quantity on the A side of the cylinder calculated by using the actual velocity.

fOilUsed_B: The requirred oil quantity on the B side of the cylinder calculated by using the actual velocity.

fOutput: The control signal that has to be writen to the drive. This signal is used in the communication between MC_AxRtFinish_BkPlcMc and MC_AxRtDrive_BkPlcMc blocks.

fOverride: The active velocity override of the axis.

fPosError: The actual position lag error.

fSetPos: The actual position setpoint.

fSetSpeed: The actual normalised velocity setpoint.

fSetAcc: The acceleration setpoint. An output signal from the profile generators.

fSetPressure: The setpoint of a pressure or force control block has to be supplied here.

fStartPos: The starting point of the active or the last executed command.

fSupplyPressure: Supply pressure. Usually this variable is updated by using a block for force or pressure read back.

fTargetPos: The target position of the active or the last executed command.

fValvePressure: The actual pressure drop over the valve. This value is usually determined by a read out block for force or pressure.

iCurrentStep: The internal motion state of the axis. Values from E_TcMcCurrentStep only.

nCalibrationState: The current state of a homing operation.

nDeCtrlDWord: The control signals of the axis.

nErrorCode: The actual error code of the axis.

nStateDWord: The status signals of the axis.

sTopBlockName: The name of the block that has been called directly by the application. All messages triggered by the block will report this block name as its source. This is true even for function blocks called by this block.

All other elements are reserved for internal use. They are not guaranteed and are not intended to be used or modified by the application.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: ST_TcMcAuxDataLabels

TYPE ST_TcMcAuxDataLabels (starting with V3.0)

This structure is containing text labels for the customer specific parameters of the axis. A structure of this type can be made a component of an axis by supplying a pointer to the MC_AxUtiStandardInit_BkPlcMcblock of the axis that will connect it by placing the pointer in the Axis_Ref_BkPlcMc structureof the axis.

TYPE ST_TcMcAuxDataLabels:
STRUCT
        stLabel:                ARRAY [1..20] OF STRING(20);
END_STRUCT
END_TYPE

stLabel: The text labels.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: ST_TcPlcDeviceInput

TYPE ST_TcPlcDeviceInput (starting with V3.0)

The variables in this structure are used to interface the input data of an external device.

TYPE ST_TcPlcDeviceInput :
STRUCT
        uiCount:                UINT:=0;
        uiLatch:                UINT:=0;
        usiStatus:      USINT:=0;

        uiPZDL_RegDaten:        UINT:=0;
        uiPZDH:         UINT:=0;
        usiRegStatus:   USINT:=0;

        udiCount:               UDINT:=0;
        uiStatus:               UINT:=0;

        bTerminalState: BYTE:=0;
        uiTerminalData: WORD:=0;
        uiTerminalState2:       WORD:=0;

        bDigInA:                BOOL:=FALSE;
        bDigInB:                BOOL:=FALSE;

        bDigCamMM:      BOOL:=FALSE;
        bDigCamM:               BOOL:=FALSE;
        bDigCamP:               BOOL:=FALSE;
        bDigCamPP:      BOOL:=FALSE;

        DriveError:     UDINT:=0;
        ActualPos:      ARRAY [0..1] OF UINT:=0;
        DriveState:     ARRAY [0..3] OF BYTE:=0;

        S_iReserve:     INT:=0;
        S_DiReserve:    ARRAY [1..9] OF DINT:=0;

        CiA_Reserve:    ARRAY [1..8] OF UINT:=0;

        bPowerOk:               BOOL:=FALSE;
        bEnAck:         BOOL:=FALSE;

        wDriveDevState: WORD:=0;
        wDriveWcState:  BYTE:=0;
        wEncDevState:   WORD:=0;
        wEncWcState:    BYTE:=0;
        uiDriveBoxState:        UINT:=0;
        uiEncBoxState:  UINT:=0;

        sEncAdsAddr:    ST_TcPlcAdsAddr;
        nEncAdsChannel: BYTE := 0;
        sDrvAdsAddr:    ST_TcPlcAdsAddr;
        nDrvAdsChannel: BYTE := 0;

        nReserve:               ARRAY [1..20] OF BYTE;
END_STRUCT
END_TYPE

uiCount: Used for actual position read back. In use for types iTcMc_EncoderEL3102, iTcMc_EncoderEL3142, iTcMc_EncoderEL5101, iTcMc_EncoderKL2521, iTcMc_EncoderKL2531, iTcMc_EncoderKL2541, iTcMc_EncoderKL3002, iTcMc_EncoderKL3042, iTcMc_EncoderKL3062, iTcMc_EncoderKL3162, iTcMc_EncoderKL5101, iTcMc_EncoderKL5111, iTcMc_EncoderM2510, iTcMc_EncoderM3120, iTcMc_DriveKL2531, iTcMc_DriveKL2541.

uiLatch: Used for position latch read back. In use for types iTcMc_EncoderEL5101, iTcMc_EncoderKL5101, iTcMc_EncoderKL5111.

usiStatus: Used for device status information. In use for types iTcMc_EncoderEL5101, iTcMc_EncoderKL3002, iTcMc_EncoderKL3042, iTcMc_EncoderKL3062, iTcMc_EncoderKL3162, iTcMc_EncoderKL5101, iTcMc_EncoderKL5111, iTcMc_EncoderM3120.

uiPZDL_RegDaten: Used for actual position read back and parameter communication. In use for types iTcMc_EncoderKL5001.

uiPZDH: Used for actual position read back. In use for types iTcMc_EncoderKL5001.

usiRegStatus: Used for device status information. In use for types iTcMc_EncoderEL5001, iTcMc_EncoderKL5001.

udiCount: Used for actual position read back. In use for types iTcMc_EncoderEL5001.

uiStatus: Used for device status information. In use for types iTcMc_EncoderAx2000_B110, iTcMc_DriveAx2000_B110.

bTerminalState: Used for parameter communication. In use for types iTcMc_EncoderKL2521, iTcMc_EncoderKL2531, iTcMc_EncoderKL2541, iTcMc_DriveEL4132, iTcMc_DriveKL2521, iTcMc_DriveKL2531, iTcMc_DriveKL2541, iTcMc_DriveKL4032.

uiTerminalData: reserved.

uiTerminalState2: Used for position latch read back. In use for types iTcMc_EncoderKL2541.

bDigInA: Used for actual position read back. In use for types iTcMc_EncoderDigIncrement.

bDigInB: Used for actual position read back. In use for types iTcMc_EncoderDigIncrement.

bDigCamMM: Used for actual position read back. In use for types iTcMc_EncoderDigCam.

bDigCamM: Used for actual position read back. In use for types iTcMc_EncoderDigCam.

bDigCamP: Used for actual position read back. In use for types iTcMc_EncoderDigCam.

bDigCamPP: Used for actual position read back. In use for types iTcMc_EncoderDigCam.

DriveError: Used for device status information. In use for types iTcMc_EncoderAx2000_B200, iTcMc_EncoderAx2000_B900.

ActualPos: Used for actual position read back. In use for types iTcMc_EncoderAx2000_B110, iTcMc_EncoderAx2000_B200, iTcMc_EncoderAx2000_B900.

DriveState: Used for device status information. In use for types iTcMc_EncoderAx2000_B200, iTcMc_EncoderAx2000_B900.

S_iReserve: reserved.

S_DiReserve: reserved.

CiA_Reserve: reserved.

bPowerOk: Optionaly used for monitoring the line power switch. In use for types iTcMc_DriveAx2000_B110, iTcMc_EncoderAx2000_B200, iTcMc_EncoderAx2000_B900.

bEnAck: reserved.

wDriveDevState: reserved.

wDriveWcState: Used for connection monitoring for the drive unit. In use for types iTcMc_EncoderAx2000_B110, iTcMc_DriveAx2000_B110.

wEncDevState: reserved.

wEncWcState: Used for connection monitoring for the actual position. In use for types iTcMc_EncoderAx2000_B110, iTcMc_DriveAx2000_B110, iTcMc_EncoderEL3102, iTcMc_EncoderEL3142, iTcMc_EncoderEL5001, iTcMc_EncoderEL5101.

uiDriveBoxState: Used for connection monitoring for the drive unit. In use for types iTcMc_DriveAx2000_B200, iTcMc_DriveAx2000_B900.

uiEncBoxState: Used for connection monitoring for the drive unit. In use for types iTcMc_EncoderAx2000_B200, iTcMc_EncoderAx2000_B900.

sEncAdsAddr: Used for parameter communication. In use for types iTcMc_EncoderAx2000_B110, iTcMc_DriveAx2000_B110, iTcMc_EncoderEL3102, iTcMc_EncoderEL3142, iTcMc_EncoderEL5001, iTcMc_EncoderEL5101.

nEncAdsChannel: Used for parameter communication. In use for types iTcMc_EncoderAx2000_B110, iTcMc_DriveAx2000_B110.

sDrvAdsAddr: Used for parameter communication. In use for types iTcMc_EncoderAx2000_B110, iTcMc_DriveAx2000_B110.

nDrvAdsChannel: Used for parameter communication. In use for types iTcMc_EncoderAx2000_B110, iTcMc_DriveAx2000_B110.

nReserve: reserved.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: ST_TcPlcMcDriveIn

TYPE ST_TcPlcDeviceOutput (starting with V3.0)

The variables in this structure are used to interface the output data of an external device.

TYPE ST_TcPlcDeviceOutput :
STRUCT
        nDacOut:                INT:=0;
        bDigOutAp:      BOOL:=FALSE;
        bDigOutAn:      BOOL:=FALSE;
        bDigOutBp:      BOOL:=FALSE;
        bDigOutBn:      BOOL:=FALSE;
        uiCount:                UINT:=0;
        uiDacOutA:      UINT:=0;
        uiDacOutB:      UINT:=0;
        bMovePos:               BOOL:=FALSE;
        bMoveNeg:               BOOL:=FALSE;
        bBrakeOff:      BOOL:=FALSE;
        bBrakeOffInverted:      BOOL:=FALSE;
        DriveCtrl:      ARRAY [0..3] OF BYTE:=0;
        NominalVelo:    DINT:=0;
        uiDriveCtrl:    UINT:=0;
        S_iReserve:     ARRAY [1..2] OF INT:=0;
        S_DiReserve:    ARRAY [1..7] OF DINT:=0;
        CiA_Reserve:    ARRAY [1..7] OF UINT:=0;
        bPowerOn:               BOOL:=FALSE;
        bEnable:                BOOL:=FALSE;
        bEnablePos:     BOOL:=FALSE;
        bEnableNeg:     BOOL:=FALSE;
        nResetState:    BYTE:=0;
        usiCtrl:                USINT:=0;
        uiTerminalData: WORD:=0;
        bTerminalCtrl:  BYTE:=0;
        uiTerminalCtrl2:        WORD:=0;
        nReserve:               ARRAY [1..20] OF BYTE;
END_STRUCT
END_TYPE

nDacOut: Used for velocity setpoint or parameter communication. In use for types iTcMc_EncoderKL2531, iTcMc_EncoderKL2541, iTcMc_DriveEL4132, iTcMc_DriveKL2521, iTcMc_DriveKL2531, iTcMc_DriveKL2541, iTcMc_DriveKL4032, iTcMc_DriveM2400_Dn.

bDigOutAp: Used for current control signals. In use for types iTcMc_DriveLowCostStepper.

bDigOutAn: Used for current control signals. In use for types iTcMc_DriveLowCostStepper.

bDigOutBp: Used for current control signals. In use for types iTcMc_DriveLowCostStepper.

bDigOutBn: Used for current control signals. In use for types iTcMc_DriveLowCostStepper.

uiCount: reserved.

uiDacOutA: Used for velocity setpoint. In use for types iTcMc_EncoderIx2512_1Coil, iTcMc_EncoderIx2512_2Coil.

uiDacOutB: Used for velocity setpoint. In use for types iTcMc_EncoderIx2512_2Coil.

bMovePos: reserved.

bMoveNeg: reserved.

bBrakeOff: reserved.

bBrakeOffInverted: reserved.

DriveCtrl: Used for device control signals. In use for types iTcMc_EncoderAx2000_B200, iTcMc_DriveAx2000_B200, iTcMc_EncoderAx2000_B900, iTcMc_DriveAx2000_B900.

NominalVelo: Used for velocity setpoint. In use for types iTcMc_DriveAx2000_B110, iTcMc_EncoderAx2000_B200, iTcMc_EncoderAx2000_B900.

uiDriveCtrl: Used for device control signals. In use for types iTcMc_EncoderAx2000_B110, iTcMc_DriveAx2000_B110.

S_iReserve: reserved.

S_DiReserve: reserved.

CiA_Reserve: reserved.

S_0_0036: reserved.

S_0_0047: reserved.

S_0_0080: reserved.

S_0_0134: reserved.

S_Reserve: reserved.

CiA_6040: reserved.

CiA_6300: reserved.

CiA_Reserve: reserved.

bPowerOn: Optionaly used for controlling the line power switch. In use for types iTcMc_DriveAx2000_B110, iTcMc_EncoderAx2000_B200, iTcMc_EncoderAx2000_B900.

bEnable: reserved.

bEnablePos: reserved.

bEnableNeg: reserved.

nResetState: reserved.

usiCtrl: Used for device control signals or parameter communication. In use for types iTcMc_EncoderEL5101, iTcMc_EncoderKL3002, iTcMc_EncoderKL3042, iTcMc_EncoderKL3062, iTcMc_EncoderKL3162, iTcMc_EncoderKL5101, iTcMc_EncoderKL5111, iTcMc_EncoderM3120.

uiTerminalData: Used for parameter communication. In use for types iTcMc_EncoderKL2521, iTcMc_EncoderKL5001, iTcMc_EncoderKL5101, iTcMc_EncoderKL5111, iTcMc_DriveEL4132, iTcMc_DriveKL2521, iTcMc_DriveKL4032.

bTerminalCtrl: Used for parameter communication. In use for types iTcMc_EncoderKL2521, iTcMc_EncoderKL2531, iTcMc_EncoderKL2541, iTcMc_DriveEL4132, iTcMc_DriveKL2521, iTcMc_DriveKL2531, iTcMc_DriveKL2541, iTcMc_DriveKL4032.

uiTerminalCtrl2: Used for device specific control signals. In use for types iTcMc_EncoderKL2541, iTcMc_DriveKL2531, iTcMc_DriveKL2541.

nReserve: reserved.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: ST_TcPlcMcLogBuffer

TYPE ST_TcPlcMcLogBuffer (starting with V3.0)

A variable of this structured type is used to hold the message logging buffer of the library. More information about creating a logging buffer can be found at FAQ #10 of the Knowledge Base.

Warning : Data in this structure must not be modified by the application.

TYPE ST_TcMcLogBuffer:
STRUCT
        ReadIdx:                INT:=0;
        WriteIdx:               INT:=0;
        MessageArr:     ARRAY [0..19] OF ST_TcPlcMcLogEntry;
END_STRUCT
END_TYPE

ReadIdx: The write index of the buffer.

WriteIdx: The read index of the buffer.

MessageArr: The current stored set of messages.


TcPlcHydraulics: PLCopen Motion Control: Datentypen: ST_TcPlcMcLogEntry

TYPE ST_TcPlcMcLogEntry (starting with V3.0)

A variable of this structured type holds one message in the message logging buffer of the library. It is used in ST_TcPlcMcLogBuffer. More information about creating a logging buffer can be found at FAQ #10 of the Knowledge Base.

Warning : Data in this structure must not be modified by the application.

TYPE ST_TcPlcMcLogEntry:
STRUCT
        TimeLow:                UDINT:=0;
        TimeHigh:               UDINT:=0;
        LogLevel:               DWORD:=0;
        Source:         DWORD:=0;
        Message:                STRING(255);
        ArgType:                INT:=0;
        diArg:          DINT:=0;
        lrArg:          LREAL:=0;
        sArg:           STRING(255);
END_STRUCT
END_TYPE

TimeLow, TimeHigh: The timestamp of the message. The creation time of the message is recorded here.

LogLevel: The level of importance of the message. A set of acceptable values is defined by the library.

Source: A coded information about the source of the message. A set of acceptable values is defined by the library.

Message: The message text, optionally containing variable format specifiers.

ArgType: The type of the optional variable part of the message.

diArg: If there is a variable message part of type DINT the value is stored here.

lrArg: If there is a variable message part of type LREAL the value is stored here.

sArg: If there is a variable message part of type STRING the value is stored here.


TcPlcHydraulics: PLCopen Motion Control: Data types: ST_TcPlcRegDataItem

TYPE ST_TcPlcRegDataItem (starting with V3.0.7)

A variable of this type contains an element of a parameter set for a KL terminal. An ARRAY of elements of this type is used vor creating the type ST_TcPlcRegDataTable.

TYPE ST_TcPlcRegDataItem :
STRUCT
        Access:         INT:=0;
        Select:         INT:=-1;
        RegData:                WORD:=0;
END_STRUCT
END_TYPE

Access: The type of operation to be performed. Details can be found at MC_AxUtiUpdateRegDriveTerm_BkPlcMc and MC_AxUtiUpdateRegEncTerm_BkPlcMc.

Select: The register address within the terminal.

RegData: The parameter value that has to be used for the operation.


TcPlcHydraulics: PLCopen Motion Control: Data types: ST_TcPlcRegDataTable

TYPE ST_TcPlcRegDataTable (starting with V3.0.7)

A variable of this type contains a parameter set for a KL terminal. Variables of this type are handled by MC_AxUtiUpdateRegDriveTerm_BkPlcMc and MC_AxUtiUpdateRegEncTerm_BkPlcMc blocks.

TYPE ST_TcPlcRegDataTable :
STRUCT
        RegDataItem:    ARRAY [1..64] OF ST_TcPlcRegDataItem;
END_STRUCT
END_TYPE


TcPlcHydraulics: PLCopen Motion Control: Data types: TRACK_REF_BkPlcMc

TYPE TRACK_REF_BkPlcMc (starting with V3.0)

TYPE TRACK_REF_BkPlcMc :
STRUCT
        Track:          ARRAY [ciBkPlcMc_TrackRef_MinIdx..ciBkPlcMc_TrackRef_MaxIdx] OF TRACK_REFTYPE_BkPlcMc;
END_STRUCT
END_TYPE

TYPE TRACK_REFTYPE_BkPlcMc:
STRUCT
        OnCompensation: LREAL;
        OffCompensation:        LREAL;
        Hysteresis:     LREAL;
END_STRUCT
END_TYPE

OnCompensation: The dead time in seconds that has to be compensated on the rising edge of the output signal.

OffCompensation: The dead time in seconds that has to be compensated on the falling edge of the output signal.

Hysteresis: Distance from the switching point (in positive and negative direction) in which the switch is not executed until the axis has left this area, in order to avoid multiple switching around the switching point.

A positive value for the dead time compensation will cause a delayed signaling. For a negative value the signaling will be done in advance.

Hint: The given time cannot be maintained accurately if rate of change of the controlling value is varying. If the controlling value is the actual position of an axis the actual velocity has to be constant.


TcPlcHydraulics: PLCopen Motion Control: System: Controller: MC_AxCtrlAutoZero_BkPlcMc

FUNCTION_BLOCK MC_AxCtrlAutoZero_BkPlcMc (starting with V3.0)

The function block is performing an automatic offset adjustment.

VAR_INPUT
        Enable:         BOOL:=FALSE;
        EnableOnMoving: BOOL:=FALSE;
        OffsetLimit:    LREAL:=0.0;
        Tn:             LREAL:=0.0;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
        Active:         BOOL;
        Limiting:               BOOL;
END_VAR

Enable: This input controls the activity of the controller.

EnableOnMoving: This input controls the activity of the controller.

OffsetLimit: The value of fZeroCompensation will be limited to this range.

Tn: The integrating time constant of the controller.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded error message is provided here.

Active: The activity of the adjustment process on fZeroCompensation in ST_TcHydAxParam is signaled here.

Limiting: The limiting of fZeroCompensation in ST_TcHydAxParam is signaled here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

As long as Enable is set to FALSE the block will be inactive. Is Enable set to TRUE the block is deciding to be active or inactive itself. For an axis in iTcHydStateIdle state the values of fPosError and fActVelo are tested. If EnableOnMoving is set to TRUE too the block will be active, if the axis is in an active and functional state too, if the values of fSetSpeed and fActVelo enable this decision.

In the active state the value of fZeroCompensation in ST_TcHydAxParam is adjusted to make sure the axis is moving in the right direction anyhow. For a permanent high error Tn is defining the time to arrive at maximum control value. In the inactive state Error and Active are set to FALSE, ErrorID is 0 and the block is not updating ST_TcHydAxParam.fZeroCompensation.

Note: The limiting action to the range defined by OffsetLimit is active even if the block is inactive. The Output Limiting is updated.

Note: The values of OffsetLimit and fZeroCompensation are regarded to be offset voltages. So the value 10.0 is the maximum control value. Depending on the application this parameter should be in the range of 0.1 to 1.

Integrating the block into the applikation

In the calling sequence of the blocks for an axis the MC_AxCtrlAutoZero_BkPlcMc is to be placed directly before the MC_AxRtFinish_BkPlcMc block. For projects replacing the single blocks by an MC_AxStandardBody_BkPlcMc block the MC_AxCtrlAutoZero_BkPlcMc has to be called before this block.

Attention : If there are situation during the operation of the axis where the control enable of the axis is HIGH, but the axis is not showing normal movement the MC_AxCtrlAutoZero_BkPlcMc block has to be disabled. This may be caused by a blockage with or without changeover into pressure control or a reduction or shut down of the energy supply. If this is not handled correct the value of fZeroCompensation in ST_TcHydAxParam will rise to the limitation with a randomly choosen sign. When the axis becomes functional later a potentionally dangerous action of the axis is to be expected. After this the positioning performance of the axis will be poor. If the axes is operated without EnableOnMoving the disadjusted offset may be not readjusted automatically. The axis will stop outside the target range and may be it will never signal the command as done.

Note: In combination with an MC_AxStandardBody_BkPlcMc block all reactions of the MC_AxCtrlAutoZero_BkPlcMc block will be delayed for one PLC cycle. Usually this is not a problem. If this delay is causing trouble the basic blocks for encoder etc. have to be used and the MC_AxCtrlAutoZero_BkPlcMc block has to be called right before the MC_AxRtFinish_BkPlcMc block.


TcPlcHydraulics: PLCopen Motion Control: System: Controller: MC_AxCtrlPressure_BkPlcMc

FUNCTION_BLOCK MC_AxCtrlPressure_BkPlcMc (starting with V3.0)

The function block is closing a pressure control loop on the axis to maintain the requested value in an actual value selected by ReadingMode.

Note: In most cases the read back of the actual pressure can be done by using blocks of type MC_AxRtReadPressureSingle_BkPlcMc or MC_AxRtReadPressureDiff_BkPlcMc.

VAR_INPUT
        Enable:         BOOL:=FALSE;
        Reset:          BOOL:=TRUE;
        FirstAuxParamIdx:       INT:=0;
        kP:             LREAL:=0.0;
        Tn:             LREAL:=0.0;
        ReadingMode:    E_TcMcPressureReadingMode:=iTcHydPressureReadingDefault;
        PreSet:         LREAL:=0.0;
        WindupLimit:    LREAL:=0.0;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
        InWindup:       BOOL;
END_VAR

Enable: This input controls the activity of the controller.

Reset: This input controls the activity of the controller and will clear the integrating part of the controller.

FirstAuxParamIdx: This parameter can activate a range of Axis_Ref_BkPlcMc.ST_TcHydAxParam.fCustomerData as parameter interface.

kP: The proportional gain factor of the controller.

Tn: The integrating time constant of the controller.

ReadingMode: The actual value that has to be adapted to the setpoint is selected here. The default is Axis_Ref_BkPlcMc.ST_TcHydAxParam.fActPressure ausgewählt.

PreSet: The integrating part of the controller is precharged to this value on change into the active state.

WindupLimit: The response of the integrating part of the controller is limited to this value. This type of limiting is used to keep a control loop from creating excessive output responses in situations where the axis is not responding to the controll.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded error message is provided here.

InWindup: This output signals that the integrating part of the control has reached WindupLimit.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

A TRUE on Reset input will force the block into idle state without taking care for other control signals. In this state the proportional and the integrating part are cleared. If Reset is FALSE Enable is controling the change into an active state.

The input ReadingMode selects the variable in the stAxRtData structure that holds the value to be controlled.

  • iTcHydPressureReadingDefault, iTcHydPressureReadingActPressure: fActPressure is controlled.
  • iTcHydPressureReadingActForce: fActForce is controlled.
  • all other settings will deactivate the controller.

Note: The setpoint has to be supplied in fSetPressure in the stAxRtData structure of the axis.

The block checks for state changes into or out of the active state by monitoring the Enable input. On a rising edge the integrating functionality is precharged to PreSet. If the output value matching ST_TcHydAxRtData.fSetPressure is known this information can be used to shortcut the settling time of the control loop. In the active state the controller is using kP and Tn to calculate a proportional and integrating response. The total of these partial responses is stored as setpoint in ST_TcHydAxRtData.fSetSpeed. Because this controller is taking over the task of a setpoint generator it is clearing ST_TcHydAxRtData.fLagCtrlOutput. The MC_AxRtFinish_BkPlcMc block placed behind the pressure controller is taking this response into account automatically.

The state change into the idle state clears the responses of the controller.

Integrating the block into the applikation

A block of this type has to be placed behind the blocks for reading the actual position and pressure information. It is taking over full control of the axis and replaces a setpoint generator if present.

Note: If there is a setpoint generator as well as a MC_AxCtrlPressure_BkPlcMc block these blocks have to be called alternatively or the MC_AxCtrlPressure_BkPlcMc block has to be called last to enable it to overwrite the setpoint generators output.

Note: By supplying a value grater than zero for FirstAuxParamIdx the block can be commanded to use three adjacend values from fCustomerData in the parameter structure as Tn, kP and PreSet. If there is an address of an ARRAY[..] OF STRING() supplied as Axis.pStAxAuxLabels the parameters are labeled automatically.

Note: There is a code example #15 available.

Setup

The four parameters kP, Tn, PreSet and WindupLimit enable the adaptation of the controller to a range of different tasks.

Attention : During the setup procedure the axis can be applied full system pressure or the pressure may show damped or undamped oscillation in a wide frequency range. If this can cause damage to the axis or its environment use adequate precautions. Be sure to have measures to deactivate the controller, anyway.

At the start Tn and Preset should be set to 0.0 and WindupLimit should be set to 1.0. The controller is now a pure proportional controller. After going to a block position and activation of the controller (Enable:=TRUE, Reset:=FALSE, SetPressure:=setpoint) the maximum applicable value for kP can be found. This is done by increasing the parameter stepwise until the loop becomes instable. Please check the loop stability by activating and deactivating the controller. In prectical work the value will be in the range of 0.1 to 0.5.

The next parameter to setup is Tn. Start of by applying a reasonable big value like 0.5. Now the actual pressure should adapt to the setpoint very slowly. By stepwise reducing the minimum setting can be found. Please check the loop stability by activating and deactivating the controller, again. If the axis starts tending to oscillate in a damped way on activation of the controller the Tn setting is to small.

The setting of WindupLimit is biasing the controller behaviour in an indirect way. This parameter is rather used for affecting the changeover performance. If the controller can build up pressure imediately because the axis doesn not need to move the value of WindupLimit should be set to a value that keeps the integrating response from going beyond about three to four times the value the valve needs in respect to its characteristics. This will short cut the time for settling of the control loop reasonably. If the axis has to travel a reasonable distance a small value will dominate the move of the axis. If the value is small the axis may approach very slowly or even fail at all. On the other hand a high value for WindupLimit may make the axis approach with high speed and cause a steep rise of the actual pressure. The peek pressure can show excessive values.

Note: If possible the pressure controller should not be activated if the axis is not at least at about the working position.

The value of PreSet can be used for two reasons. If the pressure controller should continue the work of another block the other blocks output can be used for calculating the PreSet value. By doing so jump of the setpoint on the activation of the controller is reduced or even prevented.

If the setpoint to be produced by the block the value of PreSet can be about that value. By doing so the time to build up this response in the integrating part of the controller can be reduced. Because the proportional part is active as well the applied value should be somewhat higher than the exact value.

Note: In fact the settings of the parameters have to be found by varying the value in small steps. By analysing and judging the controllers behaviour against the applications needs an adequate set of parameters have to be found.

Example for the controllers baviour on an axis that has to travel some distance before being enabled to create the requested pressure.

Example for the controllers baviour on an axis that is enabled to create the requested pressure imediately.


TcPlcHydraulics: PLCopen Motion Control: System: Controller: MC_AxCtrlSlowDownOnPressure_BkPlcMc

FUNCTION_BLOCK MC_AxCtrlSlowDownOnPressure_BkPlcMc (starting with V3.0)

The function block is slowing down an axis as much as is needed to keep the ST_TcHydAxRtData.fActPressure from exceeding a requested setpoint.

Note: In most cases the read back of the actual pressure can be done by using blocks of type MC_AxRtReadPressureSingle_BkPlcMc or MC_AxRtReadPressureDiff_BkPlcMc.

VAR_INPUT
        EnableP:                BOOL:=FALSE;
        EnableM:                BOOL:=FALSE;
        Reset:          BOOL:=TRUE;
        FirstAuxParamIdx:       INT:=0.0;
        kP:             LREAL:=0.0;
        Tn:             LREAL:=0.0;
        PreSet:         LREAL:=0.0;
        ReadingMode:    E_TcMcPressureReadingMode;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Response:               LREAL;
        Active:         BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

EnableP: This input enables the controller to become active when the axis is traveling in positive direction.

EnableM: This input enables the controller to become active when the axis is traveling in negative direction.

Reset: This input controls the activity of the controller and will clear the integrating part of the controller.

FirstAuxParamIdx: This parameter can activate a range of Axis_Ref_BkPlcMc.ST_TcHydAxParam.fCustomerData as parameter interface.

kP: The proportional gain factor of the controller.

Tn: The integrating time constant of the controller.

PreSet: On change into the active state the integrating part of the controller is precharged in a way that the controllers output will be adaptef to this value.

Response: The output signal of the controller.

ReadingMode: The actual value that has to be adapted to the setpoint is selected here. The default is Axis_Ref_BkPlcMc.ST_TcHydAxParam.fActPressure ausgewählt.

Active: A TRUE state signals, that the controller is creating a response to close the pressure control loop.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded error message is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

A TRUE on Reset input will force the block into idle state without taking care for other control signals. In this state the proportional and the integrating part are cleared, Active is FALSE and Response is 0.0.

The input ReadingMode is used to select the stAxRtData process variable to be controlled.

  • iTcHydPressureReadingDefault, iTcHydPressureReadingActPressure: loop is closed over fActPressure.
  • iTcHydPressureReadingActForce: loop is closed over fActForce.
  • all other settings will deactivate the controller.

Note: The setpoint for the control loop has to be supplied in fSetPressure in the stAxRtData structure of the axis.

In the idle state the behaviour is determined by EnableP and EnableM. They set the rules for the block becoming active while traveling in positive or negative direction. To make a decision about a state change from idle to active the block checks the sign of ST_TcHydAxRtData.fSetSpeed dnd the difference between SetPressure and the selected process value.

If the block changes its state to active the integrating functionality is precharged in a way that adds to the output of a setpoint generator to an output value matching PreSet. If the output value matching SetPressure is known this information can be used to shortcut the settling time of the control loop. In practical work the value of this parameter should reflect the behaviour of the control path. This is strongly effected by the compressability of the object, but also biased by the used velocity. If the pressure rise is slow in respect to the choosen Tn the actual setpoint in ST_TcHydAxRtData.fSetSpeed is a good choice for PreSet. For a sharp pressure rise the PreSet value has to be calculated from the pressure setpoint in respect of the pressure transfer characteristics of the valve.

In the active state the controller is using kP and Tn to calculate a proportional and integrating response. The total of these partial responses is presented as Response and Active is TRUE.

The change into idle state cleares the controller response and Active becomes FALSE.

Integrating the block into the applikation

A block of this type has to be placed behind the blocks for reading the actual position and pressure information and the setpoint generator. If there are blocks for closing a velocity or position control loop as well as a MC_AxCtrlSlowDownOnPressure_BkPlcMc block the responses of these controllers have to be combined carefully.

The controller is calculating a response, but does not write it to the ST_TcHydAxRtData structure. This has to be done by the application depending on Active and signals from other controllers. Usually Response is stored in ST_TcHydAxRtData.fLagCtrlOutput zugewiesen. The MC_AxRtFinish_BkPlcMc block that has to be called behind the MC_AxCtrlSlowDownOnPressure_BkPlcMc block is taking the response into account automatically.

Note: By setting a value greater than 0 in FirstAuxParamIdx the block can be forced to use a set of three elements of the fCustomerData from the parameter structure as Tn, kP and PreSet. If Axis.pStAxAuxLabels holds the address of an ARRAY[..] OF STRING() the parameters are labeled automatically.


TcPlcHydraulics: PLCopen Motion Control: System: Controller: MC_AxCtrlStepperDeStall_BkPlcMc

FUNCTION_BLOCK MC_AxCtrlStepperDeStall_BkPlcMc

The block is monitoring the movement of a stepper motor, that is combined with an encoder.

Note: The ussage of a real encoder is essential for this block. An encoder emulation (i.e. counting back the pulses, sent by an output device) is inadequate here.

Note: Even the use of this block cannot prevent stall situations. There is no guaranty for a constant velocity.

VAR_INPUT
        EnableAcc:      BOOL:=FALSE;
        EnableDec:      BOOL:=FALSE;
        Reset:          BOOL:=FALSE;
        UseKL2531State: BOOL:=FALSE;
        ResetRefOnError:        BOOL:=FALSE;
        FirstAuxParamIdx: INT:=0;
        VeloLimit:      LREAL:=0.0;
        LimitFilter:    LREAL:=0.0;
        UpdateFilter:   LREAL:=0.0;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Active:         BOOL;
        Activated:      BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

EnableAcc, EnableDec: These inputs controll the activity of the block during acceleration and deceleration of the axis.

Reset: This input controlls the overall activity of the block.

UseKL2531State: If this input is TRUE the block will monitor ST_TcPlcDeviceInput.bTerminalState.

ResetRefOnError: If this input is TRUE a stall detection will cause a reset of the referenced state of the encoder.

FirstAuxParamIdx: This parameter can activate a range of Axis_Ref_BkPlcMc.ST_TcHydAxParam.fCustomerData as parameter interface.

VeloLimit: The velocity error threshold for detecting a stall situation.

LimitFilter: The time threshold for detecting a stall situation.

UpdateFilter: This filter time constant is used for adapting the setpoint to the actual velocity.

Active: This output signals a detected stall situation.

Activated: This output signals that there was a stall situation detected since the last start of an active movement of the axis.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded error message is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On each call the checks for reasons to change its state. It is placed in the active state if this is enabled by the motion phase in consideration of EnableAcc, EnableDec and the velocity error is exceeding VeloLimit for at least LimitFilter. EnableAcc enables a change to the active state if the velocity is constant or rising, EnableDec enables a change on constant or falling velocity. The block is signaling a change into the active state is by setting Active and Activated.

The block is placed in the inactive state if the velocity error is below half of the VeloLimit threshold. Active is cleared on this state change.

In the active state the setpoint is adapted to the actual velocity by using UpdateFilter as a time constant. If this parameter is set to 0.0 the setpoint is updated imediately.

In the inactive state Activated is cleared if the exis is starting an active movement.

Note: The block is monitoring the difference between velocity setpoint and actual velocity. It is important to use a proper seting for the reference velocity to avoid false alarms and unwanted activation of the stall handling mechanism.

The scope view below demonstrates a move that is interfered two times by mechanical collisions. In both situations the axis is stopped completely.

Integrating the block into the applikation

A block of this type has to be placed behind the blocks for reading the actual position and setpoint generation. The block is merging its response with the output informations of the setpoint generator and is overwriting the ST_TcHydAxRtData strukture. The MC_AxRtFinish_BkPlcMc block called later in the sequence will consider the blocks response automatically.

Note: By supplying a value grater than zero for FirstAuxParamIdx the block can be commanded to use three adjacend values from fCustomerData in the parameter structure as VeloLimit, LimitFilter and UpdateFilter. If there is an address of an ARRAY[..] OF STRING() supplied as Axis.pStAxAuxLabels the parameters are labeled automatically.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtDrive_BkPlcMc

FUNCTION_BLOCK MC_AxRtDrive_BkPlcMc (starting with V3.0)

The function block performs preparation of the control value for the axis for it to be output on a hardware module. For this purpose, a hardware specific block is called, depending on what value has been specified for the nDrive_Type in Axis.pStAxParam.

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block investigates the axis interface that has been passed to it every time it is called. A number of problems can be detected and reported during this process:

  • If nDrive_Type in pStAxParams is set to an unacceptable value, the block reacts with Error and ErrorID:=dwTcHydErrCdDriveType. If the pointer pStAxRtData for the axis has been initialised, it is placed into a fault state.
  • If one of the specific sub-blocks detects a problem, it will (if possible) place the axis into a fault state. This error is then echoed at the outputs of the MC_AxRtDrive_BkPlcMc.

If it is possible to carry out these checks without encountering any problems, the control value for the axis is processed appropriately for the nDrive_Type in Axis.pStAxParams.

Note: Information about the necessary linking of I/O components with the input and output structures of the axis may be found in the Knowledge Base under FAQ #7.

Note: If only the usual blocks (encoder, generator, finish, drive) for the axis are going to be called, then a block of type MC_AxStandardBody_BkPlcMc should be used for the sake of simplicity.

Note: For asynchronous data exchange with I/O device from the KL series blocks like MC_AxUtiReadRegDriveTerm_BkPlcMc and MC_AxUtiWriteRegDriveTerm_BkPlcMc are supplied.

iTcMc_DriveAx2000_B110A

The block performs preparation of the control value for the axis for it to be output on an AX2000 servo amplifier running on EtherCAT fieldbus. It is preassumed that the motor is equiped with an absolute encoder. For motors with on board resolver use iTcMc_DriveAx2000_B110R.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_EncoderAx2000_B110A for detailed information.

iTcMc_DriveAx2000_B110R

The block performs preparation of the control value for the axis for it to be output on an AX2000 servo amplifier running on EtherCAT fieldbus. It is preassumed that the motor is equiped with a resolver. For motors with on board absolute encoder use iTcMc_DriveAx2000_B110A.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_EncoderAx2000_B110R for detailed information.

iTcMc_DriveAx2000_B200R, iTcMc_DriveAx2000_B900R

The function block performs preparation of the control value for the axis for it to be output on an AX2000 servo amplifier running on Beckhoff LightBus (B200) or RtEthernet fieldbus (B900).

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_EncoderAx2000_B200R for detailed information.

iTcMc_DriveAx2000_B750A

The block performs preparation of the control value of the axis for it to be output on an AX2000 servo amplifier running on Sercos fieldbus.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_EncoderAx2000_B750A for detailed information.

iTcMc_DriveAx5000_B110A, iTcMc_DriveAx5000_B110SR

The block performs preparation of the control value of the axis for it to be output on an AX5000 servo amplifiers running on EtherCAT (B110). It is preassumed that the motor is equiped with an absolute encoder. For motors with on board resolver use iTcMc_DriveAx5000_B110SR.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_EncoderAX5000_B110A for detailed information.

Note: Please see iTcMc_EncoderAX5000_B110A for a list of successfully tested compatible devices.

Note 2: The variables Chn0 and Chn2 are used to select the chanels of a dual drive unit. For the first chanel connect Chn0, for the second chanel use Chn1. If a single drive unit is used apply the rules for the first drive of a dual drive unit.

Note 3: There is a range of special rules for using this type of devices. See the Knowledge Base for details.

iTcMc_DriveCoE_DS402

The block performs preparation of the control value of the axis for it to be output on a servo amplifier running on EtherCAT and supporting the CoE DS402 profile.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_EncoderCoE_DS402 for detailed information.

Note: Please see iTcMc_EncoderCoE_DS402SR for a list of successfully tested compatible devices.

Note: At time being only resolvers and singleturn encoders are supported.

iTcMc_Drive_CoE_DS408

The block performs preparation of the control value for the axis for it to be output to a proportional valve on EtherCAT fieldbus. The valve has to support the CiA DS408 profile.

I/O Variable | Interface.Variable | Usage
see note | ST_TcPlcDeviceInput.nDacOut | Writing the output value.
see note | ST_TcPlcDeviceOutput.uiDriveCtrl | Control of the device.
see note | ST_TcPlcDeviceInput.uiStatus | Status of the device.
WcState | ST_TcPlcDeviceInput.wDriveWcState | Connection monitoring.
uiDriveBoxState | ST_TcPlcDeviceInput.InfoData.State | Online status monitoring.
InfoData.AdsAddr | ST_TcPlcDeviceInput.sDrvAdsAddr | Automatic Identification.

Note: The names of exchanged variables are defined by the XML file that is supplied by the vendor.

The following Index.SubIndex cominations have to be supported by the valve.

Index | Subindex | Remark
1000 | 0 | Identification
1008 | 0 | Device name (optional)
1018 | 1 | Vendor code
1018 | 2 | Product code

The following list of compatible devices is incomplete by nature. It is not to be understood as a recommendation but just an example. Beckhoff Automation GmbH cannot guarantee for interoperability or functionallity anyway.

Vendor | Type | Description
Moog | D638Exxx | Proportional valve.
Parker | DxxFP/ DxxFE/ TDP/ TPQ | Proportional valve.

x: is a placeholder for different character.

iTcMc_DriveEL4132

The function block performs preparation of the control value for the axis for it to be output on a EL4132 analog output terminal.

I/O Variable | Interface.Variable | Usage
Data Out | ST_TcPlcDeviceOutput.nDacOut | Normal operation: Writing the output value. Register communication.
Ctrl | ST_TcPlcDeviceOutput.bTerminalCtrl | Register communication.
State | ST_TcPlcDeviceInput.bTerminalState | Register communication.
Data In | ST_TcPlcDeviceOutput.uiTerminalData | Register communication.

iTcMc_DriveIx2512_1Coil

The function block performs preparation of the control value for the axis for it to be output on an IP2512 PWM fieldbus modul.

I/O Variable | Interface.Variable | Usage
Data Out | ST_TcPlcDeviceOutput.uiDacOutA | Writing the output value.

iTcMc_DriveIx2512_2Coil

The function block performs preparation of the control value for the axis for it to be output on an IP2512 PWM fieldbus modul.

I/O Variable | Interface.Variable | Usage
Data Out | ST_TcPlcDeviceOutput.uiDacOutA | Writing the output value for coil #1.
Data Out | ST_TcPlcDeviceOutput.uiDacOutB | Writing the output value for coil #2.

iTcMc_DriveKL2521

The function block performs preparation of the control value for the axis for it to be output on a KL2521 Pulse Train Output terminal.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_EncoderKL2521 for more details.

I/O Variable | Interface.Variable | Usage
Data Out | ST_TcPlcDeviceOutput.nDacOut | Normal operation: Writing the output value. Register communication.
Ctrl | ST_TcPlcDeviceOutput.bTerminalCtrl | Register communication.
State | ST_TcPlcDeviceInput.bTerminalState | Register communication.
Data In | ST_TcPlcDeviceOutput.uiTerminalData | Register communication.

iTcMc_DriveKL2531

The function block performs preparation of the control value for the axis for it to be output on a KL2531 direct stepper output terminal.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_EncoderKL2531 for more details.

E/A-Variable | Interface.Variable | Verwendung
Velocity | ST_TcPlcDeviceOutput.nDacOut | Normal operation: Writing the output value. Register communication.
Ctrl | ST_TcPlcDeviceOutput.bTerminalCtrl | Control signals for power stage, Register communication.
Position | ST_TcPlcDeviceInput.uiCount | Register communication.
Status | ST_TcPlcDeviceInput.bTerminalState | State of the power stage.
ExtStatus | ST_TcPlcDeviceInput.uiTerminalState2 | Power stage and motor monitoring.

iTcMc_DriveKL2541

The function block performs preparation of the control value for the axis for it to be output on a KL2541 direct stepper output terminal.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_EncoderKL2541 for more details.

E/A-Variable | Interface.Variable | Verwendung
Velocity | ST_TcPlcDeviceOutput.nDacOut | Normal operation: Writing the output value. Register communication.
Ctrl | ST_TcPlcDeviceOutput.bTerminalCtrl | Control signals for power stage, Register communication.
Position | ST_TcPlcDeviceInput.uiCount | Register communication.
Status | ST_TcPlcDeviceInput.bTerminalState | State of the power stage.
ExtStatus | ST_TcPlcDeviceOutput.uiTerminalCtrl2 | Power stage and motor monitoring.

iTcMc_DriveKL4032

The function block performs preparation of the control value for the axis for it to be output on a KL4032 analog output terminal.

I/O Variable | Interface.Variable | Usage
Data Out | ST_TcPlcDeviceOutput.nDacOut | Normal operation: Writing the output value. Register communication.
Ctrl | ST_TcPlcDeviceOutput.bTerminalCtrl | Register communication.
State | ST_TcPlcDeviceInput.bTerminalState | Register communication.
Data In | ST_TcPlcDeviceOutput.uiTerminalData | Register communication.

iTcMc_DriveLowCostStepper

The function block performs preparation of the control value for the axis for it to be output on a set of digital output terminals. A pulse counter is updated that can be used to emulate an actual position readback by a iTcMc_EncoderLowCostStepper encoder.

I/O Variable | Interface.Variable | Usage
Output | ST_TcPlcDeviceOutput.nDigOutAp | Noninverting output for A phase.
Output | ST_TcPlcDeviceOutput.nDigOutAn | Inverting output for A phase.
Output | ST_TcPlcDeviceOutput.nDigOutBp | Noninverting output for B phase.
Output | ST_TcPlcDeviceOutput.nDigOutBn | Inverting output for B phase.

iTcMc_DriveLowCostInverter

The function block performs preparation of the control value for the axis for it to be output on digital output terminals for controling a set of power switches or select working frequencies of a frequency inverter. There are some special rules that have to be kept in mind when using this drive type.

Brake, Enable, Direction and Speed level

Note: After the call of the MC_AxRtFinish_BkPlcMc or MC_AxStandardBody_BkPlcMc block of the axis there are four decoded signals that can be used. To create the signal that are necessary here the logical operations below have to be performed after each call. Example:

stAxDeviceOut.bDigOutAp:=stAxDeviceOut.bDigOutAp OR stAxDeviceOut.bDigOutBp;

stAxDeviceOut.bDigOutAn:=stAxDeviceOut.bDigOutAn OR stAxDeviceOut.bDigOutBn;

Note: Starting with V3.0.11 the Valve tag of the PlcMcManager supports the option of calculating absolute velocity output values. The logical operations listed above are performed by the library code internally.

I/O Variable | Interface.Variable | Usage
Ausgang | ST_TcPlcDeviceOutput.nDigOutAp | Activation of the fast speed frequency
Ausgang | ST_TcPlcDeviceOutput.nDigOutAn | Activation of the slow speed frequency
Ausgang | ST_TcPlcDeviceOutput.bMovePos | Selection of the direction: Positiv.
Ausgang | ST_TcPlcDeviceOutput.bMoveNeg | Selection of the direction: Negativ.
Ausgang | ST_TcPlcDeviceOutput.bPowerOn | Enable signal for the power stage.
Ausgang | ST_TcPlcDeviceOutput.bBrakeOff | Brake control.
Eingang | ST_TcPlcDeviceInput.bPowerOk | State of the inverter: operational signal.

Brake, Enable, Direction and Directional speed level

I/O Variable | Interface.Variable | Usage
Ausgang | ST_TcPlcDeviceOutput.nDigOutAp | Activation of the fast speed frequency in positiv direction.
Ausgang | ST_TcPlcDeviceOutput.nDigOutAn | Activation of the slow speed frequency in positiv direction.
Ausgang | ST_TcPlcDeviceOutput.nDigOutBn | Activation of the slow speed frequency in negativ direction.
Ausgang | ST_TcPlcDeviceOutput.nDigOutBp | Activation of the fast speed frequency in negativ direction.
Ausgang | ST_TcPlcDeviceOutput.bPowerOn | Enable signal for the power stage.
Ausgang | ST_TcPlcDeviceOutput.bBrakeOff | Brake control.
Eingang | ST_TcPlcDeviceInput.bPowerOk | State of the inverter: operational signal.

iTcMc_DriveM2400_Dn

The function block performs preparation of the control value for the axis for it to be output on a M2400 analog output module.

I/O Variable | Interface.Variable | Usage
DAC n | ST_TcPlcDeviceOutput.nDacOut | Writing the output value.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtEncoder_BkPlcMc

FUNCTION_BLOCK MC_AxRtEncoder_BkPlcMc (starting with V3.0)

This function block determines the actual position of the axis from the input information of a hardware module. For this purpose, a hardware specific block is called, depending on what value has been specified for the nEnc_Type in Axis.pStAxParam.

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block investigates the axis interface that has been passed to it every time it is called. A number of problems can be detected and reported during this process:

  • If nEnc_Type in pStAxParams is set to an unacceptable value, the block reacts with Error and ErrorID:=dwTcHydErrCdEncType. If the pointer pStAxRtData for the axis has been initialised, it is placed into a fault state.
  • If one of the specific sub-blocks detects a problem, it will (if possible) place the axis into a fault state. This error is then echoed at the outputs of the MC_AxRtEncoder_BkPlcMc.

If it is possible to carry out these checks without encountering any problems, the actual value of the axis is determined by calling a type-specific block corresponding to the nEnc_Type in Axis.pStAxParams.

Note: Information about the necessary linking of I/O components with the input and output structures of the axis may be found in the Knowledge Base under FAQ #4.

Note: If only the usual blocks (encoder, generator, finish, drive) for the axis are going to be called, then a block of type MC_AxStandardBody_BkPlcMc should be used for the sake of simplicity.

Note: For asynchronous data exchange with I/O device from the KL series blocks like MC_AxUtiReadRegEncTerm_BkPlcMc and MC_AxUtiWriteRegEncTerm_BkPlcMc are supplied.

iTcMc_EncoderAx2000_B110A

The block is reading the actual position from AX2000 servo amplifiers running on EtherCAT (B110). It is preassumed that the motor is equiped with an absolute encoder. For motors with on board resolver use iTcMc_EncoderAx2000_B110R.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_DriveAX2000_B110A for more details.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

E/A-Variable | Interface.Variable | Verwendung
Position actual value | ST_TcPlcDeviceInput.ActualPos[0..1] | Reading of actual position.
Status word | ST_TcPlcDeviceInput.uiStatus | Status of the device and the encoder emulation.
Control word | ST_TcPlcDeviceOutput.uiDriveCtrl | Control of the device.
Velocity demand value | ST_TcPlcDeviceOutput.NominalVelo | Demand velocity output.
WcState (see note) | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring for the actual position.
WcState | ST_TcPlcDeviceInput.wDriveWcState | Connection monitoring for the drive unit.
InfoData.State | ST_TcPlcDeviceInput.uiDriveBoxState | Operation state monitoring for the drive unit.
InfoData.AdsAddr (see note) | ST_TcPlcDeviceInput.sEncAdsAddr | Parameter communication.
InfoData.AdsAddr | ST_TcPlcDeviceInput.sDrvAdsAddr | Parameter communication.
Chn0 (see note) | ST_TcPlcDeviceInput.nEncAdsChannel | Parameter communication.
Chn0 | ST_TcPlcDeviceInput.nDrvAdsChannel | Parameter communication.
Output (of a DO terminal) | ST_TcPlcDeviceOutput.PowerOn | Optional: Controlling the line power switch. Use a digital output terminal here.
Input (of a DI terminal) | ST_TcPlcDeviceInput.PowerOk | Optional: Monitoring the line power switch. Use a digital input terminal here.

Note: For simplicity of the I/O mapping setup the elements ST_TcPlcDeviceInput.sEncAdsAddr, ST_TcPlcDeviceInput.nEncAdsChannel and ST_TcPlcDeviceInput.wEncWcState can be left unconnected if the actual position is read from the same device. The blocks for parameter communication and encoder readout will use the mapped variables of the drive connection as well.

iTcMc_EncoderAx2000_B110R

The block is reading the actual position from AX2000 servo amplifiers running on EtherCAT (B110). It is preassumed that the motor is equiped with a resolver. For motors with on board absolute encoder use iTcMc_EncoderAx2000_B110R.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_DriveAX2000_B110R for more details.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

E/A-Variable | Interface.Variable | Verwendung
Position actual value | ST_TcPlcDeviceInput.ActualPos[0..1] | Reading of actual position.
Status word | ST_TcPlcDeviceInput.uiStatus | Status of the device and the encoder emulation.
Control word | ST_TcPlcDeviceOutput.uiDriveCtrl | Control of the device.
Velocity demand value | ST_TcPlcDeviceOutput.NominalVelo | Demand velocity output.
WcState (see note) | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring for the actual position.
WcState | ST_TcPlcDeviceInput.wDriveWcState | Connection monitoring for the drive unit.
InfoData.State | ST_TcPlcDeviceInput.uiDriveBoxState | Operation state monitoring for the drive unit.
InfoData.AdsAddr (see note) | ST_TcPlcDeviceInput.sEncAdsAddr | Parameter communication.
InfoData.AdsAddr | ST_TcPlcDeviceInput.sDrvAdsAddr | Parameter communication.
Chn0 (see note) | ST_TcPlcDeviceInput.nEncAdsChannel | Parameter communication.
Chn0 | ST_TcPlcDeviceInput.nDrvAdsChannel | Parameter communication.
Output (of a DO terminal) | ST_TcPlcDeviceOutput.PowerOn | Optional: Controlling the line power switch. Use a digital output terminal here.
Input (of a DI terminal) | ST_TcPlcDeviceInput.PowerOk | Optional: Monitoring the line power switch. Use a digital input terminal here.

Note: For simplicity of the I/O mapping setup the elements ST_TcPlcDeviceInput.sEncAdsAddr, ST_TcPlcDeviceInput.nEncAdsChannel and ST_TcPlcDeviceInput.wEncWcState can be left unconnected if the actual position is read from the same device. The blocks for parameter communication and encoder readout will use the mapped variables of the drive connection as well.

iTcMc_EncoderAx2000_B200R, iTcMc_EncoderAx2000_B900R

The block is reading the actual position from AX2000 servo amplifiers running on LightBus (B200) or RealtimeEthernet (B900).

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_DriveAX2000_B200R for more details.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

I/O Variable | Interface.Variable | Usage
ActualPos[0..1] | ST_TcPlcDeviceInput.ActualPos[0..1] | Reading of actual position.
DriveError | ST_TcPlcDeviceInput.DriveError | Error code of the device.
DriveState[0..3] | ST_TcPlcDeviceInput.DriveState[0..3] | Status of the device.
BoxState | ST_TcPlcDeviceInput.uiDriveBoxState |
DriveCtrl0 | ST_TcPlcDeviceOutput.DriveCtrl[0] | Control of the device.
DriveCtrl1 | ST_TcPlcDeviceOutput.DriveCtrl[1] | Control of the device.
DriveCtrl2 | ST_TcPlcDeviceOutput.DriveCtrl[2] | Control of the device.
DriveCtrl3 | ST_TcPlcDeviceOutput.DriveCtrl[3] | Control of the device.
NominalVelo | ST_TcPlcDeviceOutput.NominalVelo | Demand velocity output.
Output (of a DO terminal) | ST_TcPlcDeviceOutput.PowerOn | Optional: Controlling the line power switch. Use a digital output terminal here.
Input (of a DI terminal) | ST_TcPlcDeviceInput.PowerOk | Optional: Monitoring the line power switch. Use a digital input terminal here.

iTcMc_EncoderAx2000_B750A

The block is reading the actual position from AX2000 servo amplifiers running on Sercos (B750).

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_DriveAX2000_B750A for more details.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

E/A-Variable | Interface.Variable | Verwendung
Status word | ST_TcPlcDeviceInput.uiStatus | Status of the device and the encoder emulation.
Position actual value | ST_TcPlcDeviceInput.ActualPos[0..1] | Reading of actual position.
Control word | ST_TcPlcDeviceOutput.uiDriveCtrl | Control of the device.
Velocity demand value | ST_TcPlcDeviceOutput.NominalVelo | Demand velocity output.
SystemState (from Sercos master) | ST_TcPlcDeviceInput.uiDriveBoxState | Monitoring the Sercos phase. Note: This variable is supplied by the Sercos master (e.g. FC7501).
Output (of a DO terminal) | ST_TcPlcDeviceOutput.PowerOn | Optional: Controlling the line power switch. Use a digital output terminal here.
Input (of a DI terminal) | ST_TcPlcDeviceInput.PowerOk | Optional: Monitoring the line power switch. Use a digital input terminal here.

Note: There is a range of special rules for using Sercos devices. See the Knowledge Base for details.

iTcMc_EncoderAx5000_B110A

The block is reading the actual position from AX5000 servo amplifiers running on EtherCAT (B110). It is preassumed that the motor is equiped with an absolute encoder. For motors with on board resolver use iTcMc_EncoderAx5000_B110SR.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_DriveAX5000_B110A for more details.

I/O Variable | Interface.Variable | Usage
Position feedback 1 value | ST_TcPlcDeviceInput.udiCount | Reading of actual position.
Drive status word | ST_TcPlcDeviceInput.uiStatus | Status of the device.
Master control word | ST_TcPlcDeviceOutput.uiDriveCtrl | Control of the device.
Velocity command value | ST_TcPlcDeviceOutput.NominalVelo | Demand velocity output.
WcState | ST_TcPlcDeviceInput.wDriveWcState | Connection monitoring for the drive unit.
WcState (see note) | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring for the actual position.
uiDriveBoxState | ST_TcPlcDeviceInput.InfoData.State | Operation state monitoring for the drive unit.
InfoData.AdsAddr | ST_TcPlcDeviceInput.sDrvAdsAddr | Parameter communication.
InfoData.AdsAddr (see note) | ST_TcPlcDeviceInput.sEncAdsAddr | Parameter communication.
Chn0 (see note 2) | ST_TcPlcDeviceInput.nDrvAdsChannel | for single drive units or the first drive of a dual drive unit: Controlling the online status, parameter communication.
Chn0 (see notes 1,2) | ST_TcPlcDeviceInput.nEncAdsChannel | for single drive units or the first drive of a dual drive unit: parameter communication.
Chn1 (see note 2) | ST_TcPlcDeviceInput.nDrvAdsChannel | only for dual drive units: Controlling the online status, parameter communication.
Chn1 (see notes 1,2) | ST_TcPlcDeviceInput.nEncAdsChannel | only for dual drive units: Parameter communication.
Ausgang (auf einer DA-Klemme) | ST_TcPlcDeviceOutput.PowerOn | Optional: Controlling the line power switch. Use a digital output terminal here.
Eingang (auf einer DE-Klemme) | ST_TcPlcDeviceInput.PowerOk | Optional: Monitoring the line power switch. Use a digital input terminal here.

Note 1: For simplicity of the I/O mapping setup the elements ST_TcPlcDeviceInput.sEncAdsAddr, ST_TcPlcDeviceInput.nEncAdsChannel and ST_TcPlcDeviceInput.wEncWcState can be left unconnected if the actual position is read from the same device. The blocks for parameter communication and encoder readout will use the mapped variables of the drive connection as well.

Note 2: The variables Chn0 and Chn2 are used to select the chanels of a dual drive unit. For the first chanel connect Chn0, for the second chanel use Chn1. If a single drive unit is used apply the rules for the first drive of a dual drive unit.

Note 3: There is a range of special rules for using Sercos devices. See the Knowledge Base for details.

iTcMc_EncoderCoE_DS402SR

The block is reading the actual position from servo amplifiers running on EtherCAT and supporting the CoE DS402 profile. It is preassumed that the motor is equiped with a singleturn encoder or resolver.

Attention : The TwinCAT System Manager will recommend to add and connect an NC axis on a manuell insertion or an automatic detection of a servo amplifier. If the servo is intended to be controlled by the hydraulics library be sure to reject this recommendation.

Note: This device is part of a group of devices that are used as drive output and encoder input as well. The encoder and drive mapping definitions are overlapping. See iTcMc_DriveCoE_DS402 for more details.

E/A-Variable | Interface.Variable | Verwendung
siehe Hinweis | ST_TcPlcDeviceInput.udiCount | Reading of actual position
 | ST_TcPlcDeviceInput.uiStatus |
 | ST_TcPlcDeviceOutput.uiDriveCtrl |
 | ST_TcPlcDeviceOutput.NominalVelo |
WcState | ST_TcPlcDeviceInput.wDriveWcState | Connection monitoring
InfoData.State | ST_TcPlcDeviceInput.uiDriveBoxState | Monitoring the nnline status
InfoData.AdsAddr | ST_TcPlcDeviceInput.sEncAdsAddr | Automatic identification.

Note: The names of the process variables of the drive are defined by the maker via XML file description.

Index | Subindex | Bedeutung
1000 | 0 | Identification
1008 | 0 | Device name (optional)
1018 | 1 | Maker identifier
1018 | 2 | Device type
6080 | 0 | Maximum turnrate in RPM (optional, if this object is not supported the reference speed has to be set manually).
608F | 1 | Encoder increments per motor turn
6090 | 1 | Increments per motor turn used for velocity output conversion.

The following list of compatible devices is incomplete by nature. It is not to be understood as a recommendation but just an example. Beckhoff Automation GmbH cannot guarantee for interoperability or functionallity anyway. If a device or a maker is not listed below the operation may be without any problem but will not be guaranteed.

Hersteller | Typ | Beschreibung
LTi DRiVES GmbH |  | Servo amplifier with singleturn absolute encoder

iTcMc_EncoderCoE_DS406

The block is reading the actual position from an encoder directly connetec to EtherCAT. The encoder has to support the CiA DS406 profile.

I/O Variable | Interface.Variable | Usage
see note | ST_TcPlcDeviceInput.udiCount | Reading of actual position.
WcState | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring.
InfoData.State | ST_TcPlcDeviceInput.uiEncBoxState | Connection monitoring.
InfoData.AdsAddr | ST_TcPlcDeviceInput.sEncAdsAddr | Automatic identification.

Note: The names of process data elements are defined the XML file supplied by the vendor.

The following index.subindex combinations have to be supported by the encoder.

Index | Subindex | Remark
1000 | 0 | Identification
1008 | 0 | Device name (optional)
1018 | 1 | Vendor code
1018 | 2 | Product code
6001 | 0 | Count per turn (option A)
6002 | 0 | Total count (option A)
6501 | 0 | Count per turn (option B)
6502 | 0 | Number of turns (option B)

The following list of compatible devices is incomplete by nature. It is not to be understood as a recommendation but just an example. Beckhoff Automation GmbH cannot guarantee for interoperability or functionallity anyway.

Vendor | Type | Description
Fritz Kübler GmbH | 58x8 | Multiturn absolute encoder.
IVO GmbH & Co | GxMMWH | Multiturn absolute encoder.
MTS | Temposonics R | Linear absolute encoder.
TR Electronic GmbH | CEV65M | Linear absolute encoder.
TWK Elektronik GmbH | CRKxx12R12C1xx | Multiturn absolute encoder.

iTcMc_EncoderDigCam

The block is reading the actual position from a set of four digital inputs.

I/O Variable | Interface.Variable | Usage
Input | ST_TcPlcDeviceInput.bDigCamPP | Reading of actual position: Positive target camm.
Input | ST_TcPlcDeviceInput.bDigCamP | Reading of actual position: Positive target range camm.
Input | ST_TcPlcDeviceInput.bDigCamM | Reading of actual position: Negative target range camm.
Input | ST_TcPlcDeviceInput.bDigCamMM | Reading of actual position Negative target camm.

iTcMc_EncoderDigIncrement

The block is reading the actual position from a set of two digital inputs by emulating an incremental encoder interface.

I/O Variable | Interface.Variable | Usage
Input | ST_TcPlcDeviceInput.bDigInA | Reading of actual position.
Input | ST_TcPlcDeviceInput.bDigInB | Reading of actual position.

iTcMc_EncoderEL3102

The block is reading the actual position from an analog input terminal of type EL3102.

I/O Variable | Interface.Variable | Usage
Value | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
InfoData.AdsAddr | ST_TcPlcDeviceInput.sEncAdsAddr | Address informationen for parameter communication via CoE.
WcState | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring.

iTcMc_EncoderEL3142

The block is reading the actual position from an analog input terminal of type EL3142.

I/O Variable | Interface.Variable | Usage
Value | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
InfoData.AdsAddr | ST_TcPlcDeviceInput.sEncAdsAddr | Address informationen for parameter communication via CoE.
WcState | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring.

iTcMc_EncoderEL3162

The block is reading the actual position from an analog input terminal of type EL3162.

I/O Variable | Interface.Variable | Usage
Value | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
InfoData.AdsAddr | ST_TcPlcDeviceInput.sEncAdsAddr | Address informationen for parameter communication via CoE.
WcState | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring.

iTcMc_EncoderEL5001

The block is reading the actual position from an SSI input terminal of type EL5001.

I/O Variable | Interface.Variable | Usage
Value | ST_TcPlcDeviceInput.udiCount | Reading of actual position.
Status | ST_TcPlcDeviceOutput.usiRegStatus | Monitoring fault signals from the encoder.
InfoData.AdsAddr | ST_TcPlcDeviceInput.sEncAdsAddr | Address informationen for parameter communication via CoE.
WcState | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring.

iTcMc_EncoderEL5101

The block is reading the actual position from an incremental input terminal of type EL5101.

I/O Variable | Interface.Variable | Usage
Value | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
Latch | ST_TcPlcDeviceInput.uiLatch | For homing when using the ync pulse of the encoder.
Ctrl | ST_TcPlcDeviceOutput.usiCtrl | Control of the latch function etc.
Status | ST_TcPlcDeviceInput.usiStatus |
InfoData.AdsAddr | ST_TcPlcDeviceInput.sEncAdsAddr | Address informationen for parameter communication via CoE.
WcState | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring.

iTcMc_EncoderEL5111

The block is reading the actual position from an incremental input terminal of type EL5111.

I/O Variable | Interface.Variable | Usage
Value | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
Latch | ST_TcPlcDeviceInput.uiLatch | For homing when using the ync pulse of the encoder.
Ctrl | ST_TcPlcDeviceOutput.usiCtrl | Control of the latch function etc.
Status | ST_TcPlcDeviceInput.usiStatus |
InfoData.AdsAddr | ST_TcPlcDeviceInput.sEncAdsAddr | Address informationen for parameter communication via CoE.
WcState | ST_TcPlcDeviceInput.wEncWcState | Connection monitoring.

iTcMc_EncoderIx5009

The block is reading the actual position from an SSI input fieldbus box of type IP5009.

I/O Variable | Interface.Variable | Usage
PZDL_RegDaten | ST_TcPlcDeviceInput.uiPZDL_RegDaten | Normal operation: Reading of actual position. Register communication.
PZDH | ST_TcPlcDeviceInput.uiPZDH | Reading of actual position.
RegStatus | ST_TcPlcDeviceInput.usiRegStatus | Various status informations.

iTcMc_EncoderKL2521

The block is reading the actual position from a pulse train terminal of type KL2521. The output pulse counter is used as an encoder emulation.

Note: This device is part of a group of devices that is used setpoint output as well as for position read back. At least the mapping rules for parameter communication is overlapping the rules for the drive block. Please see iTcMc_DriveKL2521 for details.

I/O Variable | Interface.Variable | Usage
Daten Ein | ST_TcPlcDeviceInput.uiCount | Normal operation: Reading of actual position. Register communication.
Kontrolle | ST_TcPlcDeviceOutput.bTerminalCtrl | Register communication.
Status | ST_TcPlcDeviceInput.bTerminalState | Register communication.
Daten Aus | ST_TcPlcDeviceOutput.uiTerminalData | Register communication.

iTcMc_EncoderKL2531

The block is reading the actual position from a pulse train terminal of type KL2531. The output pulse counter is used as an encoder emulation.

Note: This device is part of a group of devices that is used setpoint output as well as for position read back. At least the mapping rules for parameter communication is overlapping the rules for the drive block. Please see iTcMc_DriveKL2531 for details.

I/O Variable | Interface.Variable | Usage
Velocity | ST_TcPlcDeviceOutput.nDacOut | Normal operation: Writing the output value. Register communication.
Ctrl | ST_TcPlcDeviceOutput.bTerminalCtrl | Control signals for power stage, Register communication.
Position | ST_TcPlcDeviceInput.uiCount | Register communication.
Status | ST_TcPlcDeviceInput.bTerminalState | State of the power stage.
ExtStatus | ST_TcPlcDeviceInput.uiTerminalState2 | Power stage and motor monitoring.

iTcMc_EncoderKL2541

The block is reading the actual position from a pulse train terminal of type KL2541. The output pulse counter is used as an encoder emulation.

Note: This device is part of a group of devices that is used setpoint output as well as for position read back. At least the mapping rules for parameter communication is overlapping the rules for the drive block. Please see iTcMc_DriveKL2541 for details.

I/O Variable | Interface.Variable | Usage
Position | ST_TcPlcDeviceInput.uiCount | Normal operation: Reading of actual position. Register communication.
Ctrl | ST_TcPlcDeviceOutput.bTerminalCtrl | Register communication.
Status | ST_TcPlcDeviceInput.bTerminalState | Register communication.
ExtStatus | ST_TcPlcDeviceInput.uiTerminalState2 | Latch status for homing when using the sync pulse of the encoder.
ExtCtrl | ST_TcPlcDeviceOutput.uiTerminalCtrl2 | Control of the latch function etc.
Velocity | ST_TcPlcDeviceOutput.nDacOut | Register communication.

iTcMc_EncoderKL3002

The block is reading the actual position from an analog input terminal of type KL3002.

I/O Variable | Interface.Variable | Usage
Daten Ein | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
Ctrl | ST_TcPlcDeviceOutput.usiCtrl | Register communication.
Status | ST_TcPlcDeviceInput.usiStatus | Register communication.

iTcMc_EncoderKL3042

The block is reading the actual position from an analog input terminal of type KL3042.

I/O Variable | Interface.Variable | Usage
Daten Ein | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
Ctrl | ST_TcPlcDeviceOutput.usiCtrl | Register communication.
Status | ST_TcPlcDeviceInput.usiStatus | Register communication.

iTcMc_EncoderKL3062

The block is reading the actual position from an analog input terminal of type KL3062.

I/O Variable | Interface.Variable | Usage
Daten Ein | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
Ctrl | ST_TcPlcDeviceOutput.usiCtrl | Register communication.
Status | ST_TcPlcDeviceInput.usiStatus | Register communication.

iTcMc_EncoderKL3162

The block is reading the actual position from an analog input terminal of type KL3162.

I/O Variable | Interface.Variable | Usage
Daten Ein | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
Ctrl | ST_TcPlcDeviceOutput.usiCtrl | Register communication.
Status | ST_TcPlcDeviceInput.usiStatus | Register communication.

iTcMc_EncoderKL5001

The block is reading the actual position from an SSI input terminal of type KL5001.

I/O Variable | Interface.Variable | Usage
PZDL_RegDaten | ST_TcPlcDeviceInput.uiPZDL_RegDaten | Normal operation: Reading of actual position. Register communication.
PZDH | ST_TcPlcDeviceInput.uiPZDH | Reading of actual position.
RegStatus | ST_TcPlcDeviceInput.usiRegStatus | Various status informations.
RegDaten | ST_TcPlcDeviceOutput.uiTerminalData | Register communication.

iTcMc_EncoderKL5101

The block is reading the actual position from an incremental input terminal of type KL5101.

I/O Variable | Interface.Variable | Usage
Counter | ST_TcPlcDeviceInput.uiCount | Normal operation: Reading of actual position. Register communication.
Latch | ST_TcPlcDeviceInput.uiLatch | For homing when using the sync pulse of the encoder.
Ctrl | ST_TcPlcDeviceOutput.usiCtrl | Control of the latch function etc., Register communication.
Status | ST_TcPlcDeviceInput.usiStatus | Various status informations.
RegDaten | ST_TcPlcDeviceOutput.uiTerminalData | Register communication.

iTcMc_EncoderKL5111

The block is reading the actual position from an incremental input terminal of type KL5111.

I/O Variable | Interface.Variable | Usage
Counter | ST_TcPlcDeviceInput.uiCount | Normal operation: Reading of actual position. Register communication.
Latch | ST_TcPlcDeviceInput.uiLatch | For homing when using the sync pulse of the encoder.
Ctrl | ST_TcPlcDeviceOutput.usiCtrl | Control of the latch function etc., Register communication.
Status | ST_TcPlcDeviceInput.usiStatus | Various status informations.
RegDaten | ST_TcPlcDeviceOutput.uiTerminalData | Register communication.

iTcMc_EncoderLowCostStepper

This encoder type is reading a pulse counter that is supplied from the corresponding iTcMc_DriveLowCostStepper drive.

Attention : This encoder type is not compatible with any drive type than iTcMc_DriveLowCostStepper .

iTcMc_EncoderM2510

The block is reading the actual position from an analog input module of type M2510.

I/O Variable | Interface.Variable | Usage
Daten Ein | ST_TcPlcDeviceInput.uiCount | Reading of actual position.

iTcMc_EncoderM3120

The block is reading the actual position from an incremental input module of type M3120.

I/O Variable | Interface.Variable | Usage
Value_N | ST_TcPlcDeviceInput.uiCount | Reading of actual position.
State_N | ST_TcPlcDeviceInput.usiStatus | Various status informations.
Ctrl_N | ST_TcPlcDeviceOutput.usiCtrl | Control of the latch function etc.

iTcMc_EncoderSim

A simulation encoder is calculating the actual position by integrating the velocity setpoint. There is no need for linking I/O variables to hardware devices.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtReadForceeDiff_BkPlcMc

FUNCTION_BLOCK MC_AxRtReadForceDiff_BkPlcMc (starting with V3.0)

The function block performs determination of the actual force of the axis from the input data of two analog input terminals.

Hint: If there is a pressure transducer on one side of the axis a function block of type MC_AxRtReadForceSingle_BkPlcMc can be used. If the actual pressure is to be determined a MC_AxRtReadPressureDiff_BkPlcMc block should be used.

VAR_INPUT
        AdcValueA:      INT:=0;
        AdcValueB:      INT:=0;
        ScaleFactorA:   LREAL:=0.0;
        ScaleOffsetA:   LREAL:=0.0;
        ScaleArreaA:    LREAL:=1.0;
        ScaleFactorB:   LREAL:=0.0;
        ScaleOffsetB:   LREAL:=0.0;
        ScaleArreaB:    LREAL:=1.0;
        SlippingOffset: LREAL:=0.0;
        ReadingMode:    E_TcMcPressureReadingMode:=iTcHydPressureReadingDefault;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

AdcValueA, AdcValueB: The input data of the analog terminals.

ScaleFactorA, ScaleFactorB: The weighting factors. This value defines the pressure change equivalent to one ADC step.

ScaleOffsetA, ScaleOffsetB: This offset is used for shifting the zero point of the pressure scales.

SlippingOffset: The friction force can be supplied here.

ReadingMode: This parameter selects the pressure or force target variables in the ST_TcHydAxRtData structure.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The actual pressure of the axis is determined by evaluating the variable AdcValueA, AdcValueB. The result is stored in ST_TcHydAxRtData.fActForce.

Note: The parameter values associated with an axis can be stored along with the axis parameters by holding them in ST_TcHydAxParam.fCustomerData[...]. The associated parameters will be loaded, stored, saved and if needed even exported and imported along with the standard parameters of the axis.

Reading a differential pressure

There are at least three strategies for the setup of this block.

Setup Procedure A (only for ±10V transducers)

There is no active move requirred. The achievable accuracy is fairly good for high accuracy pressure transducers.

  • Use the max. pressure parameter of the transducers divided by AdcValueAMAX and AdcValueBMAX resp.
  • Set ScaleOffsetA to 0.
  • If the block is used to read actual pressure the parameters ScaleArreaA and ScaleArreaB have to be set to 1.0. Otherwise these parameters have to be set in units of mm2 to find the actual force in N (= Newton).

Setup Procedure B

This strategy requirres the application of the full system pressure on both blocks. There is no need for a real movement of the axis. Mechanical means like preliminary blocks can be used to disable the axis travel by part or completely.

  • All blocks that may respond to ST_TcHydAxRtData.fActForce have to be disabled.
  • The axis has to be moved at low speed against the lower mechanical end of travel. Document AdcValueA and AdcValueB here. The A side should be applied system pressure and the B side should see the tank pressure now. If this is not true for any reason the actual pressure levels have to be messured.
  • In the next step the axis has to be moved at low speed against the upper mechanical end of travel. Repeat the above mentioned procedure here.
  • The parameter values can be calculated by using the formulas below:

    ScaleFactorA := (DruckAMAX - DruckAMIN) / (AdcValueAMAX - AdcValueAMIN);

    ScaleFactorB := (DruckBMAX - DruckBMIN) / (AdcValueBMAX - AdcValueBMIN);

    ScaleOffsetA := DruckAMIN - ScaleFactorA * AdcValueAMIN;

    ScaleOffsetB := DruckBMIN - ScaleFactorB * AdcValueBMIN;

Setup Procedure C

There is no active move requirred. This strategy will lead to a somewhat reduced accuracy.

  • Start by releafing any pressure from the axis. Be sure to stop the pump and to float all accumulators.
  • Be sure that there are no external forces (e.g. gravity) that to create a cylinder pressure. Use mechanical blocks etc. Activate the valve several times in both directions to relief any cylinder pressure.
  • Find and document AdcValueA and AdcValueB. This should reflect the tank pressure and the environment situation. If this is not true the actual pressure has to be messured. All values found have to be used in the formulas above attributed as MIN values.
  • From the transducers data sheet find the max. pressure that will give the full (10 Volt, 20 mA) signal. Use the full scale response of the electrical interface component (KL..., EL...) as AdcValueA and AdcValueB. All values found have to be used in the formulas above attributed as MAX values.
  • Use the formulas from above to find the parameter values.

Reading an effective force

For reading an effective force start as described above. By setting propper values for ScaleArreaA and ScaleArreaB the block is commanded to convert the actual values from pressure in bar to force in Newton.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtReadForceSingle_BkPlcMc

FUNCTION_BLOCK MC_AxRtReadForceSingle_BkPlcMc (starting with V3.0)

The function block performs determination of the actual force of the axis from the input data of an analog input terminal.

Note: If there is a pressure transducer on the A- and B-side of the axis a function block of type MC_AxRtReadForceDiff_BkPlcMc can be used. If the actual pressure is to be determined a MC_AxRtReadPressureDiff_BkPlcMc block should be used.

VAR_INPUT
        AdcValue:               INT:=0;
        ScaleFactor:    LREAL:=0.0;
        ScaleOffset:    LREAL:=0.0;
        SlippingOffset: LREAL:=0.0;
        ReadingMode:    E_TcMcPressureReadingMode:=iTcHydPressureReadingDefault;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

AdcValue: The input data of the analog terminal.

ScaleFactor: The weighting factor. This value defines the pressure change equivalent to one ADC step.

ScaleOffset: This offset is used for shifting the zero point of the pressure scales.

SlippingOffset: The friction force can be supplied here.

ReadingMode: This parameter selects the pressure or force target variables in the ST_TcHydAxRtData structure.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The actual pressure of the axis is determined by evaluating the variable AdcValue. The result is stored in ST_TcHydAxRtData.fActForce.

Note: The parameter values associated with an axis can be stored along with the axis parameters by holding them in ST_TcHydAxParam.fCustomerData[...]. The associated parameters will be loaded, stored, saved and if needed even exported and imported along with the standard parameters of the axis.

Setup procedure A

There is no active move requirred. The achievable accuracy is fairly good for a high accuracy pressure transducer.

  • Use the max. pressure parameter of the transducer divided by AdcValueAMAX and AdcValueBMAX resp.
  • Set ScaleOffsetA to 0.
  • If the block is used to read actual pressure the parameter ScaleArreaA has to be set to 1.0. Otherwise this parameter has to be set in units of mm2 to find the actual force in N (= Newton).

Setup procedure B

For this procedure it is required that both mechanical ends of the axes travel can be pressed at by the full system pressure. If this cannot be done the axes travel can be limited by applying temporarily mounted mechanical limits or even by blocking the axis completely because a real move of the axis is not required.

  • All function blocks have to be deactivated that would be responding on the value of ST_TcHydAxRtData.fActForce.
  • At a low speed level the axis has to be moved against the lower mechanical limit. The value of AdcValue has to be documented. In this situation the B-side should be applied the system pressure and the A-side should be supplied the storage pressure. If this is by any reason not true the pressure on A- and B-side have to be determined and documented, too.
  • At a low speed level the axis has to be moved against the upper mechanical limit. Here the value of AdcValue and the pressure values have to be documented, too.
  • The parameter values have to be calculated like this:

    ScaleFactor := (PressureMAX - PressureMIN) / (AdcValueMAX - AdcValueMIN);

    ScaleOffset := PressureMIN - ScaleFactor * AdcValueMIN;

Setup procedure C

As an alternative the setup can be done without any activity of the axis. This procedure cannot reach the accuracy of procedure A.

  • The axis has to completely decompressed. The compressor has to be deactivated and accumulator has to be released.
  • Be sure that the axis is not creating pressure itself. Block the axis mechanically to avoid pressure buildup by external forces like gravity. Release stored pressure in closed cavities by opening the valve in both directions.
  • Now the value of AdcValue has to be documented. In this situation the B-side should be applied the system pressure and the A-side should be supplied the storage pressure. If this is by any reason not true the pressure on A- and B-side have to be determined and documented, too. The results from this step have to be used as MIN values in the formulas above.
  • From the data sheets of the pressure transducer find the pressure for the upper limit (10 Volts, 20 mA). For AdcValue the full scale value for the converted electrical signal is assumed. This value has to be used as MAX values in the formulas above.
  • Now the parameter values can be calculated as above.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtReadPressureDiff_BkPlcMc

FUNCTION_BLOCK MC_AxRtReadPressureDiff_BkPlcMc (starting with V3.0)

The function block performs determination of the actual pressure of the axis from the input data of two analog input terminals.

Note: If there is just one pressure transducer a function block of type MC_AxRtReadPressureSingle_BkPlcMc should be used. If the actual force is to be determined a MC_AxRtReadForceDiff_BkPlcMc block should be used.

VAR_INPUT
        AdcValueA:      INT:=0;
        AdcValueB:      INT:=0;
        ScaleFactorA:   LREAL:=0.0;
        ScaleOffsetA:   LREAL:=0.0;
        ScaleFactorB:   LREAL:=0.0;
        ScaleOffsetB:   LREAL:=0.0;
        ReadingMode:    E_TcMcPressureReadingMode:=iTcHydPressureReadingDefault;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

AdcValueA, AdcValueB: The input data of the analog terminals.

ScaleFactorA, ScaleFactorB: The weighting factors. These values define the pressure change equivalent to one ADC step.

ScaleOffsetA, ScaleOffsetB: These offsets are used for shifting the zero point of the pressure scales.

ReadingMode: This parameter selects the pressure or force target variables in the ST_TcHydAxRtData structure.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block investigates the axis interface that has been passed to it every time it is called. A problem can be detected and reported during this process:

  • If the pointer pStAxRtData in Axis_Ref_BkPlcMc is not initialised, the block reacts with a Error and ErrorID:=dwTcHydErrCdPtrMcPlc. In this case, the axis cannot be placed into a fault state.

If it is possible to carry out these checks without encountering any problems, the actual pressure of the axis is determined by evaluating the variables AdcValueA and AdcValueB. The result is stored in ST_TcHydAxRtData.fActPressure.

Note: The parameter values associated with an axis can be stored along with the axis parameters by holding them in ST_TcHydAxParam.fCustomerData[...]. The associated parameters will be loaded, stored, saved and if needed even exported and imported along with the standard parameters of the axis.

Setup Procedure A (only for ±10V transducers)

There is no active move requirred. The achievable accuracy is fairly good for high accuracy pressure transducers.

  • To find the ScaleFactorA use the max. pressure parameter of the transducers divided by AdcValueAMAX and AdcValueBMAX resp.
  • Set ScaleOffsetA to 0.

Setup procedure B

For this procedure it is required that both mechanical ends of the axes travel can be pressed at by the full system pressure. If this cannot be done the axes travel can be limited by applying temporarily mounted mechanical limits or even by blocking the axis completely because a real move of the axis is not required.

  • All function blocks have to be deactivated that would be responding on the value of ST_TcHydAxRtData.fActPressure.
  • At a low speed level the axis has to moved against the lower mechanical limit. The value of AdcValueA and AdcValueB have to be documented. In this situation the B-side should be applied the system pressure and the A-side should be supplied the storage pressure. If this is by any reason not true the pressure on A- and B-side have to be determined and documented, too.
  • At a low speed level the axis has to moved against the upper mechanical limit. Here the value of AdcValueA and AdcValueB and the pressure values have to be documented, too.
  • The parameter values have to be calculated like this:

    ScaleFactorA := (PressureAMAX - PressureAMIN) / (AdcValueAMAX - AdcValueAMIN);

    ScaleFactorB := (PressureBMAX - PressureBMIN) / (AdcValueBMAX - AdcValueBMIN);

    ScaleOffsetA := PressureAMIN - ScaleFactorA * AdcValueAMIN;

    ScaleOffsetB := PressureBMIN - ScaleFactorB * AdcValueBMIN;

Setup procedure C

As an alternative the setup can be done without any activity of the axis. This procedure cannot reach the accuracy of procedure A.

  • The axis has to completely decompressed. The compressor has to be deactivated and accumulator has to be released.
  • Be sure that the axis is not creating pressure itself. Block the axis mechanically to avoid pressure buildup by external forces like gravity. Release stored pressure in closed cavities by opening the valve in both directions.
  • Now the values of AdcValueA and AdcValueB have to be documented. In this situation the B-side should be applied the system pressure and the A-side should be supplied the storage pressure. If this is by any reason not true the pressure on A- and B-side have to be determined and documented, too. The results from this step have to be used as MIN values in the formulas above.
  • From the data sheets of the pressure transducers find the pressure for the upper limit (10 Volts, 20 mA). For AdcValueA and AdcValueB the full scale value for the converted electrical signal is assumed. These values have to be used as MAX values in the formulas above.
  • Now the parameter values can be calculated as above.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtReadPressureSingle_BkPlcMc

FUNCTION_BLOCK MC_AxRtReadPressureSingle_BkPlcMc (starting with V3.0)

The function block performs determination of the actual pressure of the axis from the input data of an analog input terminals.

Note: If there is a pressure transducer on the A- and B-side of the axis a function block of type MC_AxRtReadPressureDiff_BkPlcMc should be used. If the actual pressure is to be determined a MC_AxRtReadForceSingle_BkPlcMc block should be used.

VAR_INPUT
        AdcValue:               INT:=0;
        ScaleFactor:    LREAL:=0.0;
        ScaleOffset:    LREAL:=0.0;
        ReadingMode:    E_TcMcPressureReadingMode:=iTcHydPressureReadingDefault;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

AdcValue: The input data of the analog terminal.

ScaleFactor: The weighting factor. This value defines the pressure change equivalent to one ADC step.

ScaleOffset: This offset is used for shifting the zero point of the pressure scales.

ReadingMode: This parameter selects the pressure or force target variables in the ST_TcHydAxRtData structure.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block investigates the axis interface that has been passed to it every time it is called. A problem can be detected and reported during this process:

  • If the pointer pStAxRtData in Axis_Ref_BkPlcMc is not initialised, the block reacts with a Error and ErrorID:=dwTcHydErrCdPtrMcPlc. In this case, the axis cannot be placed into a fault state.

If it is possible to carry out these checks without encountering any problems, the actual pressure of the axis is determined by evaluating the variable AdcValue. The result is stored in ST_TcHydAxRtData.fActPressure.

Note: The parameter values associated with an axis can be stored along with the axis parameters by holding them in ST_TcHydAxParam.fCustomerData[...]. The associated parameters will be loaded, stored, saved and if needed even exported and imported along with the standard parameters of the axis.

Setup Procedure A (only for ±10V transducers)

There is no active move requirred. The achievable accuracy is fairly good for high accuracy pressure transducers.

  • Use the max. pressure parameter of the transducers divided by AdcValueAMAX and AdcValueBMAX resp.
  • Set ScaleOffsetA to 0.

Setup procedure B

For this procedure it is required that both mechanical ends of the axes travel can be pressed at by the full system pressure. If this cannot be done the axes travel can be limited by applying temporarily mounted mechanical limits or even by blocking the axis completely because a real move of the axis is not required.

  • All function blocks have to be deactivated that would be responding on the value of ST_TcHydAxRtData.fActPressure.
  • At a low speed level the axis has to moved against the lower mechanical limit. The value of AdcValue has to be documented. In this situation the B-side should be applied the system pressure and the A-side should be supplied the storage pressure. If this is by any reason not true the pressure on A- and B-side have to be determined and documented, too.
  • At a low speed level the axis has to moved against the upper mechanical limit. Here the value of AdcValue and the pressure values have to be documented, too.
  • The parameter values have to be calculated like this:

    ScaleFactor := (PressureMAX - PressureMIN) / (AdcValueMAX - AdcValueMIN);

    ScaleOffset := PressureMIN - ScaleFactor * AdcValueMIN;

Setup procedure C

As an alternative the setup can be done without any activity of the axis. This procedure cannot reach the accuracy of procedure A.

  • The axis has to completely decompressed. The compressor has to be deactivated and accumulator has to be released.
  • Be sure that the axis is not creating pressure itself. Block the axis mechanically to avoid pressure buildup by external forces like gravity. Release stored pressure in closed cavities by opening the valve in both directions.
  • Now the value of AdcValue has to be documented. In this situation the B-side should be applied the system pressure and the A-side should be supplied the storage pressure. If this is by any reason not true the pressure on A- and B-side have to be determined and documented, too. The results from this step have to be used as MIN values in the formulas above.
  • From the data sheets of the pressure transducer find the pressure for the upper limit (10 Volts, 20 mA). For AdcValue the full scale value for the converted electrical signal is assumed. This value has to be used as MAX values in the formulas above.
  • Now the parameter values can be calculated as above.


TcPlcHydraulics: PLCopen Motion Control: System: MC_FunctionGeneratorFD_BkPlcMc

FUNCTION_BLOCK MC_FunctionGeneratorFD_BkPlcMc (starting with V3.0.31)

The block calculates the signals of a function generator.

VAR_OUTPUT
        Sinus:          LREAL;
        Cosinus:                LREAL;
        Rectangle:      LREAL;
        SawTooth:       LREAL;
END_VAR

VAR_INOUT
        stTimeBase:     ST_FunctionGeneratorTB_BkPlcMc;
        stFunctionDef:  ST_FunctionGeneratorFD_BkPlcMc;
END_VAR

Sinus, Cosinus, Rectangle, SawTooth: The output signals of the function generator.

stTimeBase: A structure containing the parameters of the timebase of the function generator.

stFunctionDef: A structure containing the definition of the output signals of the function generator.

Behaviour of the block

The output signals are calculated by using stTimeBase.CurrentRatio and the parameters in stFunctionDef.

Note: The timebase in stTimeBase is to be updated by calling a MC_FunctionGeneratorTB_BkPlcMc() block.

Note: It is recommended to use a MC_FunctionGeneratorSetFrq_BkPlcMc() block for changing the working frequency.


TcPlcHydraulics: PLCopen Motion Control: System: MC_FunctionGeneratorSetFrq_BkPlcMc

FUNCTION_BLOCK MC_FunctionGeneratorSetFrq_BkPlcMc (starting with V3.0.31)

The block updates the working frequency of a timebase for one or more function generators.

VAR_INPUT
        Frequency:      LREAL;
        CycleTime:      LREAL;
END_VAR

VAR_INOUT
        stTimeBase:     ST_FunctionGeneratorTB_BkPlcMc;
END_VAR

Frequency: The working frequency to be used.

CycleTime: The cycle time of the calling task.

stTimeBase: A structure containing the parameters of the timebase of the function generator.

Behaviour of the block

The block will update stTimeBase.Frequency by using the supplied value. If there is a reason stTimeBase.CurrentTime is updated.

Note: The block is using stTimeBase.Freeze to prevent collisions with MC_FunctionGeneratorTB_BkPlcMc() blocks. Calling the blocks from different tasks is save.


TcPlcHydraulics: PLCopen Motion Control: System: MC_FunctionGeneratorTB_BkPlcMc

FUNCTION_BLOCK MC_FunctionGeneratorTB_BkPlcMc (starting with V3.0.31)

The block updates the timebase for one or more function generators.

VAR_INPUT
        CycleTime:      LREAL;
END_VAR

VAR_INOUT
        stTimeBase:     ST_FunctionGeneratorTB_BkPlcMc;
END_VAR

CycleTime: The cycle time of the calling task.

stTimeBase: A structure containing the parameters of the timebase of the function generator.

Behaviour of the block

If stTimeBase.Freeze is FALSE stTimeBase.CurrentTime is updated by using CycleTime.stTimeBase.CurrentRatio is calculated by using stTimeBase.Frequency.

Note: The use of a MC_FunctionGeneratorSetFrq_BkPlcMc() block for changing the working frequency is recommended.


TcPlcHydraulics: PLCopen Motion Control: System: TableFunctions: MC_AxTableFromAsciFile_BkPlcMc

FUNCTION_BLOCK MC_AxTableFromAsciFile_BkPlcMc (starting with V3.0)

The block reads the content of a table from an ASCII file.

VAR_INPUT
        Execute:                BOOL:=FALSE;
        pTable:         POINTER TO LREAL:=0;
        LowIdx:         INT:=0;
        HighIdx:                INT:=0;
        FileName:               STRING(255):='';
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        LastIdx:                INT:=0;
END_VAR

Execute : The operation is initiated by a rising edge at this input.

pTable: The address on an ARRAY[nFirstIdx..nLastIdx,1..2] is to be passed here.

LowIdx: The lowest index of the ARRAY addressed by pTable is to be passed here.

HighIdx: The highest index of the ARRAY addressed by pTable is to be passed here.

FileName: An optional file name can be supplied here.

Busy: A pending command is indicated here.

Done : Successful processing of the operation is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

LastIdx: The index of the last entry defined by the reading process is reported here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If LowIdx is negative it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.
  • If pTable=0 it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.
  • If LowIdx and HighIdx are defining a table with less than 5 entrys it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.

If all these checks can be carried out without problems the reading process starts. A TRUE at Busy is signaling the activity of the block. If there is a problem during the operation the block will respond with Error and an ErrorID. A success is signaled by Done.

A falling edge at Execute clears all the pending output signals. If, while the movement is still active, Execute is set to FALSE, execution of the movement that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, Done) are made available for one cycle.

Note: If FileName is supplied it has to be complete (including all neccesary components like drive, path and extension) because the block will use it as is.

Note: If FileName is not supplied the path and file name used here are the same as supplied to the MC_AxUtiStandardInit_BkPlcMc block. The extension TXT is assumed to differentiate from the parameter file using the extension DAT.

Warning : The content of the file may be read or modified by using an ASCII editor. Any modifications of the content may cause unexpected results or even inhibit the reading process. Manual modification has to be avoided at all or done with extra care by educated persons only.


TcPlcHydraulics: PLCopen Motion Control: System: TableFunctions: MC_AxTableFromBinFile_BkPlcMc

FUNCTION_BLOCK MC_AxTableFromBinFile_BkPlcMc (starting with V3.0)

The block reads the content of a table from a binary file.

VAR_INPUT
        Execute:                BOOL:=FALSE;
        pTable:         POINTER TO LREAL:=0;
        LowIdx:         INT:=0;
        HighIdx:                INT:=0;
        FileName:               STRING(255):='';
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
        LastIdx:                INT:=0;
END_VAR

Execute : The operation is initiated by a rising edge at this input.

pTable: The address on an ARRAY[nFirstIdx..nLastIdx,1..2] is to be passed here.

LowIdx: The lowest index of the ARRAY addressed by pTable is to be passed here.

HighIdx: The highest index of the ARRAY addressed by pTable is to be passed here.

FileName: An optional file name can be supplied here.

Busy: A pending command is indicated here.

Done : Successful processing of the operation is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

LastIdx: The index of the last entry defined by the reading process is reported here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If LowIdx is negative it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.
  • If pTable=0 it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.
  • If LowIdx and HighIdx are defining a table with less than 5 entrys it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.

If all these checks can be carried out without problems the reading process starts. A TRUE at Busy is signaling the activity of the block. If there is a problem during the operation the block will respond with Error and an ErrorID. A success is signaled by Done.

A falling edge at Execute clears all the pending output signals. If, while the movement is still active, Execute is set to FALSE, execution of the movement that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, Done) are made available for one cycle.

Note: If FileName is supplied it has to be complete (including all neccesary components like drive, path and extension) because the block will use it as is.

Note: If FileName is not supplied the path and file name used here are the same as supplied to the MC_AxUtiStandardInit_BkPlcMc block. The extension TBL is assumed to differentiate from the parameter file using the extension DAT.

Warning : The content of the file can not be read or modified by using an ASCII editor. Do not try to change the file manually.


TcPlcHydraulics: PLCopen Motion Control: System: TableFunctions: MC_AxTableReadOutNonCyclic_BkPlcMc

FUNCTION_BLOCK MC_AxTableReadOutNonCyclic_BkPlcMc (starting with V3.0)

The function block determines the slave values corresponding to a master value by using a data table.

Note: The block is a subcomponent of an axis cam or other similar nonlinear gear. Usually it is not directly called by the application.

VAR_INPUT
        pTable:         POINTER TO LREAL:=0;
        fMasterValue:   LREAL:=0.0;
        nFirstIdx:      UDINT:=1;
        nLastIdx:               UDINT:=1;
        bReInit:                BOOL:=FALSE;
END_VAR

VAR_OUTPUT
        fSlaveValue:    LREAL:=0.0;
        fSlaveGear:     LREAL:=0.0;
        bUnderRange:    BOOL;
        bOverRange:     BOOL;
END_VAR

pTable: The address of an ARRAY[nFirstIdx..nLastIdx,1..2] is to be passed here.

Attention : An invalid information here may cause a crash of the PLC application by triggering fatal runtime errors (Page Fault Exception).

fMasterValue: Here the master value is to be passed, that has to be converted in a slave value.

nFirstIdx: The lower boundary index of the ARRAY is to be passed here.

Attention : An invalid information here may cause a crash of the PLC application by triggering fatal runtime errors (Page Fault Exception).

nLastIdx: The upper boundary index of the ARRAY is to be passed here.

Attention : An invalid information here may cause a crash of the PLC application by triggering fatal runtime errors (Page Fault Exception).

bReInit: This signal is forcing the block to reinitialise the search precedure to tha start of the table.

fSlaveValue: The slave value corresponding fMasterValue is output here.

fSlaveGear: Here the lokal derivative of the slave values at the location defined by the master value is supplied.

bUnderRange: This signal is TRUE if the master value is matching or exceeding the lower border of the table.

bOverRange: This signal is TRUE if the master value is matching or exceeding the upper border of the table.

Behaviour of the block:

The block is searching the table for a pair of master values that matches or contains the supplied fMasterValue. In the identified interval a linear interpolation is calculated. The result is output as fSlaveValue. The local derivative found by this calculation is presented as fSlaveGear.

If the fMasterValue is below the range of values in the table bUnderRange is signalled. fSlaveValue is set to the value at the lower border of the table. fSlaveGear is set to 0.0.

If the fMasterValue is above the range of values in the table bOverRange is signalled. fSlaveValue is set to the value at the upper border of the table. fSlaveGear is set to 0.0.

The output value fSlaveGear is the ratio of the first derivative of fMasterValue and fSlaveValue. If fMasterValue is a position or a virtual time the slave velocity setpoint can be calculated by multiplying the master velocity and fSlaveGear. This can be used for creating a velocity feed forward. The use of a MC_AxRtSetExtGenValues_BkPlcMc block is recommended here.


TcPlcHydraulics: PLCopen Motion Control: System: TableFunctions: MC_AxTableToAsciFile_BkPlcMc

FUNCTION_BLOCK MC_AxTableToAsciFile_BkPlcMc (starting with V3.0)

The block writes the content of a table to an ASCII file.

VAR_INPUT
        Execute:                BOOL:=FALSE;
        pTable:         POINTER TO LREAL:=0;
        LowIdx:         INT:=0;
        HighIdx:                INT:=0;
        FileName:               STRING(255):='';
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

Execute : The operation is initiated by a rising edge at this input.

pTable: The address on an ARRAY[nFirstIdx..nLastIdx,1..2] is to be passed here.

LowIdx: The lowest index of the ARRAY addressed by pTable is to be passed here.

HighIdx: The highest index of the ARRAY addressed by pTable is to be passed here.

FileName: An optional file name can be supplied here.

Busy: A pending command is indicated here.

Done : Successful processing of the operation is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If LowIdx is negative it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.
  • If pTable=0 it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.
  • If LowIdx and HighIdx are defining a table with less than 5 entrys it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.

If all these checks can be carried out without problems the writing process starts. A TRUE at Busy is signaling the activity of the block. If there is a problem during the operation the block will respond with Error and an ErrorID. A success is signaled by Done.

A falling edge at Execute clears all the pending output signals. If, while the movement is still active, Execute is set to FALSE, execution of the movement that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, Done) are made available for one cycle.

Note: If FileName is supplied it has to be complete (including all neccesary components like drive, path and extension) because the block will use it as is.

Note: If FileName is not supplied the path and file name used here are the same as supplied to the MC_AxUtiStandardInit_BkPlcMc block. The extension TXT is assumed to differentiate from the parameter file using the extension DAT.

Warning : The content of the file may be read or modified by using an ASCII editor. Any modifications of the content may cause unexpected results or even inhibit the reading process. Manual modification has to be avoided at all or done with extra care by educated persons only.


TcPlcHydraulics: PLCopen Motion Control: System: TableFunctions: MC_AxTableToBinFile_BkPlcMc

FUNCTION_BLOCK MC_AxTableToBinFile_BkPlcMc (starting with V3.0)

The block writes the content of a table to a binary file.

VAR_INPUT
        Execute:                BOOL:=FALSE;
        pTable:         POINTER TO LREAL:=0;
        LowIdx:         INT:=0;
        HighIdx:                INT:=0;
        FileName:               STRING(255):='';
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

Execute : The operation is initiated by a rising edge at this input.

pTable: The address on an ARRAY[nFirstIdx..nLastIdx,1..2] is to be passed here.

LowIdx: The lowest index of the ARRAY addressed by pTable is to be passed here.

HighIdx: The highest index of the ARRAY addressed by pTable is to be passed here.

FileName: An optional file name can be supplied here.

Busy: A pending command is indicated here.

Done : Successful processing of the operation is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If LowIdx is negative it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.
  • If pTable=0 it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.
  • If LowIdx and HighIdx are defining a table with less than 5 entrys it responds with Error and ErrorID=dwTcHydErrCdTblEntryCount.

If all these checks can be carried out without problems the writing process starts. A TRUE at Busy is signaling the activity of the block. If there is a problem during the operation the block will respond with Error and an ErrorID. A success is signaled by Done.

A falling edge at Execute clears all the pending output signals. If, while the movement is still active, Execute is set to FALSE, execution of the movement that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, Done) are made available for one cycle.

Note: If FileName is supplied it has to be complete (including all neccesary components like drive, path and extension) because the block will use it as is.

Note: If FileName is not supplied the path and file name used here are the same as supplied to the MC_AxUtiStandardInit_BkPlcMc block. The extension TBL is assumed to differentiate from the parameter file using the extension DAT.

Warning : The content of the file can not be read or modified by using an ASCII editor. Do not try to change the file manually.


TcPlcHydraulics: PLCopen Motion Control: System: Generators: MC_AxRuntime_BkPlcMc

FUNCTION_BLOCK MC_AxRuntime_BkPlcMc (starting with V3.0)

This function block performs the task of a set point generator. For this purpose, a profile specific block is called, depending on what value has been specified for the nProfile_Type in Axis.pStAxParam.

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block investigates the axis interface that has been passed to it every time it is called. A number of problems can be detected and reported during this process:

  • If one of the pointers has not been initialised the block reacts with Error and with ErrorID:=dwTcHydErrCdPtrPlcMc or dwTcHydErrCdPtrMcPlc.

If it is possible to carry out these checks without encountering any problems, the set value generation is executed by calling an appropriate block corresponding to the nProfileType in Axis.pStAxParams.

The following generators are presently available:

nProfileType Description
iTcMc_ProfileCtrlBased Standardprofil: Single-stage time referenced acceleration, displacement referenced (square root) braking ramp, target approach at creep velocity, selectable behaviour when stationary.

With the exception of fault states and external or geared setpoint generating states the axis can be startet without care for current states.

Warning: Overshooting the new target can happen even if the axis is in front of the target position at the time of the start.

Warning: Depending on and controlled by parameter settings the block is able to perform an automatic start and change the axis state into active motion.

Note: This generator type can optional be set to work completely time based, constantly activating a closed lag control loop.
iTcMc_ProfileJerkBased Standardprofil: Single or two stage time referenced acceleration with optional jerk limiting, displacement referenced (square root) braking ramp, target approach at limited jerk, selectable behaviour when stationary.

With the exception of fault states and external or geared setpoint generating states the axis can be startet without care for current states.

Warning: Overshooting the new target can happen even if the axis is in front of the target position at the time of the start.

Warning: Depending on and controlled by parameter settings the block is able to perform an automatic start and change the axis state into active motion.

Note: This generator type can optional be set to work completely time based, constantly activating a closed lag control loop.

Attention: This generator may not support some funktions by part or as a hole.
iTcMc_ProfileTimePosCtrl Attention: Listed vor compatibility, will not be supported in the future.

Specialised profil: Two stage acceleration (initially time referenced, then displacement referenced following square root curve), displacement referenced (square root) braking ramp, target approach at creep velocity, selectable behaviour when stationary.

It is not possible to execute a start for an axis that is already travelling (new target, new velocity etc.).
iTcMc_ProfileCosine Attention: Listed vor compatibility, will not be supported in the future.

Specialised profil: Two stage acceleration (initially time referenced, then displacement referenced following cosine curve), displacement referenced (cosine) braking ramp, target approach at creep velocity, selectable behaviour when stationary.

It is not possible to execute a start for an axis that is already travelling (new target, new velocity etc.).
iTcMc_ProfileTimeRamp Specialised profil: Single stage time referenced acceleration, time referenced braking ramp, target approach at creep velocity, selectable (some restrictions) behaviour when stationary. This generator is using digital position cams instead of an encoder.

Starting an active moving axis is possible.

Note: This generator type is targeting axes that are replacing digital cam switches for the encoder.

Note: If only the usual blocks (encoder, generator, finish, drive) for the axis are going to be called, then a block of type MC_AxStandardBody_BkPlcMc should be used for the sake of simplicity.

iTcMc_ProfileCtrlBased

The profile of a time controlled acceleration phase, a displacement referenced braking phase following a square root curve, and a target approach at creep velocity is generated.

The arrows on the profile of the control value suggest how the shape of the curve can be affected through the parameters of the move order or of the axis. To begin the acceleration follows a time-controlled ramp function "1" until the required travel velocity "2" is reached. This control value is maintained until a displacement, calculated previously when the movement started, is reached. After this point, a displacement-referenced ramp "3" is followed to brake down from the main travel velocity to the creep velocity "5"; this control value is reached at a specified distance, "4", from the target. This control value is retained until the target has been approached to within a specified remaining distance "6". The axis is then switched to its idle behaviour.

Parameters active in the travel profile

Start ramp "1": The smallest of the following values is the effective one: fMaxAcc and fAcc in Axis.pStAxParam, Acceleration of the block used to start the axis (for example: MC_MoveAbsolute_BkPlcMc).

Travel phase "2": The smallest of the following values is the effective one: fRefVelo and fMaxVelo in Axis.pStAxParam, Velocity of the block used to start the axis (for example: MC_MoveAbsolute_BkPlcMc).

Braking ramp "3": The smallest of the following values is the effective one: fMaxDec and fDec in Axis.pStAxParam, Deceleration of the block used to start the axis (for example: MC_MoveAbsolute_BkPlcMc).

Creep phase "4", "5": The values of fCreepSpeed and fCreepDistance in Axis.pStAxParamhave an effect.

Transfer to target "6": The fBrakeDistance and/or fBrakeDeadTime in Axis.pStAxParamhave an effect.

Automatic start on an axis

If the distance between the actual position and the current destination position of an axis is exceeding the value of Axis.pStAxParam.fReposDistance an automatic start id released.

iTcMc_ProfileJerkBased

The profile of a time controlled acceleration phase with optional jerk limiting, a displacement referenced braking phase following a square root curve, and a target approach at limited jerk is generated.

The arrows on the profile of the control value suggest how the shape of the curve can be affected through the parameters of the move order or of the axis. To begin the acceleration follows a time-controlled ramp function "1" until the required travel velocity "2" is reached. An optional jerk limiting "6" may become active here. The control value is maintained until a displacement, calculated previously when the movement started, is reached. After this point, a displacement-referenced ramp "3" is followed to brake down from the main travel velocity to a specified distance from the target. This braking operation is controled by a defined deceleration "4" that is relieved by a limited jerk "5". The axis is then switched to its idle behaviour.

Parameters active in the travel profile

Start ramp "1": The smallest of the following values is the effective one: fMaxAcc and fAcc in Axis.pStAxParam, Acceleration of the block used to start the axis (for example: MC_MoveAbsolute_BkPlcMc).

Travel phase "2": The smallest of the following values is the effective one: fRefVelo and fMaxVelo in Axis.pStAxParam, Velocity of the block used to start the axis (for example: MC_MoveAbsolute_BkPlcMc).

Braking ramp "3", "4": The smallest of the following values is the effective one: fMaxDec and fDec in Axis.pStAxParam, Deceleration of the block used to start the axis (for example: MC_MoveAbsolute_BkPlcMc).

Transfer to target "5": The smallest of the following values is the effective one: fMaxJerk in Axis.pStAxParam, fJerk of the block used to start the axis (for example: MC_MoveAbsolute_BkPlcMc).

iTcMc_ProfileTimePosCtrl

Attention: Listed vor compatibility, will not be supported in the future. It must not be used in new projects and it is recommended to be replaced wherever possible.

iTcMc_ProfileCosine

Attention: Listed vor compatibility, will not be supported in the future. It must not be used in new projects and it is recommended to be replaced wherever possible.

iTcMc_ProfileTimeRamp

The profile of a time referenced acceleration phase, a time referenced braking phase and a target approach at creep velocity is generated.

The arrows on the profile of the control value suggest how the shape of the curve can be affected through the parameters of the move order or of the axis. To begin the acceleration follows a time-controlled ramp function "1" until the required travel velocity "2" is reached. This control value is maintained until the position cam information signals the start of the targeting phase. After this point, a time-referenced ramp "3" is followed to brake down from the main travel velocity to the creep velocity "4". This control value is retained until the position cam information signals that the target has been approached. The axis is then switched to its idle behaviour.

Parameters active in the travel profile

Start ramp "1": fStartRamp in Axis.pStAxParam.

Travel phase "2": The smallest of the following values is the effective one: fRefVelo and fMaxVelo in Axis.pStAxParam, Velocity of the block used to start the axis (for example: MC_MoveAbsolute_BkPlcMc).

Braking ramp "3": fStopRamp in Axis.pStAxParam.

Creep phase "4": fCreepSpeed in Axis.pStAxParam.

Behaviour of the block when starting over

If there is a startover command while the axis is actively moving there are two different cases.

This profile is generated in case of a startover in the same direction but different (here with higher) velocity.

This profile is generated in case of a startover in oposite direction, here with the same velocity.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtCheckSyncDistance_BkPlcMc

FUNCTION_BLOCK MC_AxRtCheckSyncDistance_BkPlcMc (starting with V3.0)

On homing operations the block checks the distance between reference cam and sync pulse.

VAR_INPUT
        MaxDistance:    LREAL;
        MinDistance:    LREAL;
        MaxIndexWidth:  LREAL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_OUTPUT
        Active:         BOOL;
        Exceeded:       BOOL;
END_VAR

MaxDistance: The maximum acceptable distance between reference cam signal and sync pulse is to be passed here.

MinDistance: The minimum acceptable distance between reference cam signal and sync pulse is to be passed here.

MaxIndexWidth: The minimum acceptable travel for leaving the cam signal is to be passed here. (starting with V3.0.20).

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Exceeded: This signal becomes TRUE if the axis has travelled more than MaxDistance after the falling edge of the reference cam without detecting a sync pulse from the encoder.

Active: This signal is TRUE when the axis has left the reference cam and is scanning for the sync pulse.

Behaviour of the block:

The block recognises the different parts of the referencing of the axis and monitors the travelled distances. There are three possible problems that will be recognised:

  • The axis is traveling more than MaxIndexWidth but the cam signal is still TRUE.
  • The axis is traveling MaxDistance but the sync pulse hasn't been found.
  • The sync pulse is detected before the axis has traveled at least MinDistance.

Any of this problems will be signaled by Exceeded. To abort the homing and place the axis in an error state a MC_AxRtGoErrorState_BkPlcMc block can be activated by this signal. There is a predefined error code dwTcHydErrCdEncSyncDist for this situation.

Note: Any or all of the mentioned monitoring operations can be disabled by setting the parameter to 0.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtFinish_BkPlcMc

FUNCTION_BLOCK MC_AxRtFinish_BkPlcMc (starting with V3.0)

This function block adapts the control value that has been generated to the special features of the particular axis. If a valve diagram linearisation is required use a MC_AxRtFinishLinear_BkPlcMc block.

Warning : This block must not be called for an axis, that has a block of type MC_AxCtrlPressureCompensation_BkPlcMc.

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block investigates the axis interface that has been passed to it every time it is called. A number of problems can be detected and reported during this process:

  • If one of the pointers has not been initialised the block reacts with Error and with ErrorID:=dwTcHydErrCdPtrPlcMc or dwTcHydErrCdPtrMcPlc.

If it is possible to carry out these checks without encountering any problems, adaptation of the control value for the axis is carried out according to the value in Axis.pStAxParams.

  • The control value for the advance and the positional control reaction are combined to form the output control value.
  • Area compensation is taken into account.
  • Compensation is applied for a bend in the characteristic curve.
  • The overlap compensation, the press control value and the offset compensation are included in the calculation.

Note: If only the usual blocks (encoder, generator, finish, drive) for the axis are going to be called, then a block of type MC_AxStandardBody_BkPlcMc should be used for the sake of simplicity.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtFinish_BkPlcMc

FUNCTION_BLOCK MC_AxRtGoErrorState_BkPlcMc (starting with V3.0)

(not recommended) This function block places the axis into a fault state.

VAR_INPUT
        Trigger:                BOOL;
        ErrorID:                UDINT;
        NoLogging:      BOOL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Trigger: A rising edge at this input places the axis in a fault state.

ErrorCode: An encoded indication of the cause of the error is provided here.

NoLogging: A TRUE on this input supresses any message output from this block.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The axis is placed into a fault state by a rising edge at the Trigger input.

Requirements:

  • The value at the ErrorCode input is not equal to 0.
  • The axis is not already in a fault state.

Note: If NoLogging is FALSE (default) there is an automatic message generated on the change to the fault state that contains some information about the axis and the ErrorCode used. This default message should be replaced by a more speaking message supplied by the application. Set NoLogging to TRUE here to suppress the default message.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtFinishLinear_BkPlcMc

FUNCTION_BLOCK MC_AxRtFinishLinear_BkPlcMc (starting with V3.0)

This function block adapts the control value that has been generated to the special features of the particular axis by using a valve diagram linearisation function.

Warning : This block must not be called for an axis, that has a block of type MC_AxCtrlPressureCompensation_BkPlcMc.

VAR_INPUT
        EnableLinearisation:    BOOL;
        ValveTable:             UDINT;
        ValveTableLowIdx:               UDINT;
        ValveTableHighIdx:              UDINT;
END_VAR

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

EnableLinearisation: A TRUE here will activate the linearisation.

ValveTable: The address of a linearisation table is to be passed here. It is recommended to use the ValveCharacteristicTable of a ST_TcMcAutoIdent structure that is connected to the axis.

ValveTableLowIdx: The index of the first element of the linearisation table.

ValveTableHighIdx: The index of the last element of the linearisation table.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block investigates the axis interface that has been passed to it every time it is called. A number of problems can be detected and reported during this process:

  • If EnableLinearisation is FALSE.
  • If ValveTable is not supplied or is 0.
  • ValveTableLowIdx is less than 0.
  • ValveTableHighIdx is less or equal to ValveTableLowIdx.

In these cases a MC_AxRtFinish_BkPlcMc block is called internally. Otherwise the adaptation of the control value for the axis is carried out by using the linearisation table. This will change the effect of some axis parameters:

  • Area compensation is not effective for the output value calculation but still effects the directional speed limitation.
  • Bend point compensation not effective.
  • Overlap compensation is not effective.
  • Offset compensation is added after running the linearisation mechanism.

Example: A linearisation table display from the PlcMcManager

Note: The linearisation table can be loaded from a file by using a MC_AxTableFromAsciFile_BkPlcMc or MC_AxTableFromBinFile_BkPlcMc block.

Note: If this block is used a MC_AxStandardBody_BkPlcMc block has to be replaced by the basic blocks for encoder, profile generation and drive adaption.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtMoveChecking_BkPlcMc

FUNCTION_BLOCK MC_AxRtMoveChecking_BkPlcMc (ab V3.0)

This block monitors the movement of an axis.

VAR_INPUT
        Enable:         BOOL;
        MinDistance:    LREAL;
        Filter:         LREAL;
END_VAR

VAR_OUPUT
        Triggered:      BOOL;
        Timeout:                BOOL;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: A TRUE on this input will activate the monitoring.

MinDistance: The monitoring treshold distance has to be passed here.

Filter: The monitoring time has to be passed here.

Triggered: This output signals that the axis has been placed in the error state.

Timeout: This output signals that the monitoring has been triggered.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block cyclically checks the movement of the axis. If the axis is requirred to move but does not travel at least MinDistance in the right direction within Filter the block will signal Timeout. If Enable is TRUE the block will then place the axis in the error state with code dwTcHydErrCdNotMoving = 16#435D = 17245. This situation will be signaled by Triggered.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtSetExtGenValues_BkPlcMc

FUNCTION_BLOCK MC_AxRtSetExtGenValues_BkPlcMc (ab V3.0)

The block supplies control values to an axis that are not created from the internal setpoint generator.

VAR_INPUT
        Enable:         BOOL;
        Position:               LREAL:=0.0;
        Velocity:               LREAL:=0.0;
        TargetPosition: LREAL:=0.0;
END_VAR

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Enable: A TRUE on this Input activates the transport of the supplied control values.

Position: This position setpoint has to be supplied cyclically.

Velocity: This velocity setpoint has to be supplied cyclically.

TargetPosition: This target position has to be supplied cyclically.

Error: This output signals problems on a supplied parameter.

ErrorID: In case of an error a codet information about the kind of problem is reported here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge on Execute. It places the axis in the state McState_Synchronizedmotion and iTcHydStateExtGenerated.

While Execute is TRUE the block is updating the runtime variables of the axis by using Position, Velocity and TargetPosition. The behaviour of the standard generator block is emulated.

When the block is detecting a falling edge on Execute the axis is placed in the McState_Standstill state. The axis is stopped by using a time ramp defined by fStopRamp if necessary.

Note: The generator block of the axis has to be called even while this block is active. It is taking care for the position control loop and will reshresh a range of internal variables.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxStandardBody_BkPlcMc

FUNCTION_BLOCK MC_AxStandardBody_BkPlcMc (starting with V3.0)

This function block calls a block of each of the following types: MC_AxRtEncoder_BkPlcMc, MC_AxRuntime_BkPlcMc, MC_AxRtFinish_BkPlcMc and MC_AxRtDrive_BkPlcMc.

VAR_OUTPUT
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The usual components of the axis are called, depending on the value in ST_TcHydAxParam. If one of the called blocks reports an Error it is echoed, together with its ErrorID, at the outputs of this block.

Note: In the event of multiple problems, they are prioritised according to the following sequence: encoder, generator, finish, drive.


TcPlcHydraulics: PLCopen Motion Control: System: Controller: MC_AxUtiAutoIdent_BkPlcMc

FUNCTION_BLOCK MC_AxUtiAutoIdent_BkPlcMc (starting with V3.0.28)

The block identifies some basic parameters of the axis.

(* last modification: 10.11.2009 *)
VAR_INPUT
        Execute:                BOOL:=FALSE;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                DINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The identification process is initiated by a rising edge at this input.

Busy: A pending command is indicated here.

Done : Successful processing of the identification process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block allways checks the Axis_Ref_BkPlcMc pointer for initialisation. If this is true a rising edge on Execute will start the identification process. The details of this process are defined and controlled by the values in ST_TcMcAutoIdent.

EnableEndOfTravel: If set to TRUE this parameter enables the automatic identification of the mechanical end of travels. As a first step the axis is tested for beeing moveable or at the positive block. Now the axis is applied a negative control value to find the negative block. At next the axis is applied a positive control voltage to find the other block. The control voltage is limited to EndOfTravel_NegativLimit and EndOfTravel_PositivLimit. If the end of travel positions are found to be in inverse order they are exchanged automatically and Axis.stAxParams.bDrive_Reversed will be inverted.

EnableOverlap, EnableZeroAdjust: If any one of these parameters is set to TRUE the overlap rsp. the offset voltage of the valve is determined. Note: This operation will also be affected by EndOfTravel_Negativ and EndOfTravel_Positiv.

As a first step the axis is moved to about the center arrea between pStAxAutoParams.EndOfTravel_Positiv and pStAxAutoParams.EndOfTravel_Negativ. The arrea will be 80% of the span of these parameters. If necessary the drive polarity will be inverted during this maneuvre. Now the block finds the voltage that will make the axis to start to move in positive direction. As a next step the negative voltage is found for the opposite effect. From these values the overlap and the offset voltage are calculated.EnableOverlap and EnableZeroAdjust will define the way the parameters are used to update the axis parameters.

EnableArreaRatio: If this parameter is set to TRUE the directional velocity ratio will be determined. As a first step the axis is moved to about the center arrea between pStAxAutoParams.EndOfTravel_Positiv and pStAxAutoParams.EndOfTravel_Negativ. The arrea will be 80% of the span of these parameters. As a next step a control voltage of 1Volt is applied in positive and negative direction. The velocity ratio is calculated by dividing the velocities found this way.

EndOfTravel_Positiv: If EnableEndOfTravel is TRUE the block will update this parameter. Otherwise the application has to define this value. Note: This parameter will have an effect during the determination of the offset voltage and the arrea ratio.

EndOfTravel_Negativ: If EnableEndOfTravel is TRUE the block will update this parameter. Otherwise the application has to define this value. Note: This parameter will have an effect during the determination of the offset voltage and the arrea ratio.

EndOfIncrements_Negativ: reserved.

EndOfIncrements_Positiv: reserved.

EndOfTravel_NegativLimit: This is the limiting value for negative control voltages.

EndOfTravel_PositivLimit: This is the limiting value for positive control voltages.

EndOfTravel_PositivDone: The block will set this signal if EnableEndOfTravel is FALSE or EndOfTravel_Positiv has been determined.

EndOfTravel_NegativDone: The block will set this signal if EnableEndOfTravel is FALSE or EndOfTravel_Negativ has been determined.

DecelerationFactor: After passing the end of the measurement move the axis will be travelled to the starting point of the next measurement. This travel will be performed by using this factor for scaling the standard axis parameters fMaxAcc and fMaxDec.

EnableValveCharacteristic: If this parameter is set the block will analyse the velocity response of the axis and find the valve diagramm.

ValveCharacteristicTable: This ARRAY[1..2,1..100] holds the pairs of value constituting the linearisation table. Here ValveCharacteristicTable[nnn,1] holds the normalised velocity and ValveCharacteristicTable[nnn,2] holds the normalised output value. The value pairs rising in value of velocities and output values for rising indices. So the first pair defines the highest negative velocity and the last active pair the highest positive velocity. The control voltage is limited to EndOfTravel_NegativLimit and EndOfTravel_PositivLimit during the automatic measurement. The remaining points are extrapolated from the last two points.

ValveCharacteristicTblCount: This parameter specifies the number of points that have to be tested and stored in ValveCharacteristicTable. This parameter has to be in the range 3 to 99 (included).

ValveCharacteristicLowEnd: The lower end position of the travel that is allowed to be used for the transfer characteristic determination.

ValveCharacteristicHighEnd: The upper end position of the travel that is allowed to be used for the transfer characteristic determination.

ValveCharacteristicRamp: This parameter is defining the ramp for rising the control voltage while analysing the velocity response of the axis. The given value specifies the ramp up time for 10 Volts. The ramp time for lower voltages will be reduced accordingly.

ValveCharacteristicSettling: After ramping up the start of the measurement can be delayed by using this parameter.

ValveCharacteristicRecovery: This parameter is defining a delay that is inserted before starting a measuring travel. This will enable the supply to compensate the pressure drop caused by the measuring travel before. Note: The axis is not applied a lag control loop here.

ValveCharacteristicMinCycle: A measuring travel is valid if the output voltage has been build up before the axis is approaching the center of the measuring span (defined by ValveCharacteristicHighEnd and ValveCharacteristicLowEnd) for less than half of this parameter. Otherwise the effective travel (without ramping) falls short compared to this parameter. In this case this measuring travel and any following measuring travel in this direction will be substituted by a value that is calculated by using the reference velocity of the axis.

Example: Demonstration of the activity of the block:

Example: A linearisation table drawn by the PlcMcManager:

Note: The characteristic found this way can be used for a runtime linearisation by means of a MC_AxRtFinishLinear_BkPlcMc block.

Note: It is recommended to save the characteristic table in an ASCII file by using a MC_AxTableToAsciFile_BkPlcMc or in a binary file by using a MC_AxTableToBinFile_BkPlcMc and reload it at the next system start.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxUtiCancelMonitoring_BkPlcMc

FUNCTION_BLOCK MC_AxUtiCancelMonitoring_BkPlcMc (starting with V3.0)

The monitoring of a function is aborted.

Note: In conformance with PLCopen definitions a wide range of blocks can be activated even if the block itself or another block is performing an activity on the axis. In most cases this fact can be used to avoid the cancelation of monitoring.

Warning: Some types of function blocks do have to monitor the process they startet. If the monitoring is aborted the process may fail or will be executed incompletely. Use the abort function only for blocks with a special hint in this documentation.

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

VAR_INPUT
        Execute:                BOOL;
END_VAR

VAR_OUTPUT
        Error:          BOOL;
        Done:           BOOL;
END_VAR

Execute : The abortion is initiated by a rising edge at this input.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Error: The occurrence of an error is indicated here.

Done : Successful processing of the abortion is indicated here.

Behaviour of the block:

On a rising edge on Execute the block will act on the supplied interface Axis in a way that some other blocks will see this as the start of some other function. If there is any other block monitoring this interface to trace a process it has started it will signal CommandAborted and abort its monitoring.

Hint: By now there are no possible reasons for problems. The output Error is allways FALSE.

Hint: The function of this block does not need any time for execution. The output Done will mirror the input Execute imediately after calling the block.

A list of the blocks accepting the abortion of monitoring is added to the Knowledge Base.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxUtiStandardInit_BkPlcMc

FUNCTION_BLOCK MC_AxUtiStandardInit_BkPlcMc (starting with V3.0)

The block initialises and monitors the components of an axis.

VAR_INPUT
        AxisName:               STRING(255);
        PathName:               STRING(255);
        pDeviceInput:   POINTER TO ST_TcPlcDeviceInput:=0;
        pDeviceOutput:  POINTER TO ST_TcPlcDeviceOutput:=0;
        pLogBuffer:     POINTER TO ST_TcPlcMcLogBuffer;
        pStAxAuxLabels: POINTER TO ST_TcMcAuxDataLabels:=0;
        pStAxAutoParams:        POINTER TO ST_TcMcAutoIdent;
        pStAxCommandBuf:        POINTER TO ST_TcPlcCmdBuffer_BkPlcMc:=0;        (* starting with V3.0.8 *)
        nLogLevel:      DINT:=0;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        Ready:          BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

AxisName: The textual name of the axis (example: 'Axis_1') has to be supplied here.

PathName: The textual path name of the axis (example: 'C:\TwinCAT\Projekt\') that is to be used for storing the axis parameters has to be supplied here.

pDeviceInput: The adress of a variable of type ST_TcPlcDeviceInput has to be supplied here.

pDeviceOutput: The adress of a variable of type ST_TcPlcDeviceOutput has to be supplied here.

pLogBuffer: The adress of a variable of type ST_TcPlcMcLogBuffer can be supplied here.

pStAxAuxLabels: The adress of a ST_TcMcAuxDataLabels structure containing text labels for the customer specific parameters of the axis can be supplied here.

pStAxAutoParams: The adress of a variable of type ST_TcMcAutoIdent can be supplied here.

pStAxCommandBuf: Starting with V3.0.8 a range of blocks support an input BufferMode that was added to the definitions of PLCopen. The functionality controlled by this signal is currently under construction. Part of this development is the implementation of this command buffer. Attention: This input must not be supplied any value except 0.

nLogLevel: A coded value has to be supplied here that defines the threshold for message recording.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded error message is provided here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On each call the block checks the supplied axis reference and the supplied pointers. If there is any change the block will set signals in the supplied Axis_Ref_BkPlcMc structure, that the axis has to be reinitialised. A block of type MC_AxParamLoad_BkPlcMc will be used to automatically load the axis parameters from a file.If pAuxLabels is supplied a ST_TcMcAuxDataLabels block is used to load text labels for the customer parameters.

Note: The strings supplied as AxisName and PathName must not contain any white space characters or other characters that may cause problems when the strings are used to create a file name. The file name is created by concatenating the supplied string and placing the extension '.dat' at the end.

Note: The parameters pDeviceInput and pDeviceOutput have to be supplied properly for all axes that do use I/O hardware for position readout and/or drive control. For pure virtuall axes these parameters must not be supplied any value except 0.

Attention : The input pStAxCommandBuf must not be supplied any value except 0.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtLogAxisEntry_BkPlcMc

FUNCTION_BLOCK MC_AxRtLogAxisEntry_BkPlcMc (starting with V3.0)

An axis related message is entered into the LogBuffer of the library. More information about creating a logging buffer can be found at FAQ #10 of the Knowledge Base.

Note: All axis related blocks of the library are using this block for message logging.

VAR_INOUT
        Axis:           POINTER TO Axis_Ref_BkPlcMc;
END_VAR

VAR_INPUT
        Execute:                BOOL:=FALSE;
        pBuffer:                POINTER TO ST_TcPlcMcLogBuffer;
        LogLevel:               DWORD:=0;
        Source:         DWORD:=0;
        Message:                STRING(255);
        ArgType:                INT:=0;
        diArg:          DINT:=0;
        lrArg:          LREAL:=0;
        sArg:           STRING(255);
END_VAR

Execute: A rising edge on this input will activate the block.

pBuffer: The address of a variable of type ST_TcPlcMcLogBuffer is to be supplied here.

LogLevel: A coded value for the type of the message. Use a Logger Levels value from the Global Constants here.

Source: A coded value for the source of the message. Use a Logger Sources value from the Global Constants here.

Message: The text of the message.

ArgType: The type of the optional argument.

diArg: If the optional argument is of type DINT supply its value here.

lrArg: If the optional argument is of type LREAL supply its value here.

sArg: If the optional argument is of type STRING supply its value here.

Behaviour of the block:

The only difference to a block of type MC_AxRtLogEntry_BkPlcMc is the prefix of the axis name to the message.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtLogClear_BkPlcMc

FUNCTION_BLOCK MC_AxRtLogClear_BkPlcMc (starting with V3.0)

This function block will clear and initialise a LogBuffer. More information about creating a logging buffer can be found at FAQ #10 of the Knowledge Base.

VAR_INOUT
        pBuffer:                POINTER TO ST_TcPlcMcLogBuffer;
END_VAR

pBuffer: The address of a variable of type ST_TcPlcMcLogBuffer is to be supplied here.

Behaviour of the block

All entries of the LogBuffer are cleared and initialised.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtLogEntry_BkPlcMc

FUNCTION_BLOCK MC_AxRtLogEntry_BkPlcMc (starting with V3.0)

A message is entered into the LogBuffer of the library. More information about creating a logging buffer can be found at FAQ #10 of the Knowledge Base.

VAR_INPUT
        pBuffer:                POINTER TO ST_TcPlcMcLogBuffer;
        LogLevel:               DWORD:=0;
        Source:         DWORD:=0;
        Message:                STRING(255);
        ArgType:                INT:=0;
        diArg:          DINT:=0;
        lrArg:          LREAL:=0;
        sArg:           STRING(255);
END_VAR

pBuffer: The address of a variable of type ST_TcPlcMcLogBuffer is to be supplied here.

LogLevel: A coded value for the type of the message. Use a Logger Levels value from the Global Constants here.

Source: A coded value for the source of the message. Use a Logger Sources value from the Global Constants here.

Message: The text of the message.

ArgType: The type of the optional argument.

diArg: If the optional argument is of type DINT supply its value here.

lrArg: If the optional argument is of type LREAL supply its value here.

sArg: If the optional argument is of type STRING supply its value here.

Behaviour of the block:

If pBuffer is supplied and points to a ST_TcPlcMcLogBuffer that can take at least one more message the supplied message elements are completed with local time informations and added to the applications message buffer.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtLoggerDeSpool_BkPlcMc

FUNCTION_BLOCK MC_AxRtLoggerDeSpool_BkPlcMc (starting with V3.0)

The block keeps the librarys logging buffer from overrunning. More information about creating a logging buffer can be found at FAQ #10 of the Knowledge Base.

VAR_INPUT
        Spare:          INT;
END_VAR

VAR_INOUT
        pBuffer:                POINTER TO ST_TcPlcMcLogBuffer;
END_VAR

Spare: The number of free message entries the block has to guarantee.

pBuffer: The adress of a variable of type ST_TcPlcMcLogBuffer has to be supplied here.

Behaviour of the block

On each call the block will remove one message from the logging buffer if the number of free entries is smaller than Spare. To forward the complete history to the event view of Windows a MC_AxRtLoggerSpool_BkPlcMc block has to be used.

Note: This block is applicable on systems with a mass storage that does have a reduced writing performance (e.g. FLASH DISK). A reduced history of at least 10 to 15 messages is made available.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtLoggerRead_BkPlcMc

FUNCTION_BLOCK MC_AxRtLoggerRead_BkPlcMc (starting with V3.0)

The block is reading a message from the LogBuffer of the library. More information about creating a logging buffer can be found at FAQ #10 of the Knowledge Base.

Note: This block is used by diagnosis tool via ADS. A direct call from the PLC application usually makes no sense.

VAR_INOUT
        Entry:          INT:=0;
        pBuffer:                POINTER TO ST_TcPlcMcLogBuffer;
        pEntry:         POINTER TO ST_TcPlcMcLogEntry;
END_VAR

VAR_OUTPUT
        Result:         DWORD:=0;
END_VAR

Entry: The number of the requested message.

pBuffer: The address of a variable of type ST_TcPlcMcLogBuffer is to be supplied here.

pEntry: The address of a destination variable of type ST_TcPlcMcLogEntry is to be supplied here.

Result: An encoded indication of the cause of the error is provided here.

Behaviour of the block:

On each call the block investigates the interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If Entry is out of the acceptable range of 1..20 the block will report dwTcHydAdsErrInvalidIdxOffset as Result.
  • If pBuffer or pEntry are undefined the block will report dwTcHydAdsErrNotReady as Result.

If these checks are carried out without problems the block will copy the message specified by Entry from the LogBuffer pBuffer into the message structure adressed by pEntry. Entry is used as a relative age: Entry:=1 is selecting the top (last in) message, Entry:=2 the message next to it. If the requested message cannot be found the destination structure is cleared and initialised.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtLoggerSpool_BkPlcMc

FUNCTION_BLOCK MC_AxRtLoggerSpool_BkPlcMc (starting with V3.0)

The block is forwarding messages from the librarys buffer to the Windows event logger. More information about creating a logging buffer can be found at FAQ #10 of the Knowledge Base.

VAR_INOUT
        pBuffer:                POINTER TO ST_TcPlcMcLogBuffer;
END_VAR

pBuffer: The adress of a variable of type ST_TcPlcMcLogBuffer has to be supplied here.

Behaviour of the block

On each call the block will remove one message from the librarys buffer and forward it to the Windows event logger.

Note: On systems with a mass storage that does have a reduced writing performance (e.g. FLASH DISK) it is not recommended to use the Windows event logger here. A reduced history can be made available by using a MC_AxRtLoggerDeSpool_BkPlcMc block.


TcPlcHydraulics: PLCopen Motion Control: System: Utilitys: Filters: MC_AxUtiAverageDerivative_BkPlcMc

FUNCTION_BLOCK MC_AxUtiAverageDerivative_BkPlcMc (starting with V3.0)

A block for calculation of the derivative of a value by numerical differentiation over multiple cycles.

VAR_INPUT
        Input:          LREAL:=0.0;
        MinIdx:         DINT:=0;
        MaxIdx:         DINT:=0;
        pBuffer:                POINTER TO LREAL:=0;
END_VAR

VAR_OUTPUT
        Output:         LREAL:=0.0;
        Error:          BOOL:=FALSE;
        ErrorID:                UDINT:=0;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Input: The raw value that has to be filtered.

MinIdx: The index of the first used element of the filter buffer.

MaxIdx: The index of the last used element of the filter buffer.

pBuffer: The address of the first element of the filter buffer.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Output: The filtered value.

Error: This output signals problems on a supplied parameter.

ErrorID: In case of an error a codet information about the kind of problem is reported here.

Behaviour of the block:

The block checks the adress of the filter buffer pBuffer and the indices of the elements to be used MinIdx and MaxIdx. In case of incorrect values the block will respond with Error and a coded information in ErrorID. Otherwise the filter buffer is updated by using Input and the average change rate over the stored values is calculated and reported as Output.

Note: The values stored in the filter buffer will contain (MaxIdx - MinIdx + 1) samples. The measuring time can be found by multipying this number by the cycle time.

Note: The working principle of the sliding average causes a transmission delay of one half of the measuring time. If the filtered value is used in a control loop the resulting frequency depending phase shift will lead to limitation of the usable range of parameter settings.

Attention: The block has no chance to check the supplied values of pBuffer, MinIdx and MaxIdx for correctness. It is important to choose these parameters with extra care. If these values are incorrect the results may be unexpected behaviour because of overwritten memorie or even a brakdown of the PLC runtime.


TcPlcHydraulics: PLCopen Motion Control: System: Utilitys: Filters: MC_AxUtiSlewRateLimitter_BkPlcMc

FUNCTION_BLOCK MC_AxUtiSlewRateLimitter_BkPlcMc (starting with V3.0)

A block for calculating a slew rate limited (i.e. ramped) value.

VAR_INPUT
        fInput:         LREAL:=0.0;
        fCycletime:     DINT:=0;
        fMaxRate:               DINT:=0;
END_VAR

VAR_OUTPUT
        fOutput:                LREAL:=0.0;
        bError:         BOOL:=FALSE;
        nErrorId:               UDINT:=0;
END_VAR

fInput: The raw value that has to be filtered.

fCycletime: The cycletime of the PLC task.

fMaxRate: The maximum acceptable change rate (i.e. ramping rate) at the output.

fOutput: The calculated value.

bError: This output is used to signal problems about the supplied parameters.

nErrorId: In case of a problem this output will hold a coded information about the problem.

Behaviour of the block:

The block checks the supplied values of fCycletime and fMaxRate. In case of incorrect values the block will respond with bError and a coded information in nErrorId. Otherwise it will calculate the difference between Input und Output. If the absolute difference is less than or equal to fMaxRate the block will update Output imediately. Otherwise it will update Output for the amount of fMaxRate to make it follow Input.

Note: The value of fCycletime has to be ≥ 0.001 seconds. For fMaxRate no negative values are allowed.

Note: Typically Input is a value that is determined and filtert in time with the blocks in use for an axis. Axis_Ref_BkPlcMc.ST_TcHydAxParam.fCycletime can be used for fCycletime here.


TcPlcHydraulics: PLCopen Motion Control: System: Utilitys: Filters: MC_AxUtiSlidingAverage_BkPlcMc

FUNCTION_BLOCK MC_AxUtiSlidingAverage_BkPlcMc (starting with V3.0)

A block for calculation of the derivative of a value by numerical differentiation over multiple cycles.

VAR_INPUT
        Input:          LREAL:=0.0;
        MinIdx:         DINT:=0;
        MaxIdx:         DINT:=0;
        pBuffer:                POINTER TO LREAL:=0;
END_VAR

VAR_OUTPUT
        Output:         LREAL:=0.0;
END_VAR

Input: The raw value that has to be filtered.

MinIdx: The index of the first used element of the filter buffer.

MaxIdx: The index of the last used element of the filter buffer.

pBuffer: The address of the first element of the filter buffer.

Output: The filtered value.

Behaviour of the block:

The block checks the adress of the filter buffer pBuffer and the indices of the elements to be used MinIdx and MaxIdx. In case of incorrect values the block will copy Input to Output. Otherwise the filter buffer is updated by using Input and the average over the stored values is calculated and reported as Output.

Note: The values stored in the filter buffer will contain (MaxIdx - MinIdx + 1) samples. The filtering time can be found by multipying this number by the cycle time.

Note: The working principle of the sliding average causes a transmission delay of one half of the filtering time. If the filtered value is used in a control loop the resulting frequency depending phase shift will lead to limitation of the usable range of parameter settings.

Attention: The block has no chance to check the supplied values of pBuffer, MinIdx and MaxIdx for correctness. It is important to choose these parameters with extra care. If these values are incorrect the results may be unexpected behaviour because of overwritten memorie or even a brakdown of the PLC runtime.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxAdsCommServer_BkPlcMc

FUNCTION_BLOCK MC_AxAdsCommServer_BkPlcMc (starting with V3.0)

The function block gives the application the functionality of an ADS server. It calls blocks of the MC_AxAdsReadDecoder_BkPlcMc and MC_AxAdsWriteDecoder_BkPlcMc types as required. The ADS codes are listed in the Knowledge Base.

VAR_INPUT
        nFirstAxisIndex:        INT;
        nLastAxisIndex: INT;
END_VAR

VAR_INOUT
        pAxItf:         POINTER TO Axis_Ref_BkPlcMc;
END_VAR

nFirstAxisIndex, nLastAxisIndex: The dimensioning of the Axis_Ref_BkPlcMc array must be given here.

Warning : Incorrect data provided at this location excludes some of the axes from communication, or can result in the PLC application crashing as a result of serious runtime errors (Page Fault Exception).

pAxItf: The address of a variable or of an array of variables of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

If the PLC application calls this block cyclically, it acquires the character of an ADS server, answering ADS read and ADS write accesses like any other ADS server. This includes the decoding of IdxGroup/IdxOffset addressing. Blocks of the MC_AxAdsReadDecoder and MC_AxAdsWriteDecoder types are called for this purpose as required.

Note: This block must not be used if the PLC application already is an ADS server. In that case, the blocks of the MC_AxAdsReadDecoder and MC_AxAdsWriteDecoder types have to be called from the ADS server blocks already included in the application.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxAdsReadDecoder_BkPlcMc

FUNCTION_BLOCK MC_AxAdsReadDecoder_BkPlcMc (starting with V3.0)

The function block decodes ADS read accesses. The ADS codes are listed in the Knowledge Base.

VAR_INPUT
        nFirstAxisIndex:        INT;
        nLastAxisIndex: INT;
        bReset:         BOOL;
        bValid:         BOOL;
        sNetId:         STRING(80);
        nPort:          UINT;
        nInvokeId:      UDINT;
        nIdxGroup:      UDINT;
        nIdxOffs:       UDINT;
        cbReadLen:      UDINT;
        pAxItf:         POINTER TO Axis_Ref_BkPlcMc:=0;
END_VAR

VAR_INOUT
        DeadManCount:   UDINT;
END_VAR

VAR_OUTPUT
        bClear:         BOOL;
        bPending:       BOOL;
END_VAR

nFirstAxisIndex, nLastAxisIndex: The dimensioning of the Axis_Ref_BkPlcMc array must be given here.

Warning : Incorrect data provided at this location excludes some of the axes from communication, or can result in the PLC application crashing as a result of serious runtime errors (Page Fault Exception).

bReset, bValid: The signals are used to co-ordinate the decoder with the ADS server.

sNetId, nPort, nInvokeId: These values are required in order to generate the ADS response. They are supplied by an ADS server's ADS indication block.

nIdxGroup, nIdxOffs, cbReadLen: These values are required in order to decode the access. They are supplied by an ADS server's ADS indication block.

Axis: The address of a variable or of an array of variables of type Axis_Ref_BkPlcMc is to be passed here.

bClear: This signal indicates that a ADS access that was indicated by bValid is going to be cleared.

bPending: This signal indicates that a ADS access that was indicated by bValid is still processed.

Behaviour of the block:

Note: If, when the bValid signal is present, the block indicates neither bClear nor bPending it has not decoded the combination of nIdxGroup and nIdxOffs, and has not generated a response. In such a case, the ADS server (if there is one) must call another decoder, or must generate a response with the appropriate error code.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxAdsWriteDecoder_BkPlcMc

FUNCTION_BLOCK MC_AxAdsWriteDecoder_BkPlcMc (starting with V3.0)

The function block decodes ADS write accesses. The ADS codes are listed in the Knowledge Base.

VAR_INPUT
        nFirstAxisIndex:        INT;
        nLastAxisIndex: INT;
        bReset:         BOOL;
        bValid:         BOOL;
        sNetId:         STRING(80);
        nPort:          UINT;
        nInvokeId:      UDINT;
        nIdxGroup:      UDINT;
        nIdxOffs:       UDINT;
        cbWriteLen:     UDINT;
        pWriteBuff:     DWORD;
        pAxItf:         POINTER TO Axis_Ref_BkPlcMc:=0;
END_VAR

VAR_INOUT
        DeadManCount:   UDINT;
END_VAR

VAR_OUTPUT
        bClear:         BOOL;
        bPending:       BOOL;
END_VAR

nFirstAxisIndex, nLastAxisIndex: The dimensioning of the Axis_Ref_BkPlcMc array must be given here.

Warning: Incorrect data provided at this location excludes some of the axes from communication, or can result in the PLC application crashing as a result of serious runtime errors (Page Fault Exception).

bReset, bValid: The signals are used to co-ordinate the decoder with the ADS server.

sNetId, nPort, nInvokeId: These values are required in order to generate the ADS response. They are supplied by an ADS server's ADS indication block.

nIdxGroup, nIdxOffs, cbWriteLen: These values are required in order to decode the access. They are supplied by an ADS server's ADS indication block.

Axis: The address of a variable or of an array of variables of type Axis_Ref_BkPlcMc is to be passed here.

bClear: This signal indicates that a ADS access that was indicated by bValid is going to be cleared.

bPending: Hier wird signalisiert, daß ein mit bValid signalisierter ADS-Zugriff bearbeitet wird.

Behaviour of the block:

Note: If, when the bValid signal is present, the block indicates neither bClear nor bPending it has not decoded the combination of nIdxGroup and nIdxOffs, and has not generated a response. In such a case, the ADS server (if there is one) must call another decoder, or must generate a response with the appropriate error code.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxParamAuxLabelsLoad_BkPlcMc

FUNCTION_BLOCK MC_AxParamAuxLabelsLoad_BkPlcMc (starting with V3.0)

The block loads the label texts for the customer specific axis parameters from a file. This file can be created by using a standard text editor like Microsoft Notepad.

Note: Incorrect structured files provided here can result in the PLC application crashing as a result of serious runtime errors (Page Fault Exception).

Note: Usually this block is not called directly from the application. It is suggested to use a MC_AxUtiStandardInit_BkPlcMc block that will call a MC_AxParamAuxLabelsLoad_BkPlcMc block internally.

VAR_INPUT
        Execute:                BOOL;
END_VAR

VAR_OUTPUT
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute: A rising edge here will start the process.

Done: Successful loading of the labels is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If Axis_Ref_BkPlcMc.pStAxAuxLabels has not been initialised the block reacts with Error and with ErrorID:=dwTcHydErrCdPtrPlcMc or dwTcHydErrCdPtrMcPlc.

The loading process begins if these checks are carried out without problems.

A falling edge at Execute clears all the pending output signals. If Execute is set to FALSE while the loading process is still active, the process that had started continues unaffected. The signals provided at the end of the operation (Error, ErrorID, Done) are made available for one cycle.

Note: The number of lines in the file has to be matching the global constant iTcHydfCustDataMaxIdx (at time being: 20) of the library. Each line must not be longer than 20 letters (inkluding blanks, no CR/LF).


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxParamLoad_BkPlcMc

FUNCTION_BLOCK MC_AxParamLoad_BkPlcMc (starting with V3.0)

The function block loads the parameters for an axis from a file. A block of type MC_AxParamSave_BkPlcMc must be used to generate a compatible parameter file.

Note: This block is usually not called directly by the application. If possible a block of type MC_AxUtiStandardInit_BkPlcMc should be used, that will make use of a block of type MC_AxParamLoad_BkPlcMc.

VAR_INPUT
        Execute:                BOOL;
END_VAR

VAR_OUTPUT
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : : The loading process is initiated by a rising edge at this input.

Done : Successful loading of the parameters is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If the cannot be opened for reading the block reacts with Error and with ErrorID:=dwTcHydErrCdPtrPlcMc or dwTcHydErrCdPtrMcPlc.

The loading process begins if these checks are carried out without problems. The format version of the file is analysed and parameters not supplied by the files content are replaced by default values. If the file contains parameters that have become obsolete or are not used yet by the library version reading the file they are ignored.

A falling edge at Execute clears all the pending output signals. If Execute is set to FALSE while the loading process is still active, the process that had started continues unaffected. The signals provided at the end of the operation (Error, ErrorID, Done) are made available for one cycle.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxParamSave_BkPlcMc

FUNCTION_BLOCK MC_AxParamSave_BkPlcMc (starting with V3.0)

The function block writes the parameters for an axis into a file. A block of type MC_AxParamLoad_BkPlcMc must be used to read the file.

VAR_INPUT
        Execute:                BOOL;
END_VAR

VAR_OUTPUT
        Done:           BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The writing process is initiated by a rising edge at this input.

Done : Successful writing of the parameters is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • If the file cannot be opened for writing the block reacts with Error and with ErrorID:=dwTcHydErrCdPtrPlcMc or dwTcHydErrCdPtrMcPlc.

The writing process begins if these checks are carried out without problems. A file format information is added to the file.

A falling edge at Execute clears all the pending output signals. If Execute is set to FALSE while the writing process is still active, the process that had started continues unaffected. The signals provided at the end of the operation (Error, ErrorID, Done) are made available for one cycle.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiReadCoeDriveTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiReadCoeDriveTerm_BkPlcMc (ab V3.0)

The block is used to read a register from the EL terminal that is used to interface the drive unit of an axis.

VAR_INPUT
        Execute:                BOOL;
        Pdata:          POINTER TO BYTE:=0;
        ByteCount:      BYTE:=0;
        Index:          WORD:=0;
        Subindex:               BYTE:=0;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The reading process is initiated by a rising edge at this input.

Pdata: The address of the data is to be passed here.

ByteCount: The size of the data is to be passed here.

Index, Subindex: The register adress selection is to be passed here.

Busy: The continuing execution of a command is signaled here.

Done : Successful reading of the parameter is indicated here.

CommandAborted : Abortion of the reading process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On a rising edge on Execute the block will examine the interface that it has been supplied. A number of problems can be detected and reported during this process:

  • If the axis is enabled for active operation the block reacts with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If ByteCount or Subindex is outside the acceptable range the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If Index or Pdata is outside the acceptable range the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nDrive_Type is selecting a I/O terminal type that does not support parameter communication the block reacts with Error and ErrorID:=dwTcHydErrCdNotCompatible.
  • If there are problems detected in the ADS communication to the terminal the block will report the received ErrorID and reacts with Error. Some examples for error codes that may show up:
    • 16#0006 = 6 = The port number is unknown. Note: Check the mapping of the InfoData element of the terminal!
    • 16#0007 = 7 = The AmsNetID of the used ADS address is invalif. Note: Check the mapping of the InfoData element of the terminal!
    • 16#0702 = 1794 = dwTcHydAdsErrInvalidIdxGroup = The terminal does not support the CoE protokoll.
    • 16#0703 = 1795 = dwTcHydAdsErrInvalidIdxOffset = The address in Index and Subindex is not supported by the terminal.
    • 16#0745 = 1861 = dwTcHydAdsErrTimeout = Timeout limit was exceeded.

A falling edge on Execute clears all output signals. If Execute is cleared while the reading process is still active the process will continue. The output signals (Done, CommandAborted, Error, ErrorID) will be valid for one cycle.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiReadCoeEncTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiReadCoeEncTerm_BkPlcMc (ab V3.0)

The block is used to read a register from the EL terminal that is used to interface the encoder of an axis.

VAR_INPUT
        Execute:                BOOL;
        Pdata:          POINTER TO BYTE:=0;
        ByteCount:      BYTE:=0;
        Index:          WORD:=0;
        Subindex:               BYTE:=0;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The reading process is initiated by a rising edge at this input.

Pdata: The address of the data is to be passed here.

ByteCount: The size of the data is to be passed here.

Index, Subindex: The register adress selection is to be passed here.

Busy: The continuing execution of a command is signaled here.

Done : Successful reading of the parameter is indicated here.

CommandAborted : Abortion of the reading process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On a rising edge on Execute the block will examine the interface that it has been supplied. A number of problems can be detected and reported during this process:

  • If the axis is enabled for active operation the block reacts with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If ByteCount or Subindex is outside the acceptable range the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If Index or Pdata is outside the acceptable range the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nEncoder_Type is selecting a I/O terminal type that does not support parameter communication the block reacts with Error and ErrorID:=dwTcHydErrCdNotCompatible.
  • If there are problems detected in the ADS communication to the terminal the block will report the received ErrorID and reacts with Error. Some examples for error codes that may show up:
    • 16#0006 = 6 = The port number is unknown. Note: Check the mapping of the InfoData element of the terminal!
    • 16#0007 = 7 = The AmsNetID of the used ADS address is invalif. Note: Check the mapping of the InfoData element of the terminal!
    • 16#0702 = 1794 = dwTcHydAdsErrInvalidIdxGroup = The terminal does not support the CoE protokoll.
    • 16#0703 = 1795 = dwTcHydAdsErrInvalidIdxOffset = The address in Index and Subindex is not supported by the terminal.
    • 16#0745 = 1861 = dwTcHydAdsErrTimeout = Timeout limit was exceeded.

If these checks are carried out without problems the block starts to read the register content.

A falling edge on Execute clears all output signals. If Execute is cleared while the reading process is still active the process will continue. The output signals (Done, CommandAborted, Error, ErrorID) will be valid for one cycle.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiReadRegDriveTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiReadRegDriveTerm_BkPlcMc (ab V3.0)

The block is used to read a register from the KL terminal that is used to interface the drive unit of an axis.

VAR_INPUT
        Execute:                BOOL;
        Select:         INT;
END_VAR

VAR_OUTPUT
        RegData:                WORD;
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute: The reading process is initiated by a rising edge at this input.

Select: The register adress selection is to be passed here.

RegData: The content of the register is indicated here.

Busy: The continuing execution of a command is signaled here.

Done: Successful reading of the parameter is indicated here.

CommandAborted: Abortion of the reading process is indicated here.

Erro: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Axis: The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On a rising edge on Execute the block will examine the interface that it has been supplied. A number of problems can be detected and reported during this process:

  • If one of the pointers ST_TcPlcDeviceInput or ST_TcPlcDeviceOutput are not initialised the block reacts with Error and with ErrorID:=dwTcHydErrCdPtrPlcMc.
  • If the axis is enabled for active operation the block reacts with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If Select is outside the acceptable range of (including) 0 to 63 the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nDrive_Type is selecting a I/O terminal type that does not support parameter communication the block reacts with Error and ErrorID:=dwTcHydErrCdNotCompatible.

If these checks are carried out without problems the block starts to read the register content.

A falling edge on Execute clears all output signals. If Execute is cleared while the reading process is still active the process will continue. The output signals (Done, CommandAborted, Error, ErrorID) will be valid for one cycle.

Hint: The drive types iTcMc_DriveKL2521, iTcMc_DriveKL4032, iTcMc_DriveKL2531 and iTcMc_DriveKL2541 are supporting register communication.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiReadRegEncTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiReadRegEncTerm_BkPlcMc (ab V3.0)

The block is used to read a register from the KL terminal that is used to interface the encoder of an axis.

VAR_INPUT
        Execute:                BOOL;
        Select:         INT;
END_VAR

VAR_OUTPUT
        RegData:                WORD;
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The reading process is initiated by a rising edge at this input.

Select: The register adress selection is to be passed here.

RegData: The content of the register is indicated here.

Busy: The continuing execution of a command is signaled here.

Done : Successful reading of the parameter is indicated here.

CommandAborted : Abortion of the reading process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On a rising edge on Execute the block will examine the interface that it has been supplied. A number of problems can be detected and reported during this process:

  • If one of the pointers ST_TcPlcDeviceInput or ST_TcPlcDeviceOutput are not initialised the block reacts with Error and with ErrorID:=dwTcHydErrCdPtrPlcMc.
  • If the axis is enabled for active operation the block reacts with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If Select is outside the acceptable range of (including) 0 to 63 the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nEncoder_Type is selecting a I/O terminal type that does not support parameter communication the block reacts with Error and ErrorID:=dwTcHydErrCdNotCompatible.

If these checks are carried out without problems the block starts to read the register content.

A falling edge on Execute clears all output signals. If Execute is cleared while the reading process is still active the process will continue. The output signals (Done, CommandAborted, Error, ErrorID) will be valid for one cycle.

Hint: The encoder types iTcMc_EncoderKL3002, iTcMc_EncoderKL3042, iTcMc_EncoderKL3062, iTcMc_EncoderKL3162, iTcMc_EncoderKL5101, iTcMc_EncoderKL5111, iTcMc_EncoderKL2521, iTcMc_EncoderKL2531 and iTcMc_EncoderKL2541 are supporting register communication.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiUpdateRegDriveTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiUpdateRegDriveTerm_BkPlcMc (ab V3.0.7)

The block writes a parameter set to a KL terminal that is used to interface the drive of an axis. It is making use of MC_AxUtiReadRegDriveTerm_BkPlcMc and MC_AxUtiWriteRegDriveTerm_BkPlcMc blocks.

VAR_INPUT
        Execute:                BOOL;
END_VAR

VAR_OUTPUT
        Done:           BOOL;
        Busy:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
        RegData:                ST_TcPlcRegDataTable;
END_VAR

Execute : The update process is initiated by a rising edge at this input.

RegData: The address of a parameter set is to be passed here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Done : Successful writing of the parameters is indicated here.

Busy: A pending command is indicated here.

CommandAborted : Abortion of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • The pointers pStDeviceInput and pStDeviceOutput in Axis_Ref_BkPlcMc are checked. If these pointers have not been initialised, the block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcDriveIn or dwTcHydErrCdPtrPlcDriveOut.
  • If the axis is enabled for active operation the block responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If Select is outside the acceptable range of 0 to 63 (including) the block responds with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nDrive_Type in the axis parameters is selecting an I/O device that does not support parameter communication the block responds with Error and ErrorID:=dwTcHydErrCdNotCompatible.
  • The value in ST_TcPlcRegDataTable.RegDataItem[...].Access defines the way the element is handled:
    • 0: The element will be ignored.
    • 1: The register selected by Select is read. The content is compared to RegData. If it is not equal the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 2: The register selected by Select is read. The content is compared to RegData. If it is not greater the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 3: The register selected by Select is read. The content is compared to RegData. If it is not smaller the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 4: The register selected by Select is read. The content is compared to RegData. If it is not greater or equal the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 5: The register selected by Select is read. The content is compared to RegData. If it is not smaller or equal the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 10: The register selected by Select is written with the value of RegData.
    • All other values are ignored by time being. Future versions of the library may assign new functions to any of them. Be sure to mark unused elements by setting to 0.

A falling edge on Execute clears all outputs. If Execute is set to FALSE while the process is still active it will continue. The signals at the end of the process (Done, CommandAborted, Error, ErrorID, Done) will be active for one cycle.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiUpdateRegEncTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiUpdateRegEncTerm_BkPlcMc (ab V3.0.7)

The block writes a parameter set to a KL terminal that is used to interface the encoder of an axis. It is making use of MC_AxUtiReadRegEncTerm_BkPlcMc and MC_AxUtiWriteRegEncTerm_BkPlcMc blocks.

VAR_INPUT
        Execute:                BOOL;
END_VAR

VAR_OUTPUT
        Done:           BOOL;
        Busy:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
        RegData:                ST_TcPlcRegDataTable;
END_VAR

Execute : The update process is initiated by a rising edge at this input.

RegData: The address of a parameter set is to be passed here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Done : Successful writing of the parameters is indicated here.

Busy: A pending command is indicated here.

CommandAborted : Abortion of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • The pointers pStDeviceInput and pStDeviceOutput in Axis_Ref_BkPlcMc are checked. If these pointers have not been initialised, the block responds with Error and ErrorID:=dwTcHydErrCdPtrPlcDriveIn or dwTcHydErrCdPtrPlcDriveOut.
  • If the axis is enabled for active operation the block responds with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If Select is outside the acceptable range of 0 to 63 (including) the block responds with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nDrive_Type in the axis parameters is selecting an I/O device that does not support parameter communication the block responds with Error and ErrorID:=dwTcHydErrCdNotCompatible.
  • The value in ST_TcPlcRegDataTable.RegDataItem[...].Access defines the way the element is handled:
    • 0: The element will be ignored.
    • 1: The register selected by Select is read. The content is compared to RegData. If it is not equal the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 2: The register selected by Select is read. The content is compared to RegData. If it is not greater the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 3: The register selected by Select is read. The content is compared to RegData. If it is not smaller the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 4: The register selected by Select is read. The content is compared to RegData. If it is not greater or equal the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 5: The register selected by Select is read. The content is compared to RegData. If it is not smaller or equal the process is terminated with Error and ErrorID:=16#FFFFFFFF.
    • 10: The register selected by Select is written with the value of RegData.
    • All other values are ignored by time being. Future versions of the library may assign new functions to any of them. Be sure to mark unused elements by setting to 0.

A falling edge on Execute clears all outputs. If Execute is set to FALSE while the process is still active it will continue. The signals at the end of the process (Done, CommandAborted, Error, ErrorID, Done) will be active for one cycle.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiWriteCoeDriveTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiWriteCoeDriveTerm_BkPlcMc (ab V3.0)

The block is used to write a register of the EL terminal that is used to interface the drive unit of an axis.

VAR_INPUT
        Execute:                BOOL;
        Pdata:          POINTER TO BYTE:=0;
        ByteCount:      BYTE:=0;
        Index:          WORD:=0;
        Subindex:               BYTE:=0;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The writing process is initiated by a rising edge at this input.

Pdata: The address of the data is to be passed here.

ByteCount: The size of the data is to be passed here.

Index, Subindex: The register adress selection is to be passed here.

Busy: The continuing execution of a command is signaled here.

Done : Successful writing of the parameter is indicated here.

CommandAborted : Abortion of the writing process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On a rising edge on Execute the block will examine the interface that it has been supplied. A number of problems can be detected and reported during this process:

  • If the axis is enabled for active operation the block reacts with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If ByteCount or Subindex is outside the acceptable range the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If Index or Pdata is outside the acceptable range the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nDrive_Type is selecting a I/O terminal type that does not support parameter communication the block reacts with Error and ErrorID:=dwTcHydErrCdNotCompatible.
  • If there are problems detected in the ADS communication to the terminal the block will report the received ErrorID and reacts with Error. Some examples for error codes that may show up:
    • 16#0006 = 6 = The port number is unknown. Note: Check the mapping of the InfoData element of the terminal!
    • 16#0007 = 7 = The AmsNetID of the used ADS address is invalif. Note: Check the mapping of the InfoData element of the terminal!
    • 16#0702 = 1794 = dwTcHydAdsErrInvalidIdxGroup = The terminal does not support the CoE protokoll.
    • 16#0703 = 1795 = dwTcHydAdsErrInvalidIdxOffset = The address in Index and Subindex is not supported by the terminal.
    • 16#0745 = 1861 = dwTcHydAdsErrTimeout = Timeout limit was exceeded.

If these checks are carried out without problems the block starts to write the register content.

A falling edge on Execute clears all output signals. If Execute is cleared while the writing process is still active the process will continue. The output signals (Done, CommandAborted, Error, ErrorID) will be valid for one cycle.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiWriteCoeEncTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiWriteCoeEncTerm_BkPlcMc (ab V3.0)

The block is used to write a register of the EL terminal that is used to interface the encoder of an axis.

VAR_INPUT
        Execute:                BOOL;
        Pdata:          POINTER TO BYTE:=0;
        ByteCount:      BYTE:=0;
        Index:          WORD:=0;
        Subindex:               BYTE:=0;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The writing process is initiated by a rising edge at this input.

Pdata: The address of the data is to be passed here.

ByteCount: The size of the data is to be passed here.

Index, Subindex: The register adress selection is to be passed here.

Busy: The continuing execution of a command is signaled here.

Done : Successful writing of the parameter is indicated here.

CommandAborted : Abortion of the writing process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On a rising edge on Execute the block will examine the interface that it has been supplied. A number of problems can be detected and reported during this process:

  • If the axis is enabled for active operation the block reacts with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If ByteCount or Subindex is outside the acceptable range the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If Index or Pdata is outside the acceptable range the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nEncoder_Type is selecting a I/O terminal type that does not support parameter communication the block reacts with Error and ErrorID:=dwTcHydErrCdNotCompatible.
  • If there are problems detected in the ADS communication to the terminal the block will report the received ErrorID and reacts with Error. Some examples for error codes that may show up:
    • 16#0006 = 6 = The port number is unknown. Note: Check the mapping of the InfoData element of the terminal!
    • 16#0007 = 7 = The AmsNetID of the used ADS address is invalif. Note: Check the mapping of the InfoData element of the terminal!
    • 16#0702 = 1794 = dwTcHydAdsErrInvalidIdxGroup = The terminal does not support the CoE protokoll.
    • 16#0703 = 1795 = dwTcHydAdsErrInvalidIdxOffset = The address in Index and Subindex is not supported by the terminal.
    • 16#0745 = 1861 = dwTcHydAdsErrTimeout = Timeout limit was exceeded.

If these checks are carried out without problems the block starts to write the register content.

A falling edge on Execute clears all output signals. If Execute is cleared while the writing process is still active the process will continue. The output signals (Done, CommandAborted, Error, ErrorID) will be valid for one cycle.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiWriteRegDriveTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiWriteRegDriveTerm_BkPlcMc (ab V3.0)

The block is used to write a register of the terminal that is used to interface the drive unit of an axis.

VAR_INPUT
        Execute:                BOOL;
        Select:         INT;
        RegData:                WORD;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The writing process is initiated by a rising edge at this input.

Select: The register adress selection is to be passed here.

RegData: The value that has to be written to the register is to be supplied here.

Busy: The continuing execution of a command is signaled here.

Done : Successful writing of the parameter is indicated here.

CommandAborted : Abortion of the writing process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On a rising edge on Execute the block will examine the interface that it has been supplied. A number of problems can be detected and reported during this process:

  • If one of the pointers ST_TcPlcDeviceInput or ST_TcPlcDeviceOutput are not initialised the block reacts with Error and with ErrorID:=dwTcHydErrCdPtrPlcMc.
  • If the axis is enabled for active operation the block reacts with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If Select is outside the acceptable range of (including) 0 to 63 the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nDrive_Type is selecting a I/O terminal type that does not support parameter communication the block reacts with Error and ErrorID:=dwTcHydErrCdNotCompatible.

If these checks are carried out without problems the block starts to write the register content.

A falling edge on Execute clears all output signals. If Execute is cleared while the writing process is still active the process will continue. The output signals (Done, CommandAborted, Error, ErrorID) will be valid for one cycle.

Hint: The drive types iTcMc_DriveKL2521, iTcMc_DriveKL4032, iTcMc_DriveKL2531 and iTcMc_DriveKL2541 are supporting register communication.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxUtiWriteRegEncTerm_BkPlcMc

FUNCTION_BLOCK MC_AxUtiWriteRegEncTerm_BkPlcMc (ab V3.0)

The block is used to write a register of the terminal that is used to interface the encoder of an axis.

VAR_INPUT
        Execute:                BOOL;
        Select:         INT;
        RegData:                WORD;
END_VAR

VAR_OUTPUT
        Busy:           BOOL;
        Done:           BOOL;
        CommandAborted: BOOL;
        Error:          BOOL;
        ErrorID:                UDINT;
END_VAR

VAR_INOUT
        Axis:           Axis_Ref_BkPlcMc;
END_VAR

Execute : The writing process is initiated by a rising edge at this input.

Select: The register adress selection is to be passed here.

RegData: The value that has to be written to the register is to be supplied here.

Busy: The continuing execution of a command is signaled here.

Done : Successful writing of the parameter is indicated here.

CommandAborted : Abortion of the writing process is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

On a rising edge on Execute the block will examine the interface that it has been supplied. A number of problems can be detected and reported during this process:

  • If one of the pointers ST_TcPlcDeviceInput or ST_TcPlcDeviceOutput are not initialised the block reacts with Error and with ErrorID:=dwTcHydErrCdPtrPlcMc.
  • If the axis is enabled for active operation the block reacts with Error and ErrorID:=dwTcHydErrCdNotReady.
  • If Select is outside the acceptable range of (including) 0 to 63 the block reacts with Error and ErrorID:=dwTcHydErrCdTblIllegalIndex.
  • If nEncoder_Type is selecting a I/O terminal type that does not support parameter communication the block reacts with Error and ErrorID:=dwTcHydErrCdNotCompatible.

If these checks are carried out without problems the block starts to write the register content.

A falling edge on Execute clears all output signals. If Execute is cleared while the writing process is still active the process will continue. The output signals (Done, CommandAborted, Error, ErrorID) will be valid for one cycle.

Hint: The encoder types iTcMc_EncoderKL3002, iTcMc_EncoderKL3042, iTcMc_EncoderKL3062, iTcMc_EncoderKL3162, iTcMc_EncoderKL5101, iTcMc_EncoderKL5111, iTcMc_EncoderKL2521, iTcMc_EncoderKL2531 and iTcMc_EncoderKL2541 are supporting register communication.


TcPlcHydraulics: Knowledge Base

Knowledge Base of the TcPlcLibHydraulics_30 PLC library

You will find a number of answers to frequently asked questions here.

Topics

Name | Description
Global Constants | Pre-defined error codes, masks for bit queries, ADS codes etc.
Setup | Setting up information
SampleList | Sample programms
Ideas Bank | Tips and tricks.
HMI Tool | The PlcMcManager

Problems on updating the library

After an update of the library there may be showing up compiler problems. A possible reason for this is a name change on a block or type. Some name changes are unavoidable because they are enforced by one of the following reasons:

  • Adaption to the rules of the PLC Open Motion Control definitions.
  • Tracing the development of the PLC Open Motion Control definitions.
  • Advancement of the supplied technologie.
  • Adaption to the used technologie, for example the usage of more I/O devices.
  • Avoiding naming collisionsand other types of incompatibility to other libraries.

Starting with V3.0 Build 22 the library is making use of TcEtherCAT.LIB for communication via the EtherCAT fieldbus. Older TwinCAT environments do not supply this library. To enable the use of the library in this kind of environment place a copy of the TcEtherCatDummy.LIB in the project directory and rename it to TcEtherCAT.LIB. Be sure to include this library BEFORE the TcPlcHydraulics.LIB.

Attention : Do not apply this procedure to a TwinCAT environment that supports EtherCAT. Do not use the library file to replace a fully functional TcEtherCAT.LIB.

Note: There will be no functionallity available that is based on EtherCAT technologies.

Note: The library used in a project should be copied to the project directory and should be included to the project backup. This will prevent an unvoluntary version change that may be caused by opening an older project by using an updated TwinCAT Version. If there is an updated version of the library available it can be applied to the project by copying manually.

Note: It is urgendly recommended to compile a project offline after an update of the library. The mappings have to be updated by using the System Manager. If there is a size change reported by the table below all connections have to be checked.

Attention : Please be sure to check the version number of any library update. A change in the first and/or second part (major, minor) will indicate a change in the mappable data types. In this case it is urgendly requirred to check and rework / reactivate any connections by using the System Manager. A change in the third part of the version (build) indicates code changes that do not affect mappings.

Former Name | New Name | Reason for change
ST_TcMcAxInterface | Axis_Ref_BkPlcMc | Adaption to the rules of the PLC Open Motion Control definitions.
ST_TcPlcMcCamId | MC_CAM_ID_BkPlcMc | Adaption to the rules of the PLC Open Motion Control definitions.
ST_TcPlcMcCamRef | MC_CAM_REF_BkPlcMc | Adaption to the rules of the PLC Open Motion Control definitions.
E_TcMCDirection | MC_Direction_BkPlcMc | Adaption to the rules of the PLC Open Motion Control definitions.
E_TcMCStartMode | MC_StartMode_BkPlcMc | Adaption to the rules of the PLC Open Motion Control definitions.
ST_TcPlcMcEncoderIn | --- | removed, task is taken over by ST_TcPlcDeviceInput.
ST_TcPlcMcEncoderOut | --- | removed, task is taken over by ST_TcPlcDeviceOutput.
ST_TcPlcMcDriveIn | --- | removed, task is taken over by ST_TcPlcDeviceInput.
ST_TcPlcMcDriveOut | --- | removed, task is taken over by ST_TcPlcDeviceOutput.
ST_TcPlcMcAx2000In | --- | removed, task is taken over by ST_TcPlcDeviceInput.
ST_TcPlcMcAx2000Out | --- | removed, task is taken over by ST_TcPlcDeviceOutput.

Size of I/O structures in bytes

Name | V 2.1.X | V3.0.0 | V3.0.x (under construction)
ST_TcPlcMcEncoderIn | 16 |  |
ST_TcPlcMcEncoderOut | 1 |  |
ST_TcPlcMcDriveIn | 23 |  |
ST_TcPlcMcDriveOut | 40 |  |
ST_TcPlcMcAx2000In | 37 |  |
ST_TcPlcMcAx2000Out | 26 |  |
ST_TcPlcDeviceInput |  | 143 | 188
ST_TcPlcDeviceOutput |  | 103 | 104


TcPlcHydraulics: Knowledge Base: Global Constants

Knowledge Base of the TcPlcHydraulics PLC library: Global Constants (starting with V3.0)

Bit-masks for position cams

These masks are to be used by the application to provide digital movement cams for bActPosCams in ST_TcHydAxRtData.

Constant | Description
bTcHydActPosCamPos | Summary of bTcHydActPosCamHigh and bTcHydActPosCamUp.
bTcHydActPosCamHigh | The axis has reached the upper target position.
bTcHydActPosCamUp | The axis is located close to the upper target position.
bTcHydActPosCamDown | The axis is located close to the lower target position.
bTcHydActPosCamLow | The axis has reached the lower target position.
bTcHydActPosCamNeg | Summary of bTcHydActPosCamLow and bTcHydActPosCamDown.

Bit-masks for axis status information

These masks are to be used by the application to interrogate status signals in nStateDWord in ST_TcHydAxRtData.

Constant | Description
dwTcHydNsDwFunctional | Axis is ready for operation.
dwTcHydNsDwReferenced | Axis has been referenced.
dwTcHydNsDwSteady | Axis is not active.
dwTcHydNsDwInTargRng | The axis is located within a distance from the target position specified by fMonPositionRange in ST_TcHydAxParam.
dwTcHydNsDwInTarget | The axis has been located without interruption since a time specified by fMonTargetFilter within a distance from the target position specified by fMonTargetRange in ST_TcHydAxParam.
dwTcHydNsDwDontTouchProtected | reserved. not supported.
dwTcHydNsDwStopped | The last movement of the axis was stopped without reaching the specified target position.
dwTcHydNsDwBusy | The axis is active.
dwTcHydNsDwMoveUp | The axis is moving in the direction of increasing positions.
dwTcHydNsDwMoveDown | The axis is moving in the direction of decreasing positions.
dwTcHydNsDwReferencing | The axis is executing a homing operation.
dwTcHydNsDwConstVelo | The axis is moving with constant velocity.
dwTcHydNsDwExtSetpointActive | The axis is controlled by a MC_AxRtSetExtGenValues_BkPlcMc block.
dwTcHydNsDwStartedOver | The axis has been started over, i.e. the last accepted move command became effective while the axis was still traveling.
dwTcHydNsDwControlActive | The control loop of the axis is effective. The actual response is defined by the individual settings of the axis.
dwTcHydNsDwErrState | The axis is in an error state.

Bit-masks for axis enable information

These masks are to be used by the application to provide enable signals in nDeCtrlDWord in ST_TcHydAxRtData.

Constant | Description
dwTcHydDcDwCtrlEnable | Controller enable. This enable is a precondition for the output of control value and controller outputs.
dwTcHydDcDwFdPosEna | Advance movement enable in positive direction. This enable is a precondition for the output of control value and controller outputs in the direction of increasing values of position.
dwTcHydDcDwCtrlPosEna | Combination of dwTcHydDcDwCtrlEnable and dwTcHydDcDwFdPosEna.
dwTcHydDcDwFdNegEna | Advance movement enable in negative direction. This enable is a precondition for the output of control value and controller outputs in the direction of decreasing values of position.
dwTcHydDcDwCtrlNegEna | Combination of dwTcHydDcDwCtrlEnable and dwTcHydDcDwFdNegEna.
dwTcHydDcDwRefIndex | Referencing cam.
dwTcHydDcDwAcceptBlockedDrive | reserved. not supported.
dwTcHydDcDwBlockedDriveDetected | reserved. not supported completely. Hint: This flag will block a velocity control loop if there is any.

Error Codes

These constants are to be used for the outputs of ErrorID from blocks and for nErrorCode in ST_TcHydAxRtData.

Constant | Hexadecimal | Decimal | Description
dwTcHydAdsErrNoError | 0 | 0 | No error.
dwTcHydAdsErrUnknownPort | 16#0006 | 6 | The addressed ADS port is unknown. Possible causes: - AMS NetID / ADS port selecting wrong run time or computer. - The adressed PLC is not running the intended project. - The project is not calling a MC_AxAdsCommServer_BkPlcMc block.
dwTcHydAdsErrUnknownTarget | 16#0007 | 7 | The addressed target computer is unknown.
dwTcHydAdsErrInvalidIdxGroup | 16#0702 | 1794 | Invalid IndexGroup.
dwTcHydAdsErrInvalidIdxOffset | 16#0703 | 1795 | Invalid IndexOffset.
dwTcHydAdsErrRdWrNotPermitted | 16#0704 | 1796 | Access (write, read) not permitted.
dwTcHydAdsErrInvalidSize | 16#0705 | 1797 | Size (number of bytes) not permitted.
dwTcHydAdsErrIllegalValue | 16#0706 | 1798 | Value not permitted.
dwTcHydAdsErrNotReady | 16#0707 | 1799 | Not ready for operation.
dwTcHydAdsErrBusy | 16#0708 | 1800 | Already active.
dwTcHydAdsErrNoFile | 16#070C | 1804 | The requested file could not be found.
dwTcHydAdsErrSyntax | 16#070D | 1805 | The syntax of the command or file is invalid.
dwTcHydAdsErrTimeout | 16#0745 | 1861 | Timeout.
dwTcHydErrCdNotCompatible | 16#4040 | 16448 | The axis is not compatible with the requested function.
dwTcHydErrCdIllegalOutputNumber | 16#4104 | 16644 | Output number is out of the acceptable range.
dwTcHydErrCdNotSupport | 16#4107 | 16647 | Function or command not supported.
dwTcHydErrCdCycleTime | 16#4205 | 16901 | Cycle time (fCycletime in ST_TcHydAxParam) not permitted.
dwTcHydErrCdMissingEnc | 16#4210 | 16912 | There is no connection to an encoder interface (pStAxEncInput and/or pStAxEncOutput in Axis_Ref_BkPlcMc).
dwTcHydErrCdMissingDrive | 16#4212 | 16914 | There is no connection to a drive interface (pStAxDriveOutput and/or pStAxDriveInput or pStAxAx2000Out and/or pStAxAx2000In in Axis_Ref_BkPlcMc).
dwTcHydErrCdCannotSynchronize | 16#421A | 16922 | Reported by MC_GearInPos_BkPlcMc blocks if there is insufficient distance to synchronise the slave axis to its master.
dwTcHydErrCdIllegalGearFactor | 16#421B | 16923 | The parameters of a gear function are invalid.
dwTcHydErrCdSoftEnd | 16#4222 | 16930 | The target position is located on the far side of an active software limit switch, and is therefore not permitted.
dwTcHydErrCdLowDist | 16#4228 | 16936 | The travel distance is unacceptably small.
dwTcHydErrCdIllegalStartType | 16#4239 | 16953 | The start type is unacceptable.
dwTcHydErrCdCommandBufferOverflow | 16#423F | 16959 | Command buffer allready full.
dwTcHydErrCdEncLostCamm | 16#4253 | 16991 | reserved. not supported.
dwTcHydErrCdCtrlEnaLost | 16#4260 | 16992 | Control enable got lost during an active move.
dwTcHydErrCdEncNoCammFound | 16#429C | 17052 | reserved. not supported.
dwTcHydErrCdEncNoCammEnd | 16#429D | 17053 | reserved. not supported.
dwTcHydErrCdEncNoSyncPulse | 16#429E | 17054 | reserved. not supported.
dwTcHydErrCdAcc | 16#4309 | 17161 | The acceleration is not acceptable.
dwTcHydErrCdDec | 16#430A | 17162 | The deceleration is not acceptable.
dwTcHydErrCdJerk | 16#430B | 17163 | The jerk is not acceptable.
dwTcHydErrCdPtrPlcMc | 16#4345 | 17221 | There is no connection to one of the required axis interfaces (pStAxParams, pStAxRtData in Axis_Ref_BkPlcMc).
dwTcHydErrCdPtrMcPlc | 16#4346 | 17222 | There is no connection to one of the required axis interfaces (pStAxParams, pStAxRtData in Axis_Ref_BkPlcMc).
dwTcHydErrCdCtrlEna | 16#4356 | 17238 | Movement without controller enable is not permitted.
dwTcHydErrCdNegFdEna | 16#4357 | 17239 | Movement in the direction of reducing positions without the negative direction advance enable is not permitted.
dwTcHydErrCdPosFdEna | 16#4358 | 17240 | Movement in the direction of increasing positions without positive direction advance enable is not permitted.
dwTcHydErrCdSetVelo | 16#4359 | 17241 | The required velocity is not acceptable.
dwTcHydErrCdPehTimeout | 16#435C | 17244 | The axis did not settle in the target within the specified time.
dwTcHydErrCdNotMoving | 16#435D | 17245 | The axis is not moving, or not in the correct direction.
dwTcHydErrCdConsequential | 16#43A0 | 17312 | Consequential error. The axis is in an error state, because an axis it depends on is in an error state.
dwTcHydErrCdEncType | 16#4401 | 17409 | The parameter type is invalid.
dwTcHydErrCdEncScaling | 16#4406 | 17414 | The increment scaling is not permitted.
dwTcHydErrCdEncSyncDist | 16#4414 | 17428 | The distance between Latch_Enable and the sync pulse is too small.
dwTcHydErrCdEncSetActPos | 16#4422 | 17442 | An error was detected during a actual position seting operation.
dwTcHydErrCdPtrPlcEncIn | 16#4442 | 17474 | The axis does not have a pointer to an encoder input interface.
dwTcHydErrCdPtrPlcEncOut | 16#4443 | 17475 | The axis does not have a pointer to an encoder output interface.
dwTcHydErrCdEncUnderrun | 16#4450 | 17488 | Reported by some encoder types: The actual position is passing thru the lower end of the encoders counting range.
dwTcHydErrCdEncOverrun | 16#4451 | 17489 | Reported by some encoder types: The actual position is passing thru the upper end of the encoders counting range.
dwTcHydErrCdEncHdwFailed | 16#4464 | 17508 | Drive unit or encoder reporting hardware failure
dwTcHydErrCdSsi | 16#4470 | 17520 | An error was detected when operating an SSI encoder.
dwTcHydErrCdPosLag | 16#4550 | 17744 | The lag distance is exceeding the active limit.
dwTcHydErrCdDriveType | 16#4601 | 17921 | The value set in nDrive_Type is not permitted.
dwTcHydErrCdRefVelo | 16#4605 | 17925 | Reference velocity (fRefVelo in ST_TcHydAxParam) is invalid.
dwTcHydErrCdStepperStalled | 16#4636 | 17974 | A stall situation is detected.
dwTcHydErrCdPtrPlcDriveIn | 16#4642 | 17986 | The axis does not have a pointer to a drive input interface.
dwTcHydErrCdPtrPlcDriveOut | 16#4643 | 17987 | The axis does not have a pointer to a drive output interface.
dwTcHydErrCdDriveNotReady | 16#4650 | 18000 | Power section not ready for operation
dwTcHydErrCdTblEntryCount | 16#4A02 | 18946 | The number of table entrys is invalid.
dwTcHydErrCdTblInvalidMasterStep | 16#4A04 | 18948 | The distances of the tables master values is illegal.
dwTcHydErrCdTblNoInit | 16#4A10 | 18960 | The table isn't initialised.
dwTcHydErrCdTblIllegalIndex | 16#4A13 | 18963 | The table index is illegal.
dwTcHydErrCdTblLineCount | 16#4A15 | 18965 | The number of table lines is to big.
dwTcHydErrCdNotStartable | 16#4B01 | 19201 | Axis in a state that does not allow it to start.
dwTcHydErrCdFuncTimeout | 16#4B07 | 19207 | The function could not be finalised within the defined time limit.
dwTcHydErrCdNotReady | 16#4B09 | 19209 | The axis is not in an operable state.
dwTcHydErrCdHomingType | 16#4F00 | 20224 | Referencing method (nEnc_HomingType in ST_TcHydAxParam) is not permitted.
dwTcHydErrCdEncCutOff | 16#4F01 | 20225 | The limit frequency for the actual value acquisition has been exceeded.
dwTcHydErrCdIllegalDistance | 16#4F02 | 20226 | The distance is invalid: zero or negative.
dwTcHydErrEncDisconected | 16#4FF0 | 20464 | The encoder hardware is disconnected.
dwTcHydErrDriveDisconected | 16#4FF1 | 20465 | The drive hardware is disconnected.
dwTcHydErrDistanceInsufficient | 16#4FF2 | 20466 | The travel is not sufficient.

Device specific error codes reported by MC_Power_BkPlcMc blocks

Values from this table may show up at ErrorID of MC_Power_BkPlcMc blocks, if there is a problem reported by the external device.

Konstante | Hexadezimal | Dezimal | Beschreibung
dwTcHydErrCdAX2000MainPwrTmOut | 16#0001 | 1 | For AX2000 only: No response from the line power switch (timeout while waiting for ST_TcPlcMcAx2000In.bPowerOk).
dwTcHydErrCdAX2000MainPwrFault | 16#0002 | 2 | For AX2000 only: Falling edge detected on the feedback of the line power switch (ST_TcPlcMcAx2000In.bPowerOk).
dwTcHydErrCdAX2000PwrStageTmOut | 16#0003 | 3 | For AX2000 only: No response from AX device (timeout while waiting for ST_TcPlcMcAx2000In.DriveState[3].6, not Ready)
dwTcHydErrCdAX2000PwrStageFault | 16#0004 | 4 | For AX2000 only: Falling edge detected on AX device (ST_TcPlcMcAx2000In.DriveState[3].6, not Ready).
dwTcHydErrCdAX2000ReportsError | 16#0005 | 5 | For AX2000 only: Error reported by AX device (ST_TcPlcMcAx2000In.DriveState[3].7 or ST_TcPlcMcAx2000In.DriveError<>0).
dwTcHydErrCdAX2000ErrorI2T | 16#0006 | 6 | For AX2000 only: I2T error reported by AX device (ST_TcPlcMcAx2000In.DriveState[0].0).
dwTcHydErrCdAX2000ErrorChopper | 16#0007 | 7 | For AX2000 only: Chopper resistor of AX device failed(ST_TcPlcMcAx2000In.DriveState[0].1).
dwTcHydErrCdAX2000ErrorWatchDog | 16#0008 | 8 | For AX2000 only: Watchdog (timeout on communication) of AX device was triggered (ST_TcPlcMcAx2000In.DriveState[0].3).
dwTcHydErrCdAX2000ErrorPwrLine | 16#0009 | 9 | For AX2000 only: Supply failure reported by AX device (ST_TcPlcMcAx2000In.DriveState[0].4).
dwTcHydErrCdAX2000ConnectionLost | 16#000A | 10 | For AX2000 only: The connection to the AX device is interrupted or severely disturbed (ST_TcPlcMcAx2000In.BoxState<>0).
dwTcHydErrCdAX2000ConnectionTmOut | 16#000B | 11 | For AX2000 only: The communication with the AX device could not be startet (timeout).
dwTcHydErrCdKL2531OverTemp | 16#0001 | 1 | For KL2531/KL2541 only: The terminal is reporting an overtemperature alarm.
dwTcHydErrCdKL2531UnderVoltage | 16#0002 | 2 | For KL2531/KL2541 only: The terminal is reporting a low supply voltage on the power rail.
 | 16#0003 | 3 | For KL2531/KL2541 only:
dwTcHydErrCdKL2531OpenLoadA | 16#0004 | 4 | For KL2531/KL2541 only: The terminal is reporting an open load condition on the A phase.
dwTcHydErrCdKL2531OpenLoadB | 16#0005 | 5 | For KL2531/KL2541 only: The terminal is reporting an open load condition on the B phase.
dwTcHydErrCdKL2531OverCurrentA | 16#0006 | 6 | For KL2531/KL2541 only: The terminal is reporting an overcurrent alarm on the A phase.
dwTcHydErrCdKL2531OverCurrentB | 16#0007 | 7 | For KL2531/KL2541 only: The terminal is reporting an overcurrent alarm on the B phase.
dwTcHydErrCdKL2531NotReady | 16#0008 | 8 | For KL2531/KL2541 only: The terminal is reporting a power stage problem (Enabled, not ready).
dwTcHydErrCdKL2531ConnectionLost | 16#000A | 10 | For KL2531/KL2541 only: The connection to the terminal is interrupted or severely disturbed (ST_TcPlcMcAx2000In.BoxState<>0).
dwTcHydErrCdKL2531ConnectionTmOut | 16#000B | 11 | For KL2531/KL2541 only: The communication with the terminal could not be startet (timeout).

ADS Codes

These constants are accepted by the MC_AxAdsReadDecoder and MC_AxAdsWriteDecoder blocks.

IndexGroup | IndexOffset | Type | R/W | Description
16#4000 + axis index | 2 | STRING() | R | Axis name in text form.
 | 4 | UDINT | R | Cycle time in microseconds.
 | 16#10003 | UDINT | R | Encoder type: nEnc_Type from ST_TcHydAxParam.
 | 16#10006 | LREAL | R | Incremental evaluation: fEnc_IncWeighting from ST_TcHydAxParam.
 | 16#30003 | UDINT | R | Drive type: nDrive_Type from ST_TcHydAxParam.
16#4100 + axis index | 1 | UDINT | R | Error code: nErrorCode from ST_TcHydAxParam.
 | 16#10002 | LREAL | R | Actual position: fActPos from ST_TcHydAxParam.
 | 16#10005 | LREAL | R | Actual velocity: fActVelo from ST_TcHydAxParam.
16#4200 + axis index | 1 | - | W | Execute axis reset.
 | 16#10 | - | W | Start reference travel.
 | 16#21 | Structure | W | Start axis movement.
 | 16#FFFF0001 | - | W | Save parameters.
 | 16#FFFF0002 | - | W | Load parameters.
16#4300 + axis index | 16#81 | UDINT | R | Status double word: nStateDWord from ST_TcHydAxParam.
 | 16#B1 | UDINT | R | Error code: nErrorCode from ST_TcHydAxParam.
16#F000 + axis index | 1 | Structure | R | The ST_TcHydAxParam variable for the axis.
 | 2 | Structure | R/W | The ST_TcHydAxParam variable for the axis.
16#000F0000 + axis index | E_TcMCParameter |  | R/W | Parameters and actual values for the axis.
16#FFFFFFFF | 0 | String() | R | Identification of the server.
 | 1 | UINT | R | Major version of the library.
 | 2 | UINT | R | Minor version of the library.
 | 3 | UINT | R | Release of the library.
 | 4 | UINT | R | Number of axes supported.

Array Dimensions

The constants below are used to define array dimensions and may be used by the application.

Constant | Description
ciBkPlcMc_CamSwitchRef_MinIdx | Lower boundary index on an array[] of CAMSWITCH_REF_BkPlcMc, supplied to blocks of type MC_DigitalCamSwitch_BkPlcMc
ciBkPlcMc_CamSwitchRef_MaxIdx | Upper boundary index on an array[] of CAMSWITCH_REF_BkPlcMc, supplied to blocks of type MC_DigitalCamSwitch_BkPlcMc
ciBkPlcMc_TrackRef_MinIdx | Lower boundary index on an array[] of TRACK_REF_BkPlcMc, supplied to blocks of type MC_DigitalCamSwitch_BkPlcMc
ciBkPlcMc_TrackRef_MaxIdx | Upper boundary index on an array[] of TRACK_REF_BkPlcMc, supplied to blocks of type MC_DigitalCamSwitch_BkPlcMc

Logger Levels

The constants below are used to define the threshold for the librarys logging functionallity.

Constant | Description
dwTcHydLogLevel_None | No recording
dwTcHydLogLevel_Errors | Error messages only
dwTcHydLogLevel_Warnings | Error messages and warnings
dwTcHydLogLevel_Actions | Error messages, warnings and activities

Logger Sources

The constants below are used to define the source of a message that is recorded by the librarys logging functionallity.

Konstante | Beschreibung
dwTcHydLogSource_Library | A block from the hydraulics library
dwTcHydLogSource_LibExt_2R2V | A block from the 2R2V gantry library
dwTcHydLogSource_Application | A block from the application
dwTcHydLogSource_ApplicationFramework | A block from an application framework

Logger Argument Types

The constants below are used to define the type of an optional parameter of a message that is recorded by the librarys logging functionallity.

Konstante | Beschreibung
dwTcHydLogArgType_DInt | The message contains a parameter of type DINT. The text of the message has to to contain a place holder of the form %d.
dwTcHydLogArgType_LReal | The message contains a parameter of type LREAL. The text of the message has to to contain a place holder of the form %f.
dwTcHydLogArgType_String | The message contains a parameter of type STRING. The text of the message has to to contain a place holder of the form %s.


TcPlcHydraulics: Knowledge Base: FAQs

Knowledge Base of the TcHydlib PLC library: FAQs (starting with V3.0)

You will find a number of answers to frequently asked questions here.

Name | Description
FAQ #1 | How do I integrate one or more axes into a PLC application?
FAQ #2 | What data has to be created in the PLC application for the axes?
FAQ #3 | How do I initialise the data and load the parameters for an axis when the PLC starts?
FAQ #4 | How is the actual position of the axes determined ?
FAQ #5 | How is the control value for an axis created?
FAQ #6 | How is the control value for an axis prepared for output?
FAQ #7 | How is the control value output to an axis?
FAQ #8 | What is the correct order to call the function blocks for an axis?
FAQ #9 | How do I control the power stage (on board or external) of a valve?
FAQ #10 | How do I create a message logger functionality?
FAQ #11 | How do I abort the monitoring of a function?
FAQ #12 | How do I monitor the communication to an I/O device?
FAQ #13 | How do I apply customer specific names to auxiliary axis parameters?
FAQ #14 | How do I control a flow valve?
FAQ #15 | What set of variables from the axis are advised to be part of a scope view?
FAQ #16 | What is the meaning of nDebugTag in Axis_Ref_BkPlcMc?
FAQ #17 | What are the special rules for using a Sercos drive unit?
FAQ #18 | How do I determine a pressure or force actual value?
FAQ #19 | What are the special rules for using a AX5000 drive unit?
FAQ #20 | reserved
FAQ #21 | How can I access a register of terminal that is used to connect an encoder or a valve?
FAQ #22 | What is the ASCII file format of a linearisation table?
FAQ #23 | How do I reject commands sended by the PlcMcManager?
Setup | How is operation of the axis begun, and how is it optimised?

FAQ #1 How do I integrate one or more axes into a PLC application?

The procedure here differs fundamentally from an axis guided by the NC task, because in this case everything done by the NC task is performed by the PLC. Ready-made program blocks are, however, available in most areas, so that the additional programming effort is held within reasonable limits. The following particular points must be considered:

  • Axis data in the PLC application (FAQ #2)
  • Initialising and loading the axis parameters when starting the PLC application (FAQ #3)
  • Acquisition of actual values (FAQ #4)
  • Generating control values (FAQ #5)
  • Processing control values in preparation for output (FAQ #6)
  • Setting up the axes (Setup)
  • Setting up force or pressure reading by applying blocks of type MC_AxRtReadPressureSingle_BkPlcMc or MC_AxRtReadPressureDiff_BkPlcMc.
  • Organisation of the procedure for movement (FAQ #7)

Note: If only the usual blocks (encoder, generator, finish, drive) for the axis are going to be called, then a block of type MC_AxStandardBody_BkPlcMc should be used for the sake of simplicity.

FAQ #2 What data has to be created in the PLC application for the axes?

A variable of each of the types Axis_Ref_BkPlcMc, ST_TcPlcDeviceInput and ST_TcPlcDeviceOutput must be created for each axis. The use of variable fields is highly recommended for multiple axes. An example for a single axis and a multiple axis project are supplied as TcPlcMcEx_1.zip and TcPlcMcEx_2.zip.

The examples demonstrate a way of startup initialising and loading parameters from files by usage of a MC_AxUtiStandardInit_BkPlcMc block.

FAQ #3 How do I initialise the data for an axis?

A number of initialisations must be carried out when the PLC applications starts. It is recomended to use a MC_AxUtiStandardInit_BkPlcMc block for this three stage process:

  1. A number of pointers must be correctly set up to link the components of the axes together. This section is usually implemented by using a block of type MC_AxUtiStandardInit_BkPlcMc(), that will monitor the projects memory layout for changes of sizes, allocation or coded interface types caused by online change. The block is triggering a parameter reload in these cases.
  2. The parameters for the axis must be appropriately set. Although it would be technically possible for the application to do have these assignments hard-coded, this is not usually helpful. It is better for the settings to be stored in files that are loaded by a MC_AxUtiStandardInit_BkPlcMc() block under the control of the application when the system starts. Notes on setting up an axis can be found under Setup.
  3. The task cycle time has to be copied to the axis parameters. This should be done at the end of the parameter loading procedure. The MC_AxUtiStandardInit_BkPlcMc() block is taking care for this update.

Warning : If a block of type MC_AxAdsCommServer_BkPlcMc is used in the application, the block must be called in the same task that carries out the pointer assignments. If this is not possible, or for some reason difficult, then calling the block must be prevented while the assignments are being carried out. The result, otherwise, can be that the PLC application crashes as a result of serious runtime errors (Page Fault Exception).

Note: All activities listet above should be carried out by a MC_AxUtiStandardInit_BkPlcMc block. When the variable nInitState in the Axis_Ref_BkPlcMc structure of the axis has been set to 2 or -2 by the block the initialisation was successfull or failed. On a successfull initialisation MC_AxUtiStandardInit_BkPlcMc.Ready and bParamsEnable in Axis_Ref_BkPlcMc are TRUE.

Note: The programm samples provided here specifie the names of the axis and of the associated parameter file (including the path). It is essential that these specifications are modified to match the particular application.

FAQ #4: How is the actual position of the axes determined ?

A range of signal transducers may be considered for use as position sensors, operating according to a variety of physical principles to generate a position-dependent electrical magnitude. This magnitude determines the type of I/O components that must be used. The variables of types ST_TcPlcDeviceInput and ST_TcPlcDeviceOutput must be created for each axis, and contain elements that are to be linked to the actual value, counter, latch, control and status variables associated with the I/O hardware.

Here are a few examples:

I/O components | Signal | Encoder type
AX2000 B110 absolute encoder | Servo amplifier | iTcMc_EncoderAx2000_B110A
AX2000 B110 resolver | Servo amplifier | iTcMc_EncoderAx2000_B110R
AX2000 B200 resolver | Servo amplifier | iTcMc_EncoderAx2000_B200R
AX2000 B750 absolute encoder | Servo amplifier | iTcMc_EncoderAx2000_B750A
AX2000 B900 resolver | Servo amplifier | iTcMc_EncoderAx2000_B900R
AX5000 B110 multiturn absolute encoder | Servo amplifier | iTcMc_EncoderAx5000_B110A
EL3102 | -10V .. 10V | iTcMc_EncoderEL3102
EL3142 | 0mA .. 20mA | iTcMc_EncoderEL3142
EL3162 | 0 .. 10V | iTcMc_EncoderEL3162
EL5001 | SSI | iTcMc_EncoderEL5001
EL5101 | A/B increments, RS422="TTL" | iTcMc_EncoderEL5101
EtherCAT servo drive, supporting DS402 profile | EtherCAT | iTcMc_Encoder_CoE_DS402
EtherCAT encoder, supporting DS406 profile | EtherCAT | iTcMc_EncoderCoE_DS406
IE5009 | SSI | iTcMc_EncoderIx5009
IP5009 | SSI | iTcMc_EncoderIx5009
KL10xx | 2 Bit, A/B increments | iTcMc_EncoderDigIncrement
KL11xx | 2 Bit, A/B increments | iTcMc_EncoderDigIncrement
KL12xx | 2 Bit, A/B increments | iTcMc_EncoderDigIncrement
KL13xx | 2 Bit, A/B increments | iTcMc_EncoderDigIncrement
KL14xx | 2 Bit, A/B increments | iTcMc_EncoderDigIncrement
KL17xx | 2 Bit, A/B increments | iTcMc_EncoderDigIncrement
KL10xx | 4 Bit, position cams | iTcMc_EncoderDigCam
KL11xx | 4 Bit, position cams | iTcMc_EncoderDigCam
KL12xx | 4 Bit, position cams | iTcMc_EncoderDigCam
KL13xx | 4 Bit, position cams | iTcMc_EncoderDigCam
KL14xx | 4 Bit, position cams | iTcMc_EncoderDigCam
KL17xx | 4 Bit, position cams | iTcMc_EncoderDigCam
KL2521 | Pulse train | iTcMc_EncoderKL2521
KL2531 | Stepper, direct (encoder emulated from pulse counter) | iTcMc_EncoderKL2531
KL2541 | Stepper, direct (with encoder or encoder emulated from pulse counter) | iTcMc_EncoderKL2541
KL2542 | DC motor, direct with encoder | iTcMc_EncoderKL2542
KL3001 | -10V .. 10V | iTcMc_EncoderKL3002
KL3002 | -10V .. 10V | iTcMc_EncoderKL3002
KL3011 | 0mA .. 20mA | iTcMc_EncoderKL3042
KL3012 | 0mA .. 20mA | iTcMc_EncoderKL3042
KL3021 | 4mA .. 20mA | iTcMc_EncoderKL3042
KL3022 | 4mA .. 20mA | iTcMc_EncoderKL3042
KL3041 | 0mA .. 20mA | iTcMc_EncoderKL3042
KL3042 | 0mA .. 20mA | iTcMc_EncoderKL3042
KL3044 | 0mA .. 20mA | iTcMc_EncoderKL3042
KL3051 | 4mA .. 20mA | iTcMc_EncoderKL3042
KL3052 | 4mA .. 20mA | iTcMc_EncoderKL3042
KL3054 | 4mA .. 20mA | iTcMc_EncoderKL3042
KL3061 | 0V .. 10V | iTcMc_EncoderKL3062
KL3062 | 0V .. 10V | iTcMc_EncoderKL3062
KL3064 | 0V .. 10V | iTcMc_EncoderKL3062
KL3162 | 0V .. 10V | iTcMc_EncoderKL3162
KL5001 | SSI | iTcMc_EncoderKL5001
KL5101 | A/B increments, RS422="TTL" | iTcMc_EncoderKL5101
KL5111 | A/B increments, RS422="HTL" | iTcMc_EncoderKL5111
M2510 | -10V .. 10V | iTcMc_EncoderM2510
M3100 | A/B increments, RS422="TTL" | iTcMc_EncoderM3120
M3120 | A/B increments, RS422="TTL" | iTcMc_EncoderM3120

If one of the components mentioned here is used, then one of the encoder blocks provided will usually be applied. These blocks are located in the library's PLCopen_motioncontrol/System/Internals sub-directory, and have technical names. It is strongly recommended to specify the type of encoder according to the constants in E_TcMcEncoderType, to set it under nEnc_Type in ST_TcHydAxParam and to use a block of type MC_AxRtEncoder_BkPlcMc. This then automatically calls the correct type of sub-block for the type concerned. Directly calling this hardware-specific block brings only a small benefit in runtime, but makes a software modification essential when I/O components are changed.

All the encoder blocks use the parameter fEnc_IncWeighting and fEnc_IncInterpolation to evaluate the increments. fEnc_ZeroShift is also used as a zero offset shift for absolute displacement sensors. Incremental sensors usually require a reference travel using a MC_Home_BkPlcMc block, during which fEnc_RefShift in ST_TcHydAxRtData is determined. This value then does the job of the zero offset shift. In special cases it is, of course, also possible to specify the zero offset shift with a MC_SetPosition_BkPlcMc block. The reference state of the axis can be defined by use of a MC_SetReferenceFlag_BkPlcMc().

If, for technical reasons, it is not possible to determine the actual position using blocks from the library, this task can be carried out by application modules, and the result entered into fActPos in ST_TcHydAxRtData. For the sake of uniformity use should again be made here of the fEnc_IncWeighting, fEnc_IncInterpolation and fEnc_ZeroShift or fEnc_RefShift parameters.

Note: If only the usual blocks (encoder, generator, finish, drive) for the axis are going to be called, then a block of type MC_AxStandardBody_BkPlcMc should be used for the sake of simplicity.

Note: The setup procedure for the read back of an actual pressure by use of MC_AxRtReadPressureSingle_BkPlcMc or MC_AxRtReadPressureDiff_BkPlcMc function blocks is described in the documentation of these function blocks.

FAQ #5: How is the control value for an axis created?

The PLC application must call a block of type MC_AxRuntime_BkPlcMc in every cycle for every axis. The parameter nProfileType in ST_TcHydAxParam specifies the procedure that is to be used to generate the control value. Velocity control values are calculated here according to the type, and depending on other parameters associated with the axis and on the movement data. These control values are, however, normalised to the abstract numerical range ±1.0, and have not yet been prepared for immediate output to I/O hardware.

Note: If only the usual blocks (encoder, generator, finish, drive) for the axis are going to be called, then a block of type MC_AxStandardBody_BkPlcMc should be used for the sake of simplicity.

FAQ #6: How is the control value for an axis prepared for output?

After calling the MC_AxRuntime_BkPlcMc block, a block of type MC_AxRtFinish_BkPlcMc must be called for each axis. This block assembles a number of velocity components (control value, controller output, offset compensation, overlap compensation), and also takes into account in the bends in the feed forward characteristic curve.

Numerical adjustment is usually necessary prior to output to an I/O module. A MC_AxRtDrive_BkPlcMc block is to be called for each axis for this purpose. The value of nDrive_Type in ST_TcHydAxParam selects the hardware-specific sub-block to be used.

The variables of types ST_TcPlcDeviceInput and ST_TcPlcDeviceOutput must be created for each axis, and contain elements that are to be linked to the set value and control variables of the I/O hardware.

Note: If only the usual blocks (encoder, generator, finish, drive) for the axis are going to be called, then a block of type MC_AxStandardBody_BkPlcMc should be used for the sake of simplicity.

FAQ #7: How is the control value output to an axis?

A range of devices and equipment might be functioning as actuators, applying a variety of physical principles to create a variable velocity that depends on an electrical magnitude. This magnitude determines the type of I/O components that must be used. The variables of types ST_TcPlcDeviceInput and ST_TcPlcDeviceOutput must be created for each axis, and contain elements that are to be linked to the variables of the I/O hardware.

Here are a few examples:

I/O components | Signal | Drive Type
AX2000 B110 absolute encoder | Servo amplifier | iTcMc_DriveAx2000_B200A
AX2000 B110 resolver | Servo amplifier | iTcMc_DriveAx2000_B200R
AX2000 B200 resolver | Servo amplifier | iTcMc_DriveAx2000_B200R
AX2000 B750 absolute encoder | Servo amplifier | iTcMc_DriveAx2000_B750A
AX2000 B900 resolver | Servo amplifier | iTcMc_DriveAx2000_B900R
AX5000 B110 multiturn absolute encoder | Servo amplifier | iTcMc_DriveAX5000_B110A
AX5000 B110 singleturn absolute encoder or resolver | Servo amplifier | iTcMc_DriveAx5000_B110SR
EtherCAT servo drive, supporting DS402 profile | EtherCAT | iTcMc_Drive_CoE_DS402
EtherCAT valve, supporting DS408 profile | EtherCAT | iTcMc_Drive_CoE_DS408
EL4132 | -10V .. 10V | iTcMc_DriveKL4032
IE2512 | PWM | iTcMc_DriveIx2512_1Coil iTcMc_DriveIx2512_2Coil
IP2512 | PWM | iTcMc_DriveIx2512_1Coil iTcMc_DriveIx2512_2Coil
KL20xx, KL21xx, KL22xx, KL24xx | 5 Bit | iTcMc_DriveLowCostInverter
KL20xx, KL21xx, KL22xx, KL24xx | 4 Bit | iTcMc_DriveLowCostStepper
KL2521 | Pulse Train | iTcMc_DriveKL2521
KL2531 | Stepper output, direct | iTcMc_DriveKL2531
KL2532 | DC motor, direct | iTcMc_DriveKL2532
KL2541 | Stepper output, direct | iTcMc_DriveKL2541
KL2542 | DC motor, direct | iTcMc_DriveKL2542
KL4031 | -10V .. 10V | iTcMc_DriveKL4032
KL4032 | -10V .. 10V | iTcMc_DriveKL4032
KL4034 | -10V .. 10V | iTcMc_DriveKL4032
M2400 | -10V .. 10V | iTcMc_DriveM2400_D1, iTcMc_DriveM2400_D2, iTcMc_DriveM2400_D3, iTcMc_DriveM2400_D4

If one of the components mentioned here is used, then one of the drive blocks provided will usually be used. These blocks are located in the library's PLCopen_motioncontrol/System/Internals sub-directory, and have technical names. It is strongly recommended to specify the type of drive according to the constants in E_TcMcDriveType, to set it under nDrive_Type in ST_TcHydAxParam and to use a block of type MC_AxRtDrive_BkPlcMc. This then automatically calls the correct type of sub-block for the type concerned. Directly calling this hardware-specific block brings only a small benefit in runtime, but makes a software modification essential when I/O components are changed.

Note: If only the usual blocks (encoder, generator, finish, drive) for the axis are going to be called, then a block of type MC_AxStandardBody_BkPlcMc should be used for the sake of simplicity.

FAQ #8: What is the correct order to call the function blocks for an axis?

  1. Mandatory : All function blocks for reading the actual situation of the axis. This applies to block types like MC_AxRtEncoder_BkPlcMc, MC_AxRtReadPressureDiff_BkPlcMc or MC_AxRtReadPressureSingle_BkPlcMc.
  2. Common: Blocks or commands that are updating the enable signals of the axis. Usually this is a block of type MC_Power_BkPlcMc or on block of the types MC_AxRtSetControllerEnable_BkPlcMc, MC_AxRtSetFeedEnableMinus_BkPlcMc and MC_AxRtSetFeedEnablePlus_BkPlcMc. For axes using an incremental encoder that monitoring an index when homing a function call MC_AxRtSetReferencingCamSignal_BkPlcMc has to be added.
  3. Optional: Blocks and commands that are doing some decissions from actual values of the axis, I/O or application signals and then release some activity. One example is the start of an axis triggered by the rising edge of a sensor or the abortion of a move as a reaction of the rise of the actual pressure.
  4. Mandatory : Setpoint generators like function blocks of typ MC_AxRuntime_BkPlcMc.
  5. Optional: According to the requirements of the application there can be some control function blocks. These function blocks may be application specific or from the library like MC_AxCtrlSlowDownOnPressure_BkPlcMc or others.
  6. Mandatory : A converting function block of typ MC_AxRtFinish_BkPlcMc.
  7. Mandatory : An output function block of type MC_AxRtDrive_BkPlcMc.

If required by the application the library function blocks can be replaced by application specific blocks. This can become necessary to interface a nonstandard sensor or actor or to cover the need for a special control functionality. A decicion like this has to be done conservative minded und the compatibility to the library has to be observed.

FAQ #9: How do I control the power stage (on board or external) of a valve?

In the ST_TcPlcDeviceOutput structure the elements bPowerOn and bEnable are provided for controlling the power supply and the enabling of a power stage. Both signals are set to TRUE by blocks of type MC_Power_BkPlcMc, when the input Enable is TRUE. At the same time this block will set the software enables in ST_TcHydAxRtData.nDeCtrlDWord. If this direct relationship is not matching the application it can be released by omitting the MC_Power_BkPlcMc block. In this case the signals in the ST_TcPlcDeviceInput structure have to be controlled directly by the application. The software enables have to be defined by MC_AxRtSetControllerEnable_BkPlcMc, MC_AxRtSetFeedEnableMinus_BkPlcMc and MC_AxRtSetFeedEnablePlus_BkPlcMc.

In the ST_TcPlcDeviceInput structure the elements bPowerOk, bEnAck and bReady are provided for monitoring the power supply, the enable loop back and the status of the power stage. The signals supplied by different hardware products of different makers are varying. At this time only the bPowerOk signal is used for defining the Status output of the MC_Power_BkPlcMc block. In case even this signal cannot be read from the machine ST_TcHydAxParam.bDrive_DefaultPowerOk should be set to TRUE.

FAQ #10: How do I create a message logger functionality?

A direct message output from a library block would be causing unpredictable run time behaviour. To avoid this the massages are stored in a buffer und forwarded to the Windows event logger sequentially if needed.

To create a message buffer instantiate a variable of type ST_TcPlcMcLogBuffer. This buffer is taking the messages of all axes. It is important that independend of the number of axes there is only one such variable in a project. The address of this same buffer is supplied to the MC_AxUtiStandardInit_BkPlcMc blocks of all axes allong with the individuell axis components. These blocks are usualoly called in the initialisating phase of the project. In the Axis_Ref_BkPlcMc structure the pointer is held in the pStAxLogBuffer element and safeguarded by the block.

In nLogLevel in Axis_Ref_BkPlcMc it is defined from wich level of importance a message is entered to the buffer. The coded values to be used here are defined in the Global Variables of the library. It has to be kept in mind that this setting is per axis.

The blocks of the library are detecting the before mentioned preparations and will start the generation of messages automatically. At this point the buffer would be filled and then any further messages would be lost. To prevent this ther are two solutions.

FAQ #10.1: Forwarding messages to the Windows event logger

To forward messages from the buffer to the Windows event logger a block of type MC_AxRtLoggerSpool_BkPlcMc has to be called cyclically. Each call will forward one message and remove it from the buffer.

Hint: Even on computers running under Windows CE an event logger functionallity can be created. Here the service can be emulated by the TwinCAT System Service. To keep the small message storing capacity of the typically used flash disc devices from overrunning be sure to log errors only.

FAQ #10.2: Clearing the oldest message

To clear and remove the oldest message a block of type MC_AxRtLoggerDespool_BkPlcMc can be called cyclically. On each call this block removes the oldest message as long there is less than a specified number of spare free messages. The removed messages are lost.

FAQ #10.3: Creating logger messages from the application

The application can launch messages in either an axis related or axis independend style. For these purposes the block types MC_AxRtLogAxisEntry_BkPlcMc and MC_AxRtLogEntry_BkPlcMc are supplied.

FAQ #11: How do I abort the monitoring of a function?

Some blocks from the library are starting a process that does not need a cyclic call of the block after a successfull start. According to the rules of PLCopen definitions the block is still to be called because it is monitoring the progress of the activity to update the status signals at the output part of the block. This monitoring function is signaled at the output Busy.

Stopping the cyclic call of a block while it is monitoring the activitie it startet usually will cause trouble. The block may be unable to detect the edges on its triggering inputs properly or may report the abortion of a command because it still tries to monitor the last command it has been starting.

To abort the monitoring of a command take the following steps:

  • Call the command block with all parameters it needs. The triggering signal has to be TRUE now to create a rising edge.
  • Check the outputs of the command block to be sure the block accepted the command and is monitoring the activity.
    • In case of an error:
      • Call the command block with a FALSE at the triggering input.
      • Do what ever is needed to come up with the situation.
    • In case of a successfull start:
      • Call a block of type MC_AxUtiCancelMonitoring_BkPlcMc with Execute:=TRUE.
      • Call the block with Execute:=FALSE.
      • First call of the command block with FALSE at the triggering input. Now the block is signaling CommandAborted.
      • Second call of the command block with FALSE at the triggering input. Now the block is in its idle state and all outputs are cleared.

The described sequence will mimic the take over of control by some other function and will bring the signal exchange with the block to its final state.

By now the abortion of monitoring is supported by blocks of type MC_MoveAbsolute_BkPlcMc and MC_MoveVelocity_BkPlcMc only.

FAQ #12: How do I monitor the communication to an I/O device?

In ST_TcPlcDeviceInput variables an element named uiBoxState is allocated. If the applied bus coupler or the interface card of the servo amplifier supplies a matching variable and the fieldbus in use is signaling an untroubled communication by the value 0 a connection should be established. This can be done for the Beckhoff Lightbus and for Realtime Ethernet and EtherCAT.

If a MC_Power_BkPlcMc block is used for the axis it will monitor uiBoxState and report communication problems. In this case the axis will be placed in an error state.

FAQ #13: How do I apply customer specific names to auxiliary axis parameters?

The Axis_Ref_BkPlcMc structure supports an element named pAuxLabels that can hold a pointer to an array of string that can be used by the PlcMcManager. These strings can be loaded from a file at plc start by the MC_AxUtiStandardInit_BkPlcMc block. This is enabled by supplying the address of a ST_TcMcAuxDataLabels variable to the block and the presence of a file in the file path used for the axis.

The strings can be set by the application by direct assignment as well. In this case no file is needed.

Note: A range of controller blocks may define strings automatically.

FAQ #14: How do I control a flow valve?

In contrast to 4/2 or 3/2 proportional directional valves or servo valves a flow valve is controlled by using a 0..10V signal (if there is a power stage) or energized by a 0...INenn current. This type of control is transporting only the absolute velocity. The direction is not communicated by a sign but by some added digital signals for defining the state of switched valves. In the ST_TcPlcDeviceOutput structure you find the elements bBrakeOff, bMovePos and bMoveNeg. To create an absolute output information for the valve set bDrive_AbsoluteOutput to TRUE.

Note: This modification enables the use of standard frequency inverters in combination with an asynchronous motor, encoder and brake if the inverter features an analog input.

FAQ #15: What set of variables from the axis are advised to be part of a scope view?

The list below mentions signals that are usually recommended:

  • Allways: Axis actual position: Axis_Ref_BkPlcMc.ST_TcHydAxRtData.fActPos: reporting in units defined by the encoder scaling.
  • Only for gear or gantry coupling or camming: Axis position setpoint: Axis_Ref_BkPlcMc.ST_TcHydAxRtData.fSetPos: reporting in units defined by the encoder scaling.
  • Especially during setup: Axis actual velocity: Axis_Ref_BkPlcMc.ST_TcHydAxRtData.fActVelo: reporting in units defined by the encoder scaling per second.
  • Especially during setup: Remaining travel: Axis_Ref_BkPlcMc.ST_TcHydAxRtData.fDistanceToTarget: reporting in units defined by the encoder scaling.
  • Only if pressure/force readback is used: a range of pressure and force actual values: In Axis_Ref_BkPlcMc.ST_TcHydAxRtData: as needed fActPressure fActPressureA fActPressureB fActForce fValvePressure fSupplyPressure: units are defined by the blocks used for value determination.
  • Especially during setup: Axis demanded velocity: Axis_Ref_BkPlcMc.ST_TcHydAxRtData.fSetSpeed: normalised value in the range of ±1.0 or Axis_Ref_BkPlcMc.ST_TcHydAxRtData.fSetVelo in units defined by the encoder scaling per second.
  • Especially during setup: Control loop output: Axis_Ref_BkPlcMc.ST_TcHydAxRtData.fLagCtrlOutput: normalised value in the range of ±1.0

Note: The setup of a signal collection in the ScopeView is simplified by choosing names for the Axis_Ref_BkPlcMc variables that start by aaa_. This strategy is used in the sample programms and makes it easy to locate the signals in the symbol list.

Note: The ScopeView supports wide signal collections. Channels that are temporarily not important can be deaktivated without removing them.

FAQ #16: What is the meaning of nDebugTag in Axis_Ref_BkPlcMc?

Allmost all blocks of the library do place a unique code in this variable during there execution. Meanwhile they keep the value they find on entry and restore it at exit.

If there is any malfunction of the programm and it may have been caused by or in a library block the nDebugTag variables of all axes have to be exermined. A value different from 0 tells us that the block marked here has been hit by the problem. In this case it is important to find the content of ST_TcHydAxRtData.sTopBlockName. Here the name of the top most called block can be found.

FAQ #17: What are the special rules for using a Sercos drive unit?

To make use of Sercos drive units (starting with V3.0.26) the rules below have to be taken into account:

  • The Sercos master device (e.g. FC7501 etc.) have to be given the textual name "SercosMaster" by using the System Manager. Otherwise the library will be disabled to control the Sercos phase or perform any parameter or diagnostiics communication.
  • There cannot be more than one Sercos line controlled by the library.
  • The devices on the Sercos line have to be given the same textual name that is supplied to the MC_AxUtiStandardInit_BkPlcMc() block of the corresponding axis. Otherwise the library will be disabled to control the Sercos phase or perform any parameter or diagnostiics communication.
  • The input variable SystemState supplied by the Sercos master device has to be mapped to each drive unit of the Sercos line.
  • A reset of any one drive unit on the Sercos line may cause a line interruption. The master device will undergo a sequence of phase changes here. Usually this sequence will end in phase 4 automatically. The result from this procedure will be:
    • the axis that is applied the reset operation will be operational as long as there is no problem left.
    • all other axes on the Sercos line will be placed in a secondary error state (fieldbus failure, axis not ready). After the triggering reset of the first axis is processed the other axis can be brought up to an operatable state by a reset. Usually this reset will not cause another Sercos phase change.

    The behaviour described above is caused by basic Sercos principles and cannot be affected or prevented by the library. It has to be taken into account by the application.

  • Depending on some drive unit parameter settings axis parameters may be determined automacically or have to be entered manually:
    • S-0-0076, Bits 0 up to 2 define the weighting method for position informations. Supported are:
      • 0 0 1 translatory weighting:

        S-0-0123 definines the rotatoric resolution (encoder interpolation). This number is combined with the weighting (S-0-0077, S-0-0078) to calculate the feedrate per turn.

      • 0 1 0 rotatory weighting:

        S-0-0079 definines the rotatoric resolution (encoder interpolation). The feedrate per turn has to be entered manually.

    • S-0-0044, Bits 0 up to 2 define the weighting method for velocity informations: Supported are:
      • 0 0 1 translatory weighting:

        The velocity setpoint is converted into a rotational speed by means of the feedrate per turn and the rotatoric resolution (encoder interpolation) in units of encoder increments per time. This information is again converted by using the velocity resolution (S-0-0045, S-0-0046) to find the output value.

      • 0 1 0 rotatory weighting:

        The velocity setpoint is converted into a rotational speed by means of the feedrate per turn to find the output value.

    • S-0-0091 is converted by the method for velocity informations described above and is used to set the reference velocity axis parameter. If the maximum velocity parameter of the axis exceeds this value it will be limited accordingly.

FAQ #18: How do I determine a pressure or force actual value?

Actual pressures or forces are determined by calling one or more blocks of types like MC_AxRtReadPressureDiff_BkPlcMc, MC_AxRtReadForceDiff_BkPlcMc, MC_AxRtReadForceSingle_BkPlcMc or MC_AxRtReadPressureSingle_BkPlcMc. Details about the calling sequence can be found at FAQ #8.

The ADC values that are supplied to the blocks have to be linked to allocated variables of the application. Details about selecting and setup can be found in the documentation of the blocks.

FAQ #19: What are the special rules for using a AX5000 drive unit?

During the start of the communication with an AX5000 unit a set of IDNs are read from the device to calculate several parameters.

IDN | used for parameter
44 | Reference velo., internal: scaling factor for the velocity output
45 | internal: scaling factor for the velocity output
46 | internal: scaling factor for the velocity output
76 | Encoder interpolation
79 | Encoder interpolation
91 | Reference velo.

The parameters listed below are set automatically and cannot be changed by using the PlcMcManager:

Parameter |  | may cause sideefects for
Global: Reference velo. | is calculated from the turn rate limit of the unit and the feed per turn | Manual speeds, Max. appl. speed
Encoder: Inc.Interpolation | is read from IDN79 of the unit | Attention: the feed per turn has to be entered as Encoder Weighting factor

FAQ #21: How can I access a register of a KL terminal that is used to connect an encoder or a valve?

For the register communication with a KL terminal that is used to connect the encoder or valve of an axis the use of MC_AxUtiReadRegDriveTerm_BkPlcMc(), MC_AxUtiReadRegEncTerm_BkPlcMc(), MC_AxUtiWriteRegDriveTerm_BkPlcMc() and MC_AxUtiWriteRegEncTerm_BkPlcMc() is recommended.

FAQ #22: What is the ASCII file format of a linearisation table?

The format of the ASCII file of a linearisation table is as described bellow:

  • One linearisation point per line.
  • Each line starts with a velocity, followed by an output value.
  • All velocities are normalised by using the reference velocity, i.e. they are in the range of -1.000 to 1.000 incl.
  • All output values are normalised by using the full level, i.e. they have to span the -1.000 to 1.000 completely.
  • The line may start with white space characters (blanls, tabs).
  • The values in the line have to be separated by at least one white space character (blanls, tabs).
  • The values in the line may be separated by more than one white space character (blanls, tabs).
  • The decimal mark may be a dot or a comma.
  • There must not be any none digits between a sign and the first digit.
  • The first line is defining the negative end of the table.
  • The velocity value of each line has to be higher (i.e. less negative or more positive) than its predecessor.
  • It is recommended that the output value of each line is higher (i.e. less negative or more positive) than its predecessor. Otherwise there will be a negative local ramping rate. This will effectively invert the amplification factor of a control loop and may case instability.
  • The zero point (i.e. both values of the point are 0.000) has to be contained in the table.

Hint: The following (idealised) table describes an asymetrical cylinder (because of a single side rod) that will travel only half speed in negative direction. It is assumed that there is a zero cut valve with a bendpoint at 40% used here.

normalised velocity | normalised output
-0,500 | -1,000
-0,430 | -0.900
-0,360 | -0,800
-0,290 | -0,700
-0,220 | -0,600
-0,150 | -0,500
-0,080 | -0,400
-0,060 | -0,300
-0,040 | -0,200
-0,020 | -0,100
0,000 | 0,000
0,040 | 0,100
0,080 | 0,200
0,120 | 0,300
0,160 | 0,400
0,300 | 0,500
0,440 | 0,600
0,580 | 0,700
0,720 | 0,800
0,860 | 0,900
1,000 | 1,000

FAQ #23: How do I reject commands sended by the PlcMcManager?

Commands sended by the PlcMcManager may cause problems or even damage when they show up during a sensitive action or situation. The MC_AxRtCommandsLocked_BkPlcMc function can be used here to make the axis reject potentionally dangerous commands sended by the PlcMcManager and respond by sending a write protect error code.

Attention: It is urgently recommended to disable the pretective function when the sensitive action is ending. This is even more important in any kind of fault situations.

Note: An example is available.


TcPlcHydraulics: Knowledge Base: Sample Programms

Knowledge Base of the TcHydlib PLC library: Sample Programms (starting with V3.0)

Attention : On opening the PLC project there may be showing up a message box, reporting that there some libraries missing. The box is providing means to adjust the access path to the libraries. Only if the libraries are present on the computer in use this support should be accepted. Otherwise reject the offer and use the project for study. In this case compiling and running the project will not work.

Hint: If the library is present on the computer in use there is the chance to save the samples as a ZIP file and unpack them. The contained PRO file can be opened by using PlcControl. Usually the path to the library has to be adjusted. In the main program you will find the call of a MC_AxUtiStandardInit_BkPlcMc block. Please adapt the axis name and file path to your needs. The files of extension DAT have to be placed as devised this way. There is a scope setup provided as SCP file that will sample the most importand information.

PLC project | Project (ZIP) | Description
TcPlcMcEx_1.pro | TcPlcMcEx_1.zip | Demonstration of the blocks MC_AxUtiStandardInit_BkPlcMc, MC_Power_BkPlcMc, MC_AxStandardBody_BkPlcMc and MC_AxAdsCommServer_BkPlcMc. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_2.pro | TcPlcMcEx_2.zip | Demonstration of arrays in projects containing multiples of axes. Five axes. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_3.pro | TcPlcMcEx_3.zip | Demonstration of the blocks MC_AxRtEncoder_BkPlcMc, MC_AxRuntime_BkPlcMc, MC_AxCtrlSlowDownOnPressure_BkPlcMc (automatic changeover pressure controller), MC_AxRtFinish_BkPlcMc and MC_AxRtDrive_BkPlcMc. Demonstration of the utilisation of fCustomerData for project parameters. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_5.pro | TcPlcMcEx_5.zip | Demonstration of the blocks MC_MoveAbsolute_BkPlcMc, MC_MoveVelocity_BkPlcMc, MC_MoveRelative_BkPlcMc and MC_Stop_BkPlcMc. The working cycle is triggered by setting the global variable bStart by using PlcControl. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_6.pro | TcPlcMcEx_6.zip | Demonstration of the block MC_AxRunTimeTimeRamp_BkPlcMc. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_7.pro | TcPlcMcEx_7.zip | Demonstration of the blocks MC_SetOverride_BkPlcMc. The signal form, cycle time and the limits of a signal generator are controlled by global variables (bOverrideSinusoidal, fOverrideCycleTime, fOverrideMinValue, fOverrideMaxValue) to define a variable override. The override value is generated by using MC_FunctionGeneratorFD_BkPlcMc, MC_FunctionGeneratorSetFrq_BkPlcMc and MC_FunctionGeneratorTB_BkPlcMc blocks. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_9.pro | TcPlcMcEx_9.zip | Demonstration of the blocks MC_SetOverride_BkPlcMc. The response to jumps etc. is demonstrated. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_10.pro | TcPlcMcEx_10.zip | Demonstration of the blocks MC_AxUtiAutoIdent_BkPlcMc, MC_AxRtFinishLinear_BkPlcMc, MC_LinTableExportToAsciFile_BkPlcMc, MC_LinTableImportFromAsciFile_BkPlcMc, MC_LinTableExportToBinFile_BkPlcMc and MC_LinTableImportFromBinFile_BkPlcMc. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_11.pro | TcPlcMcEx_11.zip | Demonstration of the blocks MC_Stop_BkPlcMc, MC_EmergencyStop_BkPlcMc and MC_ImediateStop_BkPlcMc. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_12.pro | TcPlcMcEx_12.zip | Demonstration of the PLCopen Command Buffering. Blocks MC_MoveAbsolute_BkPlcMc, MC_MoveRelative_BkPlcMc, MC_Stop_BkPlcMc and MC_AxRtCmdBufferExecute_BkPlcMc. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_13.pro | TcPlcMcEx_13.zip | Demonstration of various filter blocks from the library. No axis. Operated by use of PlcControl.
TcPlcMcEx_14.pro | TcPlcMcEx_14.zip | Demonstration of the blocks MC_FunctionGeneratorTB_BkPlcMc and MC_FunctionGeneratorFD_BkPlcMc. No axes. Operated by use of PlcControl.
TcPlcMcEx_15.pro | TcPlcMcEx_15.zip | Demonstration of the block MC_AxCtrlPressure_BkPlcMc. One axis. Operated by use of PlcControl.
TcPlcMcEx_16.pro | TcPlcMcEx_16.zip | Demonstration of the blocks MC_AxUtiStandardInit_BkPlcMc, MC_Power_BkPlcMc, MC_AxStandardBody_BkPlcMc and MC_AxAdsPtrArrCommServer_BkPlcMc. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_18.pro | TcPlcMcEx_18.zip | Demonstration of the MC_AxRtCommandsLocked_BkPlcMc.htm. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_100.pro | TcPlcMcEx_100.zip | Demonstration of the blocks MC_GearIn_BkPlcMc and MC_GearOut_BkPlcMc. Five axes. Axis 5 is a virtuel axis (center point of axis 1 and 2), axes 1 and 2 are coupled and decoupled by gearing functions. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_101.pro | TcPlcMcEx_101.zip | Demonstration of the blocks MC_CamTableSelect_BkPlcMc, MC_CamIn_BkPlcMc, MC_CamOut_BkPlcMc, MC_AxTableFromAsciFile_BkPlcMc and MC_AxTableToAsciFile_BkPlcMc. Five axes. Axis 5 is a virtuel axis (center point of axis 1 and 2), axes 1 and 2 are coupled and decoupled by camming tables. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_103.pro | TcPlcMcEx_103.zip | Demonstration of the blocks MC_GearInPos_BkPlcMc and MC_GearOut_BkPlcMc. One axis. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_104.pro | TcPlcMcEx_104.zip | Demonstration of a two axis gantry following the virtual master concept. Three axes. Operated by use of PlcControl and PlcMcManager.
TcPlcMcEx_105.pro | TcPlcMcEx_105.zip | Demonstration of the velocity transfer characteristic identification for a two axis gantry, applying MC_AxUtiAutoIdent_BkPlcMc and MC_AxUtiAutoIdentSlave_BkPlcMc blocks. Three axes. Operated by use of PlcControl and PlcMcManager.


TcPlcHydraulics: Knowledge Base: Setup

Knowledge Base of the TcHydlib PLC library: Axis setup (starting with V3.0)

The axis setup below describes a process that can be applied to most axes that are handled by the library. Some axes are equipped with valves with a non-standard behaviour. In this cases the procedure below may cause unexpected behaviour and is not recommended.

This document is organised in three sections:

  • Basic rules and recommendation
  • Default settings to be applied before activating the hydraulic power
  • Finding reference and control loop parameters

Especially for the 'Default settings' it is requirred to have detailed knowledge about the valve, the cylinder and the hydraulic arrangement. It is strongly recommended to have data sheets and documentations for any used active component and a hydralic diagramm available.

Basics

There is a range of rules and recommendations that should be follwed during the setup process.

Default setup (under construction)

A number of settings have to be done before the actual commissioning can start. The axis has to be assembled from I/O hardware, fieldbus interfaces, variables in process data arreas, function blocks etc. by defining mapping connections and working modes. Some parameter values can be found in data sheets of the devices in use.

Encoder and pressure transducers (under construction)

The read back of positions, pressures and forces is handelt here.

Drive (under construction)

The output of some function blocks is adapted to the actors in use.

Positioning (under construction)

The generation of control values for moving the axes is described here.

Loop control and monitoring

In idle state or during active axis travel control and monitoring blocks my become active.


TcPlcHydraulics: PLCopen Motion Control: Data types: E_TcPlcBufferedCmdType_BkPlcMc

PLC libraries: TcPlcHydraulics

TYPE E_TcPlcBufferedCmdType_BkPlcMc

This enumeration supplies codes for identifying buffered axis commands. See also MC_BufferMode_BkPlcMc.

TYPE E_TcPlcBufferedCmdType_BkPlcMc : (
(* last modification: xx.xx.2009 *)
iBufferedCmd_NoOperation,
iBufferedCmd_MoveAbsolute,
iBufferedCmd_MoveRelative,
iBufferedCmd_MoveVelocity,
(**)
iBufferedCmd_Stop,
iBufferedCmd_ResetAndStop,
iBufferedCmd_Halt,
iBufferedCmd_CamIn,
iBufferedCmd_GearIn,
iBufferedCmd_Power,
iBufferedCmd_Home,
iBufferedCmd_StepAbsSwitch,
iBufferedCmd_StepLimitSwitch,
iBufferedCmd_StepBlock,
iBufferedCmd_StepDirect,
iBufferedCmd_FinishHoming,
(**)
iBufferedCmdEx_Jerk:=100,
iBufferedCmdEx_Acc,
iBufferedCmdEx_Velo,
iBufferedCmdEx_Creep,
(**)
iBufferedCmd_
);
END_TYPE

iBufferedCmd_NoOperation: reserved.

iBufferedCmd_MoveAbsolute: reserved.

iBufferedCmd_MoveRelative: reserved.

iBufferedCmd_MoveVelocity: reserved.

iBufferedCmd_Stop: reserved.

iBufferedCmd_ResetAndStop: reserved.

iBufferedCmd_Halt: reserved.

iBufferedCmd_CamIn: reserved.

iBufferedCmd_GearIn: reserved.

iBufferedCmd_Power: reserved.

iBufferedCmd_Home: reserved.

iBufferedCmd_StepAbsSwitch: reserved.

iBufferedCmd_StepLimitSwitch: reserved.

iBufferedCmd_StepBlock: reserved.

iBufferedCmd_StepDirect: reserved.

iBufferedCmd_FinishHoming: reserved.

iBufferedCmdEx_Jerk: reserved.

iBufferedCmdEx_Acc: reserved.

iBufferedCmdEx_Velo: reserved.

iBufferedCmdEx_Creep: reserved.


TcPlcHydraulics: PLCopen Motion Control: Parameter: MC_AxAdsPtrArrCommServer_BkPlcMc

SPS Bibliotheken: TcPlcHydraulics

FUNCTION_BLOCK MC_AxAdsPtrArrCommServer_BkPlcMc

The function block gives the application the functionality of an ADS server. It calls blocks of the MC_AxAdsReadDecoder_BkPlcMc and MC_AxAdsWriteDecoder_BkPlcMc types as required. The ADS codes are listed in the Knowledge Base.

Attention: For most applicationen the use of a MC_AxAdsCommServer_BkPlcMc is sufficient and strongly recommended.

VAR_INPUT
    nFirstAxisIndex:	INT;
    nLastAxisIndex:	INT;
END_VAR
VAR_INOUT
    pAxItfArr: POINTER TO DWORD;
END_VAR

nFirstAxisIndex, nLastAxisIndex: The dimensioning of the Axis_Ref_BkPlcMc array must be given here.

Warning: Incorrect data provided at this location excludes some of the axes from communication, or can result in the PLC application crashing as a result of serious runtime errors (Page Fault Exception).

pAxItfArr: The address of a variable of type ARRAY [ncnstFirstAxId..ncnstLastAxId] OF POINTER TO Axis_Ref_BkPlcMc must be given here.

Warning: Incorrect data provided at this will result in the PLC application crashing as a result of serious runtime errors (Page Fault Exception).

Behaviour of the block:

If the PLC application calls this block cyclically, it acquires the character of an ADS server, answering ADS read and ADS write accesses like any other ADS server. This includes the decoding of IdxGroup/IdxOffset addressing. Blocks of the MC_AxAdsReadDecoder and MC_AxAdsWriteDecoder types are called for this purpose as required.

Note: This block must not be used if the PLC application already is an ADS server. In that case, the blocks of the MC_AxAdsReadDecoder and MC_AxAdsWriteDecoder types have to be called from the ADS server blocks already included in the application.

Note: There is a sample program #16 available.


TcPlcHydraulics: PLCopen Motion Control: System: MC_AxRtSetDirectOutput_BkPlcMc

PLC libraries: TcPlcHydraulics

FUNCTION_BLOCK MC_AxRtSetDirectOutput_BkPlcMc (ab V3.0)

The block will write a direct setpoint to the output structure of the axis.

VAR_INPUT
    Enable:		BOOL;
    OutValue:	LREAL;
    RampTime:	LREAL;
END_VAR
VAR_OUPUT
    Busy:		BOOL;
    CommandAborted:	BOOL;
    Error:		BOOL;
    ErrorID:		UDINT;
END_VAR
VAR_INOUT
    Axis:		Axis_Ref_BkPlcMc;
END_VAR

Enable: A TRUE here will activate the function.

OutValue: The commanded setpoint has to be supplied here.

RampTime: A time that will be used to ramp the setpoint to a full level.

Busy: This signal reports the active execution of a command.

CommandAborted: The abortion of a command will be signaled here.

Error: The occurrence of an error is indicated here.

ErrorID : An encoded indication of the cause of the error is provided here.

Axis : The address of a variable of type Axis_Ref_BkPlcMc is to be passed here.

Behaviour of the block:

A rising edge at Enable will activate the function. The axis is placed in the states of McState_Continousmotion and iTcHydStateExtGenerated and Busy will become TRUE. The setpoint of the axis is updated with OutValue in accordance to RampTime.

A FALSE at Enable will cause the output to ramp down to 0.0 using RampTime and end the function. At this point Busy will become FALSE.

If any other block will take over control on the axis while the MC_AxRtSetDirectOutput_BkPlcMc block is active the block will abort its activity and will signal CommandAborted.


TcPlcHydraulics: PLCopen Motion Control: System: Utilitys: Filters: MC_AxUtiPT1_BkPlcMc

PLC libraries: TcPlcHydraulics

FUNCTION_BLOCK MC_AxUtiPT1_BkPlcMc (starting with V3.0)

The block calculates a low pass filter of first order.

VAR_INPUT
    fInput:		LREAL:=0.0;
    fCycletime:	LREAL:=0.001;
    fT0:		LREAL:=1.0;
END_VAR
VAR_OUTPUT
    fOutput:		LREAL;
    bError:		BOOL;
    nErrorId:	UDINT;
END_VAR

fInput: the raw value that has to be filtered.

fCycletime: The cycle time of the calling PLC task.

fT0: The filter time constant.

fOutput: The filtered value.

bError: The occurrence of an error is indicated here.

nErrorId: An encoded indication of the cause of the error is provided here.

Behaviour of the block:

The block allways checks the supplied parameters. If there is any the block will respond with bError and a coded indication in nErrorId. Otherwise the block will update the internal variables and fOutput by using fInput.


TcPlcHydraulics: PLCopen Motion Control: System: Utilitys: Filters: MC_AxUtiPT2_BkPlcMc

PLC libraries: TcPlcHydraulics

FUNCTION_BLOCK MC_AxUtiPT2_BkPlcMc (starting with V3.0)

The block calculates a low pass filter of second order.

VAR_INPUT
    fInput:		LREAL:=0.0;
    fCycletime:	LREAL:=0.001;
    fTheta:		LREAL:=1.0;
    fT0:		LREAL:=1.0;
END_VAR
VAR_OUTPUT
    fOutput:		LREAL;
    bError:		BOOL;
    nErrorId:	UDINT;
END_VAR

fInput: the raw value that has to be filtered.

fCycletime: The cycle time of the calling PLC task.

fTheta: The damping constant.

fT0: The filter time constant.

fOutput: The filtered value.

bError: The occurrence of an error is indicated here.

nErrorId: An encoded indication of the cause of the error is provided here.

Behaviour of the block:

The block allways checks the supplied parameters. If there is any the block will respond with bError and a coded indication in nErrorId. Otherwise the block will update the internal variables and fOutput by using fInput.


TcPlcHydraulics: PLCopen Motion Control: Data types: MC_BufferMode_BkPlcMc

PLC libraries: TcPlcHydraulics

TYPE MC_BufferMode_BkPlcMc (ab V3.0)

This enumeration supplies codes for controlling the blending methods of concatenated move commands.

TYPE MC_BufferMode_BkPlcMc :
(
Aborting_BkPlcMc := 0,
Buffered_BkPlcMc,
BlendingLow_BkPlcMc,
BlendingPrevious_BkPlcMc,
BlendingNext_BkPlcMc,
BlendingHigh_BkPlcMc
);
END_TYPE

Aborting_BkPlcMc: The default case: A new command will become active without any delay or precondition and will abort a currently active command. The block that is monitoring the aborted command will signal CommandAborted.

Buffered_BkPlcMc: reserved.

BlendingPrevious_BkPlcMc: reserved.

BlendingNext_BkPlcMc: reserved.

BlendingHigh_BkPlcMc: reserved.


TcPlcHydraulics: PLCopen Motion Control: Motion: MC_GearInPos_BkPlcMc

PLC libraries: TcPlcLibHydraulics

FUNCTION_BLOCK MC_GearInPos_BkPlcMc (starting with V3.0.33)

This function block starts and monitors the coupling of two axes on the fly. To release the coupling use a MC_GearOut_BkPlcMc block.

VAR_INPUT
    Execute:			BOOL;
    RatioNumerator:		INT;
    RatioDenominator:		INT;
    MasterSyncPosition:	LREAL;
    SlaveSyncPosition:	LREAL;
    SyncMode:		INT;
    MasterStartDistance:	LREAL;
    Acceleration:		LREAL;
    Deceleration:		LREAL;
    Jerk:			LREAL;	(ab V3.0.5)
    BufferMode:		MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;
END_VAR
VAR_OUTPUT
    StartSync:	BOOL;
    InSync:		BOOL;
    Busy:		BOOL;
    Active:		BOOL;
    CommandAborted:	BOOL;
    Error:		BOOL;
    ErrorID:		UDINT;
END_VAR
VAR_INOUT
    Master:		Axis_Ref_BkPlcMc;
    Slave:		Axis_Ref_BkPlcMc;
END_VAR

Execute: The coupling is initiated by a rising edge at this input.

RatioNumerator, RatioDenominator: These parameters describe the coupling in the form of a gear box.

MasterSyncPosition: From this master position on the coupling will be in full effect.

SlaveSyncPosition: From this slave position on the coupling will be in full effect.

SyncMode: not supported.

MasterStartDistance: The coupling will be activated within this distance.

Acceleration : The required acceleration of the movement in the actual position units used by the axis per second squared.

Deceleration : The required deceleration of the movement in the actual position units used by the axis per second squared.

Jerk: The requested jerk level.

BufferMode: reserved. This input was added in preparation of future extensions. It has to be left open or supplied the constant value Aborting_BkPlcMc.

StartSync: reserved.

InSync: The full activation of the coupling is signaled here.

Busy: A pending command is indicated here.

Active: Same as Busy.

CommandAborted : Abortion of the movement is indicated here.

Error: The occurrence of an error is indicated here.

ErrorID: An encoded indication of the cause of the error is provided here.

Master, Slave: The addresses of variables of type Axis_Ref_BkPlcMc are to be passed here.

Behaviour of the block:

The block is activated by a rising edge at Execute, and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process:

  • The possibility that RatioDenominator is set to 0 is checked next. In this case the block will react by asserting Error with ErrorID:=dwTcHydErrCdIllegalGearFactor.
  • If RatioDenominator is set to <0 it responds with Error and ErrorID:=dwTcHydErrCdNotSupport.
  • By now the coupling cannot be activated if the slave is not in idle state. If this is not true the block responds with Error and ErrorID:=dwTcHydErrCdNotStartable.
  • For insufficient absolute values of MasterStartDistance it will respond with Error and ErrorID:=dwTcHydErrCdCannotSynchronize.
  • If the actual position of the master axis is already inbetween MasterSyncPosition and the end of the synchronisation distance defined by MasterStartDistance it will respond with Error and ErrorID:=dwTcHydErrCdCannotSynchronize.

The coupling is initiated if these checks can be carried out without problems. In the beginning the slave axis will still be in state McState_Standstill. As soon as the master axis is passing the start point of the synchronisation distance the axis will be placed in the McState_Synchronizedmotion state and will signal StartSync and the block will monitor the active coupling. The slave axis will signal InSync when it is passing the end of the synchronisation distance. The coupling will not deactivated even if the axis is passing the start of the synchronisation distance.

If the movement algorithm reports an error code while the coupling is being executed, the block responds with Error and ErrorID:=the movement algorithm's error code.

A falling edge at Execute clears all the pending output signals. If, while the coupling is still active, Execute is set to FALSE, execution of the coupling continues unaffected. The signals provided at the end of the movement (Error, ErrorID, CommandAborted, InGear) are made available for one cycle.

Attention: The block is not supporting the same range of functionality as supported by the TwinCAT NC.

Note: At current Active is a copy of Busy.

Note: Please find an example in the Knowledge base under #103.


TcPlcHydraulics: Knowledge Base: PlcMcManager

PLC libraries: TcPlcHydraulics

Knowledge Base of the TcHydlib PLC library: The PlcMcManager

The PlcMcManager assists in the setup and testing of axes that are controlled by using the hydraulics library. It visualizes the actual situation, enables the access to parameters and handles commands.

Warning: The PlcMcManager is not intended to run machines. It does not replace an HMI.

Installation

To install a lizenz free copy of the PlcMcManager on a computer klick the link on the left. A dialog will show up offering the options to start (recommended for one time use only) or store the tool. Please enter a path of your choice. Create a short cut on the desktop on your computer. Without this short cut the PlcMcManager can be started only from the Explorers view.

Running the PlcMcManager

If the tool has to be startet once execute it by using the link in the chapter before. In case it has been stored on the computer it can be started by a double klick in the Explorer view or by using the short cut on the desktop.

Examining a Parameter File

To examine a parameter file use Offline File Mode under Online from the menu bar. A dialog will show for selecting a file with extension DAT. After reading the file the axis parameters will be displayed allmost the same way as in the online mode.

Warning: There will be no status informations available in this mode. No commands will be handled. If the parameter file belongs to an axis that could be accesses this rule will apply.

Online

If the PlcMcManager tool is not running on the same computer that is running the PLC application controlling the axes start by selecting the target system. In the menu bar you find Online and Target. A dialog will offer a list of computers that are registered as Remote Computers on the AMS Router tab of the TwinCAT System Service.

To activate the communication with the runtime klick Loggin at Online from the menue bar. Especially for slow network connections this may take a few seconds. The informations marked below should appear.

  1. The port and server that are use to communicate with the runtime.
  2. The ONLINE mode.
  3. The version information of the library that is in use for the application.

If these informations do not show up within a few seconds the was success in establishing the connection. This usually is caused by one of the seasons below:

  • There was no target selected although the application is not sharing the computer with the PlcMcManager.
  • The application is not running of the computer that was selected as target.
  • There is no functional connection to the selected target.
  • The computer that is running the PlcMcManager has no access rights at the computer running the application.
  • The PLC hasn't been startet.

If a dialog shows up at this point that reports error messages the connection is not adequate (Timeout) or the PlcMcManager and the library used for the application are incompatible. The later may occur if the library has been updated but the PlcMcManager is an older version.

A double klick on the server on the left side will create the list of axes of the application. Klick an axes to select it and start a cyclical update of its status information and to enable the access to its parameters and functionallity.


TcHydlib: Knowledge Base: Axis setup: Basics

PLC libraries: TcPlcHydraulics

Knowledge Base of the TcHydlib PLC library: Axis setup: Basics

Security hint

The risk of causing any kind of trouble or damage is much higher during the axis setup process. This risk will strongly exceed the common risk level of normal operation. Default or odd parameter values, interupted control structures or inversion in software, hydraulical or electrical connections, sensors, actors or mechanics may cause activity of the machine at any time and in unpredictable direction or area or at unexpected acceleration or speed.

The following rules habe to be followed:

  • Be sure to reed the liability hints of this documentation.
  • Be sure all persons in the area do know about the special situation and its consequences.
  • Be sure nobody will approach or enter the machine.
  • Remove all equipment or tools that are not directly used and needed for the setup to avoid damage.
  • If there is a chance to apply mechanical blocks to keep the machine from entering hassardous areas do so.
  • Be sure no part of the machine that is not part of the current setup step may become active.
  • If there is the chance to reduce the supply pressure level without intercepting the tested function do so.
  • Be sure all persons around the machine do now that they are not allowed to do any kind of change or modification (electrical, hydraulical, mechanical) without detailed communication with the person in charge for the setup process.
  • Beyond the rules above all applicable rules about savety for persons, equipment or environment have to be obeyed.

....


TcPlcHydraulics: Knowledge Base: Setup: Loop control and Monitoring

PLC libraries: TcPlcHydraulics

Knowledge Base of the TcHydlib PLC library: Axis setup: Loop control and Monitoring

Here you find details about the standard control loop and monitoring functionallity of the library.

Default Controller of the Axis

The default controller of the axis becomes active if the axis is in idle state and the control enable is set to TRUE. The change over between active traveling the idle state is defined by the profile generator in use.

The idle state lag control loop has to be activated by setting the parameter Lag amplification on the Ctrl Tab.

Note: The response of the default controller is limited to CreepSpeed. This makes sure that the output will not jump up at the change over from creep mode to idle mode.

An analog offset in the loop can be balanced by setting the Offset compensation.

In some applications the axis has create a clamping output at the end of the traveling. The parameter value supplied here will be sent to the valve in a polarity matching the last active movement. In case the axis will not arrive the target there will be no clamping output.

Note: A reset operation will clear the output.

For axes that cannot be stabilised in the idle state by a closed loop it may be applicable to reposition the axis if it is shiftet out of the target. In case this has to be done automatically and without any activity from the application Repos. distance has to be set to the triggering threshold.

Attention: This functionallity must not be combined with a Clamping output. Otherwise the axis will become instable when targeting.

Attention: When using this functionallity be sure to have a Repos. distance setting higher than the Brake distance setting. Otherwise the axis will become instable when targeting.

Example #1: Ctrl Tab

Monitoring

The parameters of the Monitoring Tab of the PlcMcManager are used to configure a range of monitoring functions.

Software Endswitch

The parameters Softend Min and Softend Max are limiting the travel of the axis. They can be enabled or disabled. If they are active no function block will accept a target position that is beyond the setting. Blocks with an undefined target position (e.g. MC_MoveVelocity_BkPlcMc, NC_MoveJoysticked_BkPlcMc etc.) will use a Softend in the requested direction for the target position.

Target Monitoring

These parameters are used by a range of profile generators to decide about the accuracy at the target. The axis is considered to be in the target if:

  1. the remaining travel is less or equal to the setting of Pos.range and
  2. the remaining travel has not exceeded the setting of Target Range for at least Target Filter and
  3. the profile generator is in its idle state.

PEH monitoring

The PEH monitoring is checking for situations where the axis is not reaching the requested target accuracy for at least one cycle. It will create an error situation if a block (e.g. MC_MoveAbsolute_BkPlcMc) cannot report its command to be Done in a limited time.

Lag Monitoring

The position lag is the difference between a position setpoint and an actual position. For a displacement based motion control system there is a target position, but no variable position setpoint. For this reason a lag monitoring makes sense only in a set of special cases:

  • in standstill as a position error monitoring.
  • for derived setpoint setpoint generation:
    • Gearing
    • Camming
    • external setpoint generation e.g. by MC_MoveJoysticked_BkPlcMc or the application.
  • for change over to timebased setpoint generation.

Only in these cases there is a lag displayed on the Online tab.

The monitoring starts by calculating a threshold. This is done by multiplying the velocity setpoint by Dyn-Lag Filter [s] and add Max. Lag [mm]. In case the actual lag is exceeding this limit for at least Max-Lag Filter [s] and the monitoring is enabled the axis is placed in the error state with ErrorID dwTcHydErrCdPosLag.

Example #2: Monitor Tab


TcPlcHydraulics: Knowledge Base: Setup: Basic setup

PLC libraries: TcPlcHydraulics

Knowledge Base of the TcHydlib PLC library: Axis setup: Basic setup

under construction

The MC_AxUtiStandardInit_BkPlcMc Block

For each axis an instance of the MC_AxUtiStandardInit_BkPlcMc block has to be called cyclically. This block takes care for the administration and monitoring of the pointers to the I/O interfaces and a range of other optional axis components and is used for defining the axis name and the path to the parameter file.

FUNCTION_BLOCK MC_AxUtiStandardInit_BkPlcMc
VAR_INPUT
    AxisName:		STRING(255);
    PathName:		STRING(255);
    .....
END_VAR

The path within the file system that is used to access any files associated with the axis is defined by Pathname. It is highly recomended to use constant definitions here. The example below gives an idea for a PC running under Windows XP, XPe or 2000. The backslash at the end is required and must not be skipped.

VAR_GLOBAL CONSTANT
    cnst_ParamFilePath: STRING(255):='C:\Project\Data\';
END_VAR

The pathname below has to be used for CX (or other) computers running under Windows CE.

VAR_GLOBAL CONSTANT
    cnst_ParamFilePath: STRING(255):='Hard Disk\';
END_VAR

Encoder type

The combination of an encoder and an input hardware device is reporting the actual position on an axis in discrete form. This information has to be isolated from the raw input data in to be translated into the usual form (i.e. in mm) of a location. At the same time status signals of the encoder device or the interface hardware have to be monitored and (if applicable) the data exchange over the connection has to be supervised. All these tasks are executed by the MC_AxRtEncoder_BkPlcMc block. In the documentation of this block you may find a list of the required mapping connections that have to be created by usinf the TwinCAT System Manager. Use the Common Tab of the PlcMcManager to select the type of the encoder interface and enable the MC_AxRtEncoder_BkPlcMc() block to apply the matching specialised internal function block.

Hints about setup and commissioning of the encoder can be found at Knowledge Base: Setup: Encoder.

Drive type

The connection to the drive unit is established by an interface that is assembled from a hardware (terminal, fieldbus interface) and a matching software. The library is supplying the MC_AxRtDrive_BkPlcMc block to be used here. To enable this block to run the appropriate code parts please set the drive type of the Common Tab of the PlcMcManager. Again, use the TwinCAT System Manager to establish the mapping connections.

Hints about setup and commissioning of the drive can be found at Knowledge Base: Setup: Drives.

Positioning

The positioning of an axis is controlled by a profile generator. In the library this task is taken over by the MC_AxRuntime_BkPlcMc block. The generator type to be used has to be selected on the Common Tab of the PlcMcManager.

Hints about setup and commissioning of the positioning process can be found at Knowledge Base: Setup: Positioning.

Example 1: Common Tab

Loop control and Monitoring

under construction


TcPlcHydraulics: Knowledge Base: Setup: Drives

PLC libraries: TcPlcHydraulics

Knowledge Base of the TcHydlib PLC library: Axis setup: Drives

under construction

Special case: Frequency inverter.

Reference velo.: The maximum velocity of the axis has to be supplied here.

Acceleration, Deceleration: These parameters define the absolute limit. The application parameters below will be limited to theses values.

Jog slow, fast: These parameters are used by the PlcMcManager for manual movement (i.e. F1 ... F4).

Max. appl. speed: This parameter can be used to limit the speed commanded by the application. This parameter has to be less or equal to Reference velo.

Max. appl. Acceleration, Deceleration: These parameters are used to limit or replace the calling parameters of blocks like MC_MoveAbsolute_BkPlcMc etc.

Presettings

The settings described in this part of the documentation should be understood as preliminary. They are used to move the axis in a more or less controlled way at all. In the first steps of the setup process we need to do this to find some very basic parameters (encoder, positioning).

Reference velo.:

For some drive types (AX2000B750, AX5000B110A) the Reference velo is calculated from values that are read from the unit.

A first approximation for hydraulic axes can be calculated from data sheet values of the makers of the valve and the cylinder.

Vref := 16666 * Qnom / Amin

using

Vref := Reference velo. in mm per second

Qnom := Nominal oil flow of the valve in litres per minute

Amin := the smaller working arrea of the cylinder in mm2

Acceleration, Deceleration: Use a very high value (e.g. 20000.0) here.

Jog slow, fast: Use settings here that will give head time for user interference. This should be true for values less than 100mm/s. The ratio of fast to slow velocity should like 4 or 5 to 1.

Max. appl. Acceleration, Deceleration: Use small values here in the beginning. The speedup time (Vref / Acc) is a good key number here. If it is calculated to be smaller than a second the setting is quite high. Values of more than five seconds are do signal a very soft setting. For a preset the speedup time should like one or two seconds.

Example 1: Global Tab for profile type iTcMc_ProfileCtrlBased


TcPlcHydraulics: Knowledge Base: Setup: Encoders and Pressure transducers

PLC libraries: TcPlcHydraulics

Knowledge Base of the TcHydlib PLC library: Axis setup: Encoders and Pressure transducers

The commissioning of an encoder covers the scaling, the polarity and, for absolute encoders, the zero shift. For incremental encoders additional parameters for the homing are requirred.

Counting polarity

The first step the the encoder setup is to decide about the meaning of 'positiv' or 'upwards' or 'rising' for the axis. In this decision the default counting polarity of the encoder is of no importance. Make the encoder report at least a small change of the actual position to find the relationship of the encoder polarity and the axis polarity.

  • If there is a chance to move the axis manually (without using energy from the machine) make use of this.
  • Sometimes the encoder can be moved independently from the machine. Please remember that moving the encoder body will cause a reversed effect than moving the sliding part of the encoder.
  • If there is no way to move the axis without energycing the machine use extra care: The axis has no sufficient parameters yet.
    • Be sure that no other axes or devices become activated.
    • If there is any chance to remove or uncouple parts of the axis load without uncoupling the encoder do so.
    • At least the default setup for the drive should be done. If this cannot be done yet use arbitrary values: 100.0 for Ref.Velocity and Max.Appl:Velocity, 10.0 and 25.0 for the Manual Velocity slow and fast.
    • Set the Arrea Ratio to 1.0 and clear the Band Point parameters, Response Time and all Brake Time parameters. Activate the Default Power Ok.
    • Disable all kind of controllers. The axis should be controlled only by the precontrol setpoint. Be sure there is no active AutoZero tuning. Clear the Offset compensation, Press On Target and Reposition functionality.
    • Deactivate the Lag monitoring and the software end of travel monitoring.
    • Be sure there is no person and no device in the hazardous arrea. Be sure no person can enter the hazardous arrea. Be sure that everybody around knows about the dangerous situation. And be sure there is a person around taking care for your protection.
    • Now energice the machine. The axis should not move but may be somewhat drifting.
    • Select the 'Online' Tab of the PlcMcManager. The F2 key should make the axis travel in negative direction while the F3 key should make it move positive, according to the definitions in the beginning of this chapter. The rising or falling actual position is not important here. If the axis does not move at all this may be caused by an positive overlap in the valve, documented in the data sheets of the device. This can be compensated by using F1 replacing F2 and F4 replacing F3 in this test. In case the axis is moving reversed the output polarity (PlcMcManager: Valve Tab, ´'inverted', right of 'Area ratio A/B'") has to be inverted.
    • Now the axis should respond to the F keys by moving in the right direction. If the actual position does not grow when moving positive and fall when moving negative set setting of bEnc_Reversed (PlcMcManager: Encoder Tab, ´'inverted', right of 'Weighting factor [mm/INC'") has to be changed. See Example #1.

Scaling of the Actual Position

The scaling is controlled by a pair of parameters: A distance in fEnc_IncWeighting and the matching number of increments in fEnc_IncInterpolation. See Example #2. A range of options are supplied to adapt to the design, the interface and the working principle of the encoder:

  • For some encoder types (AX2000B750, AX5000B110A) the fEnc_IncInterpolation is read from the device. Be sure to set the feed (travel, distance) per turn of the motor shaft as fEnc_IncWeighting.
  • For some encoders the resolution can be found in the data sheets of the maker and is a fix number that can be entered without loss of accuracy. This is typically for most SSI encoders. Here fEnc_IncWeighting can be set directly (e.g. 0.01mm). The fEnc_IncInterpolation is 1.0 here.
  • Some rotary encoders do count a binary number (e.g. 1024 or 8192) of increments per rotation. The increment weighting factor calculates to a small number that needs a lot of digits on the right of the decimal point to be precise. In this case fEnc_IncWeighting has to be set to the distance per shaft turn and fEnc_IncInterpolation to the matching number of incremets.
  • For analog read back systems an arbitrary distance can be used as fEnc_IncWeighting and the matching number of ADC steps has to be used as fEnc_IncInterpolation. In the beginning of the commisioning an approximation can be used here. Use the measuring length of the encoder (not the axis travel) and the full range of the interface hardware (usually 32768). As soon as the axis is under controll the setting of the encoder can be done more precise. It is a well tried procedure to travel to a lower and an upper mechanical stop to find the ADC readings. The mechanical travel is to be used as fEnc_IncWeighting and the difference of the ADC readings is to be used as fEnc_IncInterpolation.

Attention: There is an important difference between 'pulses' and 'increments'. Example: An incremental encoder giving 2048 pulses for 10mm of travel is connected to a KL5101. The terminal is using four edge detection mode by default and is counting 8192 inkrements per turn.

Zero shift

The zero point of an absolute encoder is located in an odd place that is defined by the construction of the devise and the location and the way it is fixed at the machine. A Zero Offset is added to shift the point of origin of the axis according to the applications needs. This Zero Offset can be set directly (PlcMcManager: Encoder Tab, 'Zero Offset [mm]') or more comfortably by using library functionality. For the second make the axis travel to a defined or at least known mechanical position. Then enter the should be value for the actual position like being the target position for a move command (PlcMcManager: 'Start Axis: Destination [mm]') and activate it by the 'SetPos' button. See Example #1 for details.

Note: Please remember to save the parameters after setting the actual position of an absolute encoder axis.

Homing Parameters

Range and composition of the homing parameters depend on the referencing mode. This mode is set on the Common Tab. The current setting is displayed on the left. An option list to the right enables the selection of the type to be used. The selected type is activated by the "Activate" button to the right of the option list. This will update ST_TcHydAxParam.nEnc_HomingType to the selected setting by using a value from E_TcMcHomingType.

HomingOnBlock: The axis is started according Axis_Ref_BkPlcMc.stAxParams.fEnc_RefIndexVelo and bEnc_RefIndexPositive. If there hasn't been a progress of the actual position the block is regarded to be found. Now the actual position is set to Position of the homing FB.

HomingOnIndex: The axis is started according Axis_Ref_BkPlcMc.stAxParams.fEnc_RefIndexVelo and bEnc_RefIndexPositive. If CalibrationCam or the reference cam bit (Bit 5, dwTcHydDcDwRefIndex) in Axis_Ref_BkPlcMc.stAxRtData.nDeCtrlDWord become TRUE the axis stops. Now the axis is started according fEnc_RefSyncVelo and bEnc_RefSyncPositive. When the cam signal becomes FALSE the actual position of the axis is set to Position and is stopped.

HomingOnSync: The axis is started according Axis_Ref_BkPlcMc.stAxParams.fEnc_RefIndexVelo and bEnc_RefIndexPositive. If CalibrationCam or the reference cam bit (Bit 5, dwTcHydDcDwRefIndex) in Axis_Ref_BkPlcMc.stAxRtData.nDeCtrlDWord become TRUE the axis stops. Now the axis is started according fEnc_RefSyncVelo and bEnc_RefSyncPositive. The hardware latch of the I/O device is activated and the axis is traveling on until the latch becomes valid. After stopping the axis the actual position of the axis is set to a value that is calculated from Position and the distance that has been made good from the sync pulse of the encoder.

Example #1: Encoder Tab, Absolute Encoder

In some applications a poti is used as a position read back device. If the poti is directly wired to the analog input without any amplifier the input impedance has to be considered. A noticeable deviation will be caused if this effect is not compensated. The drawing below is overdrawing this for better reading. For more typical values the maximum absolute deviation will be in the range of 1 to 5% of the total travel.

This deviation can be compensated by setting the ratio of the poti resistance to the input impedance.

For a poti resistance of 5kOhm and an input impedance of 100kOhm the parameter has to receive a setting of 0.05.

Example #2: Encoder Tab Inkremental Encoder

Special Case: Digital Position Cams

In some applications a set of digital cams is replacing the encoder. Use iTcMc_EncoderDigCam for the encoder type here. The cams have to have the behaviour detailed below. Please keep in mind that the cams must not become FALSE when travelled over because the axis may travel to fast when close to the target or even travel in opposite direction and beyond the limits. This may cause malfunction and even damage.

Note: This kind of position read back has to be used in combination with a generator of type iTcMc_ProfileTimeRamp.

MC_AxRtReadForceDiff_BkPlcMc

MC_AxRtReadForceSingle_BkPlcMc

MC_AxRtReadPressureDiff_BkPlcMc

MC_AxRtReadPressureSingle_BkPlcMc


TcPlcHydraulics: Knowledge Base: Setup

PLC libraries: TcPlcHydraulics

Knowledge Base of the TcHydlib PLC library: Axis setup: Positioning by use of frequency inverters

There are some specific details that have to be considered when using a combination of a frequency inverter and an induction motor. Part of them is caused by special properties of the components in use and part is a result of the type of the connection to the control. The recommeded profile type here is iTcMc_ProfileCtrlBased.

Frequency inverter with analogue interface

under construction

Frequency inverter with digital interface

This type of device is interfaced by using only digital signals. Use iTcMc_DriveLowCostInverter for nDrive_Type here. There are two options for the mapping of the I/Os and the wiring of the device that may require the adaption of the supplied signals.

Frequencies and velocity

Two of the fixed frequency setpoints of the inverter have to be set to be used for fast and slow speed moving. A typical value for the fast speed operation is 50 to 70 Hz. The frequency for the slow speed operation has to garantee the travel in the right direction under all load condition. Typical values are in the range of 3 to 10 Hz. Note: A high value here is decreasing the accuracy at the traget.

The following formula can be used to convert a frequency into a velocity:

V := F / NPP

using:

V = velocity in mm/s

F = frequency in Hz

NPP = pole pair count

To find the reference speed use the formula to convert the fast speed frequency. Use the value for fRefVelo and fMaxVelo. The conversion of the slow speed frequency will deliver the fCreepSpeed.

Note: The calculated velocities do ignore the load dependend slip effect. In the practical use the velocities will be somewhat smaller.

Acceleration

All ramps are defined by the inverter setup in this mode of operation. Use values for ramp up and ramp down time that will allow the inverter to handle the load in all expected situations. For fAcc and fMaxAcc any value can be entered because it is not used here. For better understanding of the behaviour the results from the formula below are recomended:

fAcc := fMaxAcc := fRefVelo / Ramp_up_time_in_inverter

Deceleration

For fDec, fMaxDec and fCreepDistance there are two optional strategies.

The more conventional Twospeed setup

Use a high value for the deceleration. The value may be calculated by multiplying the reference velocity by ten and divide the result by the ramp down time of the inverter. Use a value for fCreepDistance that causes a visible creeping before the axis is stopping. Be sure that this is guaranteed even for worst case situations (maximum speed is reached, maximum load, maximum process force in traveling direction).

Example:

The benefit from this approach is the simplicity of the setup procedure. The bad point is that even somewhat smaller distances are travelled mostly or completely at creep speed.

The predictive Twospeed setup

After the setup procedure described above go ahead by reducing the setting for fDec to keep the velocity setpoint from ramping down harder than the actual velocity is doing. Be sure to run this procedure in the worst case load situation. The scope view below gives an example that still has a reasonable stability. As a next step the fCreepDistance can be reduced until there is still a visible creeping.

The application of the stragie from above has to be used for the maximum load condition. Otherwise it is creating the risk of a dramatic overshooting. In the example below the axis is stopping 10mm behind the target.

In a load situation below the expected maximum the adequate setup will cause the behaviour below. The horizontal deformation of the braking ramp is not caused by a problem but is a result from the dynamic adaption of the internal setpoint generation to the actual braking behaviour of the axis.

In setup using the descibed strategie will take the chance to use more than only creeping even for shorter traveling distances.


TcPlcHydraulics: Knowledge Base: Setup: Positioning

PLC libraries: TcPlcHydraulics

Knowledge Base of the TcHydlib PLC library: Axis setup: Positioning

The active positioning of an axis is performed by a profile generator. In the library this is the task for a MC_AxRuntime_BkPlcMc block. The generator type can be selected on the global tag of the PlcMcManagers.

Note: The setup of an axis is aided significantly by the TwinCAT ScopeView. See some details at FAQ #15.

Note: Not all profile generators do support the full range of PLCopen defined features. See MC_AxRuntime_BkPlcMc for more.

Profiletype iTcMc_ProfileCtrlBased

under construction

Acceleration phase

During the acceleration phase of the movement the control value of the axis is build up by a time controlled ramp. This ramp is defined by the relationship between reference velocity and acceleration setting. See more at "Axis setup: Drive".

The acceleration phase is done if the control value is reaching the requested value (i.e. velocity parameter of an MC_MoveAbsolute_BkPlcMc block) or the profile generator starts the targeting phase.

Targeting

The profile generator will monitor the remaining travel throughout an active move. The generator will start the targeting process if the remaining travel falls below the distance that is requirred for stopping the axis in accordance to the parameters. The parameters that are effective now can be found on the Global tag of the PlcMcManager.

Note: Starting with version V3.0.8 the parameters creep speed, creap distance, brake distance and brake dead time can be made directional. This feature can be activated by using the button "Asym." (for asymetric targeting). This will make a second set of parameters become visible. Please deactivate this mechanism in the beginning of the setup process and start by optimising the targeting in positive direction. If there is a significant difference depending on the traveling direction activate asymetric targeting. Now adapt the targeting in negative direction.

Recommended strategy for the setup process:

  1. Precautions:
    • Be sure to take care for any kind of Safety Requirements.
    • The encoder setup must have been done.
    • At least the presettings of the drive setup have to be done.
    • The axis has to be moveable.
  2. Presettings:
    • Start by setting the Brake Deadtime to 0.0
    • Set the acceleration to a low value.
    • Set the deceleration to a low value.
    • Set the Creep Distance to a high value to make the creeping clearly visible.
    • If loop control in idle state is useable and desired set the lag amplification to a small value to keep the axis from drifting.
    • Set the Brake Distance to a rather high (some mm) value.
  3. Optimisation
    • The creep speed has to make sure that the axis is traveling at least in the right direction. A high value decreases the repeatability at the target and may cause overshooting. With a low setting the axis may stop before reaching the target or may drift backward and will not be signaled to be 'in target'.
    • For the creep distance use a value that gives a chance to settle to creep velocity even for adverse conditions. A high value will rise the traveling time while a low value will increase the risk of overshooting.
    • The generator will switch to the idle state as soon as the remaining travel is falling below the brake distance setting. The next settup step depends on the behaviour of the lag controller that may become active or stay inactive:
      • For lag amplification settings > 0.0 the control loop will become active automatically. In the beginning the brake distance has to set to resonably high values. Find a lag amplification setting that will not yet make the axis oscillate at the target. Afterwards the brake distance can be set appropriate. The scope view below exempfies the effect of different brake distances.
        • The lower red curve details an unbalanced combination of brake distance and lag amplification. The output is changing imediately.
        • The upper red curve demonstrates a brake distance setting that is higher than neccessary. The lag controllers output is limited to the creep velocity and could have been supplied by the profile generator. A reduced setting of the brake distance will enable a shorter creep distance and a reduced need for traveling time.
      • If there is no active control loop in idle state (i.e. lag amplification= 0.0) the brake distance has to be choosen in a way that in average makes the axis settle at the target. This has to be tested by repeated moves. If the axis is stopping before the target the brake distance is to be shortend, otherwise it has be made longer.
    • After reaching an acceptable behaviour at the target the productivity can be optimised by a stepwise rise of acceleration and deceleration. In real world situations the actual velocity will follow the setpoint with a noticeable delay. For the acceleration phase this is not of so much importance because there is no lag monitoring. In the deceleration this will cause a to high actual velocity at the beginning of the creep phase.

In case of a poor repeatability at the target the case may be excessive variation of the actual velocity during the creeping phase. This problem may be reduced by applying a brake dead time.

Example 1: Global tag for profil type iTcMc_ProfileCtrlBased

Profiltyp iTcMc_ProfileJerkBased

under construction

Profiltyp iTcMc_ProfileTimeRamp

The profile type iTcMc_ProfileTimeRamp can be used in combination with the encoder type iTcMc_EncoderDigCam only. See more details the special case..

Acceleration

In the acceleration phase the setpoint for the axis is build up by using a time ramp. This ramp is controlled by fStartRamp in Axis.ST_TcHydAxParam. This setup value defines the time that is used to rise the setpoint upto reference velocity. Smaller requested traveling speeds will be reached in a proportionally reduced time. The parameter can be found on the Global tag of the PlcMcManagers.

The acceleration phase ends if the setpoint reaches the requested level (e.g. Velocity parameter of a MC_MoveAbsolute_BkPlcMc block) or the targeting operation is taking over control.

Targeting

During an active move the profile generator is constantly monitoring the directional target range camm. If the desired camm is detected the profile generator is switching over to targeting mode. fStopRamp in Axis.ST_TcHydAxParam defines the decelleration ramp for che change to fCreepSpeed. This parameter can be found on the global tag of the PlcMcManager.

A soon as the profile generator detects the target camm it switches over to its idel state. Sometimes there is a need for a constant output signal to keep the axis from drifting or to press at a target. To implement this behaviour set an appropriate value on the valve tag of the PlcMcManager. Otherwise set this parameter to 0.

Note: Starting with version V3.0.8 a directional setting for the creep speed can be used. This is activated by the control tag "Asym." (for asymetric targeting). A second set of input fields will become visible. At the start of the setup procedure this option should be disabled to find acceptable parameters for moving in positive direction. If neccessary parameters for the negative directions can be found later.

Special case: Frequency Inverter

Frequency inverters with analog or digital interface.