82h – ENABLE BILL
ACCEPTOR <STX><00><82h><00><ETX><CHK>
This command
immediately allows the reading of bills from the bill acceptor.
83h – DISABLE
BILL ACCEPTOR <STX><00><83h><00><ETX><CHK>
This command
immediately stops the reading of bills from the bill acceptor.
86h – ENABLE
CECB16 <STX><00><86h><00><ETX><CHK>
This command
allows the sending of data to the PC.
87h – DISABLE
CECB16 <STX><00><87h><00><ETX><CHK>
This command
stops the sending of data to the PC.
88h – DISPENSE A
CARD/BOX/COINS/SPIRAL <STX><00><88h><01><Dispenser Number><ETX><CHK>where
Dispenser Number = 1 to 8.
This command
dispenses a card/box/coins/spiral from the designated card
dispenser, box dispenser, coin dispenser or spiral motor. A
dispense can be commanded for one of 16 dispensers. Note that
the host is responsible for checking the status (see command
Status Card/Box/Coin Dispenser) of the designated dispenser to
make sure the dispenser is ready before issuing a dispense. The
only good status returned is the ‘06h’ command complete, except
for the coin dispenser. The good status is returned after about
500 Msec from the time of receipt of the command. Note that
after receiving the good status the dispenser takes four to five
seconds to dispense the product if it is a box dispenser. The
user program should then poll the CECB4 with the following
‘8Ch’ Status packet. The box dispenser will return a READY after
the five seconds when another box is ready to be dispensed. The
polls are usually about 300 milliseconds apart. Note that a
spiral motor dispenser does not have a return status because it
does not have a ready or empty sensor. The customer looks to see
if there is merchandise before pushing the dispense button.
To specify
whether coins will be dispensed, the value for UPS must be set
to the coin count desired when using the CECB1 Tester. If the
UPS value is set to zero (default at power up) then a card/box
will be dispensed. See the 7Fh command that sets the coin count
to dispense. Always use the 7Fh command before the 88h command.
The coin
dispenser returns an additional status after the ‘06h’ command
complete. The format of this packet is: <STX><00><91h><2><COIN
COUNT><DISPENSE STATUS AT END><STX><CHK>
Where the COIN
COUNT is set to the number of coins that could not be dispensed.
The DISPENSE STATUS bit 0 is 1 if there is a JAM and bit 2 is 1
if there is an EMPTY condition. The EMPTY is determined if
contact is lost between two metal plates in the coin dispenser.
Approximately, 20 coins can be dispensed after the EMPTY. The
CECB4 tries to dispense as many coins as possible without going
below the 20 coin restriction. There is no hardware JAM line
from the coin dispenser. The JAM condition occurs whenever a
dispense is commanded by the CECB4 and 12 seconds goes by
without a coin dispensing. A dispense can not be accepted if the
EMPTY is detected by the CECB4 before the first dispense in the
total count. Do not use command 8Ch to examine the coin
dispenser status, just issue the 88h command and look at the
return status to see what happened.
In this version
the eight lamp outputs are used as dispense lines, expanding the
dispenser outputs from 8 to 16. The lamps can simply be wired to
always stay ON.
The dispensers #
9 to 12 are on the main board P3 connector, pins 6 to 9. The
dispensers 13 to 16 are on the expansion board P3 connector,
pins 6 to 9. There are no input status lines for some dispensers
like spiral vending motors. In the next release V4.06, the
firmware will have one input status line for each of the outputs
9 to 16. These will function as the READY input status lines for
card or box dispensers.
When using the
CECB1 tester program to test the CECB4, look at the hex command
88, ADD TO DISPENSER NUMBER to allow using just two dispense
buttons 1 and 2 to dispense from 1 to 16. This is a little
cumbersome right now until the CECB4API Tester is released in
the near future.
8Ah –
SERIAL/VERSION NUMBERS <STX><00><7Bh><00><STX><CHK>
This command is
to return the serial number of the firmware assigned to a
particular customer followed by the version number of the
firmware release.
The format of the
returned status is:
<STX><00><8Ah><07h><Seven
Serial/Version Bytes><STX><CHK>
The seven
Serial/Version bytes are composed of three serial number bytes
followed by four version number bytes. The serial number is six
digits encoded as three packed BCD bytes. For example, the
serial number ‘123456’ would be the three bytes ‘12h’, ‘34h’,
‘56h’. The version number is four ASCII characters such as
‘4.00’ (e.g. 34h, 2Eh, 30h, 30h) which would represent the
‘V4.00’ firmware version.
The version
number and serial number are displayed in the LCD display, if it
is connected, upon powering up of the CECB16 board. The CECB4
Tester can be used to demonstrate this command packet by
clicking the DIAGNOSTIC button. Observe the SEND and RECEIVE
BUFFER contents in the tester.
8Ch– STATUS
DISPENSERS 1 to 8 <STX><00><8Ch><00><STX><CHK>
This command will
return the status of all of the first dispensers (1-8). The host
must keep track of what devices are presently connected on each
port. The card or box dispensers can be attached to any of the
eight ports available. The return status is different for the
card, box, coin dispensers, and spiral. There is no return
status for spiral.
The format of the
returned status is:
<STX><00><8Ch><0Ch><Eight
Dispenser Status Bytes><Two General Status Bytes><ETX><CHK>
There are three
status bits for each of the card/coin/ticket dispenser status
bytes. They represent the Ready, Empty, and Jam statuses. Using
the CECB1 Tester program, click the STATUS BOARD button to
return these eight status bytes.
Each status byte
for a card/coin/ticket dispenser is defined as follows:
BYTE
BIT
2 1 = Ready (Has
cards, coins or tickets and ready to dispense.)
1 1 = Empty (Not
ready – out of cards, coins or tickets.)
0 1 = Jam (Not
ready – jam or stuck detected)
The host can keep
issuing the Status command every 300 MSEC while monitoring the
card/coin or ticket dispenser status. The host is looking for
the dispenser to go READY. Another dispense command is not
issued until the previous dispense has finished successfully.
This is because a large surge current from the power supply may
be in process while retries are being attempted during a jam.
Each retry takes approximately 4-5 seconds. Up to fourteen
re-tries can be set using the dip switches on the bottom of the
card dispenser (four is usually recommended). Another option set
for a card dispenser dip switch is whether to Hold or Eject the
card after the dispense. If the ‘Hold’ option is set, the card
dispenser status will not go ‘Ready’ until the card is removed.
After a timeout the customer may have to be prompted to ‘TAKE
THE CARD!’. The power supply needs time to recover from retries
before another dispense command is attempted, probably 2
seconds.
The status bytes
for the box dispensers are defined as follows:
BYTE
BIT
2 1 = Not Ready
(Either no inventory or in process of dispensing or no box
dispenser attached)
1 1 = Ready (Has
inventory and can dispense)
The two Button
bytes are defined as follows:
BYTE 1 = Buttons
1 to 8 are represented by bits 0 to 7 respectively. Note that if
the CECB16 expansion board is not present then buttons 5 to 8
are trash. Likewise, if any button is not connected to its
status bit is trash.
BYTE 2 = Bit 0
represents a possible special extra button called the ALL
Button, which connects via the P14 connector.
8Dh– STATUS
DISPENSERS 9 to 16 <STX><00><8Ch><00><STX><CHK>
This command will
return the status of all of the last dispensers (9-16). The host
must keep track of what devices are presently connected on each
port. The card or box dispensers can be attached to any of these
eight ports. The return status is different for the card, box,
coin dispensers, and spiral. There is no return status for
spiral.
The format of the
returned status is:
<STX><00><8Ch><0Ch><Eight
Dispenser Status Bytes><Two General Status Bytes><ETX><CHK>
There is just one
status bit returned which represents the Ready status. Using the
CECB16 Tester program, click the STATUS BOARD2 button to return
these eight status bytes.
Each status byte
for a card/coin/ticket dispenser is defined as follows:
BYTE
BIT
2 1 = Ready
See command ‘8Ch’
for the explanation of the rest of the packet (which is the
same).
90h – STATUS DATA
<STX><00><90h><04><Byte 1 …Byte 4><ETX><CHK>
This status data
is automatically sent to the PC upon a power up reset. Each time
cash is added to the cash value (current total of cash not yet
sent to the PC), the Status Data bytes are also sent. If an
error condition occurs, the Status Data will be sent even if
there is no cash. After the error status is accepted by the PC (ACKed),
it will be cleared. Note that an error, such as SLUG is a
temporary error condition when a bill is rejected because a fake
bill was inserted or the bill was not of good quality. It can
also be an indication that the bill acceptor is starting to
fail. Any other error can be monitored by the Status 1, Bit 1
for a total failure where no bills can be accepted at this time,
until the condition is cleared.
The status bytes
are defined as follows:
STATUS BYTE 1
BIT
-
COIN - Stuck
-
BILL – Fault
detected on Fault line (general indicator of major failure
of bill acceptor)
-
BILL – Read
twice and did not agree (standard to read the electronic
value twice)
-
BILL –
Stacker full
-
BILL – Jam or
stuck
-
BILL – Reject
SLUG (phony bill)
-
BILL Acceptor
OFF
-
COIN Acceptor
OFF
Note: Bit 1
indicates the Bill Acceptor is Out of Service. This status bit
comes directly from the Bill Acceptor and is continuously
monitored by the CECB16. It covers (detects) all the critical
failures, such as bad power, bad cable, circuit fail, sensor
fail, Jam, Stacker Full, etc. that would render the bill
acceptor inoperative.
There
is a feature to allow initializing the SERIAL bill acceptor
table for the USA and Canada bills directly from the CECB4
board. To initialize for USA, push the S1 button and hold during
a power up. After the Escrow message appears release the button.
The procedure is the same for Canadian bills except button S2 is
used.
The
bill values are:
USA
CANADA
-------
--------
1 $1 1
$5
2 $2 2
$10
3 $5 3
$20
4 $10 4
$50
5 $20 5
$100
6 $50
7 $100
The
bill table can be changed for other currencies by using the API.
Normally before a board is shipped it will be initialized for
the USA.
STATUS
BYTE 2
BIT
0. CECB4 Power
Up Hardware Reset Detected
1. Door Open Detected
2. Future Use
3. Future Use
4. Future Use
5. Checksum Error – Escrow (cash total meter)
6. Future Use
7. Future Use
Note 1:
If both bits 0 and 5 are simultaneously detected, the cash value
was restored from non-volatile memory upon power up. Thus, it is
not known how long the CECB4 board was powered down. This cash
value is called FLOAT. The PC must determine what to do with
this cash float. It usually can not be determined if the same
customer is at the machine. In this case, the PC can ‘swallow’
the float and put it in a separate meter for accounting
purposes. If the FLOAT value has a checksum error upon power up,
it is set to zero.
Note 2:
The FRAM non-volatile memory does not have to have a special
initialization before installing in the CECB16 board. The only
initialization required is the Cash Value (Escrow), and the
checksum error will set the Cash Value to zero upon the first
power up.
BYTE 3
Most significant
byte of last value received in nickels.
BYTE 4
Least significant
byte of last value received in nickels.
For example,
$20.00 would be <01h><90h> and $100.00 would be <07h><D0h>. Note
that if more cash values are received before the transfer to the
PC, whatever is in escrow, the sum total, will be transferred.
If the status is
being reported but there is no Cash Value, the bytes would be
<00><00>.
8Dh – STATUS
CARD/BOX DISPENSERS 9 to 16 <STX><00><8Dh><00><STX><CHK>
Feature to Use
Changeable Bill Table for MARS Serial Bill Acceptor
INTRODUCTION
Version V4.02 API introduced the feature of selecting the bill
values for the hex codes received by the CECB4 from a MARS
compatible serial bill acceptor. For example, for the USA, the
bill values are typically $1, $2, $5, $10, $20, $50, and $100.
The corresponding hex codes to match would be 81h, 82h, 83, 84h,
85h, 86h, and 87h. The CECB4 board bill table must be set up at
least once.
The bill table is
stored in FRAM, which is non-volatile memory. The manufacturer
of the bill acceptor must supply the hex codes and the matching
bill values. This table is normally setup once and it usually
never has to be set again. After a power down/power up sequence,
the table is preserved.
POSSIBLE TABLE
VALUES
The table values
are numerals such as 1, 2, 3, etc. These relate to the dollar
(or what ever currency) as follows:
0 = no value
(causes the bill to be rejected)
1 = $1.00 which
is 81h
2 = $2.00 which
is 82h
3 = $5.00 which
is 83h
4 = $10.00 which
is 84h
5 = $20.00 which
is 85h
6 = $50.00 which
is 86h
7 = $100.00 which
is 87h
8 = $500.00 which
is 88h
9 = $1000.00
which is 89h
10 = $200.00
which is 8Ah
11 = $25.00 which
is 8Bh
12 = $30.00 which
is 8Ch
It is easier to
illustrate how to load the table when using the CECB4 Tester.
This tester program was designed for the CECB4/CECB16.
To up the proper
configuration of the bank note table, first, set the first six
bill value codes into the six coin values. Remember that the
least value in coins is 5 cents. In other words, we are
attempting to explain that the number in the box must be 5 times
the value. Example: A number 1 would be indicated in the box as
a 5. So, 1,2 3, etc. would be set as 5, 10, 15, etc. This may be
a little confusing for the present until the CECB4 Tester
Software Program is released. Please look carefully at the
output window and observe what hex packets are being sent to the
CECB4.
Next, click
"Update" box, then "Status Dispenser" box and then click "ONE"
box. This will cause the six values that were just transmitted
to be stored in the bill table in FRAM. Then repeat putting in
the next six coin values and click Status Dispenser and click
TWO for more than 6 bank note denomination values. This store
the new six coin values (really bank note codes) in the bank
note table in FRAM.
Coin values are
described in the above 80h – SET COIN VALUES section.
This procedure
only has to be done once to store the bill table in FRAM
forever.
Next, put in the
real coin values, if they are being used (actually only coin
value 6 is used). Then send the coin values over to the CECB16.
Remember to put
‘0’ in every bill table value where the bill is not being used.
This will cause the bill to always be rejected. For example, USA
$2.00 bill is rarely accepted. So, put zero in for that value.
Note, when
setting the bill table values that coin value 1 represents a hex
81h received from the bill acceptor. Likewise, coin value 2
represents the hex value if 82h (raw code) from the bill
acceptor.
Therefore, when
sending the second set of coin values (really bill values 7-12)
that these represent hex values 87h through 8Ch. Experiment and
it will soon become evident how it works.
8Fh MOVE COIN
VALUES TO BILL TABLE
<2><0><8Fh><1><1><3><8Eh> sends the coin table to the first half
of the bill table.
And
<2><0><8Fh><1><2><3><8Dh> sends the coin table to the second
half of the bill table.
D0h – SEND FORTY
CHARACTERS TO LCD
<STX><00><D0h><40><40
DATA BYTES TO DISPLAY><03<ETX><CHK>
After power up
the LCD displays the Firmware Version and the customer Serial
Number. After this, the LCD displays the Escrow, the cash just
input that has not been sent to the host yet. When the ‘D0h’
command is sent, the 40 characters will be displayed in the 2X20
LCD display (see APPENDIX A below for the character set code
matrix). After this first message is displayed the Escrow
messages will no longer be displayed and the displayed is only
updated if a new ‘D0h’ command is sent. The character set is
ASCII with special characters.
APPENDIX A
LCD Character
Set
The
character set for the LCD module is shown in the following
figure