Frequently asked questions (FAQ)
Porting Considerations (pdf)
Where do I find the Agilent SICL/VISA Software?
Current Version
Driver
|
1. Loading the driver for an Agilent GPIB LAN controller |
|
|
|
|
Make sure that the controller has been configured correctly within the SICL software (Agilent Connection Expert).
After the interface has been configured use the following command in HTBasic:
LOAD BIN "HPIBS;DEV lan[IP Address]:lan0 ISC 7"
lan0 is the device name. Adjust this setting according to your configuration.
The driver for the LAN/GPIB controller can also be laoded through Device Setup. Just add a new "HPIBS" driver and open the properties page. Change the SICL Device Name if needed:
lan[address IP]:lan0
If all settings are correct, load the driver using the "Load" button.
|
| |
|
| | |
|
|
2. How do I load the driver for a GPIB PCMCIA interface? |
|
|
|
|
Make sure that the controller has been configured correctly within the SICL software (Agilent Connection Expert).
When using a National Instruments compatible controller use the following command in HTBasic:
LOAD BIN "GPIBNI;DEV xxxx"
When using an Agilent compatible controller use the following HTBasic command:
LOAD BIN "HPIBS;DEV xxxx"
xxxx is the device name as configured in the driver software of the GPIB hardware manufacturer.
|
| |
|
| | |
|
|
3. What USB devices are supported by the USBS driver? |
|
|
|
|
|
5. How do I configure GPIO interfaces under HTBasic? |
|
|
|
|
Install the Agilent I/O Libraries. Then install the driver software for your GPIO interface, after that shut down the computer and install the GPIO hardware. Write down the Device Name. For example, if you have installed a GPIO interface with the device gpio12, add the following line to your AUTOST file:
LOAD BIN "GPIOS;DEV gpio12 ISC 12"
Now you can immediately output data to your GPIO interface:
OUTPUT 12;Data
You can customize the ISC (Interface Select Code), only make sure that there is no conflict with any exsiting ISC. So you could also use ISC 20 (if available):
LOAD BIN "GPIOS;DEV gpio12 ISC 20"
|
| |
|
| | |
|
|
6. What driver should I use for my GPIB Interface? |
|
|
|
|
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 only supports the TransEra GPIB Interfaces Model 900.
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.
Please note: In case the manufacturer of the GPIB interface emulates the National Instruments GPIB driver structure (GPIB-32.DLL) you do not need to install the National Instrument NI-488.2 software.
|
| |
|
| | |
|
|
7. How do I install an Agilent Agilent GPIB interface? |
|
|
|
|
Use the driver HPIBS for Agilent (or compatible) GPIB interfaces. Make sure that the controller has been configured correctly within the SICL software (Agilent Connection Expert).
After the interface has been configured use the following command in HTBasic:
Load the driver as follows:
LOAD BIN "HPIBS;DEV sicl_name ISC isc TIME timeout"
sicl_name is the Device Name (SICL Interface ID) in the Agilent I/O Libraries / Agilent Connection Expert. Please note that die the Device name is case sensitive.
isc is the Interface Select Code for the device.
timeout is the maximum wait time until a timeout is generated.
Example: LOAD BIN "HPIBS;DEV gpib0 ISC 7"
As soon as the driver has been loaded you can use the interface:
OUTPUT 705;"*IDN?"
ENTER 705;Id$
Please note: You can load the driver within your AUTOST file in order to load it automatically every time HTBasic starts up.
|
| |
|
| | |
|
|
8. How do I install a National Instrument GPIB interface? |
|
|
|
|
Use the driver HPIBS for National Instruments (or compatible) GPIB interfaces.
Make sure that the GPIB interface as well as the drivers are installed correctly.
Load the driver as follows:
LOAD BIN "GPIBNI;DEV card_name ISC isc BUS bus [NOTSYS|SYSTEM]"
card_name is the symbolic Name of the interfaces as configured in the NI Software (default: gpib0).
isc is the Interface Select Code
bus is the address of the board on the GPIB bus (when only one card is used you can omit this value)
NOTSYS is used if the interface should be used device mode
SYSTEM installs the interface as System Controller (default)
Example: LOAD BIN "GPIBNI;DEV gpib0 ISC 7"
As soon as the driver has been loaded you can use the interface:
OUTPUT 705;"*IDN?"
ENTER 705;Id$
Please note: You can load the driver within your AUTOST file in order to load it automatically every time HTBasic starts up.
|
| |
|
| | |
|
|
9. How do I install a GPIO interface from TAMS? |
|
|
|
|
Use the GPIOS driver for HP/Agilent/TAMS GPIO interfaces.
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. Use the IO configuration program (iocfg32.exe) in order to configure the interface. Write down the "Device Name".
Load the driver as follows:
LOAD BIN "GPIOS";DEV name ISC isc"
name is the SICL Name as configured in the I/O Libraries
isc is the Interface Select Code
Example: LOAD BIN "GPIOS;DEV gpio ISC 12"
OUTPUT 12;Data ! Data to send
ENTER 12;Read ! Data to read
Info: You can customize the ISC (Interface Select Code), only make sure that there is no conflict with any exsiting ISC.
|
| |
|
| | |
|
|
10. Is it possible to use more than one GPIB interfaces at once? |
|
|
|
|
HTBasic Version 9.0 and above supports more than one instance of the HPIBS driver.
Example:
LOAD BIN "HPIBS;DEV gpib0 ISC 7"
LOAD BIN "HPIBS;DEV gpib1 ISC 8"
LOAD BIN "HPIBS;DEV gpib3 ISC 13"
In older HTBasic versions you must copy and rename several copies of the HPIBS driver in order to use more than one GPIB interface.
Example:
LOAD BIN "HPIBS;DEV gpib0 ISC 7"
LOAD BIN "HPIBS2;DEV gpib1 ISC 8"
LOAD BIN "HPIBS3;DEV gpib3 ISC 13"
|
| |
|
| | |
|
|
11. What GPIB interfaces are compatible with HTBasic? |
|
|
|
|
The following GPIB interfaces are compatible with HTBasic.
Download: Compatibility list as pdf file Last Update: May 2009
|
|
| Driver for HTBasic Windows 6.x or older
| Driver for HTBasic Windows Release 7.x or higher
| Manufacturer
| Model number
| Bus type
| Win 95/98
| NT4/2000/XP
| Win 95/98
| NT4/2000/XP
| Capital Equipment
| CE-01000-00200
| ISA
| GPIBH
| N/A
| N/A
| N/A
| Capital Equipment
| CE-01000-00300
| ISA
| GPIBN
| N/A
| N/A
| N/A
| Capital Equipment
| PCI-488
| PCI
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Capital Equipment
| 488EX
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Capital Equipment
| PC488
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Capital Equipment
| —
| Microchannel
| GPIBN
| N/A
| N/A
| N/A
| Computer Boards Inc
| PCI-GPIB
| PCI
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Computer Boards Inc
| CPCI-GPIB
| CPCI
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Computer Boards Inc
| ISA-GPIB
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Computer Boards Inc
| ISA-GPIB/LC
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Computer Boards Inc
| PCM-GPIB
| PCMCIA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Computer Boards Inc
| ISA-GPIB-PC2A
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Computer Boards Inc
| PC104-GPIB
| PC104/ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| HP/Agilent
| 82335
| ISA
| GPIBH
| N/A
| N/A
| N/A
| HP/Agilent
| 82350A/B
| PCI
| HPIBS
| HPIBS
| HPIBS
| HPIBS
| HP/Agilent
| 82357A/B
| USB
| HPIBS
| HPIBS
| HPIBS
| HPIBS
| HP/Agilent
| 82340A/B
| ISA
| HPIBS
| HPIBS
| HPIBS
| HPIBS
| HP/Agilent
| 82341A/C
| ISA
| HPIBS
| HPIBS
| HPIBS
| HPIBS
| HP/Agilent
| 82341D
| ISA
| HPIBS
| N/A
| HPIBS
| N/A
| HP/Agilent
| 27209
| ISA
| GPIBH
| N/A
| N/A
| N/A
| HP/Agilent
| 82351A
| PCIe
| HPIBS
| HPIBS
| HPIBS
| HPIBS
| INES
| GPIB-PCIE
| PCIe
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| INES
| GPIB-USB
| USB
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| INES
| GPIB-PC
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| INES
| GPIB-PCI
| PCI
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| INES
| PCMCIA
| PCMCIA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| IOTech
| GP488
| ISA
| GPIBN
| N/A
| GPIBN
| N/A
| IOTech
| GP488A
| ISA
| GPIBN
| N/A
| N/A
| N/A
| IOTech
| Personal 488
| ISA
| GPIBN
| GPIBNI
| GPIBN
| GPIBNI
| IOTech
| Personal 488/MM
| PC/104
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| IOTech
| Personal488/AT
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| IOTech
| Personal488/CARD
| PCMCIA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| IOTech
| Personal488/PCI
| PCI
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| IOTech
| Power 488/NB
| Parallel
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Keithly Metrabyte
| KPC-488.2
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Keithly Metrabyte
| KPC-488.2AT
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Keithly Metrabyte
| KPCI-488
| PCI
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Keithly Metrabyte
| KPCMCIA
| PCMCIA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| Keithly Metrabyte
| KPS-488
| Microchannel
| GPIBNI
| N/A
| GPIBNI
| N/A
| Keithly Metrabyte
| MBC-488
| ISA
| GPIBN
| N/A
| N/A
| N/A
| National Instruments
| AT-GPIB
| ISA
| GPIBN
| N/A
| GPIBN
| N/A
| National Instruments
| AT-GPIB/TNT
| ISA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| National Instruments
| GPIB-1394
| Firewire
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| National Instruments
| GPIB-ENET
| Ethernet
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| National Instruments
| GPIB-PCII/IIA
| ISA
| GPIBNI
| N/A
| GPIBNI
| N/A
| National Instruments
| GPIB-USB
| USB
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| National Instruments
| MC-GPIB
| Microchannel
| GPIBN
| N/A
| N/A
| N/A
| National Instruments
| PC3
| ISA
| GPIBN
| N/A
| N/A
| N/A
| National Instruments
| PCI-GPIB
| PCI
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| National Instruments
| PCI-GPIB+
| PCI
| N/A
| GPIBNI
| N/A
| GPIBNI
| National Instruments
| PCMCIA-GPIB
| PCMCIA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| National Instruments
| PCMCIA-GPIB+
| PCMCIA
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| National Instruments
| PXI-GPIB
| cPCI
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| National Instruments
| PCIe-GPIB
| PCIe
| GPIBNI
| GPIBNI
| GPIBNI
| GPIBNI
| TAMS
| L488
| Ethernet
| HPIBS
| HPIBS
| HPIBS
| HPIBS
| TAMS
| GPIB-PCIe
| PCIe
| HPIBS
| HPIBS
| HPIBS
| HPIBS
| TAMS
| 60488 / 61488
| PCI
| N/A
| HPIBS
| N/A
| HPIBS
| TAMS
| 63488
| USB
| N/A
| HPIBS
| N/A
| HPIBS
| TransEra
| Model 900
| ISA
| GPIB
| HPIBS
| GPIB
| HPIBS / GPIB900
| Ziatech
| ZT-1444
| ISA
| GPIB
| N/A
| N/A
| N/A
| Ziatech
| ZT-1488A
| ISA
| GPIB
| N/A
| N/A
| N/A
| Ziatech
| ZT 8847
| STD
| GPIB
| N/A
| GPIB
| N/A
| Ziatech
| ZT 8848
| STD
| GPIB
| N/A
| GPIB
| N/A
|
|
| |
|
| | |
|
TCP/IP
|
1. Control devices over LAN (TCP/IP) using HTBasic |
|
|
|
|
It is possible to control measurement devices using TCP/IP over LAN.
For this purpose the Agilent SICL I/O library is neccessary. This library comes with a DLL (sicl32.dll) which allows you to communicate to devices over LAN.
The following functions are used:
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"
An example program which shows the communication between HTBasic and an Agilent 16000 Logic Analyzer can be found here.
|
| |
|
| | |
|
Printing
|
1. How to output HPGL- or PCL commands on a network or USB printer |
|
|
|
|
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:
- 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 (attention Windows Vista/7 user: open the command prompt as administrator !)
- At the command prompt type
net use lptx \\machine_name\share_name
and press ENTER
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 \\abc1234\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 DOS or command prompt. 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.
|
| |
|
| | |
|
|
4. How do I change the HPGL line thickness? |
|
|
|
|
|
5. What ISC should I use for my printer? |
|
|
|
|
HTBasic for Windows
ISC 10 defaults to LPT1
ISC 26 defaults to LPT1 or LPT2
HTBasic for DOS
ISC 10 defaults to LPT1
ISC 12 defaults to LPT2
|
| |
|
| | |
|
|
6. How to use a PCL5 printer as HPGL plotter |
|
|
|
|
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.
|
| |
|
| | |
|
|
7. How do I work with more than one printer? |
|
|
|
|
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.
Example: DUMP DEVICE IS 20 ! Select the printer at ISC 20
|
| |
|
| | |
|
Common Questions
|
2. Converting a HP Workstation BDAT file into a HTBasic BDAT file |
|
|
|
|
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.
DIM Oldbdat$[256]
ASSIGN @Oldbdatfile TO "a:\oldbdat.bdat";FORMAT MSB FIRST
ENTER @Oldbdatfile;Oldbdat$
CONFIGURE BDAT LSB FIRST
CREATE BDAT "c:\newbdat.bdat",1
ASSIGN @Newbdatfile TO "c:\newbdat.bdat"
OUTPUT @Newbdatfile;Oldbdat$
ASSIGN @Oldbdatfile TO *
ASSIGN @Newbdatfile TO *
END
|
| |
|
| | |
|
|
3. How can I find the Serial number of HTBasic installed on my PC? |
|
|
|
|
|
4. What is the purpose of the AUTOST program? |
|
|
|
|
|
5. How can I program my Multimeter in ASCII but receive Measurements in Binary? |
|
|
|
|
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 for commands
ASSIGN @I_bin TO 712;FORMAT OFF ! mode binary for answers
OUTPUT @I_asc;"READ?"
ENTER @I_bin;Mesures(*)
|
| |
|
| | |
|
|
6. How can I protect my HTBasic program from being hacked or stolen? |
|
|
|
|
If you store your program code on a workstation there is always the risk that people change your program code or even sell your application or re-use parts of your intellectual property.
There are several possibilies to protect your source code:
1. Use the runtime version on all workstations
2. Use the SECURE command before you distribute your application
3. Use SUBs and compile these SUBs using the Numeric Compiler
4. Use external DLLs for critical functions
5. Use the Secure Library for HTBasic (USB dongle library)
|
| |
|
| | |
|
|
7. Double clicking on a .prg or .bas file does not launch the file in HTBasic |
|
|
|
|
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:
1. Go to My Computer, click Tools, then Folder Options, File Types
2. Locate the .prg or .bas file extension in the list of Registered File Types and highlight it by single clicking your selection
3. Click advanced, then edit.
4. 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.
5. Simply change the line so that %1 is in quotes.
The final product should read C:\Program Files\HTBwin95\HTBwin.exe -alt "%1"
|
| |
|
| | |
|
DLL Toolkit
|
1. 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. To download this file click here
|
| |
|
| | |
|
|
2. How can I get System Information from HTBasic? |
|
|
|
|
All the system information is available through different DLL Functions. The difficulty 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
|
| |
|
| | |
|
|
3. Can I send an e-mail from HTBasic? |
|
|
|
|
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.
Example:
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
|
| |
|
| | |
|
Version 8.0
|