Skip to main content

7.6.7 UNPACK_BYTE_TO_BIT

Function

Realize the disassembly and output of 1 BYTE input into 8 BOOL outputs

LD graphics

alt text

Parameter description

Interface VariableDeclarationTypeDescription
IN_BYVar_InputBYTEBYTE input amount
BIT0Var_OutputBOOLValue input bit0 of BYTE
BIT1Var_OutputBOOLValue input bit1 of BYTE
BIT2Var_OutputBOOLValue input bit2 of BYTE
BIT3Var_OutputBOOLValue input bit3 of BYTE
BIT4Var_OutputBOOLValue input bit4 of BYTE
BIT5Var_OutputBOOLValue input bit5 of BYTE
BIT6Var_OutputBOOLValue input bit6 of BYTE
BIT7Var_OutputBOOLValue input bit7 of BYTE

Example

  • LD sample animation is as follows: alt text

  • ST example is shown in the following code:

UNPACK_BYTE_TO_BIT(
IN_BY:=IN1,
BIT0=>bVar0,
BIT1=>bVar1,
BIT2=>bVar2,
BIT3=>bVar3,
BIT4=>bVar4,
BIT5=>bVar5,
BIT6=>bVar6,
BIT7=>bVar7
);