Transformation

Transformation 1:

Exclusive function for transforming axes

This core function is only available for transforming axes.

Transformation 2:

This core function manages the coupling of the two internal axes of a transforming axis.

To this end, the transformation works internally with three translation paths:

  1. Drive table - Drive position in a load position.
  2. Load table - load position in a drive position.
  3. Drive table - Reverse translation of an actuator position into a load position.

Syntax:

FUNCTION_BLOCK FB_NcTransformation EXTENDS FB_TrafoCorefunction

Transformation 3: Properties

Name

Type

Access

Description

InitState

BOOL

Get, Set

The core function is not completely and successfully initialized.

FB_NcTransformation

IsUpdating

BOOL

Get

TRUE as long as a previously passed table is being processed internally.

LowerLimit

LREAL

Get, Set

Lower limit from which the load table is linearized.

Reversed

LREAL

Get, Set

Reserved for future use.

Table

I_CammingLookUp

Get, Set

Interface for the transformation table to be transferred.

UpperLimit

LREAL

Get, Set

Upper limit from which the load table is linearized.

Valid

BOOL

Get

The transferred table was loaded successfully.

FB_Corefunction

FailedState

BOOL

Get, Set

If IsActivated is TRUE at the same time: Signals the failure of an accepted command.

If IsActivated is FALSE at the same time: Signals the rejection of a command.

HasFeedback

BOOL

Get

The core function has responded to a pending command.

IsActivated

BOOL

Get

The core function has an accepted command pending.

IsLocalCmd

BOOL

Get

Signals that the axis is assigned with a command of this core function.

ReadyState

BOOL

Get, Set

The Corefunction is ready for operation, but is not commandable at this time.

Possible reasons are:
- The axis is not enabled.
- Another Corefunction is active.
- The Corefunction does not support any commands.

Transformation 4: Methods

Name

Description

[INTERN] Cyclic()

This method is called cyclically by the axis.

FB_NcTransformation

GetSlot()

Reserves the index of a slot for asynchronous translation function and returns it.

ReleaseSlot(nSlot)

Releases a reserved slot.

TranslateFromDrive()

Translates a drive position into a load position using the load table.

TranslateFromLoad()

Reserved for future use.

TranslateToDrive()

Translates a load position into a drive position using the load table.

TranslateToLoad()

Translates a drive position into a load position using the drive table.

UpdateToLinLoad()

Translates a position in a linearized way, depending on the set LowerLimit properties.

[INTERN] TranslateToDrivePrio()

Prioritized execution of the TranslateToDrive() method.

[INTERN] TranslateToLoadPrio()

Prioritized execution of the TranslateToLoad() method.

Transformation 5: Interfaces

Type

Description

I_Corefunction

Standard interface on FB_Corefunction.

I_Transformation

Standard interface on FB_NcTransformation.

I_CorefunctionFeedback

Standard interface on FB_CorefunctionFeedback.

Example:

// Get specific interface I_AxisTrafoBase from general interface I_AxisBase
IF __QUERYINTERFACE(iAxisBase, iAxisTrafoBase) THEN
    
    CASE nState OF
    0:  // define transformation mechanics (e.g. a crank shaft)
        fbCrankTableGenerator.DriveArm := 50.0;         // [mm]
        fbCrankTableGenerator.LoadArm := 200.0;         // [mm]
        fbCrankTableGenerator.HeightOffset := 0.0;      // [mm]
        fbCrankTableGenerator.DriveLowEnd := 0.0;       // [°]
        fbCrankTableGenerator.DriveHighEnd := 180.0;    // [°]
        
        // configure a table in which the generated characteristic curve is stored
        fbCammingLookup.Equidistance := TRUE;
        fbCammingLookup.Interpolation := E_LookupMode.eSecondOrder;
        fbCammingLookup.SetPoints(181);        // Resultion => 1 point per degree [°]
        fbCrankTableGenerator.LookUp := fbCammingLookup;
        
        // Start table generation
        IF fbCrankTableGenerator.DefineTable() THEN
            nState := nState + 1;
        ELSE
            nState := -1;
        END_IF
        
    1:  // assign the caracteristics curve to the axis
        iAxisTrafoBase.Transformation.Table := fbCrankTableGenerator;
        
        IF iAxisTrafoBase.Transformation.Valid THEN
            nState := nState + 1;
        ELSIF NOT iAxisTrafoBase.Transformation.IsUpdating THEN
            nState := -1;
        END_IF
        
    2:  // transformation is ready to use.

        // Activate full transformation to linearise load side behavior
        iAxisTrafoBase.Synchronise := TRUE;
    
    -1: // error
        
    END_CASE
ELSE
    // interface is not set to an instance deriving FB_AxisTrafoBase (e.g. FB_AxisNcTrafoBase)
    bIncompatible := TRUE;
END_IF

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4024.55

PC or CX (x64, x86)

Tc3_PlasticFunctions (>= v12.6.1.0)