The Wayback Machine - https://web.archive.org/web/20140302012749/http://www.htbasic.com:80/support/faq/


Frequently Asked Questions

HTBasic Current Version

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

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_name

    Press 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.

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

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.

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
The USBS driver only supports USBTMC and USBTMC-USB488 Devices.

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.

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. To download this file click here.

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")

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"

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

GESCAPE code 104 changes line thickness only for HPGL plotters.

To make lines on the CRT appear thicker, put multiple lines next to each other. You can�t make lines thinner on the CRT.

TransEra�s NIDAQ Data Acquisition driver supports all of National Instruments DAQ boards with the following exceptions.

If your board is not listed in the tables below, then it is supported by the latest version of the NI-DAQ driver software for your operating system. You can get the latest NI-DAQ by visiting National Insturments Drivers and Updates Library on their web site.

We support version 6.1 of the NI DAQ Software and newer.

Boards
NI-DAQ Software Version
AT-MIO-16D L/H 9/25
Version 6.1.1 Only
AT-MIO-16F-5
Version 6.1.1 Only
AT-MIO-16L/H 9/15/25
Version 6.1.1 Only
AT-MIO-16X
Version 6.1.1 Only
AT-MIO-64F-5
Version 6.1.1 Only
EISA-A2000
Not Supported
Lab-PC
Not Supported
AT-A2150
Not Supported
AT-DSP2200
Not Supported
MC-DIO-24
Not Supported
MC-DIO-32F
Not Supported
MC-MIO-16
Not Supported

HTBasic for DOS:

ISC 10 defaults to LPT1

ISC 12 defaults to LPT2

HTBasic for Windows:

ISC 10 defaults to Windows Print Manager

ISC 26 defaults to LPT1 or LPT2

It is possible to configure HTBasic to load and run a program besides the AUTOST at startup. To do this you must first insure that the program you want to load and run is a PRG type rather than an ASCII type. In DOS, you must type -alt PROGNAME after the executable file name. The command line would look like this, htb386 -alt PROGNAME . In Windows, you need to edit the properties of the HTBasic icon by right clicking on the icon and choosing properties. Then press the shortcut tab and in the Target line, add -alt "PROGNAME" after the closing quotation marks in the startup path. Click OK and double click on the icon. HTBasic should now load the program and run it automaticly.

The TransEra 900 GPIB IEEE-488 card can be used with Visual Basic only under Windows NT. This is because TransEra doesn�t have any Windows drivers written for the 900 card, but there is a utility written which allows the 900 card to be used under NT through the SICL drivers. This was designed originally for HTBasic, but any program which supports SICL drivers can now access the 900 card under NT.

In order to get the TransEra 900 IEEE-488 card to work in NT, there are a few things that must be done. First, install or confirm that the HP I/O Libraries are installed on your machine. Next, go to the TransEra FTP site and download the 900Util.zip file. This site is at ftp.rmbasic.com. Unzip this file in it�s own directory and run the Setup.exe file. This will install a utility which allows HTBasic to use the HP SICL drivers. Once the TransEra I/O configuration utility is installed, go to Start | Programs | TransEra I_O Configuration | TransEra Configuration Utility. Choose Add Card, and set up the card, or leave the default values and choose O.K. Then Press the update button to save the cards information. Now it should be possible to use the 900 card under NT.

HPIBS
The HPIBS Driver supports HP/Agilent and compatible GPIB cards. Before the driver can be used, the Agilent I/O Libraries must be installed and the interface must be correctly configured for SICL. There are a number of parameters and configuration options which are controlled through the SICL Interface.

GPIB900
The GPIB900 Driver supports the TransEra 900 GPIB card

GPIBNI
The GPIBNI Driver supports NI and compatible GPIB cards. Before the driver can be used the National Instruments software must be installed and the interface must be correctly configured in the NI software. There are a number of parameters and configuration options which are controlled through the NI Interface.

Before using the HP/Agilent GPIB cards from HTBasic, the HPIBS driver that is shipped with HTBasic must be loaded.

Before using the first time you must make sure that the HP/Agilent I/O Libraries, which is shipped with the card, has been installed and that the card is configured correctly in this library. (For more information on configuring cards in the library, see the documentation included with the I/O Libraries. )

Next you can load the driver directly from HTBasic using the Device Setup which is found under the Tools menu, or you can use the following command ( in interactive mode, or in a program)

LOAD BIN "HPIBS;DEV sicl_name ISC isc TIME timeout"

Sicl_name is the name assigned to the card in the Agilent I/O Libraries. It is case sensitive, so enter the name exactly as it appears.

Isc is the Interface Select Code for the Device.

Timeout is the maximum time that the interface will wait for a command to execute before timing out.

Example: LOAD BIN "HPIBS;DEV gpib0 ISC 7"

Once loaded you can write programs that communicate with instruments through the GPIB card via the Interface Select code 7.

10 OUTPUT 705;"*IDN?"
20 ENTER 705;Id$

Note: It is possible to put the load bin command for this driver Into the Autost program so that the driver loads automatically when HTBasic starts up.

In order to use a National Instruments GPIB card from HTBasic, you must load the GPIBNI driver into HTBasic.

Before doing this you must first ensure that the NI Software that is provided with the card is installed and that the GPIB card is correctly configured.

Next, you can load the driver in HTBasic using either the Device Setup found under the Tools menu, or using the following command.

LOAD BIN "GPIBNI;DEV card_name ISC isc BUS bus [NOTSYS|SYSTEM]

Card_name is the symbolic name of the card defined in the NI Software. It is case sensitive.

Isc is the Interface Select Code

Bus is the address of the card on the GPIB bus

NOTSYS if the card is not the system controller

SYSTEM if the card is system controller.

Example: LOAD BIN "GPIBNI;DEV gpib0 ISC 7"

You can now write programs that communicate with instruments connected to the GPIB card through Interface Select Code 7

Once loaded you can write programs that communicate with instruments through the GPIB card via the Interface Select code 7.

10 OUTPUT 705;"*IDN?"
20 ENTER 705;Id$

Note: It is possible to put the load bin command into the Autost program so that the driver will be automatically loaded at startup.

First make sure that the HP/Agilent I/O libraries is installed. Install the Tams driver that came with the Tams GPIO card and Insert the Tams GPIO card in the PC.

