AdvancedHMI Software
General Category => Open Discussion => Topic started by: aquilmustafa on August 17, 2016, 12:36:41 AM
-
Hey Guys,
I know this is off topic but didn't knew who else to ask to. I have written my own Modbus-TCP Protocol and I'm able to read words. But i don't know how to read floating points and characters. Any help in that direction would be greatly appreciated.
-
The common Modbus protocol does not support floating or strings directly. You read the data as words, then convert them. For example, read 2 words, arrange the bytes, then convert to a single type. In .NET you can use BitConverter
-
Hi Archie,
Thanks for the support. I'm already using
Dim dat As Byte() = BitConverter.GetBytes(CShort(IPAddress.HostToNetworkOrder(CShort(word(x)))))
to get word data
what can we use for the floating point numbers.