The basics of core functions (FB_CoreFunction)

The basics of core functions (FB_CoreFunction) 1:

All Corefunctions have a number of common features that are implemented in a ABSTRACT FB_Corefunction. A number of Corefunctions are derived from FB_CorefunctionFeedback and provide further properties and methods. Through the inheritance of FB_Corefunction, each Corefunction receives the properties and methods described here.

Core functions are instantiated within motion objects as local elements. At startup, the core function receives an interface to its host axis and, if necessary, to a drive-related adaptation.

Syntax:

FUNCTION_BLOCK ABSTRACT FB_Corefunction EXTENDS FB_MessageBase

The basics of core functions (FB_CoreFunction) 2: Properties

Name

Type

Access

Description

InitState

BOOL

Get, Set

The core function is not completely and successfully initialized.

FB_Corefunction

[INTERN] AxisState

E_AxisState

Get, Set

The current state of the axis state machine.

[INTERN] Connected

BOOL

Get

The Corefunction is connected to an axis.

[INTERN] CycleTime

LREAL

Get, Set

The cycle time of the PLC task from which the method Cyclic() of the Corefunction is executed.

[INTERN] CycleTimeValid

BOOL

Get, Set

A TRUE indicates that the CycleTime of the Corefunction is defined.

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.

[INTERN] NextCore

I_Corefunction

Get, Set

This property is part of the execution chain and must not be affected by the application task.

[INTERN] OnlineChangeMark

BOOL

Get, Set

The axis uses this property to signal an Online Change to the Corefunction.

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.

The basics of core functions (FB_CoreFunction) 3: Methods

Name

Description

[INTERN] Cyclic()

This method is called cyclically by the axis.

FB_Corefunction

[INTERN] ApplyCommand()

Applies the command to the axis.

[INTERN] ClearStates()

Clears up some of the possible states.

[INTERN] DoReset(bExecute)

This method is called when the axis is reset.

[INTERN] RemoveCommand()

Removes the command from the axis.

The basics of core functions (FB_CoreFunction) 4: Interfaces

Type

Description

I_Corefunction

Standard interface on FB_Corefunction.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4024.35

PC or CX (x64, x86)

Tc3_PlasticFunctions v3.12.4.26 or higher