[ENG] 12.2. [DKSF 54.3 IU] How to Use the Module «Logic»?

Rules allow setting a flexible logic scheme of controlling the features of a device depending on variable external conditions. A logic module implements up to 16 rules. All rules are equal in rights and operate in parallel! A rule consists of Input (2), Condition (3), Output (4) and Action (5). If a status of an input object is changed and now corresponds to Condition (3), a rule operates, and Action (5) is performed over an input object.

Rules of the module Logic in a web interface of a NetPing device

Checkbox of enabling a rule (1)

A line of a rule is enabled by checking a checkbox «Enable» (1) on the left of a line, and elements of a rule are selected from drop-down lists, from the left to the right. Inactive rules are displayed in gray.

Input (2) and Condition (3)

Input (2) is an information source for a rule operation

Condition (3), at which a rule is applied and a command is issued that changes a status of an output. An available set of conditions is changed depending on a selected type of a task. Rules trigger at the moment when a condition is fulfilled. Conditions (3) represent a sense of an input status.

Summary table of input objects and conditions:

Rule input

Conditions

Explanations

Input 1..8

Discrete inputs 1..4 are built-in, 5..8 are external on a 1-Wire bus.

= logic 0Current logic level of an input.
= logic 1

Humidity sensors 1..4

Sensors of a relative humidity on a 1-Wire bus.

t aboveTemperature below/above a threshold and a threshold is set here in conditions in degrees of Celsius, it is possible to use a decimal point and a можно negative value.
t below
rel.hum.aboveRelative humidity below/above a threshold, a threshold is set here, a value from 0% to 100%.
rel.hum.below
failedA sensor does not respond during polling.

Smoke 1..4

Smoke sensors through digital adapters on a 1-Wire bus.

It is used as an input rule.

in a normal stateNo smake.
alertSmoke.
powered offA power supply of a current loop is off, a sensor (IP 212) is de-energized.
failedA sensor does not respond during polling.

Pinger 1..2

Pingers configured on the page «LOGIC» of a web interface.

silentThere is a response from a specified IP address /FQDN.
responds

Power

A current power supply source of a device.

battery
220V grid

Relay 1..4

Relay 100V..240V.

It is used as a rule input.

= offCurrent physical state of a relay.
= on

Start Reset

Initialization signal when logic starts, restarts or reset. It is used for setting logic output in a specified initial status.

finished

5 seconds after the start of the logic.

started

right after logic starts.

Timer/Counter 1..4

Universal programmed objects for organizing consequences, cycles, pulse counters, measuring duration, frequency, etc.

It is used as an input rule.

reached

Comparing with a threshold that is set here in a condition, possibly with a decimal point. The value of Timer/Counter  or a number controlled by commands «add1» and «remove1», or a time interval from a command «start from 0» in seconds with a resolution of 0.1 seconds.

Thermo 1..8

Temperature sensors on a 1-Wire bus.

belowTemperature below/above a threshold, a threshold is set here in conditions in degrees of Celsius, possibly with a decimal point and/or negative value.
above
failedThe sensor does not respond during polling.

Output (4) and Action (5)

Output (4) is usually controlled by a rule. Action (5) is executed when a rule triggers.

Summary table of output objects and actions:

Rule output

Actions

Explanations

Smoke 1..4

Smoke sensors through digital adapters on a 1-Wire bus.

It is used as a rule output

power onControlling a power of a current loop.
power off
switch power
resetShort-term powering off a loop to deactivate alert.

Relay 1..4

Relay 100V..240V.

It is used as a rule output.

power off

Relay control.

power on
switch

Signal 1..4

Sending a user customizable notification using SMS, HTTP GET (webhook).

deactivateFor a customizable notification, it is possible to set an activating event «Signal N» on the page «NOTIFICATION» of a web interface, and thus link it to the triggering of a logic rule.

Timer/Counter 1..4

Universal programmed objects for organizing delays, sequences, cycles, pulse count, measuring duration, frequency, etc.

It is used as a rule output.

start from 0Zero the value and start timer (counting seconds).
zeroZero the value and stop a timer (counting seconds).
add 1Increment/decrement of a counter.
remove 1

SNMP Setter 1..2

Command SNMP SET for a remote object configured on the page «LOGIC» of a web interface.

power off

Sending a programmed SNMP SET command. The destination address, MIB variable, values for «On» and «Off» are set in the settings of the module «SNMP Setter».

power on

Rule Priority (6)

If two or more rules form conflicting commands at the same time over the same output object (4), a rule with the smallest number will be executed. Rules can be moved up and down using corresponding buttons «Move Up» and «Move Down» (6) at the end of a line.

Important. In the updated module «Logic» (starting from the firmware version DKSF 54.3.1), priorities of rules («While» rule more important than «If» rule) do not work. Also, there is no need to connect a relay to the logic module on the page «RELAYS». All sources of a relay control are made active simultaneously and they are equal in rights! The updated logic module without priorities is easy to determine by the absence of the rule type selection «While»/«If» on the left of a line with a rule.

The checkbox «Enable Logic» (7) and reset (reboot) of the logic (8)

On the top of the page «LOGIC» of a web interface, there is a checkbox (7) that enables the operation of the logic («Enable Logic») and the button «Reset» (8) for the forced reset (logic reboot). The logic is reset when the operation stops, starts, and restarts (in the moment of clicking the top button «Apply changes» (9)), as well as when clicking the button «Reset» (8). Reset activates rules with the input «Start reset» that should be used when returning the objects of a device (Relay, Timer/Counter, etc.) to a preset initial state.

The button «Apply changes» of a rule block (10)

After setting all necessary parameters, the button «Apply changes» (10) saves a configuration.

Examples of Configuration

The examples of using the updated module «Logic» can be learned from the section «[ENG] [Draft]12.5. [DKSF 54.3 IU] Configuration Examples for the Module «Logic».