Calculation Icon Properties

From Flowcode Help
Jump to navigationJump to search

<sidebar>Sidebar: Icon Properties</sidebar>

Btn Calculation.gif Gen Calculation Flowchart Icon 01.png Gen Calculation Icon Properties 01.png

Calculation icons allow the modification of variables. They can be used to check inputs and to create outputs.


Display Name

The name of the icon that appears on the flowchart.


Calculations

One or more lines of calculations can be entered into this box.

All calculations must consist of the name of an existing variable, and equals sign and an expression made up from numbers, variables and the following operators:

(, ) - Parentheses.

=, <> != - Equal to, Not equal to.

+, -, *, /, % - Addition, Subtraction, Multiplication, Division & Modulus.

<, <=, >, >= - Less than, Less than or equal to, Greater than, Greater than or equal to.

>>, << - Shift right, Shift left.

~, &, |, ^ - Bitwise NOT, AND, OR, Exclusive OR

NOT,AND,OR,XOR - Bitwise NOT, AND, OR, Exclusive OR

&&, ||, ! - Logical AND, OR, NOT


Numeric values can be in decimal (unmarked) or in HEX format (preceded by 0x) or in Binary format (preceded by 0b) e.g. 85 or 0x55 or 0b01010101.


Examples

Assuming that the variables have been previously defined, all the following are valid calculation lines.


DELAY = DELAY + 1

DELAY = (MYVAR + 3) * 3

NEXTBIT = LASTBIT >> 2 & MASK

AANDB = PORT_A AND PORT_B

INVX = NOT X


Variable and Function Box

This section is used to either select a variable or access a list of the available functions. You can reference ports directly or select from a list of available Global or Local variables. You can also view the list of available functions for mathematical and string functions.


Video instructions

See the Calculation video to learn how to use Calculation icon correctly with valid syntax, variables and expressions.

{{#ev:youtube|eycBIVJJiLc|640}}