IEC_BMDI creates a word-by-word copy of the number of elements listed in LENGTH from the OFF_IN position in the source table (SEL_IN) to the OFF_OUT position in the destination table (SEL_OUT). While copying, LENGTH always uses the type of SEL_IN for orientation (%IX, %MX: LENGTH = Number of Bits; %IW, %MW: LENGTH = number of words)
Copy behavior:
-
%MX or %IX to %MX
The source and target lengths are identical during copying of %MX or %IX to %MX
-
%IW or %MW to %MW
The source and target lengths are identical during copying of %IW or %MW to %MW
-
%MX or %IX to %MW
When copying %MX or %IX to %MW, a WORD-to-WORD copy is made as well. In this, the first source bit is copied into the MSB (highest bit) of the first %MW register, and so on. LENGTH defines the number of bits to be copied. The maximum output length is LENGTH/16 registers.
-
%IW or %MW to %MX
When copying %IW or %MW to %MX, a WORD-to-WORD copy is made as well. In this, the MSB (highest bit) of the first register is copied into the first destination bit and so on. LENGTH defines the number of registers to be copied. The maximum output length is LENGTH x 16 bits.
In the example, 64 %MX source bits from start address %MX129 are copied into the %MW destination register (starting at address %MW112). The input range is %MX129 to %MX192 and the output range is %MW112 to %MW115.
In the example, 11 %MW source bits from start address %MW250 are copied into the %MX destination register (starting at address %MX257). The input range is %MW250 to %MW260 and the output range is %MX257 to %MX432.
In the example, 128 %MX source bits from start address %MX001 are copied into the %MX destination register (starting at address %MX257). The input range is %MX001 to %MX127 and the output range is %MX257 to %MX384.
In the example, 15 %MW source bits from start address %MW250 are copied into the %MW destination register (starting at address 4:01030). The input range is %MW250 to %MW264, and the output range is 4:01030 to 4:01044.