I have the following question when read a PLC book, regarding The bit field distribution (BTD) instruction. Thank you in advance for help.
Given:
Source address: N70:22
Source data: 0000000101101000
Source bit: 3
Destination address: N70:22 (same as source address)
Destination bit: 5
Length: 6
Question:
After the BTD instruction is executed, which of following is true?
A. Not allowed (error will occur during compilation) because the destination bit is within the source data location.
B. The result is that "101101" shifted left by two bits, i.e., 0000010110101000, leaving the lowest 2 bits of source data unchanged.
C. The process is to copy and write one bit at a time, starting from lowest bit, so that the bits 5 to 8 of the source data are changed during this process, and the result in N70:22 is 0000001010101000.
Given:
Source address: N70:22
Source data: 0000000101101000
Source bit: 3
Destination address: N70:22 (same as source address)
Destination bit: 5
Length: 6
Question:
After the BTD instruction is executed, which of following is true?
A. Not allowed (error will occur during compilation) because the destination bit is within the source data location.
B. The result is that "101101" shifted left by two bits, i.e., 0000010110101000, leaving the lowest 2 bits of source data unchanged.
C. The process is to copy and write one bit at a time, starting from lowest bit, so that the bits 5 to 8 of the source data are changed during this process, and the result in N70:22 is 0000001010101000.