FB_LimitMemory
The class analyzes the size of files in a directory. By setting limits, the files can be cleaned up as required by deleting the oldest variants.
Syntax:
FUNCTION_BLOCK FB_LimitMemory EXTENDS FB_Base
Properties
Name | Type | Access | Initial value | Description |
---|---|---|---|---|
Name | STRING | Get, Set | <SourceName> | Specifies the name of the class instance. |
FB_LimitMemory | ||||
Busy | BOOL | Get | FALSE | The function is currently being executed. |
Done | BOOL | Get | FALSE | The execution was successful. |
ErrorId | UDINT | Get | FALSE | ADS error code of the error that has occurred. |
Filter | Get, Set | ‘‘ | File filter that can contain placeholders (* and ?). | |
LimitsExceeded | BOOL | Get | FALSE | The check has shown that the set limits have been exceeded. |
MaxFiles | UDINT | Get, Set | 0 | Maximum number of files in the directory. |
MaxMemory | LREAL | Get, Set | 0 [MB] | Maximum memory size of the files in the directory. |
MemorySize | LREAL | Get | 0 [MB] | Current memory size of the files in the directory. |
NetId | Get, Set | [0,0,0,0,0,0] | AMS (ADS) network ID | |
NetIdString | Get, Set | ‘0.0.0.0.0.0‘ | AMS (ADS) network ID | |
NumFiles | UDINT | Get | 0 | Current number of files in the directory. |
Path | Get | ‘‘ | Path to the target directory. | |
Timeout | LREAL | Get, Set | 0.0 [s] | Time-out period of the system response of this function. |
FB_Base | ||||
BaseState | Get | eNotHandled | Initialization state of the class instance. | |
Error | BOOL | Get | FALSE | Class is in an error state. |
ResultMessage | Get | - | Access to the class-internal EventLogger. | |
[ | STRING | Get | <SourceName> |
|
Methods
Name | Description |
---|---|
Reset() | Resets the error state of the class. |
FB_LimitMemory | |
Check( | Checks the size of the directory. |
CheckWithClean( | Triggers the commands |
Clean( | Cleans up the excess, starting with the oldest files. |
FB_Base | |
SetHMI( | General assignment method for an FB_BaseHmi extending class. |
[ | Extracts the first part of the instance path as an object namespace. |
[ | Extracts the last part of the instance path as the object name. |
Cycle methods
Name | Description |
---|---|
Cyclic() | Cycle method |
Procedure controlling methods (FB_AdaptableSequence)
Name | Description |
---|---|
Procedure for executing the file check and cleanup. |
Interfaces
Type | Description |
---|---|
I_Base | Standard interface on FB_Base. |
I_LimitMemory | Standard interface on FB_LimitMemory. |
I_BaseEmpty | For extension without standard interface. |
I_BaseDev | Covers all methods and properties of the base class. |
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT >= v3.1.4024.54 (recommended) | PC or CX (x64, x86) | Tc3_PlasticBaseApplication (>= v3.12.7.0) |