Android Question ModBus TCP

How can i communicate by Modbus TCP with my Plc on Android device?

I already make a programm with Visual Basic 6 that communicate (read and write) with my Plc by Modbus TCP protocol.

But now i want upgrade and using Android device (smartphone or tablet)
 

KMatle

Expert
Licensed User
Longtime User
Modbus TCP

Did you install that protocoll on you windows machine (Network) as an extra protocoll? Otherwise it's just a TCP/IP socket connection. It's more about the data you send. But you should know that as you have a working VB program.
 
Upvote 0
Did you install that protocoll on you windows machine (Network) as an extra protocoll? Otherwise it's just a TCP/IP socket connection. It's more about the data you send. But you should know that as you have a working VB program.

I am not an expert in network communication.
you say that i must create a simple TCP/IP socket connection on B4A?

If yes....can you send me some example? thanks
 
Upvote 0
Follow Erel's example (see his post). The modbus device is listenling via TCP/IP to a special port. So try to connect to this port with the example code and send some data.

The Plc respond only with correct format of data send by TCP/IP Modbus send from PC (example read command)
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
How can i communicate by Modbus TCP with my Plc on Android device?

I already make a program with Visual Basic 6 that communicate (read and write) with my Plc by Modbus TCP protocol.

But now i want upgrade and using Android device (smartphone or tablet)

A few years ago, I implemented the ModBus protocol on PC under VB 6.0 and in C on an ARM microcontroller. From what I remember, you could reuse a lot of your VB6.0 code to make a B4A implementation using the AsyncStreams library. The most painstaking part is parsing and creating the messages, and that code will be largely the same.
 
Upvote 0
Top