[Logo] Serotonin Software Community
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Problem adding a data source - Modbus Serial  XML
Forum Index » Hardware
Author Message
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1456
Offline

Never mind. Found it at 127.

Best regards,
Matthew Lohbihler
jkyner

Initiate

Joined: 08/06/2010 20:49:10
Messages: 5
Offline

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 34

Be 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.
jkyner

Initiate

Joined: 08/06/2010 20:49:10
Messages: 5
Offline

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.
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1456
Offline

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.

Best regards,
Matthew Lohbihler
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1456
Offline

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.

Best regards,
Matthew Lohbihler
joohwan

Initiate

Joined: 28/11/2010 18:12:25
Messages: 15
Offline

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 wrote: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.
 
Forum Index » Hardware
Go to:   
Powered by JForum 2.1.9 © JForum Team