0% found this document useful (0 votes)
767 views11 pages

MDB RS232 Quick Start

The document describes an MDB-RS232 interface adapter that connects MDB coin changers, bill acceptors, and card readers to a computer or other device via an RS232 serial connection. It has connectors for power, MDB devices, and RS232 and allows communication between MDB payment devices and a PC or other host using the MDB protocol at 9600 baud. It passes MDB data from devices to the host and host commands to the devices to control and monitor the payment devices.

Uploaded by

Preda Andrei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
767 views11 pages

MDB RS232 Quick Start

The document describes an MDB-RS232 interface adapter that connects MDB coin changers, bill acceptors, and card readers to a computer or other device via an RS232 serial connection. It has connectors for power, MDB devices, and RS232 and allows communication between MDB payment devices and a PC or other host using the MDB protocol at 9600 baud. It passes MDB data from devices to the host and host commands to the devices to control and monitor the payment devices.

Uploaded by

Preda Andrei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

MDB‐RS232 

Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

Shanghai Wafer Microelectronics Co., Ltd. 
23E,Liang Feng Building,NO.8,DongFang Road,Shanghai,China    Tel.: (0086) 21 6845‐8945    Fax: (0086)21 5045‐4820                                                 

MDB Coin Changer and MDB Bill Acceptor   
to RS232 Interface   
Model: MDB‐RS232    (New Version box type) 
SPECIFICATIONS 
Communication format: 
Baud rate:  9600            Start bit:  1     
Data bits:  8                 Parity:    NO     
Stop bit:   1     
PC data Send:    Hex       
PC data Receive:   ASCII     
Hardware Specification. 
Power      Min 20 VDC ( Normal working voltage 24...30 AC or DC ) 
                          Consumes an idle current    < 0.05A (No MDB payment device connected) 
Cable                   MDB connector, Standard RS232 serial cable and DC2.1 Power connector 
Dimensions         approx. 100 x 42 mm (Not include the cables) 
Weight                 approx. 100 g 

Install the MDB‐RS232 
( VMC can be Computer(PC) or PLC or Android main board ) 

 
 
                                                      Page 1 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

Below  is  the  picture  of  two  types  of  MDB‐RS232,  the  same  function  and  protocol  ,the  only 
difference  is  Three  LED  version  will  enable  the  payment  device  from  the  start  and  Five  LED 
version start with disable status for payment device and user need to use the enable command 
to enable. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

z (1) RS232 connector to Computer COM port 
z (2) Power connector for AC/DC power supply (Normally we use the DC24V) 
z (3) MDB connector to bill acceptor,coin validator or card reader 
                                                      Page 2 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

