Manual 18-ccTalk
Version 0.6
Page 22
DispenseCoins(HopperAddress, DummyBytes, NrCoinsToPay);
}
else if (HopperType == "ITA serial")
// use serial nr as dispense key?
{
DispenseCoins(HopperAddress, SerialNr, NrCoinsToPay); // serial number already
requested during initialization
}
}
else
// hopper errors
{
ResetHopper();
// send reset command (set receive timeout to 100 ms)
// in case of opto errors, send dispense commands within 333 ms after receiving ACK
// from Reset command
}
// Check hopper status during payout
do
{
// request hopper status each 100ms for real-time display of count values
HopperCounters = RequestHopperStatus(HopperAddress);
// update status counters
}
while (HopperCounters.NrCoinsRemaining > 0)
// Verify Dispense procedure (may be extended of coarse)
HopperStatus = TestHopper(HopperAddress);
// get hopper status bytes
if (HopperCounters.NrUnPaidCoins > 0)
// payout completed ?
{
if (HopperStatus & PAYOUT_TIMEOUT_OCCURED)
// no, hopper timeout ?
{
ShowMessage("Hopper Timeout occurred");
}
if (HopperStatus & JAM_OCCURED)
// hopper jammed during payout ?
{
ShowMessage("Hopper probably jammed");
}
}
// Check Hopper Levels
HopperLevel = RequestHopperCoinLevel(HopperAddress);
if (HopperLevel & LOW_LEVEL)
{
ShowMessage("Hopper nearly empty");
}
// Check Total Dispense counter, etc