hacker-cb / modbus-dart

BSD 3-Clause "New" or "Revised" License
37 stars 22 forks source link

Uint16List to float #20

Closed tuceturan closed 2 years ago

tuceturan commented 2 years ago

Hello how can convert to float data?

I try this Function

final bytes = Uint16List.fromList(data); final byteData = ByteData.sublistView(bytes); double value = byteData.getFloat32(0); but this value is negative and swap value Can you help?

hacker-cb commented 2 years ago

There is no float type in mosbus. You should use modbus registers accroding documentation to the the device you want to connect.

tuceturan commented 2 years ago

Okay I know but register data is float in device documentation

When I get [16134,54975] this array I want to change double first element