RS232 in Vending via MDB
RS232 in Vending via MDB
RS-232 (in former times also called V.24) is a really ancient standard for serial interfaces.
RS-232 actually is an electrical standard, defining voltage levels and maximum cable lengths, but it is commonly used for a specific way to send bits too (asynchronous, with start and stop bits etc). Almost everyone in the computer or ‘IoT’ world, but also those who deal with vending machines, have stumbled upon RS-232.
Is MDB a form of RS-232 ? No, not at all.
Can I use my RS-232 computer interface to directly talk with an MDB capable vending machine ?
No, you can not.
Let’s understand why…
RS-232 is a point-to-point connection method. It uses voltage levels of + and – 3..15V to transmit the usual ones and zeros of a serial interface.
In contrast, MDB (Multi Drop Bus) – as the name implies, is a one-to-many connection method. It uses so called ‘TTL’ logic levels of 5V and 0V, but mostly is based on the current which flows if you short circuit a 5V source or you drive an optocoupler with 5V.
So, already at the physical level, besides using different connectors, RS-232 and MDB use very different voltage levels and are meant for different purposes (point-to-point vs. one-to-many).
“Well” – you may think – “can I just do physical translation and connect RS-232 to an MDB capable vending machine if I only want to simulate one peripheral?”
Would be too nice, wouldn’t it ?
MDB uses 9600 baud, a speed commonly used also on RS-232, so that looks actually promising!
However there are two reasons why this will not easily work like that.
1 – On RS-232, we usually transmit 8 bit data (‘bytes’), or maybe 7 bit with parity added to make it 8 bit. 8 Bit PLUS parity also exists, but is less common (but generally supported).
MDB uses a 9TH data bit. So effectively transmissions on the serial link uses 9 bits per ‘byte’. This is very uncommon for standard serial ports, and the usual PC interfaces do NOT support 9 bit transmissions.
2 – Furthermore, MDB has VERY stringent timing requirements. Answers of peripherals must come almost instantly to allow the use of multiple peripherals on the bus without much delay. On modern operating systems, it is hard or maybe even impossible to meet those timing requirements.
So – how can I interface RS-232 to MDB then?
In Qiba we developed the MDB-USB Ultra interface to be used in these exact scenarios!
It is a generic MDB interface, which can take both peripheral and VMC (vending machine) roles. To the computer/host side, it implements a plain, simple ASCII protocol with no critical timing requirements, and while the name implies ‘USB’, it also has a working RS-232 port for use with RS-232 hosts which do not provide USB connectivity!
Contact us to learn more about interfacing RS-232 with MDB in vending. We are expertly equipped to help you.