manualshive.com logo in svg
background image

Содержание KM-488-ROM

Страница 1: ...KM 4881ROM Keithley Data Acquisition KeitNey MetraByte Asyst ...

Страница 2: ... guarantee that interference will not occur in a particular installation If this equipment does not causeharmful 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 interferenceby one or more of the following measures l Reorient or relocatethe receiving antenna l Increasethe separation between the eq...

Страница 3: ... IEEE 488 Interface Board R vislon A March 99 Copyrlghl Kelthley Data AC ulsltlon 1991 a Part Number 244 9 KElTHLEY DATA ACQUISITION Kelthley MetraSytelAsyst 440 Myles Standish Blvd Taunton MA 02790 TEL 609 99 0W FAX MW990 0179 11 ...

Страница 4: ...ta Acquisition assumesno responsibility for the useof suchinformation nor for any infringements of patents or other rights of third parties that may result from its use No licenseis granted by implication or otherwise under any patent rights of Keithley Data Acquisition Copyright All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any fo...

Страница 5: ...ALLABLE ROUTINES 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 6 3 9 Initializing The KM 486 ROM 3 3 Selecting The Receive Transmit Terminators Transmitting Commands Data 3 3 3 5 Reading Data Transmitting Receiving Data Via DMA 3 11 3 14 Checking Device Status 3 15 Low Level Routines 3 17 Board Configuration Routines 3 16 Multiple Board Programming Notes 3 19 CHAPTER4 PROGRAMMING IN BASICA OR GWBASIC 4 1 4 2 4 3 ...

Страница 6: ...scription Format For Routines 7 3 7 3 Routines 7 3 CHAPTER6 FACTORYRETURNS APPENDICES Appendix A ASCII Code Chart Appendix B IEEE Tutorial Appendix C IEEE Multiline Commands Appendix D Device Capability Codes Appendix E Printer Serial Port Redirection n DD vi ...

Страница 7: ...ers The KM48 ROM comprises a board software and documentation Figure l l is ablock diagram of the KM 488 ROM board Figure l l KM 4 WROh4Block Dlagram The Kh4488 ROM design includes a Wait StateGenerator to adjust bus timing allowing performance within operating specificationsof the GLIB controller chip on the fastestPCs This Board canalsogenerateprogrammed interrupts on any of six interrupt reques...

Страница 8: ...ty Data Transfer Rate Governed by the slowest device IEEEController Chip Power Consumption Operating Temperature StorageTemperature Humidity Wait States Net Weight ROM BaseAddress I O BaseAddress Device Interface Capabilities Supported One Short PCSlot size Channels 1 2 3 or None Jumper Selectable Levels2 through 7 or None Jumper Selectable 300Kb per second NEC7210 500mAmps 0 to 50 T 4 to 158 F 20...

Страница 9: ... describeshow to install the KM48EROM software and to configure the EEPROMand reload EEPROM software There arealso noteson using multiple boards in one system Chapter 3 ZntroductfanfotheCaRableRoutines provides a brief functional description of each KM488 ROM Interface Routine Chapter 4 ProgrammingtheKM 488 ROM provides a detailed description of eachKM 488 ROM Interface Routine and how it is calle...

Страница 10: ...0 l 4 KM 488 ROMUSERGUIDE ...

Страница 11: ...r signsof damage If any damage is apparent return the Board to the factory 4 Check the remaining contentsof your packageagainst the packing list to be sure your order is complete Report any missing items to the factory immediately 5 When you are satisfiedwith preliminary inspection you are ready to configure the Board Referto the next sectionfor configuration options 2 3 SOFTWARE INSTALLATION Back...

Страница 12: ...subdirectory until copying is complete Distribution Software Contents Your Distribution Software contains the file FILESDOC an ASCII text file readablewith any text editor or with the DO TYPE command FlLES DOClists and briefly describesall files in the Distribution Software The README DOC File To learn of last minute changes be sure to read the ASCII file READMEDOC 2 4 SWITCHES JUMPERS Factory Set...

Страница 13: ...ttings be sure to run the configuration program CONFIG SeeSection2 7 I O Base Address Switch Setting an I O BaseAddress enablesthe KM 488 ROM to communicate with the PC You set an I O BaseAddress for the Board by setting the sevenpositions of Switch S2for the assigned address Setting a switch position to ON puts the corresponding address line at a logic 0 low The KM 488 ROM requires a seriesof 8 I...

Страница 14: ...Position 8 asshown in Figure 2 3 This position should be ON only if the KM W ROM is used with BASICA software Flgure 2 3 Enabllng the ROM B EO LED Somealternative ROM BaseAddress switch settingsare shown in Figure 2 1 The default BaseAddress is CC00hex Besure to selectan 8 KB addressspacethat is within the first 1MB of PC memory and not occupied Flgure 2 4 ROM Base Address Selectlon If you areunsu...

Страница 15: ...r of Wait Statesby setting Positions 1and 2 marked Wait State on the DIP switch You may program 03 911 1 w STATE w l STITFS the KM468 ROM to generateone two three or four Wait States during I O Note that the number of memory Wait Statesis automatically setto a value which is onelessthan the I O Wait States To selecta number other than the default setthe switches to one of the positions shown in Fi...

Страница 16: ...M ltlE ROM contains two jumper blocks Theseblocks selectthe Interrupt Level and DMA Level Selecting an Interrupt Level The KM ROM is capableof interrupting the PC The Interrupt Level IRQ Jumper Jll defines the Interrupt Level Valid Interrupt Level selections 2 through 7 and none and the jumper positions are shown in Figure 2 9 Figure 2 9 Interrupt Level Ml Jumpers Selecting a DMA Level DMA Direct ...

Страница 17: ...plate up and out to remove 4 Beforetouching the Board place onehand on any metallic part of the PC chassis but not on any components to dischargeany staticelectricity from your body 5 Make sure the Board switches havebeenproperly set refer to the configuration sections 6 Align the Board connector with the desired accessoryslot and with the corresponding rear panel slot Gently pressthe Board into t...

Страница 18: ...RATION The settings will reflect any changeswhich were madeby running the INSTALL program The following PC function keys arenow active E II ml F31 I Shift II F3I AltI F31 F81 HELP Invoke Help at any time by pressing Fl SHOW NEXT In multiple board systems pressing Fl I shows the configuration of the next KM488 ROM LOAD Pressingthis key loads the file KM488ROM BlN to the EEPROM This function is usef...

Страница 19: ...he default value is 10010Ins A DMA Timeout Error is generated when the time to transfer via DMA an entire messageexceedsthe setDMA Timeout value Valid entries for the DMA Timeout parameter are between 0 and 65535milliseconds Ihe default value is 10010 Ins Transmit Terminators Transmit Terminators alsoreferred to asOutput Terminators are appended to data sentfrom the KM 488 ROM to another IEEE 488d...

Страница 20: ...is requirement run the CONFIG program asdescribed in the previous section Beforeyou reload the EEPROM be sureits Write Enable switch is enabled seeSection2 4 The proceed asfollows 1 Invoke the CONFIG program Switch to the appropriate directory and at the DOS prompt type CONFIG 2 Press F3I When you completed the EEPROMreload be sure to disable the EEPROMWrite Enable switch seeSection2 4 2 8 MULTIPL...

Страница 21: ...ASIC C and TURBO PASCAL Table 3 l provides an alphabetical listing of the available routines The remainder of the chapter tracks the order of aroutine s usageand is organized asfollows l Initializing the KM488 ROM Selectingthe Receiveand Transmit MessageTerminators l Transmitting Commands and Data l Reading Data l Transmitting Receiving Data via DMA l Checking the Statusof a Device l Low level Rou...

Страница 22: ...s Allows theKM 488 ROMinterrupt enablebitstobeset Selects anon defaultBaseAddress SetsSerialPollResponse of the KM 488 ROM Conductsaserialpoll ona specifieddevice Detectsthestateof tic SRQsignal onthebus Returnsvaluesof thevarioussetup parameters SendsGPIBcommands anddata Transmitsdatafromanarray AssertsREN SendsUNL UNT TALK adrs MLA data UNJ LINT If KM 48 ROMis Sys Contr assert 9 IFC None None No...

Страница 23: ...ll increase NOTE INIT must be the first KM 488 ROM routine called within the program lOTIMEOUT This routine is not usablein BASICA IOTIMEOUT allows you to resetthe length of time that is to elapsebefore a Timeout Error occurs A timeout Error occurs when the time between transmission and reception of adjacentbytes exceedsthe settime I O Timeout Error reports occur when using SEND ENTER XMITA XMIT a...

Страница 24: ...for eachof the four output messageterminator sequences You may append theseterminators to the data sentby the SEND XMIT and XMITA routines to signal the end of message Eachterminator sequenceconsistsof one or two ASCII characters irbit values and may or may not assertEOI when the last terminator characteris sent Thedefault values for each terminator appear in the following table ASCII CHARACTER DE...

Страница 25: ...atedby one or more spaces If the KM488 ROM is acting asa Controller the XMIT routine sendsboth commands and data If executing the XMIT routine the KM488 ROM must l Untalk and Unlisten all Devices l Assign a Listener l Address itself asaTalker If however the KM488 ROM is acting asa Device the XMIT routine can only senddata In this instance the KM488 ROM must be a talker before the XMIT routine can ...

