Computation Blocks
Overview
The FBD editor uses various computation blocks accessible through the
bar in the Toolbox:Compare Block
The block compares two 16-bit
register values.
FBD symbol |
Arguments |
Description |
---|---|---|
Inputs |
|
|
Outputs |
|
Add Block
The block performs an unsigned
addition of two 16-bit register values.
FBD symbol |
Arguments or Example |
Description |
---|---|---|
Inputs |
|
|
Outputs |
|
|
Example |
Assuming X = 60,000 and Y = 7,000, the overflow will be ON because 60,000 + 7,000 = 67,000, which is superior to 65,536. The result Z is then equal to 1,464 (1,464 + 65,356 = 67,000). |
Subtraction Block
The block performs an unsigned
subtraction of two 16-bit register values.
FBD symbol |
Arguments or Example |
Description |
---|---|---|
Inputs |
|
|
Outputs |
|
|
Example |
Assuming X = 5 and Y = 10, the underflow will be ON because the result is negative. The result Z is then equal to 65,531 (65,531 – 65,536 = –5) |
Multiplication Block
The block performs an unsigned
multiplication of two 16-bit register values.
FBD symbol |
Arguments or Example |
Description |
---|---|---|
Inputs |
|
|
Outputs |
|
|
Example |
Assuming X = 20,000 and Y = 10, the result will be Z(h) = 3 and Z(l) = 3,392 because 200,000 = 3 * 65,536 + 3,392 |
Division Block
The block performs an unsigned
division of two 16-bit register values.
FBD symbol |
Arguments or Example |
Description |
---|---|---|
Inputs |
|
|
Outputs |
|
|
Example |
Assuming X(h) = 3, X(l) = 3,392 and Y = 40, the result will be Z(h) = 0 and Z(l) = 5,000 because X(h) * 65,536 + X(l) = 3 * 65,536 + 3,392 = 200,000 and 200,000 /Y = 5,000 = 0 * 65,536 + 5,000 |