background image

IV. High level protocol

A. Overview

The high level protocol is available by using our demo application that is connecting to the
serial   port   and   that   can   be   accessed   by   the   user’s   application   through   a   socket.
The application requires Python 3 to be installed on the user’s application computer and,
also, depends on PySerial (tested with PySerial versions 3.0.1, 3.2.4 and 3.3).

The demo application requires one parameter (serial port name) and listens on port 5127
TCP.

You   can   use   telnet   or   other   similar   application   to   test   the   daemon,   sending   simple
commands and receiving JSON response messages.

The  JSON   answer   is  a  list   containing  the   hexadecimal   values  of  the   binary   low   level
protocol in chapter III or an interpreted message, depending on the issued command.

B. Protocol description

1. Write to memory - METWRITEMEM

This command writes a set of bytes starting at a specified address. The data set length 
cannot be longer than 64 bytes. The dataset is a list of bytes, in decimal format. 

Command

Example, setting second price to 1600 (EUR16.00)
METWRITEMEM(4,0,0,6,64)
First parameter of this function is the address to start writing, the rest of the parameters are byte values to write

Device response

{"DeviceResponse": "Acknowledge","MessageID": 101}
{"Error": "Syntax Error","ErrorCode": 1001}
{"Error": "Unknown command","ErrorCode": 1002}

2. Read from memory - METREADMEM

This command writes a set of bytes starting at a specified address. The data set length
cannot be longer than 120 bytes. The dataset is a list of bytes, in decimal format. 

Command

Example, reading second price
METREADMEM(4,4)
First parameter of this function is the address to start reading, the second parameter is the length (in bytes) to read

Device response

"{DeviceMessage": "ReadMemory",
"StartAddress": 0,
"DataLegth": 10,
"MemoryData": [0,0,0,100,0,0,0,150,0,0]}

© - 2018 – AUTOMATROM SRL – 

www.automatrom.ro

                                                                             Page 14/26

Содержание PICOBRIDGE RS232

Страница 1: ...PICOBRIDGE RS232 Executive MDB bridge mode v06 05 2018 2018 AUTOMATROM SRL www automatrom ro Page 1 26 ...

Страница 2: ...y METREADMEM 14 3 Send credit to the machine METSENDCREDIT value 15 4 Return change from the machine METSENDCHANGE value 15 5 Get device status METGETSTATUS 15 6 Device reset METRESET 15 7 Read product price METREADPRICE n 16 8 Write product price METWRITEPRICE n value 16 9 Read maximum credit setting METREADMAXCREDIT 16 10 Write maximum credit setting METWRITEMAXCREDIT value 16 11 Read maximum ch...

Страница 3: ...GSETTINGS 21 28 Write vending settings METWRITEVENDINGSETTINGS value 21 29 Read current credit METREADCURRENTCREDIT 22 30 Setting RTC 22 32 Reading RTC 23 C Unsolicited messages 23 1 Vend request 23 2 Vend result 23 3 Bill accepted 23 4 Coin accepted 24 5 Change requested 25 6 Cashless finish session 25 7 Cashless start session 25 8 Button pressed 25 Notes 26 2018 AUTOMATROM SRL www automatrom ro ...

Страница 4: ... each item too It can be used on any Executive price holding vending machine with a maximum of 96 selections products The device is self maintained and transparently manages the entire Executive MDB and transactions flow The main functions available remotely by using serial port are reading device memory including sales counters cash counters vending settings etc writing device memory erasing coun...

Страница 5: ...mode Executive RX 11 GND GND 12 Executive TX Executive to MDB bridge mode Executive TX 13 GND GND 14 MDB slave TX MDB slave mode TX 15 GND GND 16 MDB slave RX MDB slave mode RX 17 Signal GND MDB slave mode signal GND 18 Master wake Not implemented in this firmware version battery mode MDB payment systems wake signal J1 working mode change jumper J8 when installed enables MDB sniffer J4 RS232 DB9 f...