Страница 26: ...resentations after the DATA command aslong asASCII charactersare in a string enclosed by single quotes EXllmple DATA Eello 13 10 DATA Line 1 13 10 Line 2 13 10 If END follows the DATA command string MessageTerminator 0 signals the End of Transmission Section3 2describesthe default valuesof the transmit terminators and how to changethem Setthe terminators to one or two bytes and send them with or w...

Страница 27: ...M488 ROM is acting asthe System Controller When the LOC command is executed it unassertsthe GPIB RBN RemoteEnable line This action forcesall deviceson the GI IB to the local state Example LOC MLA The KM488 ROM must be the Active Controller to executeMLA My Listen Address MLA forcesthe KM488 ROM to becomea listener it sendsa listen addresscommand containing the GPIBaddress of the KM 485ROM over the...

Страница 28: ...and follows the DATA command Transmit Message Terminator 2 will signal the end of data transmission Section3 2 describesthe default valuesof the transmit terminators and how to change them Setthe terminators to one or two bytes and send with or without EOI assertedon the last byte Example DATA Eello T2 T3 If this command follows the DATA command Transmit Message Terminator 3 will signal the end of...

Страница 29: ... nnn Where nnn is the decimal value of the Parallel Poll Enablebyte This byte hasthe following format OllOSPPP Where S is 0 or 1 The addresseddevice will setthe designated GPIB data line determined by PPP to the given value if serviceis required PPP is a 3 bit value which representsa GI IB data line 0 7 The configured device will usethis data line to respond to a parallel poll Eurmple UNL LISTEN 6...

Страница 30: ...CL GET The GET Group ExecuteTrigger command synchronizes the start of a devicedependent operation in all previously addressedlisteners In many devices GETallows the KM488 ROM to trigger ameasurement This function is not supported by all devices Example LISTEN 12 GET IFC This command can only be issuedby a KM 488 ROM which is the System Controller The IFC Interfaceclear command resetsthe interface ...

Страница 31: ...m a specified location Thedata is transferred from the lowest specified memory address first then from increasingly higher addressesuntil the end of the data is reached In other words the leastsignificant byte of the first element of the array is the first charactersent The array may be of any data type provided the language you are using has stored array elementsof increasing index in increasing ...

Страница 32: ...erare stripped from the receiveddata and arenot stored within the string or included in the byte count If the ENTER routine terminates due to reception of a data characterwith EOI asserted other than the chosenreceiveterminator character that characterwill be stored and included in the byte count Beforeyou call the ENTER routine be sure to setup a string to store the receiveddata Regardlessof the ...

Страница 33: ...ning the actual number of receivedbytes are alsoreturned The RCVA routine storesevery received character including carriage returns and messageterminator characters Thesecharacterswill alsobe included within the byte count The RCVA routine will return to the calling program when one of the following eventsoccurs l RCVA is called when the KM488 ROM is not a listener l The selectedterminator charact...

Страница 34: ...s The KM488 ROM signalsits need to transfer data via the DMA request signal DMARBQ Other logic in the systemarbitrates control of the addressand data busses between the microprocessorand the DMA controller When the bussesareavailable the DMA controller placesthe contentsof the addresspointer register for that channel onto the addressbus and notifies the KM 488 ROM that it is ready to perform the t...

Страница 35: ...polling and or parallel polling Often serial polling and parallel polling are used together to determine the type of serviceneededby a device This sectiondescribesthoseroutines associatedwith serialand parallel polling They include SRQ l SPOLL l POLL l SETSPOLL NOTE The SRQroutine doesnot work in BASICA When programming in BASICA use the STATUSroutine to checkthe stateof the SRQsignal SRQ This rou...

Страница 36: ...m If the device requires service when the Parallel Poll command is issued it will assertits designated bit within the data bus The assignedbit and its assertedvalue 0 or 1 must be preconfigured This is accomplished via a setof GLIB commands sent to the deviceover the bus To configure a device for Parallel Polling l Address the device to listen l IssueaGPIBParallel Poll Configure PC command accompa...

Страница 37: ...f the various GPIBController chip registers Two routines enableyou to do this asfollows l SETlNT l STATUS SET NT This routine setsthe Interrupt maskbits within the GPIBcontroller chip The most common reasonfor this is to allow the generation of interrupts upon receiving a ServiceRequest SRQ Other possible reasonsinclude using the interrupts to enabledetection of other bus related events If the KM ...

Страница 38: ...in the register are reset It is important to note this when reading Interrupt StatusRegister 1 The XMIT and RCV routines checkthe Dl and W bits to determine when to read or write the next data character If you read the Interrupt StatusRegister1and the first byte of data hasbeen received the Dl bit will be cleared If the RCV routine is then called it will hang up waiting for the Dl bit to set Readt...

Страница 39: ...controllers within the samecomputer Note however that you will NOT be able to communicate between two KM 488 ROM boards within the SAME computer evenif one is configured asa deviceand the other asa controller In a multiple board environment the messageterminator settings and timeout valuesare GLOBAL parameters In other words all the KM 488 ROM boards within acomputer share the valuesof theseparame...

Страница 40: ...3 20 KM 488 ROM USER GUIDE ...

Страница 41: ...the setting of the KM 488 ROM Memory Address Switches Referto Section2 4for more information When multiple KM t ROMboards are present in the samesystem eachmust haveits own unique segmentaddress You may then selectwhich of the boards is to be accessedby executing a DEFSEGto its segmentaddress BASIC requires identification of the offset addressof eachKM 488ROM routine to know where to call the rout...

Страница 42: ...EF SEG SHCCOO As iqns mamory segment address xxINIT O ADRS O MODE 0 Gives offset of INIT routine L variable definitions uCALL INIT ADRS MODE uses call statement Software Configuration KM 488 ROM firmware contains a number of configuration parameters that govern the default settings of the input and output messageterminator settings messagetimeout periods and I O port addresses If thesedefault valu...

Страница 43: ...t for eachdescriptions is asfollows offset usage alternate usage parameters returns notes example a brief description of the routine SeeChapter 3 for more detailed descriptions givesthe BASICA offset for eachroutine givesan exampleof usagefor eachroutine and assumesthe input parametersarepassedin asvariables Theseparameterscan alsobe passedin directly Seethe GeneralProgramming Notes for more infor...

Страница 44: ...relocated and the data placed in the wrong location This could causeyour program to crash count is an INTEGER containing the maximum number of data bytes to be transmitted or received If you wish to send or receivemore than 32767bytes you must expresscount differently SeeProgramming Note 4 in the beginning of this section TheDMA routine alsoperforms byte packing that is two bytes of data are store...

Страница 45: ...icates the transmitted data is read from PCmemory via DMA Both this bit and the INP bit cannot be setto 1at the sametime EnablesDMA autoinitialize mode when it is setto 1 Under normal circumstances the DMA controller transfers the specifiednumber of bytes to from the PC memory from the given starting addressand terminates when completed When the AUTOINITIALIZE mode is enabled the DMA controller wi...

Страница 46: ... in control until the specified number of bytes hasbeen transferred regardlessof the state of the DMA request line Block Mode allows the fastest data transfer rate possible NOTE BLOCK MODE ISNOT RECOMMENDED FOR MOST APPLICATIONS This isbecausewhen block mode is selected all other DMA channelsare locked out and the microprocessorcannot execute any bus cycles This can be dangerous in somecircumstanc...

Страница 47: ... count FFFFrolls over to OiKlO becausethere is no mechanism to carry the most significant bit into the page register For example if the DMA routine were called with the SEG parameter setto ZOOO and the OFSparameters setto FFFF the DMA controller would be loaded with a count value of FFFF and the page register with a 2 The first location accessedwould be absoluteaddress 2FFFF The DMA controller wou...

Страница 48: ...his boundary is abovethe areaused by DOSand your program for example H70001 The data can then be moved into an array using the BASICPEEKinstruction Note that this example stores one byte per array location 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 DYA 206 DMA or11 Off ccQuT 1028 Trane ar 1026 points DuAcPPS 0 St rt with first array slomont NODE 6E2005 Input DM Ghan 1 STAT 0 Initi...

Страница 49: ... TRMl TRMO 0 ADR4 ADR3 ADR2 ADRl ADRO Where TRMl 0 Terminator Select Thesetwo bits selectthe Message Terminator to be used to signal the end of a transmission Available terminator selectionsare TRMl TRMO TERMINATOR DEFAULT 0 0 0 LF 0 1 1 CR 1 0 2 1 1 3 Theseterminators aredefined upon systemconfiguration and are stored along with the BASICA library code in the EEPROM They canbe changedby running t...

Страница 50: ...re TM0 Timeout Error Indicates whether or not a Timeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred OVF Overflow Error If this bit is a 1 then the info string was filled before a terminator characteror EOI was detected NC KM 468 ROM not an Active Controller If this bit is setto a 1 it indicates the routine was called before the KM 488 ROM was designated asa...

Страница 51: ...NIT purpose Initializes a KM438 ROM by assigning it a GPIBaddressand establishing it asa SystemController or Device offset 0 usage P IUIT 0 xx a mode P 0AI L IWIT a a modo PSrS rkVSrS adrs is an INTEGER representing the IEEEbus addressof the KM 488 ROM This is an integer from 0 to 30 PROGRAMMING IN BASICA OR GWBASIC 4 11 ...

