You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Modbus MtConnect adapter unable to read swapped float values .
Need one more data type along with ieee_float to read swapped float values from modbus device.
The text was updated successfully, but these errors were encountered:
On Apr 2, 2020, at 09:06, kalpakkarnik ***@***.***> wrote:
In Modbus MtConnect adapter unable to read swapped float values .
Need one more data type along with ieee_float to read swapped float values from modbus device.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#20>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAJ6BCJNCMSDDQSIXX4J7SLRKSZWXANCNFSM4L2TY4XQ>.
I Figures out .
In modbus_adapter.hpp file
under the structure ModbusFloat change the writeValue() function as below to read form swapped float register values:
virtual void writeValues() {
int offset = mDataItems.size();
for (int i = 0; i < mDataItems.size(); i++) {
uint32_t value;
value = (static_cast<uint32_t>(mData[offset]) << 16) + mData[offset + 1];
(static_cast<Sample*>(mDataItems[i]))->setValue(((float)&value));
offset -= mSize[i];
}
}
Closing the thread for now ,will create and send pull request soon
In Modbus MtConnect adapter unable to read swapped float values .
Need one more data type along with ieee_float to read swapped float values from modbus device.
The text was updated successfully, but these errors were encountered: