Logic Builder Blocks
The blocks are elements used in Logic Builder that, interconnected, build routines and programs.
The blocks are divided in the following categories.
Start routine
Program Variables
Macros
Operation blocks/ Built in blocks
Start Routine
This is a block found on all routines and programs. Its purpose is to mark the start of a routine,
If the routine is set to run On Event, the block will also include a Condition port. This is useful when the routine needs to run if some conditions are met. The condition can be a Get block, a macro or an operator block
Program Variable Blocks
These are blocks that provide data (for example a temperature sensor).The variables present 2 blocks, a Get and a Set block.
The Get block can be used as a condition on a runtime. An example is this Alarm Routine where roomTemp get is used as a trigger for the alarm.
The Set block is used to write a value following meeting a condition, which can be a block or an entire routine. It can also be used as a condition on itself
Like variables, variable blocks are color-coded by type as follows:
Number - Purple
Boolean - Green
String - Gold
Time/Date -Teal
Number Blocks
These blocks are representations of number type variables. The Set Block can be completed with a numerical value, either manually or via a routine.
Boolean Blocks
These blocks are representations of boolean type variables. The Set Block can be completed with a true
or false
value, either manually or via a routine.
String Blocks
These blocks are representations of string or enum type variables. The Set Block can be completed with string values, either manually or via a routine.
Time/Date Blocks
These blocks are representations of date or time type variables. The Set Block can be set to a point in time or on a calendar date.
Macro Blocks
These are special blocks that can contain entire routines or expressions (double-clicking on a macro in the Variable/Routines will open a new workspace). These blocks are coloured dark blue
Built in blocks
These are presented in the Block Library. These are used to channel conditions and commands between other types of blocks. These are coloured grey.
To lookup a block in the library, users can either look them up using the search bar or they can search through Categories.
The complete list of built-in blocks is presented below.
Category | Block | Description |
---|---|---|
Commands | Add delay to condition after a transition from false to true before evaluating to true. Units to use are: sec, min, hr | |
Commands | Send an email using the configured SMTP connector. | |
Commands | setExternal | Variable set from an external program |
Commands | wait | Pause the routine for a specific amount of time. Units to use are: sec, min, hr, and day? |
Control Flow | If block performs boolean condition flow control between then and else. | |
Control Flow | return | Return exits the routine and returns given expression value |
Expression | count | Count number of the items which match a condition |
Expression | gridSelectCol | Selects the column of a grid |
Expression | gridSize | Number of rows in a grid. |
Expression | LeadLag is used to schedule a number of units on/off. The 'units' property should be set to a bundle variable that imports the list units the command from the *unit program*. The unit program must have three variables for each unit:
This block's 'numOn' property is used to command all the units on or off. | |
Expression | leadLagStageSelect | LeadLagStageSelect |
Expression | limit | Limit val between an inclusive min and max |
Expression | Proportional integral derivative loop | |
Expression | random | Generate a random number between min and max inclusive on every cycle |
Language | Generate an alarm based on a boolean variable. Further info about alarms can be found here. Alarm program example. | |
Language | boolLatch | Latch a boolean input when it transitions to true after a configurable delay period. Once latched the output remains true until the reset is triggered to true. |
Language | callRoutine | Call a routine within the same program by name |
Language | comment | Comment |
Language | exprStmt | Statement wrapper for expression with side-effects |
Language | reset | Reset block computes output based on two linear equations. The input is clipped to inLo and inHi, the percentage of input along the linear segment between inLo and inHi is computed, and then that percentage is output as a Number between outLo and outHi. |
Language | return | Return exits the routine and returns given expression value |
Language | Compute number of stages which should be one. Delays are in seconds. | |
Language | tag | Name/value pair added to a `Tags` block |
Language | tags | Builds a dict of name/value tag pairs |
Language | delayedOutput | DelayedOutput - duration is in seconds. |
Language | dictGet | Bundles variables in a dict |
Language | jobRun | Checks if a value is an instance of a given type |
Language | varCapture | Capture current variables as a dict |
Logical | all | Returns if all items in a collection matches a condition |
Logical | Logical-and of boolean values | |
Logical | any | Returns if any item in a collection matches a condition |
Logical | Equality comparison | |
Logical | Greater than comparison | |
Logical | Greater than or equal comparison | |
Logical | Less than comparison | |
Logical | Less than or equal comparison | |
Logical | Not equal comparison | |
Logical | inRange | Return if val is between an inclusive min and max |
Logical | not | Logical not of boolean value |
Logical | or | Logical-or of boolean values |
Logical | xor | Logical exclusive-or of two boolean values |
Logical | Checks if a value is an instance of a given type | |
add | Addition: '∑ vals'. Any val which doesn't evaluate to a number is ignored. If no vals evaluate to a number then return null. | |
avg | Fold vals their standard average or arithmetic mean. Any val which doesn't evaluate to a number is ignored. If no vals evaluate to a number then return null. | |
div | Multiply: 'vals₀ × vals₁ × vals₂ ...'. Any val which doesn't evaluate to a number is ignored. If no vals evaluate to a number then return null. | |
isEven | Check if a number is even whole integer | |
isOdd | Check if a number is odd whole integer | |
max | Maximum of vals. Any val which doesn't evaluate to a number is ignored. If no vals evaluate to a number then return null. | |
min | Minimum of vals. Any val which doesn't evaluate to a number is ignored. If no vals evaluate to null | |
modulo | Modulo/remainder: 'a % b'. Return null if a or b doesn't evaluate to number. | |
Multiply: 'vals₀ × vals₁ × vals₂ ...'. Any val which doesn't evaluate to a number is ignored. If no vals evaluate to a number then return null. | ||
neg | Negate: '-val'. Return null if val doesn't evaluate to number. | |
Generate a sine wave | ||
Others | cosineWave | Generate a cosine wave |
Subtract: 'a - b'. Return null if a or b doesn't evaluate to number. | ||
Threshold returns true when input is above or below a setpoint with configurable deadband. | ||
Check if the base number is above the input number by a threshold | ||
abs | Return the absolute value of the number | |
Check if the base number is below the input number by a threshold | ||
limit | Limit val between an inclusive min and max | |
pow | Power a^b. Returns null if a or b does not evaluate to a number | |
random | Generate a random number between min and max inclusive on every cycle | |
reset | Reset block computes output based on two linear equations. The input is clipped to inLo and inHi, the percentage of input along the linear segment between inLo and inHi is computed, and then that percentage is output as a Number between outLo and outHi. | |
within | Verifies if the provided numbers are within an offset from the base | |
sqrt | Sqrt: '√val'. Return null if val does not evaluate to a number. | |
Others | invoke | Invokes an arbitrary Fantom or Axon function.The invoke block will apply certain execution time restrictions on the function invoked. |
Others | ternary | Check if condition is true and evaluates the true block, otherwise evaluates the false block |
Others | Converts an Analog value (number) to a Digital value (boolean). Output FALSE only if output is 0, otherwise the output will be 1. | |
Others | Converts a Digital value (boolean) to an Analog value (number). A value of TRUE returns 1 and a value of FALSE returns 0. | |
Others | Receives in input a dry bulb temperature value (°C) and a relative humidity value (%) and it calculates the Dew Point (°C). | |
Others | If input is TRUE, holds the TRUE output for a defined amount of time. If both durations are set, onDuration (seconds) wins over onStatusDuration. | |
Others | Holds the max value received in input. | |
Others | Holds the min value received in input. | |
Others | Start from pulse input and defined both scaling and scalingMultiplier, the pulse input is used to define a pulsesPerMinute variable. Output value is calculated and updated every minute. If the reset input is set to TRUE, the output value goes back to 0. | |
Others | Starting from pulse input and defined both scaling and scalingMultiplier, the pulse input is used to define a pulsesPerMinute variable. Output value is added to the previous value and it's updated every minute. If the reset input is set to TRUE, the output value goes back to 0. | |
Others | Starting from pulse input and defined both scaling and scalingMultiplier, the pulse input is used to define a pulsesPerInterval variable. Output value (kWh) is updated every thermalOutputCalculationInterval. | |
Others | Calculates operations on History Values (Max, Min, Average). This block concats the hisRead function with the hisRollUp function and then applies Max, Min, or Avg. | |
Others | The output is a numeric value that increases or deceases based on rising edge of the given inputs. The output won't go below zero. | |
Others | If input is TRUE, the output turns to TRUE only when time expires. | |
Others | Calculates the Enthalpy when given in input a temperature (°C) and a humidity (%). Output will be in kJ/kg measure. | |
Others | mode |
|
Others | note |
|
Others | state |
|
Others | analogToDigitalByValue | Converts an Analog value (number) to a Digital value (boolean). |
Others | digitalToAnalogByValue | Converts a Digital value (boolean) to an Analog value (number). |
Others | dateAdd | Add a duration from a DateTime. |
Others | dateSub | Substract a duration from a DateTime. |
Others | dateToDateAdd | Add one date to another -- returns duration (always day). |
Others | dateToDateSub | Subtract one date from another -- returns duration (always day). |
Strings | strCapitalize | Changes first letter of a string to upper case character. |
Strings | strConcat | String concatenation |
Strings | strContains | Compares if a val string contains substring |
Strings | strDecapitalize | Changes first letter of a string to lower case character. |
Strings | strEndsWith | Compares if a val string ends with substring |
Strings | strFormat | String format - see `format()` |
Strings | strLower | Changes all ASCII letters to lower case |
Strings | strMacro | Str macro pattern which uses the same syntax as `disMacro` and `haystack::Etc.macro`. The macro variables are resolves against the task's variables. |
Strings | strReplace | String replace |
Strings | strSize | Number of characters in a string |
Strings | strStartsWith | Compares if a val string starts with substring |
Strings | strUpper | Changes all ASCI letters to upper case |
date | Get the Date part of a DateTime | |
dateTimeAdd | Add a duration from a DateTime. If no units are supplied, then minutes will be assumed. | |
dateTimeSub | Substract a duration from a DateTime. If no units are supplied, then minutes will be assumed. | |
dateToNumber | Convert a date to a number | |
dateToString | Convert a portion of a date to a string | |
dtToDtAdd | Add one dateTime to another -- returns duration (always minutes or seconds). | |
dtToDtSub | Subtract one dateTime from another -- returns duration (always minutes or seconds). | |
now | Get the current DateTime for this server | |
siteDateTime | Get the current dateTime for the site associated with the target | |
time | Get the Time part of a DateTime | |
timeToMinutes | Convert a Time to minutes | |
timeToTimeAdd | Add one time to another -- returns duration (always minutes). | |
timeToTimeSub | Sub one time to another -- returns duration (always minutes). | |
weatherConditions | Get the conditions from a forecast. Weather Conditions are: unknown, clear, partlyCloudy, cloudy, showers, rain, thunderstorms, ice, flurries, snow. | |
weatherInfo | Get the temperature information from a forecast | |
weatherSunrise | Get the sunrise from a forecast | |
weatherSunset | Get the sunset from a forecast | |
| This entry contains the user created macro blocks, including Expressions |