Страница 52: ...ice Otherwise when this bit is setto 0 the KM 488ROM is acting asa SystemController When System Controller is selected the GLIB IFC line is momentarily asserted refurfls None example This example initializes the KM 488 ROM asa SystemController with a IEEEaddressof 0 with a High SpeedHandshake 10 DNFsEc sEccoo 20 INIT 30 AoNa o NOON 4 10 CALL INIT Z INS NODE PPOLL PvP e Initiates a Parallel Poll an...

Страница 53: ...is required PPP is a 3 bit value that tells the devicebeing configured which data bit it should useasits parallel poll response CD101through DIOB example This example assumesthat the KM 488 ROM is connected to aSorenson HPD3010 Power Supply This deviceis located at GI IB address 1 It is alsoassumedthat this devicedrives bit 3 of the Parallel Poll Response byte to a logic 1 when serviceis required ...

Страница 54: ...be used to signal the end of a transmission Available terminator selectionsare TRMl TRMO TERMINATOR DEFAULT 0 0 LF 1 1 CR 1 0 2 1 1 3 Theseterminators aredefined upon systemconfiguration and arestored along with the BASICA library code in the EEPROM To changetheir values run the CONFIG program asdescribed in Chapter 2 info is a STRING variable 256charactersmax containing the received data The stri...

Страница 55: ...nd a Keithley 196voltmeter to take a reading The meter reading is received using the RCV routine It is assumedthat the meter reading retomed will fit into a 25 characterstring This example assumesthat the KM 488 ROM hasbeenconfigured such that transmit messageterminator 1is Carriage Return Line Feed combination and this combination is also used by the Keithley 196 10 DEF SEG CSCCOO 20 IUIT 0 WIT 3...

Страница 56: ...he array may be relocated and the data will be placed into the wrong location This may result in a program crash maxlen is an INTEGER containing the maximum number of data bytes to be received SeeProgramming Note 4 found at the beginning of this section if you want to send more than 32767bytes stat is an INTEGER which selectsthe type of terminator to be used This parameter must be initialized ever...

Страница 57: ...or RCVA Termination If this bit is a 1 then RCVA routine ceasedbecausean EOI or terminator characterwas received If this bit is a0 then the RCVA was terminated becausean error occurred or the maximum byte count was reached TM0 Timeout Error Indicates whether or not a Timeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred NL KM 488 ROM not a Listener If this bi...

Страница 58: ...ter Low Byte BIT 7 6 5 4 3 2 1 0 TRMl TRMO 0 ADR4 ADF13 ADR2 ADRl ADRO Where TRMl 0 Terminator Select Thesetwo bits selectthe Input Message Terminator to be used to signal the end of a transmission Available terminator selectionsare TRMl TRMO TERMINATOR DEFAULT 0 0 0 0 1 1 ii 1 0 2 1 1 3 The valuesfor theseterminators can be changed by running the CONFIG program asdescribed in Chapter 2 The easies...

Страница 59: ... transfer If this bit is a 1 then a Timeout Error occurred NC Not Active Controller If this bit is a 1 then the SEND routine was called when the KM 488 ROM was not an Active Controller ADRS Invalid Address If this bit is setto a 1 an invalid IEEE 488 deviceaddresswas given examp e This example shows how to senddata from a KM 488 ROM to adevice The KM4 8 ROM is initialized asa SystemController loca...

Страница 60: ...to Interrupt Mask 2 INTBRRUFF MASK 1 INTVAL Input Low Byte ADRS 0 BIT 7 6 5 4 3 2 1 0 0 0 GET 0 DEC 0 0 0 Where GET DEC When this bit is setto 1 an interrupt will be generated when a KM 488 ROM acting asa device received aGPIB GET Group ExecuteTrigger command while addressed to listen When this bit is setto 1 an interrupt is generated when a DeviceClear is received INTERRUPT MASK 2 INTVAL Input Lo...

Страница 61: ...atementto execute the interrupt service routine This example showsyou how to usethe SETINT routine to enablethe SRQinterrupt 10 DERSE0 4HCCOO 20 SSTIST 212 30 IuTvAL itI 40 CALL WTIUT IUTVAL Enable SRQ intarrupt SETSPOLL Defines the SerialPoll Responseof a KM 488 ROM acting asa device non Controller 215 xx SETWOLL 215 P n p xx CALT SETSPOIL reap resp is an INTEGER describing the serial poll respon...

Страница 62: ...o device however Bit 6 is always usedto indicate whether the deviceis in need of service Consult the manufacturer s operator s manual for more information stat is an INTEGER describing the stateof the transfer returned after the call The stat value is interpreted asfollows Stat Return Low Byte BIT 7 6 6 4 3 2 1 0 0 0 0 0 TM0 0 NC ADR Where TM0 Timeout Error Indicates whether or not a Timeout Error...

Страница 63: ...er xx STATUS 209 xxrrlJ xx tat Xx CALL STATUS rag at reg is an INTEGER containing the address of the register or configuration parameter to be queried This value corresponds to a 4 bit field specifying the statusregister or configuration parameter to be read The format of the reg byte is asfollows Reg input Low Byte X May be any value ADR3 0 REGISTER PARAMETER SELECT This is a4 bit field which spe...

Страница 64: ...hether or not EOI is assertedwith the last byte When obtaining other parameters reg will retain its input value Reg Return Low Byte BIT 7 6 5 4 3 2 1 0 0 0 0 0 0 0 LEN EOI Where LEN Terminator Length If this bit is setto 0 then the terminator is one byte long If this bit is setto 1 then the terminator is two bytes long EOI If this bit is setto 1 EOI is assertedwhen the last terminator byte is sent...

Страница 65: ... 0 X SRQl LOK REM X X X ADSC Where X This bit may be any value SRQI When this bit is setto 1 it indicates SRQwas active Active Controller mode only LOK When this bit is setto 1 the device was setto Local Lockout Devicemode only AEMC When this bit is set to 1 the device was configured for remote operation Devicemode only ADSC When this bit is setto 1 a changeof the address status occurred i e untal...

Страница 66: ...e of the desired parameter asan unsigned value in the low and high bytes of stat The timeout value is expressedin milliseconds 0 to 65535 notes The bits contained in the Interrupt Status1and 2 registersare extremely volatile When you read theseregisters any bits which were setare automatically clearedby the READ operation This is extremely important to note when reading Interrupt StatusRegister1 a...

Страница 67: ... whether or not aTimeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred STR String Error If this bit is setto one then a quoted string END or terminator was found without a DATA subcommand preceding it NT KM H ROM not a Talker If this bit is setto a 1 it indicates the routine was called before the KM 488 ROM was designated asa Talker SIX Syntax Error If this b...

Страница 68: ...and UNListen l Addressing the 196to LISTEN l Addressing the KM488 ROM to talk My Talk Address l Sending the Device DependentCommands asa string of DATA l Sending the appropriate messageterminator charactersafter the data l Issuing the Group ExecuteTrigger bus command n Unaddressing all devices l Addressing the meter to TALK and the KM488 ROM to LISTEN My Listen Address in preparation for receiving...

Страница 69: ...ion term is an INTEGER which selectsthe terminator to be used This byte is of the following format Term Input Parameter Low Byte BIT 7 6 5 4 3 2 1 0 STRM TRMl TRMO X X 1 x 1 x EOI Where X This bit may be any value STRM SendMessageTerminators If this bit is setto 1 then the messageterminator s will bc sent at the end of the transmission Otherwise they will not TRMI 0 Terminator Select Thesetwo bits...

Страница 70: ...sa Talker notes When calling XMITA you must declarean integer array from which to transmit data Sinceeachinteger in BASICA uses2 Bytesof memory the total number of array locations allocated must be equal to or greater than one half the total number of bytes to be received exmp e This example illustrates the useof XMITA It shows you how to properly set up an array from which to sendthe data Note th...

Страница 71: ... QBKM488QB BI KjBKh4488QB4 QLB QB KM488QB7 QLB KjBKM488QB4 LIB QBKM488QB7 LIB File Header Besureto include the following line within your program INCLUDE km488qb Including of this file allows QuickBASIC to check that the correct number and type of parametersare specified for eachroutine called Onceyour QuickBASIC application program hasbeenwritten you will compile the program Besure to include ful...

Страница 72: ...tered by calling the DMATIMEOUT or IOTIMEOUT routine Default Temlnator Settlngs TERM OUTPUT TERMINATOR INPUT TERMINATOR 0 LF EOI LF 1 CRLFEOI CR 2 CREOI comma 3 LFCREOI semi colon Programming Notes 1 Any parameterswhich appear asvariablesmay alsobe passedasconstants 2 Parameterswhich arealso used to retorn valuesmust be declared asvariables 3 Integer variable namesend with a percent sign and integ...

Страница 73: ... specialprogramming considerations gives aprogramming example using the routine DMATIMEOUT Setsthe maximum length of time for a DMA transfer to complete before a timeout error is reported SeeRCVA and XMITA routine descriptions CArtLDMATIMEOOT time CALL SETTIMEOUTkhne NOTE The alternate usagesetsboth the DMA and I O Timeouts to the specifiedvalue time is an INTEGER which representsthe timeout perio...

