Frequently Asked Questions
To start HTBasic without running any program file, simply specify any nonexistent file name. For example:
C> HTBWin -ALT C:\MyStartup.bas
C> HTBWin -ALT nostart
In older versions of Windows you can use the Windows “net use” command to redirect an LPT port to a shared printer, even if the shared printer is on the same PC. The only way to redirect an LPT port to a TCP/IP address is through a local printer share (to the TCP/IP port) because the net use commands requires a UNC path.
This can be done by following these steps:
- Make sure your USB printer is shared on the network. (If you are not connected to a network you can workaround this by using a network loop back plug. To create a loop back plug the pins are looped from pin 1 to pin 3, and from pin 2 to pin 6.)
- Open a command prompt window. (In Windows 7, you will need to open the command prompt as an administrator. Go to Start>All Programs > Accessories > Right Click Command Prompt and select Run as Administrator.)
- At the command prompt type: net use lptx \\machine_name\share_namePress the Enter key. Machine_name is the name of the machine on which the printer is shared, the share_name is the shared name of the printer, and the x with lpt is the number of the LPT port you wish to print from. The selected LPT port can be a LPT port that physically either resides on the machine or not. For example:
net use lpt1 \\abc12345\lj5 /persistent:yes
(To make the net use connection survive power cycles and reboots, include the “/persistent:yes” at the end of the net use statement.)
- Press the Enter key. If the command was successful, a message should return that reads, “The command completed successfully.” It may take several seconds depending on the size of the network and/or network traffic.
- Verify that the connection was successful by printing a directory from the Windows command line. For example, if lpt1 was captured, type:
dir > lpt1
- Once the printer has been successfully mapped to LPT1 you can then send HPGL or PCL commands through ISC 26.
lan0 is the default device name, but you should include whatever the device name is assigned in SICL. The LAN to GPIB controller can also be loaded into the HTBasic Device Setup found under the Tools menu. Add the HPIBS driver into the list of drivers, and then go into the properties of the driver. The following needs to be entered into the SICL Device name field: lan[address IP]:lan0 Once the driver has been added and configured correctly, you can simply click the “Load” button to load the driver.
LOAD BIN “HPIBS;DEV lan[IP Address]:lan0 ISC 7”
Make sure the card has been configured correctly in the third party software. Either use a LOAD BIN statement, or the HTBasic Device Setup to load the necessary driver.
LOAD BIN “HPIBS;DEV xxxx”
LOAD BIN “GPIBNI;DEV xxxx”
where xxxx is the Device Name assigned in the third party software
The USBS driver only supports USBTMC and USBTMC-USB488 Devices.
where xxxx is the SICL Alias, or Device Name assigned in Agilent’s IO Libraries.
LOAD BIN “USBS;DEV xxxx”
First it is very important that the string array declared on the HTBasic side is the Exact size of the string array declared in the DLL.
In HTBasic a String is stored differently than in C++.
Instead of putting a NULL char at the end of the string HTBasic adds two characters to the string which contain the size of the string.
To pass a string array to a DLL you would pass the first element of the array which is received as a pointer to the array in the DLL. Next you need to add 2 to the size of each string in the array in the DLL to compensate for the extra two characters added on by HTBasic. This will allow you to access normally the string array in the DLL.
To send a string array back to HTBasic the opposite needs to happen. Each string in the array needs two have two extra characters containing the size of the string so that HTBasic knows the size of the string and can access them correctly.
Two functions have been written in a file called HTBasicStrings.cpp which allow the strings to be passed to and from the DLL.
Use the following command to enable DUMP GRAPHICS of a Widget:
CONFIGURE SYSTEM (“DUMP;PLUS”)
First, plug in the card and then install the HP I/O Libraries (SICL). Then configure the card using the HP I/O Libraries configuration utility and make a note of the device name given the card. Next, you can do a CAT from HTBasic and confirm that the GPIOS.DW6 driver is there. You can then add the following line to the AUTOST file:
LOAD BIN “GPIOS;DEV devicename ISC 12”
If you have configured the GPIO card with device name “gpio12” then you enter the line as:
LOAD BIN “GPIOS;DEV gpio12 ISC 12”
Then you will be able to write programs that communicate with the GPIO card through ISC 12:
The ISC can be changed to whatever you like (except if it conflicts with a predefined ISC, like 10). For example, you could specify ISC 20 with:
LOAD BIN “GPIOS;DEV gpio12 ISC 20”
10 DIM Oldbdat$ 20 ASSIGN @Oldbdatfile TO “a:\oldbdat.bdat”;FORMAT MSB FIRST 30 ENTER @Oldbdatfile;S$ 40 CONFIGURE BDAT LSB FIRST 50 CREATE BDAT “c:\newbdat.bdat”,1 60 ASSIGN @Newbdatfile TO “c:\newbdat.bdat” 70 OUTPUT @Newbdatfile;Oldbdat$ 80 ASSIGN @Oldbdatfile TO * 90 ASSIGN @Newbdatfile TO * 100 END
For additional help
Or email us at firstname.lastname@example.org, or call 801-572-2074 (8:00-5:00 MDT)