IoBridge
- Namespace
- ZApplication
FUNCTION_BLOCK IoBridge
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.
Constructor
FB_init
METHOD FB_init (
[input] bInitRetains : BOOL,
[input] bInCopyCode : BOOL,
[input] parent : ZCore.IManagedObject) : BOOL
Inputs
bInitRetainsBOOLif TRUE, the retain variables are initialized (warm start / cold start)
bInCopyCodeBOOLif TRUE, the instance afterwards gets moved into the copy code (online change)
parentIManagedObject
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
Methods
AddAnalogInput
METHOD AddAnalogInput (
[input] io : ZEquipment.IAnalog,
[input] publish : REFERENCE TO AnalogComPublish,
[input] subscribe : REFERENCE TO AnalogComSubscribe)
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 .
Inputs
ioIAnalogpublishREFERENCE TO AnalogComPublishsubscribeREFERENCE TO AnalogComSubscribe
AddAnalogOutput
METHOD AddAnalogOutput (
[input] io : ZEquipment.IAnalog,
[input] publish : REFERENCE TO AnalogComPublish,
[input] subscribe : REFERENCE TO AnalogComSubscribe)
Adds an analog output to the bridge, allowing synchronization between the io instance and a communciation struct that may be accessed externally.
Inputs
ioIAnalogpublishREFERENCE TO AnalogComPublishsubscribeREFERENCE TO AnalogComSubscribe
AddDebouncedInput
METHOD AddDebouncedInput (
[input] input : ZEquipment.IDebouncedInput,
[input] publish : REFERENCE TO DebouncedInputComPublish,
[input] subscribe : REFERENCE TO DebouncedInputComSubscribe)
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.
Inputs
inputIDebouncedInputpublishREFERENCE TO DebouncedInputComPublishsubscribeREFERENCE TO DebouncedInputComSubscribe
AddDigitalInput
METHOD AddDigitalInput (
[input] io : ZEquipment.IDigital,
[input] publish : REFERENCE TO DigitalComPublish,
[input] subscribe : REFERENCE TO DigitalComSubscribe)
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 .
Inputs
ioIDigitalpublishREFERENCE TO DigitalComPublishsubscribeREFERENCE TO DigitalComSubscribe
AddDigitalOutput
METHOD AddDigitalOutput (
[input] io : ZEquipment.IDigital,
[input] publish : REFERENCE TO DigitalComPublish,
[input] subscribe : REFERENCE TO DigitalComSubscribe)
Adds an digital output to the bridge, allowing synchronization between the io instance and a communciation struct that may be accessed externally.
Inputs
ioIDigitalpublishREFERENCE TO DigitalComPublishsubscribeREFERENCE TO DigitalComSubscribe
AddImpulseOutput
METHOD AddImpulseOutput (
[input] impulseOutput : REFERENCE TO ZEquipment.ImpulseOutput,
[input] publish : REFERENCE TO ImpulseOutputComPublish,
[input] subscribe : REFERENCE TO ImpulseOutputComSubscribe)
This method adds an impluse output to the bridge, allowing synchronization between the output instance and a communciation struct that may be accessed externally.
Inputs
impulseOutputREFERENCE TO ImpulseOutputpublishREFERENCE TO ImpulseOutputComPublishsubscribeREFERENCE TO ImpulseOutputComSubscribe
AddLight
METHOD AddLight (
[input] light : REFERENCE TO ZEquipment.Light,
[input] publish : REFERENCE TO DigitalComPublish,
[input] subscribe : REFERENCE TO DigitalComSubscribe)
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 .
Inputs
lightREFERENCE TO LightpublishREFERENCE TO DigitalComPublishsubscribeREFERENCE TO DigitalComSubscribe
AddOnOffController
METHOD AddOnOffController (
[input] onOffController : REFERENCE TO ZEquipment.OnOffController,
[input] publish : REFERENCE TO OnOffControllerComPublish,
[input] subscribe : REFERENCE TO OnOffControllerComSubscribe)
Adds an OnOffController to the bridge, allowing synchronization between the controller instance and communciation structs that may be accessed externally.
Inputs
onOffControllerREFERENCE TO OnOffControllerpublishREFERENCE TO OnOffControllerComPublishsubscribeREFERENCE TO OnOffControllerComSubscribe
AddPidController
METHOD AddPidController (
[input] pidController : REFERENCE TO ZEquipment.PidController,
[input] publish : REFERENCE TO PidControllerComPublish,
[input] subscribe : REFERENCE TO PidControllerComSubscribe)
Adds an PidController to the bridge, allowing synchronization between the controller instance and communciation structs that may be accessed externally.
Inputs
pidControllerREFERENCE TO PidControllerpublishREFERENCE TO PidControllerComPublishsubscribeREFERENCE TO PidControllerComSubscribe
AddPulsedOutput
METHOD AddPulsedOutput (
[input] pulsedOutput : REFERENCE TO ZEquipment.PulsedOutput,
[input] publish : REFERENCE TO PulsedOutputComPublish,
[input] subscribe : REFERENCE TO PulsedOutputComSubscribe)
This method adds a pulsed output to the bridge, allowing synchronization between the output instance and a communciation struct that may be accessed externally.
Inputs
pulsedOutputREFERENCE TO PulsedOutputReference to a PulsedOutput instance in the application
publishREFERENCE TO PulsedOutputComPublishReference to the communication struct for read access to the PulsedOutput data
subscribeREFERENCE TO PulsedOutputComSubscribeReference to the communication struct for write access to the PulsedOutput data
AddPwmController
METHOD AddPwmController (
[input] pwmController : REFERENCE TO ZEquipment.PwmController,
[input] publish : REFERENCE TO PwmControllerComPublish,
[input] subscribe : REFERENCE TO PwmControllerComSubscribe)
Adds an PwmController to the bridge, allowing synchronization between the controller instance and communciation structs that may be accessed externally.
Inputs
pwmControllerREFERENCE TO PwmControllerpublishREFERENCE TO PwmControllerComPublishsubscribeREFERENCE TO PwmControllerComSubscribe
SetLogger
METHOD SetLogger (
[input] logger : ZCore.ILogger)
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.
Inputs
loggerILogger