Hello everyone!
I am working on an existing system that contains a 1756-L73 controller, a 1756-DNB DeviceNet bridge, and a 2711-K3A5L1 PanelView Standard 300 with DeviceNet communication. The IO tags associated with the 1756-DNB are of the DINT data type. The tags in the PanelBuilder 32 software are of the INT data type.
In the code, I tried to do a masked move (MVM) of a constant value into bits 0-15 of the output from the DNB. For example, "3" gets moved to bits 0-15 of the output Local:1:O.Data[0] which is a DINT. I then used another masked move to move another fixed value to bits 16-31 of the same output Local:1:O.Data[0].
When I tested the logic, it would not write to bits 16-31 (I didn't test to see if it would write to 0-15) of the output. Even if I monitored the tag and manually put a 1 into those bits, it would change it back to a 0.
To make a long story short, I thought I would try the bit distribute (BTD) instruction instead of the MVM. It worked but it left me questioning why the MVM would not accomplish the same thing. Anyone have any ideas?
I thought maybe RSLogix configures a fixed value as a DINT and so it was letting bits 16-31 through because of the way the mask was set up and my value was so small (i.e. "3") that those bits were all zeros? That is the only guess I have.
I am working on an existing system that contains a 1756-L73 controller, a 1756-DNB DeviceNet bridge, and a 2711-K3A5L1 PanelView Standard 300 with DeviceNet communication. The IO tags associated with the 1756-DNB are of the DINT data type. The tags in the PanelBuilder 32 software are of the INT data type.
In the code, I tried to do a masked move (MVM) of a constant value into bits 0-15 of the output from the DNB. For example, "3" gets moved to bits 0-15 of the output Local:1:O.Data[0] which is a DINT. I then used another masked move to move another fixed value to bits 16-31 of the same output Local:1:O.Data[0].
When I tested the logic, it would not write to bits 16-31 (I didn't test to see if it would write to 0-15) of the output. Even if I monitored the tag and manually put a 1 into those bits, it would change it back to a 0.
To make a long story short, I thought I would try the bit distribute (BTD) instruction instead of the MVM. It worked but it left me questioning why the MVM would not accomplish the same thing. Anyone have any ideas?
I thought maybe RSLogix configures a fixed value as a DINT and so it was letting bits 16-31 through because of the way the mask was set up and my value was so small (i.e. "3") that those bits were all zeros? That is the only guess I have.