Next Configure the Tams Card in the I/O Libraries. Take note of the SICL name give to the card.

Now load the GPIOS driver using the following command:

LOAD BIN "GPIOS";DEV name ISC isc"

Name is the SICL name given to the card in the I/O Libraries.
Isc is the Interface Select Code

Example: LOAD BIN "GPIOS;DEV gpio ISC 12"

10 OUTPUT 12;Data !Data to send
20 ENTER 12;Read !Data to read

The ISC can be changed to a different value as long as that value does not cause a conflict with another defined ISC

You can put the LOAD BIN statement in the Autost file so that it gets automatically loaded on startup.

The Serial Number will be required to buy an Update to HTBasic at a reduced price. To find this number, type the following command into HTBasic.

SYSTEM$("SERIAL NUMBER")

Each time HTBasic starts up, it searches in the current directory for a program named "AUTOST". If this program exists, it is automatically loaded and executed. This permits you to load all the necessary drivers that configure HTBasic as you desire and to launch the startup program of your choice.

To change the AUTOST, simply load it and make the desired changes, then RE-STORE the program.

All the system information is available through different DLL Functions. The Dificulty is not reading the information, but finding the appropriate function in the different Microsoft documentation that gives you the information you are looking for.

The following example shows how to get system information from your machine:
! Load the kernel32.dll
DLL LOAD "KERNEL32"

! Declare the function that gets the computer name
DLL GET "stdcall void KERNEL32:GetComputerNameA" AS "Getcptname"

! Declare the function that reads the available drives
DLL GET "stdcall long KERNEL32:GetLogicalDrives" AS "Getdrives"

! Variable Declaration
DIM Computer_name$[80]
LONG Buffersize
Buffersize=MAXLEN(Computer_name$)
LONG Bitmask
INTEGER I

! Read the name of the machine
Getcptname(Computer_name$,Buffersize)

! Get the available drives
Bitmask=FNGetdrives
PRINT "Computer Name = ";Computer_name$
PRINT "Drives Available = ";
FOR I=0 TO 15
IF BIT(Bitmask,I) THEN PRINT CHR$(NUM("A")+I);": ";
NEXT I
DLL UNLOAD ALL
END

There could be two cases:

1. The Instrument supports the SICL/LAN ( ou VXI-11 LAN) protocol

It behaves, as far as possible, as if it had a GPIB Interface. The Agilent SICL Library configures the TCP/IP Interface with the appropriate protocol. From HTBasic it is enough to load the HPIBS driver, specifying the name of the LAN Interface to use.

LOAD BIN "HPIBS;DEV lan[IP Address]:lan0 ISC 7"
ASSIGN @Inst TO 711
OUTPUT @Inst;"*RST"

In fact the Instrument address (11) is not really necessary. It is just present for consistant programming. The fact that the IP Address of the Instruement has been entered is enough to link the HPIBS driver at ISC 7 to the Instruement.

2. The Instrument does not support the SICL/LAN protocol

In General, this type of instrument communicates through TCP/IP Sockets. The SICL library supports this type of communication, but HTBasic cant use it directly. It is therefore necessary to use the Agilent SICL DLL in HTBasic.

DLL LOAD "SICL32"
DLL GET "SHORT Sicl32:iopen" AS "Iopen"
DLL GET "SHORT Sicl32:iwrite" AS "Iwrite"
DLL GET "SHORT Sicl32:iread" AS "Iread"
DLL GET "SHORT Sicl32:iclose" AS "Iclose"

Other fuctions could be used (Setting Timeouts, Formatted Read/Write) but the principle communication remains the same.

- Open Session
- Communicate
- Close Session

Example running an Agilent 16700 Analyser using this method

