BD18_BIT_COMPOSITION
PROGRAM BD18_8B_TEST
VAR
IN1: ARRAY [0 .. 63] OF BOOL;
O1: LINT;
END_VAR
O1:= LIB.Core.V1_0.BD18_BIT_COMPOSITION(IN := IN1);
END_PROGRAM
LIB\CORE
V1.0
Function brings bits together to create an integer value.
Input | Type | Description |
---|---|---|
ENABLED | BOOL | Enable function |
IN | ARRAY [0 .. 63] OF BOOL | Array of input values (bits) |
BS | BOOL | Sign of the out output, if OUT<0 then BS=FALSE |
IN0 | BOOL | First input (simple type) |
IN1 | BOOL | Second input (simple type) |
Output | Type | Description |
---|---|---|
OUT | LINT | Output value - bit composition of inputs. |
The block brings together the input bit values IN[0..63] to a lint output out.
At the example, simple type (BOOL) inputs are used rather than the input array of BOOLs. The block is used e.g. to create a unit status value, such as Off / On / Auto which corresponds to values of 0 / 1 / 2.