Chapter 4. Ladder Diagram (LD) ProgrammingGFK-2950C February 2018 734.2.4 Bit Set, Bit ClearMnemonicsBIT_SET_DWORDBIT_SET_WORDBIT_CLR_DWORDBIT_CLR_WORDThe Bit Set (BIT_SET_DWORD and BIT_SET_WORD) function sets a bit in a bit string to 1. The BitClear (BIT_CLR_DWORD and BIT_CLR_WORD) function clears a bit in a string by setting the bit to 0.Each scan that power is received; the function sets or clears the specified bit. If a variable rather thana constant is used to specify the bit number, the same function can set or clear different bits onsuccessive scans. Only one bit is set or cleared, and the transition information for that bit is updated.The transition status of all the other bits in the bit string is not affected.The function passes power flow to the right, unless the value for BIT is outside the specified range.Operands for Bit Set, Bit ClearParameter Description Allowed Operands OptionalLength (??) The number of WORDs or DWORDs in thebit string. 1 Length 256.Constants NoIN The first WORD or DWORD of the data toprocessAll except constants, flow, and variableslocated in %SNoBIT The number of the bit to set or clear in IN.1 BIT (16 × Length) for WORD.1 BIT (32 × length) for DWORDAll except variables located in %S - %SC NoExample 1Whenever input V_I0001 is set, bit 12 of the string beginning at reference%R00040 (as specified by variable V_R0040) is set to 1.Example 2Whenever V_I00001 is set, %M00043, the third bit of the string beginning at%M00041, is set to 1. Note that neither the status nor the transition value of anyof the other bits in the same byte as %M00043 (e.g., %M00041, %M00042,%M00044, etc.) is affected by the BIT_SET function