[r39]: / trunk / Library / POUs / FB_AnyComparator / svnobj  Maximize  Restore  History

Download this file

6 lines (6 with data), 5.4 kB

Gx_l2!0┘jЭo│.
З╝┴_їЛяSystem.StringL{6f9dac99-8de1-4efc-8465-68ac443b7d08}SpecialFuncL{0db3d7bb-cde0-4416-9a7b-ce49a0124323}NoneImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocument	L{f3878285-8e4f-490b-bb1b-9acbb7eb04db}
TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}Id
longTagText.(* Reset the outputs *)8DataTypesNotEquals := FALSE;6DataSizeNotEquals := FALSE;<DataContentNotEquals := FALSE;d(* Check whether the type of the inputs differs *)lIF AnyValueOne.TypeClass <> AnyValueTwo.TypeClass THEN>    DataTypesNotEquals := TRUE;END_IFd(* Check whether the size of the inputs differs *)<IF NOT DataTypesNotEquals THENl    IF (AnyValueOne.diSize <> AnyValueTwo.diSize) THEND        DataSizeNotEquals := TRUE;    END_IFє(* Even though the data type and size are equals, the contents may still differ *)pIF NOT DataTypesNotEquals AND NOT DataSizeNotEquals THEN T    /// Compare each byte in the ANY-types!|    FOR IteratorCounter := 0 TO AnyValueOne.diSize - 1 BY 1 DO"Є        IF AnyValueOne.pValue[IteratorCounter] <> AnyValueTwo.pValue[IteratorCounter] THEN#R            DataContentNotEquals := TRUE;$"            EXIT;%        END_IF&    END_FOR'Interface(L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94})///*·///  This FB compares two instances of any object type and returns whether they+╒///  are the same type, size and value or not. This is necessary for two reasons:,╒///  1. So that we can know exactly what differs between the two input parameters-╗///  2. It's not possible to do a comparison (= or <>) between two instances of ANY..>FUNCTION_BLOCK FB_AnyComparator/VAR_INPUT0,    AnyValueOne : ANY;1,    AnyValueTwo : ANY;2END_VAR3VAR_OUTPUT4╪    DataTypesNotEquals : BOOL; /// The data type of the two ANY input parameters are not equal5╨    DataSizeNotEquals : BOOL; /// The data size of the two ANY input parameters are not equal6ф    DataContentNotEquals : BOOL; /// The data content of the two ANY input parameters are not equal7VAR86    IteratorCounter : DINT;9"UniqueIdGenerator:46;POULevel<L{8e575c5b-1d37-49c6-941b-5c0ec7874787}=Standard> ChildObjectGuids?8System.Collections.ArrayList@,AddAttributeSubsequentAboolпп-пп	E
пп
ґзп-пп
ґзп-пп
ґзп-пп
ґзп-пп
ґзп-пп
ґзп-пп
ґ	зп-пп
ґ
зп-пп
ґзп-пп
ґзп-пп
ґ
зп-пп
ґзп-пп
ґзп-пп
ґзп-пп
ґзп-пп
ґзп-пп
ґзп-пп
ґзп-пп
ґзп-пп
ґзп- пп
ґзп-!пп
ґзп-"пп
ґзп-#пп
ґзп-$пп
ґзп-%пп
ґзп-&пп
ґзп-п'(п	E
пп
ґзп-)пп
ґзп-*пп
ґзп-+пп
ґ зп-,пп
ґ!зп--пп
ґ"зп-)пп
ґ#зп-.пп
ґ$зп-/пп
ґ%зп-0пп
ґ&зп-1пп
ґ'зп-2пп
ґ(зп-3пп
ґ)зп-4пп
ґ*зп-5пп
ґ+зп-6пп
ґ,зп-2пп
ґ-зп-7пп
ґ.зп-8пп
ґзп-2п9-:п;<-=>?п@Aґ