Страница 74: ...ameter Low Byte BIT 7 6 5 4 3 2 1 0 TRMl TRMO 0 ADR4 ADR3 ADR2 ADRI ADRO Where TRMl 0 ADR4 0 Terminator Select Thesetwo bits selectthe Message Terminator to be used to signal the end of a transmission Available terminator selectionsare TRMl TRMO TERMINATOR DEFAULT 0 0 0 LF 0 1 1 CR 1 0 2 1 1 3 Theseterminators may be changed by the INTERM routine The easiestway to specify an alternate terminator i...

Страница 75: ...meout Error Indicates whether or not aTimeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred OVF Overflow Error If this bit is a 1 then the info string was filled before a terminator characteror EOI was detected NC KM 488ROM not an Active Controller If this bit is setto a 1 it indicates the routine was called before the KM 488 ROM was designated asan Active Co...

Страница 76: ... This is an integer from 0 to 30 mode is an INTEGER representing the operating mode of the KM 488 ROM Thesecanbe any of the following values Mode Low Byte BIT 7 6 5 4 3 2 1 0 X X X X X FAST DEV X Where X May be any value FAST Handshake Speed If this bit is setto 1 High SpeedGPIB bus handshaking will be used 5OOns If it is setto 0 Low SpeedGI IB bus handshaking 2 s will be used See Chapter 3 for mo...

Страница 77: ...TE The Alternate Syntax will only change the value of Input MessageTerminator 0 parameters num is an integer which selectsthe number of the receivemessage terminator to bechanged This rangesfrom 0 to 3 where IlUlN TERMINATOR DEFAULT 0 0 1 1 2 2 3 3 term is an integer representing the terminator byte to be programmed This integer is the decimal or hex equivalent of the terminator s ASCII representa...

Страница 78: ...d This rangesfrom 0 to 3 where num TERMINATOR DEFAULT 0 0 LF EOI 1 1 CRLFEOI 2 2 CREOI 3 3 LFCREOI chars is an INTEGER that selectsthe length of the transmit terminator This is 0 if a l character terminator is required or 1for a 2 character terminator eoi is an INTEGER that determines whether EOI is assertedwhen the last terminator byte is sent If this bit is 1 EOI will be sent If this bit is 0 EO...

Страница 79: ...parallel poll responsevalue 0or 1 that the deviceusesto respond to the parallel poll when serviceis required PPPis a 3 bit value which tells the devicebeing configured which data bit it should useasits parallel poll response DIOI through DIOS This exampleassumesthat the KM488 ROM is connected to a Sorenson HPD30 10Power Supply This deviceis located at GPIBaddress 1 It is alsoassumedthat this devic...

Страница 80: ...te reception of data when 1 the number of charactersreceivedexceedsthe length of the string 21a terminator is received or 3 any character is received with the EOI signal asserted Carriage returns and the messageterminator characterin the incoming data are ignored and not stored with the receiveddata rcvlen is an INTEGER which indicates the actual number of bytes which were receivedand stored stat ...

Страница 81: ... an array This routine may alsobe used to receive data via DMA SeeSETDMA DIM in t 1000 allooats 1000 rray looations maxlen 2000 Cw W A in t O mulsn tsrm r vlon t t alternate usage paremeters CALL stAmAY in ta msrlsn ravlm tat NOTE The Alternate Syntaxassumesthe useof EOI asa terminator term is an INTEGER which selectsthe type of terminator to be used This integer is interpreted according to the fo...

Страница 82: ...ll contain data To specify more than 32767bytes usethe technique outlined in Programming Note 4 presented at the beginning of this section stat is an integer describing the stateof the transfer returned after the call The RCVA routine returns three statusbits within the stat variable The TM0 bit is used to signal a timeout error The REOIbit signalsthat the routine returned becausethe terminator wa...

Страница 83: ... ADR3 ADR2 ADRl ADRO Where TRMl 0 Terminator Select Thesetwo bits selectthe Input Message Terminator to be used to signal the end of a transmission Available terminator s ctions are TRMl TRMO TERMINATOR DEFAULT 0 0 0 LF 0 1 1 CR 1 0 2 1 1 3 The valuesfor theseterminators canbe changed by running the CONFIG program asdescribed in Chapter 2 Theeasiestway to specify an alternate terminator is to add ...

Страница 84: ...Error occurred NC Not Active Controller If this bit is a 1 then the SEND routine was called when the KM488 ROM was not an Active Controller ADRS Invalid Address If this bit is setto a 1 an invalid IEEE488 device addresswas given examp e This example shows how to senddata from a KM488 ROM to a device The KM488 ROM is initialized asa SystemController located at GPIB address 10 The KM488 ROM useshigh...

Страница 85: ...2 SETDMA NOTE DMA allows maximum data transfer rates in excessof 100 kilobytes per second However the actual data rates arelimited by the rates at which other devicesconnectedto the bus can send or receive data Theseratesare governed automatically by the GPIBhandshaking signals Allows the useof DMA in conjunction with the XMITA and RCVA routines CALL 8ETDI R ohuursl CAL Eamcamm ahMnSl channel is a...

Страница 86: ...re X May be any value ADRS If thls bit is setto 0 bits 0 through 7will be written to Interrupt Mask 1 If this bit is setto 1 bits 0 through 7 will be written to Interrupt Mask 2 INTBRRUI T MASK 1 INTVAL Input Low Byte ADRS 01 BIT 7 6 5 4 3 2 1 0 0 0 GET 0 DEC 0 0 0 Where GET DEC When thls bit is setto 1 an interrupt will be generated when a KM438 ROM acting asa device received a GPIB GET Group Exe...

Страница 87: ...errupt when SRQis received Cw SETINT EltO SETPORT purp088 This routine is used to alter the range of addressesusedby the KM 488 ROM s I O port In a multiple board environment it is alsoused to associatea given range of I O addresseswith a board number usage CA L SETRCRT board ioport PeJZVrIeterS board is an INTEGERbetween 0 and 3 which representsthe board to be programmed Note that up to four boar...

Страница 88: ...strates a common useof SETSPOLL req 0 purpo usage parameters returns SPOLL Performs a serial poll of the specified device CALLsPOLL dr re p t adrs is an INTEGER containing the IEEEbus addressof the device that is to be serial polled This can range from 0 to 30 resp is an INTEGER containing the serial poll responsereceived The definition of this integer variesfrom deviceto device however Bit 6 is a...

Страница 89: ...SRQis generally used within a conditional branch in an application program Note that after obtaining a TRUE responsefrom SRQ SRQresponseis resetto FALSEevenif the SRQline is still active In order to resetthe SRQresponseto TRUE you must serial poll at leastone device with a requesting service Conducting a serial poll on a device requesting serviceresetsits SRQline Then if other deviceswere simultan...

Страница 90: ... X X ADR3 ADR2 ADRl ADRO Where X May be any value ADRS0 REGISTER PARAMETER SELECT This is a 4 bit field which specifiesthe statusregister or configuration parameter to be read Registersand parameters are selected asfollows ADRS ADIU ADRI ADRO REGlS RmARAMRTER returns reg When STATUSobtains the value of one of the four transmit messageterminators this variable will contain two flag bits which deter...

Страница 91: ...7 6 6 4 3 2 1 0 Where X cc LA TA This bit may be any value Active Controller If this bit is setto 1 then the KM488 ROM is a SystemController Listener If this bit is setto 1 then the KM 4 3 ROM is a Listener Talker If this bit is setto 1 then the KM 488 ROM is a Talker InterruDt StatusReeister 1 Stat Return Low Byte BIT 7 6 6 4 3 2 1 0 Where X This bit may be any value GET Group ExecuteTrigger If t...

Страница 92: ...unsigned value in the low and high bytes of stat The timeout value is expressedin milliseconds 065535 notes Thebits contained in the Interrupt Status1and 2 registers are extremely volatile When you read theseregisters any bits which were setare automatically clearedby the READ operation This is extremely important to note when reading Interrupt StatusRegister 1 assomeof the bits not shown above ar...

Страница 93: ...ut Error Indicates whether or not aTimeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred STR String Error If this bit is setto one then a quoted string END or terminator was found without a DATA subcommand preceding it NT KM 488 ROM not a Talker If this bit is setto a 1 it indicates the routine was called before the KM 488 ROM was designated asa Talker STX Sy...

Страница 94: ...te messageterminator charactersafter the data l Issuing the Group ExecuteTrigger bus command l Unaddressing all devices l Addressing the meter to TALK and the KM 488 ROM to LISTEN My Listen Address in preparation for receiving the latest reading XMITA purpose Sendsdata from an array usage CALL lMITA out t O aount tom tat alternate usage TARRAY acmnt tsrm tat parametsrs outdat is an INTEGER array c...

Страница 95: ...ll The statvalue is interpreted asfollows Stat Return Low Byte BIT 7 6 6 4 3 2 1 0 Where TM0 Timeout Error Indicates whether or not a Timeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred NT KM 488 ROM not a Talker If this bit is setto a 1 it indicates the routine was called before the KM 488 ROM was designated asa Talker example This example demonstratesuseo...

Страница 96: ... XMITA cont 5 26 KM 488 ROM USER GUlDE ...