10 ! DirectSiclSocket for Agilent 16700 Logic Analyzer
20 !
30 ! BOURBAKY Dll ToolKit Example for Real Instrument Remote Programming
40 ! -----------------------------------
50 ! How easily work with 16700 from HTBasic
60 ! Only using existing SICL functions
70 !
80 PRINT "Loading DLL"
90 DLL LOAD "SICL32"
100 !~!
110 PRINT "Function Declaration"
120 DLL GET "SHORT Sicl32:iopen" AS "Iopen"
130 DLL GET "SHORT Sicl32:iwrite" AS "Iwrite"
140 DLL GET "SHORT Sicl32:iclose" AS "Iclose"
150 DLL GET "SHORT Sicl32:itimeout" AS "Itimeout"
160 DLL GET "SHORT Sicl32:iread" AS "Iread"
170 !~!
180 LONG Intf_hdl! interface session handler
190 LONG Inst_hdl! instrument session handler
200 !~! 210 REAL Loops
220 INTEGER I
230 REAL T0
240 COM REAL Send,Receive
250 LONG Sent
260 !~! 270 INTEGER Answer
280 DIM Response$[256]
290 DIM Filename$[50]
300 Filename$="/hplogic/bky/myconf.___"
310
320 !~!
330 DIM Intf_symname$[5]
340 Intf_symname$="lan"
350 !~!
360 DIM Inst_symname$[80]
370 Inst_symname$="lan,6500[192.168.1.120]"
380
390 !~!
400 DIM Comand$[80]
410 Sent=LEN(Comand$)
420 !~!
430 ON ERROR RECOVER Error_trap
440 T0=TIMEDATE
450 Intf_hdl=FNIopen(Intf_symname$)! Open interface session
460 IF Intf_hdl=0 THEN
470 PRINT "CAN�T OPEN INTERFACE SESSION"
480 GOTO Eop3
490 ELSE
500 PRINT "INTERFACE SESSION OPENed"
510 END IF
520 !~!
530 Inst_hdl=FNIopen(Inst_symname$)! Open instrument session
540 IF Inst_hdl=0 THEN
550 PRINT "CAN�T OPEN INSTRUMENT SESSION"
560 GOTO Eop2
570 ELSE
580 PRINT "INSTRUMENT SESSION OPENed"
590 END IF
600 !~!
610 ! Program will LOOP to check the ability to stay synchronous with 16700 execution
620 !-------------------------------
630 !~!
640 LOOP
650 Loops=Loops+1
660 PRINT "===== Loop #";Loops;" ====="
670 !~!
680 !=== clear instrument ======================
690 PRINT "clear"
700 Answer=FNSocket_send(Inst_hdl,"clear")
710 EXIT IF Answer<>0
720 Answer=FNSocket_rcv(Inst_hdl,Response$)
730 EXIT IF Answer<>0
740 !~!
750 !=== LOCK User interface ============
760 PRINT "lock"
770 Answer=FNSocket_send(Inst_hdl,"lock")
780 EXIT IF Answer<>0
790 Answer=FNSocket_rcv(Inst_hdl,Response$)
800 EXIT IF Answer<>0
810 !~!
820 !=== Ask for #version ======================
830 PRINT "version : ";
840 Answer=FNSocket_send(Inst_hdl,"version")
850 EXIT IF Answer<>0
860 Answer=FNSocket_rcv(Inst_hdl,Response$)
870 EXIT IF Answer<>0
880 PRINT Response$
890 !~!
900 !=== Plugged Modules ? =====================
910 PRINT "Modules List"
920 FOR I=1 TO 10
930 Answer=FNSocket_send(Inst_hdl,"modules -slot "&CHR$(64+I))
940 Answer=Answer+FNSocket_rcv(Inst_hdl,Response$)
950 IF POS(Response$,"No module")=0 THEN PRINT Response$
960 NEXT I
970 EXIT IF Answer<>0
980 !~!
990 !=== Loadind analyzer configuration ========================
1000 PRINT "loading configuration : ";Filename$
1010 Answer=FNSocket_send(Inst_hdl,"config -l "&Filename$)
1020 EXIT IF Answer<>0
1030 Answer=FNSocket_rcv(Inst_hdl,Response$)
1040 EXIT IF Answer<>0
1050 !~!
1060 !=== RUN analyzer ================
1070 PRINT "starting acquisition"
1080 Answer=FNSocket_send(Inst_hdl,"start")
1090 EXIT IF Answer<>0
1100 !~!
1110 !=== WAIT finished =================
1120 PRINT "wait for measurement complete"
1130 Answer=FNSocket_send(Inst_hdl,"wait -complete")
1140 EXIT IF Answer<>0
1150 Answer=FNSocket_rcv(Inst_hdl,Response$)
1160 EXIT IF Answer<>0
1170 !~!
1180 !=== Check Status ======================
1190 PRINT "status : ";
1200 LOOP
1210 Answer=FNSocket_send(Inst_hdl,"status")
1220 EXIT IF Answer<>0
1230 Answer=FNSocket_rcv(Inst_hdl,Response$)
1240 EXIT IF Answer<>0
1250 EXIT IF POS(UPC$(Response$),"STOPPED")
1260 END LOOP
1270 EXIT IF Answer<>0
1280 PRINT Response$
1290 !~!
1300 !=== UNLOCK User interface ============
1310 PRINT "unlock"
1320 Answer=FNSocket_send(Inst_hdl,"unlock")
1330 EXIT IF Answer<>0
1340 Answer=FNSocket_rcv(Inst_hdl,Response$)
1350 EXIT IF Answer<>0
1360 !~!
1370 DISP "Started : ";DATE$(T0);" ";TIME$(T0);" / ";Loops;" Loops / ";Send;" Comands / ";Receive;" Responses"
1380 END LOOP
1390 !~!
1400 !~!
1410 PRINT
1420 Eop1:!
1430 PRINT "CLOSE INSTRUMENT SESSION"
1440 Iclose(Inst_hdl)
1450 Eop2:!
1460 PRINT "CLOSE INTERFACE SESSION"
1470 Iclose(Intf_hdl)
1480 Eop3:!
1490 DLL UNLOAD ALL
1500 STOP
1510 !~!
1520 Error_trap:!
1530 PRINT ERRM$
1540 GOTO Eop1
1550 END
1560 !~!
1570 DEF FNEnter_socket(LONG Hdl,Enter_str$,OPTIONAL S_timeout)
1580 ! Enter string, getting char by char
1590 INTEGER Answer
1600 INTEGER First_car=1
1610 LONG Bufsize=1
1620 LONG Actualcnt
1630 DIM C$[2]
1640 LONG Inst_timeout1=1000
1650 LONG Inst_timeout2=50
1660 IF NPAR=3 THEN Inst_timeout1=S_timeout
1670 Itimeout((Hdl),(Inst_timeout1))
1680 Enter_str$=""
1690 LOOP
1700 Answer=FNIread((Hdl),C$,(Bufsize),Actualcnt)
1710 EXIT IF Answer<>0
1720 EXIT IF Actualcnt=0
1730 Enter_str$=Enter_str$&C$
1740 IF First_car THEN
1750 First_car=0
1760 Itimeout((Hdl),(Inst_timeout2))
1770 END IF
1780 END LOOP
1790 RETURN Answer
1800 FNEND
1810 !~!
1820 DEF FNSocket_send(LONG Inst_hdl,Comand_$)
1830 COM REAL Send,Receive
1840 ALLOCATE Comand$[256]
1850 Comand$=Comand_$
1860 LONG Sent,Answer
1870 INTEGER Endi=0
1880 Comand$=Comand$&CHR$(10)
1890 Sent=LEN(Comand$)
1900 Answer=FNIwrite((Inst_hdl),Comand$,(Sent),Endi,Sent)
1910 Send=Send+1
1920 IF Answer<>0 THEN
1930 PRINT "Code Answer : ";Answer
1940 PRINT "ERROR WHILE SENDING COMAND"
1950 RETURN -1
1960 ELSE
1970 RETURN 0
1980 END IF
1990 FNEND
2000 !~!
2010 DEF FNSocket_rcv(LONG Inst_hdl,Response$)
2020 LONG Answer
2030 COM REAL Send,Receive
2040 Answer=FNEnter_socket(Inst_hdl,Response$)
2050 Receive=Receive+1
2060 ! Remove unwanted prompt and termination (if any)
2070 IF POS(Response$,"->") THEN Response$=Response$[1;POS(Response$,"->")-1]
2080 IF POS(Response$,CHR$(10))=LEN(Response$) AND LEN(Response$)<>0 THEN Response$=Response$[1;LEN(Response$)-1]
2090 IF Answer=0 THEN
2100 PRINT "Code Answer : ";Answer
2110 PRINT "ERROR GETTING ANSWER"
2120 RETURN -1
2130 ELSE
2140 RETURN 0
2150 END IF
2160 FNEND
2170 !~!

