CECB4 API Controller Specification And API Protocol Specification for 1 - 16 selections with a Touch Screen PC with XP.

Original Release May 29, 2002 

Current Revision 26 October, 2004 Rev 4.10/4.11

This product specification is proprietary and confidential to: VENDAPIN L.L.C. 

Sales: 352-796-2693 Fax 775-521-1673 

Darrell G. Rademacher, International Sales & Marketing
E-mail: darrell@vendapin.com

 Teddy Martin, Technical Software Support E-mail: tedm_2001@hotmail.com
or call (727) 669-5886
Technical Hardware Support E-mail:
support@vendapin.com 
 E-mail: support2@vendapin.com
Tel: (607) 844-8134

Table of Contents

1 General Description *

1.1 Functional Overview *

1.2 Functional Description *

2 CECB4 Hardware Specifications *

3 CECB4 API Communications Protocol *

3.1 Introduction *

3.2 API Protocol Format *

3.3 API Command Packet Structures *

3.4 API Response Packets *

3.5 API Command Formats *

Update in V4.10/V4.11 version

This version has added a feature to detect the opening/closing of the cabinet door switch.  The hex commands ‘8C’ and ‘8D’ have added a status bit in Status byte 2 for the Door Opening.  A ‘1’ bit in location bit 1 means the Program/Normal switch on the CECB4 board is in the Program mode or the door is open.

Functional Overview

The CECB4 is a new development to accommodate the needs of the Personal Computer Kiosk and other computer driven vending or game machines. With the advent of low cost, high-speed powerful personal computers, the Kiosk PC driven machines have a requirement to dispense cards or packets. The Kiosk is capable of doing this via the CECB4 controller board. In this application the CECB4 is used as a slave board for dispensing up to eight different cards or packets. There is capability to input cash via a MARS compatible banknote acceptor or a high speed pulse banknote acceptor. A serial electronic coin mechanism can also be used using Coin line 6. Money Controls Mark IV coin dispensers can be used.

The CECB4 is a card that fits externally from the computer and is connected via a serial harness or cable. The CECB4 is communicating to the PC through a set of API commands

2 x 20 LCD or Vacuum Florescent Display (Usually for testing only)

CECB4 - Eight Vendapin, L.L.C. Model CD-200 12 or 24VDC Card Dispensers or compatible dispensers.

Also, MARS type banknote acceptor and/or serial electronic coin mechanism.

Typical Scenario

The PC (host) issues a command to the CECB4 to dispense a card from one of eight card dispensers. The PC will then poll the CECB4 to return the status for all eight card dispensers. The PC will examine just the one in question. Keep in mind that the card dispenser could be doing retries if a card is jammed. This could take a long time, probably 4 seconds per retry. The PC program should be aware of how the dip switches are set in the card dispensers. The 2x20 LCD, is optional and is usually used just for testing during development. It displays the serial and version number of the CECB4 firmware. The serial number is assigned to a particular customer. As cash is inserted it is displayed on the LCD. Text can be sent to display up to 40 characters (2x20) on the LCD. After the first such text display, the cash display no longer appears. This allows messages to be sent to the customer without using a touch screen.

Introduction

This document provides detailed information on the API commands used to interface the CECB4 controller board and the PC. The communications interface from the host PC to the CECB4 is a master/slave where the PC is the master and the CECB4 is the slave. Note on nomenclature - in all following descriptions, hexadecimal values are indicated by a trailing 'h' character after a number, while decimal values are indicated by a trailing 'd'. Numbers encased in brackets are assumed to be hexadecimal if there is no trailing character. (E.g. <80> means 80h, or 128d).

API Protocol Format Each sequence uses a common protocol consisting of a command packet and a response packet. The packet structure ensures a method of error detection and recovery. Vendapin has a Visual Basic program called the CECB4 Tester that communicates through a PC RS232 port to the CECB4 and uses this protocol. This allows manual testing of commands and data to/from the PC/CECB16. The RS232 format is 9,600 baud, 1 start bit, 8 data bits, and 1 stop bit. There is no handshaking, such as hardware or XON/OFF. This is a three wire connection with transmit, receive and ground. The CECB4 operates half duplex where the PC is the master. In general, the PC issues a command and the CECB16 responds back.