Installation is relatively simple; there are only three connections that must be made for full 
functioning of the device. There are connectors on the MDB adapter box.: 
One  cable  plugs  into  a  24VDC  power  supply.  (When  connecting  the  DC24V  power  supply, 
there is no need to consider the specific polarity. The 6‐pin Molex connects to the MDB devices. 
The  final  connector  is  a  DB‐9  and  connects  into  the  back  of  the  computer  or  any  other  main 
board  with  RS232  port.  There  should  be  an  open  port  on  the  back  of  the  computer  labeled 
“SERIAL2” or “COM2.” If you only has the USB port on your computer,then would be easy for 
you to order a RS232/USB adapter. 
After connected the device,and then Apply power on with DC24V. Check for “Power Status” 
LED on the box (RED led) indicating power is OK. 
  If the MDB device is properly connected and working properly,then the “MDB Status” LED 
should start to flash. 
  On the MDB‐RS232 box also has another “PC Communication” LED,that would be flashing if 
has any data sendt from MDB‐RS232 box to PC. 

Software 
The MDB‐RS232 sends information generated by the MDB device directly to the PC via RS‐232 
serial  communication.  There  is  no  need  to  poll  each  MDB  device.  This  is  done  by  the 
MDB‐RS232. By default the MDB‐RS232 will poll all known MDB devices. The MDB‐RS232 then 
sends  data  to  the  PC  if  there  is  activity.  The  information  sent  to  the  PC  is  send  as  bytes  in 
hexadecimal. For activity data,the first byte sent is the device ID. For example 30 XX means that 
a bill validator has sent information. Whereas 08 XX means that a coin mechanism has sent data. 
Consult the MDB V4.2 command specification for commands specific to your MDB device. 

How to use the command to communicate with the MDB‐RS232 adapter box? 
Data sent and reply are all compabitle with the MDB protocol. 
PC command:    Just use the same command as the MDB protocol for VMC 
PC received data1:  Any data sent back according to PC query instructions, that is the same 
format as the MDB protocol,no need to add the first device ID byte 
PC received data2:  Any activity data from payment device will be sent to PC automatically 
and the first byte is the device ID 
For example, Coin acceptor setup command: 09 
After sent the data 09 from PC , then adapter box will read and send back the coin acceptor 
setup information: 03 11 56 05 01 00 03 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 76 
For example, Bill acceptor enable command: 0C FF FF FF FF 
After  sent  the  data  0CFFFFFFFF  from  PC  ,  then  adapter  box  will  send  to  bill  acceptor  and 
send back the validator response Data: 00 
Above PC received data,don’t have the device ID at the first byte,but following data will have 
Activity data from coin acceptor,For example a coin is accepted will be sent to as: 08 51 00   
51 00 is the activity data from coin acceptor and when report the data to PC, MDB‐RS232 
add the first byte device ID 08h 
Activity data from bill acceptor,for example,bill acceptor is disabled will be reported as: 30 09 
09 is the activity data from bill acceptor and MDB‐RS232 add the first byte device ID 30h 
(Just simply noted:    Automatically reported data will have the device ID byte) 
 
                                                      Page 3 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

MDB‐RS232 Software Communication 
Receive   
Use  an  interrupt  driven  comm  event  on  the  appropriate  com  port.  Settings  are 
9600‐8‐1‐None. Set the receive threshold to 1. Empty the contents of the receive buffer as soon 
as there is at least one character ready. 
Transmit 
Use an interrupt driven comm event on the appropriate port.    Settings are 9600‐8‐1‐None. 
Set  the  transmit  threshold  to  1.    Send  the  address  of  the  device  followed  by  the  command 
parameters. 

 
Must be noted again 
Any data sent from PC to MDB‐RS232 box, that should use HEX data 
 
Any data that PC received from MDB‐RS232 box, that is ASCII data 
So when user test command with MDB Demo tool or RS232 tools,must select the “hex” mode to 
 
send data 

MDB OPERATION INSTRUCTIONS: 
For BILL VALIDATOR 
Bills Accepted        (Byte 1)      1yyyxxxx 
yyy = Bill Routing 
                                                                      000 = Bill Stacked 
                                                                      001 = Escrow Request 
                                                                      010 = Bill Returned 
                                                                      011 = Not Used 
                                                                      100 = Disabled Bill Rejected 
           xxxx =    Bill Type 
  The bill types are: 
                        Type 0 = $1    Type 2 = $5    Type 4 = $20 
                        Type 1 = $2    Type 3 = $10 
The software should have all of the bill types enabled, this will allow the user to set which type 
of bills to be accepted on the validator itself. 
Bill Validator Operation Notes 
‐Firmware sets Bill Validator to accept 1, 2, 5, 10, 20 US bills by default 
‐Any  commands  to  changed  bills  accepted  or  held  in  escrow  will  be  set  back  to  the  firmware 
defaults upon a cycling of power or reset. 
VMC Commands for Bill Validator 
US Bills –    Bit 0 = $1  Bit 1 = $2  Bit 3 = $5  Bit 4 = $10  Bit 5 = $20 
BILL’S ACCEPTED 
Bill Type                34h          4bytes    Y1‐Y4 
Bill’s Accepted 

                                                      Page 4 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

Y1‐Y2    =    001Fh    for all US bills accepted 


=  0000h    accept no bill’s 
For example: 
Send the command: 3400030000h 
Bill’s held in Escrow 
Y3‐Y4    =    001Fh    for all US bills held in escrow 
=    0000h    for no bill’s held in escrow     
Send out 34h and then the 4 bytes Y1‐Y4 to change bill’s accepted and held in escrow. 
For example: 
Send the command: 34001F001F       
Enable the ESCROW, can accept the $1, But the coin go to the cash box directly 
BILL’S IN ESCROW ACTION 
Escrow                      35h                1byte        Y1 
Return bill    Y1 = 00h 
Stack bill    Y1 = 01h 
Send    35h and then Y1 to act on bill held in escrow 
For example: 
Send the command: 3500h      to Return the bill 
The bill acceptor will reply: 00 and also following two data bytes: 30 A3 to show the bill type 
returned 
Send the command: 3501h      to accept the bill to the bill stacker box 
The bill acceptor will reply: 00 and also following three status data bytes: 30 83 09 to show 
the bill type returned 
STACKER STATUS 
Stacker            36h     response    Z1‐Z2 
Byte1            Byte2 
Fxxxxxxx           xxxxxxxx 
F=1 Stacker Full 
Xxxxxxxxxxxxxxx = Number of bill’s in stacker 
Send out a 36h to the Bill Validator—It will respond with 2 bytes Z1‐Z2 
For example,if the bill stacker is not full and already stacked 3 pcs bills,then would reply 03 03 
 

BILL VALIDATOR 
All values are in hex  MDB data from Bill Validator to the PC 
   
Bill Accepted   
$1  30 80 09 
$2  30 81 09 
$5  30 82 09 
$10  30 83 09 
$20  30 84 09 
Bill Returned  All valid bill types disabled in software 
$1  30 C0 09 
                                                      Page 5 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

$2  30 C1 09 
$5  30 C2 09 
$10  30 C3 09 
$20  30 C4 09 
Bill Held In Escrow   
$1  30 90 09 
$2  30 91 09 
$5  30 92 09 
$10  30 93 09 
$20  30 94 09 
Bill forcibly Removed   
$1  30 A1 09 
$2  30 A2 09 
$5  30 A3 09 
$10  30 A4 09 
$20  30 A5 09 
Bill Validator Status   
01  Defective Motor 
02  Sensor Problem 
03  Validator    Busy 
04  ROM Checksum Error 
05  Validator    Jammed 
06  Validator was Reset 
07  Bill Removed 
08  Cash Box Out of Position 
09  Unit Disabled 
0A  Invalid Escrow Request 
0B  Bill Rejected 
010xxxxxx  Number of attempts to input a bill while validator is disabled 
14  Bill not accepted either because the bill type is not enabled in 
the software or the bill was not recognized 
For COIN    ACCEPTOR 
Coins Deposited:    
(Byte1)        (Byte 2) 
01yyxxxx    zzzzzzzz   
yy = Coin Routing   
00: Cash Box         
01: Tubes        
10: Not Used   
11: Reject   
xxxx = Coin    Type 
zzzzzzzz = The number of coins in the tube for the type accepted. 
 

                                                      Page 6 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

Coins Dispensed Manually      
(Byte1)        (Byte 2) 
    1yyyxxxx    zzzzzzzz   
yyy = The number of coins dispensed   
xxxx = The coin type dispensed   
zzzzzzzz = The number of coins in the tube 
The coin types are:   
                        Type 0 = 5c    Type 2 = 25c   Type 5 = $2 Can. 
                        Type 1= 10c    Type 4 = $1 Can.   
Note:  The  type  of  the  coin  is  the  same  as  the  bit  that  needs  to  be  set  in  the  ‘mdbCointype’ 
routine in order to enable the acceptance, or distribution of that coin. 
 

COIN ACCEPTOR 
All values are in hex.  DATA RECEIVED FROM MDB    AND SENT TO THE PC 
 
  Below Low Mark  Above Low Mark Above High Mark 
Coin Inserted   
NICKEL  08 50 00  08 50 06  08 40 4C 
DIME  08 51 00  08 51 08  08 41 6B 
QUARTER  08 52 00  08 52 06  08 42 4B 
QUARTER (1)  08 52 00  08 52 06  08 42 15 
$1 CANADIAN*  08 44 00 
$2 CANADIAN*  08 45 00 
* Dollar coins are routed directly to the cash box 
 
Coin Dispensed Manually   
NICKEL  08 90 00  08 90 06  08 90 4C 
DIME  08 91 00  08 91 08  08 91 6B 
QUARTER  08 92 00  08 92 06  08 92 4B 
QUARTER (1)  08 92 00  08 92 06  08 92 15 
Coin Rejected   
NICKEL  08 70 00  08 70 06  08 70 4C 
DIME  08 71 00  08 71 08  08 71 6B 
QUARTER  08 72 00  08 72 06  08 72 4B 
QUARTER (1)  08 72 00  08 72 06  08 72 15 
$1 CANADIAN*  08 74 00 
$2 CANADIAN*  08 75 00 
 
MDB    STATUS   
01  Escrow Request 
02  Changer Payout Busy 
03  No Credit 

                                                      Page 7 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

04  Defective Tube Sensor 
05  Double Arrival 
06  Acceptor Unplugged 
07  Tube Jam 
08  ROM Checksum Error 
09  Coin Routing Error 
0A  Changer Busy 
0B  Changer was Reset 
0C  Coin Jam 
21  Coin not recognized/slug. Returned 
Upon  startup  one  of  these  values  below  may  be  sent  to  the  PC  –  These  are  the  VMC 
Commands. 
08  Reset 
09  Status 
0A  Tube Status 
0B  Poll 
0C  Coin Type 
0D  Dispense 
 

MDB‐RS232 test with Nayax MDB cashless reader 
 
Important note: if User want to test with Nayax card reader, must make sure that your card 
 
reader can connect to the nayax remote server system.that would be better to confirm with 
 
nayax servicer person or sales.Because if cann’t connect to the nayax server,then MDB and 
 
even all functions are not enable.then you cann’t test it.   
 

MDB card reader has six working status: 
1.Inactive:   
After  powered  on  or  after  a  Reset  command,then  device  will  go  to  this  state.User  can  use  the  SETUP 
command to active the nayax reader 
2.Disable: 
When  card  reader  received  the  config  data,will  go  to  this  "Disable"  Status,Also  If  user  send  the  "Disable" 
Command,also will go to this state. 
3.Enable: 
After the "Enable" command and Before detected a valid card,then stay in this state. 
4.Session Idle: 
When read a valid card,will go to "Session Idle" state    to wait the "Vend request" 
5.Vend request 
When received the "Vend request" from the VMC,will go to vend status 
5.Vend 

Command List: 
1401              Enable card reader,    return 00 
                                                      Page 8 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

1400          Diable card reader,    return 00 


1402          Cancel card reader,    return 00 
10            Reset 
1300000A0001      REQUEST VEND to notice the card reader to select the goods and how much ,return 
00   
1301          VEND CANCEL 
13020001        VEND SUCCESS      return 00 
130500640001      CASH SALE        return 00 
1304          SESSION COMPLETE 
1500          REQUEST REVALUE 
1700          REQUEST ID      return FF 
110001000000      Config the card reader    Return :01 01 09 72 01 02 07 0D 94   
1101FFFF0000       Setup the maximum and minimum price 

Steps for Testing with the card reader: 
VMC:      110001000000      Config the card reader 
READER:      010109720102070D94    card reader reply 
VMC:      1101FFFF0000       Set the maximum and minimum price 
READER:  no reply 

 
READER:      03FFFE        Reading a valid card and wait the Vend selection 
VMC:      1300000A0001    VMC command to card reader after Vend selection 
READER:      00       
READER:      05000A        Card reader send to VMC, confirm the good dispatch 
VMC:      13020001      VMC tell the card reader,already dispatch the selected goods 
READER:                no reply 
VMC:      1304        end the section. 
READER:      07 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

                                                      Page 9 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

Important questions during application: 
1. Sometimes when send the command to the mdb‐rs232,but I cann’t get any reply. How can I 
know if the command has already been sent successfully to the payment device? 
Answer:  In  MDB‐RS232  box  design,when  PC  send  the  command  to  it  ,it  will  forward  the 
command  to  payment device.  But sometimes  the  payment  device is  busy,for  example  a  bill  is 
inserted and payment device cann’t reply the box in time. So PC cann’t get the reply.then just 
need to resend the command later. Of course,this is not a problem,because ALL the command 
from PC,that is not a realtime command. 
 
2. How can I know if the payment device is enabled or disabled ? 
Answer: If the payment device is disable,it will report the status to PC.For example,bill acceptor 
is disabled,will always report 30 09 to PC 
 
3. If I can use a PLC or android board to connect it ? 
Answer: That is no problem. Actually,user can use any main controller which has RS232 or USB 
port to work as the VMC.Of course, if the main controller only has the USB port.then will use a 
USB  to  RS232  adapter.  And  install  the  driver  in  the  main  controller.  Then  when  USB  to  RS232 
adapter pluged,will create a virtual com port. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

                                                      Page 10 of 11                                                                              http://www.waferlife.com 
 
MDB‐RS232  Interface  Adapter  for  MDB  Coin  Changer  Bill  Acceptor  and  MDB  card  reader 

How to order a sample to test ? 
Answer : We can order the samples from online shopping store: http://cnkiosk.aliexpress.com 
 
 
Wafer  manufacture  a  series  of  the  MDB  payment  adapters  for  Vending  machines  cashless 
payment  system,wireless  payment  payment  and  Provide  a  rich  solution  for  vending 
machine,kiosk machine or other self‐service projects. 
 

How can we connect the Pulse type coin acceptors or bill acceptors to PC ? 
Answer:  WAFER  also  have  the  PULSE‐PC  adapter  box,that  is  used  to  connect  the  pulse  type 
payment device to computer RS232 port.   
We also can order the samples from: http://cnkiosk.aliexpress.com 

How can we develop a cashless payment interface to existing vending machine? 
Answer:  WAFER  also  have  the  RS232‐MDB  adapter  box,that  is  used  to  connect  the  RS232 
interface PC or android main board or popular Raspberry pi board to vending machine,and then 
developer can use some simple command to act as a perfect cashless payment solution. 
We also can order the samples from: http://cnkiosk.aliexpress.com 

How can we develop a mobile payment solution for existing vending machine ? 
Answer: WAFER have the 3G or 4G or LAN version payment module for selection. 
We also can order the samples from: http://cnkiosk.aliexpress.com 

Where can we get more further information and get the fast technical service ? 
http://www.waferlife.com/en/MDB2PC‐PC2MDB.html 
 
Both pre‐sales and after‐sales can receive help and advice through our online skype technical 
support.   
 
 
Email:    [email protected] 
Web:  http://www.waferstar.com 
  Tel:    0086‐21‐51870528 

  Online Service Skype: wafer‐service 
 
 
 
 
 
 
V2018‐V7.2 

                                                      Page 11 of 11                                                                              http://www.waferlife.com 
 

You might also like