True 7d591bcc-b453-4853-8327-1622b58624cc 90a6d9c5-e652-47fd-87bb-6655b7d77f9c MEMCPY 6f9dac99-8de1-4efc-8465-68ac443b7d08 a9ed5b7e-75c5-4651-af16-d2c27e98cb94 3b83b776-fb25-43b8-99f2-3c507c9143fc 636933402850513683 None 7 IF ( srcAddr = 0) OR ( destAddr = 0 ) OR ( n = 0 ) THEN 14 MEMCPY := 0; 16 RETURN; 15 END_IF 21 20 pSrc := srcAddr; 22 pDest := destAddr; 24 23 FOR i := 0 TO (n-1) DO 25 pDest[i] := pSrc[i]; 26 END_FOR 28 27 MEMCPY := n; 2 FUNCTION MEMCPY : UDINT 3 VAR_INPUT 8 destAddr : CAA.PVOID; 9 srcAddr : CAA.PVOID; 10 n : UDINT; 4 END_VAR 5 VAR 11 pSrc : POINTER TO BYTE; 12 pDest : POINTER TO BYTE; 13 i : UDINT; 6 END_VAR 1 28 Standard False 90a6d9c5-e652-47fd-87bb-6655b7d77f9c CODESYS_Control_Win_V3 PLC Logic Application -1 True e16819ff-efba-4778-bc78-05a9796b59ac 90a6d9c5-e652-47fd-87bb-6655b7d77f9c prg_MemCpyTest 6f9dac99-8de1-4efc-8465-68ac443b7d08 a9ed5b7e-75c5-4651-af16-d2c27e98cb94 3b83b776-fb25-43b8-99f2-3c507c9143fc 636933419128548460 None 17 // MEMCPY 11 IF xCopy THEN 5 n := MEMCPY( destaddr := ADR(arr2), 9 srcAddr := ADR(arr1), 10 n := SIZEOF(arr2) ); 14 xCopy := FALSE; 16 END_IF; 19 18 //MemMove 24 IF xMove THEN 25 x := MEM.MemMove( pSource := ADR(arr3), 38 pDestination := ADR(arr4), 39 uiNumberOfBytes := SIZEOF(arr2) ); 28 xMove := FALSE; 23 END_IF; 20 2 PROGRAM prg_MemCpyTest 3 VAR 6 arr1 : ARRAY [0..23] OF REAL := [12.0, 25.0, 2.325, 87.0, 7.456, 128.0, 18(0.0)]; 7 arr2 : ARRAY [0..23] OF REAL; 8 n : UDINT; 13 xCopy: BOOL := FALSE; 29 30 32 arr3 : ARRAY [0..23] OF REAL := [12.0, 25.0, 2.325, 87.0, 7.456, 128.0, 18(0.0)]; 33 arr4 : ARRAY [0..23] OF REAL; 31 x : BOOL; 21 xMove: BOOL := FALSE; 22 4 END_VAR 1 39 Standard False 90a6d9c5-e652-47fd-87bb-6655b7d77f9c CODESYS_Control_Win_V3 PLC Logic Application -1 Automation Builder 2.1