plc4good.org.ua

S7:




sfc51



.
- , HMI . . , .
, , , , .



SCL



FUNCTION_BLOCK FB99
TITLE = 'check size program change'
AUTHOR : komatic
 
VAR
SZL_HEADER : STRUCT
LENTHDR : WORD := W#16#24;
N_DR : WORD := W#16#1;
END_STRUCT ;
 
Data : STRUCT
Index : WORD ;
Code : WORD ;
Size : DINT ;
Mode : WORD ;
Granu : WORD ;
RAM_Data_Size : DINT ;
RAM_Data_Occupy : DINT ; // actual size in memory
RAM_Data_Free : DINT ;
RAM_CODE_Size : DINT ;
RAM_CODE_Occupy : DINT ;
RAM_CODE_Free : DINT ;
END_STRUCT ;
 
 
RET_V : INT ;
BUSY : BOOL ;
Size_previous : DINT ;

END_VAR
 
VAR_IN_OUT out : BOOL; END_VAR;
 
RET_V:=RDSYSST( REQ := true
,SZL_ID := W#16#13
,INDEX := W#16#1
,BUSY := BUSY
,SZL_HEADER := SZL_HEADER
,DR := Data
);
 
IF Data.RAM_Data_Occupy<>Size_previous THEN out:=true; END_IF;
 
Size_previous:=Data.RAM_Data_Occupy;
 

END_FUNCTION_BLOCK



LAD

sfc51
M10.1 = 1 -

:



, / SFC22 / 23, .
Compress Memory -
(: I0.0 1.0, ) ,



- 1500 ?



sfc51
- SFC51 TIA,
- . :(