Skip to main content

7.6.3 PACK_BITS_TO_DWORD

Function

Realize the combination of 32 BOOL input quantities BIT0~BIT31 into a DWORD return value

LD graphics

alt text

Parameter description

Interface VariableDeclarationTypeDescription
BIT0Var_InputBOOLbit0 of the DWORD return value
BIT1Var_InputBOOLbit1 of the DWORD return value
BIT2Var_InputBOOLbit2 of the DWORD return value
BIT3Var_InputBOOLbit3 of the DWORD return value
BIT4Var_InputBOOLbit4 of the DWORD return value
BIT5Var_InputBOOLbit5 for the DWORD return value
BIT6Var_InputBOOLbit6 of the DWORD return value
BIT7Var_InputBOOLbit7 for the DWORD return value
BIT8Var_InputBOOLbit8 for the DWORD return value
BIT9Var_InputBOOLbit9 for the DWORD return value
BIT10Var_InputBOOLbit10 of the DWORD return value
BIT11Var_InputBOOLbit11 of the DWORD return value
BIT12Var_InputBOOLbit12 of the DWORD return value
BIT13Var_InputBOOLbit13 of the DWORD return value
BIT14Var_InputBOOLbit14 of the DWORD return value
BIT15Var_InputBOOLbit15 of the DWORD return value
BIT16Var_InputBOOLbit16 of the DWORD return value
BIT17Var_InputBOOLbit17 of the DWORD return value
BIT18Var_InputBOOLbit18 of the DWORD return value
BIT19Var_InputBOOLbit19 of the DWORD return value
BIT20Var_InputBOOLbit20 of the DWORD return value
BIT21Var_InputBOOLbit21 of the DWORD return value
BIT22Var_InputBOOLbit22 of the DWORD return value
BIT23Var_InputBOOLbit23 of the DWORD return value
BIT24Var_InputBOOLbit24 of the DWORD return value
BIT25Var_InputBOOLbit25 of the DWORD return value
BIT26Var_InputBOOLbit26 of the DWORD return value
BIT27Var_InputBOOLbit27 of the DWORD return value
BIT28Var_InputBOOLbit28 of the DWORD return value
BIT29Var_InputBOOLbit29 of the DWORD return value
BIT30Var_InputBOOLbit30 of the DWORD return value
BIT31Var_InputBOOLbit31 of the DWORD return value
Function nameReturn valueWORDConverted result

Example

  • LD sample animation is as follows:

alt text

  • ST example is shown in the following code:
OUT:=PACK_BITS_TO_WORD(
BIT0:=1,
BIT1:=1,
BIT2:=1,
BIT3:=1,
BIT4:=1,
BIT5:=1,
BIT6:=1,
BIT7:=1,
BIT8:=1,
BIT9:=1,
BIT10:=1,
BIT11:=1,
BIT12:=0,
BIT13:=1,
BIT14:=0,
BIT15:=1
);