Starting with the 9.0 version of HTBasic, there is nothing special that needs to be done. The new HPIBS driver supports multiple instances of the driver.

Example:

10 LOAD BIN "HPIBS;DEV gpib0 ISC 7"
20 LOAD BIN "HPIBS;DEV gpib1 ISC 8"
30 LOAD BIN "HPIBS;DEV gpib3 ISC 13"

With versions earlier then 9.0, it was necessary to make copies of the HPIBS driver, so that there can be multiple HPIBS.dw6 files with different names. Next each Interface loaded needs to use a different file for its driver.

Example:

10 LOAD BIN "HPIBS;DEV gpib0 ISC 7"
20 LOAD BIN "HPIBS2;DEV gpib0 ISC 8"
30 LOAD BIN "HPIBS_X3;DEV gpib3 ISC 13"

The Graphic Description Language HP-Pcl5 contains an HPGL language interpreter that in theory permits printers supporting this language to double as a plotter.

In Practice, before sending HPGL instructions to the printer, you must first put the printer into Plotter mode.

In an HTBasic Program, you would use the PLOTTER IS statement with the PCL5 parameter specifying the port with which the printer is connected. This should automatically put the printer into plotter mode.

Example: PLOTTER IS 26;"HPGL;PCL5"

At the end of plotting, add the instruction PLOTTER IS CRT, "INTERNAL" Which in addition to specifying the crt as printing device, will put the printer back into PCL5 mode.

Note: There are a number of printers that only support the PCL3 language and can not be used as a plotter.

There are at least two methods that allow using multiple printers in an HTBasic program.

Interactive Method:
In this method, it is the operator who will choose the printer he wishes to print to. The program simply opens a Printer Selection Dialog Box, which allows the user to select the desired printer. This is done using a printer control statement:

CONTROL PRT,102;1 !Shows Printer Selection Dialog

On top of just selecting a printer, the operator has access to all the properties associated with the selected printer.

Static method:
This condition allows the programmer to indicate in HTBasic all the possible printers that might be used. This is done from the HTBasic Device Setup found under the File menu. Each printer that is declared in windows can be added to the list of available printers in HTBasic. Each printer them gets associated with an ISC (Interface Select Code) that can be used in the program to indicate which printer the operation will print to.

DUMP DEVICE IS 20 !Select the printer at ISC 20

Yes, using versions 8.0 or Greater of HTBasic. One of the major modifictations of HTBasic 8.0 was the ability to use DLL�s from HTBasic. One of the DLL�s found in the DLL Toolkit provided with HTBasic is the HTBMail DLL. This DLL allows the sending of e-mail from HTBasic

The following program, along with the associated DLL can be found in the DLL ToolKit/Samples/HTBMail folder

DIM Subject$[256]
DIM Body$[256]
DLL LOAD "HTBMAIL"
DLL GET "void HTBMAIL:Sendmail"
Address$="sales@htbasic.com"
Subject$="E-mail sent from HTBASIC"
Attachment$=""
Body$="Hello, How are you?"
Sendmail(Address$,Subject$,Attachment$,Body$)
DLL UNLOAD ALL
END

When one has large amounts of data to read, it could be advantageous to read the data in as binary, rather than ascii.

Nothing stops you from declaring two methods for Enter/Output for the same address, one functioning in ASCII Mode, and the other in Binary.

REAL Mesures(1:100)
ASSIGN @I_asc TO 712;FORMAT ON ! mode ASCII
ASSIGN @I_bin TO 712;FORMAT OFF ! mode binaire
OUTPUT @I_asc;"READ?"
ENTER @I_bin;Mesures(*)

If a program�s Source Code is placed on a Workstation, there is the potential risk that the program could be altered by the User if the workstation uses the HTBasic Full Development Version.

The easiest way to avoid this problem is to use the HTBasic Runtime Versions on all Workstations. HTBasic Runtime Versions do not allow the editing of code.

To secure the program even further, the program could be encrypted using the Secure function found in HTBasic versions 9.0 and later. This causes the code to be hidden.

The ultimate step is to compile all or most of the program. The numeric compile can be used for this purpose.

This Windows bug occurs in some non English versions of Windows when a file is located inside a directory that contains spaces in the directory name.  To correct: go to My Computer, click Tools, then Folder Options, File Types, locate the .prg or .bas file extension in the list of Registered File Types and highlight it by single clicking your selection.  Next, click advanced, then edit.  Under the heading "Application used to perform action:" you will find the following by default, the exact directory or drive may vary in your individual setup C:\Program Files\HTBwin95\HTBwin.exe  -alt %1.  Simply change the line so that %1 is in quotes.  The final product should read C:\Program Files\HTBwin95\HTBwin.exe  -alt "%1" 

 

Please download the following PDF chart for a list of supported GPIB cards, and the drivers that support them.

Supported GPIB Table


HTBasic for Windows 8.0
To perform a DUMP GRAPHICS when displaying HTBasc 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")

HTBasic Legacy Version 7.x
If you are using the 7.0 CD to install the earlier release of 6.0, there is a problem with the published serial number. Please contact TransEra or your Distributor to get a correct serial number.
When placing alpha on top of previously drawn graphics while in SEPARATE ALPHA mode, the alpha will first black out the line where it is to place the text prior to placing the text. This has been repaired and is corrected in versions of HTBasic for Windows 7.1 or higher.
Under Windows 95, it is not possible to print to the default Windows printer unless it is connected directly to a physical port or mapped to a network port. If your printer is mapped only to a network printer without being assigned a port number, error 401 will occur. This has been repaired in our newest HTBasic 7.1 for Windows version. Click here for download information on the newest 7.1 release.
Only the WIN-DUMP driver responds correctly to the DUMP GRAPHICS and DUMP ALPHA commands while in SEPARATE ALPHA mode. All other drivers are available for update for proper functionality. At release time the drivers only dumped mixed ALPHA and GRAPHICS. This has been repaired in versions of HTBasic for Windows 7.1 and higher.
With alpha and graphics merged and the GRAY option specified in the CONFIGURE DUMP statement of the PS-DUMP driver, the colors on the screen are not properly gray-scaled by the printer. This has been repaired in versions of HTBasic for Windows 7.1 or higher.
GPIBNI

