beckhoff · TwinCAT 2 TcMC2 · 118 pp.

Beckhoff TwinCAT 2 PLC Library TcMC2 Manual PDF (EN) — Operation manual

Руководство по использованию библиотеки TwinCAT 2 для управления движением, включая функции блоков MC и их настройки.

Related manuals

Contents

Document text

Manual | EN TX1200 TwinCAT 2 | PLC Library: TcMC2 2025-06-30 | Version: 1.4

Page 1

Table of contents

Table of contents Table of contents 1 Foreword.................................................................................................................................................... 7 1.1 Notes on the documentation ............................................................................................................. 7 1.2 For your safety .................................................................................................................................. 7 1.3 Notes on information security............................................................................................................

9 2 Overview .................................................................................................................................................. 10 3 State diagram .......................................................................................................................................... 11 4 General rules for MC function blocks ................................................................................................... 14 5 Migration from TcMC to TcMC2 .............................................................................................................

17 6 Organisation function blocks................................................................................................................. 19 6.1 Axis functions .................................................................................................................................. 19 6.1.1 MC_Power ....................................................................................................................... 19 6.1.2 MC_Reset ........................................................................................................................

20 6.1.3 MC_SetPosition ............................................................................................................... 21 6.2 Status and parameter...................................................................................................................... 23 6.2.1 MC_ReadActualVelocity .................................................................................................. 23 6.2.2 MC_ReadActualPosition .................................................................................................. 24 6.2.3 MC_ReadAxisComponents..............................................................................................

24 6.2.4 MC_ReadAxisError .......................................................................................................... 25 6.2.5 MC_ReadBoolParameter................................................................................................. 26 6.2.6 MC_ReadParameter ........................................................................................................ 27 6.2.7 MC_ReadParameterSet................................................................................................... 29 6.2.8 MC_ReadStatus...............................................................................................................

30 6.2.9 MC_WriteBoolParameter ................................................................................................. 32 6.2.10 MC_WriteParameter ........................................................................................................ 33 6.3 Touch probe .................................................................................................................................... 34 6.3.1 MC_TouchProbe.............................................................................................................. 34 6.3.2 MC_TouchProbe_V2........................................................................................................

37 6.3.3 MC_AbortTrigger.............................................................................................................. 40 6.3.4 MC_AbortTrigger_V2 ....................................................................................................... 41 6.4 External set value generator ........................................................................................................... 42 6.4.1 MC_ExtSetPointGenEnable............................................................................................. 42 6.4.2 MC_ExtSetPointGenDisable............................................................................................

43 6.4.3 MC_ExtSetPointGenFeed................................................................................................ 44 6.5 Special extensions .......................................................................................................................... 45 6.5.1 MC_PowerStepper........................................................................................................... 45 6.5.2 Notes on the MC_PowerStepper ..................................................................................... 46 6.5.3 MC_OverrideFilter............................................................................................................

51 6.5.4 MC_SetOverride .............................................................................................................. 52 6.5.5 MC_SetEncoderScalingFactor......................................................................................... 53 6.5.6 MC_PositionCorrectionLimiter ......................................................................................... 54 6.5.7 MC_ReadDriveAddress ................................................................................................... 55 6.5.8 MC_SetAcceptBlockedDriveSignal..................................................................................

56 7 Motion function blocks........................................................................................................................... 58 TX1200 3 Version: 1.4

Page 3

Table of contents

Table of contents 7.1 Point to point motion ....................................................................................................................... 58 7.1.1 MC_MoveAbsolute........................................................................................................... 58 7.1.2 MC_MoveRelative............................................................................................................ 60 7.1.3 MC_MoveAdditive............................................................................................................ 62 7.1.4 MC_MoveModulo.............................................................................................................

64 7.1.5 Notes on modulo positioning............................................................................................ 66 7.1.6 MC_MoveVelocity ............................................................................................................ 72 7.1.7 MC_MoveContinuousAbsolute......................................................................................... 74 7.1.8 MC_MoveContinuousRelative.......................................................................................... 76 7.1.9 MC_Halt ...........................................................................................................................

78 7.1.10 MC_Stop .......................................................................................................................... 80 7.2 Superposition .................................................................................................................................. 82 7.2.1 MC_MoveSuperimposed.................................................................................................. 82 7.2.2 Application examples for MC_MoveSuperimposed ......................................................... 84 7.2.3 MC_AbortSuperposition...................................................................................................

87 7.3 Homing............................................................................................................................................ 88 7.3.1 MC_Home........................................................................................................................ 88 7.4 Manual motion................................................................................................................................. 91 7.5 Axis coupling ...................................................................................................................................

93 7.4.1 MC_Jog............................................................................................................................ 91 7.5.1 MC_GearIn....................................................................................................................... 93 7.5.2 MC_GearInDyn ................................................................................................................ 95 7.5.3 MC_GearOut.................................................................................................................... 97 7.5.4 MC_GearInMultiMaster....................................................................................................

98 8 Data types .............................................................................................................................................. 101 8.1 Axis interface................................................................................................................................. 101 8.1.1 Data type AXIS_REF ..................................................................................................... 101 8.1.2 Data type NCTOPLC_AXIS_REF ..................................................................................

102 8.2 Motion function blocks .................................................................................................................. 103 8.1.3 Data type PLCTONC_AXIS_REF .................................................................................. 102 8.2.1 Data type MC_BufferMode............................................................................................. 103 8.2.2 Data type MC_Direction................................................................................................. 105 8.2.3 Data type MC_HomingMode..........................................................................................

106 8.2.4 Data type E_SuperpositionMode ................................................................................... 106 8.2.5 Data typeST_SuperpositionOptions............................................................................... 107 8.2.6 Data type E_JogMode.................................................................................................... 108 8.3 Status and parameter.................................................................................................................... 108 8.3.1 Data type E_ReadMode.................................................................................................

108 8.3.2 Data type ST_AxisStatus ............................................................................................... 109 8.3.3 Data type MC_AxisParameter........................................................................................ 110 8.3.4 Data type ST_PowerStepperStruct................................................................................ 111 8.3.5 Data type ST_DriveAddress........................................................................................... 111 8.3.6 Data type ST_AxisParameterSet ...................................................................................

111 8.3.7 Data type ST_AxisOpModes.......................................................................................... 113 8.3.8 Data type E_AxisPositionCorrectionMode ..................................................................... 113 8.3.9 Data type MC_AxisStates .............................................................................................. 113 TX1200 4 Version: 1.4

Page 4

Table of contents

Table of contents 8.4 Touch probe .................................................................................................................................. 114 8.4.1 Data type TRIGGER_REF ............................................................................................. 114 8.4.2 Data type MC_TouchProbeRecordedData .................................................................... 115 8.5 External set value generator ......................................................................................................... 115 8.5.1 Datentyp E_PositionType...............................................................................................

115 9 Example programs................................................................................................................................ 116 9.1 Sample Programs ......................................................................................................................... 116 TX1200 5 Version: 1.4

Page 5