As you can see, you can't define bit arrays in codesys. If you need bits in your structure, you either define them separately:
TYPE DUT1 :
STRUCT
reserved1: BIT;
reserved2: BIT;
data1: BIT;
data2: BIT;
data3: BIT;
data4: BIT;
reserved3: BIT;
reserved4: BIT;
END_STRUCT
END_TYPE
Or, you can combine them into a structure themselves:
TYPE DUT2 :
STRUCT
reserved_before: Reserved2Bits;
data1: BIT;
data2: BIT;
data3: BIT;
data4: BIT;
reserved_after: Reserved2Bits;
END_STRUCT
END_TYPE
However, if you do use a separate structure for that, the bits won't be compacted with the rest. In the above the size of DUT1 is 1 byte, and the size of DUT2 is 3 bytes (1 byte for each Reserved2Bits, and 1 byte for the data bits).
And finally, you can access bits directly on integer types, for example:
VAR
bits: BYTE;
END_VAR
bits.2 := TRUE; // data1
bits.5 := FALSE; // data4
And instead of numbers you can use constants:
VAR
bits: BYTE;
END_VAR
VAR CONSTANT
data1: BYTE := 2;
data2: BYTE := 3;
data3: BYTE := 4;
data4: BYTE := 5;
END_VAR
bits.data1 := TRUE;
bits.data4 := FALSE;
In the case above, you can skip defining reserved/unused bits entirely.