Frequently Asked Questions

Starting a program automatically when launching HTBasic for you.

Yes, the -ALT switch can be used to run an AUTOST program other than the one named “AUTOST” in the current directory. For example, the following statement will start HTBasic running and will use a file named STARTUP.BAS in the root directory of drive C, regardless of what the current directory is:

C> HTBWin -ALT C:\STARTUP.BAS

To start HTBasic without running any files, direct the -ALT switch to a nonexistent file name for example:

C> HTBWin -ALT junk

Printing to a network or USB printer using HPGL or PCL commands

The net use command can be used 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:

  1. 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.)
  2. 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.)
  3. 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.)

  4. 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.
  5. Verify that the connection was successful by printing a directory from the DOS or command prompt. For example, if lpt1 was captured, type:

    dir > lpt1

  6. Once the printer has been successfully mapped to LPT1 you can then send HPGL or PCL commands through ISC 26.

How to convert BDAT file from the workstation so it can be used with HTBasic.

The following template program can be modified so that the @Oldbdatfile points to your HP workstation bdat file. IT converts the file to a format that can be used in HTBasic. The program creates a new file and place the properly formatted data into the new file

10 DIM Oldbdat$[256]
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

How to load Agilent Technologies LAN to GPIB controller.

Make sure the card has been configured correctly in Agilent�s SICL software, and then use the following statement in HTBasic:

LOAD BIN “HPIBS;DEV lan[IP Address]:lan0 ISC 7”

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.

How to load a PCMCIA GPIB card.

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.

Example:

LOAD BIN “HPIBS;DEV xxxx”, or LOAD BIN “GPIBNI;DEV xxxx” where xxxx is the Device Name assigned in the third party software

Does the USBS driver support any device that can plug into a USB port?

The USBS driver only supports USBTMC and USBTMC-USB488 Devices.

How to load the USBS driver.

Make sure your device has been recognized and configured in Agilent Technologies IO Libraries.

Load the USBS driver using either a LOAD BIN statement, or by going through the HTBasic Device Setup

Example:

LOAD BIN “USBS;DEV xxxx” where xxxx is the SICL Alias, or Device Name assigned in Agilent�s IO Libraries.

How to pass a String Array to a DLL..

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.

How do I print HTBasic Plus Widgets, or Dialogs?

To perform a DUMP GRAPHICS when displaying HTBasic BPLUS widgets or Dialogs you used to have to start HTBasic with the -gr command switch:

HTBWIN.EXE -gr off

A new command has been added to allow DUMP GRAPHICS of a BASIC Plus Widget:

CONFIGURE SYSTEM (“DUMP;PLUS”)

How To configure HP GPIO Cards with HTBasic

First, plug in the card and then install the HP I/O Libraries (SICL). This done, configure the card using the HP I/O Libraries configuration utility and make a note of the device name given the card. Next, do a CAT from BASIC and see if the GPIOS.DW6 driver is there. Then add the following line to the HBW 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:

OUTPUT 12;data

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”

How To import HPGL into Microsoft Word.

Microsoft Word 97 and Word 2000 do not include a filter for importing HPGL format graphics files. However, a 32-bit HPGL filter now available from Microsoft Product Support Services can be used with all 32-bit versions of Microsoft Word.

This file is supplied to allow you to import HPGL graphics files into Word 97 or later versions (or any other program that uses the common 32-bit graphics filters).

The HPGL filter does not ship with Word 97 or later versions.

The following file is available for download from the Microsoft Download Center. Click the file name below to download the file: from the support public or following link:

HPGL32 Executable

For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address

Microsoft Search

Didn’t find the answer you were looking for?

Give us a call: 801-572-2074