F_IsSameInstance

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); // FALSESyntax:
FUNCTION F_IsSameInstance : BOOL
Inputs
Name | Type | Description |
|---|---|---|
iCmp1 | I_Comparable | First object to be compared. |
iCmp2 | I_Comparable | Second object to be compared. |
Outputs
Name | Type | Description |
|---|---|---|
F_IsSameInstance | BOOL | Result of the comparison: |
Requirements
Development environment | Target platform | PLC libraries to include |
|---|---|---|
TwinCAT 4026 >= v3.1.4026.19 | PC or CX (x64, x86) | Tc3_PlasticBaseApplication (>= v12.14.0.0) |