National Instruments GPIB-232CT User Manual
National Instruments GPIB-232CT User Manual

National Instruments GPIB-232CT User Manual

Microgpib rs-232 to ieee-488 controller
Table of Contents

Advertisement

Quick Links

sales@artisantg.com
artisantg.com
(217) 352-9330 |
|
Click HERE
Find the National Instruments GPIB-232CT at our website:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the GPIB-232CT and is the answer not in the manual?

Questions and answers

Summary of Contents for National Instruments GPIB-232CT

  • Page 1 (217) 352-9330 | Click HERE Find the National Instruments GPIB-232CT at our website:...
  • Page 2 GPIB-232CT User Manual ® MicroGPIB RS-232 to IEEE-488 Controller July 1992 Edition Part Number 320114-01 © Copyright 1988, 1992 National Instruments Corporation. All Rights Reserved.
  • Page 3 National Instruments Corporate Headquarters 6504 Bridge Point Parkway Austin, TX 78730-5039 (512) 794-0100 (800) IEEE-488 (toll-free U.S. and Canada) Technical support fax: (512) 794-5678 Branch Offices: Australia 03 879 9422, Belgium 02 757 00 20, Canada 519 622 9310, Denmark 45 76 73 22, France 1 48 65 33 70, Germany 089 714 5093,...
  • Page 4 The reader should consult National Instruments if errors are suspected. In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it.
  • Page 5 National Instruments must be brought within one year after the cause of action accrues. National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided herein does not cover damages, defects, malfunctions, or service failures caused by owner's failure to follow the National Instruments installation, operation, or maintenance instructions;...
  • Page 6 Be sure that the equipment is plugged into a grounded outlet and that the grounding has not been defeated with a cheater plug. If necessary, consult National Instruments or an experienced radio/television technician for additional suggestions. The following booklet prepared by the FCC may also be helpful: How to Identify and Resolve Radio-TV Interference Problems.
  • Page 7 Preface The GPIB-232CT User Manual describes the features, functions, and operation of the Product. The GPIB-232CT is one of National Instruments family of MicroGPIB products. These products are high-performance, low- cost IEEE-488 support items, packaged in small all-metal cases, capable of being rackmounted.
  • Page 8 Appendix F, Parallel Polling, explains the use and operation of Parallel Polls. Appendix G, Setting Switches, gives additional details about setting switches on the GPIB-232CT. Appendix H, Sample Programs, provides some S mode and G mode sample programs. Conventions Used in This Manual...
  • Page 9 1000 bytes per second < less than • less than or equal to meter 1,048,576 Mbytes/sec 1,000,000 bytes per second milliampere millimeter ounce percent second volt volts alternating current volts direct current © National Instruments Corp. GPIB-232CT User Manual...
  • Page 10 We appreciate communicating with the people who use our products. If you encounter any technical problems, you can use the following toll-free number between the hours of 8:00 a.m. and 5:30 p.m. (central time) to reach the National Instruments applications engineering department: (512) 794-0100 (800) IEEE-488 (toll-free U.S. and Canada) For your documentation comments, we have included a User Comment Form at the back of the manual.
  • Page 11: Table Of Contents

    Description of the GPIB-232CT ..........1-1 Introduction................1-1 What Your Kit Contains ............1-2 Optional Equipment ..............1-3 GPIB-232CT Specifications............1-4 The GPIB-232CT Front Panel ...........1-5 The GPIB-232CT Rear Panel.............1-7 The RS-232 Port ............1-8 The GPIB Port .............1-9 Chapter 2 The GPIB-232CT Modes of Operation .................2-1...
  • Page 12 ................5-1 Points to Remember ..............5-1 cac - Become Active Controller ..........5-3 caddr - Change the GPIB Address of the GPIB-232CT ....5-4 clr - Clear Specified Device ............5-6 cmd - Send GPIB Commands ............5-8 echo - Echo Characters Received from Serial Port ....5-11 eos - Change/Disable GPIB EOS Termination Mode ....5-12...
  • Page 13 Function Names .................7-2 Function Argument Delimiters ..........7-2 Abbreviation for Argument .........7-2 Status Information..............7-3 Communicating with the GPIB-232CT and the Serial Device ..7-3 Address of the GPIB-232CT ........7-3 Address of the Serial Device ........7-3 Addressing Terminology .......7-3 The GPIB-232CT and Serial Device as Listener .......7-4 The GPIB-232CT and Serial Device as Talker......7-5...
  • Page 14 Serial Port Error Codes ..............B-10 Appendix C The Serial Connection ..............C-1 RS-232C..................C-1 Interfacing the GPIB-232CT to a DCE........C-3 Interfacing the GPIB-232CT to a DTE ........C-5 Buffering and Handshaking ............C-6 Hardware Handshake...........C-7 XON/XOFF ..............C-8 Appendix D Operation of the GPIB ..............D-1 Types of Messages ..............D-1...
  • Page 15 S Mode Sample Programs............H-1 Using an HP 7475A Plotter with a Terminal ......H-2 Getting Ready to Program ...........H-2 Programming Steps............H-3 Step 1. stat Function ........H-3 Step 2. Serial Port Functions ......H-3 Step 3. GPIB Initialization Functions...H-4 © National Instruments Corp. GPIB-232CT User Manual...
  • Page 16 IBM PC (with GPIB-PC) to Serial Printer .........H-14 Getting Ready to Program ...........H-14 Programming Steps............H-15 Step 1. stat Function ........H-15 Step 2. GPIB Initialization Functions...H-15 Step 3. Serial Port Initialization Functions ........H-15 Step 4. Communicate with the Printer..H-15 GPIB-232CT User Manual © National Instruments Corp.
  • Page 17 Contents Figures Figure 1-1. The GPIB-232CT ............1-1 Figure 1-2. The GPIB-232CT Front Panel.........1-5 Figure 1-3. The GPIB-232CT Rear Panel..........1-7 Figure 1-4. The RS-232 Connector and Signal Designations ....1-8 Figure 1-5. The GPIB Connector and Signal Designations ....1-9 Figure 2-1. Personal Computer Controlling a GPIB Plotter ....2-2 Figure 2-2.
  • Page 18 Low-Level Controller Functions ........4-9 Table 4-8. Parallel Poll Functions.............4-9 Table 4-9. Serial Port Initialization Functions........4-10 Table 4-10. General Use Functions ............4-10 Table 4-11. GPIB-232CT Functions...........4-11 Table 5-1. Data Transfer Termination Methods .......5-12 Table 5-2. GPIB Status Conditions...........5-48 Table 5-3. GPIB Error Conditions............5-49 Table 5-4.
  • Page 19 Contents Table C-1. RS-232 Serial Port Pinouts..........C-2 © National Instruments Corp. GPIB-232CT User Manual...
  • Page 20: Description Of The Gpib-232Ct

    GPIB. The GPIB-232CT is also capable of interfacing RS-232 instruments and peripherals to the GPIB. The GPIB-232CT has all the software and logic required to implement the physical and electrical specifications of the IEEE-488 and the RS-232 standards.
  • Page 21: What Your Kit Contains

    What Your Kit Contains Your kit should contain the following components: Component Part Number One of the following boxes: • GPIB-232CT (64K RAM - 115 VAC) 776173-01 • GPIB-232CT (256K RAM - 115 VAC) 776173-02 • GPIB-232CT (64K RAM - 230 VAC) 776173-31 •...
  • Page 22: Optional Equipment

    Chapter 1 Description of the GPIB-232CT Optional Equipment Component Part Number Rackmount Kit: Single (1 unit) 180480-01 Dual (2 units) 180480-02 RS-232 Shielded Cables, Compatible with IBM PC DTE to DTE - 2 m 180459-02 DTE to DTE - 4 m...
  • Page 23: Gpib-232Ct Specifications

    Description of the GPIB-232CT Chapter 1 GPIB-232CT Specifications Tables 1-1 through 1-3 specify the electrical, environmental, and physical characteristics of the GPIB-232CT. Table 1-1. Electrical Characteristics Characteristic Specification Power Supply Unit Wall mount type, 115 VAC or 230 VAC, 50/60 Hz input, 9 VDC @ 1A max output...
  • Page 24: The Gpib-232Ct Front Panel

    Weight 28 oz. (without power supply unit) The GPIB-232CT Front Panel The front panel of the GPIB-232CT is shown in Figure 1-2. The power switch and six Light Emitting Diodes (LEDs) are mounted on the GPIB-232CT front panel. Figure 1-2. The GPIB-232CT Front Panel ©...
  • Page 25: Table 1-4. Led Descriptions

    Description of the GPIB-232CT Chapter 1 The LEDs show the current status of the GPIB-232CT at all times. Table 1-4 describes each LED. Table 1-4. LED Descriptions Indication POWER Indicates that power to the unit has been applied and the ON/OFF switch is in the ON position.
  • Page 26: The Gpib-232Ct Rear Panel

    Chapter 1 Description of the GPIB-232CT The GPIB-232CT Rear Panel The rear panel of the GPIB-232CT is shown in Figure 1-3. The power cable, RS-232 cable, and GPIB cable are shown connected to the rear panel of the GPIB-232CT. Figure 1-3. The GPIB-232CT Rear Panel ©...
  • Page 27: The Rs-232 Port

    Description of the GPIB-232CT Chapter 1 The RS-232 Port The RS-232 port on the GPIB-232CT is configured as a DTE (Data Terminal Equipment) and uses a standard 25-pin shielded D-subminiature female connector with screwlock assemblies. The RS-232 connector will accept standard 25-pin D-subminiature male connectors. A diagram of the serial connector and the signals supported is shown in Figure 1-4.
  • Page 28: The Gpib Port

    Chapter 1 Description of the GPIB-232CT The GPIB Port The GPIB connector is a standard 24-pin shielded AMP Champ female connector with metric screwlock hardware. A diagram of the GPIB connector and the signals supported is shown in Figure 1-5 (a * suffix indicates that the signal is active low).
  • Page 29: The Gpib-232Ct Modes Of Operation

    The GPIB-232CT Modes of Operation Introduction The GPIB-232CT is capable of operating in one of two modes: S mode or G mode. This chapter helps you determine the mode you will use and the chapters of the manual that apply to that mode.
  • Page 30: Figure 2-1. Personal Computer Controlling A Gpib Plotter

    The GPIB-232CT Modes of Operation Chapter 2 Figure 2-1. Personal Computer Controlling a GPIB Plotter Figure 2-2 shows the GPIB-232CT operating in the G mode where the GPIB-232CT enables a serial printer to be programmed from a GPIB Controller. Figure 2-2. A Serial Printer Connected to a GPIB Controller Now, turn to Chapter 3 for S mode installation and configuration, then to Chapters 4 and 5 to begin programming your GPIB-232CT in S mode.
  • Page 31: Installation And Configuration In S Mode

    Installation and Configuration in S Mode If you plan to operate in S mode, use this chapter to install and configure the GPIB-232CT. Then read Chapters 4 and 5 to learn about its programming messages. Installation There are five basic steps to installing the GPIB-232CT.
  • Page 32: Step 2: Verify The Voltage Requirement

    The serial port is configured at 9600 baud, 1 stop bit, no parity, and 7 data bits. If you wish to change any of the GPIB-232CT parameters, you must open the unit and set the configuration switches. To change the configuration switches follow these steps: 1.
  • Page 33: Set Configuration Switches

    Set Configuration Switches The DIP switch at location U22 on the printed wire board is used to configure the serial port parameters of the GPIB-232CT while in S mode. The DIP switch, shown in Figure 3-1, has eight configuration switches.
  • Page 34: Default Settings For Configuration Switch

    Default Settings for Configuration Switch Figure 3-2 shows the GPIB-232CT's factory default setting for switch U22. Switch 1 is OFF; this indicates that the GPIB-232CT will be operating in S mode. Switch 2 is OFF; this indicates that the GPIB-232CT will be using 7 bits/character for its serial data transfers.
  • Page 35: Step 4: Connect The Cables

    Step 4: Connect the Cables Connect the cables as follows: 1. Connect the serial cable to the GPIB-232CT and securely fasten the holding screws. Connect the other end of the cable to your serial device. Be sure to use only shielded serial cable, and obey all RS-232 cabling restrictions.
  • Page 36: Programming In S Mode

    Chapter 4 Programming in S Mode This chapter describes how to program the GPIB-232CT in S mode using programming messages and data strings. It describes programming messages, their format, and how they are processed, along with the functions and function arguments that make up the programming messages.
  • Page 37: Example Of A Programming Message With Data String

    How Messages are Processed The GPIB-232CT processes a programming message on a line-by-line basis. The GPIB-232CT buffers the entire message, interprets the function name and arguments, then executes the message. The data portions of the wrt and cmd functions are not processed on a line-by-line basis.
  • Page 38: Function Argument Delimiters

    0 = false, off, or disable GPIB Address Each device on the GPIB has a GPIB address. The GPIB-232CT's address is 0 at power on and can be changed using the caddr function. Refer to the manuals of your GPIB devices to learn their addresses. You will need to know these when you begin to program the GPIB-232CT.
  • Page 39: Numeric String Argument

    The function descriptions also explain that the GPIB-232CT returns to you certain information. This means that the GPIB-232CT sends information to you over the serial port. You then read this information from your serial port.
  • Page 40: Serial Port Error Handling

    Serial Port Error Handling The GPIB-232CT continuously monitors the serial port for transmission errors. If it encounters an error in the serial data, the GPIB-232CT records the error. You can program the GPIB-232CT to ignore serial port errors using the spign function.
  • Page 41: S Mode - Default Settings

    Programming in S Mode Chapter 4 S Mode - Default Settings Tables 4-1 and 4-2 list power-on characteristics of the GPIB-232CT and the functions you can use to change those characteristics. Table 4-1. Serial Port Characteristics Power-on Characteristic Value Function...
  • Page 42: List Of S Mode Functions By Group

    Chapter 4 Programming in S Mode List of S Mode Functions by Group The GPIB-232CT functions are divided into three main groups: GPIB functions, Serial Port functions, and General Use functions. GPIB Functions The GPIB functions are divided into subgroups as shown in the following tables.
  • Page 43: Table 4-5. Gpib Initialization Functions

    Change or disable GPIB end-of- string termination mode EOT on/off Enable or disable END termination message on GPIB write operations ONL on/off Place the GPIB-232CT online/ offline RSC on/off Request System Control TMO values Change or disable time limits Table 4-6. Serial Poll Functions...
  • Page 44: Table 4-7. Low-Level Controller Functions

    Set/clear remote enable Table 4-8. Parallel Poll Functions Function Purpose IST on/off Set or clear individual status bit for use in GPIB-232CT response to Parallel Polls PPC values Parallel Poll Configure PPU address list Parallel Poll Unconfigure Conduct (request) a Parallel Poll ©...
  • Page 45: Serial Port Functions

    Change serial port XON/XOFF protocol General Use Functions Table 4-10. General Use Functions Function Purpose Switch to IBCL operating system IBCL Identify system STAT modes Return GPIB-232CT status WAIT mask Wait for selected event(s) GPIB-232CT User Manual 4-10 © National Instruments Corp.
  • Page 46: Alphabetical List Of S Mode Functions

    Go from Active Controller to Standby Switch to IBCL operating system IBCL Identify system IST set/clear Set or clear individual status bit for use in GPIB-232CT response to Parallel Polls LOC address list Go to Local ONL on/off Place the GPIB-232CT online/offline (continues) ©...
  • Page 47 Programming in S Mode Chapter 4 Table 4-11. GPIB-232CT Functions (continued) Function Purpose PCT address Pass Control PPC values Parallel Poll Configure PPU address list Parallel Poll Unconfigure RD count, address Read data Conduct (request) a Parallel Poll RSC on/off...
  • Page 48: Chapter 5 S Mode Functions

    Chapter 5 S Mode Functions This chapter contains descriptions of S mode functions that you use to program the GPIB-232CT. These functions are in alphabetical order and are formatted to provide you an easily usable reference. Points to Remember •...
  • Page 49 It is only necessary for you to send enough characters of the function name to distinguish it from other functions. Those characters are shown in boldface in the syntax portion of each function description. GPIB-232CT User Manual © National Instruments Corp.
  • Page 50: Cac - Become Active Controller

    GPIB-232CT is not the Active Controller and 1 if the GPIB-232CT is the Active Controller. If you call cac with an argument and the GPIB-232CT is not CIC, the GPIB-232CT records the ECIC error. The power-on Controller status of the GPIB-232CT is Idle Controller.
  • Page 51: Caddr - Change The Gpib Address Of The Gpib-232Ct

    GPIB address of the GPIB-232CT. Remarks: The argument addr is a device address that specifies the new GPIB address for the GPIB-232CT. addr consists of a primary address and an optional secondary address. The secondary address is separated from the primary address by a plus sign (+).
  • Page 52 Chapter 5 S Mode Functions Examples: 1. PRINT #1,"caddr 0+22" 'Give GPIB-232CT a 'primary address of 0 'and a secondary 'address of 22. 2. PRINT #1,"CADDR 1" 'Change GPIB-232CT 'primary address to 1 'and disable secondary 'addressing. 3. PRINT #1,"CADDR"...
  • Page 53: Clr - Clear Specified Device

    64, and the secondary address is 2 or 98, which are equivalent. 0+2 or 0+98 or 32+98 or 0+\x62 If you call clr with alist, the GPIB-232CT clears only the devices specified in alist (Selected Device Clear). If you call clr without alist, the GPIB-232CT clears all devices (Device Clear).
  • Page 54 See Also: Appendix D for more information on clearing devices, and Appendix B for more error information. Examples: 1. PRINT #1,"clr 14+30,16+12,18,3+26,6" 'Selectively clear 5 'devices. 2. PRINT #1,"CLR" 'Issue Device Clear to all 'devices. © National Instruments Corp. GPIB-232CT User Manual...
  • Page 55: Cmd - Send Gpib Commands

    For example, the GPIB Untalk (UNT) command is the ASCII character underscore (_). If you call cmd without #count, the GPIB-232CT recognizes the end of the command string when it sees a <CR> or an <LF>. #count is required only if the command string contains a <CR>...
  • Page 56 If you specify #count and enter more than #count command bytes, the excess command bytes up to the <CR><LF> are discarded. If you call cmd and the GPIB-232CT is not CIC, the GPIB-232CT records the ECIC error. If the GPIB-232CT is CIC but not Active Controller, it takes control and asserts ATN before sending the command bytes.
  • Page 57 '43 or ASCII + and GPIB- '232CT talk address is 64 'or ASCII @. PRINT #1,"WRT" 'Write the string "ABCDE" PRINT #1,"ABCDE" 'to device at address 11. 2. PRINT #1,"cmd"+CHR$(13)+"_?W"+CHR$(9) 'Pass control to device 23 '(CHR$(9)=TCT command). GPIB-232CT User Manual 5-10 © National Instruments Corp.
  • Page 58: Echo - Echo Characters Received From Serial Port

    Syntax: echo [bool]<CR> Purpose: You use echo when a terminal is connected to the GPIB-232CT and you wish to display what you type on the screen of the terminal. Remarks: If the argument bool is 1, characters received from the serial port are echoed back to the serial port.
  • Page 59: Eos - Change/Disable Gpib Eos Termination Mode

    GPIB. eos tells the GPIB-232CT when to stop reading information from the GPIB. eos also enables the GPIB-232CT to tell other devices that it is finished writing information to the GPIB. eos defines a specific character, end-of-string (EOS), to be recognized as a string terminator.
  • Page 60 If you call eos with B alone as an argument, the GPIB-232CT records the EARG error. If you call eos without an argument, the GPIB-232CT returns to you the current eos settings. The assignment made by this function remains in effect until you call eos again, call onl, or you turn off the GPIB-232CT.
  • Page 61 'Send EOI with <CR> on 'wrt; do not terminate 'when <CR> is detected 'on rd; compare 7 bits. PRINT #1,"wrt #10 5" 'GPIB-232CT sends EOI with '<CR> (CHR$(13)) to tell 'Listeners that this is 'the last byte of data. PRINT #1,"012345678"...
  • Page 62: Eot - Enable/Disable End Message On Gpib Writes

    Purpose: You use eot at the beginning of your program if you wish to change how the GPIB-232CT terminates GPIB writes. Using eot, you tell the GPIB-232CT to automatically send or not send the GPIB END message with the last byte that it writes to the GPIB.
  • Page 63 'when the last byte (the 'letter E) is sent to tell 'the Listeners it is the 'last byte of data. 3. PRINT #1,"eot" 'What is the current EOT 'setting? response: 1<CR><LF> (END termination is currently enabled) GPIB-232CT User Manual 5-16 © National Instruments Corp.
  • Page 64: Gts - Go From Active Controller To Standby

    GPIB-232CT is in Standby without shadow handshaking; CSB,1 if the GPIB-232CT is in Standby with shadow handshaking; CAC if the GPIB-232CT is CIC but is not in Standby, that is, it is the Active Controller; and CIDLE if the GPIB-232CT is not the CIC, that is, is an IDLE Controller.
  • Page 65 EOS detection if the end-of-string character used by the Talker is not known. If you call gts with an argument and the GPIB-232CT is not CIC, the GPIB-232CT records the ECIC error. See Also: cac.
  • Page 66: Ibcl - Enter Ibcl Operating System

    2. PRINT #1,": init 5 "+CHR$(34)+" IN;"+CHR$(34)+ " wrt," 'Define a word, 'called 'init' to initialize 'an IBM 7320 'Color Plotter. response: ok<CR><LF> 3. PRINT #1,"init" 'Executed the word, 'defined in Example 2. response: ok<CR><LF> © National Instruments Corp. 5-19 GPIB-232CT User Manual...
  • Page 67 S Mode Functions Chapter 5 4. PRINT #1,"bye" 'Exit ibcl and return to 'the NI610 operating 'system. response:* END,CMPL,REM,CIC,LACS NGER NSER *Assuming you had continuous status reporting enabled when you called ibcl. GPIB-232CT User Manual 5-20 © National Instruments Corp.
  • Page 68: Id - Identify System

    Remarks: The identification is returned in three strings. The first two strings identify the company product model, the software revision level, and a copyright notice. The third string identifies the number of bytes of RAM in the GPIB-232CT. Example: 1. PRINT #1,"id"...
  • Page 69: Ist - Set Or Clear Individual Status Bit

    - Set or Clear Individual Status Bit ist: Parallel Poll function Syntax: ist [bool]<CR> Purpose: You use ist when the GPIB-232CT participates in a parallel poll that is conducted by another device that is Active Controller. Remarks: If the argument bool is 1, the GPIB-232CT's individual status bit is set to 1.
  • Page 70: Loc - Go To Local

    64, and the secondary address is 2 or 98, which are equivalent. 0+2 or 0+98 or 32+98 or 0+\x62 If you call loc with alist, the GPIB-232CT places the specified device(s) in local mode using the Go To Local (GTL) command.
  • Page 71 CIC before making this call. Otherwise, the ECIC error will be posted. If you call loc without alist, and the GPIB-232CT is System Controller, the GPIB-232CT returns all devices to local mode by unasserting REN and asserting it again. If you call loc without alist and the GPIB-232CT is not System Controller, the GPIB-232CT records the ESAC error.
  • Page 72: Onl - Place The Gpib-232Ct Online/Offline

    GPIB-232CT and the GPIB, or to reinitialize the GPIB-232CT characteristics to their default values. Remarks: If the argument bool is 1, the GPIB-232CT places itself online. If the argument bool is 0, the GPIB-232CT places itself offline. By default, the GPIB-232CT powers up online, is in the Idle Controller state, and configures itself to be the System Controller.
  • Page 73: Pct - Pass Control

    Controller Idle State. It is assumed that the target device has Controller capability. If you call pct with an argument and the GPIB-232CT is not CIC, it records the ECIC error. If you call pct without an argument, the GPIB-232CT records the EARG error.
  • Page 74: Ppc - Parallel Poll Configure

    Each group of addr,ppr,s can be separated by either a comma or space, just as any list of arguments. If you call ppc without an argument, the GPIB-232CT records the EARG error. If this is the first function you call that requires GPIB Controller capability, and you have not disabled System ©...
  • Page 75 (PPE) message for each addr specified. When addr is the address of the GPIB-232CT, the GPIB-232CT programs itself to respond to a parallel poll by setting its local poll enable (LPE) message to the value specified.
  • Page 76: Ppu - Parallel Poll Unconfigure

    64, and the secondary address is 2 or 98, which are equivalent. 0+2 or 0+98 or 32+98 or 0+\x62 If you call ppu with alist, the GPIB-232CT unconfigures from parallel polls only those devices specified in alist. If you call ppu without alist, the GPIB-232CT unconfigures all devices from parallel polls.
  • Page 77 CIC before making this call. Otherwise, the ECIC error will be posted. If the address of the GPIB-232CT is included in alist, the GPIB-232CT disables itself from responding to parallel polls. See Also: ist, ppc, rpp, and Appendix F, Parallel Polling.
  • Page 78: Rd - Read Data

    GPIB, the GPIB-232CT returns the received GPIB data to you in the following manner. First, the GPIB-232CT returns to you all bytes it read from the GPIB. Next, it sends null bytes until the total number of bytes returned to you matches your requested count.
  • Page 79 10 bytes of data, the END message, or an eos byte. Let's say the GPIB-232CT receives END with the fourth data byte. The GPIB-232CT then returns to you the 4 data bytes, followed by 6 null bytes, followed by an ASCII 4 and <CR><LF>.
  • Page 80 Chapter 5 S Mode Functions If the GPIB-232CT is not CIC and you do not specify the Talker address, the GPIB-232CT assumes it will be addressed by the Controller, then proceeds. If you call rd without an argument, the GPIB-232CT records the EARG error.
  • Page 81: Rpp - Request (Conduct) A Parallel Poll

    Purpose: You use rpp if you wish to conduct a parallel poll to obtain information from several devices at the same time. Remarks: rpp causes the GPIB-232CT to conduct a parallel poll of previously configured devices by sending the IDY message (ATN and EOI both asserted) and reading the response from the GPIB data lines.
  • Page 82 'them. response: 5<CR><LF> (both devices responded positively) INPUT #1,PPR% 'Get parallel poll 'response from serial 'port buffer and assign 'it to integer variable 'PPR%. PRINT #1,"ppu" 'Unconfigure all devices 'from parallel polls. © National Instruments Corp. 5-35 GPIB-232CT User Manual...
  • Page 83: Rsc - Request System Control

    Purpose: You use rsc if some other device in your GPIB system should be System Controller. Remarks: If the argument bool is 1, the GPIB-232CT configures itself to be the GPIB System Controller. If the argument bool is 0, the GPIB-232CT configures itself as not System Controller.
  • Page 84 Chapter 5 S Mode Functions Examples: 1. PRINT #1,"rsc 1" 'Enable GPIB-232CT to be 'System Controller. 2. PRINT #1,"rsc 0" 'Disable system control. 3. PRINT #1,"rsc" 'What is the current 'System Controller 'status? response: 0<CR><LF> (GPIB-232CT is not the System Controller) ©...
  • Page 85: Rsp - Request (Conduct) A Serial Poll

    Consult the device documentation for interpretation of the response byte. GPIB-232CT User Manual 5-38 © National Instruments Corp.
  • Page 86 -1, as the number of addresses you specify. If you call rsp and the GPIB-232CT is not CIC, it attempts to become CIC. If it cannot become CIC, it records the ECIC error. Refer to Appendix B for more information.
  • Page 87 LINE INPUT #1,SPR%(I) 'Store each serial poll IF SPR%(I) = -1 THEN GOSUB 1000 NEXT I 'Response in the array. '1000 is an error routine. REM Code will now interpret poll responses. GPIB-232CT User Manual 5-40 © National Instruments Corp.
  • Page 88: Rsv - Request Service/Set Or Change Serial Poll Status Byte

    Status Byte Type: Serial Poll function Syntax: rsv [spbyte]<CR> Purpose: You use rsv if the GPIB-232CT is not the GPIB Controller and you wish to request service from the Controller using the Service Request (SRQ) signal. The GPIB-232CT will provide a user defined status byte when the Controller serially polls it.
  • Page 89: Sic - Send Interface Clear

    GPIB and makes the interface board become CIC. When needed, sic is generally used at the beginning of a program to make the GPIB-232CT CIC and is used when a bus fault condition is suspected. The IFC signal resets only the GPIB interface functions of bus devices and not the internal device functions.
  • Page 90 Chapter 5 S Mode Functions See Also: clr and Appendix D. Examples: 1. PRINT #1,"sic" 'Send interface clear for '500 microseconds. 2. PRINT #1,"SIC .01" 'Send interface clear for '10 milliseconds. © National Instruments Corp. 5-43 GPIB-232CT User Manual...
  • Page 91: Spign - Ignore Serial Port Errors

    By default, the GPIB-232CT ignores serial port errors. Remarks: If the argument bool is 0, the GPIB-232CT will not ignore serial port errors. When bool is 0, the GPIB-232CT does not execute programming messages that contain serial port errors.
  • Page 92 1. PRINT #1,"spign 0" 'Do not execute programming 'messages or process data 'that contain serial port 'errors. 2. PRINT #1,"spign 1" 'Execute all programming 'messages and send all 'data, even if serial port 'errors occur. © National Instruments Corp. 5-45 GPIB-232CT User Manual...
  • Page 93: Sre - Set (Or Clear) Remote Enable

    Use cmd to send a device its listen address after using sre. Use loc to return the device to local program mode. If you call sre with an argument and the GPIB-232CT is not System Controller, the GPIB-232CT records the ESAC error.
  • Page 94: Stat - Return Gpib-232Ct Status

    [c] s<CR> stat [c] n s<CR> Purpose: You use stat to obtain the status of the GPIB-232CT to see if certain conditions are currently present. You use stat most often to see if the previous operation resulted in an error.
  • Page 95: Table 5-2. Gpib Status Conditions

    Chapter 5 highest order bit of status, also called the sign bit, is set when the GPIB-232CT detects either a GPIB error or a serial port error. Consequently, when status is negative, an error condition exists, and when status is positive, no error condition exists.
  • Page 96: Table 5-3. Gpib Error Conditions

    Table 5-3. GPIB Error Conditions Numeric Symbolic Value (n) Value (s) Description NGER No GPIB error condition to report ECIC Command requires GPIB-232CT to be CIC ENOL Write detected no Listeners EADR GPIB-232CT not addressed correctly EARG Invalid argument or arguments...
  • Page 97: Table 5-4. Serial Port Error Conditions

    A detailed description of the conditions under which each bit in status is set or cleared can be found in Appendix B. In general, the GPIB-232CT updates the first three status variables at the end of each programming message. It updates the fourth status variable, count, after a cmd, rd, or wrt function.
  • Page 98 Chapter 5 S Mode Functions status reporting. After reading the status information returned for the stat call, you call wrt. The GPIB-232CT then returns the status information that corresponds to the wrt message. Refer to the following examples for ways in which to make use of the status information.
  • Page 99 3. The following list illustrates what appears on the screen when you are programming the GPIB-232CT from a terminal. Programming messages you enter are in regular type. GPIB-232CT responses are in boldface. The statements in parentheses are comments. stat c s n (Enable continuous status reporting.) CMPL,REM,ATN,TACS (Status returned.)
  • Page 100: Tmo - Change Or Disable Time Limit

    Type: Initialization function Syntax: tmo [timeio][,timesp]<CR> Purpose: You use tmo at the beginning of your program to change the time limits in effect on the GPIB-232CT. The time limits prevent the GPIB-232CT from hanging indefinitely when waiting for critical events to occur.
  • Page 101 EARG error if you specify a time value outside the range .00001 to 3600. The assignment made by this function remains in effect until you call tmo again, call onl, or turn off the GPIB-232CT. See Also: rsp. Examples: 1.
  • Page 102: Trg - Trigger Selected Device(S)

    If this is the first function you call that requires GPIB Controller capability, and you have not disabled System Controller capability with rsc, the GPIB-232CT sends Interface Clear (IFC) to make itself CIC. It also asserts Remote Enable. If you passed control to some other GPIB device, control must be passed back to you or you must send IFC to make yourself CIC before making this call.
  • Page 103 S Mode Functions Chapter 5 Example: 1. PRINT #1,"trg 2+10,4,5+7" 'Trigger 3 devices. GPIB-232CT User Manual 5-56 © National Instruments Corp.
  • Page 104: Wait - Wait For Selected Event

    Syntax: wait mask<CR> Purpose: You use wait to monitor selected GPIB events and to delay any further GPIB-232CT activity until any of them occur. Remarks: The argument mask is a numeric string that specifies the events to wait for. The numeric string represents a bit mask containing a subset of the same bit assignments as the status word described in the stat function.
  • Page 105: Table 5-5. Wait Mask Values

    Lockout state Remote state Controller-In-Charge Attention asserted TACS Talker active LACS Listener active DTAS Device trigger state DCAS Device clear state If mask=0 the function completes immediately and returns the current status. GPIB-232CT User Manual 5-58 © National Instruments Corp.
  • Page 106 GPIB-232CT waits indefinitely for the event to occur. If you call wait without an argument, the GPIB-232CT records the EARG error. See Also: stat and tmo.
  • Page 107: Wrt - Write Data

    64, and the secondary address is 2 or 98, which are equivalent. 0+2 or 0+98 or 32+98 or 0+\x62 When #count is not specified, the GPIB-232CT recognizes the end of the data string when it encounters a carriage return GPIB-232CT User Manual 5-60 ©...
  • Page 108 CIC before making this call. Otherwise, the ECIC error will be posted. If you do not give an alist and the GPIB-232CT is not CIC, it assumes it will be addressed by the Controller. If you do not give an alist and the GPIB-232CT is CIC, it addresses itself as Talker and assumes the Listeners are already addressed.
  • Page 109 'device at primary PRINT #1,CHR$(A(I)); 'address 9 and NEXT I 'secondary address 97. PRINT #1,CHR$(13); 'Send carriage return. 2. PRINT #1,"wrt 2" 'Write the data bytes ABCDE PRINT #1,"ABCDE" 'at device at address 2. GPIB-232CT User Manual 5-62 © National Instruments Corp.
  • Page 110: Xon - Change Serial Port Xon/Xoff Protocol

    Remarks: The argument booltx specifies whether to enable the XON/XOFF protocol when sending data out on the serial port. If the argument booltx is a 1, the GPIB-232CT monitors its serial receive buffer for XON/XOFF characters as it sends data over the serial port. If it receives the XOFF character (decimal 19 or <CTRL>s), it will immediately stop sending...
  • Page 111 Notice that the comma must precede the argument in this case. The power-on default is that XON/XOFF for both cases is disabled. If you call xon without an argument, the GPIB-232CT returns to you the current settings (1=protocol enabled, 0=protocol disabled).
  • Page 112: Installation And Configuration In G Mode

    Installation and Configuration in G Mode If you plan to operate in G mode, use this chapter to install and configure the GPIB-232CT. Then read Chapters 7 and 8 to learn about the programming messages. Installation There are five basic steps to installing the GPIB-232CT.
  • Page 113: Step 2: Verify The Voltage Requirement

    Installation and Configuration in G Mode Chapter 6 Step 2: Verify the Voltage Requirement The GPIB-232CT is shipped from the factory with either a 115V or 230V wall-mount supply. Verify that the voltage on the supply matches the voltage that is supplied in your area.
  • Page 114: Set Configuration Switches

    "OFF" side. Figure 6-1. G Mode Switch Settings Notice that to put the GPIB-232CT into G mode, Switch 1 of U22 should be ON and Switches 2 and 3 should be in the OFF position. Connecting the serial device to the GPIB-232CT converts the serial device into a GPIB device.
  • Page 115: Table 6-1. Primary Address Configurations

    OFF OFF ON OFF ON OFF OFF ON & OFF OFF OFF ON OFF OFF OFF OFF OFF OFF ON OFF ON OFF ON OFF OFF OFF OFF OFF OFF OFF OFF OFF (continues) GPIB-232CT User Manual © National Instruments Corp.
  • Page 116 Table 6-1. Primary Address Configurations (continued) Listen Talk Switches Primary Address Address Address Dec/ASCII Dec/ASCII OFF OFF ON OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF ON OFF OFF < > © National Instruments Corp. GPIB-232CT User Manual...
  • Page 117: Example Settings For Configuration Switch

    Figure 6-2 shows an example setting of the configuration switch. Switches 1, 2, and 3 are ON, OFF, and OFF, respectively, which indicates that the GPIB-232CT is operating in G mode. Switches 4 through 8 are OFF, OFF, ON, OFF, and ON, respectively. This configures the GPIB-232CT at GPIB address 5 and the serial device at address 6.
  • Page 118: Step 5: Power On The Unit

    Installation and Configuration in G Mode Step 5: Power on the Unit Power on your GPIB-232CT by using the front panel rocker switch. The POWER LED should come on immediately. The READY indicator should come on after the GPIB-232CT has passed its power-on self-test, indicating the unit is ready for operation.
  • Page 119: Programming In G Mode

    Chapter 7 Programming in G Mode This chapter shows how to program the GPIB-232CT in G mode using programming messages. It describes programming messages, their format, and how they are processed, along with the functions and function arguments that make up the programming messages.
  • Page 120: How Messages Are Processed

    How Messages are Processed The GPIB-232CT processes each programming message on a line-by-line basis. The GPIB-232CT buffers the entire message, interprets the function name and arguments, then executes the message. Function Names The function names have been selected to indicate each function's purpose, thereby making your programs easy to understand.
  • Page 121: Status Information

    Communicating with the GPIB-232CT and the Serial Device The GPIB-232CT knows the type of GPIB data it is processing by using dual addressing. With dual addressing, the GPIB-232CT recognizes two different GPIB addresses. The first is the GPIB-232CT's address. The second is the serial device's address.
  • Page 122: The Gpib-232Ct And Serial Device As Listener

    For example, let's say you have a serial printer connected to the GPIB-232CT and you wish to send a data file from your computer over the GPIB to the printer. Ordinarily, when the printer buffer is full, the printer sends the XOFF character;...
  • Page 123: The Gpib-232Ct And Serial Device As Talker

    GPIB-232CT retrieves 100 bytes from its serial port receive buffer and sends them to you. Now, find out if the serial device has sent more bytes to the GPIB-232CT by asking the GPIB-232CT to send you status information. Do this by sending the GPIB-232CT its listen address and the programming message stat n.
  • Page 124: Gpib Read And Write Termination (End And Eos)

    GPIB Read and Write Termination (END and EOS) You program the GPIB-232CT and the serial device to Talk in order to send status information and serial data over the GPIB. You program the GPIB-232CT and the serial device to Listen in order to receive programming messages and serial data from the GPIB.
  • Page 125: G Mode - Default Settings

    You can also determine if a serial port error has occurred by performing a serial poll of the GPIB-232CT and checking the serial poll response byte to see if its ESDR bit is set. Refer to the section on serial poll responses at the end of this chapter.
  • Page 126: List Of G Mode Functions By Group

    List of G Mode Functions by Group Tables 7-3 through 7-5 contain the programming messages that are sent to the GPIB-232CT from a GPIB Talker to configure the GPIB-232CT. The GPIB-232CT functions are divided into three groups: GPIB Configuration functions, Serial Port Configuration functions, and General Use functions.
  • Page 127: Serial Port Configuration Functions

    Change serial port XON/XOFF protocol spign on/off Ignore serial port errors General Use Functions Table 7-5. General Use Functions Function Purpose Identify system onl on/off Place the GPIB-232CT online/ offline stat options Return GPIB-232CT status © National Instruments Corp. GPIB-232CT User Manual...
  • Page 128: List Of G Mode Functions In Alphabetical Order

    Change serial port XON/XOFF protocol Operation of the GPIB-232CT with a Serial Device The serial device attached to the GPIB-232CT looks like any other GPIB device and, as such, is configured to respond in certain ways to GPIB commands. GPIB-610 User Manual 7-10 ©...
  • Page 129: Serial Poll

    Programming in G Mode Serial Poll The GPIB-232CT will respond to a serial poll of the serial device by placing a serial poll response byte on the data lines. Table 7-7 contains the meanings of the bits in the serial poll response byte.
  • Page 130: Parallel Poll

    This has no effect on the GPIB-232CT. Control In G mode, the GPIB-232CT can act only as a Talker/Listener. It does not make sense for the GPIB-232CT to be passed control, since all programming instructions must be sent to it from another GPIB device.
  • Page 131: Device Clear

    Programming in G Mode Device Clear When the GPIB-232CT receives the universal Device Clear (DCL) command or when it receives its listen addresses and the Selected Device Clear (SDC) command, it clears both its status buffer and its serial port receive buffer.
  • Page 132: Chapter 8 G Mode Functions

    Chapter 8 G Mode Functions This chapter contains descriptions of the G mode functions that you use to program the GPIB-232CT. These functions are in alphabetical order and are formatted to provide you with an easily usable reference. Points to Remember •...
  • Page 133 WRT$="SPSET 1200,n,8"+CHR$(13) CALL IBWRT(GPIB232%,WRT$) WRT2$="XON 1,1"+CHR$(13) CALL IBWRT(GPIB232%,WRT$) or, you could put both messages in one string and send it to the GPIB-232CT in one GPIB write: WRT$="SPSET 1200,n,8"+CHR$(13)+"XON 1,1"+CHR$(13) CALL IBWRT(GPIB232%,WRT$) • It is necessary for you to send only enough characters of the function name to distinguish it from other functions.
  • Page 134: Echo - Echo Characters Received From Serial Port

    Syntax: echo [bool]<CR> Purpose: You use echo when a terminal is connected to the GPIB-232CT and you wish to display what you type on the screen of the terminal. Remarks: If the argument bool is 1, characters received from the serial port are echoed back to the serial port.
  • Page 135 1. WRT$="echo 1"+CHR$(13) 'Enable character CALL IBWRT(GPIB232%,WRT$) 'echoing. 2. WRT$="ECHO 0"+CHR$(13) 'Disable character CALL IBWRT(GPIB232%,WRT$) 'echoing. 3. WRT$="echo"+CHR$(13) 'What is the CALL IBWRT(GPIB232%,WRT$) 'current echo CALL IBRD(GPIB232%,RESP$) 'status? 'RESP$ contains '0<CR><LF> '(character echo is 'disabled). GPIB-232CT User Manual © National Instruments Corp.
  • Page 136: Eos - Change/Disable Gpib Eos Termination Mode

    Type: GPIB Configuration function Syntax: eos [[X][B]eoschar]<CR> eos D<CR> Purpose: You use eos to enable the GPIB-232CT to add the GPIB END message to the data string sent by the serial device when the data string contains the specified end-of-string character.
  • Page 137 G Mode Functions Chapter 8 If Methods X, or X and B are chosen, the GPIB-232CT automatically sends the END message along with eoschar when performing GPIB writes of serial data. That is, when the GPIB-232CT receives eoschar over the serial port and sends it on to the GPIB, it will also assert EOI along with that byte.
  • Page 138: Id - Identify System

    Remarks: The identification is returned in three strings. The first two strings identify the company product model, the software revision level, and a copyright notice. The third string identifies the number of bytes of RAM in the GPIB-232CT. Examples: 1. WRT$="id"+CHR$(13) 'Get system 'identification.
  • Page 139: Onl - Place The Gpib-232Ct Online/Offline

    When placed offline, no data is sent out the GPIB-232CT serial port and data coming in to the GPIB-232CT serial port is not saved until onl is called with bool=1. Placing the GPIB-232CT online enables data to be sent and received over its serial port.
  • Page 140: Spign - Ignore Serial Port Errors

    By default, the GPIB-232CT ignores serial port errors. Remarks: If the argument bool is 0, the GPIB-232CT will not ignore serial port errors. When bool is 0, the GPIB-232CT does not store characters that contain serial errors. A list of serial port errors are listed in Appendix B.
  • Page 141: Spset - Change Serial Port Parameters

    9600 bits per second (bps), parity is disabled, there are 8 data bits and 1 stop bit. If you must reconfigure the GPIB-232CT's serial port, do so only when communication with the serial port is not taking place.
  • Page 142 Chapter 8 G Mode Functions Examples: 1. REM Set up the serial port of GPIB-232CT to keep REM its current baud rate, current parity, and REM to use 7 data bits and 2 stop bits. WRT$="spset 7 2"+CHR$(13) CALL IBWRT(GPIB232%,WRT$) 2.
  • Page 143: Srqen - Enable/Disable Setting Of Srq

    - Enable/Disable Setting of SRQ Type: GPIB Configuration function Syntax: srqen [mask]<CR> Purpose: You use srqen when you wish to allow the GPIB-232CT to assert SRQ under the conditions described in Chapter 7 in the section entitled Operation of the GPIB-232CT as a Serial Device.
  • Page 144 12 (4 for GERR and 8 for SERR). The power on default of srqen is disabled, that is, SRQ will never be asserted. If you call srqen without an argument, the GPIB-232CT returns a decimal string that indicates the decimal value of the current setting.
  • Page 145: Stat - Return Gpib-232Ct Status

    [c] s<CR> stat [c] n s<CR> Purpose: You use stat to obtain the status of the GPIB-232CT to see if certain conditions are currently present. You use stat most often to see if the previous operation resulted in an error.
  • Page 146: Table 8-3. Gpib-232Ct Status Conditions

    GPIB-error represents a single GPIB error condition present. serial-error represents a single serial error condition present. count is the number of bytes currently contained in the GPIB-232CT's serial port receive buffer. Table 8-3. GPIB-232CT Status Conditions Numeric Symbolic...
  • Page 147: Table 8-4. Gpib Error Conditions

    G Mode Functions Chapter 8 Table 8-3. GPIB-232CT Status Conditions (continued) Numeric Symbolic Value (n) Value (s) Description — Reserved — Reserved — Reserved Table 8-4. GPIB Error Conditions Numeric Symbolic Value (n) Value (s) Description NGER No GPIB error condition to report —...
  • Page 148: Table 8-5. Serial Error Conditions

    A detailed description of the conditions under which each bit in status is set or cleared can be found in Appendix B. The GPIB-232CT updates status and count at the end of each programming message. It updates GPIB-error and serial-error whenever a new error occurs. GPIB- error and serial-error are cleared only after you have requested status.
  • Page 149 G Mode Functions Chapter 8 Examples: 10 REM Tell GPIB-232CT to send us numeric 20 REM status. 30 WRT$="stat n"+CHR$(13) 40 CALL IBWRT(GPIB232%,WRT$) 50 REM Now read the status from the 60 REM GPIB-232CT. 70 STATUS$=SPACE$(10) : GPIBERR$=SPACE$(10) 80 SPERR$=SPACE$(10) : COUNT$=SPACE$(10) 90 CALL IBRD(GPIB232%,STATUS$) 100 REM Read up to 10 bytes of status.
  • Page 150 10 REM Turn on continuous status reporting, 20 REM in symbolic format. 30 WRT$="stat c s" 40 CALL IBWRT(GPIB232%,WRT$) 50 REM Read the GPIB-232CT status; read 50 60 REM bytes or until EOI is received. 70 RD$=SPACE$(50) 80 CALL IBRD(GPIB232%,RD$) 90 REM Print the status information.
  • Page 151: Xon - Change Serial Port Xon/Xoff Protocol

    XOFF over the serial port (if its serial port recive buffer is almost full). This tells the sender to stop sending data. When the GPIB-232CT has room to safely receive more bytes, the GPIB-232CT sends XON over the serial port.
  • Page 152 Chapter 8 G Mode Functions The power-on default is that XON/XOFF for both cases is disabled. If you call xon without an argument, the GPIB-232CT returns to you the current settings (1=protocol enabled, 0=protocol disabled). Examples: 1. WRT$="XON 1,1"+CHR$(13) 'Enable GPIB-232CT...
  • Page 153: Multiline Interface Messages

    Appendix A Multiline Interface Messages This section contains an interface message reference list, which describes the mnemonics and messages that correspond to the interface functions. These multiline interface messages are sent and received with ATN TRUE. For more information on these messages, refer to the IEEE-488 Std. 488- 1978, IEEE Standard Digital Interface for Programmable Instrumentation.
  • Page 154 MLA27 < MLA28 MLA29 > MLA30 Message Definitions Device Clear My Secondary Address Group Execute Trigger My Talk Address Go To Local Parallel Poll Configure Local Lockout Parallel Poll Disable My Listen Address GPIB-232CT User Manual © National Instruments Corp.
  • Page 155 MTA24 MSA24,PPD MTA25 MSA25,PPD MTA26 MSA26,PPD MTA27 MSA27,PPD MTA28 MSA28,PPD MTA29 MSA29,PPD MTA30 MSA30,PPD Parallel Poll Enable Serial Poll Enable Parallel Poll Unconfigure Take Control Selected Device Clear Unlisten Serial Poll Disable Untalk © National Instruments Corp. GPIB-232CT User Manual...
  • Page 156: Multiline Interface Messages

    MSA or [MSA] my secondary address TE, LE my talk address T, TE [MTA] my talk address other secondary address other talk address T, TE primary command group TE, LE, PP GPIB-232CT User Manual © National Instruments Corp.
  • Page 157 (via C) parallel poll configure (via C) [PPD] parallel poll disable (via C) [PPE] parallel poll enable (via C) PPRn parallel poll response n parallel poll unconfigure (via C) remote enable ready for data © National Instruments Corp. GPIB-232CT User Manual...
  • Page 158 [SDC] selected device clear (via C) serial poll disable (via C) serial poll enable (via C) service request status byte (via T, TE) take control (via C) unlisten (via C) untalk (via C) GPIB-232CT User Manual © National Instruments Corp.
  • Page 159: Status Bits

    Status and Message Information This appendix describes the status and error information that the GPIB-232CT records as it executes each programming message. Items that apply to S mode are marked with an S. Items that apply to G mode are marked with a G.
  • Page 160 This bit is always set, and is useful in identifying the status word from other responses. The LOK bit specifies whether the GPIB-232CT is in a lockout state. The LOK bit is set whenever the GPIB-232CT detects the Local Lockout (LLO) message has been sent either by the GPIB-232CT or by another Controller.
  • Page 161 GPIB-232CT or by another Controller. The REM bit is cleared whenever REN becomes unasserted, or when the GPIB-232CT as a Listener detects the Go to Local (GTL) command has been sent either by the GPIB-232CT or by another Controller, or when the LOC function is called while the LOK bit is cleared in status.
  • Page 162 GPIB-232CT detects that its listen address (and secondary address, if enabled) has been sent either by the GPIB-232CT itself or by another Controller. The LACS bit is also set whenever the GPIB-232CT shadow handshakes as a result of the gts function. The LACS...
  • Page 163 A call to the onl function clears the following bits: TACS LACS DTAS DCAS • A call to onl affects bits other than those listed here according to the rules explained for each bit. © National Instruments Corp. GPIB-232CT User Manual...
  • Page 164: Gpib Error Codes

    GPIB errors as a result of the last operation. ECIC The GPIB-232CT records this error when you call a function that requires that the GPIB-232CT be CIC and it is not CIC. In cases when the GPIB-232CT should always be the...
  • Page 165 Status Information ENOL The most common cause of this error is that the GPIB-232CT attempted to write to the GPIB when no Listeners were addressed. The remedy is to be sure that the proper listen address is in the alist argument string, to use cmd to properly address the Listeners, or to be sure some other controller has addressed the Listeners before you call wrt.
  • Page 166 ESAC The GPIB-232CT records this error when sic or sre is called when the GPIB-232CT does not have System Controller capability. The remedy is to give the GPIB-232CT that capability by calling rsc. (At power on, the GPIB-232CT assumes itself to be the System Controller.)
  • Page 167 Appendix B Status Information EABO The GPIB-232CT records this error when I/O has been cancelled. By far the most common cause of this error is a timeout condition. To remedy a timeout error, if I/O is actually progressing but times out anyway, lengthen the timeout period with tmo.
  • Page 168: Serial Port Error Codes

    Serial Port Error Codes The following paragraphs describe the serial port errors in detail. In S mode, when a serial port error occurs as the GPIB-232CT receives a programming message, the GPIB-232CT posts the error and discards the message. If a serial port error occurs in the middle of a data stream following a cmd or wrt function, the GPIB-232CT discards that data byte and all subsequent data bytes.
  • Page 169 GPIB-232CT does not match your serial device. It can also happen if the baud rates of the GPIB-232CT and your serial device do not match, or if one side of the serial link does not use parity and the other side does.
  • Page 170: Appendix C The Serial Connection

    The RS-232 serial port on the GPIB-232CT uses a 25-pin, D-subminiature connector with a DTE (Data Terminal Equipment) interface configuration. That is, the GPIB-232CT transmits data on pin 2 and receives data on pin 3. Table C-1 shows the signal lines supported on the GPIB-232CT.
  • Page 171 (Receive Data) serial host to the GPIB-232CT. This signal line is asserted by the (Request to GPIB-232CT when it is ready to Send) accept serial data over the RS-232. RTS is unasserted when the GPIB-232CT is no longer ready to accept serial data.
  • Page 172: Interfacing The Gpib-232Ct To A Dce

    Interfacing the GPIB-232CT to a DCE A correctly configured DTE/DCE interface is wired straight across: GPIB-232CT pin 2 to DCE pin 2, pin 3 to pin 3, and so forth. Wired in this manner, the GPIB-232CT can then interact to function properly (handshake).
  • Page 173: Figure C-2. Minimum Dte-To-Dce Cable Configuration

    Appendix C If your serial device does not use the same hardware handshaking protocol as the GPIB-232CT, you can either use a minimum configuration cable and use XON/XOFF handshaking (if necessary), or wire a custom cable that will satisfy the GPIB-232CT hardware handshaking protocol. Figure C-2 shows the connections for a minimum configuration cable.
  • Page 174: Interfacing The Gpib-232Ct To A Dte

    The cable must fool the GPIB-232CT into thinking it is communicating with a DCE. Figure C-3 shows a null modem cable. The GPIB-232CT connector is on the left. Figure C-3. Null Modem Cable Configuration ©...
  • Page 175: Buffering And Handshaking

    RS-232 characteristics and build the cable to perform the desired functions. Buffering and Handshaking The GPIB-232CT is able to accept serial data faster than it is able to process it. Two protection mechanisms are used to ensure that the GPIB-232CT does not lose incoming data: data buffering, and handshaking.
  • Page 176: Hardware Handshake

    The hardware handshake function is always active during RS-232 transfers and uses the Request to Send (RTS) and Clear to Send (CTS) signal lines. When the GPIB-232CT is ready to accept serial data, it asserts the RTS line. This signal remains asserted until the GPIB-232CT's data buffer is almost full.
  • Page 177: Xon/Xoff

    When you enable the XON/XOFF protocol, the GPIB-232CT sends the XOFF character (decimal 19 or <CTRL>s) when its internal buffer becomes full. Once the GPIB-232CT is able to start receiving characters again, it sends the XON character (decimal 17 or <CTRL>q). When you...
  • Page 178: Appendix D Operation Of The Gpib

    Talkers, Listeners, and Controllers A Talker sends data messages to one or more Listeners. The Controller manages the flow of information on the GPIB by sending commands to all devices. © National Instruments Corp. GPIB-232CT User Manual...
  • Page 179 Talker - to send data to an attached GPIB device • Listener - to receive data from an attached GPIB device In G mode, the GPIB-232CT is a GPIB device. It performs only the following two roles: • Talker - to send data to the GPIB host •...
  • Page 180: The Controller-In-Charge And System Controller

    The interface system consists of 16 signal lines and 8 ground return or shield drain lines. The 16 signal lines are divided into the following three groups. • Eight data lines • Three handshake lines • Five interface management lines © National Instruments Corp. GPIB-232CT User Manual...
  • Page 181: Data Lines

    All commands and most data use the 7-bit ASCII or ISO code set, in which case the eighth bit, DI08*, is unused or used for parity. Appendix A lists the GPIB command messages. GPIB-232CT User Manual © National Instruments Corp.
  • Page 182: Handshake Lines

    Five lines are used to manage the flow of information across the interface. ATN* (attention) The Controller drives ATN* true when it uses the data lines to send commands and false when it allows a Talker to send data messages. © National Instruments Corp. GPIB-232CT User Manual...
  • Page 183: Ifc* (Interface Clear

    The GPIB uses negative logic with standard TTL logic levels. When DAV* is true, for example, it is a TTL low level ( • 0.8V), and when DAV* is false, it is a TTL high level ( • 2.0V). GPIB-232CT User Manual © National Instruments Corp.
  • Page 184: Figure D-2. Linear Configuration Of The Gpib Devices

    Appendix D Operation of the GPIB Figure D-2. Linear Configuration of the GPIB Devices © National Instruments Corp. GPIB-232CT User Manual...
  • Page 185: Figure D-3. Star Configuration Of Gpib Devices

    Operation of the GPIB Appendix D Figure D-3. Star Configuration of GPIB Devices GPIB-232CT User Manual © National Instruments Corp.
  • Page 186: Related Document

    • No more than 15 devices connected to each bus, with at least two- thirds powered on. Bus extenders are available from National Instruments and other manufacturers for use when these limits must be exceeded. Related Document For more information on topics covered in this appendix, consult IEEE Standard Digital Interface for Programmable Instrumentation, ANSI/IEEE Std.
  • Page 187: Appendix E Common Questions

    INPUT$ to read the number of bytes you requested in your rd function. The GPIB-232CT appends to the end of the data string a string containing the number of bytes that were actually read from the GPIB. When you have read in the data bytes using INPUT$, use LINE INPUT# to read the string containing the byte count.
  • Page 188 Question I sent the programming message "rsp 10" to the GPIB-232CT to serial poll device 10. Then, I used LINE INPUT# to read the response byte and got nothing but a carriage return and linefeed (<CR><LF>) as a response.
  • Page 189: G Mode

    "stat c s"+chr$(13) Question After I write the programming message "stat c s"+chr$(13) to the GPIB-232CT in G mode, my system times out when I try to read status. Why? Answer Have you addressed the GPIB-232CT to talk? To read responses to...
  • Page 190: Appendix F Parallel Polling

    Thus, a value of 2 (binary 010) corresponds to DIO line 3. The circumstances under which a device sets its IST bit are specific to that device. For example, a device might always set the IST bit to 1 when it is © National Instruments Corp. GPIB-232CT User Manual...
  • Page 191: Configuration

    Controller does not have the capability to do the configuration. Since the GPIB-232CT cannot be the Controller in the G Mode, the GPIB Controller in your system must configure the GPIB-232CT in order to parallel poll it. GPIB-232CT User Manual...
  • Page 192: The Parallel Poll

    ORing of all the responses on that line. In the G Mode, the GPIB-232CT sets its IST bit whenever it asserts SRQ, and clears it whenever it unasserts SRQ. Refer to Chapter 7 for the conditions under which the GPIB-232CT asserts SRQ.
  • Page 193 (dio, s = 0, 0; configuration byte = 01100000), then if any device is free, it will drive the DIO line to 1. Thus, the Controller can use S-bit/IST bit correspondence for different types of information. GPIB-232CT User Manual © National Instruments Corp.
  • Page 194: Appendix G Setting Switches

    7 • stop bits: 1 If these defaults meet your needs, set the switches on the GPIB-232CT as shown in Figure G-1. Figure G-1. S mode, 7 data bits, 1 stop bit, even parity, 300 baud © National Instruments Corp.
  • Page 195: Figure G-2. S Mode, 8 Data Bits, 1 Stop Bit, Even Parity, 19200 Baud

    BASIC statement at the beginning of your program: OPEN "COM1:19200,,8," AS #1 then set the switches on the GPIB-232CT as shown in Figure G-2. Figure G-2. S mode, 8 data bits, 1 stop bit, even parity, 19200 baud As another example, if your computer is an Apple IIc, the default characteristics are as follows: •...
  • Page 196: Figure G-3. S Mode, 8 Data Bits, 1 Stop Bit, No Parity, 9600 Baud

    7 • stop bits: 1 If these defaults meet the needs of your application, set the GPIB-232CT switches as shown in Figure G-4. Figure G-4. S mode, 7 data bits, 1 stop bit, even parity, 300 baud © National Instruments Corp.
  • Page 197: Figure G-5. S Mode, 8 Data Bits, 1 Stop Bit, Even Parity, 9600 Baud

    OPEN "COM1:9600,,8," AS #1 then set the switches on the GPIB-232CT as shown in Figure G-5. Figure G-5. S mode, 8 data bits, 1 stop bit, even parity, 9600 baud If your computer (or terminal) is other than those described above, read your user's manual to learn the default settings of the serial port.
  • Page 198: Appendix H Sample Programs

    4. Communicate with the device using the rd and wrt functions, and check status if you requested it. After you initialize the GPIB-232CT, the rd and wrt functions may be the only functions you will need. © National Instruments Corp.
  • Page 199: Using An Hp 7475A Plotter With A Terminal

    Figure H-1. S mode, 8 data bits, 1 stop bit, no parity, 19200 baud Next, connect the serial cable to the serial port of the terminal and to the GPIB-232CT. Connect the GPIB cable to the GPIB port on your device and to the GPIB-232CT. Power-on the GPIB-232CT.
  • Page 200: Programming Steps

    Programming Steps Step 1. stat Function When using the stat function, use stat c s so the GPIB-232CT will report status after each programming message. In stat c s, the c stands for continuous, and the s stands for symbolic. Because you are using a terminal, it is easier to interpret the status report if it is returned in symbolic form.
  • Page 201: Step 3. Gpib Initialization Functions

    The plotter's address is 5. In the following example, the programming messages and data strings that you enter are shown in regular type. Responses sent to you by the GPIB-232CT are shown in boldface type. By looking at the status information returned after each programming message, you can see if any GPIB or serial port errors occurred, and you can see the number of bytes actually transferred out on the GPIB.
  • Page 202: Using An Hp 7475A Plotter With An Ibm Pc

    BASIC to draw a circle using an HP 7475A Plotter. Getting Ready to Program Before you start programming, determine the serial port settings you will use. Figure H-2 shows how to configure the GPIB-232CT for this example, using the following settings: •...
  • Page 203: Programming Steps

    Send serial port initialization programming messages, if necessary. For this example, this step is not necessary. Step 3. GPIB Initialization Functions Send GPIB initialization programming messages, if necessary. For this example, this step is not necessary. GPIB-232CT User Manual © National Instruments Corp.
  • Page 204: Step 4. Communicate With Rd And Wrt Functions

    STAT%=VAL(LINE INPUT #1, status$) LINE INPUT #1,gpiberr$ LINE INPUT #1,sperr$ LINE INPUT #1,cnt$ PRINT status$ gpiberr$ sperr$ cnt$ if stat% < 0 GOSUB error error: REM Place your code to handle errors here. STOP © National Instruments Corp. GPIB-232CT User Manual...
  • Page 205: Programming A Tektronix 2445 Oscilloscope From An Apple Iic

    Refer to your Applesoft manual for more information. Getting Ready to Program Before you start programming, determine what serial port settings you require. The default settings for the GPIB-232CT as given below are fine for this application. •...
  • Page 206: Programming Steps

    Programming Steps Step 1. stat Function In Applesoft BASIC, you must redirect input and output to the serial port before attempting to communicate with the GPIB-232CT. Place the following statements at the beginning of your program: D$ = CHR$(4) PRINT D$,"PR#1"...
  • Page 207: G Mode Sample Programs

    4. Communicate with the serial device and obtain status from the GPIB-232CT, if desired. After you initialize the GPIB-232CT, you may only need to perform reads and writes from the serial device. To send data to the device you must address the device. To send programming messages to the GPIB-232CT, you must address the GPIB-232CT.
  • Page 208: Getting Ready To Program

    Figure H-4. G mode, primary GPIB address 2 Next, connect the GPIB cable to the GPIB port on your computer and to the GPIB-232CT. Connect the serial cable to the serial port on your device and to the GPIB-232CT. Power-on the GPIB-232CT.
  • Page 209: Programming Steps

    Step 2. GPIB Initialization Functions If there are GPIB functions on the GPIB-232CT you wish to change from their default settings, send strings to the GPIB-232CT at this time. No changes are necessary to communicate with this plotter.
  • Page 210: Step 4. Communicate With Plotter

    Step 4. Communicate with Plotter Before communicating with the plotter, send the initialization strings to the GPIB-232CT. Next, send strings to the plotter (the GPIB-232CT does not interpret these strings, but sends them straight to the plotter). Remember to read status after you send a programming message to the GPIB-232CT.
  • Page 211: Ibm Pc (With Gpib-Pc) To Serial Printer

    Next, check the DIP switch settings on the Imagewriter. Switches 2-1 and 2-2 should be closed for 9600 baud rate. The serial port characteristics of the GPIB-232CT must match those of the serial device. The baud rate of the printer is 9600. Since the configurations match, there is no need to initialize the software of the serial port.
  • Page 212: Programming Steps

    Send stat c n if you want status information returned after each programming message. Next, use the ibrd function to read back status after this string is sent, and after every other string sent to the GPIB-232CT until continuous status is disabled.
  • Page 213 Appendix H 120 'then go to error function. 210 WRT$="Hello, world"+CHR$(13) 220 CALL IBWRT(PRINTER%,WRT$) 'Send string to 'printer. 300 STOP 310 PRINT "An error occurred:" 320 PRINT "status, GPIB-error, serial-error, count:";RD% 330 END GPIB-232CT User Manual H-16 © National Instruments Corp.
  • Page 214 User Comment Form National Instruments encourages you to give us your comments on the documentation supplied with its products. This information helps us provide quality products to meet your needs. Title: GPIB-232CT User Manual Edition Date: July 1992 Part Number: 320114-01 Please comment on the completeness, clarity, and organization of the manual.
  • Page 215 If you find errors in the manual, please record the page numbers and describe the errors. Thank you for your help. Name Title Company Address Phone Mail to: Technical Publications National Instruments Corporation 6504 Bridge Point Parkway, MS 53-02 Austin, TX 78730-5039...

Table of Contents