Supports all National Instruments 488.2 driven GPIB cards. This includes all NI GPIB cards that National supports under the respective operating systems. For example the PCII/IIA card is not supported under NT/2000 at all. However, for Windows 95/98 the card is supported if it is 488.2 compliant

This driver also supports all other "NI clone" GPIB boards.

To load a NI PCII/IIA, or other NAT488.2 compatible GPIB board, it is first necessary to install and configure the NI board with the NI software available here for Windows 95/98 or here for Windows NT/2000. Once the board is installed and configured with the National Instruments' software, it is then possible to load the GPIBNI driver in HTBasic. The load bin statement is as follows:

LOAD BIN "GPIBNI;DEV XXX"

where XXX is the device name specified in the NI configuration utility.

To determine if your PCII/IIA board is 488.2 compatible ,check the assembly number on the board. If it reads something like ASSY 180XXX, then the board is a 488.1 compliant one. National Instruments has DOS-only (no Windows) support for 488.1 cards. Only 488.2 (ASSY 181XXX) boards are supported in Windows.

For the IOTech GPIB boards. If your IOTech IEEE-488 board has a serial number higher than #036731, then your card may be run with with the GPIBNI driver by using a special driver provided by IOTech. IOTech may be contacted at: http://www.iotech.com HPIBS

This driver supports all HP SICL compatible GPIB boards. These boards include the HP SICL cards, the TransEra Model 900 board under Windows NT and Windows 2000, the TAMS PCI GPIB board under Windows NT/2000, and the Ines ISA, PCI, cPCI, and PCMCIA boards. For details on loading this card see the What's New in 7.0 Manual page 4-4. GPIB

This driver is not designed for use with Windows NT or Windows 2000. It supports the TransEra Model 900 GPIB and compatible boards. This would include the Ziatech and some older National Instruments boards that are not supported by the NI 488.2 software such as the PC3 cards.

For a full list of compatible GPIB boards, see our Compatibility Table.

GPIOS & GPIO

The HP E2075 GPIO card, and the TAMS 60622 GPIO cards are supported with the GPIOS driver. The TransEra model 600 card is supported by the GPIO driver under Windows 95 & 98 only..

In addition to the new GUI (Graphics User Interface) look and feel of version 7.1, we have also provided a version of 7.1 that is familiar to users of earlier versions of HTBasic. This executable is installed along with your full GUI version. It is called HTBwin.bak. By renaming this executable to HTBwin2.exe you will have full access to the older look and feel. It contains all fixes and enhancements that the GUI version does except the GUI, and the SEPARATE ALPHA functionality.
At the current time there is limited BASIC Plus support for the 7.1 release. To use BASIC Plus, it is required that you use the Non-GUI version as mentioned in item 3 above.
By default the Program Modified Dialog Box is enabled. To disable this dialog box insert the following line into your AUTOST:
CONTROL KBD,100;0
Future releases of the software will still have this enabled by default, however programmatic program changes will not cause this dialog box to appear.
Changing the printer in the Printer Setup dialog box from within HTBasic will not change the default Windows printer; ISC 10 will remain assigned to your default Windows printer.
LIF utilities (HPCOPY, HPCAT, and HPPURGE) remain non functional under Windows NT/2000. Under DOS, or Windows 3.x, or 95/98 they are fully functional. If you have an NT machine, it is recommended that you either 1) boot to previous version of DOS to perform the necessary transfer; 2) Boot to a DOS boot disk and perform the necessary transfer; or 3) Purchase EZTransfer from AccuMeasure that will allow you to transfer data over the GPIB bus.
Support for the BASIC DDE client has been added. For support and details, see our BASIC DDE Client web pages.

Previous Versions
The major problems that we see with serial communications in HTBasic are the following:
  • Setting Up
  • Configuring
  • Handshaking
SETTING UP:

The most common problem with the setup of the serial drivers is a discrepancy between the parameters given in the LOAD BIN statement, and the actual setup of the computer. Perhaps one of the most confusing things about the LOAD BIN "SERIAL" statement, is that each instance attempts to load two drivers.

By default, specifying LOAD BIN "SERIAL" with no parameters causes HTBasic to attempt to load drivers for COM1 and COM2. The default settings for these are BASE 3F8 INT 4 ISC 9 and BASE 2F8 INT 3 ISC 11, respectively. If these are indeed the settings for COM1 and COM2 HTBasic will attempt to load the serial drivers for both. If the defaults are different, or you need to load drivers for other COM ports, you must specify these options in the LOAD BIN statement. The examples below show how to load drivers for extended ports COM5 and COM6. Note, we assume COM5 is in use by another application.

For DOS: LOAD BIN "SERIAL;DR 1 DISABLE DR 2 BASE 31F INT 3 ISC 20" For Windows�: LOAD BIN "SERIAL;DR 1 DISABLE DR 2 DEVICE COM6" IF each of the following is true. . .
  • The parameters in the LOAD BIN statement match the settings of the COM ports
  • There is no conflict of interrupts with other peripheral hardware
  • No other applications have loaded drivers for the COM ports
  • THEN you should have not trouble loading the HTBasic serial drivers.

INITIAL CONFIGURATION:

Another source of headache with serial communications is caused when the configuration of the PC does not match the configuration of the peripheral component. The common culprits here are the baud rate, the character frame and handshaking. (The latter is explained in the next section).

To save time and trouble, determine the baud rate and character frame (parity, stop bits, etc.) of the peripheral device. Use the CONTROL ISC ,3; Baud statement in HTBasic to set the baud rate to the value Baud for the COM port whose Interface Select Code is the value of ISC.

Use the CONTROL ISC ,4; Frame statement in HTBasic to set the character frame to the value Frame for the COM port whose Interface Select Code is the value of ISC.

If these values match the baud rate and character frame of the peripheral, you will be able to communicate between HTBasic and the peripheral device.


SERIAL HANDSHAKING:

When it comes to serial communications, by far the largest number of question can be traced to the issue of handshaking.

There are two basic forms of handshaking, software and hardware. The main purpose of either of these is to control data flow in relation to the status of the buffer. If the receive buffer on the device or the PC is approaching its limit, handshaking is used to suspend the transmission of data from the other end.

It is very important that you know which kind of handshaking the peripheral device is expecting, and then use the appropriate CONTROL statements to configure HTBasic to use the same kind. The two most important control registers in this regard are 5 and 12. Refer to the USERS GUIDE for further information on the values to write to these registers.

