Library-Specific Data Types

Data Type Axis_Ref

The data type Axis_Ref is an alias of the interface IF_Axis of the MotionInterface library. Refer to the MotionInterface library guide for details.

Data Type MC_AxisDirection

The data type MC_AxisDirection is an alias of the enumeration ET_AxisDirection of the MotionInterface library. Refer to the MotionInterface library guide for details.

Data Type MC_Buffer_Mode

The data type defines the method for the start of a new/buffered movement with regard to the ongoing movement.

Name

Value

Description

Aborting

0

The ongoing movement is aborted and the new movement is executed immediately in the next possible real-time cycle.

Buffered

1

The new/buffered movement is executed as soon as the ongoing movement has reached its steady-state, which corresponds to the function block output Done, InVelocity, InSync, or EndOfProfile, depending on the ongoing movement. The buffered job becomes active immediately in the real-time-cycle when the previous job reaches its steady-state. It does not wait for the outputs to become TRUE in the next application task cycle afterwards.

BlendingLow(1)

2

The new/buffered movement is executed as soon as the ongoing movement has finished, but without standstill in between. The transition is made with the lower of the two velocity values of the ongoing movement and the new/buffered movement.

BlendingPrevious(1)

3

The new/buffered movement is executed as soon as the ongoing movement has finished, but without standstill in between. The transition is made with the velocity value of the ongoing movement.

BlendingNext(1)

4

The new/buffered movement is executed as soon as the ongoing movement has finished, but without standstill in between. The transition is made with the velocity value of the new/buffered movement.

BlendingHigh(1)

5

The new/buffered movement is executed as soon as the ongoing movement has finished, but without standstill in between. The transition is made with the higher of the two velocity values of the ongoing movement and the new/buffered movement.

StartAtMasterposition(1)

6

Provided for buffering a cam to be started at a specified master position via MC_CamIn.

(1) Only for function blocks MC_MoveVelocity, MC_MoveAbsolute, MC_MoveAdditive, and MC_MoveRelative

The following table provides details on how buffering (MC_BufferMode.Buffered) works for different function blocks:

Function block

Movement of the function block can be specified as a buffered movement

Movement of the function block can be followed by a buffered movement

Condition for buffered command to become active

MC_Power

No

No(1)

-

MC_Power is not a motion function block.

MC_MoveVelocity

Yes

Yes

InVelocity

MC_MoveAbsolute

Yes

Yes

Done

MC_MoveAdditive

Yes

Yes

Done

MC_MoveRelative

Yes

Yes

Done

MC_Home

No

No

None

MC_Stop

No

Yes

Done and input Execute set to FALSE

MC_Halt

Yes

Yes

Done

MC_CamIn

Yes

Yes(1)

EndOfProfile regardless of whether input Periodic is set to TRUE or to FALSE

MC_GearIn

No

Yes

InGear

MC_PhasingAbsolute

No

No

-

MC_MoveSuperImposed

No

No

-

MC_CustomJob

Yes

Yes

InSteadyState

(1) Differs from specifications as per PLCopen Motion Control Part 1, Version 2.0.

The controller executes the user application task (in which motion control function blocks are called) in a task separate from the real-time motion process (in which cyclic reference and target values are calculated, for example). To start a function block in the same Sercos cycle in which the active function block reaches its steady state (Done, inVelocity, EndOfProfile, InGear), the function block needs to be buffered ahead of time. If you trigger the start (Execute) of the subsequent function block via, for example, the EndOfProfile signal of the preceding function block instead of buffering it, one or several cycles of delay result in which no function block is active and the axis remains at a standstill. Refer to Task Concept for details.

Data Type MC_CamSwitch

The data type MC_CamSwitch is an alias of the structure ST_CamSwitch of the MotionInterface library. Refer to the MotionInterface library guide for details.

Data Type MC_CamSwitchMode

The data type MC_CamSwitchMode is an alias of the enumeration ET_CamSwitchMode of the MotionInterface library. Refer to the MotionInterface library guide for details.

