a b/Shared Memory Example/Device/Plc Logic/Application/PLC_PRG/svnobj
1
Gx_l!0…jüonõâ£é(zý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}
2
TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}Id
longTagTextTIF hSharedMemory = RTS_INVALID_HANDLE THEN> // not open. so create or openŒ    hSharedMemory := SysSharedMemoryCreate( pszName := sSharedMemoryName,„                                ulPhysicalAddress := 0 (* NULL means OS can choose *), \                                 pulSize := ADR(uiSharedMemorySize),F                                 pResult := ADR(result));x IF result = Errors.ERR_DUPLICATE (* from CmpErrors *)  THEN:      xShmAlreadyExisted := TRUE;   ELSE <      xShmAlreadyExisted := FALSE; END_IFEND_IFVIF hSharedMemory <> RTS_INVALID_HANDLE THENº    pabSharedMemory := SysSharedMemoryGetPointer(hShm := hSharedMemory, pResult := ADR(result));x uiBytesRead := SysSharedMemoryRead(    hShm   := hSharedMemory, .                           ulOffset   := 0,!H                           pbyData    := ADR(uiCounter),"L                         ulSize      := SIZEOF(uiCounter),#D                           pResult    := ADR(result));$8 uiCounter := uiCounter + 1;%   &€    uiBytesWritten := SysSharedMemoryWrite(    hShm   := hSharedMemory,'2                                 ulOffset   := 0,(L                                 pbyData    := ADR(uiCounter),)P                               ulSize      := SIZEOF(uiCounter),*H                                 pResult    := ADR(result));+$IF xDeleteShm THEN,X   SysSharedMemoryDelete(hShm:=hSharedMemory);-H   hSharedMemory := SINT_TO_DWORD(-1);.Interface/L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}0PROGRAM PLC_PRG1VAR2¦    hSharedMemory       : RTS_IEC_HANDLE := RTS_INVALID_HANDLE (* SysTypes2 Inerfaces *) ;3p result           : RTS_IEC_RESULT (* SysTypes2 Inerfaces *) ;4^ sSharedMemoryName : STRING := 'CodesysShared';5Ž    uiCounter       : UINT; // the value-buffer where to copy from shm goes to6| uiSharedMemorySize   : UINT := SIZEOF(uiCounter) (* 2 bytes *);7ž    xShmAlreadyExisted  : BOOL; // indicates whether the shm was created or opened82 uiBytesRead       : __UXINT;96 uiBytesWritten      : __UXINT;:°    pabSharedMemory    : POINTER TO ARRAY[0..(64-1)] OF BYTE (* pointer to shared memory *) ;;l xDeleteShm : BOOL; // triggers deleting shared memory<END_VAR="UniqueIdGenerator>61?POULevel@L{8e575c5b-1d37-49c6-941b-5c0ec7874787}AStandardB ChildObjectGuidsC8System.Collections.ArrayListD,AddAttributeSubsequentEboolÐÐ-ÐÐ    E
3
$ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­   ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­
ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­ÚÐ-ÐÐ
­!ÚÐ- ÐÐ
­"ÚÐ-!ÐÐ
­#ÚÐ-"ÐÐ
­$ÚÐ-#ÐÐ
­&ÚÐ-ÐÐ
­ ÚÐ-$ÐÐ
­'ÚÐ-%ÐÐ
­+ÚÐ-&ÐÐ
­,ÚÐ-'ÐÐ
­-ÚÐ-(ÐÐ
­.ÚÐ-)ÐÐ
­*ÚÐ-*ÐÐ
­ÚÐ-ÐÐ
­8ÚÐ-ÐÐ
­7ÚÐ-+ÐÐ
­ÚÐ-,ÐÐ
­;ÚÐ--ÐÐ
­9ÚÐ-Ð./Ð E
4
ÐÐ
­ÚÐ-0ÐÐ
­ÚÐ-1ÐÐ
­ÚÐ-2ÐÐ
­ÚÐ-3ÐÐ
­5ÚÐ-4ÐÐ
­6ÚÐ-5ÐÐ
­4ÚÐ-6ÐÐ
­
5
ÚÐ-7ÐÐ
­%ÚÐ-8ÐÐ
­)ÚÐ-9ÐÐ
­ÚÐ-:ÐÐ
­<ÚÐ-%ÐÐ
­=ÚÐ-;ÐÐ
­ÚÐ-<Ð=->Ð?@-ABCÐDE­