If HTBasic is configured for one kind of handshaking, and the connected device is configured to another, once the receive buffer is filled, HTBasic will appear to hang as it waits for the -buffer to be emptied. During this time, the peripheral device will most likely continue to transmit, and information will be lost.

If you have HTBasic for DOS version 4.3 or above you will find that the PHARLAP.386 file is now included on the distribution diskettes or you can find it in the DOWNLOAD section of our website. In the Legacy Version simply choose to install the DOS version from Windows, and the following steps are done for you. With this new file HTBasic for DOS can be launched from within Windows�. The README.1ST file (also included on the diskettes) contains the following instructions for enabling this feature:

RUNNING UNDER WINDOWS
The following actions are required to run HTBasic under Windows 3.1 or Windows 95.

  1. Copy the PHARLAP.386 file from the HTBasic directory to your windows directory.
  2. Edit your SYSTEM.INI file and add the following line in the [386Enh] section:
    device=pharlap.386
  3. Restart Windows and you are ready to assign an icon to HTBasic for DOS!

Sure! The latest HTBasic versions were built with Windows 95/98 and Windows NT and Windows 2000 in mind. HTBasic for Windows runs under Windows 95/98, Windows NT 4.0 and Windows 2000. Added features for use especially with 32-bit Windows are already included.

For example: Using the CONFIGURE LONGFILENAMES ON command HTBasic is ready to use and display the long filenames supported by 32-bit Windows.

Included with the Windows version of HTBasic is a secondary SERIAL driver, which utilizes the 32 bit serial interface of the new Windows API. By using the following statement to load the SERIAL drivers you are ready to use the "especially for 32-bit"" serial interface: LOAD BIN "SERIAL32"

This is the most common error returned when using the LOAD BIN statement to load HTBasic drivers. Fortunately, the cause of the error is almost always the same: disagreement between driver parameters and actual card settings.

Nine times out of ten , when fielding this call, the answer is found in a discrepancy between the BASE and INT values loaded in the LOAD BIN statement, and the BASE and INT values setup on the card (jumper switches or software settings).

Before you lose any sleep over " Error 167," complete the following checklist:

  1. Determine the base address setting and interrupt setting on the card itself.
  2. Make sure that these values agree with those specified in the LOAD BIN statement.

If the value of the jumper switches on the card were set to a base address of 2B8 and an interrupt of 2, you would need to assure that the LOAD BIN statement agrees. For example:

LOAD BIN "GPIB;BOARD BASE 2B8 INT 2"

Make sure that no other hardware devices in your computer are set to use this same interrupt.

(Note: On most new motherboards, Interrupt 2 is taken by the motherboards. Other major culprits are network cards and video cards)

When storing HTBasic program files in the PROG file type, there is more information in the file than the simple text entered from the HTBasic editor. As a result, information is saved from one session to another in a PROG file, which is not saved with an ASCII file.

From time to time an unexpected instruction will lead to corruption of the expected PROG file type, and it has been know to cause Abnormal Termination, or problems with stack values.

Fortunately, the remedy is simple. To clean up these files, simply LOAD the problematic file using the LOAD" filename" command. Next, SAVE the file to a temporary filename using the HTBasic SAVE" tempfilename" command. Now, use the GET" tempfilename" command to retrieve the file that was just saved in the ASCII format. Finally, use the RE-STORE " filename" command to return the file to a newly built PROG file.

Many people like to use special escape characters to obtain low-level control of the printer configuration. Under the DOS version this was accomplished using an OUTPUT 10,... statement. Under the Windows� version of HTBasic print jobs are sent through the Print Manager which interprets the escape sequences as normal text. For version 5.2 and newer, ISC 26 has been enabled and is a direct route to the parallel port or what ever is mapped to the parallel port. For older versions of HTBasic, the following example demonstrates how to get around this prob

All of the text following a line number should appear on one line.

10 ASSIGN @P TO "LPT1";FORMAT ON
20 OUTPUT @P;CHR$(27)&"E"&CHR$(27)&"%1B"&CHR$(27)&"&l1O"; !Esc Sequences
30 PLOTTER IS "LPT1","HPGL",2,268,0,190
40 MOVE 50,50
50 LABEL "THIS IS A TEST"
60 POLYGON 30,30,30,
70 ! Sets the printer back to regular mode
80 OUTPUT @P;CHR$(27)&"E"&CHR$(27)&"%1A"&CHR$(27)&"&l0O"; !Esc Sequences
90 ASSIGN @P TO *
100 PLOTTER IS CRT,"INTERNAL"
110 END

This example circumvents the problem by sending all output to the special DOS file descriptor "LPT1" rather than via the Windows� Print Manager.

TransEra�s HTBasic has been tested and found Y2K compliant in the following areas:

  1. HTBasic processes date data accurately from, into, and between the twentieth and twenty-first centuries, (including, but not limited to calculating, comparing and sequencing dates).
  2. HTBasic will accurately calculate the Year 2000 as a leap year.
  3. HTBasic is Y2K compliant when used in accordance with its product documentation.
  4. HTBasic is Y2K compliant provided all other products used in combination with HTBasic properly exchange data with it.
  5. TransEra�s hardware (i.e. GPIB and GPIO cards) does not have a BIOS; therefore, all TransEra�s hardware has been tested and is Y2K compliant.

TransEra�s High Tech Basic (HTBasic) is a programming language designed primarily for data acquisition and instrument control. In calculating and storing dates in HTBasic, the actual date is provided by the BIOS. The date is converted to the number of seconds since the start of the Julian Period in 4713 BC. Provided the BIOS is Y2K compliant, HTBasic will remain unaffected by any century changes. The TIMEDATE function in HTBasic does not hold the time/date itself; HTBasic makes system calls to get, or set, the time and/or date directly from the operating system.

Like any other programming language, HTBasic does not prevent a programmer from programming dates incorrectly. Therefore HTBasic is Y2K compliant, but specific programs written with HTBasic may not be.