Страница 97: ...BLaG IB mAG 0 TERNc ALLDispPdymerr yIAG Cl m CnDg lY m I STRB SCOPS aaPaA CALL xt4Ir cMD6 mAG setup for saope to send data IF BxAG 0 lwzN CALL DiaplaylQberr BLAG adD CGrmT 7 IA 0 CGrmTP 2050 L 0 CALL RcvA s ol comT6 0 1 SLAG D tA reaeivec3 10 WAG 0 0 TBBNCAL Di splayIWerr BIAG CMO IF L 2 N KRW l 2 TRE GOT0 2080 FOR 1 1 TO 1024 se 8 9 1 I CAT sr pRyts MS Y l 1 vAL E IP x 1 1 I 1 TEE PRINT ELSE PRIN...

Страница 98: ...ont PRINT 888P 0 CALL SPOLL BCGPE PaSP mAG PRINT SPOLL HBx RBSP AND 255 1 LE B IB 1 1 TED B 000 B IB 1 2 TBXNB 00 B TB I 3 THENB 0 B LSS RIGer s 2 Ksae wf B 2 se LB LSB WBS hap bytes 5 20 KM 488 ROM USER GUIDE ...

Страница 99: ...sed for re building TURBO Pascal UNIT file The files KM488PASPAS and KM488I LB OBJcanbe used to createa new unit file should you need to Supported Versions The Envtronment Turbo PASCAL versions4 0 5 0 and higher Beforeyou begin to develop programs in TURBO PASCAL severalfiles must be present in your working directory Copy the appropriate files from the KM48EROM Disks to your working directory TURB...

Страница 100: ... that the amount of storagespaceallocated is at leastas great asthis maximum length parameter Otherwise data may be stored into memory which hasbeenallocated for useby other parts of your program or for useby DOS This could lead to erroneous operation and possibly a systemcrash 4 In TURBO Pascal strings are actually a specialtype of characterarray The first byte of the array is used to store the n...

Страница 101: ...onjunction with XMITA and RCVA routines VAR tinu WORD BEGIW dmatimsout time mattimeout tima NOTE The alternate usagesetsboth the DMA and l O Timeouts to the specifiedvalue time is an INTEGER which representsthe timeout period to elapse during a DMA transfer A DMA Timeout Error will be generated when the time to transfer via DMA an entire messageexceedsthe setDMA timeout value time time can range f...

Страница 102: ...eiveddata a s is an INTEGER containing the IEEEbus addressof the device that the data is to be sentto and the terminator to be used This byte is of the following format Adrs Input Parameter Low Byte BIT 7 6 5 4 3 2 1 0 TRMl TRMO 0 ADR4 ADR3 ADR2 ADA1 ADRO Where TRMl 0 Terminator Select Thesetwo bits selectthe Message Terminator to be used to signal the end of a transmission Available terminator se...

Страница 103: ...0 0 0 TM0 OVF NC ADRS Where TM0 Timeout Error Indicates whether or not a Timeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred OVF Overflow Error If this bit is a 1 then the info string was filled before a terminator characteror EOI was detected NC KM48 ROM not an Active Controller If this bit is setto a 1 it indicates the routine was called before the KM 488...

Страница 104: ...ENTER cont 6 6 KM 466 ROM USER GUIDE ...

Страница 105: ...2 1 0 X X X X X FAST DEV X Where X May be any value FAST Handshake Speed If setto 1 High SpeedGPIBbus handshaking is used 5OOns If setto 0 Low SpeedGPIB bus handshaking 2 us is used SeeChapter 3 for more information DEV returns None Device If setto 1 the KM 488 ROM is acting asa Device Otherwise the KM 488 ROM is acting asa System Controller When SystemController is selected the GPIB IFC line is m...

Страница 106: ... This rangesfrom 0 to 3 where num TERMINATOR DEFAULT 0 0 LF 1 1 CR 2 2 3 3 term is an integer representing the terminator byte to be programmed This integer is the decimal or hex equivalent of the terminator s ASCII representation Hex equivalents must be preceded by H SeeAppendix A for ASCII Equivalents returns None notes The parametersmay be passeddirectly into the routine example This example se...

Страница 107: ... returns None examp e This line setsthe I O Timeout period to 1second OUTTERM purpose Changesthe output messageterminator sequences usage VaB nun INTEGER aharm 1uTEGER ad IWTBGER tnul IIiTEGER tnnz IUTR BEGIN 0utta l u l char soi trml tnllz alternate usage VAR tnnl BYTE tnnz BYTE BEGIN 8atoutputao tml t nnz NOTE The Alternate usagewill only changethe value of Terminator 0 and will always assertEOI...

Страница 108: ...rminator byte in a 2 byte temxinator it is the decimal or hex equivalent of the terminator s ASCII representation Besure to precedeall hex values with H If a l byte terminator is programmed trm2 may be any value returns None exBmple Theselines illustrate two different usesof OmERM ousxml 0 0 1 m 0 a moutputt xmilutor 0 to CRZ0T J CulT J 1 o m o1 Pa outputt dma or J to cR Ia ith Ilo MI PPOLL purpos...

Страница 109: ...Ol through DIOS example This exampleassumesthat the KM4S ROM is connected to aSorenson HPD30 10Power Supply This device is located at GPIBaddress 1 It is alsoassumedthat this devicedrives bit 3of the Parallel Poll Response byte to a logic 1 when serviceis required To program the device to respond properly send the Parallel Poll enablebyte 01101011 107 via the XMIT command RCV purpose Receivesdata ...

Страница 110: ...f characters RCV will terminate reception of data when 1 the number of charactersreceivedexceedsmaxlen 2 a terminator is received or 3 any characteris receivedwith the EOI signal asserted Carriage retorns and the messagetermtnator characterin the incoming data are ignored and not stored with the receiveddata rcvlen is aWORD that indicates the actual number of byteswhich were receivedand stored sta...

Страница 111: ...his exampleassumesthat the KM 488 ROM hasbeenconfigured such that transmit messageterminator 1is Carriage Return Line Feed combination and this combination is alsoused by the Keithley 196 Note that the Voltmeter s setup command string is enclosedwithin double single quotes 0 RCVA pUfpOSe Receivesdata into a specifiedarray It may also be used to receivedata via DMA SeeSETDMA usage VAR data TIPS LEw...

Страница 112: ...ill be used to detect the end of mception If this bit is 0 a MessageTerminator Character will not be used Terminator Select Thesetwo bits selectthe Input Message Terminator to be used to signal the end of a transmission TheSTRMbit must be setto 1 1Available terminator selectionsare TRMl TRMO TERMINATOR DEFAULT 0 0 0 LF 0 1 1 CR 1 0 2 1 1 3 The valuesfor thesetermmators can be changed by calling th...

Страница 113: ...ved If this bit is a0 then the RCVA was terminated becausean error occurred or the maximum byte count was reached TM0 Ttmeout Error Indicates whether or not a Timeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred NL m 488 ROM not a Listener If this bit is setto a 1 it indicates the RCVA was called before the KM48 ROM wasdesignated asa Listener notes The KM488...

Страница 114: ...xample if you wanted to senda messageusing messageterminator 2 to adeviceat GPIB address10 the value of adrs supplied to SEND would be 138decimal 10 128 ADR4 6 GPIBAddress Thesefive bits are used to represent the GPIBaddressof the device to which the data is to be sent GPIBaddressescan range from 0 to 30 info is a STRINGcontaining the data to be sent returns stat is an INTEGERdescribing the stateo...

Страница 115: ...nd t p t t if t t cl then Nrit LrI Nrror e dl g t t t t EM SETBOARD purpose In amultiple board system identifies the KM488 ROM to be programmed usage VAX board intspor BEGIU board board alternate usage bolti8oloot boazd parameters board is an INTEGERbetween 0and 3 which representsthe board to be programmed Note that up to four boards canbe installed in any one system The board number is associated...

Страница 116: ... by the ratesat which other devicesconnectedto the bus can send or receive data Theseratesare governed automatically by the GPIBhandshaking signals Allows the useof DMA in conjunction with XMITA and RCVA VAN ahalms intoga BEGIU et dma ahannsl Qvohann l ahmnol channel is an INTEGER which specifiesthe DMA channel to be used for the transfer where 1 SelectDMA channel 1 2 SelectDMA channel2 3 SelectDM...

Страница 117: ...yte BIT 7 6 5 4 3 2 1 0 X X X X X X X ADRS Where X May be any value ADRS If this bit is setto 0 bits 0 through 7 will be written to Interrupt Mask 1 If this bit is setto 1 bits 0 through 7 will be written to Interrupt Mask 2 INTERRUPT MASK 1 INTVAL Input Low Byte AD 0 BIT 7 6 5 4 3 2 1 0 0 0 GET 0 DEC 0 0 0 GET When this bit is setto 1 an interrupt will be generated when a KM ROM acting asa device...

Страница 118: ...upt Levelsareassignedby meansof a jumper on the KM ROM board This jumper is described in detail in Chapter 2 You must set upan tnterrupt handling routine within the QuickBASIC program to deal with the interrupt condition exzsmp e This exampleenablesthe KM 488 ROM to generate an interrupt when SRQis received sm Iwr 0 140 SETPORT purpose This routine is used to alter the range of addressesused by th...

Страница 119: ...ed that noneof thebaseaddressesoverlap This line assignsBoard 0 a Baseaddressof 300hex mtport 0 530O SETSPOLL Setsthe SerialPoll Responseof the KM 488 ROM when it is acting asa Devicefnon Controller VAR se IHTEGER BEQIU 8etqoll rr p resp is an INTRG8 Rdescribing the serial poll responseand the stateof the SRQbit This byte is of the following format Resp Input Low Byte SIT 7 6 5 4 3 2 1 0 Where SPR...

