Member Login
member
passwd
remember me on this computer.

- join now -

Search

Neat Stuff

Visit our shop for nerds in control lifestyle products.

Cool stuff
Select a topic of interest:
...and press:
Fortune
If money can't buy happiness, I guess you'll just have to rent it.
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
from the Automation List department...
Modbus sniffing serial line
Communications topic
advertisement
Posted by phe on 1 April, 2008 - 12:04 am
Hello,

We have a working installation on Modbus serial RS232 (point to point connection).

I want to visualise the data that goes over the line (like it is possible in ethernet in promiscuous mode with wireshark).

How can I do this?

I guess I have to build a sniffing tap an have two serial ports in my PC? Or can I convert it to RS485 and have this signal in my PC?

I want to see the traffic of both and also timing is important.

There are some problems (+/- 4 times a day).

Thanks,

patrick

Posted by Curt Wuollet on 1 April, 2008 - 10:55 pm
Google data scope and/or RS232 monitor for lots of free and commercial products to do this. The better ones have pretty good timing resolution.

I keep a couple around to diagnose problems and RE protocols.

Regards

cww

Posted by Chris Dierkens on 2 April, 2008 - 12:49 am
You can use a modem splitter (I use one from BlackBox) and a software program (I wrote my own) to look at it and capture the data. I wrote my own software to post some timing information. You can, however, use something like Hypterminal to do the same thing. You just may not have the timing information. It's a good start regardless. The modem splitter and cables can be found on BlackBox's site.

Good Luck...

Posted by Robert Scott on 1 April, 2008 - 11:52 pm
Patrick,

Your idea of using two serial ports on a PC is a good one. You will be able to log the two separate data streams (TxData and RxData) by connecting them each to an RxData input of a serial port.

But then you said timing was important. This could be a problem. Serial ports on a PC running Windows or any other non-real-time operating system will buffer the serial data in their driver software so that you will have difficulty time-stamping the received characters with accuracy any better than about 50 msec. This means it might be difficult to see how the two data streams interleave or measure precise timing between messages in the two streams. Are you sure you need such precise timing information? Usually the data alone is sufficient to debug protocol problems. If you have some idea of the nature of the failure you are trying to track down, and it only happens once in a while, then you might be able to program a custom filter on the sniffing program to look for suspicious patterns, rather than just log all raw data.

Robert Scott
Real-Time Specialties
Embedded Systems Consulting

Posted by Jairo Rodriguez on 2 April, 2008 - 12:08 am
Hi Patrick,

You can use a ModBus simulator in order to test you master or slave device, most tools come with their own protocol analyzer.

You can use C lenguage (or other) to get hex data from serial ports using hardware interruptions.

If you want to monitor both sides, slave and master, you can build one Y serial cable and use it.

If you have money enought Black Box have some hardware and software useful tools to do what you want.

Best regards,

Jairo J. Rodriguez
Automation Specialist
PDVSA-Petro Cedeņo

Posted by Mark on 2 April, 2008 - 12:12 am
Hi,

If one of the applications is running on MS then you might try PortMon.

http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx

I have used it many times with great success.

HTH,

Mark
http://www.peakhmi.com

Posted by Jerry Miille on 2 April, 2008 - 12:44 am
One of the best applications available is Serial Test from Frontline Test Equipment http://www.fte.com/products/Serialtest-01.asp. I am not affiliated with this company but use this product every day.

To get accurate time stamping you will need two real serial ports, not USB to Serial adapters, on your PC. I use a dual port PCMCIA card in my laptop. I think it even comes with a Modbus decoder as well these days.

Jerry Miille

Posted by Curt Wuollet on 2 April, 2008 - 11:56 pm
I've used the Frontline product and it does work well for data capture, but if you want to timestamp, I've had better results under DOS. You can also hook up a storage scope to the handshake lines if you really want to unravel timing issues.
You can also get scatter data on the timing and capture around NAKs,

Regards

cww

Posted by Eric Ratliff on 2 April, 2008 - 12:48 am
Patrick,

You would need three RS-485 converters, and that should work. You might not catch events where both ends start transmitting at the same time though. They should not do that, but we know that something is wrong... You could use two of our I-7520 converters to get the signal to two wire RS-485. Then one I-7561 to eavsedrop in via USB. See link at bottom.

If the Modbus master or slave is a PC, you might be able to use just software, similar to using WireShark. See http://www.tucows.com/preview/301057 for example.

Eric R
www.icpdas-usa.com

From Control Engineering magazine...
Related articles from Control Engineering magazine
Above articles copyright 2008 Reed Business Information. Subject to its Terms of Use.

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2008 Control Technology Corporation. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, PostgreSQL and Apache. Be happy.

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!