HTBasic Help
×
Menu
Index

Devices

 
A device can be the screen, the keyboard, a printer, lab instrument, or data acquisition device. The device is specified with an Interface Select Code (ISC) or device selector. Each interface, (IEEE-488, serial, parallel, etc.) that is connected to your computer has a unique number assigned to it. When you load a device driver for an interface, a default ISC is assigned, or you can specify another ISC. The following table gives some default ISCs.
         
ISC
Device
1
CRT display
2
Keyboard
3
Graphic display
6
Bit mapped graphic display
7
IEEE-488 Board
8
2nd IEEE-488 Board
9
Serial
10
Windows default printer via Print Manager
11
2nd Serial
12
GPIO Board
17
Various Data Acquisition Boards (no analog capabilities)
18
Various Data Acquisition Boards (with analog capabilities)
26
Parallel port
32
Processor
 
If multiple devices can be hooked to the interface simultaneously, as they can on the IEEE-488, then the primary address must be included with the ISC to uniquely identify the device. This is also true of data acquisition boards having one or more subsystem: A/D, D/A, DIO, etc. Together, the ISC and primary address are called a device selector. Some IEEE-488 devices also require one or more secondary addresses. Each primary or secondary address should be specified with two digits. Thus 1 should be specified as 01. The total length of the device selector can be 15 digits. The following examples illustrate these rules. To perform I/O with an IEEE-488 device (assuming the default ISC) at primary address 2 and secondary address 6, use this ASSIGN statement:
 
ASSIGN @Dvm TO 70206
 
To perform I/O with an IEEE-488 device at primary address 3:
 
ASSIGN @Scope TO 703
 
To use analog output with a data acquisition board set to ISC 18 and 02 as the primary address for analog output, use this ASSIGN:
 
ASSIGN @Daq TO 1802
 
To performI/O with a device hooked to a serial port at ISC 9, you could use:
 
ASSIGN @Dvm TO 9
 
A device can have more than one I/O path name, each with different attributes, associated with it.
 
An I/O path name can have more than one IEEE-488 device assigned to it. If multiple devices are specified, they must be on the same interface. When OUTPUT is made to an I/O path assigned to multiple devices, all the devices receive the data. When ENTER is made from multiple devices, the first device specified sends data to the computer and to all the other devices assigned to the I/O path name. When CLEAR, LOCAL, PPOLL CONFIGURE, PPOLL UNCONFIGURE, REMOTE, or TRIGGER are made on multiple devices, all the devices receive the IEEE-488 message.
 
It is possible to perform I/O with a device without using an I/O path. But, when an I/O statement does not specify an I/O path variable, a temporary I/O path is created internally, used for the duration of the statement, and then discarded. This is usually slower than to ASSIGN an I/O path once and use it throughout the program.
 
OUTPUT @Scope;A(*)    ! Usually faster
OUTPUT 703;A(*)       ! Usually slower