You can create logic functions in the System Manager by clicking the brain icon in the task bar. Before you can create logic functions, you must have available I/O’s.
When you click on the “+” button next to the “Group” drop-down box, you can create a new logic group and enter the desired name.
When you click the "+" button next to the "Name" drop-down box, you will see a pop-up asking if you want to create binary or analog logic.
-
Binary Logic (If – Then – Else with ON/OFF)
Automatically an "if - then - else" logic will appear at random with a the first I/O’s you have created.
Double-clicking on the list of I/O’s, overwrites the I/O concerned in the highlighted line in the field of the logic expression.
You can add or delete lines by clicking the "Insert line" & "Delete line"-button.
You can switch the logic between AND and OR conditions by clicking the AND/OR button when the AND/OR line to be changed is highlighted. Every time you change from AND to OR (or vice versa), parentheses will be added automatically. The position of the brackets cannot be changed. Ouputs that are at the end of a logical expression will therefore have the most influence on the result.
You can also change the desired status of the selected I/O by clicking the On/Off button.
You can also change the desired I/O status by clicking the On/Off button. The options are "On ELSE Off," "Off ELSE On," or "On" or "Off," which will only trigger when all conditions are true and will do nothing if the conditions are NOT true.
You can also activate scenes using binary logic. Since you can only turn scenes on, the logic result will be "THEN PRx = On ELSE PRx+1 = On," or simply "THEN PRx = On." Keep in mind that scenes are also in groups of four in a Q-bus address, and the logic will be "THEN PRx = On ELSE PRx-1 = On" if the first scene is a multiple of four!
Remark
If you have a long list of I/O’s, you can use the "Filter" field in the list of I/O’s. Placing a name in the filter will only show you I/O’s that start with that name (if you marked the "Start"-option) or that have the letters involved in their names (if you marked the "Part"-key). You can also choose whether or not the word in the filter is case sensitive.
-
Analogue Logic (If – Then – Else with all values and operations x,/,+,-,<,>,=)
Analog logic allows you to activate I/O’s based on the status of another I/O, more than one other I/O, a calculation that uses I/O’s as parameters or is based on time.
For example, it might only be possible to switch on the heating in one room if, between two times (e.g.7:00 AM and 9:00 AM), the temperature in another room is < or = X degrees.
By pressing the "+" key next to the drop-down window in the Logic module, you can select the creation of analog logic. You will automatically get an IF - THEN - ELSE logic, with certain I/O’s already created.
Remark: To create logic functions, I/O’s must first be created.
Select I/O’s
To use different I/O’s in the logic expressions, first click on the I/O in the logic you want to change, then double click on the desired I/O in the list of I/O’s on the right.Select the calculation
When you highlight the characters (<,>,=) in the logical expression, you can change them by clicking the desired character to the right of the logical expression window. You can change the value by pressing the up or down arrow on the right side of the logical expression box. By highlighting a calculation (x,/,+,-) in the logical expression, you can change it by selecting the desired calculation on the right side of the window.Remark: use “> 0” in the logic expression to indicate that an I/O must be ON. If the I/O must be OFF, use “= 0”.
The conditions change
AND/OR conditions can be changed by highlighting the AND/OR condition in the logical expression and clicking the inverse on the right. AND/OR conditions can also be deleted by clicking "Delete Line", and you can add conditions by clicking the "Insert AND/OR" button.Any condition can also be used as a parameter in a calculation; highlight the I/O you want to use in the calculation and click the “Insert Edit” button.
Using the clock
Highlight an I/O in the logic expression, then click the "Time" button.Highlight the value next to the clock, and select a combination of month/day/weekday/hours/minutes or any of these elements alone. In this way, an I/O can be activated at a specific time.
Example: Switching configuration files between summer and winter
As mentioned earlier in Setup - SD banks, different configuration files (.qdb files) can be uploaded on different SD banks in the controller. Analog logic can be used to automatically switch between .qdb files based on time. For example, if you have a winter.qdb file (with heating controlled by clock times) and a summer.qdb file (without heating), you can automatically switch between winter and summer.Click on "Other" in the list of I/O’s to be able to select SD banks.
How does Qbus analogue logic work?
Syntax:
In contrast to binary logic, you first determine the value that you will send as a result to one or more I/O’s.
It is important to know that the calculation of the Qbus logic does NOT follow standard mathematical rules.• In Qbus logic, all operations are calculated from left to right and everything is calculated immediately before moving on to the next operation. For example:
1+1x0 is executed in Qbus from left to right, or 1+1 = 2, 2x0=0 (mathematically, the multiplication is normally worked out first, before the addition, so that according to the mathematical operation the result would be: 1+ (1x0) = 1+0 = 1).
• Qbus logic counts within a range of 0 to 65535. But the result of any operation can never be more than 255 and never less than 0. For example:
255+255=255
255+255/4=127
0-255=0
In combination with the calculation that is done from left to right, and that every operation
computed first before continuing, we get the following: 255+255/4 = (255+255)/4 = 510/4=127.• If one logical operation contains both analog operations (%, volts, ...) and "binary" operations (ON/OFF, UP/DOWN), then all analog operations must be listed first followed by the binary operations. E.g.:
IF 0<1
THEN analog value 1 --> analog value 2
THEN analog value 3 --> analog value 4
THEN analog value 5 --> binary I/O 1Addition and subtraction:
An I/O that is ON is also represented as 255. In analog logic this means that adding up two I/O’s that are both ON (ON+ON = ON) can also be shown as follows: 255+255=255.
Multiply
Since Qbus counts between 0 and 255, all percentage values are also reduced compared to 255. A dimmer that lights up 5% is shown in the Qbus protocol as 5% of 255 = 13 (rounded). If percentages are then multiplied, a different result is obtained than the mathematically calculated result. E.g. 5% x 5%: is first converted relative to 255 (so 13 x 13 = 169), and then this result is again displayed relative to 255 in percent (169/255 = 66.3%).
TIP: If you wish to multiply by an analog variable equal to 1, use 0.4% to multiply (0.4% of 255 = 1). For example, Light 80% x Presence 0.4% = 80%.
Also when multiplying, a value can never be less than 0 and never be more than 255. So if you multiply with an ON/OFF I/O, the result is always 0 (=OFF) or 255 (=ON). E.g.: Light 80% x presence ON (=255) = 100%. Light 80% x presence OFF (=0) = 0%.
The analog logic internally calculates all intermediate operations on 16 bits (0-65535) but the result is always a byte (0-255)
Depending on the mode, this is displayed correctly (dimmer 0-100%, TH 0-63.5°C +/- offset, ...)When using universal I/O’s in analog logic, the values are multiplied by a fixed factor (5). This gives a range of more than 10 bits.
A maximum value up to 1275 (255 x 5) can thus be tested. In the following example, where the multiplier is set to 0.01, a power can be tested up to a maximum of 12.75 kW