Summary of Contents for Keysight Technologies 75000 C Series
Page 1
75000 Series C User Manual Keysight E1406A Command Module, Using Instrument BASIC...
Page 3
WITHOUT NOTICE, IN FUTURE EDI- without prior agreement and written con- www.keysight.com/find/E1406A TIONS. FURTHER, TO THE MAXIMUM sent from Keysight Technologies, Inc. as EXTENT PERMITTED BY APPLICABLE (product-specific information and sup- governed by United States and interna- LAW, KEYSIGHT DISCLAIMS ALL WAR- port, software and documentation tional copyright laws.
Page 6
If necessary, return instrument chassis and cover must be safe operating conditions, modules the product to a Keysight Technologies connected to an electrical ground to should not be operated beyond the full Sales and Service Office for service and minimize shock hazard.
Page 7
Safety Symbols A CAUTION denotes a hazard. It calls attention to an operating pro- cedure or practice, that, if not cor- rectly performed or adhered to could result in damage to the product or loss of important data. Do not proceed beyond a CAUTION notice until the indicated condi- tions are fully understood and met.
Page 9
Keysight 75000 Series C Documentation Suggested Sequence for Using the Manuals C-Size VXIbus Systems Installation and Getting Started Guide. Contains step-by-step instructions for all aspects of plug-in module and mainframe installation. Keysight E1406A Command Module User’s Manual. Contains information on downloading user tables to modify (if necessary) configurations set up using the Installation and Getting Started Guide, information on using an RS-232 terminal as a “front panel”...
Page 10
Common Commands. Available from: The Institute of Electrical and Electronic Engineers, Inc.; 345 East 47th Street; New York, NY 10017; U.S.A . VXIbus System Specifications. Available from Keysight Technologies. The VMEbus Specification. Available from: VMEbus International Trade Association; 10229 N. Scottsdale Road, Suite E; Scottsdale, AZ 85253; U.S.A.
Page 11
About this Manual Keysight 75000 Series C Documentation About this Manual Manual Content This manual contains information on the use of IBASIC as implemented in the Keysight E1405/E1406 Command Modules. The manual is part of a manual set that includes the C-Size VXIbus Systems “Installation and Getting Started Guide” and various plug-in module user’s manuals.
Page 12
Keysight 75000 Series C Documentation About this Manual Chapter 7: System Instrument Command Reference The command reference contains a detailed description of Command Module commands which are active when you are using the System instrument. It includes information on the choice of settings and examples showing the context in which the command is used.
Page 13
Contents 1 Keysight 75000 Series C Documentation Suggested Sequence for Using the Manuals ......xi Related Documents .
Page 14
Copying Lines (By Changing Line Numbers) ......52 More Details about Edit Mode ........52 A Closer Look at Listing a Program .
Page 15
Copying Files ..........86 Copying an Entire Volume .
Page 16
Example: Making DCV Measurement with GPIB Device ....111 Controlling RS-232/422 Peripherals ....... . 113 Assigning the RS-232/422 Interface .
Page 17
Synchronization Using IBASIC Computer ......156 Synchronization Using *OPC? ........158 Synchronization Using *OPC .
Page 18
Requesting an Instrument ........183 Arbitrating an Assignment Request .
Page 23
Using Keysight Instrument BASIC with the E1406A Getting Started Using This Chapter This chapter presents the basics of how to get started using IBASIC. You should be familiar with the operation of your C-Size mainframe, Command Module, and any instrument modules you will be using. This chapter contains the following sections: Selecting IBASIC Mode of Operation page 33...
Page 24
Getting Started Selecting IBASIC Mode of Operation Table 1-1 System Controller vs. Talk/Listen Mode Operations Function System Controller Mode Talk/Listen Mode Create/Edit IBASIC Use RS-232 Terminal Same as System Controller mode Programs Use Terminal Emulator Use RAM Disks Use DOS and LIF file systems Same as System Controller mode Use ASCII, BDAT, and DOS/HP-UX files Store programs/data to RAM volumes...
Page 25
Selecting IBASIC Mode of Operation Getting Started Figure 1-1 System Controller Mode Operation Creating/Editing IBASIC Programs In System Controller mode, you can create/edit IBASIC programs with an RS-232 computer or supported terminal and GET/SAVE program files. To create and edit IBASIC programs, you can access the IBASIC computer from a supported terminal, or from an RS-232 computer acting in terminal emulator mode.
Page 26
Getting Started Selecting IBASIC Mode of Operation volatile, while RAM VOLs 0 and 2 through 16 can be volatile only. The IBASIC computer can create DOS or LIF file systems and can use ASCII, BDAT, or DOS/HP-UX files. Controlling Instruments/ Devices/ Peripherals In System Controller mode, you can control the System instrument, plug-in module instruments, and the IBASIC instrument using the IBASIC computer via the IBASIC interface or using the front panel or supported terminal via the User...
Page 27
Selecting IBASIC Mode of Operation Getting Started Figure 1-2 Talk/Listen Mode of Operation Creating/Editing IBASIC Programs In Talk/Listen mode, you can create/edit IBASIC programs with an RS-232 computer or supported terminal and GET/SAVE program files. To create and edit IBASIC programs, you can access the IBASIC computer via from a supported terminal, or from an RS-232 computer acting as a terminal emulator.
Page 28
Getting Started Selecting IBASIC Mode of Operation Using Mass Storage Devices In Talk/Listen Mode, you can save programs and data to IBASIC memory or to RAM volumes on the RAM disk. You can create up to 16 RAM volumes (RAM VOLs).
Page 29
Setting IBASIC Mode of Operation Getting Started Setting IBASIC Mode of Operation SHOCK HAZARD. Only service-trained personnel who are aware of the hazards involved should install, remove, or configure the system. Before you removing or installing a plug-in module, disconnect AC power and field wiring from the mainframe.
Page 30
Getting Started Setting IBASIC Mode of Operation Keysight E1406A Instrument BASIC...
Page 31
Using Keysight Instrument BASIC with the E1406A Creating and Editing Programs Using this Chapter This chapter shows you how to create and edit programs using a remote RS-232 terminal or terminal emulator. General IBASIC editing information is also in this chapter.
Page 32
Creating and Editing Programs Using a Terminal Using a Terminal From a remote RS-232 terminal (or computer with terminal emulator), you can execute IBASIC commands, develop and debug programs, and interact with running programs. Programs can be edited with IBASIC’s full screen editor. Refer to the Mainframe User’s Manual for information on supported terminals and how to connect a terminal to the mainframe.
Page 33
Using a Terminal Creating and Editing Programs IBASIC Display After selecting the IBASIC instrument, you should see a display similar to this (the display contents are explained below): Instrument Name/Logical Address: Means you are using the IBASIC instrument. This line does not scroll off the display. PRINT/OUTPUT 2 Messages: These 18 or 19 lines display PRINT or OUTPUT 2 messages.
Page 34
Creating and Editing Programs Using a Terminal – Input?: IBASIC is waiting for you to respond to an INPUT command. – Idle: No program activity (none of the above operations). As with the front panel, when you select another instrument and then re-select IBASIC, the state of IBASIC will be the same as it was when last selected.
Page 35
Using a Terminal Creating and Editing Programs CLR_INST Clears the user interface input and output buffers for IBASIC (remote buffers are not cleared) and returns to the IBASIC instrument display (IBASIC_240: _). Press CLR_INST whenever IBASIC is busy (except during power-on/reset sequence), is not responding, or to abort a command being entered from the terminal.
Page 36
Creating and Editing Programs Using a Terminal Recall Prev = CTRL F Back Space = CTRL H Delete Char = CTRL X Recall Next = CTRL B Clear-to-End = CTRL L Insert Line = CTRL O Clear Line = CTRL U Run = CTRL G Pause = CTRL P Cont = CTRL Y...
Page 37
Using a Terminal Creating and Editing Programs At this point, you can begin entering program lines. Entering Program Lines To enter a program line, just type the IBASIC command characters at the keyboard. If you make any errors while typing, use the Back Space key or the left and right arrow keys to move the cursor to the erroneous character(s) and re-type them.
Page 38
Creating and Editing Programs Using a Terminal For example, you can type-in the following program pressing Enter after each line: After entering the last line of the program, press EXIT to exit Edit mode. To execute the program, either press UTILS - RUN or type RUN and press Enter. There are many ways to exit Edit Mode.
Page 39
Using a Terminal Creating and Editing Programs Inserting Lines Lines can be easily inserted into a program. As an example, assume that you want to insert a line between line 20 and line 30 in the existing program. In Edit Mode (type EDIT, press Enter), use the up or down arrow key to place the cursor on line 30 and press the INS_LN key.
Page 40
Creating and Editing Programs Using a Terminal Deleting and Recalling Lines Lines can be deleted one at a time or in blocks. In Edit Mode, pressing f2 (DEL_LN) deletes the line with the cursor on it. For example, to delete line 21, use the up/down arrows to move the cursor to line 21.
Page 41
Editing in IBASIC Creating and Editing Programs Editing in IBASIC This section introduces you to some general concepts and skills involved in creating and editing IBASIC programs. Automatic Syntax Checking Before storing a program line, the IBASIC computer checks for syntax errors and also changes the letter-case of keywords and identifiers.
Page 42
Creating and Editing Programs Editing in IBASIC identifier name. For example, change CAT to Cat or cAT and then press Enter again. A word containing a mixture of upper- and lower-case letters is assumed to be an identifier. The system’s assumptions about keywords versus identifiers won’t cause problems if the line has the proper syntax.
Page 43
Editing in IBASIC Creating and Editing Programs The line identifier also can be a line label. This makes it very easy to find a specific program segment without needing to remember its line number. For example, assume that you want to edit a sorting routine that begins with a line labeled Resort:.
Page 44
Creating and Editing Programs Editing in IBASIC The parameter 701 identifies the printer connected to the mainframe’s GPIB interface (select code 7). The printer itself has an address setting of 01. To designate the front panel or terminal display as the system printer, execute: PRINTER IS 1 You can also specify the printer in the LIST statement.
Page 45
Editing in IBASIC Creating and Editing Programs The first number or label identifies the start of the block to be deleted. The second number or label identifies the end of the block to be deleted. The line identifiers must appear in the same order they do in the program. For example, the following command deletes lines 100 through 200, inclusively.
Page 46
Creating and Editing Programs Editing in IBASIC 140 X=X+D 150 Y=Y+E 160 DISP "tax =";D;"item cost =";E 170 WAIT 5 180 PRINT P,X,Y 190 GOTO 100 200 END The second version uses the features of Keysight’s IBASIC language to make the program more easily understood.
Page 47
Editing in IBASIC Creating and Editing Programs 260 INPUT "input item price",Price 270 Tax=Price*Tax_rate 280 Item_cost=Price+Tax 290 Total_tax=Total_tax+Tax !Accumulate totals 300 Total_cost=Total_cost+Item_cost 310 DISP "Tax =";Tax;"Item cost =";Item_cost 320 WAIT 5 330 PRINT Price,Total_tax,Total_cost 340 END LOOP !Repeat loop for next item 350 END Commenting Methods There are two methods for including comments in your programs.
Page 48
Creating and Editing Programs Editing in IBASIC IBASIC vs. HP Series 200/300 Editing Differences IBASIC Edit Mode is similar to that used on HP Series 200/300 BASIC language computers. However, there are some differences. If you are familiar with the Series 200/300 computers you will want to note the following IBASIC Edit Mode differences.
Page 49
Securing Programs Creating and Editing Programs Securing Programs With the IBASIC system, you can use the SECURE statement to prevent program line(s) from being edited or listed. Once a program is secured, it cannot be unsecured. Therefore, you should keep an unsecured back-up copy of all programs. Executing this command prevents lines 30 through 60 of an existing program from being edited or listed: SECURE 30, 60...
Page 51
Using Keysight Instrument BASIC with the E1406A Using RAM Volumes How to Use This Chapter You can create from 1 to 16 RAM volumes in system memory and an additional RAM volume in USER NRAM or optional plug-in memory. Like volumes on a disk drive, RAM volumes are used for storing programs and data.
Page 52
Using RAM Volumes RAM Volumes On volatile RAM volumes (including RAM Volume 1 if it is volatile) and RAM Volume 16, no checksum is saved. The access to volatile RAM is done at the fastest possible speed with a minimum of overhead. Read/write operations on RAM Volume 1 is about 20% slower when in non-volatile memory vs.
Page 53
RAM Volumes Using RAM Volumes Softloaded Instrument Drivers, User Nonvolatile RAM (NRAM), and RAM Volume 1 compete for the nonvolatile memory space. This means that changing a memory area invalidates the memory area(s) above it as shown in Figure 3-1. The order in which memory is allocated is very important.
Page 54
Using RAM Volumes RAM Volumes Procedure 1 Allocate space in Nonvolatile User RAM (NRAM) by executing DIAG:NRAM:CRE<#bytes> from the System Instrument (this destroys any existing data in NRAM). 2 Re-Boot the system by executing DIAG:BOOT from the System Instrument or by cycling mainframe power.
Page 55
RAM Volumes Using RAM Volumes From the System Instrument, execute: DIAG:NRAM:ADDR? Determine starting address for NRAM (in this example, starting address = +16252928) From the IBASIC Instrument, execute: OUTPUT 80930;"DIAG:FILES 1,16252928" Define starting address for RAM Volume OUTPUT 80930;"DIAG:FILES 2,16267928" Define ending point for RAM Volume (start address + #bytes) INITIALIZE "DOS:MEMORY,0,16"...
Page 56
Using RAM Volumes RAM Volumes INITIALIZE "LIF:MEMORY,0,1",<n> Initialize RAM Volume 1 in LIF format INITIALIZE "DOS:MEMORY,0,1",<n> Initialize RAM Volume 1 in DOS format Where: <n> = number of 256-byte sectors; 6 sectors minimum for LIF; 10 sectors minimum for DOS. If you do not specify a size, the default size is the size of reserved memory determined by INT [(size of RDISK - 24) / 258].
Page 57
RAM Volumes Using RAM Volumes INITIALIZE "DOS:MEMORY,0,0",<n> Initialize volume 0 in DOS format Where: <n> = number of 256-byte sectors; 6 sectors minimum for LIF, 10 sectors minimum for DOS. If you do not specify <n>, the default size is1056 sectors.
Page 58
Using RAM Volumes RAM Volumes Checking a Volume’s Format You can determine whether or not a disk or RAM volume is initialized and the type of format (DOS or LIF) by cataloging the disk volume with the CAT command. The CAT command returns the contents of a mass storage volume (LIF format) or volume/directory (DOS format).
Page 59
RAM Volumes Using RAM Volumes For a flexible disk or the hard disk, if the disk or disk volume has not been initialized, "ERROR 85 Media uninitialized" occurs. If a RAM Volume has not been initialized, "ERROR 76 Incorrect unit code in msvs" occurs.
Page 60
Using RAM Volumes In Case of Difficulty In Case of Difficulty Mass Storage Error Message Cause Error 52 Improper mass storage volume The characters used for mass storage volume specified do not form a valid specifier. specifier. This could be a missing colon, too many parameters, illegal characters, etc.
Page 61
In Case of Difficulty Using RAM Volumes Error 68 Syntax error occurred during GET. One or more lines in the file could not be stored as valid program lines. (These lines will be stored as commented lines.) Also occurs if the first line in the file does not start with a valid line number.
Page 62
Using RAM Volumes In Case of Difficulty Error 294 Wild card matches >1 item. A wild card operating in File Name Completion mode expanded to more than one file name. Error 295 Improper destination type. Multiple files must be copied to directory not file. Error 296 Unable to overwrite file.
Page 63
Using Keysight Instrument BASIC with the E1406A Mass Storage Concepts How to Use This Chapter In System Controller Mode, IBASIC can access RAM volumes and external SS-80 disk and tape drives. In Talk/Listen Mode, IBASIC can access Ram Volumes only. This chapter describes how to use these mass storage devices, discusses the LIF and DOS file systems, and shows you how to manage files in either system.
Page 64
Mass Storage Concepts File Systems File Systems IBASIC supports both LIF (HP’s Logical Interchange Format) and MS-DOS file systems. The LIF file system is identical to that used by HP Series 200/300 BASIC language computers. LIF is a flat file system, that is, it cannot support subdirectories.
Page 65
File Systems Mass Storage Concepts LIF File Structure If the volume was formatted in LIF, each drawer of the file cabinet contains a large folder that represents the LIF directory. This directory holds the names and contents of all files on the volume. A file can be either an IBASIC program file or a data file (voltmeter readings, for example).
Page 66
Mass Storage Concepts File Systems Figure 4-3 DOS File Structure Specifying the Directory, File, and Volume Files are identified by specifying the following information: – The directory path where the file resides (DOS format only) – The file name – The mass storage volume specifier (MSVS) The syntax of the file specifier is: To access a directory or file, you must specify its location in the hierarchical directory structure.
Page 67
File Systems Mass Storage Concepts path with a backslash (\) to indicate the root directory. You then list every directory in the path, in hierarchical order, and separate directory names and file names with a backslash. (You can also use forward slashes (/) to separate names.) Figure 4-4 shows a typical directory path from the root to the file "PROG_A"...
Page 68
Mass Storage Concepts File Systems Figure 4-5 Path from USERS Directory LIF File Names A LIF file name can be up to 10 characters long and is case dependent. For example the file names "File1", "FILE1", "file1" and "FiLe1" represent different files.
Page 69
File Systems Mass Storage Concepts DOS File Names A DOS file name can be up to 8 characters long with an optional extension name of up to 3 characters. A period "." separates the file name from the extension. For example: DOS file names are case independent.
Page 70
Mass Storage Concepts File Systems The GPIB Address is the GPIB address of the disk drives. The first digit (left-most) specifies the GPIB interface (typically 7). The last two digits specify the GPIB address setting of the disk drives. In the above example, the interface address is 7 and the disk drive address is 00, resulting in a combined address of 700.
Page 71
File Systems Mass Storage Concepts MSI "\PROGRAMS\VOLTMET" If the default volume is already 700,0,1 After re-booting the mainframe (cycling power or DIAG:BOOT), the default MSI is set to the mass storage device where an autostart program was found (see Autostarting Programs, later in this chapter).
Page 72
Mass Storage Concepts File Systems MSI "\PROGRAMS\VOLTMET:,700,0,1" Sets current directory path to Programs\Voltmet. Sets default drive/volume to hard disk, volume 1. Catalogs current directory on default drive and volume MSI "\:,700,0,1" Returns current directory path to root. Sets default drive/volume to hard disk, volume 1.
Page 73
Managing Files Mass Storage Concepts Managing Files This section describes how to manage files (SAVE, GET, COPY etc.) in both the LIF and DOS file systems. Creating Directories You can create subdirectories on a DOS formatted disk or RAM volume using the CREATE DIR command.
Page 74
Mass Storage Concepts Managing Files Saving Programs You can write a program to a mass storage device using the SAVE command. The SAVE command creates an ASCII file (LIF) or DOS/HP-UX file (DOS) (these file types are discussed later in this chapter) and copies program lines into that file. The following examples show how to save the program "TEST"...
Page 75
Managing Files Mass Storage Concepts the same file. (If the file does not already exist, RE-SAVE behaves like the SAVE command and creates the file for the program.) The following examples show how to RE-SAVE the program "TEST" to the various mass storage devices. LIF Examples MSI ":,700,0,0"...
Page 76
Mass Storage Concepts Managing Files IBASIC computer’s memory and retrieves the specified program. By adding line numbers to the GET command, you can append program lines to an existing program and/or run the program at a specified line. Refer to Keysight Instrument BASIC Programming Techniques manual for more information on appending and running programs with GET.
Page 77
Managing Files Mass Storage Concepts must be different from the existing file name (if it is in the same directory). You can copy DOS files to LIF volumes and vice versa. Refer to "Copy to/from DOS and LIF" later in this chapter for more information. LIF Examples MSI ":,700,0,0"...
Page 78
Mass Storage Concepts Managing Files Copying an Entire Volume The COPY command also allows you to copy the entire contents of a mass storage volume to another volume. You cannot copy a larger volume to a smaller volume. You can copy a smaller volume to a larger volume, however the size of the larger volume will be reduced to the size of the smaller volume.
Page 79
Managing Files Mass Storage Concepts Purging Files You can erase a file with the PURGE command. Purging a file deletes the directory entry for the file and releases the space reserved for the file. For example, the following command removes the file "CHTRY" from the current default volume: PURGE "CHTRY"...
Page 80
Mass Storage Concepts Managing Files Always test a program before saving it as "AUTOST". It is possible to create a corrupt autostart program (on RAM volume 1 or the hard disk) that may lock-up the mainframe whenever it is re-booted. If you have a flexible disk, you can recover from this situation by inserting a flexible disk containing a functional autostart file.
Page 81
Managing Files Mass Storage Concepts To save this program as an autostart program, execute one of these commands: SAVE "AUTOST:,700,0,0" Save autostart file on hard disk volume 0 SAVE "AUTOST:,700,1" Save autostart file on flexible disk SAVE "AUTOST:,MEMORY,1" Save autostart file on RAM volume 1 Now, when the system is re-booted, IBASIC will capture the display, get and run the AUTOST file, and display "This is an autostart test".
Page 82
Mass Storage Concepts IBASIC File Types IBASIC File Types The IBASIC file system supports four different file types: ASCII, BDAT, DIR and DOS/HP-UX. ASCII Files ASCII files are stored on the disk as a series of variable length records. Each record consists of a 16-bit word followed by the number of bytes designated in the length word.
Page 83
IBASIC File Types Mass Storage Concepts DOS/HP-UX Files DOS and HP-UX files are identical file types. DOS/HP-UX type files are created with the command: CREATE "<filename>",size Where size is the number of bytes needed for the file. The record length for a DOS/HP-UX file is 1 thus the number of bytes is the same as the number of 1 byte records.
Page 84
Mass Storage Concepts Using Wild Cards Using Wild Cards The wild card characters allow you to use one command to perform operations on a number of files or to "complete the name" of file names you may be unsure The wild card characters are an asterisk "*" and a question mark "?". When wild cards are enabled, the "*"...
Page 85
Using Wild Cards Mass Storage Concepts IBASIC Commands that use Wild Cards Wild cards operate in either the multiple name expansion mode or name completion mode. The mode used depends on the command being executed. Multiple Name Expansion Mode The CAT and PURGE commands operate in multiple name expansion mode. This means the wild card name expands to as many names as can be matched.
Page 86
Mass Storage Concepts Using Wild Cards PURGE "\PROGRAMS\VOLTS.*:,700,0,1" PURGEs all files named VOLTS (with any extension) in the PROGRAMS directory on volume 1 of hard disk. PURGE "\PROGRAMS\*.CAP:,700,0,1" PURGEs all files with CAP extension in the PROGRAMS directory on volume 1 of hard disk. PURGE "\PROGRAMS\*.*:,700,0,1"...
Page 87
Using Wild Cards Mass Storage Concepts Commands that do not use Wild Cards The CREATE, INITIALIZE, and SAVE commands do not allow wild cards ("ERROR 292 Wildcards not allowed" is generated). Wild ards and the COPY Command The COPY command operates in multiple name expansion mode on the first parameter and name completion mode on the second.
Page 88
Mass Storage Concepts Behavior Differences between LIF and DOS File Systems Behavior Differences between LIF and DOS File Systems Several file system operations in IBASIC behave differently depending on whether the target disk is a LIF or a DOS disk. The purpose for this is to simplify moving files between IBASIC and either a DOS or HP Series 200/300 computer.
Page 89
Behavior Differences between LIF and DOS File Systems Mass Storage Concepts – When a program is re-saved to an existing file, the original file type is retained. – When a program is re-saved to a DOS/HP-UX file on a LIF disk, carriage-returns are removed automatically and only the line-feed portion of the line terminator is saved.
Page 90
Mass Storage Concepts Behavior Differences between LIF and DOS File Systems When using a LIF disk, you must specify adequate size when creating DOS/HP-UX files since the file cannot be expanded later. Keysight E1406A Instrument BASIC...
Page 91
Using Keysight Instrument BASIC with the E1406A System Controller Mode Operation Using This Chapter This chapter shows how to use the IBASIC computer in System Controller mode – Control instruments and external GPIB devices – Control external RS-232/422 peripherals – Store/retrieve data to disks and memory –...
Page 92
System Controller Mode Operation System Controller Mode Overview For System Controller mode only, IBASIC computer communicates with external GPIB devices via the GPIB interface. For interface select code 7, use OUTPUT 7ppss to send commands to a device and ENTER 7ppss to return data from the device, where pp = device primary address and ss = secondary address.
Page 93
Controlling Instruments/GPIB Devices System Controller Mode Operation Controlling RS-232/422 Peripherals Control external RS-232 and RS-422 peripherals with the IBASIC computer via the serial interfaces. Up to seven Keysight E1324A plug-in modules can be installed in an Keysight C-size mainframe. When the RS-232/422 ports on an Keysight E1324A plug-in module are assigned to IBASIC, use OUTPUT 21;...
Page 94
System Controller Mode Operation Controlling Instruments/GPIB Devices You can also use the READIO and WRITEIO commands which allow for more flexibility in controlling instruments/devices with the IBASIC computer. See the READIO and WRITEIO commands in Chapter 7 - IBASIC Command Reference for information on these commands.
Page 95
Controlling Instruments/GPIB Devices System Controller Mode Operation Figure 5-2 Controlling Instruments/GPIB Devices IBASIC Interface Commands The IBASIC interface connects the IBASIC computer to internal instruments in the Keysight C-size mainframe. The IBASIC interface is very similar to the GPIB interface as supported by IBASIC, except PASS CONTROL is not used by the IBASIC interface.
Page 96
System Controller Mode Operation Controlling Instruments/GPIB Devices GPIB/IBASIC Interface Command Comparisons The following table summarizes the interface commands used for the GPIB and IBASIC interface, assuming an interface select code of 7 for the GPIB interface. In the table, pp = the external GPIB device primary address, and ss = the internal instrument or GPIB device secondary address.
Page 97
Controlling Instruments/GPIB Devices System Controller Mode Operation Table 2 Summary of GPIB/IBASIC Interface Commands TRIGGER TRIGGER 7 sends Trigger message TRIGGER 8 sends Trigger message TRIGGER 16 is not allowed. to all addressed GPIB devices. to all addressed instruments. TRIGGER 16[XX]XX sends a word TRIGGER 7ppss sends a trigger TRIGGER 809ss sends a trigger serial trigger message to the...
Page 98
System Controller Mode Operation Controlling Instruments/GPIB Devices Example: Setting Remote State (REMOTE) REMOTE 80901 Sets instrument at secondary address 01 to REMOTE state REMOTE 722 For System Controller mode only, sets GPIB device at address 722 to REMOTE state Communicating with Instruments For System Controller mode (and Talk/Listen mode), the IBASIC computer communicates with internal instruments via the IBASIC interface (interface select code 8) (see Figure 5-2).
Page 99
Controlling Instruments/GPIB Devices System Controller Mode Operation See the appropriate Plug-In Module User’s Manual for typical programs to control plug-in module instruments. To use the examples in those manuals for the IBASIC computer, change the instrument address from 709ss to 809ss. Otherwise, the listed programs can be used as shown for the IBASIC computer.
Page 100
System Controller Mode Operation Controlling Instruments/GPIB Devices OUTPUT @E1410;"MEAS:VOLT:DC?" Make DCV measurement and query result ENTER @E1410;Volts Enter result PRINT "E1410A Voltage = ";Volts Display results A typical result is: E1410A Voltage = 1.254377 The same program could be used with Select Code 16 by changing line 10 to "10 ASSIGN @E1410 TO 1624"...
Page 101
Controlling Instruments/GPIB Devices System Controller Mode Operation Therefore, if the *WAI command is used on the IBASIC instrument (as would be the case for a register-based instrument to wait for command completion), sending a command to IBASIC will terminate very quickly. This occurs since the IBASIC computer begins executing the command (is running) separately from the IBASIC instrument that issued the command.
Page 102
System Controller Mode Operation Controlling Instruments/GPIB Devices OUTPUT @Hp3457;"DCV" Make Keysight 3457A voltage measurement ENTER @Hp3457;A Enter Keysight 3457A measurement PRINT "3457A Voltage = ";A Display Keysight 3457A measurement A typical return is: Keysight 3457A Voltage = 1.234674 Keysight E1406A Instrument BASIC...
Page 103
Controlling RS-232/422 Peripherals System Controller Mode Operation Controlling RS-232/422 Peripherals In System Controller mode (and in Talk/Listen mode), the IBASIC computer can control external RS-232C or RS422 peripherals via an RS-232 or RS-422 interface on an Keysight E1324A Data Communications module (interface select codes 21 through 27) (see Figure 5-4).
Page 104
System Controller Mode Operation Controlling RS-232/422 Peripherals Assigning the Built-In Interface The default assignment for the built-in RS-232 interface is the User Interface (display system). Since there is no other means of controlling the IBASIC computer unless a terminal is assigned to a Keysight E1324A serial interface, this serial interface should not be used to control other devices.
Page 105
Controlling RS-232/422 Peripherals System Controller Mode Operation To enable the new Keysight E1324A port assignments, you must cycle mainframe power after setting the LADD switches. The LADD settings must be sequential starting with 241 (241, 242,...,247). Other LADD combinations, such as 241, 243, ... will result in one or more modules not being assigned to IBASIC.
Page 106
System Controller Mode Operation Controlling RS-232/422 Peripherals OUTPUT Ib;"SYST:COMM:SER1:PACE XON" Enable XON/XOFF pacing OUTPUT Ib;"SYST:COMM:SER1:PACE THR:STOP 6144" Set XOFF threshold for 80 characters OUTPUT Ib;"SYST:COMM:SER1:PACE THR:STAR 2048" Set XON threshold for 20 characters OUTPUT Ib;"SYST:COMM:SER1:CONT:DTR ON" Set DTR control line ON OUTPUT Ib;"SYST:COMM:SER1:CONT:RTS ON"...
Page 107
Controlling RS-232/422 Peripherals System Controller Mode Operation Serial Interface Examples The following example programs demonstrate several ways to use an RS-232 serial interface on an Keysight E1324A plug-in module. These examples assume that an RS-232 terminal is attached to the RS-232 port. This program demonstrates line oriented ENTER and OUTPUT operations on a serial port.
Page 108
System Controller Mode Operation Controlling RS-232/422 Peripherals OUTPUT Serial;"Enter a line terminated with LF (CNTL-J):" ENTER Serial;Line$ ! Echo the response to the terminal OUTPUT Serial USING "K,X,DDD,3(K)";"Line",I,": ’",Line$,"’" ! Continue to LOOP until an error or BREAK is detected I=I+1 ! increment the line count END LOOP...
Page 109
Controlling RS-232/422 Peripherals System Controller Mode Operation ! character at a time with ENTER and USING. ! The program will wait in the ENTER for a character to ! be typed on the terminal. Then it will display the ! character (if it is printable) and the numeric value ! of the received character on the terminal.
Page 110
System Controller Mode Operation Controlling RS-232/422 Peripherals This program demonstrates the use of READIO and WRITEIO on the serial interface with ON CYCLE to allow non-blocking I/O. The program will not wait in an I/O statement if no characters are available, but will return to the main program and continue processing.
Page 111
Controlling RS-232/422 Peripherals System Controller Mode Operation ! variable is set which tells the main program to terminate. ! Read serial interface status and mask off all but the error bits Status=BINAND(READIO(Serial,3),DVAL("FC0",16)) IF Status THEN OUTPUT Serial;"" OUTPUT Serial;"Serial card error detected:" OUTPUT Serial;"...
Page 112
System Controller Mode Operation Storing/Retrieving Data Storing/Retrieving Data This section gives guidelines to store and retrieve data collected from internal instruments, GPIB devices, or RS-232/422 peripherals into IBASIC memory or into mass storage devices (external SS-80 disk or tape drives or RAM volumes). See Chapter 4 - Managing IBASIC Files for information about IBASIC file types.
Page 113
Storing/Retrieving Data System Controller Mode Operation Steps to Store Data There are seven main steps to store data in data files on a disk drive, or in volatile and nonvolatile RAM volumes on the RAM disk (see Figure 5-6): (1) Define a file/array in the IBASIC computer (2) Specify the default mass storage device (3) Create a data file on the mass storage device (4) Assign an I/O path name to the data file...
Page 114
System Controller Mode Operation Storing/Retrieving Data The following table summarizes typical commands to store data from instruments, GPIB devices, or RS-232/422 peripherals to a disk and to RAM volumes using these seven steps. For IBASIC operation, ASCII, BDAT, and DOS/HP-UX files can be created on mass storage devices. Note that only steps (1) and (5) are required to store data in IBASIC memory.
Page 115
Storing/Retrieving Data System Controller Mode Operation 40 OUTPUT 80903;"INIT" Trigger DMM, store the readings in DMM memory OUTPUT 80903;"FETC?" Get readings from DMM memory ENTER 80903;Dcv_rgs(*) Enter readings into IBASIC memory PRINT USING "#,K,/";Dcv_rgs (*) Display readings on terminal A typical return is: 3.245637 3.245385 10 readings 3.244967...
Page 116
System Controller Mode Operation Storing/Retrieving Data Figure 5-7 Storing Data to Disk The results are then stored on the hard disk in ASCII data file "Volts" (c) and are retrieved from the data file and displayed on the terminal (d). Note that line 320 (close I/O path) is not necessarily required, since line 360 closes the I/O path and then reopens the path.
Page 117
Storing/Retrieving Data System Controller Mode Operation ON ERROR GOTO Already_Created If ASCII file "Volts" is already created, do not attempt to create data file ! Step 3: Create Data File CREATE ASCII "Volts",10 If not already created, create ASCII file "Volts" with length of 10 (256-byte) blocks Already_Created: OFF ERROR Turn off ERROR message ! Step 4: Assign I/O Path to Data File...
Page 118
System Controller Mode Operation Storing/Retrieving Data Storing Data to RAM Volumes After a RAM volume has been created on the RAM disk, you can store data from instruments, GPIB devices, or RS-232/422 peripherals to data files on RAM volumes. You can create nonvolatile or volatile RAM volume 1 and/or volatile RAM volumes 0 and 2 through 16.
Page 119
Storing/Retrieving Data System Controller Mode Operation !RE-SAVE "STOR_RAM" ! Step 1: Define Computer File/Array REAL Dcv (1:10) Dimension REAL array in IBASIC memory ! Step 2: Specify MSI Device INITIALIZE "DOS:MEMORY,0,1",10Initialize RAM VOL 1 to DOS format MASS STORAGE IS ":MEMORY,0,1"Set RAM VOL 1 as MSI device ON ERROR GOTO Already_Created If DOS file "Volts_1"...
Page 120
System Controller Mode Operation Storing/Retrieving Data ASSIGN @File to * Close I/O path to "Volts_1" ! Display data on terminal ASSIGN @File TO "Volts_1";FORMAT OFF Reassign I/O path to file "Volts_1" FOR I = 1 to 10 Loop to transfer readings to terminal 390 ENTER @File;...
Page 121
Enabling Interrupts and Events System Controller Mode Operation Enabling Interrupts and Events This section gives guidelines to: – Enable instrument interrupts – Enable GPIB device interrupts – Enable program branching for events – Service interrupts and events Interrupts and Events Overview For System Controller mode, the IBASIC computer can sense and respond to interrupts from instruments via the IBASIC interface or from external GPIB devices via the GPIB interface.
Page 122
System Controller Mode Operation Enabling Interrupts and Events Interrupt and Event Types Events and interrupts can cause the IBASIC computer to branch to a service routine when the interrupt or event occurs. This is called event-initiated branching. For IBASIC, the commands to enable event-initiated branching are the ON CYCLE, ON ERROR, ON KEY, and ON TIMEOUT event commands and the ON INTR interrupt command.
Page 123
Enabling Interrupts and Events System Controller Mode Operation Interrupt or Event is Enabled Before an event-initiated branch can be initiated by an interrupt from an IBASIC or GPIB interface, the interface must be enabled to interrupt with an ENABLE INTR <sc> command. Events are automatically enabled when an ON-event-branch command (such as ON CYCLE or ON ERROR) is executed.
Page 124
System Controller Mode Operation Enabling Interrupts and Events Figure 5-10 Enabling Instrument Interrupts Keysight E1406A Instrument BASIC...
Page 125
Enabling Interrupts and Events System Controller Mode Operation Enabling Instrument Standard Events The first action to enable instrument interrupts is to enable the Standard Events which can set bit 5 (ESB) of the instrument’s Status Byte Register. Figure 5-11 shows the minimum instrument status register set for an instrument in the mainframe.
Page 126
System Controller Mode Operation Enabling Interrupts and Events The following table shows the Standard Event Register conditions for an instrument which are recognized by IBASIC. If one or more bits are enabled (with *ESE) and the Standard Event(s) occurs, bit 5 of the Status Byte register is set. Table 3 Instrument Standard Event Status Register Bit 7...
Page 127
Enabling Interrupts and Events System Controller Mode Operation Enabling Branching on IBASIC Interrupt When an instrument and an IBASIC interface are enabled to interrupt, the IBASIC computer can be programmed to branch to a service routine when an interrupt is received from the IBASIC interface.
Page 128
System Controller Mode Operation Enabling Interrupts and Events 140 ! to be serviced 150 ! 160 LOOP 170 END LOOP 180 END 190 ! 200 ! Service Routine for DVM 210 ! 220 SUB Service1410 COM @E1410 Have access to instrument address REAL Volts(1:10) Configure variable storage OUTPUT @E1410;"FETCH?"...
Page 129
Enabling Interrupts and Events System Controller Mode Operation Table 4 IBASIC Interface Registers for Select Codes 8 and 16 Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 End-or- Identify Not Used Not Used (EOI) Value= Value=...
Page 130
System Controller Mode Operation Enabling Interrupts and Events Figure 5-12 Enabling GPIB Device Interrupts Enabling GPIB Device Service Request Most GPIB devices have a Status Byte Register (or equivalent) which can be enabled to send an interrupt signal to the GPIB interface. See the device’s user manual for information on enabling the Status Byte register to generate an interrupt signal to the GPIB interface.
Page 131
Enabling Interrupts and Events System Controller Mode Operation For example: ON INTR 7 GOSUB 500 Branches program to line 500 when an interrupt is received from the GPIB interface (select code 7) (software priority 1) ON INTR 7,3 CALL Service Branches program to subprogram Service on GPIB interface interrupt (select code 7) (software priority 3) Enabling GPIB Interface Interrupts...
Page 132
System Controller Mode Operation Enabling Interrupts and Events Table 5 GPIB Status Register 4 Interrupt Status Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Active Parallel Poll My Talk My Listen EOI Received SPAS Remote/ Talker/...
Page 133
Enabling Interrupts and Events System Controller Mode Operation TRIGGER @Hp3456 Restart measurement 210 RETURN Return to calling program 220 END Enabling Branching on Events In addition to recognizing and servicing interrupts from the GPIB or IBASIC interface, the IBASIC computer can be enabled to recognize and service events when a predefined action occurs.
Page 134
System Controller Mode Operation Enabling Interrupts and Events The following table summarizes the actions resulting from execution of the ON CYCLE, ON ERROR, ON KEY, and ON TIMEOUT commands. Recall that for event-initiated branching to occur, interrupts must be explicitly enabled, while events are automatically enabled when the associated event command is executed.
Page 135
Enabling Interrupts and Events System Controller Mode Operation ON ERROR CALL Report Transfers program execution to subprogram Report when a trappable error occurs Using the ON KEY Event The ON KEY <key selector> [LABEL <prompt>], [<priority>] GOTO, GOSUB, RECOVER, or CALL command initiates an event-initiated branch when the specified terminal softkey is pressed.
Page 136
System Controller Mode Operation Enabling Interrupts and Events ON TIMEOUT has an effective software priority of 16 which cannot be changed. Timeouts apply to ENTER and OUTPUT statements, and to PRINTER IS devices when they are external. ON TIMEOUT is deactivated by OFF TIMEOUT. DISABLE does not affect ON TIMEOUT.
Page 137
Enabling Interrupts and Events System Controller Mode Operation ON TIMEOUT 7,.1 GOTO Over2 Enable timeout detection on 7 ENTER @Hp3456;Volt Request a reading which was not made because it was not requested PAUSE If reading received, pause 180 Over2:! off timeout 7 Turn off timeout detection DISP Count_,Dcvolt Display E1410 reading and count 200 END LOOP...
Page 138
System Controller Mode Operation Enabling Interrupts and Events Table 6 IBASIC Software Priorities for Events and Interrupts ON CYCLE 1 - 15 ON ERROR Highest priority - cannot be changed ON INTR 1 - 15 ON KEY 1 - 15 ON TIMEOUT Priority cannot be changed Logging Events and Interrupts...
Page 139
Enabling Interrupts and Events System Controller Mode Operation Figure 5-15 Higher Software Priority Takes Precedence In contrast, Figure 5-16 shows a typical sequence of actions when k1 is pressed after k2 is pressed. In this case, Key_2 finishes execution before executing Key_1. The event of pressing k1 is logged but not serviced until the routine with higher software priority completes.
Page 140
System Controller Mode Operation Enabling Interrupts and Events Changing System Priority The system priority assigned to an executing service routine is set by the software priority of the event or interrupt which caused the branch to the service routine. For example, if an event has software priority 5, the service routine has system priority 5 when it begins execution (the service routine has system priority 0 when not executing).
Page 141
Enabling Interrupts and Events System Controller Mode Operation Key_2:! Key_2 routine counts from 1 to 1000 SYSTEM PRIORITY 3 FOR I=1 TO 1000 DISP I NEXT I SYSTEM PRIORITY 0 RETURN Key_3:! Key_3 routine exits thre program once the Key_2 routine stops running.
Page 142
System Controller Mode Operation Synchronizing Instrument/Device Operations Synchronizing Instrument/Device Operations This section gives guidelines to use the IBASIC computer in System Controller mode to: – Control instruments/GPIB devices – Synchronize instruments/GPIB devices – Pass control to external computer Controlling Instruments/GPIB Devices For System Controller mode, the IBASIC computer can control both internal instruments and external GPIB devices.
Page 143
Synchronizing Instrument/Device Operations System Controller Mode Operation Figure 5-17 Controlling Instrument Devices !RE-SAVE "GPIB_INS" ASSIGN @E1410 to 80903 Assign I/O path to Keysight E1410A ASSIGN @Hp3457 to 722 Assign I/O path to Keysight 3457A DMM OUTPUT @E1410;"MEAS:VOLT:DC?" Make DCV measurement with Keysight E1410A DVM ENTER @E1410;A Enter Keysight E1410A DVM measurement PRINT "Keysight E1410A Voltage = ";A Display E1410A...
Page 144
System Controller Mode Operation Synchronizing Instrument/Device Operations Synchronizing Instrument/Device Operations With System Controller mode, several methods are available to synchronize operations among instruments, GPIB devices, and the IBASIC computer. Four ways to synchronize instruments and devices discussed in this section are to use: –...
Page 145
Synchronizing Instrument/Device Operations System Controller Mode Operation Figure 5-18 Synchronizing Using Ports The sequence of operation is: 1 INIT (line 50) closes multiplexer channel number 100. 2 Channel 100 closure generates a pulse at the Trig Out port that triggers the multimeter to take a reading.
Page 146
System Controller Mode Operation Synchronizing Instrument/Device Operations 80 OUTPUT 722;"NRDGS 1,AUTO" Set number of readings per trigger to one 90 OUTPUT 80914.;"*RST" Reset multiplexer 100 OUTPUT 80914.;"OUTP ON" Activate trigger output on action complete 110 OUTPUT 80914.;"TRIG:SOUR EXT" Set multiplexer trigger source to external 120 OUTPUT 80914.;"SCAN:PORT ABUS"...
Page 147
Synchronizing Instrument/Device Operations System Controller Mode Operation Figure 5-19 Synchronizing Using a Computer The sequence of operation is: 1 INIT (line 50) closes multiplexer channel number 100. 2 Channel 100 closure causes a pulse on Trig Out port that triggers the multimeter to take a reading.
Page 148
System Controller Mode Operation Synchronizing Instrument/Device Operations PRINT A Display reading on terminal TRIGGER 80914 Trigger multiplexer to advance to next channel NEXT I Increment count Synchronization Using *OPC? The *OPC? command causes a specified instrument to place an ASCII "1" in the instrument’s Output Queue (see Figure 5-11) when all pending operations (such as making voltage measurements or outputting a voltage) are complete.
Page 149
Synchronizing Instrument/Device Operations System Controller Mode Operation Figure 5-20 Synchronizing Using *OPC? !RE-SAVE "OPCSYNC" OUTPUT 80909;"SOUR:VOLT1 5;*OPC?" Configure DAC to output 5V on channel 1. Place a "1" in the DAC’s Output Queue when done. ENTER 80909;A Wait for *OPC? response from DAC OUTPUT 80903;"MEAS:VOLT:DC?"Measure DC voltage on DUT with 40 ENTER 80903;A Enter DUT voltage reading 50 PRINT "DUT Voltage =";A Display DUT voltage reading...
Page 150
System Controller Mode Operation Synchronizing Instrument/Device Operations Although either *OPC or *OPC? can be used for synchronization, the advantage of using *OPC is that the computer can do other operations while waiting for the response caused by *OPC. However, when using *OPC the Operation Complete bit (bit 0) in the Standard Event Register must be the only bit enabled.
Page 151
Synchronizing Instrument/Device Operations System Controller Mode Operation OUTPUT 80909;"*ESE 1" Enable Standard Event Register OPC bit (bit 0) OUTPUT 80909;"*SRE 32" Enable Status Byte Register ESB bit (bit 5) to send SRQ when DAC completes operations OUTPUT 80909;"SOUR:VOLT1 5;*OPC" Configure DAC, set Operation Complete bit when done ON INTR 8 GOTO Meas Branch to Meas (line 80) when DAC...
Page 152
System Controller Mode Operation Synchronizing Instrument/Device Operations Figure 5-22 Passing Control Run this program first in the HP 9000 Series 200/300 computer: 10 ! RE-SAVE "PASSCTL2" 20 REAL Volts(1:10) Create array for readings 30 ON INTR 7 GOTO Have_control Set up branch on PASS CONTROL 40 ENABLE INTR 7;-32768.
Page 153
Synchronizing Instrument/Device Operations System Controller Mode Operation FOR I=1 TO 10 Print selected results PRINT Volts(I) 190 NEXT I 200 PASS CONTROL @Comp709 Return control 210 DISP "DONE" 220 END Run this program second in the IBASIC computer: 10 ! RE-SAVE "PASSCTL1" 20 REAL Volts(1:10) Create array for readings 30 ON ERROR GOTO Already_there...
Page 154
System Controller Mode Operation Synchronizing Instrument/Device Operations 310 ENTER @File;Volts(*) Read data from file into array 320 ASSIGN @File TO * Close file 330 FOR I=1 TO 10 Print selected results PRINT Volts(I) 350 NEXT I 360 DISP "DONE" 370 END Keysight E1406A Instrument BASIC...
Page 155
Using Keysight Instrument BASIC with the E1406A Talk/Listen Mode Operation Using This Chapter This chapter gives guidelines to use Talk/Listen mode operation to: – Use PROGram commands – Control instruments – Control RS-232/422 peripherals – Store/retrieve data to memory – Enable instrument interrupts and events –...
Page 156
Talk/Listen Mode Operation Talk/Listen Mode Overview Talk/Listen Mode Overview Figure 6-1 shows typical functions for Talk/Listen mode operation. Talk/Listen mode is very similar to System Controller mode except that System Controller mode allows more IBASIC computer functions. With Talk/Listen mode you can control instruments using both an external computer via the GPIB interface and the IBASIC computer via the IBASIC interface.
Page 157
Talk/Listen Mode Overview Talk/Listen Mode Operation Using PROGram Commands With Talk/Listen mode, you can create programs on an external computer and download a program to the IBASIC computer. Only one program at a time can be resident in the IBASIC computer. The downloaded program can be queried and controlled using the PROGram subsystem commands.
Page 158
Talk/Listen Mode Operation Using PROGram Commands Using PROGram Commands With Talk/Listen mode, you can download a program created on an external computer (HP 9000 Series 200/300 or equivalent) to the IBASIC computer and control/query the downloaded program using the PROGram subsystem commands.
Page 159
Using PROGram Commands Talk/Listen Mode Operation Downloading Programs Program lines are downloaded to the IBASIC computer using indefinite length block parameters. For indefinite length block data, END must immediately follow the last byte of block data to force termination of the program message. For example, OUTPUT @IBASIC;"PROG:DEF #0"...
Page 160
Talk/Listen Mode Operation Using PROGram Commands Example: Downloading Previously Stored Programs The previous downloading program example is acceptable for a small program. However, for a large program or one which has been previously stored, typing the line entries may be cumbersome or time-consuming. This example shows a way to download the same previously-stored program from an HP 9000 Series 300 computer to the IBASIC computer.
Page 161
Using PROGram Commands Talk/Listen Mode Operation 170 OUTPUT @IBASIC;" " END END required for indefinite length block parameter form 180 ! 190 ! List and run downloaded program 210 OUTPUT @IBASIC;"PROG:EXEC ’LIST’" Program lists on current display system connected to IBASIC 220 OUTPUT @IBASIC;"PROG:STATE RUN"...
Page 162
Talk/Listen Mode Operation Using PROGram Commands 130 ENTER @IBASIC USING "#,A";N$[I,I] NEXT I ! The remainder of upload is actual program lines separated ! by CR/LF and terminated with EOI on LF. Enable interrupt ! on recognizing EOI with last request. ON INTR 7 GOTO Done Enable branch on Interrupt ENABLE INTR 7;2048 Enable EOI interrupt LOOP Loop until EOI received...
Page 163
Using PROGram Commands Talk/Listen Mode Operation Cataloging IBASIC Programs You can also use the PROGram:CATalog? command to see if a progam already exists. If the program exists, PROGram:CATalog? returns the name. If no program has been created, PROGram:CATalog? returns the null string (""). A program can be created with PROG:DEF# or by typing in any IBASIC command from the Display system connected to IBASIC.
Page 164
Talk/Listen Mode Operation Using PROGram Commands Using Program Wait PROGram:WAIT and PROG:WAIT? cause the IBASIC instrument to wait until the current operation is complete before executing the next command. For example: 10 OUTPUT 70930;"PROG:DEF #0" END Defines a zero-length program so commands can be sent to the IBASIC computer 20 OUTPUT 70930;"PROG:EXEC ’WAIT 5’;WAIT?"...
Page 165
Using PROGram Commands Talk/Listen Mode Operation Executing IBASIC Commands PROGram:EXECute <’program_command’> executes the IBASIC command specified. However, PROGram:EXECute ’RUN’ will not be executed if a downloaded program is currently running. For example: OUTPUT 70930;"PROG:EXEC: ’LIST’" Lists the program lines of a downloaded program OUTPUT 70930;"PROG:EXEC: ’RUN’"...
Page 166
Talk/Listen Mode Operation Controlling Instruments Controlling Instruments For Talk/Listen mode, instruments (plug-in module instruments, the System instrument, and the IBASIC instrument) can be controlled by an external computer via the GPIB interface or by the IBASIC computer via the IBASIC interfaces (see Figure 6-3).
Page 167
Controlling Instruments Talk/Listen Mode Operation Assigning Instruments to Interfaces An instrument can be controlled by only one interface at a time. For an interface to control an instrument, the instrument must first be assigned to the interface. An instrument can be assigned to GPIB, select code 8, select code 16, or can be unassigned (assigned to no interface).
Page 168
Talk/Listen Mode Operation Controlling Instruments Controlling Instruments with External Computer As shown in Figure 6-3, with Talk/Listen mode an external computer (such as an HP 9000 Series 200/300 computer) can control instruments via the GPIB interface. For an HP 9000 Series 200/300 computer, use OUTPUT 709ss; and ENTER 709ss;...
Page 169
Controlling RS-232/422 Peripherals Talk/Listen Mode Operation Controlling RS-232/422 Peripherals In Talk/Listen mode (and in System Controller mode), the IBASIC computer can control external RS-232C peripherals via the built-in RS-232 interface (interface select code 9) or via an RS-232 or RS-422 interface on an Keysight E1324A Data Communications module (interface select codes 21 through 27).
Page 170
Talk/Listen Mode Operation Storing/Retrieving Data Figure 6-4 Storing/Retrieving Data Keysight E1406A Instrument BASIC...
Page 171
Enabling Interrupts and Events Talk/Listen Mode Operation Enabling Interrupts and Events With Talk/Listen mode the IBASIC computer can detect and service an interrupt from the IBASIC interface and the ON CYCLE, ON ERROR, ON KEY, and ON TIMEOUT events (see Figure 6-5). However, with Talk/Listen mode the IBASIC computer cannot detect or service interrupts from the GPIB interface.
Page 172
Talk/Listen Mode Operation Synchronizing Instrument/Device Operations Synchronizing Instrument/Device Operations This section gives guidelines to synchronize instrument operations with the IBASIC computer when Talk/Listen mode is set. It also gives guidelines to synchronize instrument/GPIB device operations using an external computer and the IBASIC computer when Talk/Listen mode is set.
Page 173
Synchronizing Instrument/Device Operations Talk/Listen Mode Operation – Assigning the instrument Figure 6-6 Assigning Instruments to Computers Requesting an Instrument At any one time, an instrument can be assigned to the IBASIC computer via the IBASIC select code 8 or select code 16 interface, to an external computer via the GPIB interface, or can be unassigned (not assigned to either computer).
Page 174
Talk/Listen Mode Operation Synchronizing Instrument/Device Operations For example, OUTPUT 709ss; from the external computer requests assignment of the instrument at primary address 09 and secondary address ss to the external computer. Or, OUTPUT 809ss; from the IBASIC computer requests assignment of the instrument at primary address 09 and secondary address ss to the IBASIC computer.
Page 175
Synchronizing Instrument/Device Operations Talk/Listen Mode Operation If an instrument is not assigned to either side, an addressed LOCAL command first acquires it and then releases it. Releasing all Assigned Instruments Use LOCAL 7 to release all assigned instruments from the external computer. Use LOCAL 8 or LOCAL 16 to release all assigned instruments from the IBASIC computer.
Page 176
Talk/Listen Mode Operation Synchronizing Instrument/Device Operations An instrument is assigned to an interface when an addressed command, such as OUTPUT 709ss;, CLEAR 709ss, OUTPUT 809ss;, TRIGGER 809ss, etc. is issued from the interface. If the addressed instrument is already assigned to another computer, the request is denied.
Page 177
Synchronizing Instrument/Device Operations Talk/Listen Mode Operation Line: OUTPUT 70903;"MEAS:VOLT:DC?" 130 OFF TIMEOUT 7 140 ENTER 70903;A 150 DISP A 160 LOCAL 70903 170 END LOOP 180 END Line 120 might better be replaced by State = SPOLL (70903). The SPOLL operation will request data and force a timeout even though other GPIB devices on the bus (such as an GPIB Bus Analyzer) may be in the LISTEN mode.
Page 179
Using Keysight Instrument BASIC with the E1406A IBASIC Command Reference Using This Chapter This chapter shows the Keysight Instrument BASIC (IBASIC) commands supported by the IBASIC instrument in the Keysight E1406. It includes alphabetical and functional listings of supported IBASIC commands. When an IBASIC command for the Keysight E1406 differs from that shown in the Keysight Instrument BASIC Language Reference Manual, the command is described in the IBASIC Command Differences section of this chapter.
Page 180
IBASIC Command Reference IBASIC Commands Alphabetical Listing IBASIC Commands Alphabetical Listing The following table shows an alphabetical listing of IBASIC commands supported by the IBASIC instrument. Unless indicated by a * entry, the command is implemented by the IBASIC instrument as described in the Keysight Instrument BASIC Language Reference Manual.
Page 181
IBASIC Commands Alphabetical Listing IBASIC Command Reference Command Description * = See IBASIC Command Differences section for command description ** = See Chapter 2 - Creating and Editing Programs for command description Round expression to specified number of digits DROUND Converts character string to a REAL whole number DVAL DVAL$...
Page 182
IBASIC Command Reference IBASIC Commands Alphabetical Listing Command Description * = See IBASIC Command Differences section for command description ** = See Chapter 2 - Creating and Editing Programs for command description Returns largest value in list of arguments MAXREAL Returns largest REAL number available Returns smallest value in list of arguments MINREAL...
Page 183
IBASIC Commands Alphabetical Listing IBASIC Command Reference Command Description * = See IBASIC Command Differences section for command description ** = See Chapter 2 - Creating and Editing Programs for command description ROTATE Returns integer value of shift with wrap-around RPT$ Returns string repeated specified number of times Begins program execution at specified line...
Page 184
IBASIC Command Reference IBASIC Commands by Function IBASIC Commands by Function The following table shows a functional grouping of IBASIC commands supported by the IBASIC instrument. Unless indicated by a * entry, the command is implemented by the IBASIC instrument as described in the Keysight Instrument BASIC Language Reference Manual.
Page 185
IBASIC Commands by Function IBASIC Command Reference Category Command Description Binary BINAND Returns bit-by-bit logical -and of two args Returns Functions BINCMP bit-by-bit complement of argument Returns bit-by-bit exclusive-or of two args Returns bit-by-bit inclusive-or BINEOR BINIOR of two args Returns state of specified bit in argument Returns ROTATE shifted value, with wraparound...
Page 186
IBASIC Command Reference IBASIC Commands by Function Table 7-5 Program Control Operations Category Command Description Entry/ Editing EDIT** Allows user to edit program LIST Lists program lines to system printer REM and ! Allows comments on program lines Renumber lines for program in memory SECURE Protects program lines - cannot be listed Debugging...
Page 187
IBASIC Commands by Function IBASIC Command Reference Table 7-6 Instrument Control Operations Category Command Description Device ASSIGN Assigns I/O path to mass storage or devices Input/Output BEEP Produces audible tone Returns device selector or CRT DATA Specifies data accessible via READ DISP Outputs items to CRT display ENTER...
Page 188
IBASIC Command Reference IBASIC Commands by Function Table 7-6 Instrument Control Operations Event-Initiated ENABLE/DISABLE Enables/disables event-initiated branching Enables/disables interrupts set by ON INTR Branching ENABLE INTR/DISABLE Enables/disables interrupts set by ON CYCLE ON CYCLE*/OFF CYCLE* Sets up event-initiated branch for prog error ON ERROR/OFF ERROR Sets up event-initated branch for softkeys ON KEY...LABEL/OFF KEY...
Page 189
IBASIC Command Differences IBASIC Command Reference IBASIC Command Differences This section describes the IBASIC commands supported by the IBASIC instrument in the Keysight E1406 which are not described in the Keysight Instrument BASIC Language Reference Manual or have a description different from that shown in the Keysight Instrument BASIC Language Reference Manual.
Page 190
IBASIC Command Reference ABORT ABORT Keyboard Executable Programmable In an IF...THEN... For the IBASIC interfaces (select code 8 or 16), ABORT does nothing, since no operations are occurring except under IBASIC control. For the GPIB interface (select code 7) (System Controller mode only), ABORT ceases activity on the GPIB interface.
Page 191
CLEAR IBASIC Command Reference CLEAR Keyboard Executable Programmable In an IF...THEN... For the IBASIC interfaces (select code 8 or 16), when the instrument(s) are assigned to the IBASIC computer, CLEAR 8 or CLEAR 16 sets all acquired instruments to a pre-defined, instrument-dependent state., while CLEAR 809ss sets the acquired instrument at secondary address ss to a pre-defined, instrument-dependent state.
Page 192
IBASIC Command Reference CLEAR – Resets the command parser. – Disables any operation that would prevent *RST execution. – Disables the Operation Complete and Operation Complete Query modes. CLEAR 8 and CLEAR 16 do not affect: – Any settings or stored data in the instrument except the Operation Complete and Operation Complete Query modes.
Page 193
LOCAL IBASIC Command Reference LOCAL Keyboard Executable Programmable In an IF...THEN... For the IBASIC interfaces (select code 8 and 16), LOCAL 8 or LOCAL 16 places all instruments which are assigned to IBASIC in the LOCAL state, while LOCAL 809ss or 16[XX]XX places an assigned instrument at secondary address ss in the LOCAL state.
Page 194
IBASIC Command Reference LOCAL – If only interface select code 7 is selected (System Controller mode only), all GPIB devices on the interface are returned to their LOCAL state and any LOCAL LOCKOUT is canceled. – If a primary address is included, the LOCAL command is sent to a specific listener and LOCAL LOCKOUT is not disabled for any other instrument or device.
Page 195
LOCAL LOCKOUT IBASIC Command Reference LOCAL LOCKOUT Keyboard Executable Programmable In an IF...THEN... For the IBASIC interface (select code 8), executing LOCAL LOCKOUT prevents all instruments that are assigned to IBASIC and are set to the REMOTE state from being operated from their virtual front panels on the terminal. For the GPIB interface (select code 7), executing LOCAL LOCKOUT prevents all external GPIB devices which are set to the REMOTE state from being operated from their own front panels.
Page 196
IBASIC Command Reference LOCAL LOCKOUT – Sending LOCAL 8 removes LOCAL LOCKOUT for all instruments assigned to IBASIC and places them in the LOCAL state (releases the instruments). When the instrument is assigned to IBASIC, sending LOCAL 809ss (ss = secondary address) places the selected instrument in the LOCAL state (releases the instrument).
Page 197
OFF CYCLE IBASIC Command Reference OFF CYCLE Keyboard Executable Programmable In an IF...THEN... This statement cancels event-initiated branches previously defined and enabled by an ON CYCLE statement. Example Statement OFF CYCLE Cancels event-initiated branches previously defined with ON CYCLE Semantics –...
Page 198
IBASIC Command Reference ON CYCLE Item Description Range seconds numeric expression, rounded to the 0.01 through 167772.16 nearest 0.01 second priority numeric expression, rounded to an 1 through 15 integer. Default = 1 line label name of a program line integer any valid name line number constant identifying a program line...
Page 199
ON CYCLE IBASIC Command Reference – ON CYCLE is disabled by DISABLE and deactivated by OFF CYCLE. If the cycle value is so short that the computer cannot service it, the interrupt from the event is lost. Keysight E1406A Instrument BASIC...
Page 200
IBASIC Command Reference READIO READIO Keyboard Executable Programmable In an IF...THEN... READIO (and WRITEIO) provide interface control functions not available with ENTER and OUTPUT. For IBASIC, READIO reads the contents of the specified hardware register for the: – GPIB interface (select code 7) –...
Page 201
READIO IBASIC Command Reference Semantics READIO and WRITEIO are added to provide I/O functions not available with OUTPUT and ENTER. For IBASIC, READIO can be used with: – GPIB Interface (select code 7) – IBASIC Interface (select code 8) (VXI device registers) –...
Page 202
IBASIC Command Reference READIO GPIB READIO Register 4 Interrupt Status Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Active Parallel Poll My Talk My Listen SPAS Remote/ Talker/ Controller Configu- Address Address Received Local Listener...
Page 203
READIO IBASIC Command Reference Bit 4 set (1) indicates this interface is ready to accept the next data byte. Bit 3 set (1) indicates an End (EOI with ATN=0) has been detected. Bit 2 set (1) indicates a Remote/Local State change has occurred. Bit 0 set (1) indicates a change in My Address has occurred.
Page 204
IBASIC Command Reference READIO GPIB READIO Register 23 Control-Line Status Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ATN True DAV True NDAC NRFD EOI True IFC True REN True True True True Value=128 Value=64...
Page 205
READIO IBASIC Command Reference Using READIO With Serial Interfaces (Select Codes 9, 21-27) To use READIO with the RS-232/422 serial interfaces, the built-in RS-232 port must first be assigned to IBASIC with DIAG:COMM:SER:OWNER IBASIC sent to the System instrument and/or the Keysight E1324A plug-in module (s) must be assigned to IBASIC by setting the LADDR switch(es) to 241, 242, ..., 247.
Page 206
IBASIC Command Reference READIO * = Received data buffer overflow ** = Errors not covered by other bits *** = Break was received (framing error often present) Using READIO With IBASIC Memory (Select Codes 9826, 9827) To use READIO with the IBASIC memory, use select code 9826 to read ("Peek") a byte of data from a register or use select code -9826 to read a word of data from the register.
Page 207
REMOTE IBASIC Command Reference REMOTE Keyboard Executable Programmable In an IF...THEN... For the IBASIC interface (select code 8), REMOTE 8 places all addressed instruments in the REMOTE state. REMOTE 16 is not supported. REMOTE 809ss and REMOTE 16[XX]XX send the word-serial Set Lock command. For the GPIB interface (select code 7) (System Controller mode only), REMOTE 7 places all external GPIB devices having remote/local capabilities in the REMOTE state.
Page 208
IBASIC Command Reference SPOLL SPOLL Keyboard Executable Programmable In an IF...THEN... For the IBASIC interface (select code 8 or 16), SPOLL returns an integer containing the Serial Poll response from an addressed internal instrument. SPOLL returns the weighted sum of all bits which are set in the addressed instrument’s Status Byte Register.
Page 209
SPOLL IBASIC Command Reference Semantics The SPOLL command, like the *STB? Common Command, returns the weighted sum of all set bits in an instrument’s or device’s Status Byte Register. However, SPOLL differs from *STB? in that SPOLL clears bit 6 (RQS) of the Status Byte Register, while *STB? does not clear bit 6 of the register.
Page 210
IBASIC Command Reference TRIGGER TRIGGER Keyboard Executable Programmable In an IF...THEN... For the IBASIC select code 8 interface executing TRIGGER 809ss triggers the instrument at secondary address = ss. For the IBASIC select code 16 interface TRIGGER 16[XX]XX sends a word-serial trigger command to a selected device.
Page 211
TRIGGER IBASIC Command Reference – The instrument’s or device’s trigger source is set to BUS (TRIG:SOUR BUS command) – The instrument or device is in the Wait For Trigger state. – The instrument or device is addressed to listen. See the TRIGGER command in the Keysight Instrument BASIC Language Reference Manual for a summary of GPIB bus actions for the TRIGGER command.
Page 212
IBASIC Command Reference WRITEIO WRITEIO Keyboard Executable Programmable In an IF...THEN... WRITEIO (and READIO) provides interface functions not available with ENTER and OUTPUT. For IBASIC, WRITEIO writes data to the specified hardware register for the: – GPIB interface (select code 7) –...
Page 213
WRITEIO IBASIC Command Reference – IBASIC Interface (select code 8) (VXI instrument registers) – RS-232/422 Serial Interfaces (select codes 9, 21-27) – IBASIC Memory (select codes 9826, 9827) Using WRITEIO With GPIB Interface (Select Code 7) To use WRITEIO with the GPIB interface (select code 7), the Keysight E1406 must be set for System Controller mode.
Page 214
IBASIC Command Reference WRITEIO GPIB WRITEIO Register 4 Release Holdoff Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 X Value=128 Value=64 Value=32 Value=16 Value=8 Value=4 Value=2 Value=1 x = Writing anything to this register releases NDAC holdoff. If non-zero, accept last secondary address as valid.
Page 215
WRITEIO IBASIC Command Reference The commands shown in the following table can be sent to the interface by sending the specified numeric values to GPIB WRITEIO Register 23. Keysight E1406A Instrument BASIC...
Page 216
IBASIC Command Reference WRITEIO Table 7-8 GPIB WRITEIO Register 23 - Auxiliary Commands Decimal Auxiliary Command Description Value Clear Chip Reset Set Chip Reset Release ACDS holdoff. If Address Pass Through is set, it indicates an invalid secondary has been received. Release ACDS holdoff.
Page 217
WRITEIO IBASIC Command Reference GPIB WRITEIO Register 25 Address Register Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Enable Dual Disable Disable Primary Address Addressing Listen Talker Value=128 Value=64 Value=32 Value=16 Value=8 Value=4 Value=2 Value=1...
Page 218
IBASIC Command Reference WRITEIO A 1 sets the appropriate bit true during a Parallel Poll, while a 0 sets the corresponding bit false. Initially, and when Parallel Poll is not configured, this register must be set to all zeros. GPIB WRITEIO Register 31 Data-Out Register Bit 8 Bit 7 Bit 6...
Page 219
WRITEIO IBASIC Command Reference There are two steps to write data to a serial interface using WRITEIO (and READIO): 1 Use WRITEIO <sc>,1;Data to write data to the Write Data register (WRITEIO register 1) for the code to be used. 2 Use READIO (<sc>,2) to read the results from READIO register 2 (Write Data Status).
Page 220
IBASIC Command Reference WRITEIO Using select code 9827 lets you execute an MC 68000 machine-language JSR ("Jump to Subroutine") instruction. One parameter can be specified in the WRITEIO statement (DO_data in the example below), which will be written in the processor’s DO register before the JSR instruction is executed and pushed onto the A7 stack.
Page 221
Using Keysight Instrument BASIC with the E1406A SCPI Command Reference Using This Chapter This chapter describes the Standard Commands for Programmable Instruments (SCPI) commands which apply to the IBASIC instrument in the Keysight E1406. Chapter contents are: – SCPI Conformance Information shows SCPI commands implemented by the IBASIC instrument.
Page 223
SCPI Conformance Information SCPI Command Reference Table 3 SYSTem Subsystem Commands for IBASIC Keyword Parameter Form Notes SYSTem :COMMunicate :SERial[n] :CONTrol [Not SCPI] :DTR ON|OFF|STANdard|IBFull [Not SCPI :DTR? [Not SCPI] :RTS ON|OFF|STANdard|IBFull [Not SCPI] :RTS? [Not SCPI] [:RECeive] :BAUD <baud_rate>|MIN|MAX :BAUD? [MIN|MAX] :BITS...
Page 224
SCPI Command Overview SCPI Command Overview This section summarizes SCPI command format and structure. See the Beginner’s Guide to SCPI (available from your Keysight Technologies Sales and Support Office) for a complete description of SCPI command formats and structure. SCPI Command Format...
Page 225
SCPI Command Overview SCPI Command Reference SCPI Command Types SCPI commands can be required, abbreviated, or implied and usually have a query form. In addition, some commands have what appears to be a variable syntax. Required Commands Commands in the syntax tables which are not enclosed in square brackets ([]) are required commands and must be sent in the form shown.
Page 226
SCPI Command Reference SCPI Command Overview Variable Command Syntax A few commands use what appears to be a variable syntax. For example, in SYST:COMM:SER[n], the "n" is replaced by a number from 0 through 7. In this case, no space is left between the command and the number since the number is NOT a parameter, but is part of the command syntax.
Page 227
SCPI Command Overview SCPI Command Reference Table 8-4 SCPI Parameter Types Non- decimal Specify settings in hexadecimal, octal, or binary formats. #b0101 = binary for decimal 5 Numeric #Q71 = octal for decimal 57 #hFA = hexadecimal for decimal 250 SCPI Response Data Formats SCPI command response data is data returned from an instrument to the IBASIC computer or to an external computer.
Page 228
SCPI Command Reference DIAGnostic Subsystem Commands DIAGnostic Subsystem Commands For IBASIC, the DIAGnostic subsystem can be used to adjust the Keysight E1406 file system, set memory sizes, and adjust the IBASIC operating system clock time. The DIAGnostic subsystem commands table for the IBASIC instrument follows.
Page 229
:COMMunicate :SERial[n]:STORe SCPI Command Reference :COMMunicate :SERial[n]:STORe DIAGnostic:COMMunicate:SERial[n]:STORe stores the serial communications parameters (such as BAUD, BITS, PARity, etc.) into non-volatile storage for the serial interface specified by [n] in SERial[n]. Comments – Until DIAG:COMM:SER[n]:STORe is executed, communication parameter values are stored in volatile memory, and a power failure will cause the settings to be lost.
Page 230
SCPI Command Reference :COMMunicate :SERial[n]:STORe Table 8-7 File Subsystem Parameters Para- Parameter Description Range of value Defaultvalue meter USER_START: Memory address of the start of a user-defined RAM disk 24 bits that will become memory volume ":,0,16" after it is initialized. Zero means user RAM disk not present.
Page 231
:COMMunicate :SERial[n]:STORe SCPI Command Reference Table 8-7 File Subsystem Parameters Para- meter Parameter Description Range of value Defaultvalue DISK2_SC: Select Code (and Primary Addr if type = 1) DISK2_UNIT: Mass Storage Unit Number of disk DISK2_VOL: Mass Storage Volume Number of disk DISK3_TYPE: DISK3_SC: Select Code (and Primary Addr if type = 1) DISK3_UNIT: Mass Storage Unit Number of disk...
Page 232
SCPI Command Reference :COMMunicate :SERial[n]:STORe DISK 1 = 3.5 inch disk - ":,700,1" DISK 2 = Nonvolatile RAM Disk - ":0,1" DISK 3 = Hard Disk Drive - ":,700,0" Parameters 15-18 describe the first disk searched. Parameters 19-22 describe the second disk searched. Parameters 23-26 describe the third disk searched.
Page 233
:COMMunicate :SERial[n]:STORe SCPI Command Reference Example Disable AUTOSTART Search DIAG:FILES 14,0 Since <value> is 0, the Keysight E1406 will not attempt to find an AUTOST program and the DISK_WAIT (parameter 13) wait time will not occur at power-on. :FILESystem? DIAGnostic:FILESystem? returns the current value for the DIAGnostic:FILESystem parameter specified.
Page 234
SCPI Command Reference :COMMunicate :SERial[n]:STORe DIAG:IBAS:BLOCK 16384 After system reset or after cycling power, sets 16384 bytes as the size of the memory block IBASIC will request if more memory is required for program storage. :IBASic :BLOCKsize? DIAGnostic:IBASic:BLOCKsize? returns the current value for the DIAGnostic:IBASic:BLOCKsize bytes parameter.
Page 235
:COMMunicate :SERial[n]:STORe SCPI Command Reference DIAG:IBAS:DISP BUIL When command is executed and power is cycled, the terminal connected to the buiult-in RS-232 interface shows IBASIC_240: :IBASic:DISPlay? DIAGnostic:IBASic:DISPlay? returns the current value for the DIAGnostic:IBASic:DISPlay parameter specified. Example Read DIAG:IBAS:DISP Parameter Value DIAG:IBAS:DISP BUIL Connects built-in RS-232 port to IBASIC computer after power is cycled.
Page 236
SCPI Command Reference :COMMunicate :SERial[n]:STORe – Corrections Using COM Blocks. You can also define large arrays in the program in a COM block. Since COM memory is not taken from the stack requirements for the program, you may be able to run the program without cycling power.
Page 237
:COMMunicate :SERial[n]:STORe SCPI Command Reference – 10 msec. The DIAG:IBASic:SYNC[:CLOCK] allows you to set the operating system clock to within one second of the battery-backed real-time clock. – Operating System Clock Errors Effect on TIMEDATE. Since all IBASIC times are derived from the operating system clock, errors in this clock will affect the TIMEDATE reported by IBASIC and the time/date stamp on files in the file system.
Page 238
SCPI Command Reference PROGram Subsystem Commands PROGram Subsystem Commands The PROGram subsystem provides the means to generate and control an IBASIC program which is resident in the Keysight E1406. Using the PROGram subsystem, you can list programs; create, download, and upload programs; execute downloaded programs;...
Page 239
PROGram Subsystem Commands SCPI Command Reference – Related Commands: PROG:CAT – *RST Condition: A reset entered via the interface sets the IBASIC program to the STOPped state and changes the IBASIC program name to PROG. A reset generated by IBASIC acts the same except it will not cause the IBASIC program to go to the STOPped state.
Page 240
SCPI Command Reference PROGram Subsystem Commands – *RST Condition: A reset entered via the interface sets the IBASIC program to the STOPped state and changes the IBASIC program name to PROG. A reset generated by IBASIC acts the same except it will not cause the IBASIC program to go to the STOPped state.
Page 241
PROGram Subsystem Commands SCPI Command Reference – This does not delete the selected program name, if one has been assigned using the PROG:NAME command. If you query for the program name using PROG:NAME? you will get the previously selected name, even though the program is no longer in memory.
Page 242
SCPI Command Reference PROGram Subsystem Commands :MALLocate PROGram:MALLocate <nbytes>|DEFault reserves memory space for IBASIC arrays and variables and subprogram stack plus the temporary storage required needed by a RUNning IBASIC program. Common variables are allocated from System memory on demand. Parameters Parameter Name Type...
Page 243
PROGram Subsystem Commands SCPI Command Reference PROG:MALL? Returns number of bytes reserved in IBASIC memory for IBASIC arrays and variables. :NAME PROGram:NAME <progname> selects a named program for use with future PROG commands. Since only a single program can be downloaded at any one time with IBASIC, you will not need this command.
Page 244
SCPI Command Reference PROGram Subsystem Commands :NUMBer PROGram:NUMBer <varname>, <nvalues> sets the value(s) of numeric program variables or arrays in an IBASIC program. Parameters Parameter Name Type Range of Values Default varname string Any ASCII characters None nvalues numeric None Comments –...
Page 245
PROGram Subsystem Commands SCPI Command Reference Comments Related Commands: PROG:NUMB Example Return Value of Variable – PROG:NUMB B,10 Assign a value of 10 to variable B. – PROG:NUMB? B Returns a value of 10. :STATe PROGram:STATe <state>sets the state of an IBASIC program. Parameters Parameter Name Type...
Page 246
SCPI Command Reference PROGram Subsystem Commands Example Set IBASIC Program to RUN State PROG:STAT:PAUS Pauses IBASIC Program PROG:STAT:CONT Sets IBASIC Program to RUN state. :STATe? PROGram:STATe? queries the current state of the IBASIC program. Comments Related Commands: PROG:STAT Example Return State of IBASIC Program PROG:STAT:PAUS Pauses IBASIC Program.
Page 247
PROGram Subsystem Commands SCPI Command Reference – Using <svalues>. <svalues> is a list of comma-separated strings used to set <varname>. If <varname> cannot hold all the specified <svalues>, a "Parameter Not Allowed" error is generated. – Related Commands: None – *RST Condition: None. Example Assign Contents to String Variable PROG:STR B, ’B = Result’...
Page 248
SCPI Command Reference PROGram Subsystem Commands PROG:WAIT Commands to be executed do not execute until the current IBASIC program is STOPped or PAUSed. :WAIT? PROGram:WAIT? has the same effect as the PROG:WAIT command, except PROG:WAIT? returns a value of 1 to indicate the IBASIC program is no longer running.
Page 249
SYSTem Subsystem Commands SCPI Command Reference SYSTem Subsystem Commands The SYSTEM command subsystem for the IBASIC Instrument allows you to configure serial communications ports operations. The SYSTem subsystem commands table for the IBASIC instrument follows. SYSTem Subsystem Commands for IBASIC Table 8-9 SYSTem Subsystem Commands for IBASIC Keyword Parameter Form...
Page 250
SCPI Command Reference SYSTem Subsystem Commands :COMMunicate :SERial[n]: The SYStem:COMMunicate:SERial[n]:... commands set and/or modify the configuration of the serial interface(s) that are assigned to the IBASIC instrument. The interface affected by the command is specified by a number (zero through seven) which replaces the [n] in the :SERial[n] command. Comments –...
Page 251
SYSTem Subsystem Commands SCPI Command Reference :COMMunicate:SERial[n]:CONTrol:DTR SYSTem:COMMunicate:SERial[n]:CONTrol:DTR <dtr_cntrl> controls the behavior of the Data Terminal Ready output line. DTR can be set to a static state (ON|OFF), can operate as a modem control line (STANDard), or can be used as a hardware handshake line (IBFull).
Page 252
SCPI Command Reference SYSTem Subsystem Commands SYST:COMM:SER1:CONT:DTR ON Sets the serial interface on Keysight E1324A module to assert the DTR line :COMMunicate:SERial[n]:CONTrol:DTR? SYSTem:COMMunicate:SERial[n]:CONTrol:DTR? returns the current setting for DTR line control. Example Query DTR Control Setting SYST:COMM:SER1:CONT:DTR? Query DTR Control setting for serial interface on Keysight E1324A module #1 ENTER statement Returns "ON", "OFF", "STAN", or "IBF"...
Page 253
SYSTem Subsystem Commands SCPI Command Reference IBFull While the input buffer is not yet at the :STOP threshold, RTS is asserted. When the input buffer reaches the :STOP threshold, RTS is unasserted. – We recommend you set ...DTR and ...RTS to STANdard when operating a modem.
Page 254
SCPI Command Reference SYSTem Subsystem Commands :COMMunicate:SERial[n] [:RECeive]:BAUD SYSTem:COMMunicate:SERial[n][:RECeive]:BAUD <baud> sets the baud rate for the built-in RS-232 serial port or for the RS-232/422 ports on an Keysight E1324A plug-in module. Parameters Name Description Range Default bytes Sets size of memory 1024 - 65536 bytes 8192 bytes IBASIC will request.
Page 255
SYSTem Subsystem Commands SCPI Command Reference :COMMunicate:SERial[n] [:RECeive]:BITS SYSTem:COMMunicate:SERial[n][:RECeive]:BITS <bits> sets the number of bits to be used to transmit and receive data. Parameters Name Description Range Default bytes Sets size of memory 1024 - 65536 bytes 8192 bytes IBASIC will request. Comments –...
Page 256
SCPI Command Reference SYSTem Subsystem Commands SYST:COMM:SER1:BITS 7 Set data with to 7 bits for Keysight E1324A plug-in module #1 :COMMunicate:SERial[n] [:RECeive]:BITS? SYSTem:COMMunicate:SERial[n][:RECeive]:BITS? [MIN | MAX] returns the current data width if no parameter is sent, the maximum allowable setting if MAX is sent, or the minimum allowable setting if MIN is sent.
Page 257
SYSTem Subsystem Commands SCPI Command Reference SYST:COMM:SER1:PACE:PROT XON Enable XON/XOFF handshake for Keysight E1324A plug-in module #1 :COMMunicate:SERial[n] [:RECeive]:PACE [:PROTocol]? SYSTem:COMMunicate:SERial[n][:RECeive]:PACE[:PROTocol]? returns the current receive pacing protocol. Example Query XON/XOFF Protocol SYST:COMM:SER1:PACE:PROT? Querries Keysight E1324A plug-in module #1 to see if XON/XOFF protocol is enabled ENTER statement Returns "XON"...
Page 258
SCPI Command Reference SYSTem Subsystem Commands Built-in RS-232 Plug-in Modules 2048 6144 – ...STARt must be set to less than ...STOP. – Related Commands: ...PACE:PROT XON|NONE, ...CONT:DTR, ...CONT:RTS – *RST Condition: No change Example Set Interface to Generate XON SYST:COMM:SER1:PACE:THR:STAR 10 Set interface on Keysight E1324A to send XON when input buffer contains 10 characters.
Page 259
SYSTem Subsystem Commands SCPI Command Reference :COMMunicate:SERial[n] [:RECeive]:PACE:THReshold:STOP SYSTem:COMMunicate:SERial[n][:RECeive]:PACE:THReshold:STOP <char_count> configures the input buffer level at which the specified interface may send the XOFF character (ASCII 1316), deassert the DTR line, and/or deassert the RTS line. Parameters Parameter Name Type Range of Values Default char_count...
Page 260
SCPI Command Reference SYSTem Subsystem Commands :COMMunicate:SERial[n] [:RECeive]:PACE:THReshold:STOP? SYSTem:COMMunicate:SERial[n][:RECeive]:PACE:THReshold:STOP? [MIN | MAX] returns the current stop threshold if no parameter is sent, the maximum allowable setting if MAX is sent, or the minimum allowable setting if MIN is sent. Comments –...
Page 261
SYSTem Subsystem Commands SCPI Command Reference SYST:COMM:SER1:PAR:CHEC ON Set parity check to ON for serial interface on Keysight E1324A module #1 :COMMunicate:SERial[n] [:RECeive]:PARity:CHECk? SYSTem:COMMunicate:SERial[n][:RECeive]:PARity:CHECk? returns the state (ON/OFF) of parity checking. Example Check Parity Status SYST:COMM:SER1:PAR:CHEC? Query parity check status (ON/OFF) for serial interface on Keysight E1324A module #1 ENTER statement Returns 1 if ON, 0 if OFF...
Page 262
SCPI Command Reference SYSTem Subsystem Commands NONE A parity bit must not be received in the serial data frame. No parity bit will be transmitted. – Disallowed Combinations. Although the ...PARity[:TYPE] command operates independently of the . . . BITS or . . . SBITs commands, two combinations are disallowed because of their data frame bit width (see the following table): BITS...
Page 263
SYSTem Subsystem Commands SCPI Command Reference :COMMunicate:SERial[n] [:RECeive]:PARity[:TYPE]? SYSTem:COMMunicate:SERial[n][:RECeive]:PARity[:TYPE]? returns the type of parity checked and generated. Example Query Type of Parity Checking Set SYST:COMM:SER1:PAR? Query parity type for serial interface on Keysight E1324A module #1 ENTER statement Returns EVEN, ODD, ZERO, ONE, or NONE :COMMunicate:SERial[n] [:RECeive]:SBITs SYSTem:COMMunicate:SERial[n][:RECeive]:SBITs <sbits>...
Page 264
SCPI Command Reference SYSTem Subsystem Commands – DIAG:BOOT:COLD sets SBITs to 1. – Related Commands: SYST:COMM:SER[n]:BAUD – *RST Condition: No change Example Setting 2 Stop Bits SYST:COMM:SER1:SBITS 2 Sets 2 stop bits for serial interface on Keysight E1324A module #1 :COMMunicate:SERial[n] [:RECeive]:SBITs? SYSTem:COMMunicate:SERial[n][:RECeive]:SBITs? [MIN | MAX] returns the current stop bit setting if no parameter is sent, the maximum allowable setting if...
Page 265
SYSTem Subsystem Commands SCPI Command Reference – Related Commands: SYST:COMM:SER[n]:REC:PACE:PROT, SYST:COMM:SER[n]:TRAN:PACE:PROT – *RST Condition: TRAN:AUTO ON Example Link Transmit Pacing With Receive Pacing SYST:COMM:SER0:TRAN:AUTO ON Link transmit/receive pacing for built-in RS-232 interface. :COMMunicate:SERial[n]:TRANsmit:AUTO? SYSTem:COMMunicate:SERial[n]:TRANsmit:AUTO? returns the current state of receive to transmit pacing linkage. Comments –...
Page 266
SCPI Command Reference SYSTem Subsystem Commands – DIAG:BOOT:COLD sets ...PACE to XON. – Related Commands: SYST:COMM:SER[n]:TRAN:AUTO – *RST Condition: No change Example Set XON/XOFF Transmit Pacing SYST:COMM:SER0:TRAN:PACE:PROT XON Set XON/XOFF transmit pacing for built-in RS-232 interface :COMMunicate :SERial[n]:TRANsmit:PACE [:PROTocol]? SYSTem:COMMunicate:SERial[n]:TRANsmit:PACE[:PROTocol]? returns the current transmit pacing protocol.
Page 267
Using Keysight Instrument BASIC with the E1406A Common Command Reference Using this Chapter This chapter describes the IEEE 488.2 Common (*) Commands which apply to the IBASIC Instrument. See the Tutorial Description of the General Purpose Interface Bus for additional information on IEEE 488.2 Common Commands. Common Command Groups The following table shows the Common Commands implemented by the IBASIC Instrument by Command Group.
Page 268
Common Command Reference Test/Identity Commands Test/Identity Commands The Test/Identity commands include *IDN?, *RST, and *TST?. *IDN? Identification query. Returns the identity of the IBASIC instrument. Comments The response from *IDN? consists of the following four fields (fields are separated by commas): –...
Page 269
Test/Identity Commands Common Command Reference – The output queue – The Service Request Enable Register – The Standard Event Enable Register – Protected user data Example OUTPUT 70930;"*RST" Resets the IBASIC Instrument *TST? Self-test query. Always returns a 0; no IBASIC self-test is performed. Keysight E1406A Instrument BASIC...
Page 270
Common Command Reference Synchronization commands Synchronization commands The synchronization commands include *OPC, *OPC?, and *WAI. These commands can be used by IBASIC to ensure synchronization between an instrument and the IBASIC computer or between multiple instruments. These commands are not meant to be used on the IBASIC Instrument itself since the Operation Complete event or Wait Event occurs when the IBASIC parser has parsed a command--not when that command has finished being executed.
Page 271
Status and Event Commands Common Command Reference *CLS does not affect enabling bits in the Status Byte register or the Standard Event Status Group registers. However, *CLS disables the operation complete function (*OPC command) and the operation complete query function (*OPC? command).
Page 272
Common Command Reference Status and Event Commands Comments After reading the Standard Event Register, *ESR? clears the register. The events recorded in the Standard Event Register are independent of whether or not those events are enabled with the *ESE command. Example 5 !RE-SAVE "ESRQUERY"...
Page 273
Status and Event Commands Common Command Reference 20 ENTER 70930;APlaces response in variable 30 PRINT A Displays response 40 END If bits 4 and 5 are enabled to generate an SRQ, the return is 48 (16 for bit 4 + 32 for bit 5).
Page 274
Common Command Reference Macro Commands Macro Commands The Macro commands (*DMC, *EMC, *EMC?, *GMC, *GMC?, *LMC, and *PMC) can be used to define and use macros (a sequence of commands) to replace a set of commands. Macros are particularly useful when using an external computer with the mainframe in Talk/Listen mode.
Page 275
Macro Commands Common Command Reference Example *EMC 0.4 Disables all macros, since 0.4 rounds to 0. *EMC -12.4 Enables macros, since <number> is in range of -32767 to +32767. *EMC? Enable macro query. Allows user to determine if macros are enabled. The *EMC? command returns 1 when macros are enabled or returns 0 when macros are d *GMC? Get Macro Contents Query.
Page 276
Common Command Reference Macro Commands 70 OUTPUT @IBASIC;"20 DISP I" 80 OUTPUT @IBASIC;"25 I=I+1" 90 OUTPUT @IBASIC;"30 END LOOP" OUTPUT @IBASIC;"40 END" END END of downloaded program OUTPUT @IBASIC;"*PMC" Purge current macros OUTPUT @IBASIC;"*DMC ""R"",#214prog:state run" Macro R = RUN program OUTPUT @IBASIC;"*DMC ""C"",#215prog:state cont"...
Page 277
Using Keysight Instrument BASIC with the E1406A IBASIC and HP Series 200/300 Differences The IBASIC language is similar to that used on HP Series 200/300 BASIC language computers. However, there are some differences. If you are familiar with the Series 200/300 computers you will want to note the following IBASIC differences.
Page 278
IBASIC and HP Series 200/300 Differences Timeout when Entering Data from a Device Timeout when Entering Data from a Device When IBASIC times-out waiting for input from a device or gets an interface error, an extra character is returned. The following example shows what happens for the timeout case: 5 !RE-SAVE "TIMEOUT"...
Page 279
Format Off Enter to a String Does Not Look for Length Word IBASIC and HP Series 200/300 Differences Format Off Enter to a String Does Not Look for Length Word 10 ASSIGN @F TO 9;FORMAT OFF 20 ENTER @F;A$ HP Series 200/300 BASIC expects a 4 byte length word to precede the string characters.
Page 280
IBASIC and HP Series 200/300 Differences Nested I/O Nested I/O HP Series 200/300 BASIC permits nesting of I/O statements to as many levels as there are different interface select codes. HP Series 200/300 BASIC would permit the following: 10 PRINTER IS 701 20 PRINT FNNested 30 END 40 DEF FNNested...
Need help?
Do you have a question about the 75000 C Series and is the answer not in the manual?
Questions and answers