Страница 120: ... stat parameters a s an INTEGER containing the IEEEbus addressof device to be serial polled Can range from 0 to 30 returns resp aBYTEcontaining the serialpoll response The definition of resp variesdevice however Bit 6 always indicates whether the deviceneeds service Consult the manufacturer s operator s manual for more information stat is an INTEGER describing the stateof the transfer returned aft...

Страница 121: ...resenceof the GPIB SRQsignal usage IF vwl fms paremeter None returns The SRQfunction returns a0 or FALSEcondition when SRQhasnot beendetected or a 1or TRUB condition when SRQis present notes The value retruned by the SRQfunction is generally used within a conditional branch in an applicaiton program Note that onceyou haveobtained a TRUE responsefrom the SRQ function theSRQresponsewill be resetto F...

Страница 122: ...s reg at parameters reg is an INTEGERcontaining the address of the register or configuration parameter to be queried You must passthis parameter into the routine asa variable This value corresponds to a 4 bit field which specifiesthe statusregister or configuration parameter to be read The format of the regbyte is asfollows Reg input Low Byte BIT 7 6 6 4 3 2 1 0 X X X X ADR3 ADR2 ADRl ADRO Where X...

Страница 123: ...inator Length If setto 0 then the terminator is one byte long If setto 1 then the terminator is two bytes long EOI If this bit is setto 1 EOI is assertedwhen the last terminator byte is sent Otherwise EOI is not asserted stat an INTXBR describing the status bits for the register or the configuration parameter specified by the reg parameter Unless otherwise noted the high byte of stat is returned a...

Страница 124: ...ce to active controller etc InDut and Outout MessaEeTerminator 3 Contains First and Last bytes of the messageterminator Input Terminators and single character Output Terminators areonly onebyte long and are contained in the LeastSignificant Byte MSB O In the caseof a two character Output Tennlnator the Most Significant Byteof this parameter is the first charactersent DMA Timeout and I O Timeout Pa...

Страница 125: ...st be separatedby one or more spaces It may also be specifiedasa quoted string within the XMIT call All the available commandsaredescribedin Chapter 3 Thesecommands include CMD GTL MTA SDC l 0 DATA GTLA MLA SEC Tl DCL IFC PIT SPE T2 END LISTEN PPD SPD T3 EOI LLO PPU TALK UNL _ GET LOC REN TCT UNT returns stat is an INTEGERwhich describesthe stateof the transfer returned after the call The returned...

Страница 126: ...ExecuteTrigger Buscommand GET is received The program then bigger6 the instrument to get the first reading and makesit a talker and the KM 48 ROM a listener in order to get the Erst reading The deviceto receivethe setup command string which must be sentto the meter contains the following devicecommands Fu SelectDC Volts mode R3 Select30Volt range Sl Select4 l 2 digit accuracy T3 Take one reading w...

Страница 127: ... data bytes stored in eachlocation is a function of the data type A characterarray for example contains onebyte per location whereas an integer array contains two bytes per location TheXMITA routine sendsthe leastsignificant byte of the specifiedarray location first followed by the bytes in increasing significanceand increasing array index term is an INTEGER which selectsthe terminator to be used ...

Страница 128: ... II Where TM0 Timeout Error Indicates whether or not a Timeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred NT KM 488ROM not a Talker If this bit is setto a 1 it indicates the routine was called before the KM 488 ROM was designated asaTalker This exampleillustrates the useof the XMIT XMITA RCVA SEND and SPOLLroutines to sendand retrieve waveform data from aG...

Страница 129: ... XMITA cont 1aqt h ImaD mg1 aaaL i nnrmta hy casa PROGRAMMING IN TURBO PASCAL 6 31 ...

Страница 130: ...kuutat ahkmzm 0 Don t bother otu 1 eak um aount 1 send EOI ith heokmlm 1 mit ah uum t 0 km at chcvakmm asnt if kmmt t 0 mm marrorsuldl r klMt t xrit l CLBARIN ALL l5IAacs en oope CLEIUI au km e if kmst t 0 mm msrroramdl r kmet t riteln DrsPraYIaG 5luw 0 lT Aca e mope mAcal oaSQUP TOa aTO1 VPOS TTOa O BPOSTTIOa O rmTTS V Lm tatj if kmst aA 0 TEE xhxrroramdl rwmst t _ ____ mtrieYe at d oompare _____...

Страница 131: ... XMITA cont aount 2060 c number of bytr expeoted kmat t 0 PROGRAMMING IN TURBO PASCAL 6 33 ...

Страница 132: ...cl 6 34 KM 46 ROM USER GUIDE ...

Страница 133: ...e the line i nclude km488rom h Compiling Compile your program in the normal manner being sure to link it with the library KM488ROM UB For example when working in Microsoft C at the DOSprompt type either cl yourprog c link km488rom Of cl c yourprog 0 link yourprog km488rom Software TheKM ROM firmware contains a number of configuration parameterswhich govern the default settings of the input and out...

Страница 134: ...ytes than havebeen allocated for storageinto that variable other internal program variablesmay be overwritten producing unexpected results or a program crash 5 Valueswhich arereturned to aC program by the KM488 ROM routines must be handled in the following manner In order to return a value to a named variable in C the address of the named variable must be passedinto the routine Thus you must passp...

Страница 135: ...he input parameters describesany valuesreturned by the routine lists any specialprogramming considerations givesa programming example using the routine DMATIMEOUT Setsthe maximum length of time for a DMA transfer to complete before a timeout error is reported SeeXMITA and RCVA routines unaigmd tiam atthout tima NOTE Thealternate usagesetsboth the DMA and I O Timeouts to the specified value time is...

Страница 136: ...maxlen must relate to info as describedabove adrs is an INTEGERcontaining the IEEEbus addressof the device that the data is to be sentto and the termtnator to be used This byte is of the followhlg format Adrs Input Parameter Low Byte BIT 7 6 5 4 3 2 1 0 1 TRMl 1 ADA4 1 ADR3 ADR2 ADRl 1 ADRO I Where TRM1 6 Terminator Select Thesetwo bits selectthe Message Terminator to be used to signal the end of ...

Страница 137: ...at is an INTBGERwhich describesthe stateof the transfer returned after the call The returned stat values for combination 00 are interpreted asfollows Stat Return Low Byte BIT 7 6 5 4 3 2 1 0 TM0 OVF NC ADRS Timeout Error Indicates whether or not aTimeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred Overflow Error If this bit is a 1 then the info string was f...

Страница 138: ...s printed out on the computer screen inalud mtdio n Xinalu Ou4B8rom h ino 1 int in t1 7 i t lO un gnd r1 n 0 0h r in tri g 26 INIT purpose Initializes a KM 466 ROM by assigningits GPIBaddress and establishing it asa SystemController or device usage int l dr modci init a mode 7 6 KM 466 ROM USER GUIDE ...

Страница 139: ...for more information DEV returns None Device If setto 1 the KM 488 ROM is acting asa Device Otherwise the KM 488 ROM is acting asa System Controller When SystemController is selected the GPIB IFC line is momentarily asserted notes You may passthe parametersdirectly into the routine without using variable assignments i e init OP exampte This example initializes the KM ROM asa SystemController with ...

Страница 140: ...he parametersmay be passeddirectly into the routine example This examplesetsInput Terminator 0 to Line Feedand Input Terminator 3 to Carriage Return Lnt cm O 10 I input t Im iMtar s to Ia intern 3 0 0 sdx input twminator 3 to Carriage Return IOTIMEOUT putpose Changesthe length of time to elapsebefore an I O Timeout occurs usage un ignsd tuas iotimaout tAma parameters time is the amount of time to ...

Страница 141: ...determines whether or not EOI is asserted when the last terminator byte is sent If this bit is 1 EOI will be sent If this bit is 0 EOI will not be sent trml is an INTEGER which representsthe first terminator byte to be sent This integer is the hexor decimal equivalent of the terminator s ASCII representation SeeAppendix A for ASCII Equivalents Besure to precedeall hexvalueswith a Ox trm2 is an INT...

Страница 142: ... nnn is the decimal value of the ParallelPoll Enablebyte The Parallel Poll EnableByteis of the format OllOSPPP where S is the parallel poll responsevalue 0or 1 that the device usesto respond to the parallel poll when serviceis required PPP is a 3 bit value which tells the devicebeing configured which data bit it should useasits parallel poll responseCD101through DIO8 example This exampleassumestha...

Страница 143: ... your program and your program may crash term is an INTEGERcontaining the number of the input message terminator to be used where term TERMINATOR DEFAULT 0 0 LF 1 1 CR 2 2 3 3 Theseterminators canbechanged by calling the INTBRM routine info is aCHARACTER ARRAY which will contain the receiveddata The length of the string must be long enough to receivethe expected number of characters RCV will termi...

Страница 144: ...xample This exampleshows how the RCV routine might be used together with the XMIT routine to receivedata It usesthe XMIT routine to command a Keith 196voltmeter to take a reading The meter reading is received using the RCV routine It is assumedthat the meter reading returned will fit into a25character array This exampleassumesthat the KM488 ROM is configured such that transmit messageterminator 1i...

