ActuatorBridge
- Namespace
- ZApplication
The actuator bridge offers an interface to control several actuator instances, which are instantiated in the application.
It is possible to communicate through publish and subscribe structures
from external applications (i.e. HMI) or other PLCs.
In a Zeugwerk Application communication structures are instantiated in ZGlobal.com
, in general these structure should be instantiated in a location that is
accessible by external applications.
This object should offer a very basic interface to command several different actuators without any other observations or external limits. It should only be used by skilled operators because usually actuators are used inside more or less complex processes and without any checks there could be done damage on the mechanical system easily. If an operator should not use an actuator directly, it is recomended to implement separate sequences in which all necessary checks despite other sensors or systems can be done.
However, commanding an actuator without any checks can sometimes also be useful and neccessary especially in the commissioning phase of an application.
FUNCTION_BLOCK ActuatorBridge
Constructor
FB_init
In order to let the actuator bridge function correctly, it is neccessary to call its cyclic method somewhere in the application For Zeugwerk Framework application this is done by an object manager which gets initialized by providing its instance here with the parent input
METHOD FB_init (
bInitRetains : BOOL,
bInCopyCode : BOOL,
parent : ZCore.IManagedObject) : BOOL
Inputs
bInitRetains
BOOLif TRUE, the retain variables are initialized (warm start / cold start)
bInCopyCode
BOOLif TRUE, the instance afterwards gets moved into the copy code (online change)
parent
IManagedObjectInterface to the ManagedObject that is the parent of this object
Returns
- BOOL
Properties
LoadBalancer
Returns the load balancer of this bridge, which in turn can be used to adjust how the bridge updates its componeents
PROPERTY LoadBalancer : ILoadBalancer
Property Value
Methods
AddActuatorDigital
All actuator types are extending the same Base class ActuatorDigital hence it is very simple to add an actuator to this actuator bridge. This method is used to add the actuator and the communication structs for publish and subscribe communication direction.
The publish and subscribe structures have to be accessible for other applications, PLCs or also protocols like OPC-UA.
In a Zeugwerk Application communication structures are generally instantiated in ZGlobal.com
.
METHOD AddActuatorDigital (
actuator : REFERENCE TO ZEquipment.ActuatorDigital,
publish : REFERENCE TO ActuatorDigitalComPublish,
subscribe : REFERENCE TO ActuatorDigitalComSubscribe)
Inputs
actuator
REFERENCE TO ActuatorDigitalInstance of an actuator instantiated in the plc
publish
REFERENCE TO ActuatorDigitalComPublishactuator publish structure instantiated in the plc (usually separated from the actual application code like Global.com)
subscribe
REFERENCE TO ActuatorDigitalComSubscribeactuator subscribe structure instantiated in the plc (usually separated from the actual application code like Global.com)
SetLogger
Setting a logger instance allows this instance to log commands that it receives over the com interface.
Leaving this function block without a logger instance (logger=0
) disables logging for this object.
METHOD SetLogger (
logger : ZCore.ILogger)
Inputs
logger
ILoggerinterface to a logger instance