Страница 6: ...ct RTS CTS handling 2 Power supply requirements The PICOBRIDGE can be powered with 24V AC DC or 12V AC DC depending on your MDB PERIPHERALS NOTE If you apply 24AC please make sure that your MDB peripherals can support 34VDC input Otherwise use a DC power supply 2018 AUTOMATROM SRL www automatrom ro Page 6 26 ...

Страница 7: ...on needs device reset command after successful write of this settings 393 1 Scaling factor usually 10 covers most of the currencies needs device reset command after successful write of this settings 394 1 Decimal point on the machine s display needs device reset command after successful write of this settings if it is 0 no decimal places if it is 2 one decimal if it is 4 two decimals if it is 8 th...

Страница 8: ...tocol messages Every message consists of a message header message data and CRC The CRC is calculated by an XOR operation of the message header and message data bytes Every time a command or a response is sent the other device should answer with ACK or NACK accordingly ACK message is 0xFC 0xFC 0xFC 0xFC 0x00 NACK message is 0xFD 0xFD 0xFD 0xFD 0x00 As a convention for the protocol description table...

Страница 9: ...er settings to keep the interface working Be careful modifying those parameters and please make sure you clearly understand the meaning of each parameter 2 Read from memory Using this command the data could be read from device s non volatile memory The maximum length of data that could be read with one command is 64 bytes The device s internal memory store the vending settings counters prices etc ...

Страница 10: ...swers answers on MDB poll command B33 B40 cashless device status history B40 contains the latest status codes are based on the MDB cashless answers on MDB poll command B41 B44 VMC status history 0x00 machine is up and running 0x40 machine is out of order B45 B48 coins value counter B49 B52 bills value counter B53 B56 cashless value counter B57 B60 change value counter B61 B64 tube status total coi...

Страница 11: ...to rise on the machine CRC Device response ACK or NACK according to the command execution result 6 Return change to the customer Using this command the user s application can send a command to force return change tu the customer HEADER B0 CMD B1 PARAMETERS B2 to Bn CRC Bn 1 0xFA 0x08 B2 B5 The value not scaled that the user application needs to return to the customer CRC Device response ACK or NAC...

Страница 12: ...e This message is received every time a bill is accepted and stacked HEADER B0 CMD B1 PARAMETERS B2 to Bn CRC Bn 1 0xFA 0x0D B2 B5 the value not scaled of the last bill accepted and stacked by the bill validator For example for EUR10 00 the values will be B2 0x00 B3 0x00 B4 0x03 B5 0xE8 CRC 11 Coin accepted by the vending machine unsolicited message This message is received every time a coin is ac...

Страница 13: ...for EUR1 00 the values will be B2 0x00 B3 0x00 B4 0x00 B5 0x64 Value is 0xFFFFFFFF if one of the conditions below are met and the interface will not return change to the customer even if there is some credit remaining credit comes over the serial interface and not from inserted cash let you control if you want to return change for cashless credit loaded by serial port machine is set for force vend...

Страница 14: ... This command writes a set of bytes starting at a specified address The data set length cannot be longer than 64 bytes The dataset is a list of bytes in decimal format Command Example setting second price to 1600 EUR16 00 METWRITEMEM 4 0 0 6 64 First parameter of this function is the address to start writing the rest of the parameters are byte values to write Device response DeviceResponse Acknowl...

Страница 15: ...ommand METGETSTATUS Device response DeviceMessage DeviceStatus DeviceName PICOBRDGEXEMDB BillStatus 144 0 128 0 144 0 128 0 CoinStatus 0 1 2 0 1 0 1 0 CashlessStatus 0 0 0 0 0 0 0 0 VMCStatus 0 0 0 0 CoinsCounter 4294967295 BillsCounter 700 CashlessCounter 4294967295 ChangeCounter 300 AvailableChange 8720 Button1 NotPressed Button2 NotPressed CurrentCashCredit 0 CurrentCashlessCredit 0 CurrentTemp...

