The HELP keyword is implemented for the HP BASIC Compiler and for HP BASIC Plus. See your Compiler or HP BASIC Plus documentation for details. (There is no compiler for the HPBAISIC/UX 700.)
Supported On | UX WS DOS |
Option Required | KBD |
Keyboard Executable | Yes |
Programmable | Yes |
In an IF ... THEN ... | Yes |
HILBUF$ receives data sent by an HP-HIL device (e.g., Describe Records, Poll Records, etc.).
HILBUF$
Temp_buf$=HILBUF$
IF Read_buf THEN Buffer$=HILBUF$
This function receives data from HP-HIL devices which have had polling enabled by the ON HIL EXT statement or which have been sent a command by the HIL SEND statement. This data takes the form of 8-bit numbers (bytes) packed into a string. When HILBUF$ is read, the internal buffer where it accumulates this data is cleared, ready to receive more data.
The format of the string returned by the HILBUF$ function is as follows: lost packet count, followed by zero or more data packets. The lost packet count will normally be zero (the null character). If the internal buffer overflows (because it is not read), the lost packet count is the total number of packets lost (to a maximum count of 255 packets). Only whole packets are put into the buffer. The format of a packet is: packet length, device address, data list. For example, sending an HIL SEND 4;RSC statement to an ID Module would create a packet of data similar to the following:
Packet\Length | Device\Address | data list
|
||||||||
---|---|---|---|---|---|---|---|---|---|---|
11 | 4 | 16 | 4 | 180 | 65 | 151 | 176 | 3 | 15 | 65 |
where 11 is the packet length and 4 is the device address. The remaining characters make up the data list (which in this example is a product/exchange number and serial number). The first character of the packet is the packet length. The packet length tells you how many string characters are left in the packet (including this character). Packet lengths range from 3 to 19 characters. The second character in the string is the device address. This tells you the position of the device within the HP-HIL link. There can only be a total of 7 addresses in the HP-HIL link. The remaining characters in the packet make up the data list. This list contains information which is dependent on the HP-HIL device polled (ON HIL EXT) or on the HP-HIL device and the command sent (HIL SEND). For more information on packets read the chapter "HP-HIL Interface" found in the HP BASIC Interface Reference.
If the HIL SEND statement results in data being returned from the device, the data is put into HILBUF$ even if HP-HIL interrupts are not enabled (i.e. ON HIL EXT is not currently active). Note that no interrupt is generated, even if HP-HIL interrupts are enabled (i.e. ON HIL EXT is currently active), for data placed in HILBUF$ as a result of HIL SEND. However, care should be taken in this case, since executing ON HIL EXT clears HILBUF$.
Supported On | UX* WS DOS |
Option Required | KBD |
Keyboard Executable | Yes |
Programmable | Yes |
In an IF ... THEN ... | Yes |
HIL SEND allows a selected subset of the HP-HIL Command Set to be transmitted to specific devices in the HP-HIL link.
HIL SEND Dev_address;DKA PRM
HIL SEND 3;IDD
HIL SEND 7;ACK 6
Item | Description/Default | Range\Restrictions |
---|---|---|
device address | numeric expression representing the HP-HIL device's position in the HP-HIL link | 1 through 7 |
rate | numeric expression indicating a keyswitch auto-repeat rate of 20 or 40 milliseconds | 1 or 2 |
indicator | numeric expression representing which of several prompts/acknowledges on the device to use | 1 through 7 |
device specific command | numeric expression whose meaning is device dependent | 128 through 239 |
register number | numeric expression | 0 through 127 (RRG); 0 through 255 (WRG) |
register data | numeric expression | 0 through 255 |
HP-HIL commands must be sent to a specific HP-HIL device, they may not be sent to several devices at once.
The IDD (Identify and Describe) command can be sent to all HP-HIL devices. For all other commands, HP-HIL devices which can use the HIL SEND statement are those whose poll records are not being processed for another purpose by HP BASIC . These devices are grouped into three categories:
The main HP-HIL devices which cannot use this function are:
If the HIL SEND statement results in data being returned from the device, the data is put into HILBUF$ even if HP-HIL interrupts are not enabled (i.e. ON HIL EXT is not currently active). Note that no interrupt is generated, even if HP-HIL interrupts are enabled, for data placed in HILBUF$ as a result of HIL SEND. However, care should be taken in this case, since executing ON HIL EXT clears HILBUF$.
The system will report an error if an attempt is made to send an HP-HIL command to an HP-HIL device at an address which was not present at the last SCRATCH A or power-up, even if a device is now present at that address. The system will not report an error if a command is sent to an address which had a device present at power-up or SCRATCH A but is now empty.
The sections which follow cover the HP-HIL commands supported by HP BASIC . For a detailed description of these commands, read the "HP-HIL Command Reference" located in the "HP-HIL Appendix" of the HP BASIC Interface Reference.
These Acknowledge commands are used to provide an audible or visual stimulus to the user, perhaps indicating that the System is ready for a particular process to be performed. Usually Acknowledges 1 through 7 are paired with Prompt 1 through Prompt 7.
The Acknowledges supported by a device are indicated in the Describe Record.
Acknowledge is intended to be a general-purpose stimulus to the user. This command is usually paired with Prompt. An HP-HIL device indicates support of Acknowledge in the Describe Record.
This is a range of 112 commands which have been reserved for use as "device-specific" commands. These commands are intended for use by devices with special requirements which the remainder of the HP-HIL protocol does not readily support.
This command is used to disable the "repeating keys" feature for the addressed HP-HIL device, reducing returned data to one report per keyswitch transition. Support of this command is not indicated in the Describe Record or Extended Describe Record. Examples of devices which support it are the: Function Box, Vectra Keyboard, ITF Keyboard. The default state for HP-HIL devices supporting this command is AutoRepeat disabled.
NOTE |
---|
The auto-repeat for DKA, EKA 1, and EKA 2 is different and independent of the keyboard auto-repeat which is controlled by keyboard CONTROL registers 3 and 4. The repeated arrow keys return a code which is not recognized by the keyboard driver; hence they have no effect. |
EKA 1 is used to enable the "repeating key" feature in the addressed device (if the feature is supported). Support of this command is not indicated in the Describe Record or Extended Describe Record. Examples of devices which support it are the: Function Box, Vectra Keyboard, ITF Keyboard. This command will cause the HP-HIL device's keys to repeat about every 40 milliseconds. Modifier keys ([Shift], [CTRL], [Extend char], etc.) will not repeat. The cursor keys ([left arrow], [right arrow], [up arrow] and [down arrow]) on an ITF Keyboard will send repeated 02 codes after the initial Keycode.
EKA 2 is used to enable the "repeating key" feature in the addressed device (if the feature is supported). Support of this command is not indicated in the Describe Record or Extended Describe Record. Examples of devices which support it are the: Function Box, Vectra Keyboard, ITF Keyboard. This command will cause the HP-HIL device's keys to repeat about every 40 milliseconds. Modifier keys ([Shift], [CTRL], [Extend char], etc.) will not repeat. The Cursor Keys ([left arrow], [right arrow], [up arrow] and [down arrow]) on an ITF Keyboard will send repeated 02 codes at a faster rate than EKA 1.
This command provides additional information concerning more advanced device features which may not be required for basic operation. Support of the Extended Describe command is indicated in the Describe Record Header.
Identify and Describe is used by the system to determine the type of HP-HIL devices in the HP-HIL link, as well as some general characteristics of these devices.
Sending an IDD to a relative pointing device, or to an absolute pointing device which is currently the GRAPHICS INPUT device, will result in an IDD record being reconstructed from the system's internal configuration record. This pseudo-IDD record will be the actual IDD record stored by the system at power-up or SCRATCH A time, but no HP-HIL bus access is made (i.e. if the device has been removed, it will still show up here).
These Prompt commands are used to provide an audible or visual stimulus to the user, perhaps indicating that the System is ready for a particular type of input. Usually Prompts 1 through 7 are paired with Acknowledge 1 through Acknowledge 7.
The Prompts supported by a device are indicated in the Describe Record.
Prompt is intended to be a general-purpose stimulus to the user. This command is usually paired with Acknowledge. An HP-HIL device indicates support of Prompt in the Describe Record.
Report Name is used to request a string of up to 15 characters (8-bit ASCII) which aid in describing the device to the user. Devices indicate support of the Report Name command in the Extended Describe Record.
Read Register provides a means for interaction with more complex devices via HP-HIL, allowing for data transfers not generally supported by the HP-HIL devices. Device support for this command is indicated in the Extended Describe Record.
The numeric value listed after this HP-HIL command is the number of the register that is to be accessed. The range of valid register numbers is 0 to 127.
The Report Security Code command is used to extract a unique product/exchange number and serial number from the HP-HIL device. Support of the command is indicated in the Describe Record Header.
Information returned when executing this command can also be obtained using the SYSTEM$("SERIAL NUMBER") function. It should be noted that this function will only return the product/exchange number and serial number for the last HP 46084A ID Module in the HP-HIL link. If there are other devices in the HP-HIL link with security code information, they are ignored by the SYSTEM$("SERIAL NUMBER") function. This is not the case with the RSC command when it is executed with the HIL SEND statement, as it will allow you to select the device you want to report a security code.
Report Status is used to extract device-specific status information from devices configured on the HP-HIL link. Devices indicate support of the Report Status command in the Extended Describe Record.
Write Register provides a means of setting the contents of individual registers in HP-HIL devices supporting this feature. Device support for this command is indicated in the Extended Describe Record.
There are two types of Write Register Records: Write Register Type 1 and Write Register Type 2. HP BASIC looks at both of these Types as functionally the same (i.e. they both write a single byte to a single register).
The numeric value listed after this HP-HIL command is the number of the register that is to be accessed. The range of valid register numbers is 0 to 255. Range 0 to 127 selects Write Register Type 1 and range 128 to 255 selects Write Register Type 2. In either case, only one data item may be transmitted per command (i.e. this implementation limits the Type 2 data list to one item).
Bad register read/write errors are no longer reported. IDD, RNM, EXD, RST, and RSC may return a variable number of bytes in HILBUF$. This number is determined by truncating all trailing null characters from the packet obtained by the device.
Devices to be addressed using HIL SEND must not have been opened by the X Windows server. These devices must also be connected to the local system since they cannot be accessed on a remote system. See the section "Opening Input Devices" in the chapter "System-Level Customization" found in the Using the X Window System, Version 11 manual, for details on how to prevent the X Window server from opening specified HIL devices.