Data Type MC_CamSwitch_Ref

The data type MC_CamSwitch_Ref is an alias of the structure ST_CamSwitch_Ref of the MotionInterface library. Refer to the MotionInterface library guide for details.

Data Type MC_CAM_ID

The data type MC_CAM_ID is an alias of the structure ST_MultiCam of the CommonMotionTypes library. Refer to the CommonMotionTypes library guide for details.

Data Type MC_Direction

The data type defines the direction of movement.

For MC_MoveVelocity and MC_MoveRelative, the direction inverts the direction of movement (by inverting the sign of the velocity or distance). This is independent of the axis type (modulo or linear).

For MC_MoveAbsolute and the ramp-in functionality of MC_CamIn, the direction input specifies the direction in which the absolute target position is approached. For these function blocks, the direction is only considered for modulo axes. It is ignored for linear axes (as absolute positions on linear axes are approached in the only mathematically possible direction).

Name

Value

Description

PositiveDirection

0

Positive direction of movement

NegativeDirection

1

Negative direction of movement

ShortestWay(1)

2

The direction of movement depends on whether the positive direction of movement or the negative direction of movement has the shortest distance to the target position.

(1) Only for function blocks MC_MoveAbsolute and MC_CamIn.

Data Type MC_Interpolation_Mode

The data type MC_Interpolation_Mode is an alias of the enumeration ET_InterpolationMode of the MotionInterface library. Refer to the MotionInterface library guide for details.

Data Type MC_Interpolation_Parameter

The data type MC_Interpolation_Parameter is an alias of the structure ST_Interpolation_Parameter of the MotionInterface library. Refer to the MotionInterface library guide for details.

Data Type MC_Master_Start_Mode

Name

Value

Description

Absolute

0

The cam starts at the X coordinate equal to the absolute master axis position at the time of start.

Relative

1

The cam starts at the X coordinate equal to the X of the first cam point, which is assumed to correlate with the position of the master axis at the time of start.

NOTE: In PLCopen Motion Control Part 1, Version 2.0, there is a data type MC_Start_Mode, as well as two Boolean flags MasterAbsolute and SlaveAbsolute. To improve clarity, this library instead implements two data types MC_Master_Start_Mode (a combination of MC_Start_Mode and MasterAbsolute) and MC_Slave_Start_Mode (a combination of MC_Start_Mode and SlaveAbsolute). The latter also contains the mode RampIn.

Data Type MC_OperationMode

The data type MC_OperationMode specifies the operating mode for the function block MC_MoveVelocity via the input OperationMode.

Name

Value

Description

Position

0

Velocity control with active position control loop in drive (Cyclic Synchronous Position).

Velocity

1

Cyclic Synchronous Velocity, pure velocity control.

The value Position performs a movement with the velocity set at the input Velocity of the function block MC_MoveVelocity. In this operating mode, the position control loop of the drive remains active (Cyclic Synchronous Position). This is the default operating mode for the function block MC_MoveVelocity.

The value Velocity activates the operating mode Cyclic Synchronous Velocity. In this operating mode, the position control loop of the drive is not active (pure velocity control).

The operating mode Cyclic Synchronous Velocity is started when the value at the input OperationMode of the function block MC_MoveVelocity is Velocity and the value at the input Execute changes from FALSE to TRUE.

The checkbox VelocityOperationMode on the tab Feature Configuration must be activated to enable the operating mode Cyclic Synchronous Velocity.

Executing MC_MoveVelocity with the operating mode Cyclic Synchronous Velocity for an axis whose drive does not support this operating mode or for which it has not been enabled results in a detected error by MC_MoveVelocity without affecting the axis behavior.

If the active operating mode is Cyclic Synchronous Velocity and the function blocks MC_Stop or MC_Halt are executed or if an error is detected with a resulting transition to the operating state ErrorStop, the operating mode Cyclic Synchronous Velocity remains active.

