Touch System Programming Guide - Elo TouchSystems

16 downloads 138 Views 765KB Size Report
Touch System. Programmer's. Guide. CARROLL TOUCH. TOUCH PRODUCTS an AMP company. Part #: 2970-0011-01-Rev A. August 1996 ...
Touch System Programmer's Guide

CARROLL TOUCH TOUCH PRODUCTS

an AMP company

Touch System Programmer’s Guide

CARROLL TOUCH TOUCH PRODUCTS an AMP company

August 1996 Part #: 2970-0011-01-Rev A

Copyright Copyright ©1996 Carroll Touch. All rights reserved. Trademarks Smart-Frame is a trademark of Carroll Touch, Round Rock, Texas. IBM and PC are trademarks of International Business Machines Corporation. All other brands and product names are trademarks of their respective owners. Disclaimer Carroll Touch has a policy of continually improving products as new technology becomes available. Carroll Touch reserves the right to make changes and improvements to the specifications of this equipment at any time without notice. Carroll Touch has made every attempt to ensure that the information in this document is accurate and complete. Carroll Touch assumes no liability for any damages that result from the use of this manual or the equipment it documents. Carroll Touch reserves the right to make changes to this document at any time without notice.

CARROLL TOUCH

Table of Contents

Table of Contents Welcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

1. Introduction to Infrared Touch Systems . . . . . . . 1-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Touch Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Touch Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interpolating Touch Coordinates . . . . . . . . . . . . . . . . . . . . Reporting Touch Coordinates . . . . . . . . . . . . . . . . . . . . . . Failed Beams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Criteria for Failing a Beam . . . . . . . . . . . . . . . . . . . . . Failed Beam Timing Parameters . . . . . . . . . . . . . . . . . Criteria for Unfailing a Beam . . . . . . . . . . . . . . . . . . . Failed Beam Reports . . . . . . . . . . . . . . . . . . . . . . . . . .

1-2 1-2 1-2 1-3 1-4 1-4 1-5 1-5 1-7 1-7

2. Introduction to Guided Wave Touch Systems . . . 2-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Touch Screens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Touch Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EEPROM File and Parameters . . . . . . . . . . . . . . . . . . . . .

2-2 2-2 2-2 2-3

3. General Programming Issues . . . . . . . . . . . . . . . . 3-1 Hardware Configurations . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Built-In Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 External Controllers. . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Application Program Interface . . . . . . . . . . . . . . . . . . 3-4 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Floating Point Calibration Program Design . . . . . . . . 3-7 Floating Point Calibration Examples. . . . . . . . . . . . . . 3-8 HBC I/O Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 Sending a Touch Command to the HBC . . . . . . . . . . . 3-9 Receiving Touch Data from the HBC . . . . . . . . . . . . 3-10 Polling Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 Interrupt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 Resetting the HBC . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11

i

Table of Contents

CARROLL TOUCH

