IoBridge
- Namespace
- ZApplication
IO instances are created in the application context and only the PLC should read and write to these instances. However, an HMI or other external applications have to be able to read and write to IOs as well. This function block is the connection and synchronization object between IO instances and appropriate communication structs for these applications. The later may be instantiated at a location that is read & writeable by ADS and also separated from the actual IO. In the framework, communication structs are created in the Global.Com context, whereas IOs are instantiated in the MAIN context. It is not a good approach to contact these FBs directly by external applications!
This function block manages lists for all IO types ( DigitalInput ; DigitalOutput ; AnalogInput ;AnalogOutput ) that are available in the framework. Synchronization of communication structs and IO instances occures with a load balancer. Usually, HMIs do not need an update for every PLC task cycle. The load balancer can be used to adjust synchronization according to the performance needs of the actual application.
FUNCTION_BLOCK IoBridge
Constructor
FB_init
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
IManagedObject
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
AddAnalogInput
Adds an analog input to the bridge, allowing synchronization between the io instance and a communciation struct that may be accessed externally.
Note, that inputs are usually not writeable - only if the io is simulated write access is allowed. This bahavior is implemented in AnalogInput .
METHOD AddAnalogInput (
io : ZEquipment.IAnalog,
publish : REFERENCE TO AnalogComPublish,
subscribe : REFERENCE TO AnalogComSubscribe)
Inputs
io
IAnalogpublish
REFERENCE TO AnalogComPublishsubscribe
REFERENCE TO AnalogComSubscribe
AddAnalogOutput
Adds an analog output to the bridge, allowing synchronization between the io instance and a communciation struct that may be accessed externally.
METHOD AddAnalogOutput (
io : ZEquipment.IAnalog,
publish : REFERENCE TO AnalogComPublish,
subscribe : REFERENCE TO AnalogComSubscribe)
Inputs
io
IAnalogpublish
REFERENCE TO AnalogComPublishsubscribe
REFERENCE TO AnalogComSubscribe
AddDebouncedInput
Adds an debounced input to the bridge, allowing synchronization between the io instance and a communciation struct that may be accessed externally.
Note, that inputs are usually not writeable - only if the io is simulated write access is allowed. This bahavior is implemented in DigitalInput.
METHOD AddDebouncedInput (
input : ZEquipment.IDebouncedInput,
publish : REFERENCE TO DebouncedInputComPublish,
subscribe : REFERENCE TO DebouncedInputComSubscribe)
Inputs
input
IDebouncedInputpublish
REFERENCE TO DebouncedInputComPublishsubscribe
REFERENCE TO DebouncedInputComSubscribe
AddDigitalInput
Adds an digital input to the bridge, allowing synchronization between the io instance and a communciation struct that may be accessed externally.
Note, that inputs are usually not writeable - only if the io is simulated write access is allowed. This bahavior is implemented in DigitalInput .
METHOD AddDigitalInput (
io : ZEquipment.IDigital,
publish : REFERENCE TO DigitalComPublish,
subscribe : REFERENCE TO DigitalComSubscribe)
Inputs
io
IDigitalpublish
REFERENCE TO DigitalComPublishsubscribe
REFERENCE TO DigitalComSubscribe
AddDigitalOutput
Adds an digital output to the bridge, allowing synchronization between the io instance and a communciation struct that may be accessed externally.
METHOD AddDigitalOutput (
io : ZEquipment.IDigital,
publish : REFERENCE TO DigitalComPublish,
subscribe : REFERENCE TO DigitalComSubscribe)
Inputs
io
IDigitalpublish
REFERENCE TO DigitalComPublishsubscribe
REFERENCE TO DigitalComSubscribe
AddImpulseOutput
This method adds an impluse output to the bridge, allowing synchronization between the output instance and a communciation struct that may be accessed externally.
METHOD AddImpulseOutput (
impulseOutput : REFERENCE TO ZEquipment.ImpulseOutput,
publish : REFERENCE TO ImpulseOutputComPublish,
subscribe : REFERENCE TO ImpulseOutputComSubscribe)
Inputs
impulseOutput
REFERENCE TO ImpulseOutputpublish
REFERENCE TO ImpulseOutputComPublishsubscribe
REFERENCE TO ImpulseOutputComSubscribe
AddLight
Adds an light to the bridge, allowing synchronization between the io instance and a communciation struct that may be accessed externally.
Note, that inputs are usually not writeable - only if the io is simulated write access is allowed. This bahavior is implemented in DigitalInput .
METHOD AddLight (
light : REFERENCE TO ZEquipment.Light,
publish : REFERENCE TO DigitalComPublish,
subscribe : REFERENCE TO DigitalComSubscribe)
Inputs
light
REFERENCE TO Lightpublish
REFERENCE TO DigitalComPublishsubscribe
REFERENCE TO DigitalComSubscribe
AddOnOffController
Adds an OnOffController to the bridge, allowing synchronization between the controller instance and communciation structs that may be accessed externally.
METHOD AddOnOffController (
onOffController : REFERENCE TO ZEquipment.OnOffController,
publish : REFERENCE TO OnOffControllerComPublish,
subscribe : REFERENCE TO OnOffControllerComSubscribe)
Inputs
onOffController
REFERENCE TO OnOffControllerpublish
REFERENCE TO OnOffControllerComPublishsubscribe
REFERENCE TO OnOffControllerComSubscribe
AddPidController
Adds an PidController to the bridge, allowing synchronization between the controller instance and communciation structs that may be accessed externally.
METHOD AddPidController (
pidController : REFERENCE TO ZEquipment.PidController,
publish : REFERENCE TO PidControllerComPublish,
subscribe : REFERENCE TO PidControllerComSubscribe)
Inputs
pidController
REFERENCE TO PidControllerpublish
REFERENCE TO PidControllerComPublishsubscribe
REFERENCE TO PidControllerComSubscribe
AddPulsedOutput
This method adds a pulsed output to the bridge, allowing synchronization between the output instance and a communciation struct that may be accessed externally.
METHOD AddPulsedOutput (
pulsedOutput : REFERENCE TO ZEquipment.PulsedOutput,
publish : REFERENCE TO PulsedOutputComPublish,
subscribe : REFERENCE TO PulsedOutputComSubscribe)
Inputs
pulsedOutput
REFERENCE TO PulsedOutputReference to a PulsedOutput instance in the application
publish
REFERENCE TO PulsedOutputComPublishReference to the communication struct for read access to the PulsedOutput data
subscribe
REFERENCE TO PulsedOutputComSubscribeReference to the communication struct for write access to the PulsedOutput data
AddPwmController
Adds an PwmController to the bridge, allowing synchronization between the controller instance and communciation structs that may be accessed externally.
METHOD AddPwmController (
pwmController : REFERENCE TO ZEquipment.PwmController,
publish : REFERENCE TO PwmControllerComPublish,
subscribe : REFERENCE TO PwmControllerComSubscribe)
Inputs
pwmController
REFERENCE TO PwmControllerpublish
REFERENCE TO PwmControllerComPublishsubscribe
REFERENCE TO PwmControllerComSubscribe
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
ILogger