FUNCTION_BLOCK AS_MemTITLE='Single AS 41x-5H-1H read memory used'NAME:AS_MemFAMILY:DiagnoseAUTHOR:NCLVERSION:'1.0'KNOW_HOW_PROTECT// Typical-Attribute{S7_bIockview:='big'} VAR_INPUTUpdOp:BOOL;UpdAutCyc:DINT:=DINT#100; END_VARVAR_OUTPUTWorkMemoryDataTotal{S7_dynamic:='true' }:DINT;WorkMemoryDataUsed{S7_dynamic:='true'}:DINT;WorkMemDataUsedPersent{S7_dynamic:='true'}:REAL;WorkMemoryCodeTotal{S7_dynamic:='true' }:DINT;WorkMemoryCodeUsed{S7_dynamic:='true' }:DINT;WorkMemCodeUsedPersent{S7_dynamic:='true' }:REAL;END_VARVARiRunUpCyc : INT :=10; //Counter for Run up cyclic iErrCode : INT ; //RET_VAL parameter caintains an error codexBusy : BOOL ; //Reading no yet doneReq :BOOL;SZL_HEADER : STRUCT //LENTHDR is the length of a data record of the SSL list or the SSL partial list LENTHDR : WORD ; //W#16#0010: One data record is 8 words long (16 bytes) N_DR : WORD ; //W#16#0001: Number of data records END_STRUCT ; SZL_ID : WORD := W#16#00; //SSL-ID of the system status list or partial list to be readINDEX : WORD := W#16#00; //Type or number of an object in a partial list. DR_Memory:STRUCT Index:WORD;//Index of a memory area W#16#0001: work memory Code:WORD; // Memory type:W#16#0001: volatile memory (RAM) W#16#0002: non-volatile memory (FEPROM) W#16#0003: mixed memory (RAM + FEPROM) Size:DINT; //Total Size of the selected memory Mode:WORD; //bit0=RAM(volatile memory) ,bit1 =FEPROM (non-volatile memory),bit2=Mixed memory (RAM+FEPROM),bit3= code and data separate,bit4=Bit 4: code and