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 [2017/11/30 09:51] – [Math nodes] wikiadminlogic_module [2021/05/21 10:26] (current) ingrid
Line 1: Line 1:
 ====== Logic Module ====== ====== Logic Module ======
 +
 +  * [[#scheme_management| Scheme management]]\\
 +  * [[#simulation_management| Simulation management]]\\
 +  * [[#Nodes,_connectors_and_connection| Nodes, Connectors and Connection]]
 +    * [[#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]]\\
 +  * [[#Logic_examples| Logic Examples]]\\
  
 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 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.
Line 93: Line 105:
 There are several kinds of **Input nodes** that can be used for this purpose: There are several kinds of **Input nodes** that can be used for this purpose:
  
-  * [[lm_input_number|Constant Value]] +++++Constant Value| {{ :logic_icons_number.png?100 |}}
-  * [[lm_input_knxinput|KNX Input]] +
-  * [[lm_input_sheetinput|Sheet Input]] +
-  * [[lm_input_intstatus|System Status]]+
  
-== Output Connector ==+It represents a constant inside the block diagram. It can be a number, a bit or a string. 
 + 
 +  * **Value**: the value assigned to the constant. 
 +++++ 
 +++++KNX Input| {{ :logic_icons_knxinput.png?100 |}} 
 + 
 +It represents an input coming from the KNX bus. 
 + 
 +  * **Input type**: the datatype of the value to read from KNX. 
 +  * **KNX group**: the KNX group address. 
 +  * **Value at startup**: policy to determine which value to assign to the input at the beginning of the execution of the logic scheme. 
 +    * //’Read current value’:// indicates that the input starting value is equivalent to the value of the KNX group. 
 +    * //’Wait for a new telegram’:// indicates that the input doesn’t take any value until the receiving of a new telegram. 
 +    * //’0 until first telegram’:// indicates that the input takes value 0 until the receiving of the first telegram. 
 +    * //’1 until first telegram’:// indicates that the input takes value 1 until the receiving of the first telegram. 
 +++++ 
 +++++Sheet Input| {{ :logic_icons_sheet_input.png?100 |}} 
 +++++ 
 +++++System Status| {{ :logic_icons_internalstatus.png?100 |}} 
 + 
 +It represents an input coming from a status of a System object in the Configurator. For example, a feedback coming from Sonos. 
 + 
 +  * **System status**: the system status to read. To edit this property, click on the right button of the property text field. 
 +++++ 
 + 
 +=== 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: 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:
Line 112: Line 146:
 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.\\ 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.\\
 There are several kinds of **Output nodes** that can be used for this purpose: There are several kinds of **Output nodes** that can be used for this purpose:
-  * [[lm_output_command|Command]] +++++Command| {{ :logic_icons_command.png?nolink&220 |}}
-  * [[lm_output_knxoutput|KNX Output]] +
-  * [[lm_output_sheetoutput|Sheet Output]]+
  
-== Input connectors ==+It represents the command to be executed when a value on the input connector is received. 
 + 
 +  * **Trigger** It determines the behaviour of the node for the command execution: 
 +    * //On trigger// If selected, a new **Trigger** input connector is added to the node, which executes the command whenever the connector value is 1 (or 0 if the connector is inverted) 
 +    * //On parameter value change// If selected and the parameters are input connectors of the node, whenever the value of an input connector is updated, executes the command 
 +  * **Command** It is the command to execute. If the selected command has parameters, they are added to the property grid as new node properties, and for each parameter it is possible to assign a value or to make it become an input connector for the node so that the value for the parameter is dynamic. 
 +++++ 
 +++++KNX Output| {{ :logic_icons_knxinput.png?100 |}} 
 + 
 +It represents the KNX group on which the value will be sent.  
 + 
 +  * **KNX group**: the KNX group address. 
 +  * **Output type**: the datatype of the value to write on KNX. 
 +++++ 
 +++++Sheet Output| //coming soon// 
 +++++ 
 + 
 +=== Input connectors ===
 All the input connectors of output nodes have the following properties: 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".   * **Trigger** Whenever a new value is received on the connector, if this property is enabled, the node triggers the "output action".
Line 122: Line 171:
  
 The Analog nodes represent a collection of node which perform analog operations.\\ The Analog nodes represent a collection of node which perform analog operations.\\
-  * [[lm_analog_comparator|Comparator/2 Points Regulator]] +++++Comparator/2 Points Regulator| {{ :logic_icons_comparator.png?250 |}} 
-  [[lm_analog_pid|PID Controller]] + 
-  * [[lm_analog_pwm|Pulse Width Modulator]] +The Comparator node accepts numeric values for **Input 1** connector and **Input 2** connector and generates a pulse as the result of the comparison between the two inputs. If the difference between the two input values is greater than the value specified in the **Threshold for ON** property of the node, a logic 1 is sent to the **Output** connector. Instead, if the difference is lower than the value specified in the **Threshold for OFF** property, a logic 0 is sent to the **Output** connector.\\ 
-  * [[lm_analog_ramp|Ramp]] +When the the difference is among the two threshold values, the previous state of the output is maintained.\\ 
-  * [[lm_analog_range|Range Verifier]] + 
-  * [[lm_analog_thres|Threshold Filter]] +<WRAP center round important 60%>This node is really useful for temperature regulation because it acts as a 2 Points Regulator, preventing frequent switching of the output. 
-  [[lm_analog_time|Time-based Filter]]+</WRAP> 
 + 
 +{{ :diagram_comparator2.png Behaviour of Comparator }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Comparator </WRAP>  </WRAP> 
 +++++ 
 +++++PID Controller| 
 +++++ 
 +++++Pulse Width Modulator{{ :logic_icons_pwm.png?300 |}} 
 + 
 +The Pulse Width Modulator node converts an analog input into a pulse where the ON/OFF ratio depends on the modulated value of the **Input** connector.\\ 
 +The node computes the ratio of the **Input** value with the **Input Min.** property and the **Input Max.** property and applies it to the **Period** of the output pulse to determine the ON time.\\ 
 +The ratio is calculated at every expiration of the **Period** and thus it considers the actual value of the **Input** connector in that moment. 
 + 
 +{{ :diagram_pwm.png | Behaviour of PWM }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of PWM </WRAP>  </WRAP> 
 +++++ 
 +++++Ramp| {{ :logic_icons_ramp.png?230 |}} 
 + 
 +The Ramp node increases or decreases in a linear way the value of the **Output** connector until it reaches the value of the **Input** connector. The linear increment consists of adding (or subtracting) to the **Output** a value represented by the **Step size** property every time interval specified by the **Time step** property.\\ 
 +The value of the **Output** can't go beyond the **Input** value, so the node reduces the step to adapt the output to the input. 
 + 
 +{{ :diagram_ramp.png Behaviour of Ramp }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Ramp </WRAP>  </WRAP> 
 +++++ 
 +++++Range Verifier| {{ :logic_icons_range.png?280 |}} 
 + 
 +The Range Verifier node, given the analog value of the **Input** connector, checks if it is included between two threshold values, specified with the properties **Threshold Min.** and **Threshold Max.**, and sends 1 to the **Output** connector if the condition is verified, otherwise 0. 
 + 
 +{{ :diagram_range.png Behaviour of Range Verifier }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Range Verifier </WRAP>  </WRAP> 
 +++++ 
 +++++Threshold Filter{{ :logic_icons_threshold.png?280 |}} 
 + 
 +The Threshold Filter node, given an analog value on the **Input** connector, sends it to the **Output** connector if the value is included between the values specified by the two properties **Threshold Min.** and **Threshold Max.**, otherwise it sends the value of the reached threshold.\\ 
 +It is possible to exclude one of the two thresholds by editing the **Filter type** property of the node. 
 + 
 +{{ :diagram_threshold.png Behaviour of Threshold Filter with Filter Type set to //Minimum and maximum thresholds// }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Threshold Filter with Filter Type set to //Minimum and maximum thresholds// </WRAP>  </WRAP> 
 +++++ 
 +++++Time-based Filter
 +++++
  
 ===== Counter nodes ===== ===== Counter nodes =====
Line 134: Line 223:
 The Counter nodes, given an input (number or bit), perform a counting operation on the input and send it to the output.\\ The Counter nodes, given an input (number or bit), perform a counting operation on the input and send it to the output.\\
 There are several kinds of **Counter nodes** that can be used for this purpose: There are several kinds of **Counter nodes** that can be used for this purpose:
-  [[lm_counter_maintcounter|Maintenance Counter]] +++++Maintenance Counter| {{ :logic_icons-maintcounter.png?300 |}} 
-  * [[lm_counter_updowncounter|Up/Down Counter]] + 
-  * [[lm_counter_statcounter|Statistic Meter]]+The Maintenance Counter counts the total time the **Input** connector value is 1 and forwards it to the **Output** connector whenever the **Input** receives a falling edge on the signal. The unit of measure of the time is defined through the **Time UoM** property of the node.\\ 
 +If the **Reboot survive** property of the node is enabled, the counter value is persistent which it means that it doesn't get lost when the server reboots and after the reboot, the counter increments the last saved value; otherwise, the counter value gets resetted every time the server reboots.\\ 
 +The **Start Date** output connector sends the last date and time the counter received a Reset signal. 
 +When the **Reset** input receives 1, the counter gets resetted, **Output** goes to 0 and **Start Date** is updated, the counting will start again only after Reset goes back to 0. 
 + 
 +{{ :diagram_mcounter.png Behaviour of Maintenance Counter}} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Maintenance Counter </WRAP>  </WRAP> 
 +++++ 
 +++++Up/Down Counter| {{ :logic_icons-updowncounter.png?300 |}} 
 + 
 +The Up/Down Counter increases the counter whenever the **Increment** input receives a rising edge and it decrements the counter whenever the **Decrement** input receives a rising edge.\\ 
 +If the **Reboot survive** property of the node is enabled, the counter value is persistent which it means that it doesn't get lost when the server reboots and after the reboot, the counter increment/decrement the last saved value; otherwise, the counter value gets resetted every time the server reboots.\\ 
 +The **Start Date** output connector sends the last date and time the counter received a Reset signal. 
 +When the **Reset** input receives 1, the counter gets resetted, **Output** goes to 0 and **Start Date** is updated; the counting will start again only after Reset goes back to 0. 
 + 
 +{{ :diagram_udcounter.png Behaviour of Up/Down Counter}} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Up/Down Counter </WRAP>  </WRAP> 
 +++++ 
 +++++Statistic Meter{{ :logic_icons-statcounter.png?320 |}} 
 + 
 +The Statistic Meter reads the numeric value of the **Input** connector and calculates: 
 +  * //Current day total// on the **Curr. Day** output connector 
 +  * //Current week total// on the **Curr. Week** output connector 
 +  * //Current month total// on the **Curr. Month** output connector 
 +  * //Current year total// on the **Curr. Year** output connector 
 +  * //Previous day total// on the **Prev. Day** output connector 
 +  * //Previous week total// on the **Prev. Week** output connector 
 +  * //Previous month total// on the **Prev. Month** output connector 
 +  * //Previous year total// on the **Prev. Year** output connector 
 +The counted values are persistent, which it means that they don't get lost when the server reboots.\\ 
 +The **Start Date** output connector sends the last date and time the counter received a Reset signal. 
 +When the **Reset** input receives 1, the counter gets resetted, all the outputs go to 0 and **Start Date** is updated, the counting will start again only after Reset goes back to 0.\\ 
 +Whenever the **Data Request** input connector receives 1, the node refreshes the values of the outputs. 
 + 
 +<WRAP center round important 80%>To make the Statistic Meter operational the first time it is loaded into the server, it needs to receive 1 on the Reset input connector or on the Gate connector (if enabled). 
 +</WRAP> 
 +++++
  
-== Output connectors ==+=== Output connectors ===
  
 All the output connectors of the counter nodes have particular properties to manage the policies to send the values: All the output connectors of the counter nodes have particular properties to manage the policies to send the values:
Line 152: Line 277:
 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 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**.
  
-  * [[lm_logic_and|And]] +++++ And| {{ :logic_icons_andnode.png?200 |}}
-  * [[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 ==+The And node sends 1 on the output only when all the inputs are 1. 
 + 
 +{{ :truthtable_and.png |}} 
 +++++ 
 +++++Filter| {{ :logic_icons_filternode.png?200 |}} 
 + 
 +The Filter node forwards to the output the value coming from the input connector follwing some policies determined by the following properties: 
 + 
 +  * **Filter type**: It indicates the value assigned to the output depending on the input value. 
 +    * //’1 -> - / 0 -> - (disabled)’// indicates that no values are assigned to the output. 
 +    * //(//’1 -> - / 0 -> 0’) if input is equal to 1, no value assigned to the output. If input is equal to 0, 0 will be sent to the output. 
 +    * //’1 -> - / 0 -> 1’// if input is equal to 1, no value sent to the output. If input is 0, 1 is sent to the output 
 +    * //’1 -> - / 0 -> Toggle’// if input is equal to 1, no value will be sent to the output. If input is equal to 0, the output will toggle. 
 +    * //’1 -> 0 / 0 -> -’// If input is 1, output will be set to 0. If input is 0, no value will be sent to the output. 
 +    * //’1 -> 0 / 0 -> 1 (inversion)’// indicates that the input value is inverted and than sent to the output. 
 +    * //’1 -> 1 / 0 -> -’// indicates that if the input is 1, 1 is assigned to the output, if the input is 0, no values are assigned to the output. 
 +    * //’1 -> 1 / 0 -> 0 (pass all)’// indicates that both of the input values are sent to the output. 
 +    * //’1 -> Toggle / 0 -> -’//: indicates that if the input is 1 the output value is inverted, if the input is 0 no values are assigned to the output. 
 +    * //’1 -> Toggle / 0 -> Toggle’// for every input value (both 0 or 1), the output will toggle. 
 +  * **Delay**: It indicates if is necessary to wait for a time interval before sending the output value. 
 +    * //’Do not use’:// disables the property so no delays are applied . 
 +    * //’Use if input is 1’:// applies the delay only if the input is 1. 
 +    * //’Use if input is 0’:// applies the delay only if the input is 0. 
 +    * //’Use always’:// applies the delay for any input value. 
 +  * **Delay base time**: It indicates the measurement unit of the time interval of the delay. 
 +  * **Delay factor**: It indicates the value of the time interval of the delay.  
 +++++ 
 +++++If| {{ :logic_icons_iifnode.png?220 |}} 
 + 
 +The If node evaluates the value of the input **Condition**, if it is equal to 1 sends the **True value** input value to the output, otherwise it sends the **False value** input value. 
 +++++ 
 +++++Latching Relay| {{ :logic_icons_latching-relay.png?250 |}} 
 + 
 +The Latching Relay node sends 1 to the output when the input **Set** is set to 1 and sends 0 to the output when the input **Reset** is set to 1. When both Set and Reset are 0, the previous state of the output is mantained.\\ 
 +The **Behaviour** property determines whether Set or Reset must be dominant when both of them are 1. 
 + 
 +{{ :truthtable_lrelay.png |}} 
 + 
 +{{ :diagram_lrelay_sdom.png | Behavior of node when Set input is dominant}} 
 +<WRAP center 60%> <WRAP centeralign> Behavior of node when Set input is dominant </WRAP>  </WRAP> 
 + 
 +{{ :diagram_lrelay_rdom.png | Behavior of node when Reset input is dominant}} 
 +<WRAP center 60%> <WRAP centeralign> Behavior of node when Reset input is dominant </WRAP>  </WRAP> 
 +++++ 
 +++++Logic Matrix| {{ :logic_icons_logicMatrix.png?250 |}} 
 + 
 +The Logic Matrix, given some inputs determined by the **Number of inputs** property and some outputs determined by the **Number of outputs** property, forwards the value of a selected input to a selected output. The selection of inputs and outputs is decided by the value of two inputs, **Input selector** and **Output selector**.\\ 
 +The **Data type** property determines the inputs and outputs data type managed by the matrix; if it is set to //1 bit Boolean//, the inputs and outputs are the standard connectors for all the logic nodes as explained [[logic_module#input_connectors|here]], otherwise the **Inverted** property on the connectors won't be available. 
 + 
 +== Input and Ouput selectors == 
 + 
 +These connectors have two properties to define their behaviour: 
 +  * **Default control value** It indicates the default input/output with a number [0-255] representing the 0-base index of the input/output. 
 +  * **Update every control value** If enabled in the Input selector, outputs will be updated for every value received by the Input selector. If disabled, outputs will be refreshed only when the selected input receives a new value or, if this property is enabled in the Output selector, when the Output selector receives a new value. 
 +++++ 
 +++++ Nand| {{ :logic_icons_nandnode.png?200 |}} 
 + 
 +The Nand node is the opposite of the [[lm_logic_and|And node]], sends 0 on the output only when all the inputs are 1. 
 + 
 +{{ :truthtable_nand.png |}} 
 +++++ 
 +++++Nor| {{ :logic_icons_nor.png?200 |}} 
 + 
 +The Nor node is the opposite of the [[lm_logic_or|Or node]], sends 1 on the output only when all the inputs are 0. 
 + 
 +{{ :truthtable_nor.png |}} 
 +++++ 
 +++++Not| {{ :logic_icons_notnode.png?200 |}} 
 + 
 +The Not node accepts just one input, it inverts the value of the input. 
 + 
 +{{ :truthtable_not.png |}} 
 +++++ 
 +++++Or| {{ :logic_icons_ornode.png?200 |}} 
 + 
 +The Or node sends 1 on the output when at least one input is equal to 1. 
 + 
 +{{ :truthtable_or.png |}} 
 +++++ 
 +++++Pulse Relay| {{ :logic_icons_pulserelay.png?250 |}} 
 + 
 +The Pulse Relay node sends 1 to the output when the input **Set** is set to 1 and sends 0 to the output when the input **Reset** is set to 1. When both Set and Reset are 0, the previous state of the output is mantained. Whenever the input **Trigger** receives a rising edge signal, Set and Reset are ignored and the output is toggled.\\ 
 +The **Behaviour** property determines whether Set or Reset must be dominant when both of them are 1. 
 + 
 +{{ :diagram_prelay.png | Behavior of Pulse Relay}} 
 +<WRAP center 60%> <WRAP centeralign> Behavior of node when Set input is dominant </WRAP>  </WRAP> 
 + 
 +<WRAP center round important 60%>The Pulse Relay it is used to transform a pulse input in a toggle switch!\\ 
 +Set and Reset inputs are optional, if they are not connected to any other nodes, the Trigger input is the only input which controls the output.</WRAP> 
 +++++ 
 +++++Xand| {{ :logic_icons_xand.png?200 |}} 
 + 
 +The Xand node sends 1 on the output only when all the inputs are equal. 
 + 
 +{{ :truthtable_xand.png |}} 
 +++++ 
 +++++Xor| {{ :logic_icons_xor.png?200 |}} 
 + 
 +The Xor node sends 1 on the output when the inputs don't have the same value. 
 + 
 +{{ :truthtable_xor.png |}} 
 +++++ 
 + 
 +=== Input connectors ===
 All the input connectors of logic nodes have the following properties: All the input connectors of logic nodes have the following properties:
   * **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.   * **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.
   * **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.   * **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.
  
-== Output connectors ==+=== Output connectors ===
 All the output connectors of logic nodes have the following properties: 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.   * **Output sending behavior** It indicates when the value has to be forwarded to the connected nodes.
Line 180: Line 397:
  
 The Timer nodes represent time-based operations inside the scheme. The Timer nodes represent time-based operations inside the scheme.
-  [[lm_timer_pulsegen|Continuous Pulse Generator]] +++++Continuous Pulse Generator| {{ :logic_icons_pulsegen.png?330 |}} 
-  * [[lm_timer_onoffdelay|On/Off Delay]] + 
-  * [[lm_timer_pulsetrain|Pulse Train Generator]] +The Continuous Pulse Generator node, for all the time the value of the **Gate** connector is 1, generates pulses with the ON time specified by the **Factor for ON** property and the OFF time specified by the **Factor for OFF** property.\\ 
-  * [[lm_timer_random|Random Generator]] + 
-  * [[lm_timer_schedpulse|Scheduled Pulse]] + 
-  [[lm_timer_stairwell|Stairwell Lighting Switch]] +{{ :diagram_pulsegen2.png Behaviour of Continuous Pulse Generator }} 
-  * [[lm_timer_stopwatch|Stopwatch]]+<WRAP center 60%> <WRAP centeralign> Behaviour of Continuous Pulse Generator </WRAP>  </WRAP> 
 +++++ 
 +++++ On/Off Delay| {{ :logic_icons_onoffdelay.png?250 |}} 
 + 
 +The On/Off Delay node, for every rising edge of the **Input** connector signal, generates a rising edge on the **Output** connector after a delay specified by the **Factor for ON delay** property. When the **Input** signal has a falling edge, the node generates a falling edge on the **Output** connector after a delay specified by the **Factor for OFF delay** property.\\ 
 +When the value of the **Reset** connector is 1, the node immediately sends 0 to the **Output** connector. 
 + 
 + 
 +{{ :diagram_onoffdelay2.png Behaviour of On/Off Delay }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of On/Off Delay </WRAP>  </WRAP> 
 +++++ 
 + 
 +++++Pulse Train Generator| {{ :logic-icons_pulsetrain.png?300 |}} 
 + 
 +The Pulse Train Generator node, for every rising edge of the **Input** connector signal, generates a train of pulses on the **Output** connector with the ON time specified by the **Factor for ON** property and the OFF time specified by the **Factor for OFF** property. The number of sequential pulses to generate is determined by the **Pulse number** property.\\ 
 +When the value of the **Reset** connector is 1, the node immediately sends 0 to the **Output** connector. 
 + 
 + 
 +{{ :diagram_pulsetrain2.png Behaviour of Pulse Train Generator }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Pulse Train Generator with Pulse Number = 2 </WRAP>  </WRAP> 
 +++++ 
 +++++Random Generator| {{ :logic_icons_random.png?300 |}} 
 + 
 +The Random Pulse Generator node, for all the time the **Gate** connector value is 1, generates pulses with random times for ON and OFF.\\ 
 +The random time for ON will be included between **Minimum factor for ON** property and **Maximum factor for ON** property; the random time for OFF will be included between **Minimum factor for OFF** property and **Maximum factor for OFF** property. 
 + 
 + 
 +{{ :diagram_random2.png Behaviour of Random Generator }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Random Pulse Generator </WRAP>  </WRAP> 
 +++++ 
 +++++Scheduled Pulse{{ :logic_icons-schedpulse.png?250 |}} 
 + 
 +The Scheduled Pulse node, if the **Gate** connector value is 1, generates a pulse at a precise time of the day.\\ 
 +The time is specified by the **Scheduled Time** property, the pulse generated has a period determined by the properties **Factor for pulse duration** and **Time base for pulse duration**. 
 +++++ 
 +++++Stairwell Lighting Switch{{ :logic_icons_stairwell.png?300 |}} 
 + 
 +The Stairwell Lighting Switch node, when the **Input** connector value is 1, sends 1 to the **Output** connector and then starts a timer, at the expiration of the timer it sends 0 to the **Output** connector.\\ 
 +The timer is set to the time defined in the **Time for ON** property of the node and if the property **Retriggerable** is enabled, the timer restarts whenever the **Input** connector receives 1.\\ 
 +If the property **Manual OFF** is enabled, when the **Input** connector value goes to 0 the node sends 0 to the **Output** connector and automatically stops the timer; otherwise the expiration of the timer is the only condition to send 0 to the **Output** connector.\\ 
 +The **Warning** connector value goes to 1 before the timer expires until the **Output** connector is 1. The time for warning is specified through the **Warning before OFF** property. 
 + 
 +{{ :diagram_stairwell2.png | Behaviour of Stairwell Lighting Switch }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Stairwell Lighting Switch </WRAP>  </WRAP> 
 +++++ 
 +++++Stopwatch| {{ :logic_icons_stopwatch.png?250 |}} 
 + 
 +The Stopwatch node measures provides two modalities to determine how it should start counting time which are specified by the **Trigger policy** property: 
 +  * //Switch// The Stopwatch starts counting time when the **Input** connector value goes to 1, it pauses when the **Input** value goes to 0. Whenever the node pauses, it sends the time the **Input** value has been 1 to the **Partial time** connector and the total counted time to the **Total time** connector. 
 +  * //Toggle// The Stopwatch starts counting when it receives the first rising edge on the **Input** connector, all the other times it receives a rising edge it sends the time passed between the current rising edge and the previous one to the **Partial time** connector, and the total counted time to the **Total time** connector. 
 +When the **Reset** connector value is 1, the node stops counting the time and sends 0 to both **Partial time** and **Total** time, it will start counting again only after the **Reset** value goes to 0. 
 + 
 +{{ :diagram_stopwatch_switch.png Behaviour of Stopwatch with Trigger policy //Switch// }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Stopwatch with Trigger policy //Switch// </WRAP>  </WRAP> 
 + 
 +{{ :diagram_stopwatch_toggle.png | Behaviour of Stopwatch with Trigger policy //Toggle// }} 
 +<WRAP center 60%> <WRAP centeralign> Behaviour of Stopwatch with Trigger policy //Toggle// </WRAP>  </WRAP> 
 +++++
  
 ===== Math nodes ===== ===== Math nodes =====
Line 202: Line 476:
   * [[logic_module#math_nodes|Multiplication]]: It computes the multiplication of //n// input values and sends the result to the output connector   * [[logic_module#math_nodes|Multiplication]]: It computes the multiplication of //n// input values and sends the result to the output connector
   * [[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   * [[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
 +  * [[logic_module#math_nodes|Remainder]]: It computes the division of two inputs and sends the //remainder// to the output connector
 +  * [[logic_module#math_nodes|Round]]: Given an input, it rounds the value to the closest integer and sends it to the output connector
 +  * [[logic_module#math_nodes|Subtract]]: It computes the subtraction of //n// input values and sends the result to the output connector
 +
 +===== 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 bloc and the function "Regulator", it is possible to implement a regulation on an output given a setpoint and an actual temperature value. The two additional inputs in the expression are the "hysteresis" value, and the possibility to invert the result (1= inverted, 0= normal). The example shown in the picture above will send value 1 to Heat Valve and 0 to Cool Valve in case Setpoint > Actual, and value 0 to Heat Valve and 1 to Cool Valve in case Setpoint < Actual.
 +
 +++++
  • logic_module.1512031911.txt.gz
  • Last modified: 2019/03/20 17:03
  • (external edit)