PlatformAdapterManagedObject
- Namespace
- ZPlatform
- Extends
- Inherited Properties
- Inherited Methods
- Implements
FUNCTION_BLOCK ABSTRACT PlatformAdapterManagedObject EXTENDS ZCore.ManagedObject IMPLEMENTS ZCore.IManagedObject, ZCore.IBootable, ZCore.IObject, ZCore.IError (
[output] State : ObjectState)
This functionblock extends a ManagedObject with functions that
are commonly used when building adapters around original Beckhoff function blocks that have
"cyclic behavior" (busy, error, errorId variables in the output of the function block).
Such functionblocks do not have an interface that fits nicely into the framework, but try to
achieve something similar like we handle with the Object in an object-oriented way.
Notably, this implementation overwrites Object.AbortErrorId to automatically write nice error details when aborting the object with an AdsErrorCode.
This function block should be adapted by all function blocks that are wrapped around Beckhoff function blocks.
However, in contrast to PlatformAdapterObject
it is intended for function blocks that are automatically called by a parent, which is passed
during construction of this object with FB_init.
PlatformAdapterManagedObject per default do not have a Booting phase. This is achived by setting the state to idle when the object is constructed via the object's FB_init
Constructor
FB_init
METHOD FB_init (
[input] bInitRetains : BOOL,
[input] bInCopyCode : BOOL,
[input] parent : ZCore.IManagedObject) : BOOL
Inputs
bInitRetainsBOOLif TRUE, the retain variables are initialized (warm start / cold start)
bInCopyCodeBOOLif TRUE, the instance afterwards gets moved into the copy code (online change)
parentIManagedObjectInterface to the ManagedObject that is the parent of this object
Returns
- BOOL
Methods
AbortErrorId
METHOD PROTECTED AbortErrorId (
[input] errorId : UDINT,
[input] message : ZCore.ZString)
This method aborts the Object with an error message that fits to the nErrId return of several Beckhoff function blocks. Internally, it simply maps the nErrId to an error-string-table that can be found on the AdsErrorCode enumeration site
Inputs
errorIdUDINTmessageZString(optional) gets concatenated to the errorMessage we decode out of the errorId of the original Beckhoff functionblock