Страница 16: ...ing this command the user s application can read the maximum credit set on the device While a transaction if the cash inserted by the customer reaches this limit the payment systems are inhibited It Is a safety method to avoid returning too much change Command Description METREADMAXCREDIT Reads the non scaled MAXIMUM CREDIT settings for transactions Below is the an example answer to the METREADMAX...

Страница 17: ...change Command Description METWRITEMAXCHANGE value Requires METRESET after issuing this command since the value is loaded only once at start up Writes the non scaled MAXIMUM CHANGE accepted for a transaction For example set max change to EUR 5 00 METWRITEMAXCHANGE 500 Device response DeviceResponse Acknowledge MessageID 101 Error Syntax Error ErrorCode 1001 Error Unknown command ErrorCode 1002 13 ...

Страница 18: ... are ignoring this and work on their decimal point setting In that case if they are not matching this will drive you to display error on values Command Description METREADDECIMALPOINT Reads the DECIMAL POINT settings for credit price display Below is an example answer to the METREADDECIMALPOINT command where decimal point is 2 meaning 2 decimals after the decimal point Device response DeviceRespon...

Страница 19: ...101 Error Syntax Error ErrorCode 1001 Error Unknown command ErrorCode 1002 19 Read bills counter METREADBILLSCOUNTER Using this command the user s application can read the non volatile counter representing the total value of the cashed bills Command Description METREADBILLSCOUNTER Reads the BILLS COUNTER Below is an example where the device shows a value or EUR 104 00 for the cashed bills Device r...

Страница 20: ...r Syntax Error ErrorCode 1001 Error Unknown command ErrorCode 1002 23 Read cashless counter METREADCASHLESSCOUNTER Using this command the user s application can read the non volatile counter representing the total value of the cashless transactions Command Description METREADCASHLESSECOUNTER Reads the CASHLESS COUNTER Below is an example where the device shows a value or EUR 12 50 for cashless tra...

Страница 21: ...values between 1 and 96 and number of sales can take values between 0 and 65535 2 bytes Device response DeviceResponse Acknowledge MessageID 101 Error Syntax Error ErrorCode 1001 Error Unknown command ErrorCode 1002 27 Read vending settings METREADVENDINGSETTINGS Using this command the user s application can read the device vending settings Command Description METREADVENDINGSETTINGS Reads the devi...

Страница 22: ...Device response DeviceResponse ReadCurrentCredit CurrentCreditValue 520 30 Setting RTC Command Description METSetRTC h m s d M y wd Set device internal RTC date time h hour must be in 24h format only 0 23 m minute 0 59 s second 0 59 M month 1 12 y year 00 99 wd week day 1 7 1 for Sunday 2 for Monday etc Device response DeviceResponse Acknowledge MessageID 101 Error Syntax Error ErrorCode 1001 Erro...

Страница 23: ...by the customer key number selection number ProductPrice is the price of the latest product selected by the customer MessageID is the message ID number always 103 for this message 2 Vend result This message is send by the device every time the VMC is finishing a transaction product dispensed or product failed to dispense Message VMCMessage VendResult ResultCode VendSuccess MessageID 104 Descriptio...

Страница 24: ...serted into the coin acceptor and sorted to a tube or to the cash box Message DeviceMessage CoinAccepted CoinAcceptedValue 50 Description CoinAcceptedValue is the value of the last accepted coin in this example coin of EUR0 50 2018 AUTOMATROM SRL www automatrom ro Page 24 26 ...

Страница 25: ...nge operation is inhibited by the interface settings Pressing changer escrow lever while the current credit is 0 will be ignored No message sent in this situation 6 Cashless finish session This message is send by the device every time the cashless device is finishing the session cashless support removed Message DeviceMessage CashlessFinishSession CashlessCreditValue 0 Description 7 Cashless start ...

Страница 26: ...Notes 2018 AUTOMATROM SRL www automatrom ro Page 26 26 ...

Отзывы: