FB_Referencing

FB_Referencing 1:

The Homing class implements standard procedures for referencing an axis.

Syntax:

FUNCTION_BLOCK FB_Referencing EXTENDS FB_Base

FB_Referencing 2: Properties

Name

Type

Access

Initial value

Description

Name

STRING

Get, Set

<SourceName>

Specifies the name of the class instance.

FB_Referencing

AttachableMdInterface

I_MdComponent

Get

-

Interface to the machine data component

Enable

BOOL

Get, Set

FALSE

If TRUE, commands are executed directly via FB_ReferencingHmi.

ExternalStates

I_AdaptableSeqExt

Get, Set

NULL

Interface to an object with additional homing procedure steps

Homing

I_Homing

Get, Set

THIS^

Subcategory of homing functions.

InputAbsSwitch

I_InputBase

Get, Set

NULL

I/O object for an absolute switch.

InputNegativeLimitSwitch

I_InputBase

Get, Set

NULL

I/O object for an end position sensor in the negative direction.

InputPositiveLimitSwitch

I_InputBase

Get, Set

NULL

I/O object for an end position sensor in the positive direction.

AbsoluteSwitch1

BOOL

Set

FALSE

Input value of an absolute position switch
Alternatively: InputAbsSwitch

FB_Base

BaseState

E_BaseState

Get

eNotHandled

Initialization state of the class instance.

Error

BOOL

Get

FALSE

Class is in an error state.

ResultMessage

I_AppMessage

Get

-

Access to the class-internal EventLogger.

[PROTECTED] _Name

STRING

Get

<SourceName>

.Name without leading 'fb'.

FB_Referencing 3: Methods

Name

Description

Reset()

Resets the error state of the class.

FB_Referencing

DoAbort()

Aborts the currently active referencing.

DoAbsSwitch()

Starts referencing the axis using an absolute position switch.

DoAbsSwitchDetect()

Starts the detection of the position of an absolute position switch.

DoAbsSwitchSequence()

Starts a sequence of DoAbsSwitch() and DoFinish().

DoBlock()

Starts referencing against an end stop.

DoBlockDetect()

Starts the detection of the position at an end stop.

DoBlockSequence()

Starts a sequence of DoBlock(), DoBlockDetect() and DoFinish().

DoFinish()

Starts the termination of homing.
Notice This step is essential for successfully completing a homing process.

DoLimitSwitch()

Starts referencing the axis against a limit switch.

DoLimitSwitchDetect()

Starts the detection of the position of a limit switch.

DoLimitSwitchSequence()

Starts a sequence of DoLimitSwitch(), DoLimitSwitchDetect () and DoFinish().

DoSetZero()

Sets the current position of the axis to 0.

FB_Base

GetHMI()

Returns the assigned HMI object.

Notice The method is not implemented in the FB_Base class. If the method is not overwritten by inheritance, a pseudo variable is always returned.

SetHMI(ipBase)

General assignment method for an FB_BaseHmi extending class as a local HMI.

Notice The method is not implemented in the FB_Base class. If the method is not overridden by inheritance, it always fails.

[PROTECTED] _QueryNamespace()

Extracts the first part of the instance path as an object namespace.

[PROTECTED] _QueryObjectName()

Extracts the last part of the instance path as the object name.

FB_Referencing 4: Procedure controlling methods (FB_AdaptableSequence)

Name

Description

HomingStates()

State machine of the homing procedures

FB_Referencing 5: Event-driven methods (callback methods)

Name

Description

ExtAdaptSeq()

Dummy method() for use without "ExternalStates"

FB_Referencing 6: Possible events

ID

Description

Alarm/Message

4000

Homing not allowed

Alarm

4001

Homing failed

Alarm

4002

Save homing was successful

Message

4003

Save homing was not successful

Message

FB_Referencing 7: Interfaces

Type

Description

I_Base

Standard interface on FB_Base.

I_Referencing

Standard interface on FB_Referencing

I_AttachableMdInterface

Interface for containerless machine data components

I_AdaptableSeqExt

Interface for providing external homing procedures

I_Homing1

Compatibility with the obsolete interface on FB_Homing

I_BaseEmpty

For extension without standard interface.

I_BaseDev

Covers all methods and properties of the base class.

Prerequisites

Development environment

Target platform

PLC libraries to include

TwinCAT >= v3.1.4024.54 (recommended)
TwinCAT >= v3.1.4024.42 (required)

PC or CX (x64, x86)

Tc3_PlasticBaseApplication (>= v12.10.2.0)