F_IsSameInstance

F_IsSameInstance 1:

Compares two objects to see if they are exactly the same instance. If the transferred objects are each an instance of the same class but not the identical object, FALSE is returned.

This function works for all objects that implement I_Comparable (e.g. by inheriting from FB_Base) and interfaces that extend I_Comparable.

Example:

VAR
    fbObj1:        FB_Axis;
    fbObj2:        FB_Axis;
    iObj:          I_Axis := fbObj1;
END_VAR

F_IsSameInstance(fbObj1, fbObj1); // TRUE
F_IsSameInstance(fbObj1, iObj);   // TRUE
F_IsSameInstance(fbObj1, fbObj2); // FALSE

Syntax:

FUNCTION F_IsSameInstance : BOOL

F_IsSameInstance 2: Inputs

Name

Type

Description

iCmp1

I_Comparable

First object to be compared.

iCmp2

I_Comparable

Second object to be compared.

F_IsSameInstance 3: Outputs

Name

Type

Description

F_IsSameInstance

BOOL

Result of the comparison: TRUE -> Identical, FALSE -> Different

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT 4026 >= v3.1.4026.19
TwinCAT 4024 >= v3.1.4024.71

PC or CX (x64, x86)

Tc3_PlasticBaseApplication (>= v12.14.0.0)