Table of Contents

FieldbusBridge

Namespace
ZApplication
FUNCTION_BLOCK FieldbusBridge

The fieldbus bridge offers an interface to control several ethercat master 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 application.

This object is often needed for diagnosing ethercat-fieldbus issues like crc errors or faulty ethercat slaves.

Constructor

FB_init

METHOD FB_init (
 [input] bInitRetains : BOOL,
 [input] bInCopyCode : BOOL,
 [input] parent : ZCore.IManagedObject) : BOOL

In order to let the fieldbus 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

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)

parent IManagedObject

Interface to a valid parent, which usually forwards this instance to an ObjectManager

Returns

BOOL

Properties

LoadBalancer

PROPERTY LoadBalancer : ILoadBalancer

Returns the load balancer of this bridge, which in turn can be used to adjust how the bridge updates its componeents

Property Value

ILoadBalancer

Methods

AddEthercatMaster

METHOD AddEthercatMaster (
 [input] ethercatMasterRef : REFERENCE TO ZEquipment.EthercatMaster,
 [input] publishRef : REFERENCE TO EthercatMasterComPublish,
 [input] subscribeRef : REFERENCE TO EthercatMasterComSubscribe)

Inputs

ethercatMasterRef REFERENCE TO EthercatMaster

Instance of an ethercat master instantiated in the plc

publishRef REFERENCE TO EthercatMasterComPublish

ethercat master publish structure instantiated in the plc (usually separated from the actual application code like Global.com)

subscribeRef REFERENCE TO EthercatMasterComSubscribe

ethercat master subscribe structure instantiated in the plc (usually separated from the actual application code like Global.com)

SetLogger

METHOD SetLogger (
 [input] logger : ZCore.ILogger)

Setting a logger instance allows this instance to log commands that it ultimately forwards to an ethercat master. Leaving this function block without a logger instance (logger=0) disables logging for this object.

Inputs

logger ILogger

interface to a logger instance

SetSynchronizationPeriod

METHOD SetSynchronizationPeriod (
 [input] ethercatMasterIndex : INT,
 [input] timeout : LREAL)

This method can be used to adjust how often the ethercat master should refresh the statistical data, which is provided in its communication publish struct. This method can be used to distribute load, if there are a lot of ethercat master instances configured. The index of the first ethercat master that has been added to the bridge with AddEthercatMaster is 0.

To change the synchronization period of all ethercat masters, use SetSynchronizationPeriodAll.

Inputs

ethercatMasterIndex INT

selected ethercat master. Valid from 0 to (MaxEthercatMasterCount)[xref:ZApplication.ParameterList#MaxEthercatMasterCount]

timeout LREAL

period between data refreshs

SetSynchronizationPeriodAll

METHOD SetSynchronizationPeriodAll (
 [input] timeout : LREAL)

This method can be used to adjust how often the ethercat masters that have been added to this bridge, should refresh their statistical data. The later is provided in its communication publish struct. This method can be used to distribute load, if there are a lot of ethercat master instances configured.

To change the synchronization period of a distinct ethercat masters, use SetSynchronizationPeriod

Inputs

timeout LREAL

period between data refreshs