Table of Contents

ILight

Namespace
ZEquipment
Extends
Inherited Properties
INTERFACE ILight EXTENDS ZEquipment.IPulsedOutput

This interface defines the api of the light function block and has all necessary methods implemented to use a light properly. To see one implementation and the predefined light blinking sequences head over to ZEquipment.Light.

There are several predefined Light blinking sequences and it is also possible to define a custom one by parametrizing the properties Delay, Duration, Frequency and GroupCount.

Properties

Characteristic

PROPERTY Characteristic : LightCharacteristic

This property returns the current active light characteristic, which is set when calling Enable. This property returns LightCharacteristic.Custom whenever manual calls to the following methods, are performed to manipulate the active lighting pattern.

Property Value

LightCharacteristic

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

This property returns the current state of the light. The implementation inside light respects the logic configuration.

  • Setting the property to TRUE internally calls Enable(LightCharacteristic.FixedOn),
  • Setting the property to FALSE internally calls Enable(LightCharacteristic.FixedOff)

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

Simulation

PROPERTY Simulation : BOOL

Every light is able to simulate its behaviour. With activated simulation the function block uses internally a different variable to save its state and therefore it is also possible to simulate the behaviour of a light even without any connected hardware. Set this property to TRUE to enable simulation and FALSE to disable simulation

Property Value

BOOL

Methods

Enable

METHOD Enable (
 [input] characteristic : LightCharacteristic)

Enable a specific light blinking mode. Use a specific mode from LightCharacteristic enumeration or use custom combined with the following properties

Note

Note that the latter properties can also be used after calling this method in order to fine tune a preset.

Inputs

characteristic LightCharacteristic

Invert

METHOD Invert ()

This method simply inverts the output of the light according to the Invert methodology. It should not be used while using a defined pattern like isophase or occulting because of unexpected behavior, but can be used while using fixedOn or fixedOff characteristic.

IsEnabled

METHOD IsEnabled () : BOOL

Returns the actual state of the light output. If the light is set, it returns TRUE otherwise FALSE. However, the state on the fieldbus may be different, which depends on the current parameterized logic of the DigitalOutput which can be changed with SetLogic

Returns

BOOL

Name

METHOD Name () : ZCore.ZString

This method returns the name that has been set with SetName during initialization phase.

Returns

ZString

Off

METHOD Off ()

This method turns the light off and stops any light blinking mode; Its simply the same action as calling Enable(ZEquipment.LightCharacteristic.FixedOff);

On

METHOD On ()

This method turns the light on without any blinking mode; Its simply the same action as calling Enable(ZEquipment.LightCharacteristic.FixedOn);

SetLogger

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

Setting a Logger with this method enables the logging functionality of lights.

Note

To change the logging behaviour it is sometimes useful to inject a LoggerNameDecorator here. For more information on that pattern read the following documentation (TODO: documentation of the decorator Pattern)

Leaving this Light instance without logger will not create any log entry

Inputs

logger ILogger

SetLogic

METHOD SetLogic (
 [input] logic : DigitalLogic)

The actual logic of a light output can be changed in initialization phase or anywhere, at any time in the application. Depending on the logic, the internally instantiated DigitalOutput has a different behaviour while returning the actual state For more information on that, please refer to the SetLogic docs at DigitalOutput.

Inputs

logic DigitalLogic

logic of the output, available types normal and inverted

SetName

METHOD SetName (
 [input] name : ZCore.ZString)

Usually logging should not be used for lights because some of them are switched very often which leads to a high logging load. However, to differantiate between all those lights (e.g. in a IO-Bridge) they should be initialized with a name. Initialization can be done with instantiation or later by calling this SetName method. A name should not be longer than 30 characters and should be used according to the name in an electrical plan of your automation project to have a proper connection for the service personnel.

Inputs

name ZString