Страница 145: ...essageTerminator Character will be used to detectthe end of reception If this bit is 0 a MessageTerminator Character will not be used TRM1 6 Terminator Select Thesetwo bits selectthe Input Message Terminator to be used to signal the end of a transmission TheSTRMbit must be setto 1 Available terminator selectionsare TRMl TRMO TERMINATOR DEFAULT 0 0 0 LF 0 1 1 CR 1 0 2 1 1 3 The valuesfor thesetermt...

Страница 146: ...is a 1 then RCVA mutine ceasedbecausean EOI or terminator characterwas received If this bit is a 0 then the RCVA was terminated becausean error occurred or the maximum byte count was reached TM0 Timeout Error Indicates whether or not aTimeout Error occurred during data transfer If this bit is a 1 then a Timeout Error occurred NL KM466 ROM not a Listener If this bit is set to a 1 it indicates the R...

Страница 147: ...ddress 192 Terminator 3 Forexample if you wanted to senda messageusing messageterminator 2 to adevice at GPIBaddress 10 the valueof adrs supplied to SEND would be 138decimal 10 12 GPIBAddress Thesefive bits are used to represent the GPIBaddressof the device to which the data is to be sent GPIBaddressescan range from 0 to 30 info is aSTRINGcontaining the data tobe sent returns stat is an INTEGERdes...

Страница 148: ...dshaking The data a devicesetop string is sentto a device located at GPIBaddress2 inolud 4ssrom h tin0 I irat a 12 t t 0 usage alternate usage parameters SETBOARD In multiple board system identifies the Kh4488 ROM to be programmed int board 1 ckboard board board is an lNTEGERbetween 0and 3 representing the board to be programmed Note that up to four boards install in any one system The board numbe...

Страница 149: ...h other devicesconnected to the bus can send or receive data Theseratesaregoverned automatically by the GPIBhandshaking signals purpose Allows the useof DMA in conjunction with XMITA and RCVA usage iat c4luma1 astdml IlhaMel alternate usage dmaohumel ahMnol parameters channel is an INTEGERwhich specifiesthe DMA channel to be used for the transfer where 1 SelectDMA channel 1 2 SelectDMA channel2 3 ...

Страница 150: ...t High Byte BIT 7 6 6 4 3 2 1 0 Where X May be any value ADRS If this bit is setto 0 bits 0 through 7 will be written to Interrupt Mask 1 If this bit is setto 1 bits 0 through 7 will be written to Interrupt Mask 2 INTERRUPT MASK 1 INTVAL Input Low Byte ADRS 01 BIT 7 6 5 4 3 2 1 0 GET 0 DEC 0 0 0 Where GET When this bit is setto 1 an interrupt will be generated when aKM488 ROM acting asadevice rece...

Страница 151: ...2 You must set upan interrupt handling routine withIn the QuickBASIC program to deal with the interrupt condition This exampleenablesthe KM I ROM to generate an interrupt when SRQis received SETINT Oxl40 SETPORT purpose This routine is used to alter the range of addressesusedby the KM k ROM s I O Port In a multiple board environment it is alsoused to associatea given range of I O addresseswith a b...

Страница 152: ...evice nonControUer9 USage int rs p l et poll resp parameters resp is an INTEGERdescribing the serial pail responseand the stateof the SRQbit This byte is of the following format Resp Input Low Byte BIT 7 6 5 4 3 2 1 0 SPRB RSV SPR6 SPR5 SPR4 SPR3 SPR2 SPRl Where SPA14 Bits 1through 8 of this device sSerialPoll ResponseByte RSV If this bit is 1 SRQwill beassertedto request servicing Otherwise SRQwi...

Страница 153: ...g the stateof the transfer returned after the call The statvalue is interpreted asfollows Stat Return Low Byte BIT 7 6 5 4 3 2 1 0 Where TM0 Indicates whether a Timeout Error occurred during data transfer If a 1 then aTimeout Error occurred NC KM488 ROM not a Controller If setto a 1 it indicates the routine was called before the KM 488ROM was designated asan Active Controller ADR Invalid GPIBAddre...

Страница 154: ...ere simultaneously asserting SRQ the output of the SRQfimction would onceagain be resetto TRUE Othenvtse the SRQfunction would becomeTRUE on the next assertion of the SRQline exmJp e This example assumesthat the KM 488 ROM is connected to an instrument locatedat GPIBaddress1which is capableof requesting servicevia SRQ When the SRQis detected the SPOLL function will be called and the serial poll re...

Страница 155: ...or not EOI is assertedwith the lastbyte When obtaining other parameters reg will retain its input value Reg Return Low Byte BIT 7 6 5 4 3 2 1 0 0 0 0 0 0 0 LEN EOI Where LEN Terminator Length If this bit is setto 0 then the terminator is one byte long If this bit is setto 1 then the terminator is two bytes long EOI If this bit is setto 1 EOIis assertedwhen the last terminator byte is sent Otherwis...

Страница 156: ... bit is setto 1 then a Group ExecuteTrigger command was received while the KM488 ROM was a device DEC When this bit is setto 1 a Device Clear was received Interrout StatusRetister 2 Stat Return Low Byte BIT 7 6 6 4 3 2 1 0 X sFla1 LOK REM X X X ADSC Where X This bit may be any value SRQl When this bit is setto 1 it indicates SRQwas active Active Controller mode only LOK When this bit is setto 1 th...

Страница 157: ...ou read theseregisters any bits which were setare automatically clearedby the READ operation This is extremely important to note when reading Interrupt StatesRegister1 assomeof the bits not shown above are used by various KM4WROM routines It may be possibleto causevarious KM488 ROM routines to report a timeout error if this register is read while the KM4 ROM is addressed to talk or listen exampte ...

Страница 158: ...t is a 1 then a Timeout Error occurred String Error If this bit is setto one then a quoted string END or terminator was found without a DATA subcommandpreceding it KM488 ROM not a Talker If this bit is setto a 1 it indicates the routine was called before the KM 488 ROM was designatedasa Talker Syntax Error If this bit is setto 1 a syntax error was found example This exampleiUustratesone way to use...

Страница 159: ...ands asa string of DATA l Sending the appropriate messageterminator charactersafter the data l Issuing the Group ExecuteTrigger bus command l Unaddressing all devices l Addressing the meter to TALK and the KM 488 ROM to LISTBN My Listen Address in preparation for receiving the latest reading The default value for transmit messageterminator 1is acarriage return line feed combination inolu xkm4SSrom...

Страница 160: ...selectsthe terminator to be used This byte is of the format Term Input Parameter Low Byte 7 6 5 4 3 2 1 0 When2 X This bit may be any value STRM Send MessageTerminators If this bit is setto 1 then the messageterminator61 will be sentat the end of the transmission Otherwlse they will not TRM1 0 Terminator Select Thesetwo bits selectthe Output MessageTerminator to be used to signal the end of a tran...

Страница 161: ... setto a 1 it indicates the routine was called before the KM 488ROM was designated asa Talker This exampleillustrates the useof the XMIT XMITA RCVA SEND and SPOLL routines to sendand retrieve waveform data from aGPIB compatible oscilloscope un igncld i ta lO241 sins xave data l txdat lcl281 inednti m3nverts 3 by s a pByt es rav mine l0281 for oanvertsd data l ahar rxd t nloo for ra1 data from Osfi...

Страница 162: ... XMITA cont 7 30 KM 488 ROM USER GUIDE ...

Страница 163: ...Bondler kmst t prr tr COMPARE SEW ANDR CBTVED DATA OK aplD comarlE n a0MiV d de format t rt itA h ader n byi3 aount CORVE xX aeaeivd data at rta at offset 9 l l rx dat s atart Of ata d wI r l rev mine ror i o i aor i I aopy data to ro ed c PROGRAMMING IN C 7 31 ...

Страница 164: ...da a i rw si il put I put f printi nConpl t key getoh 0 ii k y 27 exit O exit o 1 n ign d int srapByte nE ned value n ign d N l O n al l 8 rva1ucl I due s retuz N l 1 void mrr0rEIuldl r irk ErrorF1e g printF nERROR NOMBER d n BrrorFlag axit 7 32 KM 488 ROM USER GUIDE ...

Страница 165: ...Note that if you are submitting your equipment for repair under warranty you must furnish the invoice number and date of purchase When returning equipment for repair pleaseinclude the following information 1 Your name address and telephone number 2 The invoice number and date of equipment purchase 3 A description of the problem or its symptoms Repackagethe equipment Handle it with ground protectio...

Страница 166: ...a 0 cl 8 2 KM 4 i ROM USER GUIDE ...

Страница 167: ...ousIdle 16 22 ETB End of Trans Blank 17 23 CAN Cancel 18 24 EM Endof Medium 19 2s SUB Substitute 1A 26 ESC Escape 1B 27 FS File Separator 1c 28 GS Group Separator 1D 29 RS RecordSeparator 1E 30 us unit separator 1F 31 SP Space 20 32 ASCII CHARACTER HEX DEC I Exclamation Point 21 33 QuoteMark 22 34 Pound Sign 23 3s Dollar Sign 2A 36 PerCent Sign 25 31 Ampersand 26 38 Apostrophe 27 39 Left Parenthes...

