A Alessandro548 Member Mar 6, 2017 #1 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)
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)
Erel B4X founder Staff member Licensed User Longtime User Mar 7, 2017 #2 You should use Socket (Network library) + AsyncStreams (RandomAccessFile library): https://www.b4x.com/android/forum/pages/results/?query=asyncstreams Upvote 0
You should use Socket (Network library) + AsyncStreams (RandomAccessFile library): https://www.b4x.com/android/forum/pages/results/?query=asyncstreams
A Alessandro548 Member Mar 7, 2017 #3 Erel said: You should use Socket (Network library) + AsyncStreams (RandomAccessFile library): https://www.b4x.com/android/forum/pages/results/?query=asyncstreams Click to expand... thanks for your reply....but this example not use protocol Modbus TCP on my PLC i have only Modbus TCP...is an international standard industrial protocol Upvote 0
Erel said: You should use Socket (Network library) + AsyncStreams (RandomAccessFile library): https://www.b4x.com/android/forum/pages/results/?query=asyncstreams Click to expand... thanks for your reply....but this example not use protocol Modbus TCP on my PLC i have only Modbus TCP...is an international standard industrial protocol
KMatle Expert Licensed User Longtime User Mar 7, 2017 #4 Alessandro548 said: Modbus TCP Click to expand... 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
Alessandro548 said: Modbus TCP Click to expand... 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.
A Alessandro548 Member Mar 7, 2017 #5 KMatle said: 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. Click to expand... 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
KMatle said: 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. Click to expand... 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
KMatle Expert Licensed User Longtime User Mar 7, 2017 #6 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. 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.
A Alessandro548 Member Mar 7, 2017 #7 KMatle said: 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. Click to expand... The Plc respond only with correct format of data send by TCP/IP Modbus send from PC (example read command) Upvote 0
KMatle said: 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. Click to expand... The Plc respond only with correct format of data send by TCP/IP Modbus send from PC (example read command)
Erel B4X founder Staff member Licensed User Longtime User Mar 7, 2017 #8 You will need to implement the protocol yourself. I'm not familiar with Modbus so I cannot say whether it will be simple or not. ByteConverter and RandomAccessFile are two useful objects for such tasks. Upvote 0
You will need to implement the protocol yourself. I'm not familiar with Modbus so I cannot say whether it will be simple or not. ByteConverter and RandomAccessFile are two useful objects for such tasks.
KMatle Expert Licensed User Longtime User Mar 7, 2017 #9 Alessandro548 said: I already make a programm with Visual Basic 6 that communicate (read and write) with my Plc by Modbus TCP protocol. Click to expand... You already did a working program. So what did you do exactly? Which commands are you sending? B4x is similar. Upvote 0
Alessandro548 said: I already make a programm with Visual Basic 6 that communicate (read and write) with my Plc by Modbus TCP protocol. Click to expand... You already did a working program. So what did you do exactly? Which commands are you sending? B4x is similar.
Didier9 Well-Known Member Licensed User Longtime User Mar 7, 2017 #10 Alessandro548 said: 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) Click to expand... 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
Alessandro548 said: 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) Click to expand... 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.
A Alessandro548 Member Mar 14, 2017 #11 KMatle said: You already did a working program. So what did you do exactly? Which commands are you sending? B4x is similar. Click to expand... I need a "object" for network communication (and simple example), like Socket in VB6...but this time in B4A Upvote 0
KMatle said: You already did a working program. So what did you do exactly? Which commands are you sending? B4x is similar. Click to expand... I need a "object" for network communication (and simple example), like Socket in VB6...but this time in B4A
Erel B4X founder Staff member Licensed User Longtime User Mar 14, 2017 #12 The Networker's Guide To The Galaxy Upvote 0