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

Download this file

5 lines (5 with data), 5.4 kB

Gx_l !0…jüooçŸÙ‰_§ìÑ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 R    // 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­