PulsedOutputAbstract
- Namespace
- ZEquipment
- Implements
FUNCTION_BLOCK ABSTRACT PulsedOutputAbstract IMPLEMENTS ZEquipment.IPulsedOutput, ZEquipment.IDigital, ZCore.ITrigger
Implements logic that is shared over indivual implementations of IPulsedOutput.
Properties
Delay
PROPERTY Delay : LREAL
Controls the start delay of the customizable signal pattern, which is the duration that is waited for before the
digital output ist set to NOT PauseState.
For details about the pattern, see PulsedOutput.
Property Value
- LREAL
Duration
PROPERTY Duration : LREAL
Controls the duration (in s) of the customizable signal pattern, which is the duration that the digital output is switched on for, before entering its pause phase (or disabled phase if group count > 0).
For details about the pattern, see PulsedOutput.
Property Value
- LREAL
Enabled
PROPERTY Enabled : BOOL
Returns TRUE if the actual output is currently set to TRUE because of an ongoing impulse or the isophase TRUE cycle.
This property can be used to run things only in phases where the output of this function block is in TRUE state
Property Value
- BOOL
Frequency
PROPERTY Frequency : LREAL
Controls the frequency (in Hz) of the customizable signal pattern. Internally, this property is related to
Duration with Duration := 0.5/Frequency.
For details about the pattern, see PulsedOutput.
Property Value
- LREAL
GroupCount
PROPERTY GroupCount : INT
Controls the group count of the customizable signal pattern, which is the number of repitions of enabled and disabled phases of the digital output before the pause duration is started.
For details about the pattern, see PulsedOutput.
Property Value
- INT
Logic
PROPERTY Logic : DigitalLogic
This property can be used to return the parametrized logic of the DigitalInput or Output and it can also be set directly
Property Value
PauseDuration
PROPERTY PauseDuration : LREAL
Controls the pause duration of the customizable signal pattern, which is the duration that is waited for between individual
repititions of enabled-disabled phases accordingly to the group count. For GroupCount=0 this property is unused.
For details about the pattern, see PulsedOutput.
Property Value
- LREAL
PauseState
PROPERTY PauseState : BOOL
Controls the pause state of the customizable signal pattern. Note that the actual signal of the pattern is the inverted pause state. For details about the pattern, see PulsedOutput.
Property Value
- BOOL
Simulation
PROPERTY Simulation : BOOL
Enables or disables the simulation of the internally instantiated DigitalOutput so it can be used without hardware. If it is set to TRUE the simulation is enabled for this PulsedOutput otherwise it will write its value to the actual link on the fieldbus.
Property Value
- BOOL
Methods
Enable
METHOD Enable (
[input] on : BOOL)
This method enables the PulsedOutput statically to the given value.
The actual state that is set on the fieldbus depends on the parametrized logic of the digital output.
Inputs
FallingTrigger
METHOD FallingTrigger () : BOOL
Often it is necessary to start an action on a falling or rising edge of an output. This method is especially created for this purpose. It Returns TRUE once, if the PulsedOutput has a falling edge on its output
Returns
- BOOL
HasTriggered
METHOD HasTriggered () : BOOL
Depending on the logic set with SetTriggerLogic this method internally calls RisingTrigger or FallingTrigger.
Returns
- BOOL
Invert
METHOD Invert ()
Because this function block is just an extension of a DigitalOutput, it can also be used as a simple output
This method toggles the output from false to true and vice-versa.
The actual state that is set on the fieldbus depends on the parameterized logic of the digital output.
IsophaseAsync
METHOD IsophaseAsync (
[input] duration : LREAL)
This method starts an isophase signal, that is defined as periodically repeating on/off cycles with a digital output,
where off phases and on phases are of equal length.
The method is a shortcut for calling PulseAsync.
Signal patterns that may have been started previously to a call this method are interrupted.
Since the function block is busy all the time, calling this method will not fail, even if the function block is already busy.
Inputs
Name
METHOD FINAL Name () : ZCore.ZString
This method returns the name that has been set with SetName
Returns
PulseAsync
METHOD PulseAsync (
[input] dutyCycle : LREAL,
[input] duration : LREAL)
This method starts a repeating cycle of on and off phases of the digital output.
The total duration of the signal can be set with the duration period parameter.
dutyCycle is used to split this duration into an on and off phase, respectively.
dutyCycle=50%means that the both phases are of equal durationdutyCycle<50%means that on phases are shorter than off phases.dutyCycle>50%means that on phases are longer than off phases.
dutyCycle is limited to the open interval (0, 100). For values greater or equal than 100 the
digital output is switched on permanently. For values smaller or equal than 0 the digital output
is switched off.
For the special case duration=0 the digital output is switched off.
Since the function block is busy all the time, calling this method will not fail, even if the function block is already busy.
Inputs
dutyCycleLREALdutyCycle of the on phase of the signal,
dutyCycle=50means that the duration of both phases are equal.durationLREALtotal duration of the signal (
onphase +offphase)
RisingTrigger
METHOD RisingTrigger () : BOOL
Returns TRUE for on call, if the output switched from TRUE to FALSE. This method
respects the logic that the digital output is parametrized with.
Returns
- BOOL
RunAsync
METHOD RunAsync (
[input] startToken : ZCore.IStartToken)
Runs the pattern that is configured the input variables of this function block. It is possible to call this method while the object is already busy (e.g. RunAsync was called before). Doing so resets the pattern to its initial phase and resets the iterator of already performed cycles to 0;
Inputs
startTokenIStartToken
SetLogger
METHOD SetLogger (
[input] logger : ZCore.ILogger)
Setting a Logger with this method enables the logging functionality of the PulsedOutput function block.
Setting logger=0 deactivates logging, which might be useful for PulsedOutput, because these
function blocks can easily spam the logger with (unimportant) messages.
Note
To change the logging behaviour it is sometimes useful to inject a LoggerNameDecorator here.
Inputs
loggerILoggerinterface of a logger instance or a logger decorator instance
SetLogic
METHOD SetLogic (
[input] logic : DigitalLogic)
According to the process or the used hardware some inputs are high- or low active.
To standardize this, all digital in- and outputs have the functionality to abstract this behaviour.
Inputs
logicDigitalLogiclogic of the input, available types normal and inverted
SetName
METHOD SetName (
[input] name : ZCore.ZString)
Usually logging should not be used for outputs, because some of them are switched very often which leads to a high logging load. To differentiate between all those outputs they have to be initialized with a name. A name should not be longer than about 30 characters and should be used according to the name in an electrical plan of your automation project to be able to identify the corresponding input properly.
Inputs
nameZStringname of the Pulsed output as STRING, should not be longer than 30 characters
SetSimulation
METHOD SetSimulation (
[input] on : BOOL)
Enables or disables the simulation of the internally instantiated DigitalOutput so it can be used without hardware. If it is set to TRUE the simulation is enabled for this PulsedOutput otherwise it will write its value to the actual link on the fieldbus.
Inputs
SetTriggerLogic
METHOD SetTriggerLogic (
[input] logic : DigitalLogic)
This method controls the logic of the HasTriggered method
Inputs
logicDigitalLogiclogic of the digital output, available types normal and inverted
Stop
METHOD Stop ()
Signal patterns that may have been started previously are interrupted immediately.
The state of the digital output is not changed by calling this method. It remains in the state it was previously.