AxisBridge
- Namespace
- ZApplication
- Implements
The axis bridge offers an interface to control several axis 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 offers a basic interface to control several different axes without any other observations or external limits. It should only be used by skilled operators because usually axes are used inside more or less complex processes and without any checks there could be done damage on the mechanical and electrical system easily. If an operator should not use an axis directly, it is recomended to implement separate sequences in which all necessary checks despite other sensors or systems can be done.
However, commanding and controlling an axis without any checks can sometimes also be useful and neccessary especially in the commissioning phase of an application.
Interface to build a bridge between communication interfaces (AxisComPublish and AxisComSubscribe)
and an implementation of an Axis/Drive. Not all axis implementation implement all features that the Zeugwerk Framework implements. Most
notably, Vfd drives usually do not implement positioning interfaces.
Use the "With methods" to build a control instance in the following way. In the following example the actual datatype of axis
refers to a specific implementation, which
implements all features of the Framework. Note that some calls to With may not be supported for the specific implementation that you are using. In the latter case
remove the relevant `"With methods".
_axis1 : ZExperimental.AxisLenzei950;
-----------------------------------
_axisBridge.WithAbsolute(_axis1)
.WithBrake(_axis1)
.WithHoming(_axis1)
.WithFeedbackCurrent(_axis1).WithFeedbackVelocity(_axis1).WithFeedbackPosition(_axis1)
.WithMoveCurrent(_axis1).WithMoveVelocity(_axis1) .WithMovePosition(_axis1)
.AddAxis(_axis1, _parent._com._axis1.publish, _parent._com._axis1.subscribe);
FUNCTION_BLOCK AxisBridge IMPLEMENTS ZApplication.IAxisBridgeBuilder
Constructor
FB_init
In order to let the axis 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 a valid parent, which usually forwards this instance to an ObjectManager
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
AddAxis
This method adds a manually controlable axis to the axis bridge. Note that different axis types are providing different actions (e.g. moving velocity controlled, moving position controlled, homing, torque control, ...) use the With Methods of this object to setup the instance correctly (see IAxisBridgeBuilder
For example a simple stepper motor will not have the ability for a torque controlled movement so for a stepper implementation the IAxisMoveCurrent interface is usually not available and so, WithMoveCurrent can not be called for said implementation.
The publish and subscribe should be accessible for other applications, PLCs or also protocols like OPC-UA in order to control axis
over the publish
& subscribe
structures.
In a Zeugwerk Application communication structures are generally instantiated in ZGlobal.com
.
If any of the passed references is invalid, the axis is not added to the axis bridge.
METHOD AddAxis (
axis : REFERENCE TO ZEquipment.Axis,
publish : REFERENCE TO AxisComPublish,
subscribe : REFERENCE TO AxisComSubscribe)
Inputs
axis
REFERENCE TO Axisprovides a basic axis instance with all its status and actions which are implemented for all axis types
publish
REFERENCE TO AxisComPublishaxis publish structure instantiated somewhere in the plc (usually separated from the actual application code like Global.com)
subscribe
REFERENCE TO AxisComSubscribeaxis subscribe structure instantiated in the plc (usually separated from the actual application code like Global.com)
AddAxisPlcOpenMc
convenient method to add this specific type of axis, see AddAxis for detailed information on how to add an axis to this function block This method is a shortcut for calling
_axisBridge.WithHoming(axis)
.WithMovePosition(axis)
.WithMoveVelocity(axis)
.WithHalt(axis)
.WithVelocityFeedrate(axis)
.WithFeedbackPosition(axis)
.WithFeedbackVelocity(axis)
.WithFeedbackCurrent(axis)
.AddAxis(axis := axis,
publish := publish,
subscribe := subscribe);
METHOD AddAxisPlcOpenMc (
axis : REFERENCE TO ZEquipment.AxisPlcOpenMc,
publish : REFERENCE TO AxisComPublish,
subscribe : REFERENCE TO AxisComSubscribe)
Inputs
axis
REFERENCE TO AxisPlcOpenMcprovides zeugwerk plc open compatible axis instance with all its status and actions which are implemented for this specifix axis types
publish
REFERENCE TO AxisComPublishaxis publish structure instantiated somewhere in the plc (usually separated from the actual application code like Global.com)
subscribe
REFERENCE TO AxisComSubscribeaxis subscribe structure instantiated in the plc (usually separated from the actual application code like Global.com)
AddAxisSimulated
convenient method to add this specific type of axis, see AddAxis for detailed information on how to add an axis to this function block This method is a shortcut for calling
_axisBridge.WithHoming(axis)
.WithMovePosition(axis)
.WithMoveVelocity(axis)
.WithHalt(axis)
.WithVelocityFeedrate(axis)
.WithFeedbackPosition(axis)
.WithFeedbackVelocity(axis)
.WithFeedbackCurrent(axis)
.WithHalt(axis)
.AddAxis(axis := axis,
publish := publish,
subscribe := subscribe);
METHOD AddAxisSimulated (
axis : REFERENCE TO ZEquipment.AxisSimulated,
publish : REFERENCE TO AxisComPublish,
subscribe : REFERENCE TO AxisComSubscribe)
Inputs
axis
REFERENCE TO AxisSimulatedprovides zeugwerk plc open compatible axis instance with all its status and actions which are implemented for this specifix axis types
publish
REFERENCE TO AxisComPublishaxis publish structure instantiated somewhere in the plc (usually separated from the actual application code like Global.com)
subscribe
REFERENCE TO AxisComSubscribeaxis 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 ultimately forwards to an axis.
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
WithAbsolute
METHOD WithAbsolute (
absolute : ZEquipment.IAxisAbsolute) : IAxisBridgeBuilder
Inputs
absolute
IAxisAbsoluteInterface to an implementation with an absolute encoder
Returns
WithBrake
METHOD WithBrake (
brake : ZEquipment.IAxisBrake) : IAxisBridgeBuilder
Inputs
brake
IAxisBrakeInterface to close/open a brake of an axis
Returns
WithFeedbackCurrent
METHOD WithFeedbackCurrent (
feedbackCurrent : ZEquipment.IAxisFeedbackCurrent) : IAxisBridgeBuilder
Inputs
feedbackCurrent
IAxisFeedbackCurrentCurrent feedback
Returns
WithFeedbackPosition
METHOD WithFeedbackPosition (
feedbackPosition : ZEquipment.IAxisFeedbackPosition) : IAxisBridgeBuilder
Inputs
feedbackPosition
IAxisFeedbackPositionPosition feedback
Returns
WithFeedbackVelocity
METHOD WithFeedbackVelocity (
feedbackVelocity : ZEquipment.IAxisFeedbackVelocity) : IAxisBridgeBuilder
Inputs
feedbackVelocity
IAxisFeedbackVelocityVelocity feedback
Returns
WithHalt
METHOD WithHalt (
halt : ZEquipment.IAxisHalt) : IAxisBridgeBuilder
Inputs
halt
IAxisHaltprovides an interface to the axis halt function
Returns
WithHoming
METHOD WithHoming (
homing : ZEquipment.IAxisHoming) : IAxisBridgeBuilder
Inputs
homing
IAxisHomingprovides an interface to the axis homing functions
Returns
WithMoveCurrent
METHOD WithMoveCurrent (
current : ZEquipment.IAxisMoveCurrent) : IAxisBridgeBuilder
Inputs
current
IAxisMoveCurrentprovides an interface to the axis move current function
Returns
WithMovePosition
METHOD WithMovePosition (
position : ZEquipment.IAxisMovePosition) : IAxisBridgeBuilder
Inputs
position
IAxisMovePositionprovides an interface to the axis move position function
Returns
WithMoveVelocity
METHOD WithMoveVelocity (
velocity : ZEquipment.IAxisMoveVelocity) : IAxisBridgeBuilder
Inputs
velocity
IAxisMoveVelocityprovides an interface to the axis move velocity function
Returns
WithVelocityFeedrate
METHOD WithVelocityFeedrate (
velocityFeedrate : ZEquipment.IAxisVelocityFeedrate) : IAxisBridgeBuilder
Inputs
velocityFeedrate
IAxisVelocityFeedrateprovides an interface to the axis velocity feedrate function