DOS error 21 results from a combination of mixed mode RAM and older versions of WIN32s, which allows 32-bit applications to run on 16-bit Operating Systems such as Windows 3.x. Version 6.1 has this update included in its install. An update of the Win32s is also available for download from our ftp site on our download page.
Due to increased memory protection in Windows NT and Windows 2000, HTBasic for DOS will not be supported under this Operating System. If you require the use of HTBasic under the NT/2000 OS, it is suggested to use HTBasic for Windows.
In the Windows version of HTBasic, extensive use of the Print manager makes printing simpler and compatible with a wider range of printers. However the print manger currently ignores all Escape characters (commonly used for changing margins, fonts, and adding enhancements directly to your print output). In version 5.2 the addition of ISC 26 was introduced. With this release and all newer releases this ISC provides a direct path to LPT ports. By default this is set to LPT1. This will (Use 26 instead of 10)
In HTBasic for Windows, it is necessary to use 256 colors or less for your Windows color pallet setting. Setting this to higher settings will cause the DUMP GRAPHICS command to not invert, as well, GSTORE and GLOAD commands will give memory overflow errors. If you do not wish to change this setting, 32-bit windows users can use the DirectX enabled version of HTBasic for Windows. This mode will automatically switch your color pallet into 256 color mode when launching HTBasic.

Different revisions of HTBasic have different PROG types. Each PROG type is unique and can only be LOADed by a revision that supports that PROG type. For example I have a file that I STOREd using version 4.1. This file will have a revision 4 PROG type. To open it in a version that supports version 5 PROG types, I must convert the file to ASCII by LOADing it into the older version, then using the SAVE command to save it out. Then I can open the newer version of HTBasic where I use the GET command to bring it into memory.

Then using the STORE command I can store it as a version 5 PROG type. Version 5.0 through version 6.1 for both DOS and Windows are all version 5 PROG types. Typical divisions in PROG type occur with major revision numbers in HTBasic. For example revision 3.x will have a version 3 PROG type. Revision 4 has version 4 PROG type etc.

Many users of HTBasic also possess a spreadsheet program. Those users may find it desirable to use the graphics and analysis capabilities of the spreadsheet program with data from an HTBasic program. This note describes how to write a data file from an HTBasic program and import that data into several popular spreadsheet programs. This note assumes that the reader is familiar with the HTBasic programming language and is somewhat familiar with one or more of the spreadsheet programs discussed.

This note covers the 123 spreadsheet program, version 2.01, from Lotus Corp., the Quattro Pm spreadsheet, version 2.0, from Borland Corp., The Excel spreadsheet, version 2.1, from Microsoft Corp., and the AsEasyAs spreadsheet, version 4.00, from Trius, Inc. The techniques explained here should work with other versions of these spreadsheet programs without much modification, and may also work with spreadsheet programs not considered here.

At the end of the note are examples showing how to graph data produced by an HTBasic program using the graphics capabilities of the spreadsheet programs. This is probably the widest use of spreadsheet programs with HTBasic data.

Creating a Data File in HTBasic Most spreadsheet programs, including all those listed above, can read ASCII files containing numeric data, one row of data per line. If a row contains more than one column of data, the columns are separated by commas. If a field contains non-numeric data, it should be enclosed in quotation marks. This is called comma-separated-value (CSV) format. Many spreadsheet programs can read files with spaces or tabs, instead of commas, separating the column�s, but CSV format seems to be the most universally supported. Although they are not the subject of this note, many database programs can also read data from files in CSV format.

To create a CSV file from an HTBasic program, use the HTBasic CREATE command to create a DOS ASCII file. Put data in the file by opening it using HTBasic ASSIGN command with the FORMAT ON attribute and writing to it using the HTBasic OUTPUT command. This can also be done more simply by using the HTBasic PRINTER IS command to redirect text output from the screen to the file. For example, the HTBasic programs listed below create a file having 37 rows with 2 columns each. The data in the file describes a Lissajous figure. The following example uses the HTBasic ASSIGN command to access the file.

10 INTEGER I
20 DEG
30 CREATE "DATA.CSV",0
40 ASSIGN @Io_path TO "DATA.CSV"; FORMAT ON
50 FOR I=0 TO 360 STEP 10
60 X=COs(REAL(I))
70 Y=SIN(REAL(I*3))
80 OUTPUT @Io_path;X;",";Y
90 NEXT I
100 ASSIGN @Io_path TO *
110 END

The following example creates the same file as the preceding example, but using the PRINTER IS command.

10 INTEGER I
20 DEG
30 CREATE "DATA.CSV",0
40 PRINTER IS "DATA>CSV"
50 FOR I=0 TO 360 STEP 10
60 X=COs(REALI(I))
70 Y=SIN(REAL(I*3))
80 PRINT X;",";Y
90 NEXT I
100 PRINTER IS CRT
110 END

Reading the Data into a Spreadsheet Program 123
To read data from a file in CSV format into 123, run the 123 program. If the data is to be read into an existing worksheet, read that worksheet into the 123 program. Otherwise, use the blank worksheet displayed when the program is run. Using the computer�s arrow keys or a mouse, move the worksheet cursor to the cell that will receive the first data item from the file. Be sure that the area in the worksheet to the right and below the cursor position is empty for at least the number of rows and columns present in the file; any data present in that area of the worksheet will be overwritten by the data from the file. From 123�s main menu, select File, then select Import, then select Numbers (from worksheet mode, type/FIN). When asked for the file name, type the name of the file containing the data generated by the HTBasic program. After you type the name, the data should appear in the portion of the worksheet below and to the right of the cursor.

Excel
To read data in a CSV format file into Excel, run Excel. Using the mouse, select the File menu and select Open in that menu. On the control panel that appears in the center of the screen, type the name of the file, then select OK. The file name must end with the extension .CSV as in the example above; Excel uses the extension to determine the file format. Excel should open a new window and read the data into a new worksheet in that window. The data may be moved to within an existing worksheet using normal Excel commands.

Quattro Pro
Quattro Pro can be operated in a variety of modes. If you are operating Quattro Pro in 123 menu compatibility mode, refer to the instructions for reading data into 123, above. If you are operating Quattro Pro in Quattro mode, follow the instructions below.

Run the Quattro Pro program. If the data from the HTBasic program is to be placed into an existing worksheet, read that worksheet into Quattro Pro. Position the cursor at the row and column that will receive the first data item from the file. The other data items in the file will be placed below and to the right of the cursor position, destroying any data that was already in those cells. From the main menu, select File From the File menu, select Import, then Comma & "" Delimited File. Type the name of the file containing the data generated by the HTBasic program. Press the computer�s Enter key. The data should appear in the spreadsheet at the cursor position.

