Logic

Logic - is a mechanism for automatic management.

The syntax of a logic description

The logic is described by a line in the following form:

(SENSORID OLDSTATE-NEWSTATE OPERATOR ...){SENSORID1:TIMEOUT NEWSTATE2 OPERATOR2 ...}

Where:

  • SENSORID - unique sensor ID.

  • OLDSTATE-NEWSTATE - sensor status codes, with which the condition is true in transition. The values of both parameters should be the same.

  • OPERATOR - the operator code with which the result of conditions is calculated.

  • SENSORID1 - Unique sensor ID whose status should be changed under the conditions of the logical scheme.

  • TIMEOUT - A timeout condition.

  • NEWSTATE2 - The status code where you want to move the element (relay).

  • OPERATOR2 - Symbol '+'.

Status codes are:

  • 'normal': 1;

  • 'low': 2;

  • 'warning': 3;

  • 'alarm': 4;

  • 'on': 5;

  • 'off': 6.

  • 'not connected': 7.

  • 'pulse': 8.

Operators codes:

  • 'and': symbol '+';

  • 'or': symbol '|'.

Manage logic

To create a logic use field ctlLogicRowStatus. Moving field ctlLogicRowStatus in a state CreateAndWait(5) will create a new note in the table сtlLogicsTable.

After creating the logic it is necessary to specify its name in the field ctlLogicName and the logic description in the field ctlLogicDescription.

After creating a logic description, the logic becomes active, as indicated by the value active(1) in a field ctlLogicRowStatus.

Turning off the logic is performed by setting a field ctlLogicDisable desired interval in seconds.

Turn-on logic is performed by setting the field ctlLogicDisable value of '0'.

Remove logic is performed by setting the field ctlLogicRowStatus in a state destroy(6).


Example. Creating, editing, checking, and removing logic

Reading the logic table:

$ snmptable -Ci -Cb -v2c -cread 192.168.0.193 VUTLAN-SYSTEM-MIB::ctlLogicsTable

 

SNMP table: VUTLAN-SYSTEM-MIB::ctlLogicsTable index ID Name Description Disable RowStatus 1 1 "Logic scheme" "(20 4 - 4){34:0 8}" 0 active

 

Creating new logic:

 

 

View created logic table:

 

 

Now we have two logics:

  • Logic "Logic scheme" is triggered when an element of the system with ID = 20 goes to state "alarm"(4) and provides an incentive "pulse"(8) on the element with ID=34 (relay or outlet, see table above) immediately (through 0 с);

  • Logic "New Logic" is triggered, when an element of the system with ID=20 goes to state "normal"(1) and provides an incentive "on"(8) on the element with ID=301 (Trap element, see table above) immediately (through 0 с);

Disabling the logic in 60 seconds:

 

 

Verify that the logic is disabled:

 

 

Remove Logic:

 

After the removal of the logic, the logic table should have an initial appearance.