logic_module

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
logic_module [2019/03/20 17:04] – external edit 127.0.0.1logic_module [2026/09/21 11:30] (current) – francesco
Line 1: Line 1:
 ====== Logic Module ====== ====== Logic Module ======
  
-Each logic scheme represents a **sheet** containing block units. In the sheet it is possible to add several kinds of **nodes**, each one of them corresponding to a specific function in the server. The interaction of the node is defined by its **connectors** which are inputs and outputs of the node. Several nodes can be linked together by creating **connections** among the nodes. A connection is a link that starts from an output connector in a node and ends in an input connector.+Each logic scheme consists of a sheet containing different functional blocks, called **nodes**. Each node corresponds to a specific function executed by the Thinknx server.
  
-{{ :schemewindow1.png?nolink |}}+The behavior of a node is determined by its **connectors**, which represent its inputs and outputs. Nodes can be linked together through connections: each connection starts from an output connector and ends at an input connector of another node. 
 + 
 +{{ :schemewindow1.png |Logic Module editor}} 
 + 
 +<WRAP center round info 70%> 
 +This page describes the general operation of the Logic Module. For the configuration and behavior of an individual node, select the corresponding link in the following sections. 
 +</WRAP> 
 + 
 +===== Quick access ===== 
 + 
 +  * [[#scheme_management|Scheme management]] 
 +  * [[#simulation_management|Simulation management]] 
 +  * [[#nodes_connectors_and_connections|Nodes, connectors and connections]] 
 +  * [[#input_nodes|Input nodes]] 
 +  * [[#output_nodes|Output nodes]] 
 +  * [[#analog_nodes|Analog nodes]] 
 +  * [[#counter_nodes|Counter nodes]] 
 +  * [[#logic_nodes|Logic nodes]] 
 +  * [[#timer_nodes|Timer nodes]] 
 +  * [[#math_nodes|Math nodes]] 
 +  * [[#scripting_node|Scripting node]] 
 +  * [[#reusable_logic_sheets|Reusable logic sheets]] 
 +  * [[#scheme_verification|Scheme verification]] 
 +  * [[#logic_examples|Logic examples]]
  
 ===== Scheme management ===== ===== Scheme management =====
  
-The logic scheme can be managed with the following buttons in the toolbar:+The logic scheme can be managed using the following buttons in the toolbar:
  
-  * **Import** It imports the block diagram contained in a XML file into the current logic scheme. //This operation overwrites completely the logic scheme!// +  * **Import**: imports the block diagram contained in an XML file into the current logic scheme.
-  * **Export** It exports the current logic scheme in an XML file so that can be used inside other logic schemes. //This operation doesn't save the current logic scheme inside the Configurator but just exports it!// +
-  * **Save** It saves the current logic scheme inside Configurator. +
-  * **Close** It closes the logic scheme editor window.+
  
-===== Simulation management =====+<WRAP center round important 60%> 
 +The import operation completely overwrites the current logic scheme. 
 +</WRAP>
  
-The simulation feature allows to predict and debug what will happen when the block diagram will be executed inside the Thinknx server. Inside Thinknx Logic Module there are two kinds of simulation: **Offline Simulation** and **Online Simulation**.\\ +  * **Export**: exports the current logic scheme to an XML file, which can then be imported into other logic schemes.
-**Offline simulation** simulates the behavior of the server by executing the block diagram inside Configurator and showing in realtime the values passing by all inputs and outputs of the nodes. In this way the user keeps trace of the values due some input values.\\ +
-**Online simulation** connects to Thinknx server and provides feedback regarding the execution of the block diagram directly inside the server.+
  
-<WRAP center round important 60%>Online simulation only works if the Configurator is in the same local network of the server. The IP needed for the connection corresponds to Local IP address specified in the System object.+<WRAP center round important 60%> 
 +The export operation does not save the scheme inside the Configurator. It only generates the corresponding XML file.
 </WRAP> </WRAP>
  
-The feedback provided while the simulation is running can be managed with some parameters by clicking the **Sim. Settings** button in the toolbar:+  * **Save**: saves the current logic scheme inside the Configurator project. 
 +  * **Close**: closes the Logic Module editor.
  
-{{ :sim_settings.png?nolink&400 |}}+===== Simulation management =====
  
-  * **Force show value labels for all connectors** During a simulation, when the value passing by a connector is updated, a box showing the value appears beside the connector. To force this box to always be shown during simulation, check this box.\\ +The simulation feature allows the behavior of the block diagram to be tested and analyzed before or during its execution on the Thinknx server.
-  * **Value updates fade timeout** If the previous checkbox is unchecked, it indicates the time the update will be shown on the screen.\\+
  
-===== Nodes, Connectors and Connections =====+Two types of simulation are available in the Logic Module:
  
 +  * **Offline Simulation**: executes the block diagram directly inside the Configurator and displays, in real time, the values passing through the node inputs and outputs. This makes it possible to test the behavior of the scheme by manually setting the input values.
 +/*  * **Online Simulation**: connects to the Thinknx server and displays directly in the Configurator the values processed by the block diagram running on the server. */
  
 +<WRAP center round info 70%>
 +Offline Simulation can be used to test the behavior of the scheme, but it does not communicate with the KNX bus or with the real system objects. Input values must be simulated manually.
 +</WRAP> 
  
-==== Create a node ====+/*<WRAP center round important 70%> 
 +Online Simulation works only when the computer running the Configurator is connected to the same local network as the server.
  
-To create a node, open the "Node Types Library" and drag the desired node into the sheet. For each node it is possible to edit its properties by clicking on it.+The address used for the connection corresponds to the **Local IP address** configured in the **System** object. 
 +</WRAP>*/
  
-{{ :createnode.png?nolink |}}+During a simulation, the value display can be configured by selecting **Sim. Settings** in the toolbar.
  
-==== Edit a node ====+{{ :sim_settings.png |Simulation settings}}
  
-By selecting the node, the property grid gets populated with its properties, by editing them the behavior of the node will change.+The following options are available:
  
-{{ :selectnode.png?nolink |}}+  * **Force show value labels for all connectors**: keeps the labels containing the current values of all connectors permanently visible. If this option is disabled, a label is displayed only when the corresponding connector value is updated. 
 +  * **Value updates fade timeout**: if permanent label display is disabled, this property determines how long the latest received value remains visible.
  
-Every connector in the node has its own properties to describe its behavior. To edit them, click on the connector and the properties will be displayed in the property grid.+===== Nodes, connectors and connections =====
  
-It is possible to select multiple nodes by pressing the //Shift// key. +==== Creating a node ====
-==== Delete a node ====+
  
-{{ :deletenode.png?nolink |}}+To create a node:
  
-To delete a node, select it and press Del key, or click on the little X icon which appears by moving the mouse over the node. After the node has been deleted, all the connection associated to the node will be removed.+  - Open the **Node Types Library**. 
 +  - Locate the required node type. 
 +  - Drag the node into the logic scheme sheet. 
 +  - Select the node to configure its properties.
  
-==== Create a connection between nodes ====+{{ :createnode.png |Creating a node}}
  
-To build the block diagram, it is necessary to link the nodes among each other. To create a connection click and hold one connector in the node and drag the mouse until the connector of the destination node. Before releasing the mouse, if the connection respects the standard rules among nodes, a green check will appear near the destination connector.+==== Editing a node ====
  
-<WRAP center round important 60%>Connections can be established ONLY between an output connector and an input connector belonging to different nodes.\\ One output connector can link to several input connectors but one input connector can link to just one output connector!</WRAP>+When a node is selected, its properties are displayed in the property grid.
  
-{{ :yesno_connection.png?nolink&700 |}}+Changing these parameters modifies the behavior of the node.
  
-==== Data compatibility among nodes ====+{{ :selectnode.png |Selecting and editing a node}}
  
-There are no limitation in the creation of a new connection due to data compatibility, the incoming values will be automatically converted to the expected input type following these rules:\\ +Each connector also has its own properties. To edit them, select the connector directly: the corresponding parameters will be displayed in the property grid. 
-  * **Bit to Number** When a logic output (a bit) is connected to an analog input (a number), the system will convert the logic 0 (False) to 0 and the logic 1 (True) to 1. + 
-  * **Number to Bit** When an analog output (a number) is connected to a logic input (a bit), the system will convert the analog value to a logic 0 (False) if it is equal to 0, and to a logic 1 (True) for all the other values. +Multiple nodes can be selected by holding down the **Shift** key. 
-  * **String to Bit** When a string coming from an input node is connected to a logic input, the system will convert the string to a logic 1 (True) only if the string is equal to 1 or to "true". + 
-  * **String to Number** When a string is connected to an analog input, the string value is converted into a number.+==== Deleting a node ==== 
 + 
 +To delete a node: 
 + 
 +  * select it and press the **Del** key; or 
 +  * move the pointer over the node and select the small **X** icon displayed on it. 
 + 
 +{{ :deletenode.png |Deleting a node}} 
 + 
 +When a node is deleted, all associated connections are automatically removed. 
 + 
 +==== Creating a connection ==== 
 + 
 +To create a connection between two nodes: 
 + 
 +  - Select an output connector. 
 +  - Hold down the mouse button. 
 +  - Drag the connection to the input connector of the destination node. 
 +  - Release the button when the green confirmation symbol appears. 
 + 
 +{{ :yesno_connection.png |Creating a valid connection}} 
 + 
 +Connections can be created only between: 
 + 
 +  * an **output** connector; 
 +  * an **input** connector belonging to another node. 
 + 
 +An output connector can be linked to multiple input connectors. An input connector can receive only one connection. 
 + 
 +==== Data compatibility ==== 
 + 
 +A connection is not prevented when the output data type differs from the type expected by the input. The received value is automatically converted according to the following rules: 
 + 
 +^ Conversion ^ Rule ^ Example ^ 
 +| **Bit → Number** | Logic **0 (False)** is converted to the number **0**, while logic **1 (True)** is converted to the number **1**. | ''True → 1'' | 
 +| **Number → Bit** | The number **0** is converted to **0 (False)**. Any other numeric value is converted to **1 (True)**. | ''25 → True'' | 
 +| **String → Bit** | The string is converted to **1 (True)** only if it contains ''1'' or ''true''. In all other cases, it is converted to **0 (False)**. | ''"true" → True'' | 
 +| **String → Number** | The string content is converted to a numeric value if it uses a valid format. | ''"25.5" → 25.5'' |
  
 ==== Gate connector ==== ==== Gate connector ====
  
-{{ :gateconnector.png?nolink |}}+Except for input and output nodes, nodes can be enabled or disabled through the **Gate** connector.
  
-Except for input and output nodes, all the nodes can be enabled and disabled with the **Gate** connector. To show the Gate connector on the node, the **Gate** property on the node must be enabled.+To display this connector, enable the **Gate** property of the node.
  
-<WRAP center round important 60%>When a node is disabled, the computation is not performed and no values are sent to the output connectors even if an input connector receives a new value.</WRAP>+{{ :gateconnector.png |Gate connector}}
  
-By selecting the Gate connector it is possible to edit its properties which determine the behavior of the node: +When a node is disabled:
-  * **Inverted gate** If disabled, the node is enabled when the connector's value is 1 and disabled when the connector's value is 0. By enabling this property, the behavior will be inverted (0 = node enabled, 1 = node disabled). +
-  * **Force output sending** If enabled, when the node gets enabled, the values of all the output connectors are refreshed independently by the **Output sending behaviour** property of the corresponding output connector.+
  
-<WRAP center round important 60%>When the Gate property is enabled, if the Gate connector is not connected to any other node, the node is disabled by default. Otherwise, if the Gate connector is connected to a node but it is not receiving any value from the source of the connection, the node is still disabled.</WRAP>+  * the calculation is not performed; 
 +  * no values are sent to the output connectors; 
 +  * new values received by the input connectors do not produce any result.
  
-The picture below describes the behaviour of the Gate in the node:+The following properties can be configured by selecting the **Gate** connector: 
 + 
 +  * **Inverted gate**: 
 +    * when disabled, the node is enabled when **Gate = 1** and disabled when **Gate = 0**; 
 +    * when enabled, the behavior is inverted: the node is enabled when **Gate = 0** and disabled when **Gate = 1**. 
 +  * **Force output sending**: when the node is enabled, all output connector values are refreshed regardless of the **Output sending behavior** configured for the individual outputs. 
 + 
 +When the **Gate** property is enabled but its connector is not connected, the node is disabled by default. 
 + 
 +The node also remains disabled when the **Gate** connector is connected but has not yet received a value from its source. 
 + 
 +{{ :gateforlogicmodule.png |Gate connector behavior}} 
 + 
 +==== Await all inputs ==== 
 + 
 +The **Await all inputs** property is available for individual blocks in the logic scheme. 
 + 
 +When set to **True**, the node waits until all its inputs have received at least one value before performing the calculation and producing a result. 
 + 
 +This property prevents the node from being processed using incomplete data or inputs that have not yet been initialized.
  
-{{ :gateforlogicmodule.png?nolink&500 |}} 
 ===== Input nodes ===== ===== Input nodes =====
  
-The scheme should be able to read values coming from the plant as the the inputs of the block diagram or just provide some constants in the logic.\\ +Input nodes allow the scheme to acquire values from the installation, System objects, or constants defined directly in the scheme.
-There are several kinds of **Input nodes** that can be used for this purpose:+
  
-  * [[lm_input_number|Constant Value]] +  * [[lm_input_number|Constant Value]]: provides the scheme with a numeric, logic, or text value defined during configuration. 
-  * [[lm_input_knxinput|KNX Input]] +  * [[lm_input_knxinput|KNX Input]]: acquires the value associated with a KNX group address from the KNX bus. 
-  * [[lm_input_sheetinput|Sheet Input]] +  * [[lm_sheet|Sheet Input]]: represents a generic input of a reusable logic function. 
-  * [[lm_input_intstatus|System Status]]+  * [[lm_input_intstatus|Internal Status]]: acquires a status made available by a System object configured in the project.
  
-== Output Connector ==+==== Output connector ====
  
-All the input nodes have only one output connector and the input value of these nodes will pass through it. In this connector it is possible to define the policy that will be used to forward the value to the connected nodes through the property:+Input nodes have a single output connector through which the acquired value is transmitted.
  
-  * **Output sending behavior** It indicates when the value has to be forwarded to the connected nodes. +The **Output sending behavior** property determines when the value is forwarded to the connected nodes: 
-     * //’On result change’// indicates that the result is sent only when different from the previous one. + 
-     * //’When a new input telegram is received’// indicates that the result is sent whenever the server receives a value update from the source of the input.+  * **On result change**: the result is sent only when it differs from the previous value. 
 +  * **When a new input telegram is received**: the result is sent whenever the server receives an update from the input source, even if the value has not changed. 
 + 
 +During an offline simulation, input updates can be simulated by manually entering values in the corresponding toolbar panel.
  
-<WRAP center round important 60%>During //Offline Simulation// it is possible to simulate the value updates by manually typing them in the toolbar panel. 
-</WRAP> 
 ===== Output nodes ===== ===== Output nodes =====
  
-The scheme generates one or more output values to send on the KNX bus, commands to perform, etc. The output nodes represent the kind of action to perform with these values.\\ +Output nodes represent the final action performed using the values processed by the scheme, such as sending a KNX telegram or executing a command. 
-There are several kinds of **Output nodes** that can be used for this purpose: + 
-  * [[lm_output_command|Command]] +  * [[lm_output_command|Command]]: executes the configured command when a value or trigger signal is received. 
-  * [[lm_output_knxoutput|KNX Output]] +  * [[lm_output_knxoutput|KNX Output]]: sends the value processed by the scheme to a KNX group address. 
-  * [[lm_output_sheetoutput|Sheet Output]]+  * [[lm_sheet|Sheet Output]]: represents a generic output of a reusable logic function. 
 + 
 +==== Input connectors ==== 
 + 
 +The input connectors of output nodes include the **Trigger** property. 
 + 
 +When this property is enabled, receiving a new value on the connector starts the action configured in the output node.
  
-== Input connectors == 
-All the input connectors of output nodes have the following properties: 
-  * **Trigger** Whenever a new value is received on the connector, if this property is enabled, the node triggers the "output action". 
 ===== Analog nodes ===== ===== Analog nodes =====
  
-The Analog nodes represent a collection of node which perform analog operations.\\ +Analog nodes process numeric values, perform regulation, apply filters, and check whether configured thresholds have been reached. 
-  * [[lm_analog_comparator|Comparator/2 Points Regulator]] + 
-  * [[lm_analog_pid|PID Controller]] +  * [[lm_analog_comparator|Comparator / 2 Points Regulator]]: compares two numeric values using two switching thresholds and maintains the previous state while the difference remains between them. 
-  * [[lm_analog_pwm|Pulse Width Modulator]] +  * [[lm_analog_pid|PID Controller]]: regulates the output according to the difference between the setpoint and the measured value. 
-  * [[lm_analog_ramp|Ramp]] +  * [[lm_analog_pwm|Pulse Width Modulator]]: converts an analog value into a pulse signal whose ON/OFF ratio is proportional to the received value. 
-  * [[lm_analog_range|Range Verifier]] +  * [[lm_analog_ramp|Ramp]]: progressively increases or decreases the output until the requested value is reached. 
-  * [[lm_analog_thres|Threshold Filter]] +  * [[lm_analog_range|Range Verifier]]: checks whether the received value is included between a minimum and maximum threshold. 
-  * [[lm_analog_time|Time-based Filter]]+  * [[lm_analog_thermostatauto|Automatic Thermostat]]: automatically manages thermostat regulation according to the configured modes and values. 
 +  * [[lm_analog_thermostatsetpoint|Thermostat Setpoint]]: determines or modifies the setpoint used for thermostat regulation. 
 +  * [[lm_analog_thres|Threshold Filter]]: limits the output value according to the configured minimum and maximum thresholds. 
 +  * [[lm_analog_time_filter|Time-based Filter]]: filters or delays value transmission according to the configured time conditions.
  
 ===== Counter nodes ===== ===== Counter nodes =====
  
-The Counter nodes, given an input (number or bit), perform a counting operation on the input and send it to the output.\\ +Counter nodes receive a numeric or logic value, perform a counting operation, and provide the result through their output connectors. 
-There are several kinds of **Counter nodes** that can be used for this purpose: + 
-  * [[lm_counter_maintcounter|Maintenance Counter]] +  * [[lm_counter_maintcounter|Maintenance Counter]]: measures the total time during which the input remains active. 
-  * [[lm_counter_updowncounter|Up/Down Counter]] +  * [[lm_counter_updowncounter|Up/Down Counter]]: increases or decreases a value in response to the rising edges received on the corresponding inputs. 
-  * [[lm_counter_statcounter|Statistic Meter]]+  * [[lm_counter_statcounter|Statistic Meter]]: calculates and stores current and previous daily, weekly, monthly, and yearly totals. 
 + 
 +==== Output connectors ==== 
 + 
 +The output connectors of counter nodes include specific properties that determine when calculated values are sent. 
 + 
 +The **Output sending behavior** property provides the following options: 
 + 
 +  * **On new value reception**: the value is sent whenever the node updates the result. 
 +  * **After a fixed time interval**: the value is sent when the configured interval expires, regardless of whether it has changed. 
 +  * **On over-threshold change**: the value is sent when its percentage difference from the previous value exceeds the configured threshold. 
 +  * **On over-threshold change and after time**: the value is sent when the change threshold is exceeded and, in any case, when the configured interval expires. 
 + 
 +The associated properties are:
  
-== Output connectors ==+  * **Store time interval**: time interval to wait before sending the value. 
 +  * **Change percentage**: minimum percentage change required to send the value. The new value must differ from the previous one by more than the configured percentage.
  
-All the output connectors of the counter nodes have particular properties to manage the policies to send the values: 
-  * **Output sending behaviour** The connector value will be updated depending on the following criteria: 
-     * //On new value reception// Whenever the node updates the value, it sends it to the connector. 
-     * //After a fixed time interval// The node sends the value to the connector at the expiration of a specified time interval, independently by the fact that the value has changed or not. 
-     * //On over-threshold change// The node will compare the latest computed value with the previous one, if the difference between the two values overcrosses a predefined  threshold  it  will send it to the connector. The threshold represents the ratio between the gap of the two values and the previously stored value. 
-     * //On over-threshold change and after time// This option combines the advantages of both previously explained techniques. The node will send the value when over-threshold change occurs and, in any case, after a fixed time interval. 
-  * **Store time interval** Time interval to wait before the node sends the value to the connector. 
-  * **Change percentage** Minimum change percentage required to send the value to the connector. To be sent, the new value has to differ from the previous value more than the percentage applied to the previous value. 
 ===== Logic nodes ===== ===== Logic nodes =====
  
-Logic nodes represent all the operations to manipulate bits. Exept some special nodes, it is always possible to edit the number of inputs of the node with the property **Number of inputs**.+Logic nodes process binary values.
  
-  * [[lm_logic_and|And]] +Except for nodes with a fixed structure, the number of inputs can be changed using the **Number of inputs** property.
-  * [[lm_logic_filter|Filter]] +
-  * [[lm_logic_if|If]] +
-  * [[lm_logic_lrelay|Latching Relay]] +
-  * [[lm_logic_lmatrix|Logic Matrix]] +
-  * [[lm_logic_nand|Nand]] +
-  * [[lm_logic_nor|Nor]] +
-  * [[lm_logic_not|Not]] +
-  * [[lm_logic_or|Or]] +
-  * [[lm_logic_prelay|Pulse Relay]] +
-  * [[lm_logic_xand|Xand]] +
-  * [[lm_logic_xor|Xor]]+
  
-== Input connectors == +  * [[lm_logic_and|AND]]: returns **1** only when all inputs are equal to **1**. 
-All the input connectors of logic nodes have the following properties: +  * [[lm_logic_filter|Filter]]: forwards, modifies, or blocks the received value according to the configured filtering mode. 
-  * **Trigger** Whenever a new value is received on the connector, if this property is enabled, the node triggers the computation and sends the values to the output connectors. +  * [[lm_logic_if|IF]]: selects one of two input values according to the state of the condition. 
-  * **Inverted input** If enabled the connector inverts the received value. If the value on the connector is inverted, a red symbol appears beside the connector.+  * [[lm_logic_lrelay|Latching Relay]]: maintains the output state and allows it to be changed using the **Set** and **Reset** inputs. 
 +  * [[lm_logic_lmatrix|Logic Matrix]]: transfers the value of a selected input to a selected output. 
 +  * [[lm_logic_memory|Memory]]: stores and provides the latest value received according to the configured conditions. 
 +  * [[lm_logic_nand|NAND]]: returns **0** only when all inputs are equal to **1**. 
 +  * [[lm_logic_nor|NOR]]: returns **1** only when all inputs are equal to **0**. 
 +  * [[lm_logic_not|NOT]]: inverts the logic value received at the input. 
 +  * [[lm_logic_or|OR]]: returns **1** when at least one input is equal to **1**. 
 +  * [[lm_logic_prelay|Pulse Relay]]: maintains the output state and toggles it whenever a rising edge is received on the **Trigger** input. 
 +  * [[lm_logic_xand|XAND]]: returns **1** only when all inputs have the same value. 
 +  * [[lm_logic_xor|XOR]]: returns **1** when the inputs have different values.
  
-== Output connectors == +==== Input connectors ==== 
-All the output connectors of logic nodes have the following properties: + 
-  * **Output sending behavior** It indicates when the value has to be forwarded to the connected nodes. +The input connectors of logic nodes include the following properties: 
-     * //’On result change’// indicates that the result is sent only when different from the previous one. + 
-     * //’When a new input telegram is received’// indicates that the result is sent whenever the server receives a value update from the source of the input. +  * **Trigger**: when enabled, receiving a new value on the connector triggers the node calculation and the possible transmission of the results. 
-  * **Inverted output** If enabled the connector inverts the value to send. If the value on the connector is inverted, a red symbol appears beside the connector.+  * **Inverted input**: inverts the value received by the connector. When the input is inverted, a red symbol is displayed beside the connector. 
 + 
 +==== Output connectors ==== 
 + 
 +The output connectors of logic nodes include the following properties: 
 + 
 +  * **Output sending behavior**: 
 +    * **On result change**: the result is sent only when it differs from the previous one; 
 +    * **When a new input telegram is received**: the result is sent whenever the source updates an input. 
 +  * **Inverted output**: inverts the transmitted value. When the output is inverted, a red symbol is displayed beside the connector.
  
 ===== Timer nodes ===== ===== Timer nodes =====
  
-The Timer nodes represent time-based operations inside the scheme. +Timer nodes perform time-based operations, apply delays, and generate pulses or timed sequences. 
-  * [[lm_timer_pulsegen|Continuous Pulse Generator]] + 
-  * [[lm_timer_onoffdelay|On/Off Delay]] +  * [[lm_timer_converter|Date and Time Converter]]: divides a value containing a date or time into its individual components. 
-  * [[lm_timer_pulsetrain|Pulse Train Generator]] +  * [[lm_timer_onoffdelay|On/Off Delay]]: applies independent delays to the rising and falling edges of the signal. 
-  * [[lm_timer_random|Random Generator]] +  * [[lm_timer_pulsegen|Continuous Pulse Generator]]: continuously generates pulses with configurable ON and OFF times while the **Gate** connector is active. 
-  * [[lm_timer_schedpulse|Scheduled Pulse]] +  * [[lm_timer_pulsetrain|Pulse Train Generator]]: generates a sequence containing a configurable number of pulses. 
-  * [[lm_timer_stairwell|Stairwell Lighting Switch]] +  * [[lm_timer_random|Random Pulse Generator]]: generates pulses with random ON and OFF times within the configured ranges. 
-  * [[lm_timer_stopwatch|Stopwatch]]+  * [[lm_timer_schedpulse|Scheduled Pulse]]: generates a pulse at a configured time. 
 +  * [[lm_timer_stairwell|Stairwell Lighting Switch]]: keeps the output active for the configured time and can provide a warning signal before switching it off. 
 +  * [[lm_timer_stopwatch|Stopwatch]]: measures partial intervals and the total accumulated time.
  
 ===== Math nodes ===== ===== Math nodes =====
  
-The Math nodes represent all the arithmetical operation that can be performed inside the scheme.\\ +Math nodes perform arithmetic operations on the values received at their inputs. 
-  * [[logic_module#math_nodes|Abs]]: It computes the absolute value of the given input value and sends the result to the output connector + 
-  * [[logic_module#math_nodes|Add]]: It computes the addition of //n// input values and sends the result to the output connector +  * [[lm_math_abs|Absolute Value]]: calculates the absolute value of the received value. 
-  * [[logic_module#math_nodes|Average]]: It computes the arithmetic mean of //n// input values and sends the result to the output connector +  * [[lm_math_add|Addition]]: calculates the sum of //n// values. 
-  * [[logic_module#math_nodes|Division]]: It computes the division of two inputs and sends the result to the output connector +  * [[lm_math_avg|Average]]: calculates the arithmetic mean of //n// values. 
-  * [[lm_math_linearcomb|Linear Combination]] +  * [[lm_math_div|Division]]: calculates the division of two values. 
-  * [[logic_module#math_nodes|Logarithm]]: It computes the logarithm given two inputs, which represent base and argument of the logarithm, and sends the result to the output connector +  * [[lm_math_linearcomb|Linear Combination]]: calculates the linear combination of the inputs using the configured weights. 
-  * [[lm_math_expression|Math Expression]] +  * [[lm_math_log|Logarithm]]: calculates the logarithm using the base and argument received at the inputs. 
-  * [[logic_module#math_nodes|Max]]: Given //n// inputs, it sends to the output the maximum value among the inputs +  * [[lm_math_expression|Math Expression]]: calculates a custom mathematical expression. 
-  * [[logic_module#math_nodes|Min]]: Given //n// inputs, it sends to the output the minimum value among the inputs +  * [[lm_math_max|Maximum]]: returns the maximum value among the inputs. 
-  * [[logic_module#math_nodes|Multiplication]]: It computes the multiplication of //n// input values and sends the result to the output connector +  * [[lm_math_min|Minimum]]: returns the minimum value among the inputs. 
-  * [[logic_module#math_nodes|Pow]]: It computes the exponentiation given two inputs, which represent base and exponent, and sends the result to the output connector +  * [[lm_math_mul|Multiplication]]: calculates the product of //n// values. 
-  * [[logic_module#math_nodes|Remainder]]: It computes the division of two inputs and sends the //remainder// to the output connector +  * [[lm_math_pow|Power]]: performs exponentiation using a base and an exponent. 
-  * [[logic_module#math_nodes|Round]]: Given an input, it rounds the value to the closest integer and sends it to the output connector +  * [[lm_math_remainder|Remainder]]: returns the remainder of the division of two values. 
-  * [[logic_module#math_nodes|Subtract]]: It computes the subtraction of //n// input values and sends the result to the output connector+  * [[lm_math_round|Round]]: rounds the received value to the closest integer. 
 +  * [[lm_math_sub|Subtraction]]: calculates the subtraction of //n// values. 
 + 
 +===== Scripting node ===== 
 + 
 +The [[lm_scripting|Scripting Node]] allows users with basic programming knowledge to freely create operational logic using the integrated IDE. 
 + 
 +The script code defines the algorithm to be executed, its input parameters, and any output values. 
 + 
 +For the method syntax, parameter definition, and usage examples, refer to the [[lm_scripting|Scripting Node page]]. 
 + 
 +===== Reusable logic sheets ===== 
 + 
 +The **Sheet Input**, **Sheet Output**, and **Logic Module Sheet** nodes can be used to create generic logic blocks, export them in XML format, and reuse them in other projects. 
 + 
 +This feature makes it possible to standardize recurring logic and divide a complex scheme into multiple functional blocks. 
 + 
 +For the complete procedure, refer to [[lm_sheet|Sheet Input, Sheet Output and Logic Module Sheet]]. 
 + 
 +===== Comments ===== 
 + 
 +The [[lm_comment|Comment]] node can be used to add text annotations to the sheet, making the logic scheme easier to document and understand. 
 + 
 +Comments do not participate in logic processing and do not have connectors. 
 + 
 +===== Scheme verification ===== 
 + 
 +Before saving the scheme and transferring the project to the server: 
 + 
 +  - Verify that all required inputs receive a value. 
 +  - Check the **Trigger** properties of the connectors. 
 +  - Verify the configuration of any **Gate** connectors. 
 +  - Check whether nodes requiring multiple inputs should use the **Await all inputs** property. 
 +  - Use Offline Simulation to verify the results produced by the scheme. 
 +  - Verify that there are no unintended circular connections. 
 +  - Check that the data types and automatic conversions produce the expected results. 
 +  - Save the scheme using the **Save** button. 
 +  - Transfer the project to the server and, if necessary, use Online Simulation to verify its actual behavior. 
 + 
 +<WRAP center round important 70%> 
 +Pay particular attention when the input and output of a logic scheme use the same source, for example the same KNX group address. An incorrect **Trigger** configuration may generate a continuous update loop. 
 +</WRAP> 
 + 
 +===== Logic examples ===== 
 + 
 +==== Temperature regulator ==== 
 + 
 +{{ :example_1.png |Example 1: Temperature Regulator}} 
 + 
 +<WRAP center 60%> 
 +<WRAP centeralign> 
 +Example 1: Temperature Regulator 
 +</WRAP> 
 +</WRAP> 
 + 
 +Using the **Math Expression** node and the ''Regulator'' function, it is possible to implement a regulation based on a setpoint and the actual temperature value. 
 + 
 +The two additional expression inputs represent: 
 + 
 +  * the hysteresis value; 
 +  * the option to invert the result: 
 +    * **0** = normal operation; 
 +    * **1** = inverted result. 
 + 
 +In this example: 
 + 
 +  * if **Setpoint > Actual**, the value **1** is sent to **Heat Valve** and **0** is sent to **Cool Valve**; 
 +  * if **Setpoint < Actual**, the value **0** is sent to **Heat Valve** and **1** is sent to **Cool Valve**. 
 + 
 +For more information about configuring expressions, refer to the [[lm_math_expression|Math Expression]] page.
  • logic_module.1553097883.txt.gz
  • Last modified: 2019/03/20 17:04
  • by 127.0.0.1