FB_ProductionCounter
Implements a general counter for production-dependent data such as a piece counter or a production time counter.
Syntax:
FUNCTION_BLOCK FB_ProductionCounter EXTENDS FB_BaseMd
Properties
Name | Type | Access | Initial value | Description |
---|---|---|---|---|
Name | STRING | Get, Set | <SourceName> | Specifies the name of the class instance. |
FB_ProductionCounter | ||||
SavingInterval | LREAL | Get, Set | 10.0 [min] | Interval for saving the counter value in a machine data file. |
SinceLastReset | Get | - | Counter value since the last execution of the Reset() method. | |
SinceProducing | Get | - | Counter value since the start of the current counting process. | |
SinceStart | Get | - | Counter value since machine start. | |
Total | Get | - | Counter value since the beginning of the machine production time. | |
FB_BaseMd | ||||
MachineData | Get | - | Interface for machine data handling. | |
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_ProductionCounter | |
NewPart( | Logs a new part for the part counter. |
Producing( | Indicates that production is actively running. |
FB_BaseMd | |
[ | Adds a component of type I_MdComponent to the machine data container. |
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 - Call once per PLC cycle (default 10 ms) |
Machine data
Component | Description | Index range | Number of instances |
---|---|---|---|
File information | 0x0000 Fxxx | 1 | |
Counter | 0x0010 8xxx | 2 |
Interfaces
Type | Description |
---|---|
I_Base | Standard interface on FB_Base. |
I_ProductionCounter | Standard interface on FB_ProductionCounter. |
I_BaseMd | Standard interface on FB_BaseMd. |
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.35 | PC or CX (x64, x86) | Tc3_PlasticBaseApplication (>= v3.12.5.0) |