Table of Contents

PlatformAdapterObject

Namespace
ZPlatform
Extends
Inherited Properties
Inherited Methods
Implements
FUNCTION_BLOCK ABSTRACT PlatformAdapterObject EXTENDS ZCore.Object IMPLEMENTS ZCore.IObject, ZCore.IError (
 [output] State : ObjectState)

This functionblock extends an Object 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 PlatformAdapterManagedObject it is intended for function blocks that do not have to be called cyclically and so automatically by a parent.

PlatformAdapterObject per default do not have a Booting phase. This is achived by settting 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) : BOOL

Inputs

bInitRetains BOOL

if TRUE, the retain variables are initialized (warm start / cold start)

bInCopyCode BOOL

if TRUE, the instance afterwards gets moved into the copy code (online change)

Returns

BOOL

Methods

AbortErrorId

METHOD PROTECTED AbortErrorId (
 [input] errorId : UDINT,
 [input] message : ZCore.ZString)

Inputs

errorId UDINT
message ZString

(optional) gets concatenated to the errorMessage we decode out of the errorId of the original Beckhoff functionblock