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 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.
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 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.
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.
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 •...
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...
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...
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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...
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.
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...
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 •...
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.
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"...
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).
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.
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.
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"...
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.
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.
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"...
- 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.
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.
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.
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 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.
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.
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.
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.
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 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.
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.
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.
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.
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.
[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.
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.
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...
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.)
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.
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.
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 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 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.
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).
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.
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.
"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.
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.
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.
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.
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.
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.
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;...
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
- 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.
[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.
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...
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 —...
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.
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...
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.
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...
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.
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.
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.
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).
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.
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.
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.
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 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 •...
• 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.
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.
"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...
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...
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.
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: •...
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.
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.
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.
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.
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: •...
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. •...
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"...
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.
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.
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.
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.
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.
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 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...
Need help?
Do you have a question about the GPIB-232CT and is the answer not in the manual?
Questions and answers