« SPLat learns to count in new ways | Main | New program download tool »

ModBus, RS-whatnot and How Many Can I Have?

I just got asked about how many devices can be supported on a ModBus link. There is much confusion around such questions, so here's a quick summary of the facts.

ModBus is a protocol. It defines messages, responses and data content. It is the language. It says nothing about the communications interface (lips, tongue, vocal chords). Other protocols include TCP, X-modem and Morse code. (If you are knowledgeable enough to debate me on the latter, you probably don't need to be reading this :-)

RS232 is a communications interface. The RS232 standard defines some electrical voltage and current levels. It says nothing about the language (including nothing about the number of bits, parity etc., which strictly speaking are the character profile, something else again. Phonemes?)

RS485 is another electrical interface. So are RS422, Ethernet, current loop, V35 etc.

So maybe now you can see why questions like "do you have a ModBus interface" or "do you have RS485 protocol" are not the right question to ask.

So how many widgets can I connect?

Let's stick to ModBus, RS232 and RS485, which is the realm of ModBus on SPLat.

RS232, the electrical interface, officially allows only a one on one connection over a distance of (formally) 50 feet. Various tricks are sometimes used to extend this envelope.

RS485 officially allows up to 32 devices to share a multidrop line. All devices are connected in parallel on that line. (RS422 has the same voltage levels but is only for one on one connections). The maximum official distance is 4000 feet.

ModBus, the protocol, allows up to 247 device addresses. You will probably never get that many on a simple network (i.e. one without buffers, line extenders and other hardware aids).

So what about in SPLat?

RS232: On those SPLat controllers that have an RS232 "compatible" programming port, we have been a bit tricky. Based on work we did very successfully in the wardrobe of Melbourne's Crown Casino for conveyor maker Hiemac, these interfaces have multidrop capability. That means up to 6 can be connected in parallel and driven off a PC. They must however be located within an overall cable length of about 5m (15 feet). The distance will vary with data rate (9600, 38400 etc), the quality of cable and ambient noise. This multidrop capability is a bonus feature. Current products with this are MMi series and SL series controllers.

The PC232 programming cable used on the CC16 and the MS series controllers converts the board's signals to RS232. However, it contains an industry standard RS232 drive/translator chip, and cannot be multidropped. Hence with those controllers you are currently limited to one on one.

RS485: Right now we don't have an RS485 interfaces on any standard product. There are a few prototype converters kicking about the lab, but that's it. If you need RS485 and plan to use a whole bunch, contact me. The 32 devices limit on RS485 can be extended. At least one chip maker I know of makes "quarter load" driver chips, extending the capacity to 128.

We do have a couple of handy program examples in VB6 showing low level ModBus driver code. Also, you can buy ModBus software components from a number of vendors. Setting up a SPLat to be a ModBus slave is very simple. Basically you just play with our examples until you get the hang of it, then copy and paste our startup code.

Please post any questions below.

TrackBack

TrackBack URL for this entry:
http://www.splatco.com/cgi-sys/cgiwrap/microcon/managed-mt/mt-tb.cgi/29

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


About

This page contains a single entry from the blog posted on April 4, 2007 11:16 AM.

The previous post in this blog was SPLat learns to count in new ways.

The next post in this blog is New program download tool.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.33