Table of Contents

PulsedOutputAbstract

Namespace
ZEquipment
Implements

Implements logic that is shared over indivual implementations of IPulsedOutput.

FUNCTION_BLOCK ABSTRACT PulsedOutputAbstract IMPLEMENTS ZEquipment.IPulsedOutput, ZEquipment.IDigital, ZCore.ITrigger

Properties

Delay

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 Delay : LREAL

Property Value

LREAL

Duration

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 Duration : LREAL

Property Value

LREAL

Enabled

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 Enabled : BOOL

Property Value

BOOL

Frequency

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 Frequency : LREAL

Property Value

LREAL

GroupCount

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 GroupCount : INT

Property Value

INT

PauseDuration

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 PauseDuration : LREAL

Property Value

LREAL

PauseState

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 PauseState : BOOL

Property Value

BOOL

Simulation

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 Simulation : BOOL

Property Value

BOOL

Methods

Enable

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.

METHOD Enable (
 on : BOOL)

Inputs

on BOOL

on=TRUE ... enables the output, on=FALSE ... disables the output

FallingTrigger

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

METHOD FallingTrigger () : BOOL

Returns

BOOL

HasTriggered

Depending on the logic set with SetTriggerLogic this method internally calls RisingTrigger or FallingTrigger.

METHOD HasTriggered () : BOOL

Returns

BOOL

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.

METHOD Invert ()

IsophaseAsync

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.

METHOD IsophaseAsync (
 duration : LREAL)

Inputs

duration LREAL

period of the pwm signal as LREAL variable in seconds

Name

This method returns the name that has been set with SetName

METHOD FINAL Name () : ZCore.ZString

Returns

ZString

PulseAsync

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 duration
  • dutyCycle<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.

METHOD PulseAsync (
 dutyCycle : LREAL,
 duration : LREAL)

Inputs

dutyCycle LREAL

dutyCycle of the on phase of the signal, dutyCycle=50 means that the duration of both phases are equal.

duration LREAL

total duration of the signal (on phase + off phase)

RisingTrigger

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.

METHOD RisingTrigger () : BOOL

Returns

BOOL

RunAsync

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;

METHOD RunAsync (
 startToken : ZCore.IStartToken)

Inputs

startToken IStartToken

SetLogger

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.

METHOD SetLogger (
 logger : ZCore.ILogger)

Inputs

logger ILogger

interface of a logger instance or a logger decorator instance

SetLogic

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.

METHOD SetLogic (
 logic : DigitalLogic)

Inputs

logic DigitalLogic

logic of the input, available types normal and inverted

SetName

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.

METHOD SetName (
 name : ZCore.ZString)

Inputs

name ZString

name of the Pulsed output as STRING, should not be longer than 30 characters

SetSimulation

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.

METHOD SetSimulation (
 on : BOOL)

Inputs

on BOOL

SetTriggerLogic

This method controls the logic of the HasTriggered method

METHOD SetTriggerLogic (
 logic : DigitalLogic)

Inputs

logic DigitalLogic

logic of the digital output, available types normal and inverted

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.

METHOD Stop ()