The text of a manual · part 12 of 18
TouchProbe Communications for DOS Computers, pages 111 to 120
Pages 111 to 120 of 171
The original document is the PDF (1.7 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 Videx TouchProbe
Page 111
Appendix F Writing a Download Program for TouchProbe
Contents P. 102 P. 103 P. 119 P. 121 P. 124 P. 126
Introduction TouchProbe Configuration Application Program Interface TouchProbe Download Packet Protocol Definition TouchProbe Download Data Format Specification Internal Record Structure Specification Memory Button Data Format Specification
Appendix F Writing a Download Program for TouchProbe
103
Page 112
Introduction This section is useful to software developers and programmers who want to use the TouchProbe with a computer other than MS/PC DOS or Macintosh. Videx, Inc. offers TouchProbe Communications software for DOS and Macintosh computers. These software packages provide excellent working examples of the download process. The purchase price of the software includes the license fee for incorporating the download code into your own program. Videx has written TouchProbe download programs using C. The C language source code is available upon request with purchase of the TouchProbe Communications software. This appendix contains information that will help you write a download program for a host computer/operating system not currently supported by Videx download software. The TouchProbe Configuration Application Program Interface section contains the protocol for communicating with a TouchProbe.
104
Appendix F Writing a Download Program for TouchProbe
Page 113
TouchProbe Configuration Application Program Interface Configuring the TouchProbe The TouchProbe supports commands that enable it to be configured to work in different application environments. 1) Host Mode To communicate with the TouchProbe, it must be placed in Host mode. Host mode is entered by sending a BREAK character to the TouchProbe. A BREAK character is defined as a logical ‘0’ signal with a duration of at least 350 milliseconds. The TouchProbe remains in Host mode for one second. If it receives no serial communication during this time, it times out. Using the standard TouchProbe Downloader, the BREAK character is initiated by the TouchProbe Communications software (i.e., Videx programs TOUCH.EXE or TRANSFER.EXE). The original Videx TouchProbe Downloader Plus with the button on top, contains an internal software program, triggered by the button, that sends a BREAK character and then automatically unlocks the TouchProbe with a special ID number. 2) Communications Communications with the TouchProbe must be initiated when it is in Host mode. When a TouchProbe is placed in the downloader, communications to the downloader occur in simplex mode. The communications parameters used should be eight bits per byte, no parity, and one stop bit (N-8-1). Initial speed is 19200 baud, but this can be changed once host mode is entered.
Appendix F Writing a Download Program for TouchProbe
105
Page 114
3) Commands The general command format is: <command> [space] [<parameter>] <end-of-line> <command> is the one character command. [space] is an optional space character (ASCII 32). [<parameter>] is an optional parameter string if applicable. <end-of-line> is the terminating sequence, and can be either <LF> or <CR><LF>, where CR is ASCII 13 and LF is ASCII 10. A description of each command and the TouchProbe’s response are listed on the following pages. The TouchProbe will not respond to any commands until it has been unlocked using the Unlock command. Once unlocked, the TouchProbe will respond to an unknown command with “Huh?” Issue the command without a parameter to query the TouchProbe for a current setting. Note: Commands are case sensitive. *
Commands on the following pages that are denoted with an asterisk are for use with a TouchProbe Downloader Plus only.
106
Appendix F Writing a Download Program for TouchProbe
Page 115
Command A
*
Description Selects the answer/originate mode when the TouchProbe is placed in a TouchProbe Downloader Plus: A0 - Disables modem functions A1 - ANSWER mode * (Data transfer must begin within 255 seconds after the TouchProbe Downloader Plus unlocks the TouchProbe in this mode) A2 - ORIGINATE mode * Default: 1 – ANSWER mode
ARx
*
Directs the TouchProbe Downloader Plus to answer a call from the host after a TouchProbe has been successfully downloaded. The default behavior (AR = 0) is that if a TouchProbe is successfully downloaded then the TouchProbe Downloader Plus will flash a green Power light and will ignore a ring indicator received from the modem. Otherwise, if AR = 1 the TouchProbe Downloader Plus will process the ring indicator. Default: 0 Range: 0 or 1
AZx
*
Defines whether the TouchProbe must be downloaded and cleared of its data before the TouchProbe Downloader Plus will flash a green Power light to indicate a successful transfer. AZ = 0 indicates that data must be cleared to enable that condition; AZ = 1 indicates that the TouchProbe Downloader Plus may indicate a successful download even if data is not cleared. Default: 0 Range: 0 or 1
Appendix F Writing a Download Program for TouchProbe
107
Page 116
Command
Description
B
Requests the TouchProbe’s current configuration flags. Returns as follows: H <date/time stamp> FF <ID> Bffccppss . . .
Bffccppss T 000 BC
Clears all button configurations.
B ffccppss
Sets configuration flags ‘cc’ for button type ‘ff.’ This button type has ‘pp’ partitions of size ‘ss’ if applicable. Maximum number of configurations is 256. The ‘B f f c c p p s s’ command is the workhorse command for customizing the operation of the TouchProbe. Its operation is described below: ff = family code cc = configuration byte pp = # of partitions of storage (ignored) ss = size of each partition (ignored; hardcoded @ 32 bytes (0x20)) The pp and ss fields must be passed but their values are ignored.
108
Appendix F Writing a Download Program for TouchProbe
Page 117
ff
Description
‘FF’
Global configuration options.
Possible values for cc (configuration byte): 00 - Does not attempt to read “foreign” or undefined buttons (default) 01 - Attempts to read “foreign” buttons. ‘FE’
Download configuration option.
Possible values for cc (configuration byte): 02 - Downloads all records stored in memory (default) 01 - Downloads only records since last download ‘xx’
Button family code. These button family codes are supported by the TouchProbe: 01 = 1990 button 02 = 1991 button 08 = 1992 button 06 = 1993 button 04 = 1994 button
Possible values for cc (configuration byte) for each of the button family codes: 76543210 (bit positions) ||||||||--read from button (0), or write to button (1) |||||||---write data since last write (0), or write all data (1) ||||||----type not configured (0), or type is configured (1) |||||-----(not used) ||||------append (0) or overwrite (1) data |||-------clear (0) or don’t clear (1) data when read ||--------store date/time (0) or date/time/data (1) |---------ignore button (0), or act according to other bits (1)
(The configuration byte will default to A4H (10100100). This reads the button serial number and type for unconfigured buttons.)
Appendix F Writing a Download Program for TouchProbe
109
Page 118
Command
Description
C
Requests the TouchProbe’s ID. The TouchProbe responds with an ASCII string of up to ten characters representing its ID.
Cxxxxxxxxxx
Sets the TouchProbe’s ID to ‘xxxxxxxxxx’. May be up to ten characters.
D
Requests packet download data from TouchProbe. Transfer protocol is defined in the TouchProbe Download Packet Protocol Definition available from Videx, Inc.
Dyyyymmddhhmmss Same as D command, but downloads all data stored since specified date. F
Requests the amount of free memory (in bytes) in the TouchProbe.
G
Locks the TouchProbe. The TouchProbe locks itself automatically if allowed to power down due to a timeout. Default time out is 60 seconds of no serial port activity. Time out value may be set for the current session with the P command.
110
Appendix F Writing a Download Program for TouchProbe
Page 119
Command
Description
Gpassword
Locks the TouchProbe with a specified password. On a subsequent unlock, this password must be specified after the probe ID but before the line terminator. Example: Ixxxxxxxxxx<space>password<end-of-line> (Note: A “backdoor” is provided, as in the I command. The TouchProbe will always accept a field of ten ASCII zeroes. If the probe ID is known, but not the password, the string ‘I<IDstring> 0000000000’ will unlock the TouchProbe. If the probe ID and the password are unknown, ‘I0000000000 0000000000’ will unconditionally unlock any TouchProbe.)
*
H xxx
Sets the number of modem dial attempts (retries) when the TouchProbe is in originate mode. Range is 0–255. A retry is attempted whenever a string matching any of the commands M3 through M5 (error codes) is received from the modem. Default: 1
*
HR xxx
Sets the number of minutes to wait before retrying a dial operation. Default: 240 (minutes) Range: 0–255 (0 = no retry)
Appendix F Writing a Download Program for TouchProbe
111
Page 120
Command
Description
Ixxxxxxxxxx
Unlocks the TouchProbe with ID xxxxxxxxxx. A “backdoor” ID of ‘0000000000’ unlocks any TouchProbe in the event its ID is not known. The TouchProbe responds with ‘TPxxx’ where xxx is the revision level of the software running on the TouchProbe. This is followed by a space, the probe ID, and a <cr><lf> sequence. This command should be given within one second after putting the TouchProbe into Host mode. See also the P command and the G command.
L
Requests the data set that has been loaded into the TouchProbe.
L<data>
Loads a data set into the TouchProbe’s storage area. The TouchProbe wraps the data in an appropriate Header/Tailer pair. Up to 256 characters may be stored. The TouchProbe must first be configured to write the data set to read/write buttons. The data set is cleared when the TouchProbe is downloaded or when it receives a new button configuration set with the B command. Raw data with embedded carriage returns or line feeds should be enclosed in double quotation marks (e.g., L “this <cr> is raw data <lf>”).
112
Appendix F Writing a Download Program for TouchProbe