Direccionamiento de bits

El direccionamiento de bits se utiliza para acceder a un bit particular en un contenedor más grande. Los contenedores más grandes incluyen cualquier entero, estructura, o matriz de BOOL. Por ejemplo:
Definición
Ejemplo
Descripción
Variable0
definida como LINT
tiene 64 bits
variable0.42
Este ejemplo hace referencia al bit 42 de variable0.
variable1
definida como DINT
tiene 32 bits
variable1.2
Este ejemplo hace referencia al bit 2 de variable1.
variable2
definida como INT
tiene 16 bits
variable2.15
Este ejemplo hace referencia al bit 15 de variable2.
variable3
definida como SINT
contiene 8 bits
variable3.[4]
Este ejemplo hace referencia al bit 4 de variable3.
variable4
definida como estructura COUNTER
tiene 5 bits de estado
variable4.DN
Este ejemplo hace referencia al bit DN de variable4.
MyVariable definida como BOOL[100]
MyIndex definido como SINT
MyVariable[(MyIndex AND NOT 7) / 8].[MyIndex AND 7]
Este ejemplo hace referencia a un bit en una matriz BOOL.
MyArray definida como BOOL[20]
MyArray[3]
Este ejemplo hace referencia al bit 3 de MyArray.
variable5
definida como ULINT
contiene 64 bits
variable5.53
Este ejemplo hace referencia al bit 53 de variable5.
Utilice el direccionamiento de bits donde se permita una etiqueta de tipo BOOL.
Entregue su opinión
¿Tiene dudas o comentarios acerca de esta documentación? Por favor deje su opinión aquí.
Normal