The API serial command packet specification is designed to be integrated into any operating systems or embedded systems using the
existing serial communication routines libraries. Because of that, we do not offer DLL module.

There are several serial communication component libraries offered by companies that are designed for Windows as listed here:

Visual C++ - Free Serial Communication Library:
http://www.aspfree.com/c/a/Code-Examples/Writing-a-Serial-Communication-Library-for-Windows/

Visual Basic/Net/ActiveX
http://www.wcscnet.com/Software.htm (COMM-DRV/Lib.Net or COMM-DRV/Lib or
SI-COMM)

Reading/writing the serial packets are pretty straight forward with approximate routines that will easily handle the checksum,
parsing chars/strings and other data conversion routines.

We have the CommControls.bas Visual basic source code file (based on Setup Express program) available for assisting you on integrating the Visual Basic serial routines into your system if you're interested.
 

API Command Packet Structures

The command packet is transmitted from the host PC computer to the CECB4. It is the beginning of a communications sequence. The packet has the following structure:

<STX><ADD><CMD><LEN><DTA><ETX><CHK>

Where:

STX ASCII Character For Start Of Text - 02h

ADD Device Address - this byte is not used in this application and must be zero (note that this extra

byte allows the use of the Vendapin Protocol Analyzer for debugging)

CMD Command Byte - 80h through 8Fh, as described in section III

LEN Length Of Data Packet (0 - 63d)

DTA Packet Data (contains the number of bytes specified in LEN)

ETX ASCII Character For End Of Text - 03h

CHK Checksum Of Packet Data - the XOR (exclusive OR) of all bytes from STX to ETX

Minimum Packet Length - 6 Bytes

Maximum Packet Length - 70 bytes (6 bytes packet format + 64 bytes data)

API Response Packets - The response packet is transmitted from the PC to the CECB16. It is the termination of a communications sequence. The packet has the following structure:

<STX><ADD><RSP><LEN><DTA><ETX><CHK>

Where:

STX ASCII Character For Start Of Text - 02h

ADD Device Address - this byte is not used in this application and must be zero

RSP Command Byte – as described below LEN Length Of Data Packet (0 - 255d)

DTA Packet Data (contains the number of bytes specified in LEN)

ETX ASCII Character For End Of Text - 03h

CHK Checksum Of Packet Data - the XOR (exclusive OR) of all bytes from STX to ETX

Minimum Packet Length - 6 Bytes

Maximum Packet Length - 261 bytes (6 bytes packet format + 255 bytes data)

Responses to a Command Packet are:

06h Command accepted (ACK – where the entire ACK packet is: <02><00><06><00><03><07>)

FAh Error in size of data packet (ETX not found where expected)

FCh Data value is invalid

FDh Command packet not completed (timeout occurred)

FEh Unrecognized command code

FFh Checksum error in command packet

If the response code is not ‘Command Accepted’ then the PC must retransmit the command packet.

Command Formats:

80h – SET COIN VALUES <STX><00><80h><06><COIN VALUES><ETX><CHK> where Coin Values = <COIN1 VALUE, COIN2 VALUE, ….COIN6 VALUE>

Coin1 Value corresponds to the COIN1 input,

Coin2 Value corresponds to the COIN2 input, etc.

Each coin value will be one byte where the least significant bit is five cents. At the present time only two coin values are being utilized. These are Coin3 and Coin6 values. The current design is for a maximum of two high speed pulse lines tied to hardware coin line 3 and line 6. A pulse type bill acceptor, if used, must be on coin line 6. A totaling type coin acceptor could be connected to coin line 3. The other coin values should be set to zero (values 1,2 4, and 5 will be ignored).  An example for Coin 6 Value would be <14h> to represent one dollar (twenty nickels).

81h – ADD TO DISPENSER NUMBER <STX><00><81h><01><Add Number><ETX><CHK> where Add Number = 0 to 6.

