Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| logic_module [2019/03/20 17:04] – external edit 127.0.0.1 | logic_module [2026/09/21 11:30] (current) – francesco | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Logic Module ====== | ====== Logic Module ====== | ||
| - | Each logic scheme | + | Each logic scheme |
| - | {{ : | + | The behavior of a node is determined by its **connectors**, |
| + | |||
| + | {{ : | ||
| + | |||
| + | <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. | ||
| + | </ | ||
| + | |||
| + | ===== Quick access ===== | ||
| + | |||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| + | * [[# | ||
| ===== Scheme management ===== | ===== Scheme management ===== | ||
| - | The logic scheme can be managed | + | The logic scheme can be managed |
| - | * **Import** | + | * **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' | + | |
| - | * **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. | ||
| + | </ | ||
| - | 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** simulates | + | |
| - | **Online simulation** connects | + | |
| - | <WRAP center round important 60%>Online simulation only works if the Configurator | + | <WRAP center round important 60%> |
| + | The export operation does not save the scheme inside | ||
| </ | </ | ||
| - | The feedback provided while the simulation is running can be managed with some parameters by clicking | + | * **Save**: saves the current logic scheme inside |
| + | | ||
| - | {{ : | + | ===== 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 simulation |
| - | * **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**: | ||
| + | /* * **Online Simulation**: | ||
| + | <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. | ||
| + | </ | ||
| - | ==== 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" | + | The address used for the connection corresponds to the **Local IP address** configured in the **System** object. |
| + | </ | ||
| - | {{ :createnode.png?nolink |}} | + | During a simulation, the value display can be configured by selecting **Sim. Settings** in the toolbar. |
| - | ==== Edit a node ==== | + | {{ : |
| - | 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 | + | ===== Nodes, connectors |
| - | It is possible to select multiple nodes by pressing the //Shift// key. | + | ==== Creating |
| - | ==== Delete | + | |
| - | {{ :deletenode.png? | + | 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 | ||
| + | - Drag the node into the logic scheme sheet. | ||
| + | - Select | ||
| - | ==== Create | + | {{ : |
| - | To build the block diagram, it is necessary to link the nodes among each other. To create | + | ==== Editing |
| - | <WRAP center round important 60%> | + | When a node is selected, its properties are displayed in the property grid. |
| - | {{ : | + | Changing these parameters modifies the behavior of the node. |
| - | ==== Data compatibility among nodes ==== | + | {{ : |
| - | There are no limitation | + | Each connector also has its own properties. To edit them, select the connector directly: the corresponding parameters will be displayed |
| - | | + | |
| - | | + | Multiple nodes can be selected by holding down the **Shift** key. |
| - | | + | |
| - | | + | ==== 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. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | 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 | ||
| + | - Release the button when the green confirmation symbol appears. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Connections can be created only between: | ||
| + | |||
| + | * an **output** connector; | ||
| + | * an **input** connector belonging | ||
| + | |||
| + | 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 | ||
| + | |||
| + | ^ Conversion ^ Rule ^ Example ^ | ||
| + | | **Bit → Number** | ||
| + | | **Number | ||
| + | | **String | ||
| + | | **String | ||
| ==== Gate connector ==== | ==== Gate connector ==== | ||
| - | {{ : | + | 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 display this connector, |
| - | <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.</ | + | {{ : |
| - | 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' | + | |
| - | * **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%> | + | * the calculation |
| + | * no values are sent to the output connectors; | ||
| + | * new values received | ||
| - | The picture below describes | + | The following properties can be configured by selecting |
| + | |||
| + | * **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 | ||
| + | |||
| + | When the **Gate** property is enabled but its connector is not connected, | ||
| + | |||
| + | 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. | ||
| - | {{ : | ||
| ===== Input nodes ===== | ===== Input nodes ===== | ||
| - | The scheme | + | Input nodes allow the scheme to acquire |
| - | 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 | + | * [[lm_input_intstatus|Internal |
| - | == Output | + | ==== Output |
| - | All the input nodes have only one output connector | + | Input nodes have a single |
| - | * **Output sending behavior** | + | The **Output sending behavior** |
| - | | + | |
| - | | + | * **On result change**: the result is sent only when it differs |
| + | * **When a new input telegram is received**: the result is sent whenever the server receives | ||
| + | |||
| + | During an offline simulation, | ||
| - | <WRAP center round important 60%> | ||
| - | </ | ||
| ===== Output nodes ===== | ===== Output nodes ===== | ||
| - | The scheme generates one or more output values to send on the KNX bus, commands to perform, etc. The output | + | Output |
| - | 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 " | ||
| ===== Analog nodes ===== | ===== Analog nodes ===== | ||
| - | The Analog nodes represent a collection of node which perform | + | Analog nodes process numeric values, |
| - | * [[lm_analog_comparator|Comparator/ | + | |
| - | * [[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]]: |
| + | * [[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 | + | Counter nodes receive a numeric |
| - | 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/ | + | * [[lm_counter_updowncounter|Up/ |
| - | * [[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**: | ||
| + | * **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**: | ||
| - | 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 | ||
| - | * //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. |
| - | | + | Except for nodes with a fixed structure, the number of inputs can be changed using the **Number of inputs** property. |
| - | | + | |
| - | | + | |
| - | | + | |
| - | * [[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]]: |
| - | All the input connectors | + | * [[lm_logic_filter|Filter]]: |
| - | * **Trigger** Whenever a new value is received on the connector, if this property is enabled, the node triggers the computation | + | * [[lm_logic_if|IF]]: |
| - | * **Inverted input** If enabled 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 | ||
| + | * [[lm_logic_memory|Memory]]: | ||
| + | * [[lm_logic_nand|NAND]]: | ||
| + | * [[lm_logic_nor|NOR]]: | ||
| + | * [[lm_logic_not|NOT]]: | ||
| + | * [[lm_logic_or|OR]]: | ||
| + | * [[lm_logic_prelay|Pulse Relay]]: maintains | ||
| + | * [[lm_logic_xand|XAND]]: | ||
| + | * [[lm_logic_xor|XOR]]: | ||
| - | == Output | + | ==== Input connectors |
| - | All the output | + | |
| - | * **Output sending behavior** It indicates | + | The input connectors of logic nodes include |
| - | | + | |
| - | | + | * **Trigger**: when enabled, receiving a new value on the connector triggers the node calculation and the possible transmission of the results. |
| - | * **Inverted output** | + | * **Inverted input**: inverts |
| + | |||
| + | ==== 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 | ||
| + | * **When a new input telegram is received**: the result is sent whenever the source | ||
| + | * **Inverted output**: inverts the transmitted | ||
| ===== Timer nodes ===== | ===== Timer nodes ===== | ||
| - | The Timer nodes represent | + | Timer nodes perform |
| - | * [[lm_timer_pulsegen|Continuous Pulse Generator]] | + | |
| - | * [[lm_timer_onoffdelay|On/ | + | * [[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/ |
| - | * [[lm_timer_random|Random Generator]] | + | * [[lm_timer_pulsegen|Continuous Pulse Generator]]: |
| - | * [[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 |
| - | * [[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# | + | |
| - | * [[logic_module# | + | * [[lm_math_abs|Absolute Value]]: calculates |
| - | * [[logic_module# | + | * [[lm_math_add|Addition]]: calculates |
| - | * [[logic_module# | + | * [[lm_math_avg|Average]]: |
| - | * [[lm_math_linearcomb|Linear Combination]] | + | * [[lm_math_div|Division]]: |
| - | * [[logic_module# | + | * [[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]]: |
| - | * [[logic_module# | + | * [[lm_math_expression|Math Expression]]: calculates a custom mathematical expression. |
| - | * [[logic_module# | + | * [[lm_math_max|Maximum]]: returns |
| - | * [[logic_module# | + | * [[lm_math_min|Minimum]]: returns |
| - | * [[logic_module# | + | * [[lm_math_mul|Multiplication]]: |
| - | * [[logic_module# | + | * [[lm_math_pow|Power]]: performs |
| - | * [[logic_module# | + | * [[lm_math_remainder|Remainder]]: |
| - | * [[logic_module# | + | * [[lm_math_round|Round]]: rounds the received |
| + | * [[lm_math_sub|Subtraction]]: calculates | ||
| + | |||
| + | ===== 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 | ||
| + | |||
| + | For the method syntax, parameter definition, | ||
| + | |||
| + | ===== 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 | ||
| + | </ | ||
| + | |||
| + | ===== Logic examples ===== | ||
| + | |||
| + | ==== Temperature regulator ==== | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | <WRAP center 60%> | ||
| + | <WRAP centeralign> | ||
| + | Example 1: Temperature Regulator | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Using the **Math Expression** node and the '' | ||
| + | |||
| + | 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, | ||