====== Bit decomposition, 8 bits ====== {{:en:mervis-ide:35-help:bd19_8b.png}} ===== Block name ===== BD19_BIT_DECOMPOSITION_8BIT ===== ST call ===== PROGRAM BD19_8B_TEST VAR I1: USINT; O1: ARRAY [0 .. 7] OF BOOL; FB: LIB.CORE.V1_0.BD19_BIT_DECOMPOSITION_8BIT; END_VAR FB(IN := I1, OUT=>O1); END_PROGRAM ===== Library ===== LIB\CORE ===== Version ===== V1.0 ===== Description ===== The function decomposes an integer value to 8 bits (which are formed in an array). ===== Inputs ===== |Input |Type |Description | |ENABLED|BOOL |Enable of function.| |IN |USINT|Input value. | ===== Outputs ===== |Output|Type |Description | |OUT |ARRAY [0 .. 7] OF BOOL|Output array of values| ===== Function ===== The block decomposes the input integer value //IN// to individual bits //OUT[0..7]//. Note: The output array elements are numbered from 0, while the optional binary outputs out1, out2, out3 etc. start with index 1. Thus, e.g. out3 binary output is the value of the out[2] array element. ===== Application example ===== {{:en:mervis-ide:35-help:bd19_8b_example.png}}\\ The block is used to extract bits from an integer value, i.e. status and alarm bits communicated from a 3rd party device.