Chapter 7. CPU Program DataGFK-2816F August 2015 127Bit in Word ReferencesBit in word referencing allows you to specify individual bits in a word reference type as inputsand outputs of Boolean expressions, functions, and calls that accept bit parameters (such asparameterized blocks). This feature is restricted to word references in retentive memory. Thebit number in the bit within word construct must be a constant.You can use the programmer or an HMI to set an individual bit on or off within a word, ormonitor a bit within a word. Also, C blocks can read, modify, and write a bit within a word.Bit in Word references can be used in the following situations:■ In retentive 16-bit memory (AI, AQ, R, W, P, and L) and symbolics.■ On all contacts and coils except legacy transition contacts (POSCON/NEGCON) andtransition coils (POSCOIL/NEGCOIL).■ On all functions and call parameters that accept single or unaligned bit parameters.Functions that acceptunaligned discrete referencesParametersARRAY MOVE (BIT) SR and DSARRAY RANGE (BIT) QMOVE (BIT) IN and QSHFR (BIT) IN, ST and QThe use of Bit in Word references has the following restrictions:■ Bit in Word references cannot be used on legacy transition contacts(POSCON/NEGCON) and transition coils (POSCON/NEGCON).■ The bit number (index) must be a constant; it cannot be a variable.■ Bit addressing is not supported for a constant.■ Indirect references cannot be used to address bits in 16-bit memory.■ You cannot force a bit within 16-bit memory.Examples::%R2.X [0] addresses the first (least significant) bit of %R2%R2.X [1] addresses the second bit of %R2. In the examplesIn the examples [0] and [1] are the bit indexes. Valid bit indexes for the different variabletypes are:BYTE variable [0] through [7]WORD, INT, or UINT variable [0] through [15]DWORD or DINT variable [0] through [31]