The text of a manual · part 5 of 10
QTERM-IV/P40 User's Manual: Chapter 3.
Pages 27 to 34 of 64, from QTERM-IV/P40 User's 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 QSI Corp QTerm-IV and Beijer QTerm-IV
Page 27
CHAPTER 3. USING THE QDATA FILE 3.1
QDATA Files
A QDATA file is used to configure your terminal. There are four reasons you may want to use a QDATA file:
• You want to change what keys send when they are pressed, or design your own display characters (this must be done with the QDATA file). • You want to change some of the other defaults (such as beep length, tab settings, etc.). • You want to define event-driven strings or macro strings. • You want to protect your development investment by modifying the terminal from its factory-default operation.
“QDATA24.V21” would be the QDATA file for a 24 key QTERM with version 2.1 QCODE. You will only need to use the QDATA file that matches the hardware on your terminal. The QDATA file for your QTERM is already set up with default values for all parameters. You will modify only the parameters which you want to change from their default. NOTE: The QTERM-P40 is not available with a wide-temp display. Your QTERM is delivered with the default QDATA file already installed. You only need to modify the appropriate QDATA file and load it into the terminal if you want to change any of the default values. If not, you can skip this entire chapter.
With your terminal you will have received a disk (PC-compatible) with a variety of files. Two of these files are
Note that all QTERM parameters can be modified using software commands (see Chapter 2) except for key strings and custom display characters! The only way to modify what a key sends when it is pressed, or to redefine the custom display characters, is by modifying the QDATA file and loading it into the QTERM using the QSETUP program.
QDATA File
3.2
If the fourth reason is important to you, be sure to consider modifying the <qdata retrieve mode> identifier to ensure that your investment remains protected.
QSETUP.EXE
An ASCII (text) file that specifies values for all of the configurable parameters of the QTERM. A program which loads the QDATA file into the QTERM.
There are actually several versions of the QDATA file on the disk: QDATA24.Vxy QDATA40.Vxy QDATA24W.Vxy
Using QSETUP
Your distribution disk includes the QSETUP.EXE program, which is used to load the QDATA file into your QTERM. This program actually performs three tasks:
• load a QDATA file into the QTERM • retrieve a QDATA file from the QTERM • load the operation code file (QCODE file) into the
For 24-key terminals. For 40-key terminals. For 24-key terminals with wide-temperature displays. For 40-key terminals with wide-temperature displays.
To use QSETUP, you must use power-on setup to set the QTERM's baud rate and data format to 9600/8n1. These are the only settings that will work with QSETUP.
The file extension “Vxy” will actually be the QDATA software version, represented by “Version x.y”. For example
You must also connect your terminal to your PC's COM port and supply power to it. If you do not have an EIA-232
QDATA40W.Vxy
QTERM
Beijer Electronics Fax 801-466-8792 Web www.beijerelectronicsinc.com Phone 801-466-8770
Page 28
18
QTERM-IV/P40 User's Manual terminal, you will need an interface unit. See Chapter 1 for more information.
QDATA file (which puts several identifiers on one line in the key sections).
When you first run QSETUP, you will see an introductory screen that shows the version number. This version must match the version of the QDATA file you are going to load. See the Versions section below for more information.
Since neither of these affects the parameter content of the retrieved QDATA file, this retrieved file can be downloaded into any QTERM without modification.
The next screen will give you a choice of COM ports, if your PC has more than one. Select the port to which you have connected your terminal. 3.2.1
Loading a QDATA File
To load a QDATA file from disk into the QTERM, select the Load QDATA menu item. You will be asked for the file name. Enter the file name, along with the extension, then press the Enter key. QSETUP will now open the specified file, scan it for errors, and, if none are found, load it into the QTERM. This will take about 10 seconds. If any errors are found, QSETUP will display an error message indicating the problem. Use your editor to fix the problem, then try to load it again. 3.2.2
Loading a QCODE File
Also included on your distribution disk is a file called QCODE.V21. This is the actually microprocessor code for running the QTERM. If the code in the QTERM somehow gets corrupted, you can load this file into the terminal to get it running again. If you suspect your terminal has corrupted code, call Beijer Electronics for technical assistance in reloading the QCODE file. 3.2.3
Retrieving a QDATA File
If you select the third menu item on the QSETUP menu screen, you will be asked for a file name into which QSETUP will put the retrieved QDATA information. Specify a file name that does not exist. QSETUP will retrieve the QDATA information from your terminal and put it into a disk file. This file is similar to the default files supplied with your terminal, except for two changes:
• The retrieved file will have no comments in it. • The retrieved file will have exactly one identifier per line, so it will have many more lines than the default
3.3
Basic QDATA File Concepts
Identifiers. The QDATA file contains “identifiers” used by QSETUP to determine how to configure the QTERM. These identifiers appear in two formats: [....] and <....> The most important rule about editing the QDATA file is: NEVER DELETE OR EDIT ANY OF THE IDENTIFIERS, AND NEVER CHANGE THEIR ORDER! You will edit the values assigned to the identifiers, but you may not edit the identifiers, delete the identifiers or change the order in which they appear. Versions. You must use the same version of the QDATA file and the QSETUP program as the version of code in your QTERM.
• Your QDATA version is noted in the file name extension (i.e. QDATA40.V21 is version 2.1) and is the first identifier in the QDATA file. • The QSETUP version is displayed on the first screen when you start the QSETUP program. • The version of software in your QTERM is displayed if you hold down any key and apply power. If you find that you have different QDATA, QSETUP and QTERM code versions, contact Beijer Electronics for updated software and instructions. Do not attempt to use different versions of these items together; you will probably corrupt the QTERM operational code. QDATA File Size. The QDATA file which you edit can be as large as you want. When QSETUP sends the QDATA information to the QTERM, it only sends actual parameters and key strings. The maximum amount of information from the QDATA file which can be stored by the QTERM is about 20 kbytes, which should be enough for even the most memory demanding applications. The default QDATA files generate about 300 bytes of information, so you can add over 19 kbytes of data to key strings before you exceed the 20 kbyte limit. QSETUP will tell you if there is too much data to be stored by the QTERM.
Beijer Electronics Fax 801-466-8792 Web www.beijerelectronicsinc.com Phone 801-466-8770
Page 29
QTERM-IV/P40 User's Manual ASCII Editor. You may use any editor to modify the QDATA configuration file, but the output from the editor must be in ASCII format, without any embedded codes. Included on your QTERM distribution disk is the TED3 editor (TED3.COM), which you can use to edit the QDATA file. The file TED3.DOC provided documentation for the editor and its commands. Uppercase/Lowercase. For quoted text strings, (used for key strings), the string is assigned exactly as shown in the QDATA file. Comments. Comments may be added to the file as desired. A comment starts with a semicolon, and ends at the end of a line (at the carriage return). Whitespace. Whitespace may be added to the file as desired. This means you can add spaces, tabs, carriage returns and line feeds anywhere you would like. The only exceptions are identifiers (such as [shift mode]) with whitespace and in quoted text strings (which are assigned to keys); anything within the quotes will be assigned to the key. Since you can add and remove carriage returns, you can place each identifier on a separate line, or you can have several identifiers on one line, as long as the order in which they appear is not changed.
3.4
Parameter and Key String Sections
The QDATA file has two sections: the parameter section at the top, followed by the key string section at the bottom. 3.4.1
Parameter Section
In the parameter section, you will assign a number to each identifier. Numbers. The number can be specified in one of two ways:
• decimal numbers (49, 27) • hexadecimal numbers (x0D, x8C) These numbers are always positive integer numbers within the range specified by the comments. Hexadecimal constants start with the letter “x”. Decimal and hexadecimal constants are equivalent; use whichever one is easier at any time.
19 3.4.2
Key String Section
This section follows the parameter section. The format for the identifiers for each key is <k#*> <sk#*> <kr#*> <skr#*>
- unshifted key strings - shifted key strings - unshifted key release strings - shifted key release strings where: # = row (top = row 0) * = column (right = column 0) Examples of this notation: <k21> is for unshifted key string for row 2 and column 1
<skr32> is for shifted key release string for row 3 and column 2. Since the QTERM electronics can support up to eight rows and six columns of keys, there are identifiers for 48 unshifted and 48 shifted key strings, as well as identifiers for 48 unshifted and 48 shifted key release strings. All of these must remain in the file; however, you will have no reason to assign key strings to keys that do not exist on your keypad. In the key string section the type of values you can assign to a key are
• strings enclosed in single quotes ('abcde') • decimal numbers (49, 27) • hexadecimal numbers (x0D, x8C) • Special Function Switches (\L, \P, \S) • a combination of the above, separated by commas Strings. Text strings can contain any printable ASCII characters and are enclosed in single quotes. If you need to include a single quote in your text string, terminate the string and specify the ASCII value as a number (x27 hexadecimal or 39 decimal). Numbers. Numbers are always positive integer numbers within the range 0 to 255. Hexadecimal numbers start with the letter “x”. Decimal and hexadecimal numbers are equivalent; use whichever one is easier at any time. Special Function Switches. These special switches are used for advanced functions such as Local Mode toggle,
Beijer Electronics Fax 801-466-8792 Web www.beijerelectronicsinc.com Phone 801-466-8770
Page 30
20
QTERM-IV/P40 User's Manual pausing and Edit Mode control. See section 3.5.3 and section 4.3 for a detailed description of these switches. Examples of Key Strings. The simplest example of a key string is where pressing the key sends just one character, regardless of whether the shift key has been pressed: <k43> '1' ; send ASCII '1' <sk43> '1' ; send same if shifted <kr43> ; send nothing on release <skr43> ; send nothing on shifted release The next example shows a key which sends a string when pressed, but beeps if pressed when shifted (the number 7 is a “bell” character): <k27> 'Hello There'; send string <sk27> 7 ; beep if shifted <kr27> ; nothing <skr27> ; nothing Below is a key string which uses Special Function Switches to control the keypad LEDs and to pause. The key controls LED1 when unshifted (press and the LED goes on, release and it goes off), and controls LED2 when shifted (press and it goes on, release and it goes off ½-second later): <k32> <sk32> <kr32>
'Turn 1 on',\L,27,'PI';send string, turn L1 on 'Turn 2 on',\L,27,'PJ'; send string, turn L2 on 'Turn 1 off',\L,27,'PA' ; send string, turn L1 off <skr32> 'Turn 2 off',\P,10,\L,27,'PB'; send string, pause ½-second, turn L2 off The final example shows how to combine strings, numbers and Special Function Switches on one key string assignment. Note the splitting the key assignment onto multiple lines (as done here) is perfectly acceptable. <k62> 'Pause here ',\P,10,'then turn dig0 on ', \L,27,'dH','then beep ',7,'then send a cr/lf ' 'to the host',x0D,10 Key String Restrictions. A key string may be from 0 to 255 bytes long. Pause constants may be from 1 to 255, which corresponds to 50 ms to 12.75 second pauses. Multiple pause constants can be specified in one string. Be sure to separate each component of a key string (text strings and numbers) by a comma, as shown in the examples above.
3.4.3
Macros and Event Triggered Strings
This is the last section of the QDATA file, and contains macro strings and strings that get executed according to certain events. The following section explains these advanced features in more detail.
3.5
Advanced QDATA File Concepts
The QTERM has some advanced capabilities in its string processing ability that go beyond simple byte strings that get transmitted to the host. 3.5.1
String Terminology
The various string definitions available in the QTERM provide a great deal of flexibility when interfacing to a variety of host systems. In order to understand the operation of QTERM strings, you must understand the following terminology: STRING DEFINITION A string of bytes specifying the data to be transmitted or displayed and any commands to be executed when the defined string is executed. String Definitions can only be entered in a QDATA file. The program QSETUP is then used to compile the QDATA file and download it into the QTERM's EEPROM memory. STRING EXECUTION The transmission or display of characters, or execution of software commands specified in a given String Definition. Strings can be executed in a number of ways. For example, by pushing a key (this would execute the string defined for that key) or by undergoing a timeout (this would execute the timeout string). HOST MODE Forces String Definition data to be transmitted to the host. All String Definitions are executed in Host Mode, by default, unless the string execution mode is switched by a LocalMode toggle. Host Mode only applies to String Definitions; it has no meaning outside of a String Definition. LOCAL MODE Forces String Definition data to display or execute locally on the QTERM. Software commands and displayable data are handled as though they were received from the host. Local Mode only applies to String Definitions; it has no meaning outside of a String Definition. Local mode is enabled by entering the Local Mode toggle (“\L”) in a String Definition. Any data following the Local Mode toggle is interpreted as Local Data by the QTERM
Beijer Electronics Fax 801-466-8792 Web www.beijerelectronicsinc.com Phone 801-466-8770
Page 31
QTERM-IV/P40 User's Manual up until another Local Mode toggle is encountered, after which Host Mode becomes active again. Local Mode can be toggled on and off as much as desired within a String Definition. HOST DATA That portion of a String Definition which is executed in Host mode and specifies what is to be transmitted to the host. Since Host Mode is the default String Definition mode, String Definitions are always executed as Host Data until a Local Mode toggle is encountered. LOCAL DATA That portion of a String Definition which is executed in Local Mode and specifies what is to be displayed or executed on the QTERM-IV itself when a given string executes. Local Data may contain Display Data or Local Commands. DISPLAY DATA That portion of either an incoming packet or a Local-Mode string definition which contains data for display on the LCD. LOCAL COMMANDS That portion of a String Definition, executing in Local Mode, which contains QTERM software commands which are to be executed on the QTERM. Local Commands can only consist of QTERM software commands. Certain commands are not allowed as Local Commands; certain other commands take on special behavior as Local Data when the QTERM's serial interface mode is set to Block or Multidrop mode, i.e. EDIT buffer editing keys. This special behavior is described in the Block and Multidrop Serial Mode sections below. 3.5.2
21 • key release strings (executed when a key is released) • macro strings (executed when a the macro command is received)
• autoexec string (executed on power-up or reset) • timeout string (executed when a timeout occurs) • low-battery string (executed when the lowbat line goes low) 3.5.3
String Definitions
String definitions describe what happens when a given string is executed. String definitions can only appear in QDATA files. Then you use the QSETUP program to compile the QDATA file and all the string definitions and other configuration data contained in the QDATA file and download it into the QTERM. String Definitions are constructed using a combination of quoted text ('text'), numerical byte values (27, xF3) and three optional special-function switches: \L, \P and \S. The Local Mode Toggle switch, \L, toggles the string between host and local mode. For example, here is a QDATA file key-string definition which uses Host Mode to transmit a string to the host and Local Mode to display a different string on the QTERM's LCD. <k13> 'Host',\L,'QTERM' This would send the text “Host” to the host computer (host data) and the text “QTERM” to the QTERM display (local-mode display data) when the key at row #1 and column #3 is pressed. The \L can be used multiple times in a string to toggle back and forth between host and local modes. All strings always default to host data until a \L is encountered.
String Concepts
The QTERM takes the concept of a “character string” and broadens it to include any combination of these items:
One of the useful features of local mode is to cause the QTERM to execute software commands without receiving the commands from the host. For example, if you defined the autoexec string as
• Host data (text to be transmitted to the host) • Local display data (text to be displayed on the
[autoexec string] '!',\L,'QTERM Active', 07,x1B,'IC@'
QTERM screen)
• Local commands (commands to be executed as if sent from the host)
• Special functions including Pauses (delays) in string processing and Multidrop/Block mode buffer control A string is “executed” when it is processed by the QTERM. The concepts of a “string” and of “string execution” apply to all references to strings on the QTERM:
on power up or reset, the QTERM would send “!” to the host and display “QTERM Active” on the LCD. Then the QTERM buzzer will beep, since 07 is the ASCII BEL code, and the cursor would move the first column on the last row since ] IC@ is the command sequence to position the cursor at row 3 and column 0. The Pause switch, \P, inserts a pause in string execution. The form is \P,n where n is a number indicating the number of 50 ms periods to pause. For example:
• key strings (executed when a key is pressed) Beijer Electronics Fax 801-466-8792 Web www.beijerelectronicsinc.com Phone 801-466-8770
Page 32
22
QTERM-IV/P40 User's Manual
<k00> 'First',\P,20,'Second' would send the text “First” to the host, pause for one second (20*50 ms = 1 sec), then send the text “Second” to the host. n can be a decimal number (1 to 255) or a hexadecimal number (x01 to xFF). The EDIT Buffer Start switch, \S, sets the start of the Multidrop/Block EDIT buffer at the current cursor location (this is only useful when the QTERM is in either Multidrop or Block mode). The EDIT buffer extends to the end of the current line. A more detailed description of Multidrop and Block modes and the EDIT buffer follows below. Any of the special function switches can appear anywhere inside a string definition. 3.5.4
String Examples
Example 1: A More Sophisticated Warning Key String <k00>
07,'ALARM!',\L,27,'E','WARNING!!', 27,'PQ',07,\P,20,07
Pressing this key would result in the following: 07 'ALARM!' \L 27,'E' 'WARNING!!' 27,'PQ' 07 \P,20 07
-sent to host, should cause host to “beep” -sent to host for display -switch to local mode -clear screen command to QTERM (27 = ]) -displayed on QTERM screen -command to blink rightmost QTERM LED -tells QTERM to beep -pauses for 1 second -tells QTERM to beep again
Example 2: A Macro String for Displaying a Menu (make sure AutoLinefeed is ON for this one!) <m00>L,27,'E', ' Please Select One:',x0D, ' 1) Main Menu ',x0D, ' 2) Setup Menu ',x0D, ' 3) Text Menu ' If the host sent the command ] p @ (to execute macro 00) to the QTERM, the QTERM would clear its screen (] E), then display the menu text shown above. All of this with one three-byte command from the host! Example 3: Key Strings Executing Macro Strings
Presume that the macro above is defined, and that we define a key as follows: <k00> 'Entering Menu',\L,27,'p@' If the user presses this key (which we might want labeled “MENU” on the graphic overlay), the QTERM will send the string “Entering Menu” to the host, and then execute Macro 00, which displays the menu shown above. All without any assistance from the host!
3.6
Custom Display Characters
The QTERM is capable of displaying eight user-defined characters. Each of these characters consists of an eight row by five column dot matrix, where you specify which of the dots are on or off. You also define what code will cause the character to be displayed by the QTERM. You may choose any 8-bit value (code) from 00h through FFh, except values from 07h through 1Bh (see Appendix B for a chart of this). This allows you to redefine up to eight of the standard ASCII character bit patterns. For example, you could redefine the hex value x62, which normally displays a “b”, to display a small box (G). Each custom character is defined in the QDATA file as a string of eight byte values, where each byte specifies the dot pattern for one row of dots. For each byte, the upper three bits are set to 0, and the lower five bits correspond to the five dots on the row. If a bit is set to 1, the dot will be dark (on); if the bit is set to 0, the dot will be light (off). As an example, Figure 3-1 shows the default dot pattern of custom character 6 which is a little humanoid figure. From this dot pattern, the following bit assignments are derived: Row
7
6
5
4
3
2
1
0
Hex
1 2 3 4 5 6 7 8
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 1 1 0 1 1
1 1 0 1 0 0 1 0
1 1 1 1 1 1 1 0
1 1 0 1 0 0 1 0
0 0 0 1 1 0 1 1
0E 0E 04 1F 15 04 1F 11
As you can see in your default QDATA file, the hexadecimal values listed in the right column above are the values which are used to define the custom character. This particular dot patter is assigned to the ASCII character x06 in the default QDATA file.
Beijer Electronics Fax 801-466-8792 Web www.beijerelectronicsinc.com Phone 801-466-8770
Page 33
QTERM-IV/P40 User's Manual
23
Default dot patterns and character assignments for all eight custom characters are shown in the chart in Appendix B.
Figure 3-1. Example Custom Character.
Beijer Electronics Fax 801-466-8792 Web www.beijerelectronicsinc.com Phone 801-466-8770
Page 34
24
QTERM-IV/P40 User's Manual
Beijer Electronics Fax 801-466-8792 Web www.beijerelectronicsinc.com Phone 801-466-8770