This article lists all available Function Blocks in Sense&Control with their short code identifiers and descriptions. The reader of this article should have basic understanding of the Sense&Control concept. If not, please visit the Sense&Control Introduction article first.
What is a Function Block?
A Function Block implements a specific function. This can be a simple mathematical operator or a complex implementation. Depending on their type, Function Blocks accept one or more inputs and have at least one output. For more information about Function Block and how to use them see Sense&Control Introduction.
Quick Reference List
Short Code ID | Name |
&{num}{x} | AND (Binary) |
|{num}{x} | OR (Binary) |
^{num}{x} | XOR (Binary) |
b{num}{x} | Boolean (Binary) |
!{num}{x} | NOT (Binary) |
+{num}{x} | Add |
-{num}{x} | Subtract |
*{num}{x} | Multiply |
/{num}{x} | Divide |
%{num}{x} | Modulo |
~{num}{x} | Negate |
={num}{x} | Equals |
>{num}{x} | Greater/Lower Than |
>={num}{x} | Greater/Lower Than or Equals |
m{num}{x} | Single Bit Memory |
p{num}{x} | Conditional Pulse |
t{num}{x} | Timer |
d{num}{x} | Delay |
dc{num}{x} | Down Clock |
c{num}{x} | Counter |
sd{num}{x} | Signal Delay |
Detailed Reference List
&{num}{x}
AND Operator (Binary)
This operator outputs a positive number if both inputs are set. Function: o = a & b.
Arguments
- num:
- Unique number per AND operator. Should be higher than 0.
- Example:
&1a
,&1b
for inputs,&1o
for the output.
- x:
- a: Input A.
- b: Input B.
- o: Output.
In / Output
This truth table gives an overview of the output in relation to input A and B.
o: a & b
0: 0 0
0: 1 0
0: 0 1
1: 1 1
|{num}{x}
OR Operator (Binary)
This operator outputs a positive number if one or both inputs are set. Function: o = a | b.
Arguments
- num:
- Unique number per OR operator.
- Example:
|1a
,|1b
for inputs,|1o
for the output.
- x:
- a: Input A.
- b: Input B.
- o: Output.
In / Output
This truth table gives an overview of the output in relation to input A and B.
o: a | b
0: 0 0
1: 1 0
1: 0 1
1: 1 1
^{num}{x}
XOR Operator (Binary)
This operator outputs a 1 if there is an uneven number of inputs 1. Function: o = a ^ b.
Arguments
- num:
- Unique number per XOR operator.
- Example:
^1a
,^
1b
for inputs,^1o
for the output.
- x:
- a: Input A.
- b: Input B.
- o: Output.
In / Output
This truth table gives an overview of the output in relation to input A and B.
o: a ^ b
0: 0 0
1: 1 0
1: 0 1
0: 1 1
b{num}{x}
Boolean Operator (Binary)
This operator outputs a 1 if the input is not equal to 0.
Note: A negative number on the input results in 1 on the output.
Arguments
- num:
- Unique number per Boolean operator.
- Example:
b1i
input,b1o
for the output.
- x:
- i: Input.
- o: Output.
In / Output
o: i
0: 0
1: >0
1: <0
!{num}{x}
NOT Operator (Binary)
This operator inverts the binary input. Function: o = !i.
Arguments
- num:
- Unique number per Boolean operator.
- Example:
!1i
input,!1o
for the output.
- x:
- i: Input.
- o: Output.
In / Output
This truth table gives an overview of the output in relation to input A and B.
o: !i
0: 1
1: 0
+{num}{x}
Add Operator
This operator adds the two integer numbers of both inputs and outputs the sum as integer. Function: o = a + b.
Arguments
- num:
- Unique number per Add operator.
- Example:
+1a
,+1b
for inputs,+1o
for the output.
- x:
- a: Augend input.
- b: Addend input.
- o: Sum.
In / Output examples
o: a + b
0: 0 0
-1: -2 1
5: 1 4
...
-{num}{x}
Subtract Operator
This operator subtracts two integer numbers of both inputs and outputs the result as integer. Function: o = a - b.
Arguments
- num:
- Unique number per Subtract operator.
- Example:
-1a
,-1b
for inputs,-1o
for the output.
- x:
- a: Minuend input.
- b: Subtrahend input.
- o: Difference output.
In / Output examples
o: a - b
0: 0 0
1: 2 1
-3: 1 4
...
*{num}{x}
Multiply Operator
This operator multiplies two integer numbers of both inputs and outputs the result as integer. Function: o = a * b.
Arguments
- num:
- Unique number per Multiply operator.
- Example:
*1a
,*1b
for inputs,*1o
for the output.
- x:
- a: Multiplicand input.
- b: Multiplier input.
- o: Product output.
In / Output examples
o: a * b
0: 0 0
-6: -3 2
8: 2 4
...
/{num}{x}
Divide Operator
This operator divides two integer numbers and outputs the result as an integer. Dividing by zero results in 0 on the output. Function: o = a / b.
Arguments
- num:
- Unique number per Divide operator.
- Example:
/1a
,/1b
for inputs,/1o
for the output.
- x:
- a: Dividend input.
- b: Divisor input. If 0, the output is 0.
- o: Quotient output.
In / Output examples
o: a / b
0: 0 / 0
0: 0 2
-2: -8 4
5: 10 2
...
%{num}{x}
Modulo Operator
This operator divides two integer numbers and outputs the remainder result as integer. Function: o = a % b.
Arguments
- num:
- Unique number per Modulo operator.
- Example:
%1a
,%1b
for inputs,%1o
for the output.
- x:
- a: Dividend input.
- b: Divisor input.
- o: Remainder output.
In / Output examples
o: a % b
0: 4 2
1: 5 2
3: 11 4
...
~{num}{x}
Negate Operator
This operator takes the inverse of the integer input and returns this as integer number on the output. Basically it adds or removes the sign to or from the input Function: o = ~i.
Arguments
- num:
- Unique number per Inverse operator.
- Example:
~1i
for input,~1o
for the output.
- x:
- i: Input.
- o: Output.
In / Output examples
o: ~i
0: 0
-1: 1
5: -5
...
={num}{x}
Equals Operator
This operator tests if both integer numbers on inputs A and B are equal, if true the output will be set. Function: o: a == b.
Arguments
- num:
- Unique number per Equals operator.
- Example:
=1a
,=1b
for inputs,=1o
for the output.
- x:
- a: Input A.
- b: Input B.
- o: Output.
In / Output examples
o: a == b
0: 4 2
1: 5 5
0: -2 0
...
>{num}{x}
Greater/Lower Than Operator
This operator tests if input A is greater than input B, if true the output will be set. Function: o: a > b. If a lower than operator is required, just switch inputs A and B. Function: o: b < a.
Arguments
- num:
- Unique number per Greater/Lower Than operator.
- Example:
>1a
,>1b
for inputs,>1o
for the output.
- x:
- a: Input A.
- b: Input B.
- o: Output.
In / Output examples
o: a > b
0: 4 2
1: 2 -4
...
>={num}{x}
Greater/Lower Than or Equals Operator
This operator tests if input A is greater than or equal to input B, if true the output will be set. Function: o: a >= b. If a lower than or equals operator is required, just switch inputs A and B. Function: o: b <= a.
Arguments
- num:
- Unique number per Greater/Lower Than or Equals operator.
- Example:
>=1a
,>=1b
for inputs,>=1o
for the output.
- x:
- a: Input A.
- b: Input B.
- o: Output.
In / Output examples
o: a >= b
0: 4 2
1: 5 5
1: 8 -1
...
m{num}{x}
Single Bit Memory
This memory element can store a single bit. When the set input becomes non zero, the output becomes 1 until the reset input is triggered. While reset is active the output remains zero.
Arguments
- num:
- Unique number per Single Bit Memory element.
- Example:
m1s
,m1r
for inputs,m1o
for the output.
- x:
- s: Set input.
- r: Reset input clears memory, output is zero.
- o: Outputs current memory state.
In / Output examples
o: s, r
1: 1, 0 -> 1: 0, 0 -> 0: 0, 1
p{num}{x}
Conditional Pulse
Generates a pulse on the output when the input value changes and the difference between the new and old value is equal to the Trigger difference value. The length of the pulse has the shortest possible duration. If the Trigger difference value is set to 0, then every state change of Input will cause a pulse. Function: (( i[new] - i[old] ) == v ) or ( v == 0 ) then o = pulse [1,0]
Arguments
- num:
- Unique number per Conditional Pulse element.
- Example:
p1i
,p1v
for inputs,p1o
for the output.
- x:
- i: Input value.
- v: Trigger difference input. Positive, zero and negative values are allowed.
- o: Pulse output
In / Output examples
i v: [o]
0 0: [0,0] -> 1 0: [1,0] -> 1 0: [0,0] -> 0 0: [1,0]
0 1: [0,0] -> -1 0: [1,0] -> -1 0: [0,0] -> 0 0: [0,0]
0 -1: [0,0] -> 1 0: [0,0] -> 0 0: [1,0] -> 0 0: [0,0]
t{num}{x}
Timer
If the Set input is non-zero, the output will be 1. When the input is then set to 0, then the output will remain 1 until a certain amount of state changes (positive and negative) has occurred to the Timer ticks input. This amount is equal to value set by Duration input.
Arguments
- num:
- Unique number per Timer element.
- Example:
t1s
,t1v
,t1t
for inputs,t1o
for the output.
- x:
- s: Set input. Resetting this from non-zero to zero starts the timer.
- v: Duration input. Determines the number of Timer ticks before resetting output to zero.
- t: Timer ticks input or Clock signal.
- o: Output.
In / Output examples
v: 3
t: 0 1 0 1 0 1
s:o -> 0:0 -> 1:1 -> 0:1 -> 0:1 -> 0:1 -> 0:0
d{num}{x}
Delay
When Set input becomes non-zero, then the output will become 1 after a certain amount of state changes has occurred to Timer ticks input. This amount is equal to the value set by Duration input. The output will remain 1, until Reset input becomes non-zero. If the Duration is less than or equal to 0, then this acts identical as the Boolean operator.
Arguments
- num:
- Unique number per Delay element.
- Example:
d1s
,d1r
,d1v
,d1t
for inputs,d1o
for the output.
- x:
- s: Set input.
- r: Reset input
- v: Duration input.
- t: Timer ticks input or Clock signal.
- o: Output.
In / Output examples
v: 3
t: 0 1 0 1 0 1 0
s,r:o -> 0,0:0 -> 1,0:0 -> 0,0:0 -> 0,0:0 -> 0,0:0 -> 0,0:1 -> 0,1:0
dc{num}{x}
Down Clock
Reduces the incoming clock speed of Ticks input by the Tick-rate divisor. For example, if the Ticks input is the standard 5 Hz clock signal, and the Tick-rate divisor is 600, then function block will change it's output state once per minute. Function: o[Hz] = t[Hz] / v
Arguments
- num:
- Unique number per Down Clock element.
- Example:
dc1v
,dc1t
for inputs,dc1o
for the output.
- x:
- v: Tick-rate divisor, range: equal or greater than 0. If set to 0, the output will be 0.
- t: Ticks input or Clock signal.
- o: Output clock signal.
In / Output example
v: 4
t: 010101010101010101010101
0: 000011110000111100001111
c{num}{x}
Counter
Counts the amount of state changes that has occurred to Input, and outputs it. The counter can be reset to 0 by making the Reset non-zero. As long as Reset is non-zero, the counter will not count.
Arguments
- num:
- Unique number per Counter element.
- Example:
c1v
,c1r
for inputs,c1o
for the output.
- x:
- v: Input.
- r: Reset the counter to zero.
- o: Outputs the current counter value.
In / Output example
v,r:o
0,0:0 -> 1,0:1 -> 0,0:2 -> 1,0:3 -> 0,0:4 -> 1,0:5 -> 0,1:0
sd{num}{x}
Signal Delay
Captures input changes and outputs it after the amount specified by the Total delay input. The internal operation of this control can be compared with a FIFO register. The Reset input can be used to reset the Signal Delay and start over. The Signal Delay will not operate while Reset input is 0, the output will be 0.
Arguments
- num:
- Unique number per Signal Delay element.
- Example:
sd1s
,sd1r
,sd1c
for inputs,sd1o
for the output.
- x:
- s: Signal input.
- r: Reset input.
- c: Total delay elements. Number should be constant. Valid range: min 0, max 60.
- o: Delayed signal output.
In / Output example
c: 3
s,r:o
0,0:0 -> 3,0:0 -> 4,0:0 -> 5,0:0 -> 6,0:3 -> 0,0:4 -> 0,0:5 -> 0,0:6
Comments
0 comments
Please sign in to leave a comment.