The text of a manual · part 11 of 23
VRC 4000 Software Driver Manual: Chapter 2 TBDriver Touchscreen Driver for DOS, pages 93 to 102
Pages 93 to 102 of 206, from VRC 4000 Software Driver Manual
The original document is the PDF (1.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Symbol VRC-4000
Page 93
Chapter 2: TBDriver Touchscreen Driver for DOS
SET TBdpath=c:\ would cause TBdriver to always locate the TBcalib file in the root directory. If any of the environment variables are set to invalid values, they are ignored, and the normal defaults apply.
Unloading TBdriver To unload TBdriver from memory, type: TBdriver u
2-51
Page 94
VRC 4000 Software Driver Manual
TBdriver Messages TBdriver made resident TBdriver loaded successfully.
TBdriver Unloaded TBdriver is being unloaded from memory at your request.
Invalid COM port number You specified a value other than 1 to 8 as a command line argument when you attempted to load TBdriver.
Hard calibration is required TBdriver loads successfully, but cannot find file TBcalib. No hard calibration will be active. The touchscreen will work, but the coordinates will not match the display. Use TBcal to perform hard calibration.
Can't unload - not loaded You requested TBdriver to unload, but it is not loaded, or is loaded for an API interrupt vector which is not the current value of TBdint.
Can't unload - vectors have been hooked You requested TBdriver to unload, but another Terminate Stay Resident program has been loaded after TBdriver, and has hooked interrupt vectors used by TBdriver. Unload the second TSR first, then you can unload TBdriver.
Can't load - already loaded You tried to load TBdriver when it is already loaded. Use environment variable TBdint to specify a different API vector if you wish to load a second TBdriver.
API interrupt vector already in use The interrupt vector you are asking TBdriver to use is already in use by another program. You will have to use environment variable TBdint to specify a different vector.
2-52
Page 95
Chapter 2: TBDriver Touchscreen Driver for DOS
Touchscreen controller not responding The driver is unable to communicate with the touchscreen controller hardware. Check that it is properly connected and powered on.
Invalid TBcalib file deleted The TBcalib file was created for a different type of touchscreen, or was created by an old version of TBdriver. It has been deleted and a new one created with null calibration data. Re-calibrate using TBcal.
Unable to create calibration file Could be caused by insufficient disk space, or an invalid TBdpath environment variable.
Touchscreen controller reports bad status Some touchscreens report possible hardware problems when they are initialized. TBdriver attempts to continue.
Invalid address parameter The address specified with the /a control argument was not a valid hexadecimal address in the range 0 - FFFF.
Invalid IRQ parameter The IRQ specified with the /i control argument was not a valid decimal number in the range 0 to 15.
Invalid /S value The value specified for the /S parameter was not a valid decimal number in the range 1 to 20.
Invalid /T value The value specified for the /T parameter was not a valid decimal number in the range 0 to 20.
2-53
Page 96
VRC 4000 Software Driver Manual
Invalid /C parameters You did not correctly specify all the components of the /C parameter. All components must be specified in the form /C:bbbb,p,d,s where bbbb is 1200, 2400, 4800 or 9600, p is N, O or E, d is 7 or 8, and s is 1 or 2.
/H and /G are mutually exclusive You specified both the /G and the /H parameters. /H is for normal IRQsharing, and /G is for IRQ-sharing with Global Rearming. You do not need to specify both parameters.
TBdriver Return Codes If the driver fails to load an error code is returned so that batch files can determine the driver status with an IF ERRORLEVEL statement. Returned error codes are as follows: 0 1 2 3 4 5 6 8 9 10 11 12 13 -
2-54
Loaded/Unloaded OK Driver already loaded Can't unload, not loaded Can't unload, vectors hooked API vector in use Invalid COM port number Controller not responding Unable to create calibration file Invalid address parameter Invalid IRQ parameter Invalid /S parameter Invalid /T parameter Invalid /C parameter
Page 97
Chapter 2: TBDriver Touchscreen Driver for DOS
The TBdriver Demonstration Program The supplied utility program, TBddemo, can demonstrate almost all the features of TBdriver. To run TBddemo, first load TBdriver, then TBddemo. The following screen is displayed:
TBdriver Demonstration Program V4.07 X N F R L N F R L N F R L N F R L N
Y
T
Pad
27 30 30
15 14 14
0 0 0
2 2 2
24 24 24
16 17 17
0 42 0
2 2 2
18 41 41
18 9 9
0 9 0
1 2 2
21 21 21
19 19 19
0 24 0
1 1 1
(c) Touch-Base Ltd. 1989 - 1994 Menu
1 2 3 4 5 6 7 8 9 A B C D E F G H I M
Single read Continuous reads Set scale & origin Set sensitivity Flush buffer Read softcal coords Activate softcal De-activate softcal Define pad Activate pad De-activate pad Set test pads Touch cursor on Set stabilisation Disable touches Enable touches Packet counting User ISR More options
Driver Status Version Int Vector Origin X, Y scales Stability Sensitivity Calibration Hardware Touch Pads ( 1 A 2 A 3 A 4 A 5 A 6 7 8
4.07 66 1 80, 25 0 1 Hard xxxx, COM2 Enabled to scroll) 1, 2, 21, 25 22, 2, 45, 22 46, 2, 80, 12 46, 13, 80, 22 22, 23, 80, 25 0, 0, 0, 0 0, 0, 0, 0 0, 0, 0, 0
X to Exit Press any key to stop continuous reads Touches
Selecting 'M' for more options reveals four further options. 'J' performs a touchscreen Reset, 'N' performs a Non-Destructive Read, 'K' sets up a built in Pre-Processing User ISR, and 'L' disables the built in Pre-Processing User ISR. When the program loads, it makes use of the Get Parameters, Get Pad Definition, and Get Current Calibration functions to display the current state of the driver in the status and pads windows.
2-55
Page 98
VRC 4000 Software Driver Manual
Single Read This option performs a single Read Touches function, and displays the resulting information in the touches window. A new line is only written to the touches window when the touch type changes, otherwise the current line is overwritten.
Continuous Reads This option performs the Read Touches function continuously until a key is pressed on the keyboard. The information returned from each read is displayed in the touches window. This function provides a good example of the type of touch data stream handled by a polling application.
Set Scale and Origin Allows you to enter the X and Y values for a new scale, and 0 or 1 for the new origin, then calls the Set Scale and Origin function. If the touchscreen supports a Z axis, the new Z scale may also be entered.
Set Sensitivity Allows you to enter the new sensitivity value, then performs the Set Sensitivity function.
Flush Buffer Performs the Flush Buffer function.
Read Soft Calibration Coordinates Invites you to touch the bottom left, then the top right corners of the area to be soft calibrated, in order to perform a pair of Read Soft Calibration Coordinates functions. The resulting coordinates are then displayed for you to write down (just as an application would have to store them in a file). You may wish to soft calibrate a small subset of the screen in order to see an exaggerated example of soft calibration.
2-56
Page 99
Chapter 2: TBDriver Touchscreen Driver for DOS
Activate Soft Calibration Invites you to enter the soft calibration coordinates you wish to activate, then performs the Activate Soft Calibration Coordinates function. For convenience, the coordinates last obtained using the previous option are defaulted, but you may change them if you wish.
Deactivate Soft Calibration Performs the De-activate Soft Calibration Coordinates function.
Define Pad Allows you to enter a pad number and the coordinates which apply to the pad, then performs the Define Pad function.
Activate Pad Allows you to enter a pad number then performs the Activate Pad function.
Deactivate Pad Allows you to enter a pad number then performs the De-activate Pad function.
Set Test Pads Forces the scale to 80 x 25, then defines and activates five pads to fit the five windows of TBddemo. If you then select the continuous reads option, you can see the pad number being returned as you touch or slide around the screen. Better still, switch on the touch cursor first.
Touch Cursor On Forces the scale to 80 x 25, then enables a cursor which follows the current X and Y coordinates. When the cursor is on, this option changes to Touch cursor off, so repeated selection of this option toggles the cursor on and off. Note that the cursor is a function of TBddemo, not TBdriver.
Set Stabilization Allows you to enter a new value for stability averaging in the range 0 to 10, then calls the Set Stabilization function.
2-57
Page 100
VRC 4000 Software Driver Manual
Disable Touches Performs the Disable Touches function.
Enable Touches Performs the Enable Touches function.
Packet Counting Like the continuous reads option, this option performs the Read Touches function until a key is pressed on the keyboard. After each call to Read Touches, it calls the Packet Counting function and updates the packet count, elapsed seconds, and packets per second in the Packet Counts window.
User ISR This option calls the Set Event User ISR function, passing the address of a built-in user ISR routine, then simply waits for a key to be pressed on the keyboard. When a key is pressed, Set Event User ISR is called again with a null ISR address. The built-in user ISR performs the Read Touches function and displays the result in the Touches window, and moves the cursor if it is switched on. Unlike the continuous reads option though, the user ISR always writes a new line for each event. This demonstration conveys the event driven nature of the user ISR - notice that No-touch states are not reported, nor are Repeat-touch states when there has been no movement. Also remember that the foreground application could be doing some useful work here, whereas in this demonstration it is simply looping waiting for a key to be pressed.
Reset Touchscreen Performs the Reset Touchscreen function
Scroll pads The up and down arrow keys allow you to scroll the pads window, so that you can examine all presently defined pads.
Non-Destructive Read Performs the Non-Destructive Read API Call.
2-58
Page 101
Chapter 2: TBDriver Touchscreen Driver for DOS
Set Pre-Processing User ISR This option calls the Set Pre-Processing User ISR function, passing the address of a built-in user ISR routine, then returns to normal menu processing. The built-in user ISR simply beeps and displays the touch event in the bottom right hand corner of the screen
Disable Pre-Processing User ISR This option calls the Set Pre-Processing User ISR function, passing a null address.
Exit Terminates TBddemo.
2-59
Page 102
VRC 4000 Software Driver Manual
The TBdriver Calibration Program The supplied utility program, TBcal, should be used to perform hard calibration and, optionally, soft calibration for various video resolutions. The ’Concepts’ section describes the need for soft calibration. Soft calibrations defined using TBcal are automatically loaded by TBdriver when the system changes into the appropriate video modes. To calibrate matrix touchscreens refer to the ’Matrix Touchscreens’ section. To run TBcal, first load TBdriver, then TBcal. The following menu screen is displayed:
Touch-Base TBdriver Calibration
(c) Touch-Base Ltd. 1989 - 1994 Version 4.07
Program Main Menu
H
-
Hard calibrate
8
-
800 x 600 graphics
1
-
40 x 25 text
9
-
1024 x 768 graphics
2
-
80 x 25 text
U
-
User defined calibration (1)
3
-
320 x 200 graphics
V
-
User defined calibration (2)
4
-
640 x 200 graphics
T
-
Test menu
5
-
640 x 350 graphics
C
-
Customise video mode mappings
6
-
640 x480 graphics
F
-
Display TBcalib file details
7
-
640 x 400 graphics
X
-
Exit
You must hard calibrate if you have not yet done so You may soft calibrate in as many modes as you wish Any modes which you do not calibrate will use the hard calibration
You must always hard calibrate after installation, and may optionally soft calibrate in any video modes you may be going to use. Any new calibrations take immediate effect and are also stored in the TBcalib file. All standard resolutions are supported, as are Super VGA modes up to 1024 x 768, as well as two “user defined” resolutions.
2-60