This command must be the first command issued to the CECB4 with an Add Number always equal to ‘00h’. This is necessary because this Add Number is added to the Dispenser Number upon issuing a Dispense Card command, ‘88h’. This extra command was implemented to allow the CECB1 Tester program to be used for initial testing of the CECB16 API. This tester only has the DISPENSE 1 and DISPENSE 2 buttons to control the dispensing of up to 8 dispensers. This extra command allows a bias to be added to enable using the full range of 8 dispensers for initial testing. In the CECB1 Tester, the Digit Counter in the upper right hand corner sends the packet that uses the ‘81h’ command.

If you look facing a hopper port like P13, the right most pin is Pin 1 which is ground.  The second pin from the right is the Stuck (or Jam) line.  The 3rd pin is the Empty line.  Then the fourth pin is the Ready line.  You should look at these lines using a scope with scope probes (Pin1 to Pin 4 for example); otherwise, you may short out something and damage the port.
 
You have to poll the dispenser after a dispense command.  Wait about 300 or more Msec to start the polling (to allow the dispense to complete).
Use the '8C' hex command to look at dispensers 1 to 8 statuses for the polling.  The dispensers 1-4 are on the main CECB4 board and 5-8 are beneath that on the expansion board.
 
Note the Ready line will not go ready if anything is wrong with the CD200, its cables, power input, Jam, or Empty statuses.  The Ready line will not go ready if the CD200 has a jam condition and is doing retries to try to free the card.  This is the only tricky part.  Only you know how the dip switches are set on the CD200.  The dip switches set how many retries the CD200 will attempt if it detects a jam.  Usually the switches are to to 4 for example.  The API documentation for the '8C' hex command explains this.  Each retry can possibly take 4-5 seconds.  So, if the dip switches are set to 4 retries then (if the dispenser is not Empty) you should wait 16 to 20 seconds (worst case) for the card dispenser to go ready.  The '8C' hex command also suggests that a 2 second delay should be done after retries before issuing another dispense command to allow the power supply to recover.  The best thing to do is experiment with it.  You can create a jam for testing by inserting a long thin blade screwdriver just in front of the card exit slot to prevent a normal exit.
 
Please study the Status Dispensers command (8Ch) carefully.

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

  1.                      COIN - Stuck
  2.                  BILL – Fault detected on Fault line (general indicator of major failure of bill acceptor)
  3.                  BILL – Read twice and did not agree (standard to read the electronic value twice)
  4.                       BILL – Stacker full
  5.                       BILL – Jam or stuck
  6.                      BILL – Reject SLUG (phony bill)
  7.                       BILL Acceptor OFF
  8.                       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

=================================
Serial communication resources

1) Web sites:
Sam's Serial Communication for Visual C++
http://www.samspublishing.com/library/content.asp?b=Visual_C_PlusPlus&seqNum=86&rl=1

Naughter Serial Communication for VB/VC++ (free CSerialPort library/details)
http://www.naughter.com/serialport.html

MSDN Serial Communications in Win32
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp

Other serial communication web sites:
http://www.control.com/1026217270/index_html
http://www.control.com/1026197274/index_html (how to program serial port
for VC++)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=370193&SiteID=1
http://www.ontrak.net/mfc.htm (simple Visual C++ read/write routines)
http://www.sealevel.com/thirdpartysoftware.asp
http://programmersheaven.com/ (serial keyword to find the snippets)
http://www.beyondlogic.org/ (look for RS-232 Interfacing)
===============================


2) 3rd Party Serial Communication Library (Component)

http://www.rs232-serial-communications.com/serial-communications-activex.htm

Greenleaf Software
http://www.greenleafsoft.com/

Eltima Software
http://www.eltima.com/
http://www.eltima.com/help/serial-activex/html/vb6.html

COMM-DRV/LIB Professional Edition
http://www.wcscnet.com/GoogleAdword/SerialCommLibraries.htm

CSerialPort MFC Class for Win32 serial ports (free)
http://www.naughter.com/serialport.html (see attached zipped file)

.NET SerialPort Library for C# (Free)
http://sourceforge.net/projects/serialportnet

Delphi/C++Builder serial communication library
http://sourceforge.net/projects/comport

================================

3) Books:
Visual Basic Serial Port Complete by Jan Axelson
ISBN: 0965081923

Visual Basic Programmer's Guide to Serial Communications, 4th Edition by
Richard Grier
ISBN: 1890422282

