Home
Help
Search
Login
Register
AdvancedHMI Software
»
General Category
»
Open Discussion
»
ModbusTCP
« previous
next »
Print
Pages: [
1
]
Author
Topic: ModbusTCP (Read 2044 times)
aquilmustafa
Full Member
Posts: 121
ModbusTCP
«
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.
Logged
Archie
Administrator
Hero Member
Posts: 5322
Re: ModbusTCP
«
Reply #1 on:
August 17, 2016, 03:32:13 AM »
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
Logged
aquilmustafa
Full Member
Posts: 121
Re: ModbusTCP
«
Reply #2 on:
August 17, 2016, 09:19:14 AM »
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.
Logged
Print
Pages: [
1
]
« previous
next »
AdvancedHMI Software
»
General Category
»
Open Discussion
»
ModbusTCP