4. Smart-Frame Protocol . . . . . . . . . . . . . . . . . . . . . . 4-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 SFP and SFP-II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 Types of SFP Commands . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 Communication Commands . . . . . . . . . . . . . . . . . . . . 4-3 Reporting Method Commands. . . . . . . . . . . . . . . . . . . 4-3 Touch Mode Commands . . . . . . . . . . . . . . . . . . . . . . . 4-4 Information Request Commands . . . . . . . . . . . . . . . . . 4-5 System Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5 Reports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6 Touch System Initialization. . . . . . . . . . . . . . . . . . . . . . . . 4-7 Resetting the Touch System . . . . . . . . . . . . . . . . . . . . 4-7 Power Cycle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7 Dedicated Reset Signal . . . . . . . . . . . . . . . . . . . . . 4-7 Break (Hardware Detected) . . . . . . . . . . . . . . . . . . 4-7 HBC Hardware Reset Register . . . . . . . . . . . . . . . 4-8 Break (Firmware Detected) . . . . . . . . . . . . . . . . . . 4-8 Reset (45H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8 Performing the Autobaud/Autoparity Sequence . . . . . 4-8 Checking for Touch System Errors . . . . . . . . . . . . . . . 4-9 Setting the Reporting Method and Touch Mode . . . . 4-10 Touch System Initialization Examples . . . . . . . . . . . . . . 4-10 Using Autobaud/Autoparity . . . . . . . . . . . . . . . . . . . 4-10 Using a Fixed Baud Rate . . . . . . . . . . . . . . . . . . . . . . 4-11 Using the HBC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11 Using an SBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12 Compatibility Issues/Programming Tips . . . . . . . . . . . . . 4-12 Number of Processors Independence . . . . . . . . . . . . 4-13 Firmware Version Independence. . . . . . . . . . . . . . . . 4-13 Frame Size Independence . . . . . . . . . . . . . . . . . . . . . 4-13 Touch System Response Time Independence . . . . . . 4-13 SFP Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14 Autobaud/Autoparity Delay Time . . . . . . . . . . . . . . . 4-14 Maximum Command Completion Time . . . . . . . . . . 4-14 Reset Time/Diagnostics Completion Time . . . . . . . . 4-14 SFP Programming Examples. . . . . . . . . . . . . . . . . . . . . . 4-14

5. Smart-Frame Protocol II . . . . . . . . . . . . . . . . . . . . 5-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Extensibility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modal Protocols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Backward Compatibility . . . . . . . . . . . . . . . . . . . . . . . Types of SFP-II Functions. . . . . . . . . . . . . . . . . . . . . . . . . Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

ii

5-2 5-2 5-4 5-4 5-5 5-5

CARROLL TOUCH

Table of Contents

Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 Validation Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 Interpretation Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 Reports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 Validation Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9 Interpretation Layer . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10 Reporting Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11 Report Transfer Mode . . . . . . . . . . . . . . . . . . . . . . . . 5-11 Error Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12 Invalid Command Number . . . . . . . . . . . . . . . . . . . . 5-12 Invalid Parameter Value . . . . . . . . . . . . . . . . . . . . . . 5-13 Unsupported Feature . . . . . . . . . . . . . . . . . . . . . . . . . 5-13 Invalid Byte Count. . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14 Not Enough Parameters . . . . . . . . . . . . . . . . . . . . . . . 5-17 Too Many Parameters . . . . . . . . . . . . . . . . . . . . . . . . 5-17 Overloaded Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18 Shared Parameters between SFP and SFP-II . . . . . . . . . . 5-19 Touch Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-19 Report Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20

6. Touch Application Program Interface (TAPI) . . 6-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installing a TAPI Driver . . . . . . . . . . . . . . . . . . . . . . . . . . SBC Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HBC Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RS-232 Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Determining if a TAPI Driver Is Installed. . . . . . . . . . . . . Calling TAPI Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . Touch System Initialization Using a TAPI Driver . . . . . . TAPI Programming Examples. . . . . . . . . . . . . . . . . . . . . .

6-2 6-3 6-3 6-4 6-4 6-6 6-7 6-7 6-8 6-9

7. CTKERN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Touch Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calibration and Scaling Examples. . . . . . . . . . . . . . . . . . . Temporal Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Methods for Interfacing CTKERN and an Application Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Polling Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interrupt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7-2 7-2 7-4 7-5 7-5 7-8 7-9 7-9 7-9

iii

Table of Contents

CARROLL TOUCH

Loading the CTKERN Driver . . . . . . . . . . . . . . . . . . . . . . 7-9 Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9 Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10 Determining If the CTKERN Driver Is Installed . . . . . . 7-13 Calling CTKERN Functions . . . . . . . . . . . . . . . . . . . . . . 7-13 CALIB.EXE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13 Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15 Calibrate Mono, EGA, VGA Video Modes . . . . 7-16 Calibrate Other Video Modes . . . . . . . . . . . . . . . 7-17 Edit Entry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18 Delete Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18 CALIB.DAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20 CTKERN Programming Examples . . . . . . . . . . . . . . . . . 7-20

8. Dynamic Link Library (DLL) Functions . . . . . . . 8-1 Calling Windows Driver DLL Functions . . . . . . . . . . . . . 8-2

A. Smart-Frame Protocol Command Reference . . . A-1 Add_Exit_Point_Modifier (29H) ()) . . . . . . . . . . . . . . A-5 Clear_Touch_Report_Buffer (3DH) (=) . . . . . . . . . . . A-6 Continuous_Mode (27H) (’) . . . . . . . . . . . . . . . . . . . . A-7 Coordinate_Reporting (23H) (#) . . . . . . . . . . . . . . . . . A-8 Echo_Off (21H) (!) . . . . . . . . . . . . . . . . . . . . . . . . . . A-10 Echo_On (20H) (SPACE) . . . . . . . . . . . . . . . . . . . . . A-11 Enter_Point_Mode (25H) (%) . . . . . . . . . . . . . . . . . . A-12 Exit_Point_Mode (28H) (() . . . . . . . . . . . . . . . . . . . . A-13 Get_Configuration_Report (33H) (3) . . . . . . . . . . . . A-14 Get_Error_Report (32H) (2) . . . . . . . . . . . . . . . . . . . A-15 Get_Failed_Beam_Report (36H) (6) . . . . . . . . . . . . . A-19 Get_Firmware_Version_Report (34H) (4) . . . . . . . . A-21 Get_Frame_Size_Report (37H) (7) . . . . . . . . . . . . . . A-23 Get_One_Report (46H) (F) . . . . . . . . . . . . . . . . . . . . A-24 Get_State_Report (47H) (G) . . . . . . . . . . . . . . . . . . . A-25 Hardware_Flow_Control_Off (42H) (B). . . . . . . . . . A-27 Hardware_Flow_Control_On (41H) (A) . . . . . . . . . . A-28 Report_Transfer_Off (43H) (C) . . . . . . . . . . . . . . . . A-29 Report_Transfer_On (44H) (D). . . . . . . . . . . . . . . . . A-30 Reset (45H) (E) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-31 Run_Diagnostics (3AH) (:) . . . . . . . . . . . . . . . . . . . . A-32 Scan_Reporting (22H) (”) . . . . . . . . . . . . . . . . . . . . . A-33 Software_Reset (3CH) (