Serial Communications: A C++ Developer's Guide, 2nd Edition
http://www.dogma.net/markn/serial2/serial2.htm
by Mark Nelson
ISBN 0-76454-570-1
 

[END OF DOCUMENT]

Previous Revision Date: 10 March, 2003
Last Revision Date: 1 August, 2003
Latest Revision Date: 26 October, 2004

USING CECB4 TESTER TO TEST CTD-200 CARD DISPENSER

FIRMWARE FOR API VERSION

DECEMBER  14, 2005

 

 

INTRODUCTION

 

This specification is only for the (PC) MODE.  To set this mode, set the CTD-200 dip switch #1 to ON.  This is the only dip switch setting for the API.  This will also always drop the card.  The main objective is to tell if a card has actually been dispensed correctly or not.  To do this, the status bits sent to the CECB4 Tester have to be interpreted correctly and also the bi-color LEDs.

 

CECB4 API TESTER

 

The CECB4 API Tester is the only software used for the testing.  It must be installed from a CD or off the VendaPin web site.  This tester will test up to 16 ports, but only 8 will be used.  The second set of eight were designed for spiral motors using a special harness.  IBM is using card dispensers normally connected to a CECB4 and also to the RS232 serial port of the CECB4.

 

Run the CECB4 tester by selecting the program ‘CECB4 API Test’.  A window will come up titled ‘CECB4 API TESTER’.  Connect the standard VendaCom direct connect cable from the PC to the RJ-11 jack.

 

In the upper left corner, click ‘Setup’ and then ‘Open Port’ under that pull down menu.   Power up the CECB4 with the V4.10 firmware.  After the power up packets will start coming in from the CECB4 in the Receive Buffer display window.  Click ‘ACK’ to stop the packets.  Then click ‘Clear Receive Buffer’ right above the Receive buffer window to clear the buffer of received hex data from the CECB4.

 

Click ‘Status Dispensers 1-8’ to look at the hex status packet from the CECB4 for 8 dispensers 1-8.  Something like 2/6/0/3/7 hex will be displayed which is the acknowledgment of the command just sent.  This will immediately be followed by something like 2/0/8C/C/4/4/4/4/7/2/4…..0/3/81.  The ‘8C’ is the return status packet and the ‘C’ hex  is the data byte count of 12 data bytes.  The eight bytes that follow the ‘C’ are the statuses of the eight CECB4 dispenser ports in the order 1-8.  The following is a summary of the possibilities:

 

HEX    Meaning

1                    JAM           (rarely see this, almost always a hex ‘7’.  Can still try to dispense.)

2                    EMPTY

4              READY

7                    JAM&EMPTY&READY which means that a dispense was unsuccessful (JAM) & now ready again to dispense.  Note that these three are used so that the bicolor RED & GREEN can be ON at the same time.

8                    Note that when a dispense is finished, the roller will rotate backward in small steps (up to a full revolution) to attempt to get off a ‘hump’ to eliminate an empty condition.  This is normal.

 

Click ‘Status Dispensers 1-8’ before starting a dispense.  Then click ‘Dispense 1’ to do a dispense on dispenser 1, for example.  (Can clear the receive buffer at this time if needed).  Then click ‘Status Dispensers 1-8’ again after the dispense is complete to see what the result was.  Note that another dispense can be done at any time after the dispenser stops.

 

The objective is to put your hand or screwdriver in front of a card and stop it at different places and look at the resultant status.  IBM wants to see if a hex ‘7’ comes that tells that a dispense was not completed due to a jam but the dispenser is still ready to try again.  Notice that one long 6 seconds dispense starts off and if the hand stops it, you will feel up to three pulses trying to dislodge or free the card and let it continue. 

 

Please note if a status is JAMMED& READY (hex code 7), the hex code 7 will cause both RED and GREEN LEDs to come on together.  The LED shows a slightly lighter RED and some slight GREEN when viewed from the side.

 

When finished testing, be sure to close the RS232 port by clicking ‘Setup’ and then ‘Close Port’.  Then click ‘Exit’ to end the tester.  If you do not close the port and you later try to use that port for something else, it may be ‘busy – still open’ and you may have to reboot Windows to recover.

 

[ END OF DOCUMENT ]

 

CECB4 Zipped Tester Program with source code