Problem adding a data source - Modbus Serial
I'm using a USB-serial adapter on my laptop to provide a serial port to connect to a modbus RTU network. Although the com port shows up in Windows Device Manager, the list of ports in Mango is empty when I try to add a serial modbus data source.
Is this adapter a likely problem or should I be checking something else?
Most likely it's a problem with your javacomm setup. See this posting for some useful information, including a small program to run to check your installation: http://mango.serotoninsoftware.com/forum/posts/list/13.page.
I have a problem about Modbus Serial. Not sure that I test it properly or not. When I connect Modbus Serial to Mango, there is no result after scaning. What it support to show after scanning? And, what I should do when setting modbus serail?
The scan looks for nodes that respond to a ReadExceptionStatus request. So, in addition to needing all your serial port settings to be exactly correct (port, baud rate, flow, etc), your equipment needs to powered and able to respond to that request. If a node is found, the node id will be listed in the selection box.
Be careful with those usb-serial adapters. I have a modbus meter that refuses to talk to them, but works fine with motherboard-integrated ports. You can buy PCI and PCIe serial port adapter cards from newegg that might work better.
Just a quick hint with modbus...before you even start configuring and setting up devices through mango verify serial comms...there are many modbus testers that are open source and some that cost money...if at first one doesnt work try another...remember modbus serial is RS485, you will always need a convertor and make sure your convertor matches your device...simple but for a person new to modbus this may help
Does anybody know of a USB/RS485 adapter with a reliable Ubuntu device driver that works with Mango? Also, any tips or hyperlinks on how to install the driver to make it work with Mango would be a big help. I know how RS485 works but I just need a few pointers on getting a USB/RS485 adapter to work dependably on Ubuntu.
I saw Mango described in the latest Modbus.org newsletter and I'm glad I checked it out -- it works well with Modbus-TCP/RTU to a single slave via a Moxa NPort 5130 Ethernet/RS485 adapter. Now if I can just find a USB/RS485 adapter that works as well!
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.
I've a gen-set controller with modbus/RTU connected to a Moxa adapter.
modpoll (http://www.focus-sw.com/fieldtalk/modpoll.html) works great for test using "Encapsulated Modbus RTU over TCP", but i can't get it running on Mango.
It's possible to get this device works with Mango?
I spent lot of time testing theese serial adapters and realize that the problem was the driver.
Now I am using an usb/serial adapter to communicate serial devices with Mango, and it works very well.
If you are having problems try this driver:
You can use it with your own adapter, or may purchase a new one from website.
(I am using a cheap adpater with this driver and it works)
You're right. USB-Serial adaptors aren't the most compatible peripheral in the world.
But my problem is different, 'cause i use a Serial to Ethernet adaptor (Moxa calls it "device server"). If i install a driver on my PC, i got a virtual COM port though ethernet.
When i use modpoll for test (www.focus-sw.com/fieldtalk/modpoll.html) everything works:
D:\>modpoll -m enc -r 8196 -1 -p 4001 *MyIPAddress* modpoll - FieldTalk(tm) Modbus(R) Polling Utility Copyright (c) 2002-2006 FOCUS Software Engineering Pty Ltd Visit http://www.modbusdriver.com for Modbus libraries and tools. Protocol configuration: Encapsulated RTU over TCP Slave configuration...: Address/Id = 1, start reference = 8196, count = 1 Communication.........: *MyIPAddress*, port 4001 Data type.............: 16-bit register, output (holding) register table Polling slave ... : 226
But i can't select "Encapsulated RTU over TCP" on Mango (AFAIK, this protocol is supported).
I try to configure an Modbus IP data source without luck.
Transport Type: TCP
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.
Therefore... My Modbus slave is incompatible with mango?
Thanks a lot!!
Can you make your device available over the internet for testing? It seems "encapsulated RTU" is a different protocol than modbus TCP.
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 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.
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.