AsEasyAs
To read data in a CSV format file into AsEasyAs, run AsEasyAs. If the data is to be read into an existing worksheet, read that worksheet into AsEasyAs. Otherwise, use the blank worksheet displayed when AsEasyAs is run. Move the worksheet cursor to the cell that will receive the first data item from the file. Be sure that the area in the worksheet to the right and below the cursor position is empty for at least the number of rows and columns present in the file; any data present in that area of the worksheet will be overwritten by the data from the file. From the main menu, select File, then select Import, then select Values (from worksheet mode, type /FIV). when asked for the file name, type the name of the file containing the data generated by the HTBasic program. After you type the name, the data should appear in the portion of the spreadsheet below and to the right of the cursor.

Graphing Data Produced by an HTBasic Program These examples show how to graph data produced by the HTBasic program using some of the spreadsheet programs discussed in this note.

123
This example uses the data produced by the program segments shown on page 2. The programs produce 37 (x,y) pairs of data that describe a Lissajous figure with three periods in the x direction and one period in the y direction. The program puts this data in a file called DATA.CSV.

Key in one of the HTBasic programs shown on pages 2 and 3. Run the program. After the HTBasic program has created the DATA.CSV file, leave HTBasic. Run 123 by typing "123" at the DOS prompt. A blank worksheet should appear on the computer screen with the cursor at column A1. As outlined in the procedure for reading data into 123, above, type /FIN followed by DATA.CSV. Press the Enter key. The data from the file should appear in columns A and B, rows 1 to 37. Type /GTX to select an X-Y graph. Type X and then A1..A37 and press the Enter key to select cells Al A37 as the x range to graph. Type A and then B1..B37 and press the Enter key to select cells El - B37 as they range of cells to graph. Press the Esc key twice to return to worksheet mode. Press the F1O function key. You should see a graph like the one on the next page.

You may embellish the graph with x and y labels and titles as desired. To print or plot the graph, type /GS and the name of a file in which to save the graph. You can use the PrintGraph program supplied with 123 to print or plot the graph. You can also import the saved graph into a wordprocessor or desktop publishing document.

Excel
This example uses the data produced by the program segments shown on page 2. The programs produce 37 (x,y) pairs of data that describe a Lissajous figure with three periods in the x direction and one period in the y direction. The program puts this data in a file called DATA.CSV.

Key in one of the HTBasic programs shown on pages 2 and 3. Run the program. After the HTBasic program has created the DATA.CSV file, leave HTBasic and run Excel. Select File, then Open, then the file name bar in the window that appears. Delete any default file name found there and type DATA.CSV. Move the mouse cursor to the OK button and click the left mouse button. Excel should read the data and display it in a worksheet, named by default Sheet2. Move the mouse cursor to cell Al in the worksheet. While holding the button down, scroll to cell B87. The cells between cells Al and B37 should be displayed in reverse video. Release the mouse button. From the menu bar, select Edit. From the pulldown menu that appears select Cut. A moving dashed line should surround the cells you have selected. From the menu bar select File. From the pulldown menu that appears select New. Move the mouse cursor to the OK item and click the left mouse button. In the window that appears in the center of the screen select the Chart button. A window containing a graph should appear on top of the worksheet. From the menu bar, select Edit. From the pulldown menu select Paste Special. In the window that appears, be sure the Column button and the Category is in column 1 option are selected. Click the mouse button on the OK item. From the menu bar at the top of the screen, select Chart. From the pulldown menu that appears select Scatter. If your copy of Excel had a default graph of another type, the graph should be redrawn. The graph should be similar to that shown below.

You may embellish the graph with labels and titles as desired, as the one shown above has been. To print the graph, select File from the menu bar and select Print from the pulldown menu that appears. Change any printer options desired. Click the mouse button the the OK item to print the graph. You may also import the graph into any program compatible with the Windows clipboard by selecting the graph and copying it to the clipboard, running the other application, and inserting the clipboard contents into it.

Quattro Pro
This example shows how the independent y axes in Quattro Pro can be used to produce magnitude/phase plots of complex values computed by HTBasic. The example uses the HTBasic program shown below to produce the data for such a graph. The graph is made using Quattro Pro.

10 INTEGER I,J
20 REAL P, Omega,R,L,C
30 COMPLEX Rv
40 DEG
50 READ R,L,C
60 CREATE "COMPLEX.CSV",0
70 PRINTER IS "COMPLEX.CSV"
80 FOR I=3 TO 7
90 FOR J=1 TO 9
100 F=REAL(J)*10.0^I
110 Omega=2.0*PI*F
120 RV=R/CMPLX(R,Omega*L-1.0/(Omega*C))
130 PRINT F;",";20.0*LGT(ABS(RV));",";Arg(RV)
140 NEXT
150 NEXT
160 DATA 1000.0,1.0E-3,1.0E-10
170 END

To try the example, key in the HTBasic program shown above. Run the program. After the HTBasic program has created the DATA.CSV file, run Quattro Pro by typing Q at the DOS prompt. A blank worksheet should appear on the computer screen with the cursor at column A1. As outlined in the procedure for reading data into Quattro Pro, above, type /TIC. Type COMPLEX.CSV in the file name box. Press the Enter key. The data from the file should appear in columns A - C, rows I - 45. Type /CGX to select an X-Y graph. Type SX and then A1..A45 and press the Enter key to select cells Al - A45 as the x range to graph. Type 1 and then B1..B45 and press the Enter key to select cells BI - B45 as the first y range of cells to graph. Type 2 and then C1..C45 and press the Enter key to select cells Cl - C45 as the second y range of cells to graph. Type QCY2SQQ to select the second y axis as that to use with the second series. Type XMLQ to make the x axis logarithmic. Type OGVQ to make the graph have vertical grid lines. Type CMF1L2LQQY2SQQ to make the data be shown as lines. Press the EsC key to return to worksheet mode. Press the F1O function key. You should see a graph similar to the one on the next page.

You may embellish the graph with x and y labels, titles, legends, or other text using the Graph I Text and Graph I Annotate functions. To print or plot the graph, type /RGG.


Copyright 2007 © TransEra Corp.