National Instruments GPIB-232 User Manual - About This Manual

Summary of GPIB-232

  • Page 1

    Gpib gpib-232/485ct-a user manual gpib-232/485ct-a user manual november 1999 edition part number 3 70898a -01.

  • Page 2

    Worldwide technical support and product information www.Ni.Com national instruments corporate headquarters 11500 north mopac expressway austin, texas 78759-3504 usa tel: 512 794 0100 worldwide offices australia 03 9879 5166, austria 0662 45 79 90 0, belgium 02 757 00 20, brazil 011 284 5011, canada ...

  • Page 3: Important Information

    Important information warranty the gpib-232/485ct-a is warranted against defects in materials and workmanship for a period of two years from the date of shipment, as evidenced by receipts or other documentation. National instruments will, at its option, repair or replace equipment that proves to be ...

  • Page 4: Compliance

    Compliance fcc/canada radio frequency interference compliance* determining fcc class the federal communications commission (fcc) has rules to protect wireless communications from interference. The fcc places digital electronics into two classes. These classes are known as class a (for use in industr...

  • Page 5

    Interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures: • reorient or relocate the receiving antenna. • increase the separation between the equipmen...

  • Page 6: Contents

    © national instruments corporation vii gpib-232/485ct-a user manual contents about this manual conventions ...................................................................................................................Xv related documentation.........................................................

  • Page 7

    Contents gpib-232/485ct-a user manual viii www.Ni.Com configure the hardware ................................................................................................ 3-3 changing the s mode characteristics ............................................................. 3-3 sample switch settin...

  • Page 8

    Contents © national instruments corporation ix gpib-232/485ct-a user manual eot...................................................................................................................................5-15 gts.....................................................................................

  • Page 9

    Contents gpib-232/485ct-a user manual x www.Ni.Com serial port transmission................................................................................................ 6-7 operation of the gpib-232/485ct-a as a gpib device ............................................. 6-7 serial poll responses ....

  • Page 10

    Contents © national instruments corporation xi gpib-232/485ct-a user manual appendix e interfacing to an rs-485 device appendix f gpib basics appendix g common questions appendix h parallel polling appendix i programming steps and examples appendix j technical support resources glossary index figure...

  • Page 11

    Contents gpib-232/485ct-a user manual xii www.Ni.Com figure 3-4. Sample g mode switch setting ............................................................ 3-7 figure d-1. Straight-through cabling in a dte-to-dce interface ........................ D-3 figure d-2. Null-modem cabling in a dte-to-dce in...

  • Page 12

    Contents © national instruments corporation xiii gpib-232/485ct-a user manual table 4-1. S mode serial port characteristics........................................................4-6 table 4-2. Gpib characteristics in s mode ...........................................................4-7 table 4-3. A...

  • Page 13: About This Manual

    © national instruments corporation xv gpib-232/485ct-a user manual about this manual the gpib-232/485ct-a user manual describes the features, functions, and operation of the gpib-232ct-a and gpib-485ct-a. This manual assumes that you have a general knowledge of rs-232 or rs-485 serial communications...

  • Page 14: Related Documentation

    About this manual gpib-232/485ct-a user manual xvi www.Ni.Com rs-232 rs-232 refers to the ansi/eia-232-c standard. Rs-422 rs-422 refers to the eia-422-a standard. Rs-485 rs-485 refers to the eia-485 standard. Related documentation the following documents contain information that you might find helpf...

  • Page 15: Hardware Overview

    © national instruments corporation 1-1 gpib-232/485ct-a user manual 1 hardware overview this chapter lists what you need to get started and optional equipment you can order, and briefly describes the gpib-232/485ct-a. What you need to get started before you install your gpib hardware, make sure you ...

  • Page 16

    Chapter 1 hardware overview gpib-232/485ct-a user manual 1-2 www.Ni.Com ❑ one of the following shielded cables, compatible with ibm pc, which you can purchase from national instruments: – rs-232 dte-to-dte cable (1, 2, or 4 m) for the gpib-232ct-a – rs-485 null-modem cable (1, 2, or 4 m) for the gpi...

  • Page 17

    Chapter 1 hardware overview © national instruments corporation 1-3 gpib-232/485ct-a user manual nat4882 controller chip implements all ieee 488 talker/listener/controller functionality. Ac version front panel the power switch, fuse holder, and power cord receptacle are located on the gpib-232/485ct-...

  • Page 18

    Chapter 1 hardware overview gpib-232/485ct-a user manual 1-4 www.Ni.Com the leds show the current status of the gpib-232/485ct-a at all times. Table 1-1 describes each led. Rear panel the configuration switches are located on the rear panel of the gpib-232/485ct-a. Figure 1-3 shows the rear panel of...

  • Page 19

    Chapter 1 hardware overview © national instruments corporation 1-5 gpib-232/485ct-a user manual figure 1-4. The ac version rear panel side panels the gpib connector and the serial connector are mounted on opposite side panels. On the dc version, the dc power jack is located next to the serial connec...

  • Page 20

    Chapter 1 hardware overview gpib-232/485ct-a user manual 1-6 www.Ni.Com rs-232 connector the rs-232 port on the gpib-232ct-a is configured as a dte (data terminal equipment) and uses a standard 9-pin shielded d-subminiature male connector with screwlock assemblies. The rs-232 connector accepts stand...

  • Page 21

    Chapter 1 hardware overview © national instruments corporation 1-7 gpib-232/485ct-a user manual rs-485 connector the rs-485 port on the gpib-485ct-a uses a standard 9-pin shielded d-subminiature male connector with screwlock assemblies. The rs-485 connector accepts standard 9-pin d-subminiature fema...

  • Page 22

    Chapter 1 hardware overview gpib-232/485ct-a user manual 1-8 www.Ni.Com gpib connector the gpib connector is a standard 24-pin shielded champ female connector with metric screwlock hardware. Figure 1-8 shows a diagram of the gpib connector and the signals supported. A * suffix indicates that the sig...

  • Page 23: Operating In S Mode And

    © national instruments corporation 2-1 gpib-232/485ct-a user manual 2 operating in s mode and g mode this chapter helps you determine which mode of operation, s mode or g mode, you should use. It also describes data buffering and handshaking schemes. Choosing between s mode and g mode the gpib-232/4...

  • Page 24

    Chapter 2 operating in s mode and g mode gpib-232/485ct-a user manual 2-2 www.Ni.Com figure 2-1 shows an example of a setup using s mode. The gpib-232/485ct-a is connected to a pc, which is controlling a gpib plotter. Figure 2-1. Example of s mode system setup refer to chapter 3, installing and conf...

  • Page 25

    Chapter 2 operating in s mode and g mode © national instruments corporation 2-3 gpib-232/485ct-a user manual figure 2-2 shows an example of a setup using g mode. The gpib-232/485ct-a is connected to a serial printer, which is programmed by the gpib controller. Figure 2-2. Example of g mode system se...

  • Page 26

    Chapter 2 operating in s mode and g mode gpib-232/485ct-a user manual 2-4 www.Ni.Com hardware handshaking the hardware handshake function is always active during serial data transfers and uses the request to send (rts on the gpib-232ct-a, rts+ and rts– on the gpib-485ct-a) and clear to send (cts on ...

  • Page 27

    Chapter 2 operating in s mode and g mode © national instruments corporation 2-5 gpib-232/485ct-a user manual xoff character, it suspends transmission of any further data until it receives the xon character. If you are transmitting binary data (as opposed to 7-bit ascii), do not configure the gpib-23...

  • Page 28: Installing and Configuring

    © national instruments corporation 3-1 gpib-232/485ct-a user manual 3 installing and configuring your controller this chapter contains detailed instructions for connecting and configuring your gpib-232/485ct-a. Check the hardware configuration the ac versions of the gpib-232/485ct-a are shipped with...

  • Page 29: Connect The Hardware

    Chapter 3 installing and configuring your controller gpib-232/485ct-a user manual 3-2 www.Ni.Com connect the hardware complete the following steps to connect the gpib-232/485ct-a to your system. Step 1. Power off your system power off your system, turn off your computer, and unplug the power cord. S...

  • Page 30: Configure The Hardware

    Chapter 3 installing and configuring your controller © national instruments corporation 3-3 gpib-232/485ct-a user manual if you have a dc version, connect the dc power plug of the dc power supply to the power jack on the serial end of the gpib-232/485ct-a, then plug the supply into an ac outlet of t...

  • Page 31

    Chapter 3 installing and configuring your controller gpib-232/485ct-a user manual 3-4 www.Ni.Com note the numbers 1–8 do not appear on the box. They are included in these illustrations as a reference aid. Figure 3-1. Default setting (s mode) for dip switch in figure 3-1, switch 8 is set to s mode, s...

  • Page 32

    Chapter 3 installing and configuring your controller © national instruments corporation 3-5 gpib-232/485ct-a user manual sample switch settings for s mode to operate in s mode, set switch 8 to off. Set the remaining switches to match the characteristics of the terminal or computer you attach to the ...

  • Page 33

    Chapter 3 installing and configuring your controller gpib-232/485ct-a user manual 3-6 www.Ni.Com if these defaults meet the needs of your application, set the gpib-232/485ct-a switches as shown in figure 3-2. Figure 3-2. Switch settings to match ibm pc defaults in many cases, you might want to chang...

  • Page 34

    Chapter 3 installing and configuring your controller © national instruments corporation 3-7 gpib-232/485ct-a user manual changing the g mode characteristics you can use the dip switch on the rear panel to configure the g mode settings. When switch 8 is set to g mode, switches 1 through 5 set the gpi...

  • Page 35

    Chapter 3 installing and configuring your controller gpib-232/485ct-a user manual 3-8 www.Ni.Com shows the switch settings for the first (primary) gpib address and the corresponding serial device address. Table 3-4. Gpib address switch settings for g mode switches gpib-232/ 485ct-a address serial de...

  • Page 36

    Chapter 3 installing and configuring your controller © national instruments corporation 3-9 gpib-232/485ct-a user manual on on on off on 23 24 off off off on on 24 25 on off off on on 25 26 off on off on on 26 27 on on off on on 27 28 off off on on on 28 29 on off on on on 29 30 off on on on on 30 0...

  • Page 37: Programming In S Mode

    © national instruments corporation 4-1 gpib-232/485ct-a user manual 4 programming in s mode this chapter describes how to program the gpib-232/485ct-a in s mode. It explains status information and error handling, programming considerations, programming messages, function arguments, gpib termination ...

  • Page 38: Programming Considerations

    Chapter 4 programming in s mode gpib-232/485ct-a user manual 4-2 www.Ni.Com programming considerations • the programming examples for each function description are in microsoft quickbasic version 4.5. Although the examples in this manual are written in basic, you can program the gpib-232/485ct-a usi...

  • Page 39

    Chapter 4 programming in s mode © national instruments corporation 4-3 gpib-232/485ct-a user manual programming message example 1 the following line of code is an example programming message in basic. Print #1,"clr 3,4" this programming message contains the function name clr and the arguments 3 and ...

  • Page 40: Function Arguments

    Chapter 4 programming in s mode gpib-232/485ct-a user manual 4-4 www.Ni.Com how messages are processed the gpib-232/485ct-a processes a programming message on a line-by-line basis. When the gpib-232/485ct-a receives a message, it buffers the entire message, interprets the function name and arguments...

  • Page 41: (End And Eos)

    Chapter 4 programming in s mode © national instruments corporation 4-5 gpib-232/485ct-a user manual for example, the binary value 01100010 (decimal 98) is interpreted as decimal 2. Each of the following gpib addresses specifies a primary address of 0 and a secondary address of 2. A plus sign (+) sep...

  • Page 42: Function Names

    Chapter 4 programming in s mode gpib-232/485ct-a user manual 4-6 www.Ni.Com byte accompanied by eoi*, regardless of the value of the byte. Eos character the talker sends an eos (end-of-string) character at the end of its data string. The listener stops receiving data when it detects the eos characte...

  • Page 43

    Chapter 4 programming in s mode © national instruments corporation 4-7 gpib-232/485ct-a user manual list of s mode functions by group the gpib-232/485ct-a s mode functions are divided into three main groups: gpib functions, serial port functions, and general use functions. For more information about...

  • Page 44

    Chapter 4 programming in s mode gpib-232/485ct-a user manual 4-8 www.Ni.Com high-level bus management functions—send frequently used bus management instructions to gpib devices. • clr • loc • trg gpib initialization functions—initialize various configurations of the gpib port. • caddr • eos • eot • ...

  • Page 45

    Chapter 4 programming in s mode © national instruments corporation 4-9 gpib-232/485ct-a user manual serial port functions the serial port functions initialize and manage the serial port of the gpib-232/485ct-a. • echo • spign • xon general use functions the general use functions are used for general...

  • Page 46

    Chapter 4 programming in s mode gpib-232/485ct-a user manual 4-10 www.Ni.Com id identify system ist set/clear set or clear individual status bit for use in gpib-232/485ct-a response to parallel polls lines determine state of gpib control lines ln address list check for listening devices loc address ...

  • Page 47

    Chapter 4 programming in s mode © national instruments corporation 4-11 gpib-232/485ct-a user manual for more detailed information on each function, refer to chapter 5, s mode functions ..

  • Page 48: S Mode Functions

    © national instruments corporation 5-1 gpib-232/485ct-a user manual 5 s mode functions this chapter contains descriptions of the s mode functions you can use to program the gpib-232/485ct-a. These functions are in alphabetical order for easy reference. The i/o and high-level bus management functions...

  • Page 49

    Chapter 5 s mode functions — cac gpib-232/485ct-a user manual 5-2 www.Ni.Com cac become active controller type low-level bus management function syntax cac [bool] purpose you can use cac to change the gpib-232/485ct-a from standby controller to active controller when the i/o and high-level bus manag...

  • Page 50

    Chapter 5 s mode functions — cac © national instruments corporation 5-3 gpib-232/485ct-a user manual example 3 print #1,"cac" 'are we the active controller? Response: 1 (...Yes, we are cac).

  • Page 51

    Chapter 5 s mode functions — caddr gpib-232/485ct-a user manual 5-4 www.Ni.Com caddr change the gpib address of gpib-232/485ct-a type initialization function syntax caddr [addr] purpose you can use caddr at the beginning of your program to change the gpib address of the gpib-232/485ct-a. Remarks the...

  • Page 52

    Chapter 5 s mode functions — caddr © national instruments corporation 5-5 gpib-232/485ct-a user manual example 3 print #1,"caddr" 'return current gpib-232/485ct-a address. Response: 1 (current gpib-232/485ct-a address is 1).

  • Page 53

    Chapter 5 s mode functions — clr gpib-232/485ct-a user manual 5-6 www.Ni.Com clr clear specified device* type high-level bus management function syntax clr [alist] purpose you can use clr to reset the internal or device functions of the specified gpib devices. For example, a multimeter might require...

  • Page 54

    Chapter 5 s mode functions — cmd © national instruments corporation 5-7 gpib-232/485ct-a user manual cmd send gpib commands type low-level bus management function syntax cmd [#count] commands purpose you can use cmd when the i/o and high-level bus management functions do not meet the needs of your d...

  • Page 55

    Chapter 5 s mode functions — cmd gpib-232/485ct-a user manual 5-8 www.Ni.Com the cmd operation terminates when: • the gpib-232/485ct-a successfully transfers all commands. • the gpib-232/485ct-a is not controller-in-charge. The ecic error is recorded. • the i/o time limit is exceeded. The eabo error...

  • Page 56

    Chapter 5 s mode functions — conf © national instruments corporation 5-9 gpib-232/485ct-a user manual conf read/change gpib-232/485ct-a configuration type general use function syntax conf option [value] purpose you can use conf to read or change certain configuration parameters of the gpib-232/485ct...

  • Page 57

    Chapter 5 s mode functions — conf gpib-232/485ct-a user manual 5-10 www.Ni.Com example 2 print #1 "conf 0" 'return the current setting for 'the pp2 option. Response: 1 (pp2 mode selected).

  • Page 58

    Chapter 5 s mode functions — echo © national instruments corporation 5-11 gpib-232/485ct-a user manual echo echo characters received from serial port type serial port function syntax echo [bool] purpose you can use echo when a terminal is connected to the gpib-232/485ct-a and you want everything you...

  • Page 59

    Chapter 5 s mode functions — eos gpib-232/485ct-a user manual 5-12 www.Ni.Com eos change/disable gpib eos termination mode type initialization function syntax eos [r[b] eoschar] or eos x[b] eoschar or eos d purpose you can use eos at the beginning of your program if you want to use an eos mode when ...

  • Page 60

    Chapter 5 s mode functions — eos © national instruments corporation 5-13 gpib-232/485ct-a user manual methods x and b together determine when gpib write operations ( wrt ) performed by the gpib-232/485ct-a send the end message. If method x alone is chosen, the end message is sent automatically with ...

  • Page 61

    Chapter 5 s mode functions — eos gpib-232/485ct-a user manual 5-14 www.Ni.Com example 2 print #1,"eos x,13" 'send eoi* with on wrt; do not 'terminate when is detected 'on rd; compare 7 bits. Print #1,"wrt #10 5"+chr$(10)+"012345678" 'gpib-232/485ct-a sends eoi* with '(chr$(13)) to tell listeners tha...

  • Page 62

    Chapter 5 s mode functions — eot © national instruments corporation 5-15 gpib-232/485ct-a user manual eot enable/disable end message on gpib writes type initialization function syntax eot [bool] purpose you can use eot at the beginning of your program if you want to change how the gpib-232/485ct-a t...

  • Page 63

    Chapter 5 s mode functions — eot gpib-232/485ct-a user manual 5-16 www.Ni.Com example 2 print #1,"eot 1" 'send end with last byte. Print #1,"wrt 3"+chr$(10)+abcde" 'write data to device at address 3. 'the eoi* line is automatically 'asserted when the last byte (the letter 'e) is sent to tell the lis...

  • Page 64

    Chapter 5 s mode functions — gts © national instruments corporation 5-17 gpib-232/485ct-a user manual gts go from active controller to standby type low-level bus management function syntax gts [bool] purpose you can use gts to change the gpib-232/485ct-a from active controller to standby controller....

  • Page 65

    Chapter 5 s mode functions — gts gpib-232/485ct-a user manual 5-18 www.Ni.Com if you call gts without an argument, the gpib-232/485ct-a returns the current controller status, as follows: • csb,0 if the gpib-232/485ct-a is in standby without shadow handshaking • csb,1 if the gpib-232/485ct-a is in st...

  • Page 66

    Chapter 5 s mode functions — id © national instruments corporation 5-19 gpib-232/485ct-a user manual id identify system type general use function syntax id purpose you can use id if you want to know the revision level of your software or how much ram is installed in your gpib-232/485ct-a. Remarks th...

  • Page 67

    Chapter 5 s mode functions — ist gpib-232/485ct-a user manual 5-20 www.Ni.Com ist set or clear individual status bit type parallel poll function syntax ist [bool] purpose you can use ist when the gpib-232/485ct-a participates in a parallel poll that is conducted by another device that is active cont...

  • Page 68

    Chapter 5 s mode functions — lines © national instruments corporation 5-21 gpib-232/485ct-a user manual lines return state of gpib control lines type low-level bus management function syntax lines purpose you can use lines to determine the state of the gpib control lines. Remarks this command return...

  • Page 69

    Chapter 5 s mode functions — ln gpib-232/485ct-a user manual 5-22 www.Ni.Com ln check for listening devices type low-level bus management function syntax ln alist purpose you can use ln to determine whether or not there are listening devices at the specified gpib addresses. Remarks the argument alis...

  • Page 70

    Chapter 5 s mode functions — loc © national instruments corporation 5-23 gpib-232/485ct-a user manual loc go to local* type high-level bus management function syntax loc [alist] purpose you can use loc to put a gpib device in local program mode. In this mode you can program the device from its front...

  • Page 71

    Chapter 5 s mode functions — loc gpib-232/485ct-a user manual 5-24 www.Ni.Com see also appendix c, status and error message information . Example 1 print #1,"loc 6+22,4+23,7" 'put 3 devices in local mode. Example 2 print #1,"loc" 'put all devices in local mode. Example 3 print #1,"loc 255" 'put the ...

  • Page 72

    Chapter 5 s mode functions — onl © national instruments corporation 5-25 gpib-232/485ct-a user manual onl place the gpib-232/485ct-a online/offline type initialization function syntax onl [bool] purpose you can use onl to disable communications between the gpib-232/485ct-a and the gpib, or to reinit...

  • Page 73

    Chapter 5 s mode functions — pct gpib-232/485ct-a user manual 5-26 www.Ni.Com pct pass control type low-level bus management function syntax pct addr purpose you can use pct to pass controller-in-charge (cic) authority from the gpib-232/485ct-a to some other gpib device. Remarks the argument addr is...

  • Page 74

    Chapter 5 s mode functions — ppc © national instruments corporation 5-27 gpib-232/485ct-a user manual ppc parallel poll configure type parallel poll function syntax ppc addr,ppr,s [addr,ppr,s]... Purpose you can use ppc to configure specified gpib devices to respond to parallel polls in a certain ma...

  • Page 75

    Chapter 5 s mode functions — ppc gpib-232/485ct-a user manual 5-28 www.Ni.Com gpib-232/485ct-a records the ecap error. The gpib-232/485ct-a does not require gpib controller capability to configure itself for parallel polls. See also conf , ist , ppu , rpp , and appendix h, parallel polling . Example...

  • Page 76

    Chapter 5 s mode functions — ppu © national instruments corporation 5-29 gpib-232/485ct-a user manual ppu parallel poll unconfigure type parallel poll function syntax ppu [alist] purpose you can use ppu if you are performing parallel polls and you want to prevent certain gpib devices from responding...

  • Page 77

    Chapter 5 s mode functions — ppu gpib-232/485ct-a user manual 5-30 www.Ni.Com example 2 print #1,"ppu" 'send the ppu command to all devices. Example 3 print #1,"ppu 255" 'disable the gpib-232/485ct-a from 'responding to parallel polls..

  • Page 78

    Chapter 5 s mode functions — rd © national instruments corporation 5-31 gpib-232/485ct-a user manual rd read data* type i/o function syntax rd #count [addr] purpose you can use rd to read data from the gpib. Remarks the argument count is a numeric string preceded by a number sign (#). Count specifie...

  • Page 79

    Chapter 5 s mode functions — rd gpib-232/485ct-a user manual 5-32 www.Ni.Com you should always read back count bytes of data from the serial port, then look at the numeric string to determine how many bytes were read from the gpib. If you call rd with the addr argument, the gpib-232/485ct-a must be ...

  • Page 80

    Chapter 5 s mode functions — rpp © national instruments corporation 5-33 gpib-232/485ct-a user manual rpp request (conduct) a parallel poll type parallel poll function syntax rpp purpose you can use rpp if you want to conduct a parallel poll to obtain information from several gpib devices at the sam...

  • Page 81

    Chapter 5 s mode functions — rsc gpib-232/485ct-a user manual 5-34 www.Ni.Com rsc request system control type initialization function syntax rsc [bool] purpose you can use rsc if you want to change which device in your gpib system is system controller. Remarks if the argument bool is 1, the gpib-232...

  • Page 82

    Chapter 5 s mode functions — rsc © national instruments corporation 5-35 gpib-232/485ct-a user manual example 2 print #1,"rsc 0" 'disable system control. Example 3 print #1,"rsc" 'what is the current system controller 'status? Response: 0 (gpib-232/485ct-a is not system controller).

  • Page 83

    Chapter 5 s mode functions — rsp gpib-232/485ct-a user manual 5-36 www.Ni.Com rsp request (conduct) a serial poll type serial poll function syntax rsp alist purpose you can use rsp if you want to conduct a serial poll to obtain device-specific status information from one or more gpib devices. Remark...

  • Page 84

    Chapter 5 s mode functions — rsp © national instruments corporation 5-37 gpib-232/485ct-a user manual see also tmo . Example print #1,"rsp 1+28,5,9" 'poll 3 devices. Response: 42 (device 9 did not respond 30 within the timeout period) -1.

  • Page 85

    Chapter 5 s mode functions — rsv gpib-232/485ct-a user manual 5-38 www.Ni.Com rsv request service/set or change serial poll status byte type serial poll function syntax rsv [spbyte] purpose you can use rsv if the gpib-232/485ct-a is not the gpib controller and you want to request service from the co...

  • Page 86

    Chapter 5 s mode functions — sic © national instruments corporation 5-39 gpib-232/485ct-a user manual sic send interface clear type low-level bus management function syntax sic [time] purpose you can use sic if the initialization, i/o, or high-level bus management functions do not meet the needs of ...

  • Page 87

    Chapter 5 s mode functions — sic gpib-232/485ct-a user manual 5-40 www.Ni.Com example 1 print #1,"sic" 'send interface clear for 500 'microseconds. Example 2 print #1,"sic .01" 'send interface clear for 10 'milliseconds..

  • Page 88

    Chapter 5 s mode functions — spign © national instruments corporation 5-41 gpib-232/485ct-a user manual spign ignore serial port errors type serial port function syntax spign [bool] purpose you can use spign at the beginning of your program if you want to change the effect that serial port errors ha...

  • Page 89

    Chapter 5 s mode functions — spign gpib-232/485ct-a user manual 5-42 www.Ni.Com example 2 print #1,"spign 1" 'execute all programming messages and 'send all data, even if serial port 'errors occur..

  • Page 90

    Chapter 5 s mode functions — sre © national instruments corporation 5-43 gpib-232/485ct-a user manual sre set (or clear) remote enable type low-level bus management function syntax sre [bool] purpose use sre to turn the remote enable signal on and off. In some cases, the first i/o or high-level bus ...

  • Page 91

    Chapter 5 s mode functions — stat gpib-232/485ct-a user manual 5-44 www.Ni.Com stat return gpib-232/485ct-a status type general use function syntax stat [[c] n] or stat [c] s or stat [c] n s purpose you can use stat to obtain the status of the gpib-232/485ct-a to see if certain conditions are curren...

  • Page 92

    Chapter 5 s mode functions — stat © national instruments corporation 5-45 gpib-232/485ct-a user manual detects either a gpib error or a serial port error. When status is negative, an error condition exists. Table 5-2 lists the values and descriptions of the gpib status conditions that might be retur...

  • Page 93

    Chapter 5 s mode functions — stat gpib-232/485ct-a user manual 5-46 www.Ni.Com table 5-3 lists values and descriptions of gpib error conditions that might be returned by the stat function. Table 5-4 lists the serial port error conditions that might be returned by the stat function. Table 5-3. S mode...

  • Page 94

    Chapter 5 s mode functions — stat © national instruments corporation 5-47 gpib-232/485ct-a user manual a detailed description of the conditions under which each bit in status is set or cleared can be found in appendix c, status and error message information . In general, the gpib-232/485ct-a updates...

  • Page 95

    Chapter 5 s mode functions — stat gpib-232/485ct-a user manual 5-48 www.Ni.Com 540 print "gpib-error = ";gpiberr% 550 print "serial-error = ";sperr% 560 stop example 2 10 print #1, "stat s" 20 'if it has just read 3 bytes from the 30 'gpib, the gpib-232/485ct-a responds 40 'with:cmpl,cic,lacs 50 'ng...

  • Page 96

    Chapter 5 s mode functions — tmo © national instruments corporation 5-49 gpib-232/485ct-a user manual tmo change or disable time limit type initialization function syntax tmo [timeio][,timesp] purpose you can use tmo at the beginning of your program to change the time limits in effect on the gpib-23...

  • Page 97

    Chapter 5 s mode functions — tmo gpib-232/485ct-a user manual 5-50 www.Ni.Com the assignment made by tmo remains in effect until you call tmo again, call onl , or turn off the gpib-232/485ct-a. See also rsp . Example 1 print #1,"tmo 30" 'set timeout for i/o operations to 30 'seconds. Example 2 print...

  • Page 98

    Chapter 5 s mode functions — trg © national instruments corporation 5-51 gpib-232/485ct-a user manual trg trigger selected device(s)* type high-level bus management function syntax trg alist purpose you can use trg to trigger the specified gpib devices. The documentation for each gpib device explain...

  • Page 99

    Chapter 5 s mode functions — wait gpib-232/485ct-a user manual 5-52 www.Ni.Com wait wait for selected event type general use function syntax wait mask purpose you can use wait to monitor selected gpib events and to delay further gpib-232/485ct-a activity until any of them occur. Remarks the argument...

  • Page 100

    Chapter 5 s mode functions — wait © national instruments corporation 5-53 gpib-232/485ct-a user manual table 5-5 lists the wait mask values. If mask=0 the function completes immediately and returns the current status. If the timo bit is 0 or the timeio time limit is set to 0 by tmo , timeouts for th...

  • Page 101

    Chapter 5 s mode functions — wait gpib-232/485ct-a user manual 5-54 www.Ni.Com example 1 print #1,"wait \x5000" 'wait for timo or srqi. Input#1,status%,gpiberr%,sperr%,count% 'get status info. If (status% and &h4000) 0 then goto 1000 'if timo bit is set we timed out before 'getting srqi. Go to an er...

  • Page 102

    Chapter 5 s mode functions — wrt © national instruments corporation 5-55 gpib-232/485ct-a user manual wrt write data* type i/o function syntax wrt [#count][alist] data purpose you can use wrt to send data over the gpib. Remarks the argument data is a string of 8-bit characters that are transferred, ...

  • Page 103

    Chapter 5 s mode functions — wrt gpib-232/485ct-a user manual 5-56 www.Ni.Com after wrt terminates, the gpib-232/485ct-a records the number of data bytes it actually sent. If one of the errors described above occurs the count might be less than expected. If an error occurs and the gpib-232/485ct-a i...

  • Page 104

    Chapter 5 s mode functions — xon © national instruments corporation 5-57 gpib-232/485ct-a user manual xon change serial port xon/xoff protocol type serial port function syntax xon [booltx][,boolrx] purpose you can use xon at the beginning of your program to configure the gpib-232/485ct-a to communic...

  • Page 105

    Chapter 5 s mode functions — xon gpib-232/485ct-a user manual 5-58 www.Ni.Com if you call xon without an argument, the gpib-232/485ct-a returns the current handshake settings: 1 if the protocol is enabled or 0 if protocol is disabled. The assignment made by xon remains in effect until you call xon a...

  • Page 106: Programming In G Mode

    © national instruments corporation 6-1 gpib-232/485ct-a user manual 6 programming in g mode this chapter describes how to program the gpib-232/485ct-a in g mode. It describes status and error handling information, programming considerations, programming messages, function arguments, addressing in g ...

  • Page 107: Programming Messages

    Chapter 6 programming in g mode gpib-232/485ct-a user manual 6-2 www.Ni.Com • the following ni-488.2 function call addresses the gpib-232/485ct-a to listen and sends it the programming message spset , followed by a carriage return. Wrt$="spset"+chr$(13) call ibwrt(gpib232%,wrt$) if you are not using...

  • Page 108: Function Arguments

    Chapter 6 programming in g mode © national instruments corporation 6-3 gpib-232/485ct-a user manual second line of the example is a ni-488.2 function call that allows a personal computer to control the gpib from microsoft basic. This function outputs the string in wrt$ to the gpib-232/485ct-a. Progr...

  • Page 109

    Chapter 6 programming in g mode gpib-232/485ct-a user manual 6-4 www.Ni.Com abbreviations for arguments the term bool is an abbreviation used for an argument in the function descriptions. The values for bool are 1 = true, on, or enable and 0 = false, off, or disable. Addressing the gpib-232/485ct-a ...

  • Page 110

    Chapter 6 programming in g mode © national instruments corporation 6-5 gpib-232/485ct-a user manual follow these steps to send a data file from your computer to a serial printer: 1. Address the gpib-232/485ct-a to listen by sending its listen address. 2. Send the programming message xon ,1 to the gp...

  • Page 111: (End And Eos)

    Chapter 6 programming in g mode gpib-232/485ct-a user manual 6-6 www.Ni.Com to send, it responds to gpib reads with a carriage return and a linefeed, accompanied by end. The status information returned to you contains the number of bytes remaining in the serial port receive buffer. This information ...

  • Page 112: Serial Port Transmission

    Chapter 6 programming in g mode © national instruments corporation 6-7 gpib-232/485ct-a user manual serial port transmission the gpib-232/485ct-a checks the data received from the serial device for errors while it buffers data. If a serial port error occurs, the gpib-232/485ct-a records the appropri...

  • Page 113

    Chapter 6 programming in g mode gpib-232/485ct-a user manual 6-8 www.Ni.Com service request conditions you can program the gpib-232/485ct-a to assert service request (srq*) in a variety of cases. After you power on, the gpib-232/485ct-a defaults to never asserting service request. Using the srqen fu...

  • Page 114: Function Names

    Chapter 6 programming in g mode © national instruments corporation 6-9 gpib-232/485ct-a user manual take control (tct) this command has no effect on the gpib-232/485ct-a. It would not make sense for control to pass to the gpib-232/485ct-a, since all programming messages and gpib commands must be sen...

  • Page 115

    Chapter 6 programming in g mode gpib-232/485ct-a user manual 6-10 www.Ni.Com g mode default settings and related functions tables 6-2 and 6-3 list power-on characteristics of the gpib-232/485ct-a and the functions you can use to change those characteristics. List of g mode functions by group the gpi...

  • Page 116

    Chapter 6 programming in g mode © national instruments corporation 6-11 gpib-232/485ct-a user manual gpib functions gpib functions manage the gpib port of the gpib-232/485ct-a. • eos • srqen serial port functions serial port functions initialize and manage the serial port of the gpib-232/485ct-a. • ...

  • Page 117

    Chapter 6 programming in g mode gpib-232/485ct-a user manual 6-12 www.Ni.Com srqen mask set conditions for asserting srq* stat options return gpib-232/485ct-a status xon modes change serial port xon/xoff protocol table 6-4. Alphabetical list of g mode functions (continued) function purpose.

  • Page 118: G Mode Functions

    © national instruments corporation 7-1 gpib-232/485ct-a user manual 7 g mode functions this chapter contains descriptions of the g mode functions that you can use to program the gpib-232/485ct-a. These functions are in alphabetical order for easy reference. For general information about using g mode...

  • Page 119

    Chapter 7 g mode functions — echo gpib-232/485ct-a user manual 7-2 www.Ni.Com echo echo characters received from serial port type serial port function syntax echo [bool] purpose you can use echo when a terminal is connected to the gpib-232/485ct-a and you want everything you type to display on the s...

  • Page 120

    Chapter 7 g mode functions — echo © national instruments corporation 7-3 gpib-232/485ct-a user manual example 3 wrt$="echo"+chr$(13) 'what is the call ibwrt(gpib232%,wrt$) 'current echo call ibrd(gpib232%,resp$) 'status? 'resp$ contains '0 '(character echo is 'disabled)..

  • Page 121

    Chapter 7 g mode functions — eos gpib-232/485ct-a user manual 7-4 www.Ni.Com eos change/disable gpib eos termination mode type gpib function syntax eos [x[b]eoschar] or eos d purpose you can use eos to enable the gpib-232/485ct-a to add the gpib end message to the data string sent by the serial devi...

  • Page 122

    Chapter 7 g mode functions — eos © national instruments corporation 7-5 gpib-232/485ct-a user manual if b is the only mode chosen, the earg error is posted. If d is chosen, all eos modes are disabled. By default, all eos modes are disabled. If you call eos without an argument, the gpib-232/485ct-a r...

  • Page 123

    Chapter 7 g mode functions — id gpib-232/485ct-a user manual 7-6 www.Ni.Com id identify system type general use function syntax id purpose you can use id if you want to know the revision level of your software or how much ram is installed in your gpib-232/485ct-a. Remarks the identification is retur...

  • Page 124

    Chapter 7 g mode functions — onl © national instruments corporation 7-7 gpib-232/485ct-a user manual onl place the gpib-232/485ct-a online/offline type general use function syntax onl [bool] purpose you can use onl to disable communication between the gpib-232/485ct-a and the serial port, or to rese...

  • Page 125

    Chapter 7 g mode functions — spign gpib-232/485ct-a user manual 7-8 www.Ni.Com spign ignore serial port errors type serial port function syntax spign [bool] purpose you can use spign at the beginning of your program if you want to change the effect that serial port errors have on the storage of a ch...

  • Page 126

    Chapter 7 g mode functions — spset © national instruments corporation 7-9 gpib-232/485ct-a user manual spset change serial port parameters type serial port function syntax spset [baud] [parity] [databits] [stopbits] purpose you can use spset at the beginning of your program to set the gpib-232/485ct...

  • Page 127

    Chapter 7 g mode functions — spset gpib-232/485ct-a user manual 7-10 www.Ni.Com example 2 'what are the current gpib-232/485ct-a serial port settings? Wrt$="spset"+chr$(13) call ibwrt(gpib232%,wrt$) 'resp$ will contain 9600,n,7,2 '(9600 baud, no parity, 7 data bits, '2 stop bits). Call ibrd(gpib232%...

  • Page 128

    Chapter 7 g mode functions — srqen © national instruments corporation 7-11 gpib-232/485ct-a user manual srqen enable/disable setting of srq* type gpib function syntax srqen [mask] purpose you can use srqen when you want to allow the gpib-232/485ct-a to assert srq* under the conditions described in c...

  • Page 129

    Chapter 7 g mode functions — srqen gpib-232/485ct-a user manual 7-12 www.Ni.Com to determine the mask value you want, add up the hex or decimal values of each of the conditions on which you want srq* to be asserted. For example, if you want srq* asserted on gpib errors and serial port errors you sho...

  • Page 130

    Chapter 7 g mode functions — stat © national instruments corporation 7-13 gpib-232/485ct-a user manual stat return gpib-232/485ct-a status type general use function syntax stat [[c] n] or stat [c] s or stat [c] n s purpose you can use stat to obtain the status of the gpib-232/485ct-a to see if certa...

  • Page 131

    Chapter 7 g mode functions — stat gpib-232/485ct-a user manual 7-14 www.Ni.Com table 7-3 lists the values and descriptions of gpib status conditions that might be returned by the stat function. The gpib error code represents a single gpib error condition present. The serial error code represents a s...

  • Page 132

    Chapter 7 g mode functions — stat © national instruments corporation 7-15 gpib-232/485ct-a user manual table 7-4 lists the values and descriptions of gpib error conditions that might be returned by the stat function. Table 7-5 lists the serial port errors that might be returned by the stat function....

  • Page 133

    Chapter 7 g mode functions — stat gpib-232/485ct-a user manual 7-16 www.Ni.Com when you want to begin continuous status reporting, send the stat c s , stat c n , or stat c n s programming message. When you call stat with both n and s modes specified, the numeric status is always returned first. The ...

  • Page 134

    Chapter 7 g mode functions — stat © national instruments corporation 7-17 gpib-232/485ct-a user manual 90 'bytes or until eoi is received. 100 rd$=space$(30) 110 call ibrd(gpib232%,rd$) 120 'print the status information. 130 print "gpib-232/485ct-a status is: ";rd$ example 3 10 'turn on continuous s...

  • Page 135

    Chapter 7 g mode functions — xon gpib-232/485ct-a user manual 7-18 www.Ni.Com xon change serial port xon/xoff protocol type serial port function syntax xon [booltx][,boolrx] purpose you can use xon at the beginning of your program to configure the gpib-232/485ct-a to communicate over the serial port...

  • Page 136

    Chapter 7 g mode functions — xon © national instruments corporation 7-19 gpib-232/485ct-a user manual if you call xon without an argument, the gpib-232/485ct-a returns the current handshake setting: 1 if the protocol is enabled or 0 if protocol is disabled. The assignment made by xon remains in effe...

  • Page 137: Specifications

    © national instruments corporation a-1 gpib-232/485ct-a user manual a specifications this appendix contains tables which specify the electrical, environmental, and physical characteristics of the gpib-232/485ct-a, as well as the ieee 488 capability codes. Electrical characteristics ac version power ...

  • Page 138

    Appendix a specifications gpib-232/485ct-a user manual a-2 www.Ni.Com environmental characteristics ac version operating temperature ............................10 to 40 °c storage temperature ................................0 to 70 °c relative humidity ...................................10% to 95%,...

  • Page 139

    Appendix a specifications © national instruments corporation a-3 gpib-232/485ct-a user manual the ieee 488 standard specifies allowable subsets of interface functions. The codes supported by the gpib-232/485ct-a are detailed in table a-1. For more information, refer to the ansi/ieee standard 488.1-1...

  • Page 140: Multiline Interface Messages

    © national instruments corporation b-1 gpib-232/485ct-a user manual b multiline interface messages this appendix lists the multiline interface messages and describes the mnemonics and messages that correspond to the interface functions. The multiline interface messages are commands defined by the ie...

  • Page 141

    Appendix b multiline interface messages gpib-232/485ct-a user manual b-2 www.Ni.Com table b-1. Multiline interface messages hex dec ascii message hex dec ascii message 00 0 nul — 20 32 sp mla0 01 1 soh gtl 21 33 ! Mla1 02 2 stx — 22 34 " mla2 03 3 etx — 23 35 # mla3 04 4 eot sdc 24 36 $ mla4 05 5 en...

  • Page 142

    Appendix b multiline interface messages © national instruments corporation b-3 gpib-232/485ct-a user manual 40 64 @ mta0 60 96 ` msa0, ppe 41 65 a mta1 61 97 a msa1, ppe, cfg1 42 66 b mta2 62 98 b msa2, ppe, cfg2 43 67 c mta3 63 99 c msa3, ppe, cfg3 44 68 d mta4 64 100 d msa4, ppe, cfg4 45 69 e mta5...

  • Page 143

    Appendix b multiline interface messages gpib-232/485ct-a user manual b-4 www.Ni.Com multiline interface message definitions cfe † configuration enable cfg † configure dcl device clear get group execute trigger gtl go to local llo local lockout mla my listen address msa my secondary address mta my ta...

  • Page 144: Status and Error Message

    © national instruments corporation c-1 gpib-232/485ct-a user manual c status and error message information this appendix describes the status and error information that the gpib-232/485ct-a records as it executes each programming message. This information is returned in response to the stat command,...

  • Page 145

    Appendix c status and error message information gpib-232/485ct-a user manual c-2 www.Ni.Com functions (for example, rd , wrt , and cmd ), if a timeout occurs during a call. The timo bit is cleared in the status word in all other circumstances. End s mode 8192 the end bit specifies whether the end or...

  • Page 146

    Appendix c status and error message information © national instruments corporation c-3 gpib-232/485ct-a user manual (gtl) command, or when the loc function is called while the lok bit is cleared in status. A call to onl also clears rem. Cic s mode 32 the cic bit specifies whether the gpib-232/485ct-...

  • Page 147: Gpib Error Codes

    Appendix c status and error message information gpib-232/485ct-a user manual c-4 www.Ni.Com dtas s mode 2 the dtas bit specifies whether the gpib-232/485ct-a has detected a device trigger command. The dtas bit is set whenever the gpib-232/485ct-a as a listener, detects that another controller has se...

  • Page 148

    Appendix c status and error message information © national instruments corporation c-5 gpib-232/485ct-a user manual ( 256 ) to delay further processing until control is passed to the gpib-232/485ct-a. Enol s mode 2 the enol error occurs most frequently when the gpib-232/485ct-a attempts to write dat...

  • Page 149

    Appendix c status and error message information gpib-232/485ct-a user manual c-6 www.Ni.Com earg s or g mode 4 the gpib-232/485ct-a records this error when you pass an invalid argument to a function call. The following are some examples: • tmo called with a value not in the range .00001 to 3600 • si...

  • Page 150: Serial Port Error Codes

    Appendix c status and error message information © national instruments corporation c-7 gpib-232/485ct-a user manual ecap s or g mode 11 this error results when a particular capability has been disabled in the gpib-232/485ct-a and a call is made that attempts to make use of that capability. A common ...

  • Page 151

    Appendix c status and error message information gpib-232/485ct-a user manual c-8 www.Ni.Com nser 0 the gpib-232/485ct-a reports this value when there is no serial port error detected as a result of the last operation. Epar 1 the gpib-232/485ct-a records this error when the parity of the received cha...

  • Page 152: Rs-232 Standard

    © national instruments corporation d-1 gpib-232/485ct-a user manual d interfacing to an rs-232 device this appendix describes the rs-232 serial port on the gpib-232ct-a and explains how to interface a dce or dte serial device to the rs-232 serial port. The gpib-232ct-a transfers serial data using th...

  • Page 153: Dte Vs. Dce

    Appendix d interfacing to an rs-232 device gpib-232/485ct-a user manual d-2 www.Ni.Com description of the rs-232 port the rs-232 serial port on the gpib-232ct-a uses a male 9-pin d-subminiature connector with a dte interface configuration. Table d-1 shows the signal lines supported on the gpib-232ct...

  • Page 154

    Appendix d interfacing to an rs-232 device © national instruments corporation d-3 gpib-232/485ct-a user manual a dte directly to a dce and vice versa, the pinouts were defined so that cabling was simple. That is, a cable connected a computer to a modem by wiring pin 1 to pin 1, pin 2 to pin 2, and s...

  • Page 155

    Appendix d interfacing to an rs-232 device gpib-232/485ct-a user manual d-4 www.Ni.Com figure d-3 shows the location of the rs-232 connector. Figure d-3. Location of the rs-232 connector interfacing the gpib-232ct-a to a dce with handshaking a correctly configured dte-to-dce interface is wired strai...

  • Page 156

    Appendix d interfacing to an rs-232 device © national instruments corporation d-5 gpib-232/485ct-a user manual buffer full conditions. Figure d-5 shows an equivalent 9-pin dte to 25-pin dce cable configuration. Figure d-4. Cable configuration for 9-pin dte to 9-pin dce with handshaking figure d-5. C...

  • Page 157

    Appendix d interfacing to an rs-232 device gpib-232/485ct-a user manual d-6 www.Ni.Com • wire a custom cable that properly interfaces the gpib-232ct-a hardware handshaking protocol to the handshaking protocol of your serial device. Minimum configuration cable the minimum configuration cable assumes ...

  • Page 158

    Appendix d interfacing to an rs-232 device © national instruments corporation d-7 gpib-232/485ct-a user manual custom cables if your application requires a custom cable, you can construct one if you have a thorough knowledge of the handshaking protocols involved. Review the rs-232 characteristics of...

  • Page 159

    Appendix d interfacing to an rs-232 device gpib-232/485ct-a user manual d-8 www.Ni.Com the cable configuration in figure d-8 allows you to connect to the 9-pin serial port of a personal computer. The cable in figure d-9 shows how to connect to the 25-pin serial port of a personal computer. Figure d-...

  • Page 160

    Appendix d interfacing to an rs-232 device © national instruments corporation d-9 gpib-232/485ct-a user manual • wire a custom cable that properly interfaces the gpib-232ct-a hardware handshaking protocol to the handshaking protocol of your serial device. Minimum configuration cable the minimum cabl...

  • Page 161

    Appendix d interfacing to an rs-232 device gpib-232/485ct-a user manual d-10 www.Ni.Com custom cables if your application requires a custom cable, you can construct one if you have a thorough knowledge of the handshaking protocols involved. Review the rs-232 characteristics of your serial device and...

  • Page 162: Rs-422

    © national instruments corporation e-1 gpib-232/485ct-a user manual e interfacing to an rs-485 device this appendix describes the rs-485 serial port on the gpib-485ct-a and explains how to interface an rs-485 device to the rs-485 serial port. The gpib-485ct-a transfers serial data using the electric...

  • Page 163: Rs-485

    Appendix e interfacing to an rs-485 device gpib-232/485ct-a user manual e-2 www.Ni.Com rs-485 rs-485, as specified in the eia-485 standard, standard for electrical characteristics of generators and receivers for use in balanced digital multipoint systems, expands on the rs-422 standard by increasing...

  • Page 164

    Appendix e interfacing to an rs-485 device © national instruments corporation e-3 gpib-232/485ct-a user manual table e-1. Rs-485 serial port signal configuration pin number signal description function 1 gnd (ground) this signal establishes a reference point for all interface voltages. 2 cts+ (hsi+) ...

  • Page 165

    Appendix e interfacing to an rs-485 device gpib-232/485ct-a user manual e-4 www.Ni.Com interfacing serial devices to the rs-485 serial port the gpib-485ct-a is a full-duplex, point-to-point device. Separate wires must be connected for the txd, rxd, cts, and rts lines. For example, to connect the gpi...

  • Page 166

    Appendix e interfacing to an rs-485 device © national instruments corporation e-5 gpib-232/485ct-a user manual rs-485 termination connector that contains embedded terminating resistors for easy termination. Figure e-2 shows a full-duplex system with termination. Figure e-2. Point-to-point network us...

  • Page 167: Gpib Basics

    © national instruments corporation f-1 gpib-232/485ct-a user manual f gpib basics this appendix contains information about how the gpib operates, including information about gpib messages, the roles of talkers, listeners, and controllers, gpib signals and lines, and connecting and configuring device...

  • Page 168

    Appendix f gpib basics gpib-232/485ct-a user manual f-2 www.Ni.Com 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. Devices can be listeners, talkers, and/or contr...

  • Page 169: Gpib Signals and Lines

    Appendix f gpib basics © national instruments corporation f-3 gpib-232/485ct-a user manual in g mode, the gpib-232/485ct-a acts as a gpib device. It performs only the following two roles: • talker—to send data to the gpib host • listener—to receive data from the gpib host the controller-in-charge an...

  • Page 170

    Appendix f gpib basics gpib-232/485ct-a user manual f-4 www.Ni.Com figure f-1 shows the arrangement of these signals and lines on the gpib cable connector (a * suffix indicates that the signal is active low). Figure f-1. Gpib connector signals and lines data lines the eight data lines, dio1* through...

  • Page 171

    Appendix f gpib basics © national instruments corporation f-5 gpib-232/485ct-a user manual ndac* (not data accepted) ndac* indicates when a device has or has not accepted a message byte. The line is driven by all devices when receiving commands and by listeners when receiving data messages. Dav* (da...

  • Page 172

    Appendix f gpib basics gpib-232/485ct-a user manual f-6 www.Ni.Com connecting devices on the bus devices are usually connected with a cable assembly consisting of a shielded 24 conductor cable with both a plug and receptacle connector at each end. This design allows devices to be linked in either a ...

  • Page 173

    Appendix f gpib basics © national instruments corporation f-7 gpib-232/485ct-a user manual figure f-3. Star configuration of gpib devices configuring devices on the bus if you want to achieve the high data transfer rate that the gpib was designed for, you must limit the physical distance between dev...

  • Page 174: Common Questions

    © national instruments corporation g-1 gpib-232/485ct-a user manual g common questions this appendix contains answers to common questions about s mode and g mode. S mode questions why is there an unmarked dip switch on my gpib-232/485ct-a? The second dip switch is reserved for future expansion and s...

  • Page 175: G Mode Questions

    Appendix g common questions gpib-232/485ct-a user manual g-2 www.Ni.Com when i use line input# , my strings are usually preceded by a linefeed () and followed by a carriage return (). Why don’t my strings contain both a carriage return and linefeed at the end? Line input# stops reading when a carria...

  • Page 176

    Appendix g common questions © national instruments corporation g-3 gpib-232/485ct-a user manual after i write the programming message "stat c s"+chr$(13) to the gpib-232/485ct-a in g mode, my system times out when i try to read status. Why? Make sure you have addressed the gpib-232/485ct-a to talk. ...

  • Page 177: Parallel Polling

    © national instruments corporation h-1 gpib-232/485ct-a user manual h parallel polling this appendix explains the use and operation of parallel polls. By using parallel polls, a gpib controller can obtain information from several devices on the gpib in one operation. The controller polls configured ...

  • Page 178: Configuration

    Appendix h parallel polling gpib-232/485ct-a user manual h-2 www.Ni.Com configuration there are two methods by which a device can be configured to respond to parallel polls. Only one of these two methods may be used by a device. • the device configures itself. This is referred to in the ieee 488 spe...

  • Page 179

    Appendix h parallel polling © national instruments corporation h-3 gpib-232/485ct-a user manual table h-1 contains a list of the parallel poll message bits and a description of each bit. Because the u bit is set in all of the ppd messages, they all have the same effect. All of the ppd messages disab...

  • Page 180

    Appendix h parallel polling gpib-232/485ct-a user manual h-4 www.Ni.Com the ppc function is used to enable gpib devices to respond to parallel polls, and the ppu function is used to disable parallel poll responses. For every addr , ppr , s configuration, the ppc function sends the talk address of th...

  • Page 181: The Parallel Poll

    Appendix h parallel polling © national instruments corporation h-5 gpib-232/485ct-a user manual the parallel poll in s mode, after parallel poll configuration is complete, the gpib-232/485ct-a conducts a parallel poll by calling rpp . In the previous example, where the device was remotely configured...

  • Page 182

    Appendix h parallel polling gpib-232/485ct-a user manual h-6 www.Ni.Com example 1 figure h-3 shows an example parallel polling situation. The configuration and responses are described in the following paragraphs. Figure h-3. Parallel polling setup example 1 the pc configures the scanner (at address ...

  • Page 183

    Appendix h parallel polling © national instruments corporation h-7 gpib-232/485ct-a user manual the pc configures all of the line printers (at addresses 1, 2, and 3) to respond positively on dio line 5 when busy by sending the following programming message to the gpib-232/485ct-a: ppc 1,5,1 2,5,1 3,...

  • Page 184

    Appendix h parallel polling gpib-232/485ct-a user manual h-8 www.Ni.Com example 2 instead of checking if any printer is busy, you might want to know if any printer is free. Figure h-4 shows a parallel polling setup to accomplish this. The configuration and responses are described in the following pa...

  • Page 185: Programming Steps

    © national instruments corporation i-1 gpib-232/485ct-a user manual i programming steps and examples this appendix contains program examples you can use as guidelines as you start writing programs for the gpib-232/485ct-a. The first part of the appendix applies to s mode. The remainder of the append...

  • Page 186

    Appendix i programming steps and examples gpib-232/485ct-a user manual i-2 www.Ni.Com preparing to program 1. Before you start programming, determine the serial port settings you need by looking at the settings of your terminal. 2. Set the configuration switches on the gpib-232/485ct-a so that they ...

  • Page 187

    Appendix i programming steps and examples © national instruments corporation i-3 gpib-232/485ct-a user manual determine other serial port functions you need to change. No other changes are necessary for this example. Step 2. Send the stat function when using the stat function, use stat c s so the gp...

  • Page 188

    Appendix i programming steps and examples gpib-232/485ct-a user manual i-4 www.Ni.Com on the second line lengthens the timeout from 10 seconds (default) to 30 seconds to allow you more time to type the data string for the wrt commands. The address of the plotter is 5. Echo 1 tmo 30 stat c s cmpl nge...

  • Page 189

    Appendix i programming steps and examples © national instruments corporation i-5 gpib-232/485ct-a user manual figure i-2. Sample switch settings for an ibm pc and hp plotter 3. Connect the serial cable to the serial port of your computer and to the gpib-232/485ct-a. 4. Connect the gpib cable to your...

  • Page 190

    Appendix i programming steps and examples gpib-232/485ct-a user manual i-6 www.Ni.Com step 3. Send the gpib initialization functions send gpib initialization programming messages, if necessary. For this example, this step is not necessary. Step 4. Communicate with the device rd and wrt functions com...

  • Page 191: G Mode Sample Programs

    Appendix i programming steps and examples © national instruments corporation i-7 gpib-232/485ct-a user manual after you initialize the gpib-232/485ct-a, you might 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...

  • Page 192

    Appendix i programming steps and examples gpib-232/485ct-a user manual i-8 www.Ni.Com the serial port characteristics of the gpib-232/485ct-a and the serial device must be exactly the same. In this case, the serial port settings of the plotter are as follows: baud rate 9600 parity none data bits 7 s...

  • Page 193

    Appendix i programming steps and examples © national instruments corporation i-9 gpib-232/485ct-a user manual step 3. Send the serial port initialization functions change any serial port initialization functions, if necessary. This plotter sends and receives 7-bit data. Since the default of the gpib...

  • Page 194

    Appendix i programming steps and examples gpib-232/485ct-a user manual i-10 www.Ni.Com 170 'scale the plotting area. 175 wrt$=wrt$ + "pa50,-40;ci30,30;" 180 'plot absolute, circle=radius 185 '30 degrees, chordangle 30 190 'degrees. 200 call ibwrt(plotter%,wrt$) 205 stop 210 print "an error occurred:...

  • Page 195

    Appendix i programming steps and examples © national instruments corporation i-11 gpib-232/485ct-a user manual programming steps step 1. Send the stat function send stat c n if you want status information returned after each programming message. You can read the status after this and all subsequent ...

  • Page 196

    Appendix i programming steps and examples gpib-232/485ct-a user manual i-12 www.Ni.Com 100 'a minus sign, then go to 105 'error function. 110 wrt$="hello, world"+chr$(13) 115 call ibwrt(printer%,wrt$) 'send string to printer. 120 stop 125 print "an error occurred:" 130 print "status, gpib-error, ser...

  • Page 197: Technical Support Resources

    © national instruments corporation j-1 gpib-232/485ct-a user manual j technical support resources this appendix describes the comprehensive resources available to you in the technical support section of the national instruments web site and provides technical support telephone numbers for you to use...

  • Page 198: Worldwide Support

    Appendix j technical support resources gpib-232/485ct-a user manual j-2 www.Ni.Com software-related resources • instrument driver network—a library with hundreds of instrument drivers for control of standalone instruments via gpib, vxi, or serial interfaces. You also can submit a request for a parti...

  • Page 199: Glossary

    © national instruments corporation glossary-1 gpib-232/485ct-a user manual glossary prefix meaning value m- milli- 10 –3 k- kilo- 10 3 m- mega- 10 6 symbols ° degrees % percent Ω ohms a a amperes ac alternating current ansi american national standards institute ascii american standard code for infor...

  • Page 200

    Glossary gpib-232/485ct-a user manual glossary-2 www.Ni.Com d dcas device clear active state dce data circuit-terminating equipment dcl device clear dio digital input/output dip dual inline package dtas device trigger active state dte data terminal equipment dtr data terminal ready e eia electronic ...

  • Page 201

    Glossary © national instruments corporation glossary-3 gpib-232/485ct-a user manual h hex hexadecimal hz hertz i idy identify iec international electrotechnical commission ieee institute of electrical and electronic engineers ifc interface clear in. Inches i/o input/output iso international standard...

  • Page 202

    Glossary gpib-232/485ct-a user manual glossary-4 www.Ni.Com p pc personal computer ppe parallel poll enable r ram random-access memory rem remote ren remote enable rom read-only memory rqs request service rts request to send rxd receive data s s seconds srq service request srqi service request input...

  • Page 203

    Glossary © national instruments corporation glossary-5 gpib-232/485ct-a user manual u ul underwriters laboratories v v volts vac volts alternating current vdc volts direct current.

  • Page 204: Index

    © national instruments corporation index-1 gpib-232/485ct-a user manual index a addresses g mode function arguments gpib-232/485ct-a, 6-4 serial device, 6-4 gpib addresses lists of addresses for s mode functions, 4-5 s mode function argument, 4-4 to 4-5 addressing gpib-232/485ct-a and serial device ...

  • Page 205

    Index gpib-232/485ct-a user manual index-2 www.Ni.Com controllers controller-in-charge, f-3 functions for changing cac, 5-2 to 5-3 gts, 5-17 to 5-18 pct, 5-26 gpib-232/485ct-a as controller, f-2 to f-3 role of gpib controller, f-2 system controller, f-3 conventions used in manual, xv-xvi cts signal,...

  • Page 206

    Index © national instruments corporation index-3 gpib-232/485ct-a user manual e eabo error code, c-6 eadr error code, c-5 earg error code, c-6 ebus error code, c-7 ecap error code, c-7 echo function g mode, 7-2 to 7-3 s mode, 5-11 ecic error code, c-4 to c-5 ecmd error code, c-7 efrm error code, c-8...

  • Page 207

    Index gpib-232/485ct-a user manual index-4 www.Ni.Com arguments, 6-3 to 6-6 abbreviations, 6-4 addressing gpib-232/485ct-a and serial device, 6-4 as listeners, 6-4 to 6-5 as talkers, 6-5 to 6-6 gpib-232/485ct-a address, 6-4 serial device address, 6-4 echo, 7-2 to 7-3 eos, 7-4 to 7-5 general use func...

  • Page 208

    Index © national instruments corporation index-5 gpib-232/485ct-a user manual go to local (gtl) command, 6-9 gpib ansi/ieee standard 488.1-1987, f-1 configuring devices on bus, f-7 connecting devices on bus, f-6 to f-7 message types, f-1 overview, f-1 signals and lines data lines, f-4 handshake line...

  • Page 209

    Index gpib-232/485ct-a user manual index-6 www.Ni.Com h handshake lines, f-4 to f-5 handshaking dce (data communications equipment) interfacing with handshaking, d-4 to d-5 interfacing without handshaking, d-5 to d-7 hardware handshaking, 2-4 interfacing with handshaking, d-7 to d-8 interfacing with...

  • Page 210

    Index © national instruments corporation index-7 gpib-232/485ct-a user manual m manual. See documentation. Messages multiline interface messages, b-1 to b-4 programming messages g mode, 6-2 to 6-3 s mode, 4-2 to 4-4 types of gpib messages, f-1 multiline interface messages, b-1 to b-4 n national inst...

  • Page 211

    Index gpib-232/485ct-a user manual index-8 www.Ni.Com requirements for getting started, 1-1 to 1-2 rpp function, 5-33 rs-232 serial port description, d-2 dte vs. Dce, d-2 to d-3 interfacing serial devices, d-3 to d-10 location of rs-232 connector (figure), d-4 to dce with handshaking, d-4 to d-5 to ...

  • Page 212

    Index © national instruments corporation index-9 gpib-232/485ct-a user manual loc, 5-23 to 5-24 low-level bus management functions, 4-8 names and abbreviations, 4-6 onl, 5-25 parallel poll functions, 4-8 pct, 5-26 ppc, 5-27 to 5-28 ppu, 5-29 to 5-30 rd, 5-31 to 5-32 rpp, 5-33 rsc, 5-34 to 5-35 rsp, ...

  • Page 213

    Index gpib-232/485ct-a user manual index-10 www.Ni.Com spset, 7-9 to 7-10 xon, 7-18 to 7-19 s mode echo, 5-11 list of functions, 4-9 spign, 5-41 to 5-42 xon, 5-57 to 5-58 serial ports characteristics g mode defaults and functions for changing (table), 6-10 s mode defaults and functions for changing ...

  • Page 214

    Index © national instruments corporation index-11 gpib-232/485ct-a user manual gpib error conditions returned (table), 5-46 purpose and use, 5-44 to 5-47 serial port error conditions returned (table), 5-46 status conditions returned (table), 5-45 status bits, c-1 to c-4 atn, c-3 cic, c-3 cmpl, c-2 d...