IObject
- Namespace
- ZCore
IObject is the heart of the Zeugwerk Framework. The central feature of the interface are methods to indicate the operation state of a framework object. At its core theses states are the foundation of all sequences within the framework. Almost all classes (aka functionblocks) in the framework use these states to propagate within sequences.
Every object can be in one of the following states.
- Booting intially after the PLC (re-)starts and an object still has to perform its initialization phase (i.e. waiting for hardware, a connection, ...) the object is in the booting state. In this case the object isBusy and has no error. The ErrorMessage method may still show a message, but in this state this message is invalid.
- BootingError when the initialization phase fails an object will trigger a transition from booting to bootingError. This usally indicates a configuration or hardware error. The exact reason for the error can be retrieved by the ErrorMessage methods.
- Idle this state indicates that an object is ready to start a (new) sequence. The object is not busy, does not have an error. The ErrorMessage methods may still show a message, but in this state this message is invalid.
- Busy this state indicates that an object is executing a sequence. The ErrorMessages method may still show a message, but in this state this message is invalid.
- Error an object is in this state if the initialization phase succeeded, but a sequence failed. The exact reason for the error can be retrieved by the ErrorMessages or ErrorMessageRef method.
There are some helper methods to check for a specific state of an object, which are summerized in the following table.
State | Busy | Done | Error |
---|---|---|---|
Booting | TRUE | FALSE | FALSE |
BootingError | FALSE | FALSE | TRUE |
Idle | FALSE | TRUE | FALSE |
Busy | TRUE | FALSE | FALSE |
Error | FALSE | FALSE | TRUE |
INTERFACE IObject EXTENDS ZCore.IError
- Extends
- Inherited Properties
- Inherited Methods
Properties
Busy
This property returns TRUE
if the object is Busy executing a sequence or still in its
initialization phase (if applicable). It returns FALSE
if the object is Idle or in an
Error state.
PROPERTY Busy : BOOL
Property Value
- BOOL
Done
If the object is in idle state (often mentioned as "the object is not busy and not on error"),
this is indicated by this property returning TRUE
.
PROPERTY Done : BOOL
Property Value
- BOOL
Error
If the object aborts its execution with an error, this is indicated by this property returning TRUE
.
Information about the error may be retrieved by utilizing the methods that are implemented from the
IError.
Returns TRUE
if a fault occured within a sequence or the initialization phase
of an object, respectively. If this property returns TRUE
, use
to get insights about the origin of the fault.
PROPERTY Error : BOOL
Property Value
- BOOL
Methods
ErrorSource
This method returns the direct error source of this object. This method can then be used to retrieve the actual error source by using the method of the returned IError.
METHOD ErrorSource () : IError