Problem adding a data source - Modbus Serial
-
I think what ModPoll calls "encapsulated RTU" is what Modscan32 calls a "remote telnet server" connection, which just treats the TCP/IP socket like a serial port. That is, just sendng plain Modbus RTU packets via the socket without the extra 6-byte header that Modbus TCP/IP requires.
It would be a cool feature for Mango to support that connection type so folks can use cheaper serial device servers with Mango instead of pricey Modbus Ethernet gateways.
I can probably connect my Moxa to the Internet for you to test with later this week if David can't make his available.
-
Last to connect to the internet's a rotten egg!
-
Thanks for setting this up. I've tried sending the (decimal) message [1, 3, 4, 196, 0, 1, 196, 199] to the IP address you gave but i never get a response. I also tried varying the slave id from 0 to 240 but still, nothing but crickets. Can you provide a trace of a message to which this equipment will respond?
-
Never mind. Found it at 127.
-
Sorry, I forgot to mention the slave address is 127 (7F hex). Here's a hex dump of the command and reply I just captured with my C# Modbus master program that reads 2 holding registers at address 0 (or addresses 40001 and 40002 in Modbus terminology):
8 bytes sent: 7F 03 00 00 00 02 CE 15
9 bytes rcvd: 7F 03 04 00 00 00 00 64 34Be sure to use a long enough reply timeout to allow for extra timing delays due the to the Internet. I use a 3 second timeout. Also, the Windows TCP/IP sockets API has some options to help make sure the packet doesn't get fragmented at the Ethernet layer e.g. their's a flag called ClientSocket.NoDelay that should be set true. For Linux, there should be a similar flag.
BTW, not very many Modbus slaves support the function code for reading exception data that Mango uses for automatically identifying the slaves on an RS485 drop. A more universal way is to just read some register (40001 is a common one). If the slave has a register at that address, it will give you a normal response. If not, it will respond with "illegal address" exception. Either way, you've discovered that there's a slave at that slave address.
-
Matthew, please post a message here when you have a new version of Mango that works with a "Serial Device Server" option for Modbus serial RTU protocol. That would help put Mango on the same level as Modbus master software like Modpoll and Modscan32 (as far as Modbus protocol support). Then with all of Mango's other features, it would leave them in the dust!
Just an FYI for anyone wanting to use an SDS or SDA with Modbus serial RTU protocol: you usually need to tweak the adapter's settings to allow for the way that the protocol determines the end of a packet (i.e. with a silent interval). For the Moxa NPort 5130, I configured it for a "Packing length" of 256 and a "Force Transmit" of 5 milliseconds. This also makes analyzing a communications session with Wireshark easier.
Of course the SDA approach doesn't support multiple concurrent sessions like Modbus TCP/IP can, but for a lot of applications that's beside the point.
-
BTW, not very many Modbus slaves support the function code for reading exception data
Yeah, this has been noted previously. It just took one more mention i guess to motivate a change. (A change suggestion doesn't hurt either, of course. Thanks.) Modbus4J has been updated accordingly.
-
The encapsulated RTU changes have been made to Modbus4J and check into the CVS repo, for anyone that uses that package standalone. The changes have also been incorporated into Mango, and will be available in the next version. The only visible change is the "encapsulated" checkbox in the IP configuration.
You will see a notice in the Mango that a new version of the product is available, so no explicit posting will be made here for that event.
-
Hello jkyner,
Can you be more specific on the following post you made, please?
I've been trying to put my power meter (connected to Mango via Modbus serial) on our LAN using Moxa 5230 without much success.What data source should I use to configure/connect to the Moxa 5230?
And what "operation mode" should I choose for Moxa 5230 for Mango to connect?TIA,
joohwan
@jkyner said:
I should have said Mango works fine with a Lantronix Intellibox Modbus Gateway with RTU slaves but also works fine with the Moxa 5130 (a basic Ethernet/RS485 SDA that is not Modbus-aware) for those Modbus slaves that can handle the 6-byte Modbus TCP-RTU header forwarded over RS485.