Страница 168: ...81 52 82 53 83 54 84 55 85 56 86 57 87 58 88 59 89 5A 90 5B 91 SC 92 SD 93 SE 94 SF 95 60 61 97 62 98 ASCII CHARACTER HEX DEC 99 1 m n 0 P 9 r S t w x Y z Left Brace I Vertical Slash Right Brace Tilde DEL Delete 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 12 73 74 15 76 77 78 79 7A 7B 7c 7D 7E 7F 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 1...

Страница 169: ... measurement or control system can be representedas DEVICE OR PROCESS MEASURING DEVICES 4 A typical testwould be to measurethe frequency response of a device The sourcewould be capableof supplying a sinewave of varying frequency to the input of the deviceand the measuring device would measurethe magnitude and phaseof the output In an automated system the CONTROL box would step the sourcethrough a ...

Страница 170: ...to another such asa meter outputting data to a printer A more typical IEEE 488bus system SeeFigure B l is comprised of up to 15devices eachof which actsasone or more of the following Controller Listener and Talker There area variety of interface functions whlchGPIB devicescan support at various levels The IEEEstandard recommendsthat a label listing the device codesbe placed on the instrument near ...

Страница 171: ...n either through the useof hardware switches or by sometype of configuration software and usually would not be changed This SystemController can be the samecontroller asthe one which is the current Active Controller or an entirely different one If the controller is both a SystemController and an Active Controller and it passescontrol to another controller the systemcontroller capability is not pas...

Страница 172: ...ds They arediscussedextensively in sectionB 4 Control Lines Thecontrol Lines perform a variety of control request and coordinating functions which assurethe orderly flow of information on the bus The IEEEstandard refers to any bus activity asbeing a message Messagesused to control bus functions asopposed to sending data between devices arecalled interface messages Asserting acontrol line is said t...

Страница 173: ...canbeprogrammed viaIEEE buscommands issuedfromanactivetalker Thisline canonlybe asserted by theSystemController Thislinewhenasserted indicatesthatserviceisrequiredfromthe ActiveContmller SRQcanbeasserted by anybusdevicewhich supportsthefunction Handshake Lines There are three Handshake Lines which areused to coordinate data transfersbetween talkers and listeners on the bus Table B 2briefly describ...

Страница 174: ...Y Flgure Et4 Handshake Tknlng Flgurs B 5 Transmlsslon of Data from Talker to Llstener B 6 KM 488 ROM USER GUIDE ...

Страница 175: ...EEE488 1 specification refers to two types of messagesasoccurring on the bus This first is interface messageswhich manage the interface itself and the secondaredevice dependent messageswhich are used to transfer information between bus devices Interface messagesare sumrnarlzed in Appendix D and canbe placed in two groups The first group consistsof the so called Uniline Interface Messages introduce...

Страница 176: ...roller by addressing a prospective controller to listen and then issuing aTake Control TCT SeeSectionB 5 message Care must be taken that the prospective controller is capableof accepting control becausegenerally no error will be detected if it is not Having issuedthe messagethe previous controller becomesan inactive controller and a normal bus device A systemcontroller canalways seizecontrol by as...

Страница 177: ...voltage range on a multimeter produced by another company Thedevice s which is addressedto listen candistinguish Device Commands from data becausecertain characteror command sequencesare included Newer deviceswhich conform to the IEEE4882 and or SCPI Standard Commands for Programmable Instruments specificationsmay havemore standardized command sets Consult the documentation accompanying the device...

Страница 178: ... followed by a serialpoll This enablesthe Active Controller to determine the type of serviceneededby a device Serial Polling Serialpolling permits the Active Controller to determine whether any device s needsservice The Active Controller serial polls one deviceat a time by first issuing the serial poll enable SPE multiline messageof Section8 5 Now when a device is addressedto talk the device will ...

Страница 179: ...el poll Their capability including the manner of DIO assignmentis specifiedby the PI code Appendix D Only certain controller C codes support parallel poll B 5 BUS INTERFACE Buscommands areissuedby the Active Controller There are five types of bus commands l Universal l Listen Address Group LAG l Talk Address Group TAG l Addressed Commands l SecondaryCommands Thesearedescribed within this section A...

Страница 180: ... to 30 of the devicewhich is to talk This addressconsistsof a primary address in the range 0 to 30 Address 31canbe used to UNTALK all devices This may be accompanied by a secondaryaddressin the range 0 to 31 Generally when an Active Controller issuesa TAG command it l Assertsthe ATN line l Untalks all devices l Sendsa TAG l Unassertsthe ATN line l The talker then sendsits data Listen Address Group...

Страница 181: ...ombinedwith theuseof thesecondary commands PPE andPPD thiscommand enables disables theaddressed deviceto beremotelyparallelpolledby theconrroller TCT TakeControl Thisallowstheactivecontrollertopasscontroltoanother controlleronthesystem Thesecondcontrollerthenbecomes the activecont roIler Secondary Commands Secondarycommandsare sentimmediately following a PPC Parallel Poll Configure TAG Talk Addres...

Страница 182: ...lls the device to assertits assignedline when serviceis required while setting the 4th lowest bit low will cause the device to assertits line when serviceis not required B 6 REFERENCE DOCUMENTS If you require more detailed information than this tutorial provides refer to the following documents l ANSI IEEE 488 1 1987 IEEE Standard Digital Interfacefor Programmable Instrumentation l ANSI IEEE 488 2...

Страница 183: ...Appendix C IEEE Multiline Commands IEEE MULTILINE COMMANDS C l ...

Страница 184: ...c 2 KM 488 ROM USER GUIDE ...

Страница 185: ...GlherFunction Subs Required SHO NOflO SHl Ti TB TEI TEE or C26 TFunctionAllowabk Subsots ldenlilicafion C awipdon CiherFunctionSubs Basic Talker Talk Unaddress Required Only if MA Mode 7 F Y i NOI 3 SHi andAH1 T2 Y Y N N SHl andAH1 T3 Y N Y N SHl andAH1 T4 Y N N N SHl andAH T5 Y Y Y Y SHl andLl L4 orLEl LE4 T6 Y Y N Y SHl andLl L4orLEl LE4 77 Y N Y Y SHl andLl L4 orLEl LE4 T6 Y N N Y SHl andLl L4 ...

Страница 186: ...LEl LE4 Y N N Y SHl andLl L4 orLEl LE4 Rl FunctionAllowable Subsets ldenlilicalion Description Xher FunctionSubsets RLO RLl RL2 NoLocalLwkoul Required NOW Ll L4 or LEi LM Ll L4 a LEl LM PP FunctionAltmvable Subsets ldenlilicalion Desuiption OtherFunctionSubsets Required FE Nocapability Remote cap lay None PP2 LocalCanllguration L or LEl LM DC FunctionAllowable Subssts ldenlilicalion Dewiption Clhe...

Страница 187: ...escription Basic Listen Unaddress CihetFunction SubsetsRequired Listener OnlyMode if MSA m E v v i NOIW AH1 LE2 Y N N AH1 LE3 Y Y Y AH1andTl T6 or TEl TEE LE4 Y N Y AH1andT T6orTEl TEE Replaced byMTAwhenusedtogether whhtheTh ndion SR FunctionA owab eSubsets ldenlificalion SRO SRl Description No abiliiy p Camp819 Capability OtherFunctionSubsets Required NOW3 Z T T TE TE TES O DEVICE CAPABILITY CODE...

Страница 188: ...iij D 4 KM 488 ROM USER GUIDE ...

Страница 189: ...a to be printed Logical devicesare representedusing a colon for example LpTl This would indicate the device which is currently configured to receivethe data to be printed The computer maintains two tables eachof which has four entries Thesetablesare used to assigna physical device to a logical device For example if two printer ports and one serial port were installed thesetableswould initially app...

Страница 190: ...ich specifiesthe timeout period This can be any value between 1to 30seconds The default value is 1second The timeout period should be set long enough to allow for the slowest plotter function NOTES 9 If KMLPT is executedwith no arguments then it just displays the current logical printer port assignments l If one or more arguments are provided then the first logical printer port LFTl is re directed...

Страница 191: ...e possible to unload the re director until subsequentdrivers areunloaded l The IPC messageis sent when the driver loads E 3 SERIAL PORT REDIRECTION Serial Port redirection is accomplished in the samemanner asParallel Port e direction The only difference is that you usethe KMCOM utility This is a bidirectional redirector which intercepts a characterrequestfrom DOSBIOSand reads writes the data from ...

Страница 192: ...he first logical COM port COMl is re directed to the physical deviceby the first argument the next logical port COM2 is re directed to the next specified physical etc l If lessthan four devicesare specified then the remaining logical COM ports are re directed to any unused physical COM ports l For the serial or parallel port to be redirected effectively the application program should be configured...

Страница 193: ...are sent LINT UNL MLA TA ATN is unassertedand the data is received If the GPIBbus addressusedby the KMCOM redirect driver remains the same the data is simply sentor received over the bus E 5 UNLOADING KMCOM FROM DOS To unload the KMCOM utility from the DO8 command line 1 Change to the directory where your KM 488 ROM software is located 2 At the DO 3prompt type l0fCOH U l If the driver is already r...

Страница 194: ...lotter doesnot understand To avoid this problem determine if your application will allow you to turn off this hardware handshaking If you can strip out the RS 232handshaking commands and send apure plot file to aport in useindirect output If you areIndirectly Outputting your plot files try to nameyour file something which includes an I O port name e g COM3 X However this may result in the program ...

Отзывы: