Modbus sniffing serial line

P

Thread Starter

phe

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
 
C

Curt Wuollet

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
 
R

Robert Scott

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
 
J

Jairo Rodriguez

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
 
J

Jerry Miille

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
 
E

Eric Ratliff

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
 
C

Chris Dierkens

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

Curt Wuollet

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
 
Top