If an attempt is made to start a motion function block (for example, MC_MoveAbsolute) while MC_MoveVelocity is being executed in the operating mode Cyclic Synchronous Velocity, that motion function block is not executed and its output Error is set to TRUE. MC_MoveVelocity continues to run in the operating mode Cyclic Synchronous Velocity.

To change from the operating mode Cyclic Synchronous Velocity to a different operating mode, stop the axis with the function block MC_Stop or MC_Halt. Executing any motion function block other than MC_MoveVelocity then changes the operating mode from Cyclic Synchronous Velocity to the operating mode used by that function block. For example, if you want to change from the operating mode Cyclic Synchronous Velocity to the operating mode Cyclic Synchronous Position without starting a movement, you can execute the function block MC_MoveRelative with a distance of 0. If you want to change from the operating mode Cyclic Synchronous Velocity without executing a motion function block, disable and re-enable the power stage of the drive via the function block MC_Power.

If the requested operating mode is not confirmed by the drive within 30 Sercos cycles, an error is detected (output Error of the requesting function block is set to TRUE).

Data Type MC_Slave_Start_Mode

Name

Value

Description

Absolute

0

For starting the cam, the position of the slave axis is directly set to the first calculated Y value. The slave axis position is calculated on the basis of the cam definition and “master as seen by slave”. As opposed to the slave start modes Relative and RampIn, there are no offsets and superimposed movements. The reference velocity and the acceleration are calculated on the basis of the cam definition.

If there is a position difference between the position of the slave and its calculated start position (Y value) for the cam, and if this start position cannot be reached within one task scan, an error is detected. However, if this start position can be reached in spite of the position difference, this movement may be made in the form of a sudden position jump.

Relative

1

The cam starts at the Y coordinate defined by f(X start), where f() is the cam function and X start is determined by the master start mode (MC_Master_Start_Mode). This Y is correlated with the current slave axis position.

RampIn

2

It is assumed that the absolute slave axis position is supposed to be equal to the cam Y coordinate for the cam to be in sync.

At the beginning, the cam starts like slave relative, meaning f(X start) is correlated with the absolute slave axis position when the cam starts. Then a ramp-in movement is performed which offsets the slave axis to align the coordinate system of the axis position with the coordinate system of Y.

 WARNING
UNINTENDED EQUIPMENT OPERATION
Verify the physical position of the slave axis at the start of the cam and verify that it matches the position in the cam definition.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
NOTE: In PLCopen Motion Control Part 1, Version 2.0, there is a data type MC_Start_Mode, as well as two Boolean flags MasterAbsolute and SlaveAbsolute. To improve clarity, this library instead implements two data types MC_Master_Start_Mode (a combination of MC_Start_Mode and MasterAbsolute) and MC_Slave_Start_Mode (a combination of MC_Start_Mode and SlaveAbsolute). The latter also contains the mode RampIn.

Data Type MC_Track_Ref

The data type MC_Track_Ref is an alias of the structure ST_Track_Ref of the MotionInterface library. Refer to the MotionInterface library guide for details.

Data Type MC_Trigger_Ref

MC_Trigger_Ref is an alias of DAL.IF_Trigger. This is an input type for MC_TouchProbe and MC_AbortTrigger in order to connect the function blocks to the corresponding TouchProbe inputs, similar to Axis_Ref.

The interface MC_Trigger_Ref/DAL.IF_Trigger provides a property CaptureEdge of type UINT which can have a value from 0 to 2.

Name

Value

Description

FallingEdge

0

Falling edge

RisingEdge

1

Rising edge

BothEdges

2

Both rising edge and falling edge

VAR
fb_MC_TriggerRef: PLCO.MC_Trigger_Ref;
fb_MC_Touchprobe : PLCO.MC_TouchProbe;
END_VAR

fb_MC_TriggerRef := DRV_Lexium32S.triggerCap1;
fb_MC_TriggerRef.CaptureEdge := MOIN.ET_CaptureEdge.RisingEdge;
fb_MC_Touchprobe(Axis := DRV_Lexium32S.Axis, ifTrigger := fb_MC_TriggerRef);