Home

NI-488.2 Function Reference Manual for DOS/Windows

image

Contents

1. NI 488 Functions Chapter 1 IBSTOP Board Level IBSTOP Device Level Purpose Abort asynchronous I O operation DOS Format C int ibstop int ud QuickBASIC BASIC CALL ibstop ud or BASICA CALL ibstop ud Windows Format C int ibstop int ud Visual Basic CALL ibstop ud Or Direct Entry with C DLLibstop int ud int far ibsta status ilstop status ilstop int far iberr long far ibocntl Direct Entry with Visual Basic Declare Function DLLibstop Lib gpib dll ByVal ud NI 488 2 FRM for DOS Windows ibsta iberr ibcntl amp As Integer 1 106 National Instruments Corp Chapter 1 NI 488 Functions IBSTOP Board Level IBSTOP Device Level Continued Input ud Board or device descriptor Output Function Return Description The value of ibsta The ibstop function aborts any asynchronous read write or command operation that is in progress and resynchronizes the application with the driver If asynchronous I O is in progress the error bit is set in the status word ibsta and EABO is returned indicating that the I O was successfully stopped Possible Errors EABO EDVR ENEB Asynchronous I O was successfully stopped Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured National Instruments Corp 1 107 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBTMO Board
2. Windows Format C void TriggerList int boardID Addr4882 t addrlist Visual Basic CALL TriggerList boardID addrlist Direct Entry with C DLLTriggerList int boardID Addr4882 t far addrlist int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLTriggerList Lib gpib dll ByVal boardID addrlist ibsta iberr ibcntl amp National Instruments Corp 2 79 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 TriggerList TriggerList Continued Input boardID The interface board number addrlist A list of device addresses terminated by NOADDR Description TriggerList sends the Group Execute Trigger GET GPIB message to the devices included in addrlist If addrlist contains only NOADDR the Group Execute Trigger message is sent to all devices that are currently listen active on the GPIB Possible Errors EARG EBUS ECIC EDVR ENEB EOIP An invalid address out of range appears in addrlist ibcnt1 is the index of the invalid address in the addrlist array No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 80 National Instruments Corp Chapter 2 NI 488 2 Rou
3. device drive path nivgpibd 386 where drive and path describe the location of nivgpibd 386 on your hard drive By default only one GPIB board at a time can perform DMA If you need to perform DMA transfers on multiple GPIB boards at the same time add a new section to your system ini file vapibd In this section add the option NumBoardsUsingDMA and set it equal to the number of boards that will be performing DMA For example if you want two boards to perform DMA concurrently add the following lines to the bottom of your system ini file vgpibd NumBoardsUsingDMA 2 NI 488 2 FRM for DOS Windows C 6 National Instruments Corp Appendix C Error Codes and Solutions To install the virtual DMA device first change the default virtual DMA device line to a remark line by adding a semicolon Then add a line to install the National Instruments virtual DMA device as follows device vdmad device drive path nivdmad 386 where drive and path describe the location of nivdmad 386 on your hard drive Note You must restart Windows after you modify the system ini file Alternatively you can correct the EDMA problem by disabling DMA in the software You can use ibdma to disable DMA EOIP 10 EOIP occurs when an asynchronous I O operation has not finished before some other call is made During asynchronous I O you can only use ibstop ibwait and ibonl or perform other non GPIB operations Once the asynchronous
4. National Instruments Corp D 1 Fax Number 03 9879 6277 0662 45 79 90 19 02 757 03 11 905 785 0086 514 694 4399 45 76 26 02 90 502 2930 01 48 14 24 14 089 714 60 35 2686 8505 03 5734816 02 41309215 03 5472 2977 02 596 7455 5 520 3282 0348 430673 32 84 86 00 2265887 91 640 0533 08 730 43 70 056 200 51 55 02 737 4644 01635 523154 NI 488 2 FRM for DOS Windows Technical Support Form Photocopy this form and update it each time you make changes to your software or hardware and use the completed copy of this form as a reference for your current configuration Completing this form accurately before contacting National Instruments for technical support helps our applications engineers answer your questions more efficiently If you are using any National Instruments hardware or software products related to this problem include the configuration forms from their user manuals Include additional pages if necessary Name Company Address Fax ___ Computer brand Model Operating system Speed Display adapter Mouse yes Other adapters installed Hard disk capacity Instruments used Phone ___ Processor MHz RAM no MB Brand National Instruments hardware product model Revision Configuration National Instruments software product Revision Configuration MB continues The problem is List any error messages The following steps will
5. C void TestSys int boardID Addr4882 t addrlist short resultlist QuickBASIC BASIC CALL TestSys boardID addrlist resultlist BASICA CALL TestSys boardID addrlist 0 resultlist 0 Windows Format C void TestSys int boardID Addr4882 t addrlist short resultlist Visual Basic CALL TestSys boardID addrlist resultlist Direct Entry with C DLLTestSys int boardID Addr4882 t far addrlist short far resultlist int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLTestSys Lib gpib dll ByVal boardID addrlist resultlist ibsta iberr ibcntl amp NI 488 2 FRM for DOS Windows 2 74 National Instruments Corp Chapter 2 NI 488 2 Routines TestSys TestSys Continued Input boardID The interface board number addrlist A list of device addresses terminated by NOADDR Output resultlist A list of test results each entry corresponds to an address in addrlist Description TestSys sends the TST Nn message to the IEEE 488 2 compliant devices described by addrlist The TST Vn message instructs them to conduct their self test procedures A 16 bit test result code is read from each device and stored in resultlist A test result of 0 n indicates that the device passed its self test Any other value indicates that the device failed its self test Refer to the manual that came with your device to determine the meaning of
6. EBUS No devices are connected to the GPIB ECIC The interface board is not the Controller In Charge see SendIFC EDVR Either boardID is invalid out of range or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress National Instruments Corp 2 65 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 SendLLO SendLLO Purpose Send the Local Lockout LLO message to all devices DOS Format C void SendLLO int boardID BASICA QuickBASIC BASIC CALL SendLLO boardID Windows Format C void SendLLO int boardID Visual Basic CALL SendLLO boardID Direct Entry with C DLLSendLLO int boardID int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLSendLLO Lib gpib dll ByVal boardID ibsta iberr ibocntl amp Input boardID The interface board number NI 488 2 FRM for DOS Windows 2 66 National Instruments Corp Chapter 2 NI 488 2 Routines SendLLO SendLLO Continued Description SendLLO sends the GPIB Local Lockout LLO message to all devices While Local Lockout is in effect only the Controller In Charge can alter the state of the devices by sending appropriate GPIB messages SendLLO is reserved for use in unusual local remote situations In most cases use Set RWLS to place devices in Remote With Lockout State Possible Errors EBUS N
7. ENEB ENOL EOIP The I O timeout period has expired before all of the bytes were sent The address parameter is invalid out of range or the constant NOADDR or the buffer is empty and the otmode is DABend No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured No Listeners are on the GPIB to accept the data bytes Asynchronous I O is in progress National Instruments Corp 2 55 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 SendCmds SendCmds Purpose Send GPIB command bytes DOS Format C void SendCmds int boardID void buffer long cnt BASICA QuickBASIC BASIC CALL SendCmds boardID buffer Windows Format C void SendCmds int boardID void buffer long cnt Visual Basic CALL SendCmds boardID buffer Direct Entry with C DLLSendCmds int boardID void far buffer long cnt int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLSendCmds Lib gpib dll ByVal boardID ByVal buffer ByVal cnt amp ibsta iberr ibcntl amp NI 488 2 FRM for DOS Windows 2 56 National Instruments Corp Chapter 2 NI 488 2 Routines SendCmds SendCmds Continued Input boardID The interface board number buffer Command
8. The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 8 National Instruments Corp Chapter 2 NI 488 2 Routines DevClearList DevClearList Purpose Clear multiple devices DOS Format C void DevClearList QuickBASIC BASIC CALL DevClearList BASICA CALL DevClearList Windows Format C void DevClearList Visual Basic CALL DevClearList Direct Entry with C int boardID Addr4882 t addrlist boardID addrlist boardID addrlist 0 int boardID Addr4882 t addrlist boardID addrlist DLLDevClearList int boardID Addr4882 t far addrlist int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLDevClearList Lib gpib dll ByVal boardID addrlist ibsta iberr ibcntl amp National Instruments Corp 2 9 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 DevClearList DevClearList Continued Input boardID The interface board number addrlist A list of device addresses terminated by NOADDR that you want to clear Description DevClearList sends the Selected Device Clear SDC GPIB message to all the device addresses described by addrlist If addrlist contains only the constant NOADDR then the Universal Device Clear DCL message is sent to all the devices on the bus Possible Errors EARG EBUS ECIC EDVR ENEB EOIP
9. Input ud Board or device descriptor pad The primary GPIB address of the device sad The secondary GPIB address of the device Output listen Indicates whether or not a device is present Function Return The value of ibsta Description ibln determines whether there is a listening device at the GPIB address designated by the pad and sad parameters If ud is a board descriptor then the bus associated with that board is tested for Listeners If ud is a device descriptor then ib1n uses the access board associated with that device to test for Listeners If a Listener is detected a non zero value is returned in 1isten If no Listener 1s found zero is returned The pad parameter can be any valid primary address a value between 0 and 30 The sad parameter can be any valid secondary address a value between 96 to 126 or one of the constants NO SAD or ALL SAD The constant NO SAD designates that no secondary address is to be tested only a primary address is tested The constant ALL SAD designates that all secondary addresses are to be tested National Instruments Corp 1 61 NI 488 2 FRM for DOS Windows NI 488 Functions IBLN Chapter 1 Board Level IBLN Device Level Continued Possible Errors EARG ECIC EDVR ENEB EOIP Either the pad or sad argument is invalid Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid
10. NRFD Not Ready For Data P parallel poll PIO PPC Parallel Poll Configure PPD Parallel Poll Disable PPE Parallel Poll Enable A GPIB command used to address a device to be a Listener It can be any one of the 31 primary addresses My Secondary Address is the GPIB command used to address a device to be a Listener or a Talker when extended two byte addressing is used The complete address is a MLA or MTA address followed by an MSA address There are 31 secondary addresses for a total of 961 distinct listen or talk addresses for devices A GPIB command used to address a device to be a Talker It can be any one of the 31 primary addresses The concurrent processing of more than one program or task One of the three GPIB handshake lines See handshake One of the three GPIB handshake lines See handshake The process of polling all configured devices at once and reading a composite poll response See serial poll See programmed I O Parallel Poll Configure is the GPIB command used to configure an addressed Listener to participate in polls Parallel Poll Disable is the GPIB command used to disable a configured device from participating in polls There are 16 PPD commands Parallel Poll Enable is the GPIB command used to enable a configured device to participate in polls and to assign a DIO response line There are 16 PPE commands NI 488 2 FRM for DOS Windows Glossary 6 National Instruments Corp
11. PPU Parallel Poll Unconfigure programmed I O R RAM resynchronize RQS SDC serial poll Service Request source handshake SPD Serial Poll Disable National Instruments Corp Glossary Parallel Poll Unconfigure is the GPIB command used to disable any device from participating in polls Low speed data transfer between the GPIB board and memory in which the CPU moves each data byte according to program instructions See DMA Random access memory The NI 488 2 software and the user application must resynchronize after asynchronous I O operations have completed Request Service Seconds Selected Device Clear is the GPIB command used to reset internal or device functions of an addressed Listener See DCL and IFC The process of polling and reading the status byte of one device at a time See parallel poll See SRQ The GPIB interface function that transmits data and commands Talkers use this function to send data and the Controller uses it to send commands See acceptor handshake and handshake Serial Poll Disable is the GPIB command used to cancel an SPE command Glossary 7 NI 488 2 FRM for DOS Windows Glossary SPE Serial Poll Enable SRQ Service Request status byte status word synchronous System Controller T TAD Talk Address Talker TCT timeout TLC NI 488 2 FRM for DOS Windows Serial Poll Enable is the GPIB command used to enable a spec
12. 1 38 to 1 40 ibdma 1 41 to 1 42 ibeos 1 43 to 1 45 ibeot 1 46 to 1 47 ibevent 1 48 to 1 50 ibfind 1 51 to 1 52 ibgts 1 53 to 1 54 ibist 1 55 to 1 56 iblines 1 57 to 1 59 ibln 1 60 to 1 62 ibloc 1 63 to 1 64 ibonl 1 65 to 1 66 National Instruments Corp Index 5 NI 488 2 FRM for DOS Windows NI 488 2 FRM for DOS Windows Index ibpad 1 67 to 1 68 ibpct 1 69 to 1 70 ibppc 1 71 to 1 73 ibrd 1 74 to 1 76 ibrda 1 77 to 1 79 ibrdf 1 80 to 1 82 ibrdi 1 83 to 1 85 ibrdia 1 86 to 1 89 ibrpp 1 90 to 1 91 ibrsc 1 92 to 1 93 ibrsp 1 94 to 1 96 ibrsv 1 97 to 1 98 ibsad 1 99 to 1 100 ibsic 1 101 to 1 102 ibsre 1 103 to 1 104 ibsrq 1 105 ibstop 1 106 to 1 107 ibtmo 1 108 to 1 110 ibtrap 1 111 to 1 112 ibtrg 1 113 to 1 114 ibwait 1 115 to 1 118 ibwrt 1 119 to 1 121 ibwrta 1 122 to 1 124 ibwrtf 1 125 to 1 127 ibwrti 1 128 to 1 130 ibwrtia 1 131 to 1 134 list of functions table board level functions 1 5 to 1 6 device level functions 1 3 to 1 4 Windows format 1 2 NI 488 2 routines AllSpoll 2 5 to 2 6 DevClear 2 7 to 2 8 DevClearList 2 9 to 2 10 DOS format 2 1 EnableLocal 2 11 to 2 12 EnableRemote 2 13 to 2 14 FindLstn 2 15 to 2 17 FindRQS 2 18 to 2 19 GenerateREQF 2 20 to 2 21 GenerateREQT 2 22 to 2 23 GotoMultAddr 2 24 to 2 32 list of routines table 2 3 to 2 4 PassControl 2 33 to 2 34 PPoll 2 35 to 2 36 PPollConfig 2 37 to 2 38 PPollUnconfig 2 39 to 2 40 RcvRes
13. FindLstn routine 2 15 ibln function 1 60 to 1 62 RcvRespMsg routine 2 41 to 2 43 ReceiveSetup routine 2 49 to 2 50 technical support D 1 TestSRQ routine 2 72 to 2 73 TestSys routine 2 74 to 2 76 timeout function See ibtmo function TIMO status word condition B 2 trap mode changing See ibtrap function trigger functions routines ibtrg 1 113 to 1 114 Trigger routine 2 77 to 2 78 TriggerList routine 2 79 to 2 80 National Instruments Corp Index 9 NI 488 2 FRM for DOS Windows Index W wait functions routines ibwait function 1 115 to 1 118 WaitSRQ routine 2 81 to 2 82 write functions routines ibwrt 1 119 to 1 121 ibwrta 1 122 to 1 124 ibwrtf 1 125 to 1 127 ibwrti 1 128 to 1 130 ibwrtia 1 131 to 1 134 NI 488 2 FRM for DOS Windows Index 10 National Instruments Corp
14. PPU GPIB message is sent to all GPIB devices The devices unconfigured by this function do not participate in subsequent parallel polls For more information on parallel polling refer to the NI 488 2 user manual Possible Errors EARG EBUS ECIC EDVR ENEB EOIP An invalid address out of range appears in addrlist ibcnt1 is the index of the invalid address in the addrlist array No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 40 National Instruments Corp Chapter 2 NI 488 2 Routines RcvRespMsg RcvRespMsg Purpose Read data bytes from a device that is already addressed to talk DOS Format C void RcvRespMsg int boardID void buffer long cnt int termination BASICA QuickBASIC BASIC CALL RcvRespMsg boardID buffer terminations Windows Format C void RcvRespMsg int boardID void buffer long cnt int termination Visual Basic CALL RcvRespMsg boardID buffer terminations Direct Entry with C DLLRcvRespMsg int boardID void far buffer long cnt int termination int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLRcvRespMsg Lib gpib dll ByVa
15. SimulatedAddress amp TAD SendDataBytes 0 buffer unsigned long strlen buffer DABend if ibsta amp ERR printf Error from SendDataBytes n ibonl 0 0 exit 1 GenerateREQF 0 SimulatedAddress amp TAD else printf NOT talk or listen addressed n ibon1 0 0 exit 1 You must call ibonl with a value of 0 before exiting the program x ibonl 0 0 return 0 end of main NI 488 2 FRM for DOS Windows 2 32 National Instruments Corp Chapter 2 NI 488 2 Routines PassControl PassControl Purpose Pass control to another device with Controller capability DOS Format C void PassControl int boardID Addr4882 t address BASICA QuickBASIC BASIC CALL PassControl boardID address Windows Format C void PassControl int boardID Addr4882 t address Visual Basic CALL PassControl boardID address Direct Entry with C DLLPassControl int boardID Addr4882 t address int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLPassControl Lib gpib dll ByVal boardID ByVal address ibsta iberr ibcntl amp National Instruments Corp 2 33 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 PassControl PassControl Continued Input boardID The interface board number address Address of the device to which you want to pass control Description PassControl sends the Take
16. The response byte Is stored in result Possible Errors EABO EARG EBUS ECIC EDVR ENEB EOIP The device times out instead of responding to the serial poll The address parameter is invalid out of range No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress National Instruments Corp 2 45 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 Receive Receive Purpose Read data bytes from a device DOS Format C void Receive int boardID Addr4882 t address void buffer long cnt int termination BASICA QuickBASIC BASIC CALL Receive boardID address buffer terminations Windows Format C void Receive int boardID Addr4882 t address void buffer long cnt int termination Visual Basic CALL Receive boardID address buffer terminations Direct Entry with C DLLReceive int boardID Addr4882 t address void far buffer long cnt int termination int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLReceive Lib gpib dll ByVal boardID ByVal address ByVal bufferS ByVal cnt amp ByVal termination ibsta iberr ibcntl amp NI 488 2 FRM for DOS Windows 2 46 National Instrum
17. They are not used to send instructions to GPIB devices Use ibwrt to send device specific instructions The asynchronous I O calls ibcmda ibrda ibwrta are designed so that applications can perform other non GPIB operations while the I O is in progress Once the asynchronous I O has begun further GPIB calls are strictly limited Any calls that would interfere with the I O in progress are not allowed the driver returns EOIP in this case Once the I O is complete the application must resynchronize with the NI 488 2 driver Resynchronization is accomplished by using one of the following three functions ibwait If the returned ibsta mask has the CMPL bit set the driver and application are resynchronized ibstop The I O is canceled the driver and application are resynchronized ibonl The I O is canceled and the interface is reset the driver and application are resynchronized NI 488 2 FRM for DOS Windows 1 26 National Instruments Corp Chapter 1 IBCMDA NI 488 Functions Board Level IBCMDA Continued Possible Errors EARG ECIC EDVR ENEB ENOL EOIP ud is valid but does not refer to an interface board The interface board is not Controller In Charge Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured No Listeners are on the GPIB Asynchronous I O is in progress National Instruments Corp 1 27 NI 488 2 FRM for
18. iberr ibcntl amp As Integer National Instruments Corp 1 71 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBPPC Board Level IBPPC Device Level Continued Input ud Board or device descriptor v Parallel poll enable disable value Output Function Return Description Device Level The value of ibsta If ud is a device descriptor ibppc enables or disables the device from responding to parallel polls The device is addressed and sent the appropriate parallel poll message Parallel Poll Enable PPE or Disable PPD Valid parallel poll messages are 96 to 126 hex 60 to hex 7E or zero to send PPD Board Level If ud is a board descriptor ibppc performs a local parallel poll configuration using the parallel poll configuration value v Valid parallel poll messages are 96 to 126 hex 60 to hex 7E or zero to send PPD If no error occurs during the call then iberr contains the previous value of the local parallel poll configuration For more information on parallel polling refer to the NI 488 2 user manual NI 488 2 FRM for DOS Windows 1 72 National Instruments Corp Chapter 1 IBPPC NI 488 Functions Board Level IBPPC Device Level Continued Possible Errors EARG EBUS ECAP ECIC EDVR ENEB EOIP v does not contain a valid PPE or PPD message Device level No devices are connected to the GPIB Board level The board is not configured to perform local parallel poll configuration
19. ibsre function 1 103 to 1 104 Remote With Lockout State See SetRWLS routine ResetSys routine 2 51 to 2 52 RQS status word condition B 3 S secondary address functions routines ibsad 1 99 to 1 100 secondary address functions routines GotoMultAddr routine 2 24 to 2 32 Send routine 2 53 to 2 54 SendCmds routine 2 56 to 2 57 SendDataBytes routine 2 58 to 2 60 SendIFC routine 2 61 to 2 62 SendList routine 2 63 to 2 65 SendLLO routine 2 66 to 2 67 SendSetup routine 2 68 to 2 69 serial poll functions routines AllSpoll 2 5 to 2 6 ibrsp 1 94 to 1 96 ibrsv 1 97 to 1 98 ReadStatusByte routine 2 44 to 2 45 service request functions routines GenerateREQF routine 2 20 to 2 21 GenerateREQT routine 2 22 to 2 23 TestSRQ routine 2 72 to 2 73 SetRWLS routine 2 70 to 2 71 NI 488 2 FRM for DOS Windows Index 8 National Instruments Corp software configuration parameters changing See ibconfig function returning See ibask function SPOLL status word condition B 3 SRQ functions routines ibsrq 1 105 WaitSRQ routine 2 81 to 2 82 SRQI status word condition B 2 status word conditions ATN B 4 CIC B 4 CMPL B 3 DCAS B 5 DTAS B 5 END B 2 ERR B 2 EVENT B 3 LACS B 5 LOK B 4 REM B 4 RQS B 3 SPOLL B 3 SRQI B 2 TACS B 4 TIMO B 2 Index System controller functions routines See Controller functions routines T TACS status word condition B 4 Talker Listener functions routines
20. v or status ilrsv ud v BASICA CALL ibrsv ud v Windows Format C int ibrsv int ud int v Visual Basic CALL ibrsv ud v or status ilrsv ud v Direct Entry with C DLLibrsv int ud int v int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Function DLLibrsv Lib gpib dll ByVal ud ByVal v ibsta iberr ibcntl amp As Integer National Instruments Corp 1 97 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBRSV Board Level IBRSV Continued Input ud Board descriptor v Serial poll status byte Output Function Return Description The value of ibsta ibrsv requests service from the Controller and provides the Controller with an application dependent status byte when the Controller serial polls the GPIB board The value v is the status byte that the GPIB board returns when serial polled by the Controller In Charge If bit 6 hex 40 is set in v the GPIB board requests service from the Controller by asserting the GPIB SRQ line When ibrsv is called and an error does not occur the previous status byte is returned in iberr Possible Errors EARG EDVR ENEB EOIP ud is a valid descriptor but does not refer to a board Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 98 National Instr
21. 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBEOT Board Level IBEOT Device Level Purpose Enable or disable the automatic assertion of the GPIB EOI line at the end of write I O operations DOS Format C int ibeot int ud int v QuickBASIC BASIC CALL ibeot ud v or BASICA CALL ibeot ud v Windows Format C int ibeot int ud int v Visual Basic CALL ibeot ud v or Direct Entry with C ileot ud v oe ileot ud v DLLibeot int ud int v int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibeot Lib ByVal ud ByVal v NI 488 2 FRM for DOS Windows gpib dll iberr ibcntl amp As Integer National Instruments Corp Chapter 1 NI 488 Functions IBEOT Board Level IBEOT Device Level Continued Input ud A board or device descriptor v Enables or disables the end of transmission assertion of EOI Output Function Return Description The value of ibsta ibeot enables or disables the assertion of the EOI line at the end of write I O operations such as ibwrt for the board or device described by ud If v is non zero then EOI is asserted when the last byte of a GPIB write is sent If v is zero then nothing occurs when the last byte is sent If no error occurs during the call then the previous value of EOT is returned in iberr For more information on the termination of I O operations refer to the NI 488
22. 2 Routines Chapter 2 GotoMultAddr GotoMultAddr Continued The following program is an example of how to simulate multiple GPIB addresses The program waits in a loop until one of its simulated addresses is present on the bus It then reads data or writes data for the simulated device If you press any key the program terminates x short cdecl main void short testing short SimulatedAddress addressed FALSI testing TRUE Tu Enable multiple primary GPIB addresses for interface board 0 Pass the address of the address selection function addrfunc and the serial poll response function spollfunc a ox GotoMultAddr 0 MultAddrPrimary addrfunc spollfunc if ibsta amp ERR printf Error calling GotoMultAddr n iboni 0 0 exit 1 This is the main loop Stay here until any key is pressed on the keyboard while testing printf NnWaiting to be addressed n E Check for any key to be pressed TEM addressed FALSE if bios keybrd KEYBRD READY testing FALSE break NI 488 2 FRM for DOS Windows 2 30 National Instruments Corp Chapter 2 NI 466 2 Routines GotoMultAddr GotoMultAddr Continued addres Simula As pro y if te if sed FALSE tedAddress address long as you did not press a key to exit the
23. 81 Appendix A Multiline Interface Messages sss A 1 Appendix B Status Word Conditions see B 1 Appendix C Error Codes and Solutions ee C 1 Appendix D Customer Communication sse D 1 GIOSSaEY ote xe bo tede bet imt anth bebes eit Glossary 1 Index dece el kB AR Msi EUER E LU Index 1 Tables Table 1 1 List of NI 488 Device Level Functions eeeeeenee 1 3 Table 1 2 List of NI 488 Board Level Functions eene 1 5 Table 1 3 ibask Board Configuration Parameter Options sese 1 10 Table 1 4 ibask Device Configuration Parameter Options sss 1 15 Table 1 5 ibconfig Board Configuration Parameter Options sss 1 31 Table 1 6 ibconfig Device Configuration Parameter Options 1 35 Table 1 7 EOS Configurations eese nter nenne enne nenne 1 44 Table 1 8 Timeout Code Values esee nene enne 1 110 Table 1 9 Wait Mask Lay Outs eet pese eet E ERE EE Ets 1 118 Table 2 1 List of NI 488 2 Routines essent 2 3 National Instruments Corp vii NI 488 2 FRM for DOS Windows Contents Table B 1 Status Word Bits cccccccccececcscscscsececccccccccececesesesessesessssesescscessessseceseeess B 1 Table C 1 GPIB Error Codes eeeeeeeeee eene nennen enhn nares erret C 1 NI 488 2 FRM for
24. All calls are recorded but no trapping occurs 3 Turn recording and trapping on All calls are recorded and the monitor is displayed whenever a trap condition occurs Refer to Chapter 6 appmon GPIB Applications Monitor in the NI 488 2 User Manual for DOS for more information about appmon Possible Errors EARG mode is an invalid value ECAP The GPIB Applications Monitor is not installed NI 488 2 FRM for DOS Windows 1 112 National Instruments Corp Chapter 1 NI 488 Functions IBTRG Device Level IBTRG Purpose Trigger selected device DOS Format C int ibtrg int ud QuickBASIC BASIC CALL ibtrg ud or status iltrg ud BASICA CALL ibtrg ud Windows Format C int ibtrg int ud Visual Basic oe CALL ibtrg ud or status iltrg ud Direct Entry with C DLLibtrg int ud int _far ibsta int _far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibtrg Lib gpib dll ByVal ud ibsta iberr ibcntl amp As Integer Input ud Device descriptor National Instruments Corp 1 113 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBTRG Device Level IBTRG Continued Output Function Return Description The value of ibsta ibtrg sends the Group Execute Trigger GET message to the device described by ua Possible Errors EARG EBUS ECIC EDVR ENEB EOIP ud is a valid descriptor but does not refer to a device No
25. An invalid address out of range appears in addrlist ibcnt1 is the index of the invalid address in the addrlist array No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 10 National Instruments Corp Chapter 2 NI 488 2 Routines EnableLocal EnableLocal Purpose Enable operations from the front panel of devices leave remote programming mode DOS Format C void EnableLocal int boardID Addr4882 t addrlist QuickBASIC BASI C CALL EnableLocal boardID addrlist BASICA CALL EnableLocal boardID addrlist 0 Windows Format C void EnableLocal int boardID Addr4882 t addrlist Visual Basic CALL EnableLocal boardID addrlist Direct Entry with C DLLEnableLocal int boardID Addr4882 t far addrlist int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLI EnableLocal Lib gpib dll ByVal boardID addrlist ibsta iberr ibontl amp National Instruments Corp 2 11 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 EnableLocal EnableLocal Continued Input boardID The interface board number addrlist A list of d
26. C int ibrdf int ud char flname QuickBASIC BASIC CALL ibrdf ud flname or status ilrdf ud flname BASICA CALL ibrdf ud flname Windows Format C int ibrdf int ud char flname Visual Basic CALL ibrdf ud flname Or status ilrdf ud flname Direct Entry with C DLLibrdf int ud char _far flname short _far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibrdf Lib gpib dll ByVal ud ByVal flname ibsta iberr ibcntl amp As Integer NI 488 2 FRM for DOS Windows 1 80 National Instruments Corp Chapter 1 NI 488 Functions IBRDF Board Level IBRDF Device Level Continued Input ud Board or device descriptor flname Name of file into which data is read Output Function Return The value of ibsta Description Device Level If ud is a device descriptor ibrdf addresses the GPIB reads data from a GPIB device and places the data into the file specified by 1name The operation terminates normally when END is received The operation terminates with an error if the transfer could not complete within the timeout period The actual number of bytes transferred is returned in the global variable ibcnt1 Board Level If ud is a board descriptor ibrdf reads data from a GPIB device and places the data into the file specified by 1name A board level ibrdf assumes that the GPIB is already properly addressed The operation terminates
27. DOS Windows NI 488 Functions Chapter 1 IBCONFIG Board Level IBCONFIG Device Level Purpose Change the software configuration parameters DOS Format C ibconfig int ud int option int value QuickBASIC BASIC CALL ibconfig ud option value arent ilconfig ud option value BASICA CALL ibconfig ud option values Windows Format C ibconfig int ud int option int value Visual Basic CALL ibconfig ud option value Or status ilconfig ud option value Direct Entry with C DLLibconfig int ud int option int value int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibconfig Lib gpib dll ByVal ud ByVal option ByVal value ibsta iberr ibcntl amp As Integer NI 488 2 FRM for DOS Windows 1 28 National Instruments Corp Chapter 1 NI 488 Functions IB CONFIG Board Level IB CONFIG Device Level Continued Input ud Board or device unit descriptor option A parameter that selects the software configuration item value The value to which the selected configuration item is to be changed Output Function Return The value of ibsta Description ibconfig changes the configuration item to the specified value for the selected board or device option may be any of the defined constants in Table 1 5 and value must be valid for the parameter that you are configuring The previous setting of the configured item
28. DOS Windows viii National Instruments Corp About This Manual This manual describes the NI 488 functions and the NI 488 2 routines that comprise the NI 488 2 software package for DOS Windows The NI 488 2 software package is meant to be used with Microsoft DOS version 3 0 or higher or with Microsoft Windows version 3 0 or higher This manual assumes that you are already familiar with the DOS or Windows operating system For LabWindows CVI users this manual serves as a function reference for the GPIB and GPIB 488 2 libraries which share the same C syntax as the NI 488 2 routines and NI 488 functions How to Use This Manual Set Getting Started Manual Installation and Configuration Experienced Users Novice Users fuc NI 488 2 User NI 488 2 Function Manual Reference Manual gt Application Function Development and Routine and Examples Descriptions Use the getting started manual to install and configure your GPIB hardware and NI 488 2 software for DOS or Windows Use the NI 488 2 User Manual for DOS or NI 488 2 User Manual for Windows to learn the basics of GPIB and how to develop an application program The user manual also contains debugging information and detailed examples National Instruments Corp ix NI 488 2 FRM for DOS Windows About This Manual Use the NI 488 2 Function Reference Manual for DOS Windows for specific NI 4
29. Direct Entry with C DLLTrigger int boardID Addr4882 t address int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLTrigger Lib gpib dll ByVal boardID ByVal address ibsta iberr ibcntl amp National Instruments Corp 2 77 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 Trigger Trigger Continued Input boardID The interface board number address Address of a device to be triggered Description Trigger sends the Group Execute Trigger GET GPIB message to the device described by address If address is the constant NOADDR the Group Execute Trigger message is sent to all devices that are currently listen active on the GPIB Possible Errors EARG EBUS ECIC EDVR ENEB EOIP The address parameter is invalid out of range No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 76 National Instruments Corp Chapter 2 NI 488 2 Routines TriggerList TriggerList Purpose Trigger multiple devices DOS Format C void TriggerList int boardID Addr4882 t addrlist QuickBASIC BASIC CALL TriggerList boardID addrlist BASICA CALL TriggerList boardID addrlist 0
30. EARG EBUS ECIC EDVR ENEB EOIP The address parameter is invalid out of range or NOADDR No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 50 National Instruments Corp Chapter 2 NI 488 2 Routines ResetSys ResetSys Purpose Reset and initialize IEEE 488 2 compliant devices DOS Format C void ResetSys int boardID Addr4882 t addrlist QuickBASIC BASIC CALL ResetSys boardID addrlist BASICA CALL ResetSys boardID addrlist 0 Windows Format C void ResetSys int boardID Addr4882 t addrlist Visual Basic CALL ResetSys boardID addrlist Direct Entry with C DLLResetSys int boardID Addr4882 t far addrlist int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLResetSys Lib gpib dll ByVal boardID addrlist ibsta iberr ibcntl amp National Instruments Corp 2 51 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 ResetSys ResetSys Continued Input boardID The interface board number addrlist A list of device addresses that is terminated by NOADDR Description The reset and initialization take place in three steps The first
31. I O has begun further GPIB calls are strictly limited Any calls that would interfere with the I O in progress are not allowed the driver returns EOIP in this case Once the I O is complete the application must resynchronize with the NI 488 2 driver Resynchronization is accomplished by using one of the following three functions ibwait If the returned ibsta mask has the CMPL bit set then the driver and application are resynchronized ibstop The I O is canceled the driver and application are resynchronized e ibonl The I O is canceled and the interface is reset the driver and application are resynchronized Note The cnt parameter specifies the number of bytes to transfer For example if you want to transfer 16 integers the number of bytes is 16 2 32 National Instruments Corp 1 133 NI 488 2 FRM for DOS Windows NI 488 Functions IBWRTIA Chapter 1 Board Level IBWRTIA Device Level Continued Possible Errors EABO EADR EBUS ECIC EDVR ENEB ENOL EOIP Board level a Device Clear message was received from the CIC Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad Device level No devices are connected to the GPIB Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 4
32. NI 488 Functions Chapter 1 IBPCT Device Level IBPCT Continued Input ud Device descriptor Output Function Return Description The value of ibsta ibpct passes Controller in Charge status to the device indicated by ud The access board automatically unasserts the ATN line and goes to Controller Idle State This function assumes that the device has Controller capability Possible Errors EARG EBUS ECIC EDVR ENEB EOIP ud is valid but does not refer to a device No devices are connected to the GPIB The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 70 National Instruments Corp Chapter 1 NI 488 Functions IBPPC Board Level IBPPC Device Level Purpose Parallel poll configure DOS Format C int ibppc int ud int v QuickBASIC BASIC CALL ibppc ud v Or status ilppc ud v BASICA CALL ibppc ud v Windows Format C int ibppc int ud int v Visual Basic oe CALL ibppc ud v Or status ilppc ud v Direct Entry with C DLLibppe int ud int v int _far ibsta int _far iberr long _far ibocntl Direct Entry with Visual Basic Declare Function DLLibppc Lib gpib dll ByVal ud ByVal v ibsta
33. and Unlisten UNL are not sent after each device level read and write operation non zero The UNT and UNL commands are sent after each device level read and write operation IbaBNA 0x0200 The index of the GPIB access board used by the given device descriptor NI 488 2 FRM for DOS Windows 1 16 National Instruments Corp Chapter 1 NI 488 Functions IBBNA Device Level IBBNA Purpose Change the access board of a device DOS Format C int ibbna int ud char bname QuickBASIC BASIC CALL ibbna ud bname or status ilbna ud bname BASICA CALL ibbna ud bname Windows Format C int ibbna int ud char bname Visual Basic CALL ibbna ud bname or status ilbna ud bname Direct Entry with C DLLibbna int ud char _far bname int _far ibsta int _far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibbna Lib gpib dll ByVal ud ByVal bname ibsta iberr ibcntl amp As Integer National Instruments Corp 1 17 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBBNA Device Level IBBNA Continued Input ud A device unit descriptor bname An access board name for example gpibO0 Output Function Return Description The value of ibsta ibbna assigns the device described by ud to the access board described by bname All subsequent bus activity with device ud occurs through the access board bname If the call succeeds iberr c
34. byte is returned in spr If bit 6 hex 40 of the response byte is set the device is requesting service If the automatic serial polling feature is enabled the device might have already been polled In this case ibrsp returns the previously acquired status byte For more information on serial polling refer to the NI 488 2 user manual National Instruments Corp 1 95 NI 488 2 FRM for DOS Windows NI 488 Functions IBRSP Chapter 1 Device Level IBRSP Continued Possible Errors EABO EARG EBUS ECIC EDVR ENEB EOIP ESTB The serial poll response could not be read within the serial poll timeout period ud is a valid descriptor but does not refer to a device No devices are connected to the GPIB The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress Autopolling is enabled and the serial poll queue has overflowed Disable automatic serial polling or call ibrsp more often to keep the queue from overflowing NI 488 2 FRM for DOS Windows 1 96 National Instruments Corp Chapter 1 NI 488 Functions IBRSV Board Level IBRSV Purpose Request service and change the serial poll status byte DOS Format C int ibrsv int ud int v QuickBASIC BASIC CALL ibrsv ud
35. cmdbuf cnt Direct Entry with C DLLibcmd int ud void _far cmdbuf long cnt int _far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibcmd Lib gpib dll ByVal ud ByVal cmdbuf ByVal cnt amp ibsta iberr ibcntl amp As Integer National Instruments Corp 1 23 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IB CMD Board Level IB CMD Continued Input ud A board unit descriptor cmdbuf Buffer of command bytes to send cnt Number of command bytes to send Output Function Return The value of ibsta Description ibcmd sends cnt bytes from cmdbuf over the GPIB as command bytes interface messages The number of command bytes transferred is returned in the global variable ibcntl Refer to Appendix A Multiline Interface Messages for a table of the defined interface messages Command bytes are used to configure the state of the GPIB They are not used to send instructions to GPIB devices Use ibwrt to send device specific instructions Possible Errors EABO The timeout period expired before all of the command bytes were sent EARG ud is valid but does not refer to an interface board ECIC The interface board is not Controller In Charge EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured ENOL No Listeners are on the GPIB EOIP Asynchronous I O is in prog
36. devices are connected to the GPIB The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 114 National Instruments Corp Chapter 1 NI 488 Functions IBWAIT Board Level IBWAIT Device Level Purpose Wait for GPIB events DOS Format C int ibwait int ud int mask QuickBASIC BASIC CALL ibwait ud mask or status ilwait ud mask BASICA CALL ibwait ud mask Windows Format C int ibwait int ud int mask Visual Basic CALL ibwait ud mask or status ilwait ud mask Direct Entry with C DLLibwait int ud int mask int _far ibsta int _far iberr long far ibocntl Direct Entry with Visual Basic Declare Function DLLibwait Lib gpib dll ByVal ud ByVal mask ibsta iberr ibcntl As Integer National Instruments Corp 1 115 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBWAIT Board Level IBWAIT Device Level Continued Input ud Board or device descriptor mask Bit mask of GPIB events to wait on Output Function Return Description The value of ibsta ibwait monitors the events specified by mask and delays processing until one or more of the events occurs If the wait mask is zero ibwait retur
37. ibevent function to determine which event occurred CMPL dev brd CMPL indicates the condition of I O operations It is set whenever an I O operation is complete CMPL is cleared while an I O operation is in progress National Instruments Corp B 3 NI 488 2 FRM for DOS Windows Status Word Conditions Appendix B LOK brd LOK indicates whether the board is in a lockout state While LOK is set the EnableLocal routine or ibloc function is inoperative for that board LOK is set whenever the GPIB board detects that the Local Lockout LLO message has been sent either by the GPIB board or by another Controller LOK is cleared when the System Controller unasserts the Remote Enable REN GPIB line REM brd REM indicates whether or not the board is in the remote state REM is set whenever the Remote Enable REN GPIB line is asserted and the GPIB board detects that its listen address has been sent either by the GPIB board or by another Controller REM is cleared in the following situations When REN becomes unasserted When the GPIB board as a Listener detects that the Go to Local GTL command has been sent either by the GPIB board or by another Controller When the ibloc function is called while the LOK bit is cleared in the status word CIC brd CIC indicates whether the GPIB board is the Controller In Charge CIC is set when the SendIFC routine or ibsic function is executed while the GPIB board is System Controll
38. ibppc ibrd ibrda ibrdf ibrdi ibrdia ibrpp ibdma Enable or disable DMA Configure the end of string EOS termination mode or character the end of write I O operations continues National Instruments Corp 1 5 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 Table 1 2 List of NI 488 Board Level Functions Continued ibwrtf ibwrtia NI 488 2 FRM for DOS Windows ibwrti Write data to a device from a file Write data to a device from a user integer buffer Write data asynchronously to a device from a user integer buffer National Instruments Corp Chapter 1 NI 488 Functions IBASK Board Level IBASK Device Level Purpose Return information about software configuration parameters DOS Format C int ibask int ud int option int value QuickBASIC BASIC CALL ibask ud option value or status ilask ud option value BASICA CALL ibask ud option value Windows Format C int ibask int ud int option int value Visual Basic CALL ibask ud option value Or status ilask ud option value Direct Entry with C DLLibask int ud int option int value int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibask Lib gpib dll byVal ud ByVal option value ibsta iberr ibcntl As Integer National Instruments Corp 1 7 NI 488 2 FRM for DOS Windows NI 488 Fun
39. in the queue 1 A Device Trigger message was received 2 A Device Clear message was received 3 Interface Clear was received Note The GPIB board must not be configured as System Controller to detect interface clear Use ibconfig option IbcSC to disable System Controller capability When this function returns ibcnt1 contains the number of events that remain in the event queue To enable the event queue use the ibconfig function option IbcEventQueue National Instruments Corp 1 49 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBEVENT Board Level IBEVENT Continued Possible Errors EARG ud is a valid descriptor but does not refer to a board ECAP The interface board is not configured to use the event queue See ibconfig option IbcEventQueue EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress ETAB The event queue has overflowed and events have been discarded NI 488 2 FRM for DOS Windows 1 50 National Instruments Corp Chapter 1 NI 488 Functions IBFIND Board Level IBFIND Device Level Purpose Open and initialize a GPIB board or a user configured device DOS Format C int ibfind char udname QuickBASIC BASIC CALL ibfind udname ud or ud ilfind udname BASICA CALL ibfind udname ud Windows Format C int ibfin
40. int ud int _far ibsta int _far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibclr Lib gpib dll ByVal ud ibsta iberr ibcntl amp As Integer National Instruments Corp 1 21 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBCLR Device Level IBCLR Continued Input ud A device unit descriptor Output Function Return Description The value of ibsta ibclr sends the GPIB Selected Device Clear SDC message to the device described by ud Possible Errors EARG EBUS ECIC EDVR ENEB EOIP ud is a valid descriptor but does not refer to a device There are no devices connected to the GPIB The access board is not CIC See the Device Level Calls and Bus Management section in Chapter 7 of the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 22 National Instruments Corp Chapter 1 NI 488 Functions IB CMD Board Level IB CMD Purpose Send GPIB commands DOS Format C int ibcmd int ud void cmdbuf long cnt QuickBASIC BASIC CALL ibcmd ud cmdbuf or status ilcmd ud cmdbuf cnt amp BASICA CALL ibcmd ud cmdbuf Windows Format C int ibcmd int ud void cmdbuf long cnt Visual Basic CALL ibcmd ud cmdbuf or status ilcmd ud
41. invalid address parameter e PPollConfig called with an invalid data line or sense bit Solutions Make sure that the parameters passed to the NI 488 function or NI 488 2 routine are valid e Do not use a device descriptor in a board function or vice versa ESAC 5 ESAC results when ibsic ibsre SendIFC or EnableRemote is called when the GPIB board does not have System Controller capability Solutions Give the GPIB board System Controller capability by calling ibrsc 1 You can also configure that capability into the software using ibconf in DOS or the GPIB software configuration utility in Windows EABO 6 EABO indicates that an I O operation has been canceled usually due to a timeout condition Other causes for this error are calling ibstop or receiving the Device Clear message from the CIC while performing an I O operation Frequently the I O is not progressing the Listener is not continuing to handshake or the Talker has stopped talking or the byte count in the call which timed out was more than the other device was expecting Solutions Use the correct byte count in input functions or have the Talker use the END message to signify the end of the transfer Lengthen the timeout period for the I O operation using ibtmo Make sure that you have configured your device to send data before you request data National Instruments Corp C 5 NI 488 2 FRM for DOS Windows Error Codes and Solutions Appendix
42. is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress National Instruments Corp 1 89 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBRPP Board Level IBRPP Device Level Purpose Conduct a parallel poll DOS Format C int ibrpp int ud char ppr QuickBASIC BASIC CALL ibrpp ud ppr or status ilrpp ud pprs BASICA CALL ibrpp ud ppr Windows Format C int ibrpp int ud char ppr Visual Basic CALL ibrpp ud ppr or status ilrpp ud pprs Direct Entry with C DLLibrpp int ud int _far iberr Direct Entry with Visual Basic Declare Function DLLibrpp Lib ByVal ud ppr Input ud NI 488 2 FRM for DOS Windows 1 90 char far ppr long _ int far ibsta far ibcntl gpib dll ibsta iberr ibcntl amp As Integer Board or device descriptor National Instruments Corp Chapter 1 NI 488 Functions IBRPP Board Level IBRPP Device Level Continued Output ppr Function Return Description Parallel poll response byte The value of ibsta ibrpp parallel polls all the devices on the GPIB The result of this poll is returned in ppr For more information on parallel polling refer to the NI 488 2 user manual Possible Errors EBUS ECIC EDVR ENEB EOIP Device level No devices are connected to the GPIB Device level The access board is
43. is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual EDVR Either udname is not recognized as a board or device name or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured NI 488 2 FRM for DOS Windows 1 52 National Instruments Corp Chapter 1 NI 488 Functions IBGTS Board Level IBGTS Purpose Go from Active Controller to Standby DOS Format C int ibgts int ud int v QuickBASIC BASIC CALL ibgts ud v Or status ilgts ud v BASICA CALL ibgts ud v Windows Format C int ibgts int ud int v Visual Basic CALL ibgts ud v Or status ilgts ud v Direct Entry with C DLLibgts int ud int v int far ibsta int far iberr long far ibcnt Direct Entry with Visual Basic 1 Declare Function DLLibgts Lib gpib dll ByVal ud ByVal v ibsta iberr ibcntl amp As Integer National Instruments Corp 1 53 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBGTS Board Level IBGTS Continued Input ud Board descriptor v Determines whether to perform acceptor handshaking Output Function Return The value of ibsta Description ibgts causes the board ud to go to Standby Controller and the GPIB ATN line to be unasserted If v is non zero acceptor handshaking or shadow handshaking is performed until END occurs or until ATN is reasserted by a subsequent ibcac call
44. is not properly configured Asynchronous I O is in progress Board does not have System Controller capability NI 488 2 FRM for DOS Windows 1 102 National Instruments Corp Chapter 1 NI 488 Functions IBSRE Board Level IBSRE Purpose Set or clear the Remote Enable line DOS Format C int ibsre int ud int v QuickBASIC BASIC CALL ibsre ud v or status BASICA CALL ibsre ud v Windows Format C int ibsre int ud int v Visual Basic CALL ibsre ud v or status Direct Entry with C oe ilsre ud v DLLibsre int ud int v int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibsre Lib gpib dll ByVal ud ByVal v ibsta Integer National Instruments Corp 1 103 iberr S ibcntl amp As NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBSRE Board Level IBSRE Continued Input ud Board descriptor v Indicates whether to set or clear the REN line Output Function Return The value of ibsta Description If v is non zero the GPIB Remote Enable REN line is asserted If v is zero REN is unasserted The previous value of REN is returned in iberr REN is used by devices to choose between local and remote modes of operation A device should not actually enter remote mode until it receives its listen address Possible Errors EARG ud is a valid descriptor but does not refer to a board EDVR E
45. is return in iberr Possible Errors EARG Either option or value is not valid See Table 1 5 ECAP The driver is not able to make the requested change EDVR Either ud is invalid or the NI 488 2 driver is not installed EOIP Asynchronous I O is in progress National Instruments Corp 1 29 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IB CONFIG Board Level IB CONFIG Device Level Continued Table 1 5 lists the options you can use with ibconfig when ud is a board descriptor or a board index If the table does not list the default value for a particular option the default value is determined by either ibconf in DOS or the GPIB software configuration utility in Windows The following is an alphabetical list of the opt ion constants included in Table 1 5 Constants Values Constants Values IbcAUTOPOLL 0x0007 IbcPP2 0x0010 IbcCICPROT 0x0008 bcPPC 0x0005 IbcDMA 0x0012 IbcPPollTime 0x0019 IbcEndBitIsNormal 0x001A IbcReadAdjust 0x0013 IbcEOSchar 0x000F IbcRsv 0x0021 IbcEOScmp Ox000E e IbcSAD 0x0002 bcEOSrd 0x000C IbcSC 0x000A IbcEOSwrt 0x000D bcSendLLO 0x0017 bcEOT 0x0004 bcSpollBit 0x0016 IbcEventQueue 0x0015 IbcSRE Ox000B bcHSCableLength 0x001F bc TIMING 0x0011 IbcIRQ 0x0009 e IbcTMO 0x0003 e bcIst 0x0020 e bcWriteAdjust 0x0014 bcPAD 0x0001 NI 488 2 FRM for DOS Windows 1 30 National Instruments Corp Chapter 1 NI 488 Functions IB CONFIG Board Level IB
46. not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 46 National Instruments Corp Chapter 2 NI 488 2 Routines ReceiveSetup ReceiveSetup Purpose Address a device to be a Talker and the interface board to be a Listener in preparation for RcvRespMsg DOS Format C void ReceiveSetup int boardID Addr4882 t address BASICA QuickBASIC BASIC CALL ReceiveSetup boardID address Windows Format C void ReceiveSetup int boardID Addr4882 t address Visual Basic CALL ReceiveSetup boardID address Direct Entry with C DLLReceiveSetup int boardID Addr4882 t address int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLReceiveSetup Lib gpib dll ByVal boardID ByVal address ibsta iberr ibcntl amp National Instruments Corp 2 49 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 ReceiveSetup ReceiveSetup Continued Input boardID The interface board number address Address of a device to be talk addressed Description ReceiveSetup makes the device described by address talker active and makes the interface board listen active This call is usually followed by a call to RcvRespMsg to transfer data from the device to the interface board This routine is particularly useful to make multiple calls to RcvRspMsq it eliminates the need to readdress the device to receive every block of data Possible Errors
47. see ibconfig option IbcPP2 Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress National Instruments Corp 1 73 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBRD Board Level IBRD Device Level Purpose Read data from a device into a user buffer DOS Format C int ibrd int ud void rdbuf long cnt QuickBASIC BASIC CALL ibrd ud rdbuf or status ilrd ud rdbuf cnt amp BASICA CALL ibrd ud rdbuf Windows Format C int ibrd int ud void rdbuf long cnt Visual Basic CALL ibrd ud rdbuf or status ilrd ud rdbuf cnt amp Direct Entry with C DLLibrd int ud void _far rdbuf long cnt int _far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibrd Lib gpib dll ByVal ud ByVal rdbuf ByVal cnt amp ibsta iberr ibcntl amp As Integer NI 488 2 FRM for DOS Windows 1 74 National Instruments Corp Chapter 1 NI 488 Functions IBRD Board Level IBRD Device Level Continued Input ud Board or device descriptor ent Number of bytes to be read from the GPIB Output rdbuf Address of buffer into which data is read Function Return The value of ibsta Des
48. serial poll responses are not stored in the response queue unless they have bit 6 set An automatic serial poll occurs either as a result of a call to ibwait or automatically if automatic serial polling is enabled If the serial poll response queue is not empty ibrsp returns the oldest byte stored in the queue To empty the response queue call ibrsp repeatedly until RQS is no longer set in the device s status word SPOLL brd Use SPOLL in Talker Listener applications applications in which the GPIB interface is not the Controller to determine when the Controller has serial polled the GPIB board The SPOLL bit is disabled by default Use the ibconfig function option IbcSPollBit to enable it When the SPOLL bit is enabled it is set after the board has been serial polled SPOLL is cleared on any call immediately after an ibwait call if the SPOLL bit was set in the wait mask or immediately following a call to ibrsv EVENT brd Use EVENT in Talker Listener applications to monitor the order of GPIB device clear group execute trigger and send interface clear commands The usual DCAS and DTAS bits of ibsta might be insufficient The EVENT bit is disabled by default If you want to use this bit you must use the ibconfig function option IbcEvent Queue to enable it When you enable this bit the DCAS and DTAS bits are disabled When an event occurs the EVENT bit is set and any I O in progress is aborted The application can then call the
49. step resets the GPIB by asserting the Remote Enable REN line and then the Interface Clear IFC line The second step clears all of the devices by sending the Universal Device Clear DCL GPIB message The final step causes IEEE 488 2 compliant devices to perform device specific reset and initialization This step is accomplished by sending the message RST n to the devices described by addrlist Possible Errors EABO EARG EBUS ECIC EDVR ENEB ENOL EOIP ESAC I O operation is aborted An invalid address out of range appears in addrlist ibcntlis the index of the invalid address in the addrlist array or the addrlist is empty No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured No Listeners are on the GPIB Asynchronous I O is in progress Board is not System Controller NI 488 2 FRM for DOS Windows 2 52 National Instruments Corp Chapter 2 NI 488 2 Routines Send Send Purpose Send data bytes to a device DOS Format C void Send int boardID Addr4882 t address void buffer long datacnt int eotmode BASICA QuickBASIC BASIC CALL Send boardID address buffer eotmodes Windows Format C void Send int boardID Addr4882 t address void buffer long datacnt int eotm
50. you are using device level calls call ibpad and ibsad if necessary to match the configured address to the device switch settings Reduce the write byte count to that which is expected by the Controller EADR 3 EADR occurs when the GPIB board is CIC and is not properly addressing itself before read and write functions This error is usually associated with board level functions EADR is also returned by the function ibgt s when the shadow handshake feature is requested and the GPIB ATN line is already unasserted In this case the shadow handshake is not possible and the error is returned to notify you of that fact Solutions Make sure that the GPIB board is addressed correctly before calling NI 488 board level ibrd or ibwrt and NI 488 2 routines RcvRespMsg or SendDataBytes e Avoid calling ibgts except immediately after an ibcmd call ibcmd causes ATN to be asserted EARG 4 EARG results when an invalid argument is passed to a function call The following are some examples ibtmo called with a value not in the range 0 through 17 ibpador ibsad called with primary or secondary addresses ibppc called with invalid parallel poll configurations NI 488 2 FRM for DOS Windows C 4 National Instruments Corp Appendix C Error Codes and Solutions A board level NI 488 call made with a valid device descriptor or a device level NI 488 call made with a valid board descriptor An NI 488 2 routine called with an
51. 000E 0x000C 0x000D 0x0004 0x0015 0x001F 0x0009 0x0020 0x0001 1 9 Constants IbaPP2 IbaPPC IbaPPollTime IbaReadAdjust IbaRsv IbaSAD IbaSC IbaSendLLO IbaSpollBit IbaSRE IbaTIMING IbaTMO IbaWriteAdjust Values 0x0010 0x0005 0x0019 0x0013 0x0021 0x0002 0x000A 0x0017 0x0016 0x000B 0x0011 0x0003 0x0014 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBASK Board Level IBASK Device Level Continued Table 1 3 ibask Board Configuration Parameter Options em EDO I Constants Values Returned Information IbaPAD 0x0001 The current primary address of the board MN MN IbaSAD 0x0002 The current secondary address of the board pe ceu e IbaTMO 0x0003 The current I O timeout of the board Ee lcm eee IbaEOT 0x0004 zero The GPIB EOI line is not asserted at the end of a write operation non zero EOI is asserted at the end of a write See ibeot IbaPPC 0x0005 The current parallel poll configuration information of the board See ibppc IbaAUTOPOLL 0x0007 zero Automatic serial polling is disabled non zero Automatic serial polling is enabled Refer to the NI 488 2 user manual for more information about automatic serial polling IbaCICPROT 0x0008 zero The CIC protocol is disabled non zero The CIC protocol is enabled Refer to the NI 488 2 user manual for more information about device level calls and bus management IbaIRQ 0x0009 zero Interrupts are not enabled non zer
52. 016 IbcSendLLO 0x0017 IbcPPollTime 0x0019 National Instruments Corp 0 No byte swapping 1 Swap pairs of bytes during a read Default zero 0 No byte swapping 2 Swap pairs of bytes during a write Default zero zero The event queue is disabled non zero The event queue is enabled Default zero See ibevent zero The SPOLL bit of ibsta is disabled non zero The SPOLL bit of ibsta is enabled Default zero Refer to the NI 488 2 user manual for information about Talker Listener applications zero Do not send LLO when putting a device online ibfindor ibdev non zero Send LLO when putting a device online ibfindor ibdev Default zero 0 Use the standard duration 2 us when conducting a parallel poll 1 to 17 Use a variable length duration when conducting a parallel poll The duration represented by 1 to 17 corresponds to the ibtmo values Default zero continues 1 33 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IB CONFIG Board Level IB CONFIG Device Level Continued Table 1 5 ibconfig Board Configuration Parameter Options Continued Options Options Constants Values Legal Values IbcEndBitIsNormal 0x001A zero Do not set the END bit of ibsta when an EOS match occurs during a read non zero Set the END bit of ibsta when an EOS match occurs during a read Default non zero IbcHSCableLength 0x001F 0 High speed data transfer H
53. 1 36 National Instruments Corp Chapter 1 NI 488 Functions IB CONFIG Board Level IB CONFIG Device Level Continued Table 1 6 ibconfig Device Configuration Parameter Options Continued Options Options Constants Values Legal Values IbcSPollTime 0x0018 0 to 17 Sets the length of time the driver waits for a serial poll response byte when polling the given device The length of time represented by 0 to 17 corresponds to the ibtmo values Default 11 IbcEndBitIsNormal 0x001A zero Do not set the END bit of ibsta when an EOS match occurs during a read non zero Set the END bit of ibsta when an EOS match occurs during a read Default non zero IbcUnAddr OxOO1B zero Do not send Untalk UNT and Unlisten UNL at the end of device level reads and writes non zero Send UNT and UNL at the end of device level reads and writes Default zero National Instruments Corp 1 37 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBDEV Device Level IBDEV Purpose Open and initialize a device descriptor DOS Format C int ibdev int BdIndx int pad int sad int tmo int eot int eos QuickBASIC BASIC CALL ibdev BdIndx pad sad tmo eot eos ud ud zu iiey BdIndx pad sad tmo eot eos BASICA CALL ibdev BdIndx pad sad tmo eot eos ud Windows Format C int ibdev int BdIndx int pad int sad int tmo int eot int eos Visual
54. 1 85 ibrdia function 1 86 to 1 89 ibrpp function 1 90 to 1 91 ibrsc function 1 92 to 1 93 ibrsp function 1 94 to 1 96 ibrsv function 1 97 to 1 98 ibsad function 1 99 to 1 100 ibsic function 1 101 to 1 102 ibsre function 1 103 to 1 104 ibsrq function 1 105 ibsta See status word condition ibstop function 1 106 to 1 107 ibtmo function 1 108 to 1 110 ibtrap function 1 111 to 1 112 ibtrg function 1 113 to 1 114 ibwait function 1 115 to 1 118 ibwrt function 1 119 to 1 121 ibwrta function 1 122 to 1 124 ibwrtf function 1 125 to 1 127 ibwrti function 1 128 to 1 130 ibwrtia function 1 131 to 1 134 individual status bits See ibist function NI 488 2 FRM for DOS Windows Index 4 National Instruments Corp Index interface clear functions routines ibsic function 1 101 to 1 102 SendIFC routine 2 61 to 2 62 interface messages multiline A 1 to A 3 L LACS status word condition B 5 listeners See Talker Listener functions routines Local Lockout message See SendLLO routine local mode functions routines EnableLocal routine 2 11 to 2 12 ibloc function 1 63 to 1 64 LOK status word condition B 4 M manual See documentation multiline interface messages A 1 to A 3 multiple address routine See GotoMultAddr routine N NI 488 functions DOS format 1 1 ibask 1 7 to 1 16 ibbna 1 17 to 1 18 ibcac 1 19 to 1 20 ibclr 1 21 to 1 22 ibcmd 1 23 to 1 24 ibemda 1 25 to 1 27 ibconfig 1 28 to 1 37 ibdev
55. 15 PPE CFG15 50 120 80 P MTA16 70 160 112 p MSAI6 PPD 51 121 81 Q MTAI17 71 161 113 q MSA17 PPD 52 122 82 R MTAI18 72 162 114 r MSA18 PPD 53 123 83 S MTAI19 73 163 115 S MSA19 PPD 54 124 84 T MTA20 74 164 116 t MSA20 PPD 55 125 85 U MTA21 75 165 117 u MSA21 PPD 56 126 86 V MTA22 76 166 118 v MSA22 PPD 57 127 87 W MTA23 TI 167 119 w MSA23 PPD 58 130 88 X MTA24 78 170 120 x MSA24 PPD 59 131 89 Y MTA25 79 171 121 y MSA25 PPD 5A 132 90 Z MTA26 7A 172 122 Z MSA26 PPD 5B 133 91 MTA27 7B 173 123 MSA27 PPD 5C 134 92 MTA28 7C 174 124 MSA28 PPD 5D 135 93 MTA29 7D 175 125 MSA29 PPD SE 136 94 MTA30 TE 176 126 MSA30 PPD 5F 137 95 UNT TF 177 127 DEL PPE Parallel Poll Enable SPE Serial Poll Enable PPU Parallel Poll Unconfigure TCT Take Control SDC Selected Device Clear UNL Unlisten SPD Serial Poll Disable UNT Untalk National Instruments Corp A 3 NI 488 2 FRM for DOS Windows Appendix B Status Word Conditions This appendix gives a detailed description of the conditions reported in the status word ibsta For information about how to use ibsta in your application program refer to Chapter 3 Developing Your Application in the NI 488 2 user manual If a function call returns an ENEB or EDVR error all status word bits except the ERR bit are cleared indicating that it is not possible to obtain the status of the GPIB board Each bit in ibsta can be set for NI 488 device calls dev NI 488 board calls and NI 4
56. 1B 033 27 ESC 3B 073 59 MLA27 1C 034 28 FS 3C 074 60 lt MLA28 1D 035 29 GS 3D 075 61 MLA29 1E 036 30 RS 3E 076 62 gt MLA30 1F 037 31 US CFE 3F 077 63 UNL Message Definitions CFE Configuration Enable MLA My Listen Address CFG Configure MSA My Secondary Address DCL Device Clear MTA My Talk Address GET Group Execute Trigger PPC Parallel Poll Configure GTL Go To Local PPD Parallel Poll Disable LLO Local Lockout TThis multiline interface message is a proposed extension to the IEEE 488 1 specification to support the HS488 high speed protocol NI 488 2 FRM for DOS Windows A 2 National Instruments Corp Appendix A Multiline Interface Messages Multiline Interface Messages Hex Oct Dec ASCII Msg Hex Oct Dec ASCII Msg 40 100 64 MTAO 60 140 96 MSAO PPE 41 101 65 A MTAI 61 141 97 a MSA1 PPE CFG1 42 102 66 B MTA2 62 142 98 b MSA2 PPE CFG2 43 103 67 C MTA3 63 143 99 c MSA3 PPE CFG3 44 104 68 D MTA4 64 144 100 d MSA4 PPE CFG4 45 105 69 E MTA5 65 145 101 e MSAS PPE CFG5 46 106 70 F MTA6 66 146 102 f MSA6 PPE CFG6 47 107 71 G MTA7 67 147 103 g MSA7 PPE CFG7 48 110 72 H MTAS8 68 150 104 h MSA8 PPE CFG8 49 111 73 I MTA9 69 151 105 i MSA9 PPE CFG9 4A 112 74 J MTAIO 6A 152 106 j MSA10 PPE CFG10 4B 113 75 K MTAII 6B 153 107 k MSA11 PPE CFG11 4C 114 76 L MTA12 6C 154 108 1 MSA12 PPE CFG12 4D 115 TI M MTA13 6D 155 109 m MSA13 PPE CFG13 4E 116 78 N MTAI4 6E 156 110 n MSA14 PPE CFG14 4F 117 79 O MTA15 6F 157 111 o MSA
57. 2 user manual Possible Errors EDVR ENEB EOIP Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress National Instruments Corp 1 47 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBEVENT Board Level IBEVENT Purpose Return the oldest recorded event DOS Format C int ibevent int ud short event QuickBASIC BASIC CALL ibevent ud events or status ilevent ud event BASICA CALL ibevent ud events Windows Format C int ibevent int ud short event Visual Basic CALL ibevent ud events or status ilevent ud event Direct Entry with C DLLibevent int ud short _far event int _far ibsta int _far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibevent Lib gpib dll ByVal ud event ibsta iberr ibcntl amp As Integer NI 488 2 FRM for DOS Windows 1 48 National Instruments Corp Chapter 1 NI 488 Functions IBEVENT Board Level IBEVENT Continued Input ud A board descriptor Output event The returned event Function Return Description The value of ibsta ibevent determines which GPIB event Device Clear Device Trigger or Interface Clear occurred Usually you call ibevent when the EVENT bit is set in ibsta The variable event can be one of the following values 0 No events are
58. 88 function and NI 488 2 routine information such as format parameters and possible errors If you ordered a kit from National Instruments that includes the GPIB analyzer software you also received documentation for the GPIB analyzer You can only use the GPIB analyzer in Windows Organization of This Manual This manual is organized as follows Chapter 1 NJ 488 Functions includes a listing of the available NI 488 functions and then describes the purpose format input and output parameters and possible errors for each function Chapter 2 NI 488 2 Routines includes a listing of the available NI 488 2 routines and then describes the purpose format input and output parameters and possible errors for each routine Appendix A Multiline Interface Messages contains a multiline interface message reference list which describes the mnemonics and messages that correspond to the interface functions These multiline interface messages are sent and received with ATN TRUE Appendix B Status Word Conditions gives a detailed description of the conditions reported in the status word ibsta Appendix C Error Codes and Solutions lists a description of each error some conditions under which it might occur and possible solutions Appendix D Customer Communication contains forms you can use to request help from National Instruments or to comment on our products and manuals The Glossary contains an alphabetical list and descriptio
59. 88 2 FRM for DOS Windows 1 100 National Instruments Corp Direct Entry with C DLLibsic int ud Chapter 1 NI 488 Functions IBSIC Board Level IBSIC Purpose Assert interface clear DOS Format C int ibsic int ud QuickBASIC BASIC CALL ibsic ud or status ilsic ud BASICA CALL ibsic ud Windows Format C int ibsic int ud Visual Basic CALL ibsic ud Or status ilsic ud int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibsic Lib gpib dll ibsta iberr ibcntl amp As Integer ByVal ud National Instruments Corp 1 101 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBSIC Board Level IBSIC Continued Input ud Board descriptor Output Function Return Description The value of ibsta ibsic asserts the GPIB interface clear IFC line for at least 100 us if the GPIB board is System Controller This initializes the GPIB and makes the interface board CIC and Active Controller with ATN asserted The IFC signal resets only the GPIB interface functions of bus devices and not the internal device functions Consult your device documentation to determine how to reset the internal functions of your device Possible Errors EARG EDVR ENEB EOIP ESAC ud is a valid descriptor but does not refer to a board Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or
60. 88 2 calls brd or both dev brd The following table lists the status word bits Table B 1 Status Word Bits pa E E e Mnemonic Pos Value Type Description SPOLL 10 400 brd Board has been serial polled by Controller Event o xw wa DCAS DTAS or FC event kas occured Fcwr e m deta wo come T 80 wa Lockout swe Prem e w wo Remes maces 3 s w me poas o 1 wa Device cearsute National Instruments Corp B 1 NI 488 2 FRM for DOS Windows Status Word Conditions Appendix B ERR dev brd ERR is set in the status word following any call that results in an error You can determine the particular error by examining the error variable iberr Appendix C Error Codes and Solutions describes error codes that are recorded in iberr along with possible solutions ERR is cleared following any call that does not result in an error TIMO dev brd TIMO indicates that the timeout period has been exceeded TIMO is set in the status word following an ibwait call if the TIMO bit of the ibwait mask parameter is set and the time limit expires TIMO is also set following any synchronous I O functions for example ibcmd ibrd ibwrt Receive Send and SendCmds if a timeout occurs during one of these calls TIMO is cleared in all other circumstances END dev brd END indicates that either the GPIB EOI line has been asserted or
61. 88 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured No Listeners were detected on the bus Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 134 National Instruments Corp Chapter 2 NI 488 2 Routines This chapter lists the available NI 488 2 routines and then describes the purpose format input and output parameters and possible errors for each routine For general programming information refer to the NI 488 2 user manual The user manual explains how to develop and debug your program It also describes the example programs included with your NI 488 2 software Routine Names The routines in this chapter are listed alphabetically Purpose Each routine description includes a brief statement of the purpose of the routine DOS Format The DOS format is given for each of the languages supported by the NI 488 2 software Microsoft C version 5 1 or higher Microsoft Professional BASIC version 7 0 or higher and Microsoft Visual Basic for MS DOS version 1 0 or higher Microsoft QuickBASIC version 4 0 or higher BASICA and GWBASIC National Instruments Corp 2 1 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 Windows Format The Windows format is given for the following Microsoft C version 5 1 or higher LabWindows CVI for Windows and Borland C version 2 0 or higher Micro
62. A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad Device level No devices are connected to the GPIB Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 76 National Instruments Corp Chapter 1 NI 488 Functions IBRDA Board Level IBRDA Device Level Purpose Read data asynchronously from a device into a user buffer DOS Format C int ibrda int ud void rdbuf long cnt QuickBASIC BASIC CALL ibrda ud rdbuf Or status ilrda ud rdbuf cnt amp BASICA CALL ibrda ud rdbuf Windows Format C int ibrda int ud void rdbuf long cnt Visual Basic CALL ibrda ud rdbuf Or status ilrda ud rdbuf cnt amp Direct Entry with C DLLibrda int ud void far rdbuf long cnt int far ibsta short far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibrda Lib gpib dll ByVal ud ByVal rdbuf ByVal cnt amp ibsta iberr ibcntl amp As Integer National Instruments Corp 1 77 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBRDA Board Level IBRDA Device Level Continued Input ud Board or devi
63. Basic CALL ibdev BdIndx pad sad tmo eot eos ud Or ud ildev BdIndx pad sad tmo eot eos Direct Entry with C DLLibdev int BdIndx int pad int sad int tmo int eot int eos int far ibsta int far iberr long far ibcntl NI 488 2 FRM for DOS Windows 1 38 National Instruments Corp Chapter 1 NI 488 Functions IBDEV Device Level IBDEV Continued Direct Entry with Visual Basic Declare Function DLLibdev Lib gpib dll ByVal BdIndx ByVal pad ByVal sad ByVal tmo ByVal eot ByVal eos ibsta iberr ibcntl amp As Integer Input BdIndx Index of the access board for the device pad The primary GPIB address of the device sad The secondary GPIB address of the device tmo The I O timeout value eot EOI mode of the device eos EOS character and modes Output Function Return The device descriptor Description ibdev acquires a device descriptor to use in subsequent device level NI 488 functions It opens and initializes a device descriptor and configures it according to the input parameters For more details on the meaning and effect of each input parameter see the corresponding NI 488 functions for ibbna ibpad ibsad ibtmo ibeot and ibeos If ibdev is unable to get a valid device descriptor a 1 is returned the ERR bit is set in ibsta and iberr contains EDVR National Instruments Corp 1 39 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBDEV Devi
64. C ENEB 7 ENEB occurs when no GPIB board exists at the I O address specified in the configuration program This happens when the board is not physically plugged into the system the I O address specified during configuration does not match the actual board setting or there is a system conflict with the base I O address or the Use This Interface field is set incorrectly in ibconf in DOS or the GPIB software configuration utility in Windows Solutions Make sure there is a GPIB board in your computer that is properly configured both in hardware and software at a free base I O address e Make sure thatthe Use This Interface field is set to Yes in ibconf or the GPIB software configuration utility EDMA 8 NI 488 2 for Windows EDMA occurs when an error occurs using DMA for data transfers If your computer has more than 16 MB of RAM and you do not have the National Instruments virtual GPIB device nivgpibd 386 installed the NI 488 2 software returns EDMA if you are using DMA and the data buffer is located in memory above 16 MB If you are using Windows 3 0 you are using DMA for data transfers and you do not have the National Instruments virtual DMA device nivdmad 386 installed the NI 488 2 software returns EDMA if you try to use DMA to transfer data Solutions nstall the appropriate virtual device in the system ini file in the Windows directory in the 38 6Enh section The following line installs the virtual GPIB device
65. C ui eiu Sonet eo canted x eh Bk easels Ci ee 1 92 ligue 1 94 IBRSM 5o eere en a ee hla RANE Um edet 1 97 TB SAD EEEE S AA E AE deste e be E e rep ERE EPER SIRE 1 99 TB SUG A Uno UHR n re E NIE PEE 1 101 IBSRE EAEN TAA A ree Mc iue AME LM O MT 1 103 IBSRQ aene nane SEI 1 105 IBS TOP 4 e ehe ete 1 106 TEM Oi 353 x M NN 1 108 IBTRAP A oe ce Sorrel ote Meats e he te eee ditte dee eme eet 1 111 IBTRG edes eee ONU 1 113 IBWATESA tee erect site teed E tu tease a eSI 1 115 Ina 1 119 SAVAIT RN 1 122 IBWRTEZz a nrbes deua 1 125 IBWRITL icu uen en Lo Ra ELM clot is Ta wen s rr 1 128 IBWRTIA c n tes tec aii rere eere Bel oie eat tec etie ee 1 131 Chapter 2 NI 488 2 Routines 277 1st teens 2 1 Routine Names xeu ern es ER PE e URN aa 2 1 UTP OSE ier ertet t eee eicere pee prp ep eerte eee ree tees 2 1 DOS Botrma t 2 ene eel I Re ee ae EEE 2 1 WindowS POorimat ever eec E ER RUE eo ee 2 2 Input and Output Parameters sesseeeeeeeeeeeeee eee 2 2 D SGCEIptlOns Jine cerner rrt ee CO e RR PFERDE 2 2 Exai ple8 4 ett ee et ret eet e E pant feb m e ens 2 2 POSSIDIE mi K KOI EIEEE S TE AE olei e 2 3 List of Available NI 488 2 Routines eee eene 2 3 AISpoll ceteri shanks EGO P Ub Ro or e ts 2 5 DevCleatzs EE CE ENE OT 2 7 DEV Clear Lasts ett ee eee es VeRO as TE ee vp 2 9 EnableLoc l h eter eee eti tedde codes covtvcogeasevonstestesteetseoeceycte 2 11 EnableRemote 5 5 ener RR eee ences eve d
66. CONFIG Device Level Continued Table 1 5 ibconfig Board Configuration Parameter Options Options Options Constants Values Legal Values IbcPAD 0x0001 Changes the primary address of the board Identical to ibpad IbcSAD 0x0002 Changes the secondary address of the board Identical to ibsad IbcTMO 0x0003 Changes the I O timeout limit of the board Identical to ibtmo IbcEOT 0x0004 Changes the data termination mode for write operations Identical to ibeot IbcPPC 0x0005 Configures the board for parallel polls Identical to board level ibppc Default zero IbcAUTOPOLL 0x0007 zero Disable automatic serial polling non zero Enable automatic serial polling Refer to the NI 488 2 user manual for more information about automatic serial polling IbcCICPROT 0x0008 zero Disable the CIC protocol non zero Enable the CIC protocol Refer to the NI 488 2 user manual for more information about the CIC protocol IbcIRQ 0x0009 zero Do not use interrupts non zero Use interrupts use the hardware interrupt level configured through ibconf in DOS or the GPIB software configuration utility in Windows IbcSC 0x000A Request or release system control Identical to ibrsc continues National Instruments Corp 1 31 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IB CONFIG Board Level IB CONFIG Device Level Continued Table 1 5 ibconfig Board Configuration Parameter Options Continued Op
67. Chapter 1 IBDMA Board Level IBDMA Continued Input ud A board descriptor v Enable or disable the use of DMA Output Function Return Description The value of ibsta ibdma enables or disables DMA transfers for the board described by ud If vis zero then DMA is not used for GPIB I O transfers If v is non zero then DMA is used for GPIB I O transfers Possible Errors EARG ECAP EDVR ENEB EOIP ud is valid but does not refer to an interface board The interface board is not configured to use a DMA channel To configure a DMA channel use ibconf in DOS or the GPIB software configuration utility in Windows Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 42 National Instruments Corp Chapter 1 NI 488 Functions IBEOS Board Level IBEOS Device Level Purpose Configure the end of string EOS termination mode or character DOS Format C int ibeos int ud int v QuickBASIC BASIC CALL ibeos ud v Or status ileos ud v BASICA CALL ibeos ud v Windows Format C int ibeos int ud int v Visual Basic CALL ibeos ud v Or status ileos ud v Direct Entry with C DLLibeos int ud int v int far ibsta int tar 1bertrt long far ibcntl Direct Entry with Visual Basic Declare Function DLLibeos Lib gpib dll ByV
68. Control TCT GPIB message to the device described by address That device becomes Controller In Charge and boardID is no longer CIC Possible Errors EARG EBUS ECIC EDVR ENEB EOIP The address parameter is invalid out of range or NOADDR No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 34 National Instruments Corp Chapter 2 NI 488 2 Routines PPoll PPoll Purpose Perform a parallel poll on the GPIB DOS Format C void PPoll int boardID short result BASICA QuickBASIC BASIC CALL PPoll boardID result Windows Format C void PPoll int boardID short result Visual Basic CALL PPoll boardID result Direct Entry with C DLLPPoll int boardID short far result int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLPPoll Lib gpib dll ByVal boardID result ibsta iberr ibcntl Input boardID The interface board number Output result The parallel poll result National Instruments Corp 2 55 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 PPoll PPoll Continued Description PPo11 conducts a parallel poll and the resul
69. D padlist resultlist limits BASICA CALL FindLstn boardID padlist 0 resultlist 0 limits Windows Format C void FindLstn int boardID Addr4882 t padlist Addr4882 t resultlist int limit Visual Basic CALL FindLstn boardID padlist resultlist limits Direct Entry with C DLLFindLstn int boardID Addr4882 t far padlist Addr4882 t far resultlist int limit int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLFindLstn Lib gpib dll ByVal boardID padlist resultlist ByVal limit ibsta iberr ibcntl amp National Instruments Corp 2 15 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 FindLstn FindLstn Continued Input boardID The interface board number padlist A list of primary addresses that is terminated by NOADDR limit Total number of entries that can be placed in resultlist Output resultlist Addresses of all listening devices found by FindLstn are placed in this array Description FindLstn tests all of the primary addresses in padlist as follows If a device is present at a primary address given in padlist then the primary address is stored in resultlist Otherwise all secondary addresses of the primary address are tested and the addresses of any devices found are stored in resultlist No more than limit addresses are stored in resultlist ibcnt1 contains the actual number of addresses sto
70. I 488 Functions Chapter 1 IBWAIT Board Level IBWAIT Device Level Continued Table 1 9 Wait Mask Layout ROS T SPOLL 10 400 The board has been serial polled by the Controller EVENT 9 200 A DTAS DCAS or IFC event has occurred CMPL 8 100 T O completed LOK 7 80 GPIB board is in Lockout State REM 6 40 GPIB board is in Remote State CIC GPIB board is CIC TACS 3 8 GPIB board is Talker LACS GPIB board is Listener DTAS GPIB board is in Device Trigger State DCAS o 1 GPIB board is in Device Clear State NI 488 2 FRM for DOS Windows 1 118 National Instruments Corp Chapter 1 NI 488 Functions IBWRT Board Level IBWRT Device Level Purpose Write data to a device from a user buffer DOS Format C int ibwrt int ud void wrtbuf long cnt QuickBASIC BASIC CALL ibwrt ud wrtbuf Or status ilwrt ud wrtbuf cnt BASICA CALL ibwrt ud wrtbuf Windows Format C int ibwrt int ud void wrtbuf long cnt Visual Basic CALL ibwrt ud wrtbuf or status ilwrt ud wrtbuf cnt Direct Entry with C DLLibwrt int ud void far wrtbuf long cnt int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibwrt Lib gpib dll ByVal ud ByVal wrtbuf ByVal cnt amp ibsta iberr ibcntl amp As Integer National Instruments Corp 1 119 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IB
71. I O has begun GPIB calls other than ibstop ibwait or ibonl are strictly limited If a call might interfere with the I O operation in progress the driver returns EOIP Solutions Resynchronize the driver and the application before making any further GPIB calls Resynchronization is accomplished by using one of the following three functions ibwait If the returned ibsta contains CMPL then the driver and application are resynchronized ibstop The I O is canceled the driver and application are resynchronized ibonl The I O is canceled and the interface is reset the driver and application are resynchronized ECAP 11 ECAP results when your GPIB board lacks the ability to carry out an operation or when a particular capability has been disabled in the software and a call is made that requires the capability Solutions Check the validity of the call or make sure your GPIB interface board and the driver both have the needed capability National Instruments Corp C 7 NI 488 2 FRM for DOS Windows Error Codes and Solutions Appendix C EFSO 12 EFSO results when an ibrdf or ibwrt f call encounters a problem performing a file operation Specifically this error indicates that the function is unable to open create seek write or close the file being accessed The specific DOS error code for this condition is contained in ibcntl Solutions Make sure the filename path and drive that you specified are correct
72. IB address that is currently present on the bus This function should return the 8 bit serial poll response byte that is sent to the Controller Possible Errors EARG The t ype parameter is invalid ECAP Hardware interrupt s are disabled EDVR Either boardID is invalid out of range or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress National Instruments Corp 2 27 NI 488 2 FRM for DOS Windows NI 488 2 Routines GotoMultAddr Chapter 2 GotoMultAddr Continued Example The following example program in C simulates four GPIB devices at primary addresses 1 3 24 and 30 lt stdio h gt lt string h gt lt process h gt lt bios h gt co at gpib c decl h include include include include include define BUE 1 define 0 FALSI Ed 0x20 0x40 LAD TAD define define talk address mask BUFSIZE 512 Ed define Globals EJ short addressed FALSE unsigned short address char buffer BUFSIZE 2 listen address mask xy address selection call The following function implements th back function bus If GPIB this function 57 addresses 1 3 24 returns TRUE unsigned short far loadds addrfunc the addresses on the It is used to validat or 30 are seen on the bus short board unsign
73. Level IBTMO Device Level Purpose Change or disable the I O timeout period DOS Format C int ibtmo int ud int v QuickBASIC BASIC CALL ibtmo ud v Or status iltmo ud v BASICA CALL ibtmo ud v Windows Format C int ibtmo int ud int v Visual Basic oe CALL ibtmo ud v Or status iltmo ud v Direct Entry with C DLLibtmo int ud int v int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibtmo Lib gpib dll ByVal ud ByVal v ibsta iberr ibcntl amp As Integer NI 488 2 FRM for DOS Windows 1 108 National Instruments Corp Chapter 1 NI 488 Functions IBTMO Board Level IBTMO Device Level Continued Input ud Board or device descriptor v Timeout duration code Output Function Return Description The value of ibsta The timeout period is set to v The timeout period is used to select the maximum duration allowed for a synchronous operation for example ibrd and ibwait Ifthe operation does not complete before the timeout period elapses then the operation is aborted and TIMO is returned in ibsta See Table 1 8 for a list of valid timeout values These timeout values represent the minimum timeout period The actual period might be longer Possible Errors EARG EDVR ENEB v Is invalid Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not proper
74. Make sure that the access mode of the file is correct Make sure there is enough room on the disk to hold the file EBUS 14 EBUS results when certain GPIB bus errors occur during NI 488 device level functions All device functions send command bytes to perform addressing and other bus management Devices are expected to accept these command bytes within the time limit specified by the default configuration or the ibtmo function EBUS results if a timeout occurred while sending these command bytes Solutions e Verify that the instrument is operating correctly Check for loose or faulty cabling or several powered off instruments on the GPIB If the timeout period is too short for the driver to send command bytes increase the timeout period ESTB 15 ESTB is reported only by the ibrsp function ESTB indicates that one or more serial poll status bytes received from automatic serial polls have been discarded because of a lack of storage space Several older status bytes are available however the oldest is being returned by the ibrsp call Solutions Call ibrsp more frequently to empty the queue Disable autopolling with the ibconfig function the ibconf utility in DOS or the GPIB software configuration utility in Windows NI 488 2 FRM for DOS Windows C 8 National Instruments Corp Appendix C Error Codes and Solutions ESRQ 16 ESRQ occurs only during the ibwait function ESRQ indicates that a wait for RQS is
75. NI 488 2 Function Reference Manual for DOS Windows August 1996 Edition Part Number 320702C 01 Copyright 1993 1996 National Instruments Corporation All Rights Reserved National Instruments Corporate Headquarters 6504 Bridge Point Parkway Austin TX 78730 5039 512 794 0100 Technical support fax 512 794 5678 Branch Offices Australia 03 9879 5166 Austria 0662 45 79 90 0 Belgium 02 757 00 20 Canada Ontario 905 785 0085 Canada Qu bec 514 694 8521 Denmark 45 76 26 00 Finland 90 527 2321 France 01 48 14 24 24 Germany 089 741 31 30 Hong Kong 2645 3186 Israel 03 5734815 Italy 02 413091 Japan 03 5472 2970 Korea 02 596 7456 Mexico 95 800 010 0793 Netherlands 0348 433466 Norway 32 84 84 00 Singapore 2265886 Spain 91 640 0085 Sweden 08 730 49 70 Switzerland 056 200 51 51 Taiwan 02 377 1200 U K 01635 523545 Limited Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions due to defects in materials and workmanship for a period of 90 days from date of shipment as evidenced by receipts or other documentation National Instruments will at its option repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period National Instruments does not warrant that the operation of the software shall be uninterrupted or error free A Retu
76. NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 GenerateREQF GenerateREQF Purpose Cancel service request generated by GenerateREQT DOS Format C void GenerateREQF int boardID unsigned short GPIBaddr QuickBASIC BASIC Not supported BASICA Not supported Windows Format C void GenerateREQF int boardID unsigned short GPIBaddr Visual Basic Not supported Direct Entry with C DLLGenerateREQF int boardID unsigned short GPIBaddr int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Not supported NI 488 2 FRM for DOS Windows 2 20 National Instruments Corp Chapter 2 NI 488 2 Routines GenerateREQF GenerateREQF Continued Input boardID The interface board number GPIBaddr The 5 bit GPIB addresses of the simulated device that is no longer requesting service Description The driver keeps track of the simulated devices currently requesting service so that it knows when to unassert the SRQ bus line GenerateREQF cancels the service request of the simulated device at GP IBaddr The driver unasserts the SRQ line if no other simulated devices are requesting service The driver usually calls GenerateREOF automatically after the simulated device is serial polled You can call this function if you want to cancel the request for service before the device is serial polled For an example of the Generat eREOF routine call refer to the descript
77. S indicates whether the GPIB board has detected a device trigger command DTAS is set whenever the GPIB board as a Listener detects that the Group Execute Trigger GET command has been sent by another Controller DTAS is cleared on any call immediately following an ibwait call if the DTAS bit is set in the ibwait mask parameter DCAS brd DCAS indicates whether the GPIB board has detected a device clear command DCAS is set whenever the GPIB board detects that the Device Clear DCL command has been sent by another Controller or whenever the GPIB board as a Listener detects that the Selected Device Clear SDC command has been sent by another Controller DCAS is cleared on any call immediately following an ibwait call if the DCAS bit was set in the ibwait mask parameter It also clears on any call immediately following a read or write National Instruments Corp B 5 NI 488 2 FRM for DOS Windows Appendix C Error Codes and Solutions This appendix lists a description of each error some conditions under which it might occur and possible solutions The following table lists the GPIB error codes Table C 1 GPIB Error Codes FD Mnemonic Value Meaning nv o Opeaingawemenor Peano 6 lOoemiwsed mw DMA s DMAem y O EDVR 0 NI 488 2 for DOS EDVR is returned when the board or device name passed to ibfind is not configured in the software In this case the variable ibcnt1 contains the s
78. S488 is disabled 1 to 15 The number of meters of GPIB cable in your system The NI 488 2 software uses this information to select the appropriate high speed data transfer HS488 mode See the NI 488 2 user manual for information about high speed data transfers HS488 IbcIst 0x0020 Changes the individual status ist bit of the board Identical to ibist IbcRsv 0x0021 Changes the serial poll status byte of the board Identical to ibrsv Default zero NI 488 2 FRM for DOS Windows 1 34 National Instruments Corp Chapter 1 NI 488 Functions IB CONFIG Board Level IB CONFIG Device Level Continued Table 1 6 lists the options you can use with ibconfig when ud is a device descriptor or a device index If the table does not list the default value for a particular option the default value is determined by either ibconf in DOS or the GPIB software configuration utility in Windows The following is an alphabetical list of the option constants included in Table 1 6 Constants Values Constants Values IbcEndBitIsNormal 0x001A IbcREADDR 0x0006 e bcEOSchar 0x000F bcReadAdjust 0x0013 IbcEOScmp Ox000E IbcSAD 0x0002 IbcEOSrd 0x000C bcSPollTime 0x0018 IbcEOSwrt 0x000D IbcTMO 0x0003 bcEOT 0x0004 e IbcWriteAdjust 0x0014 bcPAD 0x0001 bcUnAddr 0x001B Table 1 6 ibconfig Device Configuration Parameter Options Options Options Constants Values Legal Values IbcPAD 0x0001 Changes the primar
79. The operation terminates with an error if cnt bytes could not be sent within the timeout period The actual number of bytes transferred is returned in the global variable ibcntl National Instruments Corp 1 129 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBWRTI Board Level IBWRTI Device Level Continued Board Level If ud is a board descriptor ibwrti writes cnt bytes of data from the buffer specified by wrtbuf to a GPIB device a board level ibwrti assumes that the GPIB is already properly addressed The operation terminates normally when cnt bytes have been sent The operation terminates with an error if cnt bytes could not be sent within the timeout period or if the board is not CIC the CIC sends the Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcnt1 Note The cnt parameter specifies the number of bytes to transfer For example if you want to transfer 16 integers the number of bytes is 16 2 32 Possible Errors EABO Either cnt bytes were not sent within the timeout period or a Device Clear message was received after the write operation began EADR Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad EBUS Device level No devices are connected to the GPIB ECIC Device level The
80. Val boardID addrlist ByVal bufferS ByVal datacnt amp ByVal eotmode ibsta iberr ibocntl amp National Instruments Corp 2 63 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 SendList SendList Continued Input boardID The interface board number addrlist A list of device addresses to send data to buffer The data bytes to be sent datacnt Number of bytes transmitted eotmode The data termination mode DABend NULLend or NLend Description SendList addresses the devices described by addrlist to listen and the interface board to talk Then datacnt bytes from buffer are sent to the devices The last byte is sent with the EOI line asserted if eotmode is DABend The last byte is sent without the EOI line asserted if eotmode is NULLend If eotmode is NLend then a new line character Nn is sent with the EOI line asserted after the last byte The actual number of bytes transferred is returned in the global variable ibcntl NI 488 2 FRM for DOS Windows 2 64 National Instruments Corp Chapter 2 NI 488 2 Routines SendList SendList Continued Possible Errors EABO The I O timeout period expired before all of the bytes were sent EARG An invalid address out of range appears in addrlist ibcnt1 is the index of the invalid address in the addrlist array the eotmode parameter is invalid eotmode can be only DABend NULLend or NLend or the buffer is empty and the eotmode is DABend
81. Visual Basic Declare Sub DLLSetRWLS Lib gpib dll ByVal boardID addrlist ibsta iberr ibocntl amp NI 488 2 FRM for DOS Windows 2 70 National Instruments Corp Chapter 2 SetRWLS NI 466 2 Routines SetRWLS Continued Input boardID addrlist Description The interface board number A list of device addresses terminated by NOADDR SetRWLS places the devices described by addrlist in remote mode by asserting the Remote Enable REN GPIB line Then those devices are placed in lockout state by the Local Lockout LLO GPIB message You cannot program those devices locally until the Controller In Charge releases the Local Lockout To release the Local Lockout use the EnableLocal NI 488 2 routine Possible Errors EARG EBUS ECIC EDVR ENEB EOIP ESAC An invalid address out of range appears in addrlist ibcnt1 is the index of the invalid address in the addrlist array or the addrlist is empty No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress The interface board is not configured as System Controller National Instruments Corp 2 71 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 TestSRQ TestSRQ Purpose Determine the curre
82. WRT Board Level IBWRT Device Level Continued Input ud Board or device descriptor wrtbuf Address of the buffer containing the bytes to write cnt Number of bytes to be written Output Function Return The value of ibsta Description Device Level If ud is a device descriptor ibwrt addresses the GPIB and writes cnt bytes from the memory location specified by wrtbuf to a GPIB device The operation terminates normally when cnt bytes have been sent The operation terminates with an error if cnt bytes could not be sent within the timeout period The actual number of bytes transferred is returned in the global variable ibent1 Board Level If udis a board descriptor ibwrt writes cnt bytes of data from the buffer specified by wrtbuf to a GPIB device a board level ibwrt assumes that the GPIB is already properly addressed The operation terminates normally when cnt bytes have been sent The operation terminates with an error if cnt bytes could not be sent within the timeout period or if the board is not CIC the CIC sends the Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcnt1 NI 488 2 FRM for DOS Windows 1 120 National Instruments Corp Chapter 1 IBWRT NI 488 Functions Board Level IBWRT Device Level Continued Possible Errors EABO EADR EBUS ECIC EDVR ENEB ENOL EOIP Either cnt bytes were not sent within the timeout period or a De
83. With this option the GPIB board can participate in data handshake as an acceptor without actually reading data If END is detected the interface board enters a Not Ready For Data NRFD handshake holdoff state which results in hold off of subsequent GPIB transfers If v is 0 no acceptor handshaking or holdoff is performed Before performing an ibgts with shadow handshake call the ibeos function to establish proper EOS modes For more information about handshaking refer to the ANSI IEEE Standard 488 1 1987 Possible Errors EADR v is non zero and either ATN is low or the interface board is a Talker or a Listener EARG ud is valid but does not refer to an interface board ECIC The interface board is not Controller In Charge EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 54 National Instruments Corp Chapter 1 NI 488 Functions IBIST Board Level IBIST Purpose Set or clear the board individual status bit for parallel polls DOS Format C int ibist int ud int v QuickBASIC BASIC CALL ibist ud v Or status ilist ud v BASICA CALL ibist ud v Windows Format C int ibist inb ud int v Visual Basic CALL ibist ud v Or status ilist ud v Direct Entry with C DLLibist int ud int v int far ibsta int far iberr lo
84. access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured ENOL No Listeners were detected on the bus EOIP Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 130 National Instruments Corp Chapter 1 NI 488 Functions IBWRTIA Board Level IBWRTIA Device Level Purpose Write data asynchronously to a device from a user integer buffer DOS Format C Not supported use ibwrta QuickBASIC BASIC CALL ibwrtia ud wrtbuf cnt amp Or Status ilwrtia ud wrtbuf cnt amp BASICA CALL ibwrtia ud wrtbuf 0 cnt Windows Format C Not supported use ibwrta Visual Basic CALL ibwrtia ud wrtbuf cnt amp Or Status ilwrtia ud wrtbuf cnt amp Direct Entry with C Not supported use ibwrta National Instruments Corp 1 131 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBWRTIA Board Level IBWRTIA Device Level Continued Direct Entry with Visual Basic Declare Function DLLibwrta Lib gpib dll ByVal ud wrtbuf ByVal cnt amp ibsta iberr ibcntl amp As Integer Note For direct entry with Visual Basic the correct format is DLLibwrt not DLLibwrtia Input ud Board or device descriptor wrtbuf Address of the integer buffer containing the bytes to writ
85. al ud ByVal v ibsta iberr ibcntl amp As Integer National Instruments Corp 1 43 NI 488 2 FRM for DOS Windows NI 488 Functions IBEOS Chapter 1 Board Level IBEOS Device Level Continued Input ud Output Function Return Description A board or device descriptor EOS mode and character information The value of ibsta ibeos configures the EOS termination mode or EOS character used by the board or device described by ud The parameter v describes the new end of string EOS configuration to use If v is zero then the EOS configuration is disabled Otherwise the low byte is the EOS character and the upper byte contains flags which define the EOS mode Table 1 7 describes the different EOS configurations and the corresponding values of v If no error occurs during the call then the value of the previous EOS setting is returned in iberr Table 1 7 EOS Configurations Value of v Configuration High Byte Low Byte A Terminate read when EOS is 00000100 EOS character detected Set EOI with EOS on write 00001000 EOS character function C Compare all 8 bits of EOS 00010000 EOS character byte rather than low 7 bits all read and write functions NI 488 2 FRM for DOS Windows 1 44 National Instruments Corp Chapter 1 NI 488 Functions IBEOS Board Level IBEOS Device Level Continued Configuration bits A and C determine how to terminate read I O operations If bit A is set and bit C is
86. alker National Instruments Corp Glossary 9 NI 488 2 FRM for DOS Windows Index A aborting asynchronous I O operation See ibstop function access board changing See ibbna function address functions routines See GPIB address functions routines AllSpoll routine 2 5 to 2 6 asynchronous I O operation aborting See ibstop function ATN status word condition B 4 C CIC status word condition B 4 clearing devices DevClear routine 2 7 to 2 8 DevClearList routine 2 9 to 2 10 ibclr function 1 21 to 1 22 CMPL status word condition B 3 commands sending ibemd function 1 23 to 1 24 ibcmda function 1 25 to 1 27 configuration parameters changing See ibconfig function returning See ibask function control line status See iblines function Controller functions routines ibcac function 1 19 to 1 20 ibgts function 1 53 to 1 54 ibpct 1 69 to 1 70 ibrsc 1 92 to 1 93 PassControl routine 2 33 to 2 34 customer communication xii D 1 D DCAS status word condition B 5 DevClear routine 2 7 to 2 8 DevClearList routine 2 9 to 2 10 device descriptor opening See ibdev function DMA enabling or disabling See ibdma function National Instruments Corp Index 1 NI 488 2 FRM for DOS Windows Index documentation conventions used in manual xi how to use manual set ix organization of manual x related documentation xii DTAS status word condition B 5 E EABO error code C 5 EADR error c
87. an I O address Refers to the National Instruments family of GPIB interface boards See GET Go To Local is the GPIB command used to place an addressed Listener in local front panel control mode National Instruments Corp Glossary 3 NI 488 2 FRM for DOS Windows Glossary H handshake hex high level function Hz ibcnt ibconf iberr ibic ibsta IEEE interface message I O Input Output NI 488 2 FRM for DOS Windows The mechanism used to transfer bytes from the Source Handshake function of one device to the Acceptor Handshake function of another device The three GPIB lines DAV NRFD and NDAC are used in an interlocked fashion to signal the phases of the transfer so that bytes can be sent asynchronously for example without a clock at the speed of the slowest device For more information about handshaking refer to the ANSI IEEE Standard 488 1 1987 Hexadecimal a number represented in base 16 for example decimal 16 hex 10 See device level function Hertz After each NI 488 2 I O function this global variable contains the actual number of bytes transmitted The NI 488 2 driver configuration program for DOS A global variable that contains the specific error code associated with a function call that failed The Interface Bus Interactive Control program for DOS is used to communicate with GPIB devices troubleshoot problems and develop your application At the end of eac
88. ardID Addr4882 t addrlist short resultlist Visual Basic CALL AllSpoll boardID addrlist resultlist Direct Entry with C DLLAllSpoll int boardID Addr4882 t far addrlist short far resultlist int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLAllSpoll Lib gpib dll ByVal boardID addrlist resultlist ibsta iberr ibcntl amp National Instruments Corp 2 5 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 AllSpoll AllSpoll Continued Input boardID The interface board number addrlist A list of device addresses that is terminated by NOADDR Output resultlist A list of serial poll response bytes corresponding to device addresses in addrlist Description Al11Spoll serial polls all of the devices described by addrlist It stores the poll responses in resultlist and the number of responses in ibcntl Possible Errors EABO EARG EBUS ECIC EDVR ENEB EOIP One of the devices timed out instead of responding to the serial poll ibcnt1 contains the index of the timed out device An invalid address out of range appears in addrlist ibcnt 1 is the index of the invalid address in the addrlist array No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not instal
89. board attempts to become the Active Controller by asserting ATN If v is zero the GPIB board takes control asynchronously If v is non zero the GPIB board takes control synchronously Before you call ibcac the GPIB board must already be CIC To make the board CIC use the ibsic function To take control synchronously the GPIB board attempts to assert the ATN signal without corrupting transferred data If this is not possible the board takes control asynchronously To take control asynchronously the GPIB board asserts ATN immediately without regard for any data transfer currently in progress Most applications do not need to use ibcac Functions that require ATN to be asserted such as ibcmd do so automatically Possible Errors EARG ud is valid but does not refer to an interface board ECIC The interface board is not Controller In Charge EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 20 National Instruments Corp Chapter 1 NI 488 Functions IB CLR Device Level IB CLR Purpose Clear a specific device DOS Format C int ibclr int ud QuickBASIC BASIC CALL ibclr ud or status ilclr ud BASICA CALL ibclr ud Windows Format C int ibelr int ud Visual Basic CALL ibclr ud or status ilclr ud Direct Entry with C DLLibclr
90. bonl with a 0 or 1 You must always call ibonl with a 0 before your application program terminates Otherwise the driver maintains the addrfunc and spollfunc pointers and might try to access the functions when they are no longer in memory causing your computer to lock up Before you use the GotoMultAddr routine make sure that hardware interrupts on the interface board have been enabled with either the ibconf utility in DOS the GPIB software configuration utility in Windows or the ibconfig function Because the addrfunc and spollfunc functions are called at interrupt time you must take special care when writing your function code Follow these rules when writing functions that are called at interrupt time Return from the interrupt call as soon as possible Performing large calculations prevents the system from performing other interrupt activities such as maintaining the system clock National Instruments Corp 2 25 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 GotoMultAddr GotoMultAddr Continued Make sure that any function you call is re entrant Most system functions are not re entrant This includes DOS and BIOS functions standard C library function Windows functions and GPIB functions Do not use a large amount of stack space The stack provided to your function has about 512 bytes available for its use You should disable run time stack overflow checking using the Gs option of the Microsoft C compi
91. bytes to be sent cnt Number of bytes to be sent Description SendCmds sends cnt command bytes from buf fer over the GPIB as command bytes interface messages The number of command bytes transferred is returned in the global variable ibcntl Refer to Appendix A Multiline Interface Messages for a listing of the defined interface messages Use command bytes to configure the state of the GPIB not to send instructions to GPIB devices Use Send or SendList to send device specific instructions Possible Errors EABO ECIC EDVR ENEB ENOL EOIP The I O timeout period expired before all of the command bytes were sent The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured No devices are connected to the GPIB Asynchronous I O is in progress National Instruments Corp 2 57 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 SendDataBytes SendDataBytes Purpose Send data bytes to devices that are already addressed to listen DOS Format C void SendDataBytes int boardID void buffer long datacnt int eotmode BASICA QuickBASIC BASIC CALL SendDataBytes boardID bufferS eotmodes Windows Format C void SendDataBytes int boardID void buffer long datacnt int eotmode Visual Basic CALL SendDataBytes boardID buff
92. ce Level IBDEV Continued ibdev acquires and initializes a device descriptor from the set of user configurable devices for example dev1 dev2 and so on through dev32 As a result it is necessary for an application to use ibdev only after all calls to ibfind for user configurable devices have been completed This is the only way to ensure that ibdev and ibfind do not both return the same device descriptor Possible Errors EARG pad sad tmo or eos is invalid See the corresponding NI 488 function EDVR Either no device descriptors are available or BdIndx refers to a GPIB board that is not installed ENEB The interface board is not installed or is not properly configured NI 488 2 FRM for DOS Windows 1 40 National Instruments Corp Chapter 1 NI 488 Functions IBDMA Board Level IBDMA Purpose Enable or disable DMA DOS Format C int ibdma int ud int v QuickBASIC BASIC CALL ibdma ud v Or status ildma ud v BASICA CALL ibdma ud v Windows Format C int ibdma int ud int v Visual Basic o ildma ud v oe ae CALL ibdma ud v or status Direct Entry with C DLLibdma int ud int v int _far ibsta int _far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibdma Lib gpib dll ByVal ud ByVal v ibsta iberr ibcntl amp As Integer National Instruments Corp 1 41 NI 488 2 FRM for DOS Windows NI 488 Functions
93. ce descriptor cnt Number of bytes to be read from the GPIB Output rdbuf Address of buffer into which data is read Function Return The value of ibsta Description Device Level If ud is a device descriptor ibrda addresses the GPIB begins an asynchronous read of up to cnt bytes of data from a GPIB device and places the data into the memory location specified by rdbuf The operation terminates normally when cnt bytes have been received or END is received The actual number of bytes transferred is returned in the global variable ibcntl Board Level If ud is a board descriptor ibrda reads up to cnt bytes of data from a GPIB device and places the data into the buffer specified by rdbuf A board level ibrda assumes that the GPIB is already properly addressed The operation terminates normally when cnt bytes have been received or END is received The operation terminates with an error if the board is not the CIC or if the CIC sends the Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcnt1 NI 488 2 FRM for DOS Windows 1 78 National Instruments Corp Chapter 1 NI 488 Functions IBRDA Board Level IBRDA Device Level Continued Board and Device Level The asynchronous I O calls ibcmda ibrda ibwrta are designed so that applications can perform other non GPIB operations while the I O is in progress Once the asynchronous I O has begun further GPIB calls are strictly limit
94. clear then a read ends when a byte that matches the low seven bits of the EOS character is received If bits A and C are both set then a read ends when a byte that matches all eight bits of the EOS character is received Configuration bits B and C determine when a write I O operation asserts the GPIB EOI line If bit B is set and bit C is clear then EOI is asserted when the written character matches the low seven bits of the EOS character If bits B and C are both set then EOI is asserted when the written character matches all eight bits of the EOS character Note Defining an EOS byte does not cause the driver to automatically send that byte at the end of write I O operations In your application the EOS byte must be placed at the end of the data strings that it defines For more information on the termination of I O operations refer to the NI 488 2 user manual Examples ibeos ud 0x140A Configure the software to end reads on newline character hex 0A for the unit descriptor ud ibeos ud 0x180A Configure the software to assert the GPIB EOI line whenever the newlin character hex 0A is written out by the unit descriptor ud Possible Errors EARG The high byte of v contains invalid bits EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress National Instruments Corp 1 45 NI 488
95. cluded with your NI 488 2 software Function Names The functions in this chapter are listed alphabetically Each function is designated as board level device level or both Purpose Each function description includes a brief statement of the purpose of the function DOS Format The DOS format is given for each of the languages supported by the NI 488 2 software Microsoft C version 5 1 or higher and Borland C version 2 0 or higher Note The C language interface does not support the Borland C huge memory model Contact National Instruments for the Borland C huge memory model language interface Microsoft Professional BASIC version 7 0 or higher and Microsoft Visual Basic for DOS version 1 0 or higher Microsoft QuickBASIC version 4 0 or higher BASICA and GWBASIC National Instruments Corp 1 1 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 Windows Format The Windows format is given for the following Microsoft C version 5 1 or higher LabWindows CVI for Windows and Borland C version 2 0 or higher Microsoft Visual Basic version 1 0 or higher Direct entry into the Windows Dynamic Link Library gpib dll Direct entry for Microsoft C and Borland C Direct entry for Microsoft Visual Basic Input and Output The input and output parameters for each function are listed Function Return describes the return value of the function The return value of the NI 488 functions is usual
96. cription Device Level If ud is a device descriptor ibra addresses the GPIB reads up to cnt bytes of data and places the data into the buffer specified by rdbuf The operation terminates normally when cnt bytes have been received or END is received The operation terminates with an error if the transfer could not complete within the timeout period The actual number of bytes transferred is returned in the global variable ibcnt1 Board Level If ud is a board descriptor ibrd reads up to cnt bytes of data from a GPIB device and places it into the buffer specified by rdbuf A board level ibrd assumes that the GPIB is already properly addressed The operation terminates normally when cnt bytes have been received or END is received The operation terminates with an error if the transfer could not complete within the timeout period or if the board is not the CIC the CIC sends a Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcnt1 National Instruments Corp 1 75 NI 488 2 FRM for DOS Windows NI 488 Functions IBRD Chapter 1 Board Level IBRD Device Level Continued Possible Errors EABO EADR EBUS ECIC EDVR ENEB EOIP Either cnt bytes or END was not received within the timeout period or a Device Clear message was received after the read operation began Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level
97. ctions Chapter 1 IBASK Board Level IBASK Device Level Continued Input ud Board or device unit descriptor option Selects the configuration item whose value is being returned Output value Current value of the selected configuration item Function Return The value of ibsta Description ibask returns the current value of various configuration parameters for the specified board or device The current value of the selected configuration item is returned in the integer specified by value Table 1 3 and Table 1 4 list the valid configuration parameter options for ibask Possible Errors EARG option is not a valid configuration parameter See the ibask options listed in Table 1 3 and Table 1 4 ECAP option is not supported by the driver in its current configuration EDVR Either ud is invalid or the NI 488 2 driver is not installed NI 488 2 FRM for DOS Windows 1 6 National Instruments Corp Chapter 1 IBASK Board Level Device Level NI 488 Functions IBASK Continued Table 1 3 lists the options you can use with ibask when ud is a board descriptor or a board index The following is an alphabetical list of the option constants included in Table 1 3 National Instruments Corp Constants IbaAUTOPOLL IbaCICPROT IbaDMA IbaEndBitIsNormal IbaEOSchar IbaEOScmp IbaEOSrd IbaEOSwrt IbaEOT IbaEventQueue IbaHSCableLength IbaIRQ Ibalst IbaPAD Values 0x0007 0x0008 0x0012 0x001A 0x000F 0x
98. d char udname Visual Basic CALL ibfind udname ud or ud ilfind udname Direct Entry with C DLLibfind char _far udname int _far ibsta int _far iberr long _far ibcntl Direct Entry with Visual Basic Declare Function DLLibfind Lib gpib dll ByVal udname ibsta iberr ibcntl amp As Integer National Instruments Corp 1 51 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBFIND Board Level IBFIND Device Level Continued Input udname A user configured device or board name Output Function Return The board or device descriptor Description ibfind is used to acquire a descriptor for a board or user configured device this board or device descriptor can be used in subsequent NI 488 functions ibfind performs the equivalent of an ibonl 1 to initialize the board or device descriptor The unit descriptor returned by ibfind remains valid until the board or device is put offline using ibonl 0 If ibfindis unable to get a valid descriptor a 1 is returned the ERR bit is set in ibsta and iberr contains EDVR Note Using ibfindto obtain device descriptors is useful only for compatibility with existing applications New applications should use ibdev instead of ibfind ibdevis more flexible easier to use and frees the application from unnecessary device name requirements Possible Errors EBUS Device level There are no devices connected to the GPIB ECIC Device level The access board
99. d 2 13 Jenine l S ia EEEE E P 2 15 Find ROS a D A 2 18 erae ri O EE E E AE 2 20 GenerateREQT s atc E E E T ee 2 22 GoToMultAddt ites at anes ES a teet been etate a a 2 24 PassGonttol gne nonne deeem eben ae e sees Seba stele E 2 33 PP OMe or eet ee mese dein Vhs aN ond Mee feted lease kM gs Se 2 35 PPollConfig iet hi eere nte ete e eit rm m ee o ens 2 37 PPollUnconfig roe eo etae anie teda ett eden 2 39 RGVRESPMS8 MT coset cotecdy esa teeds petseeessuetech ost ee ER RAE 2 41 ReadStatusByte eia dco kaa gne cei en 2 44 NI 488 2 FRM for DOS Windows vi National Instruments Corp Contents RECEIVE 2 46 Receive Setup a isc 8 sath bes chs choco rU RES RD ne em E Eo ERE avis ERE TR es 2 49 RESELSYS isa itenim dr d Gp E EP erro PED ERR a 2 51 SCI i 26688 ER 2 53 SendC mds bee rer E RE EMERGERE DS 2 56 SendD taBytes n rer ite te recien E e waves Ere re end 2 58 ST l l A eui etnia qe ERE RR TO EE REHAB REPRE 2 61 NIIS EE 2 63 Send LAs Oss steeped erp DA BH d mne eden teet ls 2 66 SendSetup soie rm Pe e e e cir 2 68 SetRWES ioheesshieemhhEpe regles dine e PO eee 2 70 TestS RO zitieren pe tie Oe Oe ass cere tones 2 72 POSES YS coe other eee ote sh ee cee e TE dens 2 74 TrIgget istis eie E Pr rH ER ERR Ru EH ERE DER DIRE EECREA 2 77 Trgeerbist 55 thal aid eA oe ettet ete Ae ana od 2 79 W AltS RO sars r Erea n peni A EO I EE eic SR etre 2
100. d Bus Management section in the NI 488 2 user manual EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress National Instruments Corp 1 85 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBRDIA Board Level IBRDIA Device Level Purpose Read integer data asynchronously from a device into a user buffer DOS Format C Not supported use ibrda QuickBASIC BASIC CALL ibrdia ud rdbuf cnt amp Or status ilrdia ud rdbuf cnt amp BASICA CALL ibrdia ud rdbuf 0 cnt Windows Format C Not supported use ibrda Visual Basic CALL ibrdia ud rdbuf cnt amp Or status ilrdia ud rdbuf cnt amp Direct Entry with C Not supported use ibrda NI 488 2 FRM for DOS Windows 1 86 National Instruments Corp Chapter 1 NI 488 Functions IBRDIA Board Level IBRDIA Device Level Continued Direct Entry with Visual Basic Declare Function DLLibrda Lib gpib dll ByVal ud rdbuf ByVal cnt amp ibsta iberr ibcntl amp As Integer Note For direct entry with Visual Basic the correct format is DLLibrd not DLLibrdia Input ud Board or device descriptor cnt Number of bytes to be read from the GPIB Output rdbuf Address of buffer into which integer data is read You can replace rdbuf with rdbuf to read long integer data Function R
101. dll ByVal boardID addrlist result ibsta iberr ibcntl amp NI 488 2 FRM for DOS Windows 2 18 National Instruments Corp Chapter 2 FindRQS NI 466 2 Routines FindRQS Continued Input boardID addrlist Output result Description The interface board number List of device addresses that is terminated by NOADDR Serial poll response byte of the device that is requesting service FindROS serial polls the devices described by addrlist in order until it finds a device which is requesting service The serial poll response byte is then placed in result ibcnt1 contains the index of the device requesting service in addrlist If none of the devices are requesting service then the index corresponding to NOADDR in addrlist is returned in ibcnt1 and ETAB is returned in iberr Possible Errors EARG EBUS ECIC EDVR ENEB EOIP ETAB An invalid address out of range appears in addrlist ibocentl is the index of the invalid address in the addrlist array No devices are connected to the GPIB boardID is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed boardID is not installed or is not properly configured Asynchronous I O is in progress None of the devices in addrlist are requesting service or addrlist contains only NOADDR ibcnt1 contains the index of NOADDR in addrlist National Instruments Corp 2 19
102. e You can replace wrtbuf with wrtbuf amp to send long integer data cnt Number of bytes to be written Output Function Return The value of ibsta Description Device Level If ud is a device descriptor ibwrtia addresses the GPIB and writes cnt bytes from the buffer pointed to by wrt buf to a GPIB device The operation terminates normally when cnt bytes have been sent The operation terminates with an error if cnt bytes could not be sent within the timeout period The actual number of bytes transferred is returned in the global variable ibcnt1 NI 488 2 FRM for DOS Windows 1 132 National Instruments Corp Chapter 1 NI 488 Functions IBWRTIA Board Level IBWRTIA Device Level Continued Board Level If ud is a board descriptor ibwrtia begins an asynchronous write of cnt bytes of data from the buffer pointed to by wrt buf to a GPIB device A board level ibwrtia assumes that the GPIB is already properly addressed The operation terminates normally when cnt bytes have been sent The operation terminates with an error if cnt bytes could not be sent within the timeout period or if the board is not CIC the CIC sends the Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcntl Board and Device Level The asynchronous I O calls ibcmda ibrda ibwrta are designed so that applications can perform other non GPIB operations while the I O is in progress Once the asynchronous
103. e EOI line is not asserted when the EOS character is sent during a write operation non zero The EOI line is asserted when the EOS character is sent during a write operation See ibeos zero A 7 bit compare is used for all EOS comparisons non zero An 8 bit compare is used for all EOS comparisons See ibeos continues 1 15 NI 488 2 FRM for DOS Windows NI 488 Functions IBASK Chapter 1 Board Level IBASK Device Level Continued Table 1 4 ibask Device Configuration Parameter Options Continued Options Constants Options Values Returned Information IbaEOSchar 0x000F The current EOS character of the device See ibeos 0x0013 0x0014 IbaSPollTime 0x0018 IbaReadAdjust IbaWriteAdjust IbaEndBitIsNormal IbaUnAddr 0x001A 0x001B 0 Read operations do not have pairs of bytes swapped 1 Read operations have each pair of bytes swapped 0 Write operations do not have pairs of bytes swapped 1 Write operations have each pair of bytes swapped The length of time the driver waits for a serial poll response when polling the device The length of time is represented by the ibtmo timing values zero The END bit of ibsta is set only when EOI or EOI plus the EOS character is received If the EOS character is received without EOI the END bit is not set non zero The END bit is set whenever EOI EOS or EOI plus EOS is received zero The GPIB commands Untalk UNT
104. e and makes the interface board talk active This call is usually followed by SendDataBytes to actually transfer data from the interface board to the devices SendSetup is particularly useful to set up the addressing before making multiple calls to SendDataBytes it eliminates the need to readdress the devices for every block of data Possible Errors EARG EBUS ECIC EDVR ENEB EOIP The addrlist is empty or an invalid address out of range appears in addrlist ibontlis the index of the invalid address in the addrlist array No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress National Instruments Corp 2 69 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 SetRWLS SetRWLS Purpose Place devices in Remote With Lockout State DOS Format C void SetRWLS int boardID Addr4882 t addrlist QuickBASIC BASIC CALL SetRWLS boardID addrlist BASICA CALL SetRWLS boardID addrlist 0 Windows Format C void SetRWLS int boardID Addr4882 t addrlist Visual Basic CALL SetRWLS boardID addrlist Direct Entry with C DLLSetRWLS int boardID Addr4882 t far addrlist int far ibsta int far iberr long far ibcntl Direct Entry with
105. e function 2 27 GPIB address functions routines GotoMultAddr routine 2 24 to 2 32 ibpad 1 67 to 1 68 ibsad 1 99 to 1 100 I ibask function 1 7 to 1 16 Index board configuration parameter options table 1 10 to 1 13 description 1 7 to 1 8 device configuration parameter options table 1 15 to 1 16 option constants board configuration parameters 1 9 device configuration parameters 1 14 ibbna function 1 17 to 1 18 ibcac function 1 19 to 1 20 ibclr function 1 21 to 1 22 ibcmd function 1 23 to 1 24 National Instruments Corp NI 488 2 FRM for DOS Windows Index ibemda function 1 25 to 1 27 ibconfig function 1 28 to 1 37 board configuration parameter options table 1 31 to 1 34 description 1 28 to 1 29 device configuration parameter options table 1 35 to 1 37 option constants board configuration parameters 1 30 device configuration parameters 1 35 ibdev function 1 38 to 1 40 ibdma function 1 41 to 1 42 ibeos function 1 43 to 1 45 ibeot function 1 46 to 1 47 ibevent function 1 48 to 1 50 ibfind function 1 51 to 1 52 ibgts function 1 53 to 1 54 ibist function 1 55 to 1 56 iblines function 1 57 to 1 59 ibln function 1 60 to 1 62 ibloc function 1 63 to 1 64 ibonl function 1 65 to 1 66 ibpad function 1 67 to 1 68 ibpct function 1 69 to 1 70 ibppc function 1 71 to 1 73 ibrd function 1 74 to 1 76 ibrda function 1 77 to 1 79 ibrdf function 1 80 to 1 82 ibrdi function 1 83 to
106. e interface include file addr is the 5 bit GPIB address that is currently present on the bus This function should return a non zero value to accept the given address It should return Zero to reject the address NI 488 2 FRM for DOS Windows 2 26 National Instruments Corp Chapter 2 NI 488 2 Routines GotoMultAddr GotoMultAddr Continued Serial Poll Response Function The driver calls the serial poll response function when the interface board is serial polled by the GPIB Controller In Charge The driver passes the GPIB address of the device being polled to this function This function should return an 8 bit serial poll response byte which is sent to the Controller If the simulated device is requesting service through the use of the Generat eREQT function at the time of the poll the driver sets the Request Service RSV bit to 1 before sending the response byte to the Controller Before the application calls the serial poll response function it calls the address selection function with type set to MultAddrSerialPoll Because the address selection function is called first it can return zero to reject the address This prevents the driver from calling the serial poll response function Here is the function prototype of the serial poll response function unsigned short far loadds spollfunc short board unsigned short addr boardis the index of the interface board on which the GPIB address is present addr is the 5 bit GP
107. e the GPIB board become Controller In Charge on the GPIB e Use ibrsc 1 to make sure your GPIB board is configured as System Controller e In multiple CIC situations always be certain that the CIC bit appears in the status word ibsta before attempting these calls If it does not appear you can perform an ibwait for CIC call to delay further processing until control is passed to the board ENOL 2 ENOL usually occurs when a write operation is attempted with no Listeners addressed For a device write this error indicates that the GPIB address configured for that device in the software does not match the GPIB address of any device connected to the bus that the GPIB cable is not connected to the device or that the device is not powered on ENOL can also occur in situations in which the GPIB board is not the CIC and the Controller asserts ATN before the write call in progress has ended National Instruments Corp C 3 NI 488 2 FRM for DOS Windows Error Codes and Solutions Appendix C Solutions Make sure that the GPIB address of your device matches the GPIB address of the device to which you want to write data e If you are not using device level calls make sure that your device is properly addressed to listen before writing to it by using ibcmd or SendSetup Use the appropriate hex code in ibcmd to address your device Check your cable connections and make sure at least two thirds of your devices are powered on f
108. ed Description SendIFC is used as part of GPIB initialization It forces the interface board to be Controller In Charge of the GPIB It also ensures that the connected devices are all unaddressed and that the interface functions of the devices are in their idle states Possible Errors EDVR ENEB EOIP ESAC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress The interface board is not configured as the System Controller see ibrsc NI 488 2 FRM for DOS Windows 2 62 National Instruments Corp Chapter 2 NI 488 2 Routines SendList Send List Purpose Send data bytes to multiple GPIB devices DOS Format C void SendList int boardID Addr4882 t addrlist void buffer long datacnt int eotmode QuickBASIC BASIC CALL SendList boardID addrlist buffer eotmodes BASICA CALL SendList boardID addrlist 0 buffer eotmode Windows Format C void SendList int boardID Addr4882 t addrlist void buffer long datacnt int eotmode Visual Basic CALL SendList boardID addrlist buffer eotmodes Direct Entry with C DLLSendList int boardID Addr4882 t far addrlist void far buffer long datacnt int eotmode int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLSendList Lib gpib dll By
109. ed Any calls that would interfere with the I O in progress are not allowed the driver returns EOIP in this case Once the I O is complete the application must resynchronize with the NI 488 2 driver Resynchronization is accomplished by using one of the following three functions ibwait If the returned ibsta mask has the CMPL bit set then the driver and application are resynchronized ibstop The I O is canceled the driver and application are resynchronized ibonl The I O is canceled and the interface is reset the driver and application are resynchronized Possible Errors EABO Board level a Device Clear message was received from the CIC EADR Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad EBUS Device level No devices are connected to the GPIB ECIC Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress National Instruments Corp 1 79 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBRDF Board Level IBRDF Device Level Purpose Read data from a device into a file DOS Format
110. ed short type unsigned short addr if addr 1 addr 3 addr 24 addr 30 If the device is to be serial polled then accept the address so that the spollfunc can be called to return the serial poll response byte NI 488 2 FRM for DOS Windows 2 28 National Instruments Corp Chapter 2 GotoMultAddr NI 466 2 Routines GotoMultAddr Continued if type MultAddrSerialPoll return TRUE If this is a listen address then set the global addressed to TRUE and store the listen address in the global address else if type MultAddrListen addressed TRUE address LAD addr return TRUE If this is a talk address then set the global addressed to TRUE and store the talk address in the global address s else if type MultAddrTalk addressed TRUE address TAD addr return TRUE Return FAL r since you do not claim this address return FALSI E end of addrfunc The following function implements the Serial Poll Response call back function It always returns the GPIB address of the ur unsigned short return addr National Instrume simulated devic _far _loadds spollfunc as the serial poll response byte short board unsigned short addr 10x40 nts Corp 2 29 NI 488 2 FRM for DOS Windows NI 488
111. ents Corp Chapter 2 NI 488 2 Routines Receive Receive Continued Input boardID The interface board number address Address of a device from which to receive data cnt Number of bytes to read termination Description of the data termination mode STOPend or an EOS character Output buffer Stores the received data bytes Description Receive addresses the device described by address to talk and the interface board to listen Then up to cnt bytes are read and placed into the buffer Data bytes are read until either cnt bytes have been read or the termination condition is detected If the termination condition is STOPend the read is stopped when a byte is received with the EOI line asserted Otherwise the read is stopped when the 8 bit EOS character is detected The actual number of bytes transferred is returned in the global variable ibentl National Instruments Corp 2 47 NI 488 2 FRM for DOS Windows NI 488 2 Routines Receive Chapter 2 Receive Continued Possible Errors EABO EARG EBUS ECIC EDVR ENEB EOIP The I O timeout period elapsed before all the bytes were received The address or termination parameter is invalid out of range or address is NOADDR No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is
112. er eotmodes Direct Entry with C DLLSendDataBytes int boardID void far buffer long datacnt int eotmode int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLSendDataBytes Lib gpib dll ByVal boardID ByVal buffer ByVal datacnt amp ByVal eotmode ibsta iberr ibontl amp NI 488 2 FRM for DOS Windows 2 56 National Instruments Corp Chapter 2 NI 488 2 Routines SendDataBytes SendDataBytes Continued Input boardID The interface board number buffer The data bytes to be sent datacnt Number of bytes to be sent eotmode The data termination mode DABend NULLend or NLend Description SendDataBytes sends datacnt number of bytes from the buffer to devices which are already addressed to listen The last byte is sent with the EOI line asserted if otmode is DABend the last byte is sent without the EOI line asserted if eot mode is NULLend If eotmode is NLend then a new line character Nn is sent with the EOI line asserted after the last byte The actual number of bytes transferred is returned in the global variable ibcntl SendDataBytes assumes that the interface board is in talk active state and that devices are already addressed as Listeners on the GPIB see SendSetup Send or SendList National Instruments Corp 2 59 NI 488 2 FRM for DOS Windows NI 488 2 Routines SendDataBytes Chapter 2 SendDataBytes Continued Possible E
113. er or when another Controller passes control to the GPIB board CIC is cleared whenever the GPIB board detects Interface Clear IFC from the System Controller or when the GPIB board passes control to another device ATN brd ATN indicates the state of the GPIB Attention ATN line ATN is set whenever the GPIB ATN line is asserted and it is cleared when the ATN line is unasserted TACS brd TACS indicates whether the GPIB board is addressed as a Talker TACS is set whenever the GPIB board detects that its talk address and secondary address if enabled has been sent either by the GPIB board itself or by another Controller TACS is cleared whenever the GPIB board detects the Untalk UNT command its own listen address a talk address other than its own talk address or Interface Clear IFC NI 488 2 FRM for DOS Windows B 4 National Instruments Corp Appendix B Status Word Conditions LACS brd LACS indicates whether the GPIB board is addressed as a Listener LACS is set whenever the GPIB board detects that its listen address and secondary address if enabled has been sent either by the GPIB board itself or by another Controller LACS is also set whenever the GPIB board shadow handshakes as a result of the ibgts function LACS is cleared whenever the GPIB board detects the Unlisten UNL command its own talk address Interface Clear IFC or that the ibgts function has been called without shadow handshake DTAS brd DTA
114. eturn The value of ibsta Description Device Level If ud is a device descriptor ibrdia addresses the GPIB begins an asynchronous read of up to cnt bytes of data from a GPIB device and places the data into the memory location specified by rdbuf The operation terminates normally when cnt bytes have been received or END is received The operation terminates with an error if the transfer could not complete within the timeout period The actual number of bytes transferred is returned in the global variable ibcnt1 National Instruments Corp 1 87 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBRDIA Board Level IBRDIA Device Level Continued Board Level If ud is a board descriptor ibrdia reads up to cnt bytes of data from a GPIB device and places the data into the buffer specified by rdbuf A board level ibrdia assumes that the GPIB is already properly addressed The operation terminates normally when cnt bytes have been received or END is received The operation terminates with an error if the transfer could not complete within the timeout period or if the board is not the CIC the CIC sends a Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcntl Board and Device Level The asynchronous I O calls ibcmda ibrda ibwrta are designed so that applications can perform other non GPIB operations while the I O is in progress Once the asynchronous I O has begun
115. eturned from ibevent call ibevent more often to empty the queue National Instruments Corp C 9 NI 488 2 FRM for DOS Windows Appendix D Customer Communication For your convenience this appendix contains forms to help you gather the information necessary to help us solve technical problems you might have as well as a form you can use to comment on the product documentation Filling out a copy of the Technical Support Form before contacting National Instruments helps us help you better and faster National Instruments provides comprehensive technical assistance around the world In the U S and Canada applications engineers are available Monday through Friday from 8 00 a m to 6 00 p m central time In other countries contact the nearest branch office You may fax questions to us at any time Corporate Headquarters 512 795 8248 Technical Support Fax 512 794 5678 Branch Offices Australia Austria Belgium Canada Ontario Canada Quebec Denmark Finland France Germany Hong Kong Israel Italy Japan Korea Mexico Netherlands Norway Singapore Spain Sweden Switzerland Taiwan U K Phone Number 03 9879 5166 0662 45 79 90 0 02 757 00 20 905 785 0085 514 694 8521 45 76 26 00 90 527 2321 01 48 14 24 24 089 741 31 30 2645 3186 03 5734815 02 413091 03 5472 2970 02 596 7456 95 800 010 0793 0348 433466 32 84 84 00 2265886 91 640 0085 08 730 49 70 056 200 51 51 02 377 1200 01635 523545
116. evice addresses that is terminated by NOADDR Description EnableLocal sends the Go To Local GTL GPIB message to all the devices described by addrlist This places the devices in local mode If addrlist contains only the constant NOADDR then the Remote Enable REN GPIB line is unasserted Possible Errors EARG EBUS ECIC EDVR ENEB EOIP ESAC An invalid address out of range appears in addrlist ibcnt1 is the index of the invalid address in the addrlist array No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress The interface board is not configured as System Controller NI 488 2 FRM for DOS Windows 2 12 National Instruments Corp Chapter 2 NI 488 2 Routines EnableRemote EnableRemote Purpose Enable remote GPIB programming for devices DOS Format C void EnableRemote QuickBASIC BASIC CALL EnableRemote BASICA CALL EnableRemote Windows Format C void EnableRemote Visual Basic CALL EnableRemote Direct Entry with C int boardID Addr4882 t addrlist boardID addrlist boardID addrlist 0 int boardID Addr4882 t addrlist boardID addrlist DLLEnableRemote int boardID Addr4882 t far add
117. further GPIB calls are strictly limited Any calls that would interfere with the I O in progress are not allowed the driver returns EOIP in this case Once the I O is complete the application must resynchronize with the NI 488 2 driver Resynchronization is accomplished by using one of the following three functions ibwait If the returned ibsta mask has the CMPL bit set then the driver and application are resynchronized ibstop The I O is canceled the driver and application are resynchronized ibonl The I O is canceled and the interface is reset the driver and application are resynchronized Note The cnt parameter specifies the number of bytes to transfer For example if you want to transfer 16 integers the number of bytes is 16 2 32 NI 488 2 FRM for DOS Windows 1 88 National Instruments Corp Chapter 1 IBRDIA NI 488 Functions Board Level IBRDIA Device Level Continued Possible Errors EABO EADR EBUS ECIC EDVR ENEB EOIP Board level a Device Clear message was received from the CIC Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad Device level No devices are connected to the GPIB Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud
118. h function call this global variable status word contains status information Institute of Electrical and Electronic Engineers A broadcast message sent from the Controller to all devices and used to manage the GPIB In the context of this manual the transmission of commands or messages between the computer via the GPIB board and other devices on the GPIB Glossary 4 National Instruments Corp T O address KB L LAD Listen Address language interface listen address Listener low level function M MAV MB memory resident National Instruments Corp Glossary The address of the GPIB board from the point of view of the CPU as opposed to the GPIB address of the GPIB board Also called port address or board address An Individual Status bit of the status byte used in the Parallel Poll Configure function Kilobytes See MLA Code that enables an application program that uses NI 488 functions or NI 488 2 routines to access the driver See MLA A GPIB device that receives data messages from a Talker See board level function Meters The Message Available bit is part of the IEEE 488 2 defined status byte which is received from a device responding to a serial poll Megabytes of memory Resident in RAM Glossary 5 NI 488 2 FRM for DOS Windows Glossary MLA My Listen Address MSA My Secondary Address MTA My Talk Address multitasking N NDAC Not Data Accepted
119. hapter 1 IBASK NI 488 Functions Board Level IBASK Device Level Continued Table 1 3 ibask Board Configuration Parameter Options Continued Options Constants IbaPPollTime IbaEndBitIsNormal IbaHSCableLength Options Values 0x0019 0x001F 0x0020 0x0021 National Instruments Corp Returned Information 0 The board uses the standard duration 2 us when conducting a parallel poll 1 to 17 The board uses a variable length duration when conducting a parallel poll The duration values correspond to the ibtmo timing values zero The END bit of ibsta is set only when EOI or EOI plus the EOS character is received If the EOS character is received without EOI the END bit is not set non zero The END bit is set whenever EOI EOS or EOI plus EOS is received 0 High speed data transfer HS488 is disabled 1 to 15 High speed data transfer HS488 is enabled The number returned represents the number of meters of GPIB cable in your system See the NI 488 2 user manual for information about high speed data transfers HS488 The individual status ist bit of the board The current serial poll status byte of the board 1 13 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBASK Board Level IBASK Device Level Continued Table 1 4 lists the options you can use with ibask when ud is a device descriptor or a device index The following is an alphabetical list of the o
120. hedriver gpib d11 is not installed The driver configuration file gpib ini is not located in the windows directory In this case the variable ibcnt 1 contains the value 1 e The driver file gpib iniisinthe windows directory but not compatible with the driver file goib d11 that you are using In this case the variable ibcnt1l contains a negative value other than 1 Solutions Use ibdev to open a device without specifying its symbolic name Useonly device or board names that are configured in the GPIB software configuration utility as parameters to the ibfind function NI 488 2 FRM for DOS Windows C 2 National Instruments Corp Appendix C Error Codes and Solutions Use the unit descriptor returned from ibfind as the first parameter in subsequent NI 488 functions Examine the variable before the failing function to make sure the function has not been corrupted e Make sure the NI 488 2 driver is installed by checking that gpib d11 and gpib ini are in the windows directory usually c windows ECIC 1 ECIC is returned when one of the following board functions or routines is called while the board is not CIC Any device level NI 488 functions that affect the GPIB Any board level NI 488 functions that issue GPIB command bytes such as ibcmd ibcmda ibln ibrpp ibcac ibgts Any of the NI 488 2 routines that issue GPIB command bytes such as SendCmds PPoll Send Receive Solutions Use ibsic or SendIFC to mak
121. ific device to be polled That device must also be addressed to talk See SPD The GPIB line that a device asserts to notify the CIC that the device needs servicing The IEEE 488 2 defined data byte sent by a device when it is serially polled See ibsta Refers to the relationship between the NI 488 2 driver functions and a process when executing driver functions is predictable the process is blocked until the driver completes the function The single designated Controller that can assert control become CIC of the GPIB by sending the Interface Clear IFC message Other devices can become CIC only by having control passed to them See MTA A GPIB device that sends data messages to Listeners Take Control is the GPIB command used to pass control of the bus from the current Controller to an addressed Talker A feature of the NI 488 2 driver that prevents I O functions from hanging indefinitely when there is a problem on the GPIB An integrated circuit that implements most of the GPIB Talker Listener and Controller functions in hardware Glossary 8 National Instruments Corp Glossary U ud unit descriptor A variable name and first argument of each function call that contains the unit descriptor of the GPIB interface board or other GPIB device that is the object of the function UNL Unlisten is the GPIB command used to unaddress any active Listeners UNT Untalk is the GPIB command used to unaddress an active T
122. ified device in remote program mode ibloc is used to move devices temporarily from a remote program mode to a local mode until the next device function is executed on that device Possible Errors EBUS Device level No devices are connected to the GPIB ECIC Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 64 National Instruments Corp Chapter 1 NI 488 Functions IBONL Board Level IBONL Device Level Purpose Place the device or interface board online or offline DOS Format C int ibonl int ud int v QuickBASIC BASIC CALL ibonl ud v or status ilonl ud v BASICA CALL ibonl ud v Windows Format C int ibonl int ud int v Visual Basic o CALL ibonl ud v or status ilonl ud v oe Direct Entry with C DLLibonl int ud int v int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibonl Lib gpib dll ByVal ud ByVal v ibsta iberr ibcntl amp As Integer National Instruments Corp 1 65 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBONL Board Level IBONL Device Level Continued Input ud Board or device descri
123. illines ud clines Direct Entry with C DLLiblines int ud short far clines int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLiblines Lib gpib dll ByVal ud clines ibsta iberr ibcntl amp As Integer National Instruments Corp 1 57 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBLINES Board Level IBLINES Continued Input ud Board descriptor Output clines Returns GPIB control line state information Function Return The value of ibsta Description iblines returns the state of the GPIB control lines in clines The low order byte bits 0 through 7 of c1ines contains a mask indicating the capability of the GPIB interface board to sense the status of each GPIB control line The upper byte bits 8 through 15 contains the GPIB control line state information The following is a pattern of each byte frases ees Sees To determine if a GPIB control line is asserted first check the appropriate bit in the lower byte to determine if the line can be monitored If the line can be monitored indicated by a 1 in the appropriate bit position then check the corresponding bit in the upper byte If the bit is set 1 the corresponding control line is asserted If the bit is clear 0 the control line is unasserted Example short lines iblines ud amp lines if lines amp ValidREN check to see if REN is asserted if lines am
124. ion of the GotoMultAddr routine Possible Errors EARG GP IBaddr is an invalid 5 bit GPIB address See Got oMultAddr for a description of valid 5 bit GPIB addresses EDVR Either board ID is invalid out of range or the NI 488 2 driver is not installed ENEB board ID is not installed or is not properly configured EOIP Asynchronous I O is in progress National Instruments Corp 2 21 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 GenerateREQT GenerateREQT Purpose Request service from the GPIB Controller In Charge DOS Format C void GenerateREQT int boardID unsigned short GPIBaddr QuickBASIC BASIC Not supported BASICA Not supported Windows Format C void GenerateREQT int boardID unsigned short GPIBaddr Visual Basic Not supported Direct Entry with C DLLGenerateREQT int boardID unsigned short GPIBaddr int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Not supported NI 488 2 FRM for DOS Windows 2 22 National Instruments Corp Chapter 2 NI 488 2 Routines GenerateREQT GenerateREQT Continued Input boardID The interface board number GPIBaddr The 5 bit GPIB address of the simulated device that is requesting service Description The driver keeps track of the simulated devices currently requesting service so that it knows when to assert and unassert the SRQ bus line Use GenerateREQT when the simulated device a
125. ions of National Instruments products involving medical or clinical treatment can create a potential for accidental injury caused by product failure or by errors on the part of the user or application designer Any use or application of National Instruments products for or involving medical or clinical treatment must be performed by properly trained and qualified medical personnel and all traditional medical safeguards equipment and procedures that are appropriate in the particular situation to prevent serious injury or death should always continue to be used when National Instruments products are being used National Instruments products are NOT intended to be a substitute for any form of established process procedure or equipment used to monitor or safeguard human health and safety in medical or clinical treatment Contents About This Manual sese tene ix How to Use This Manual Set eee 1X Organization of This Manual seen X Conventions Used in This Manual eee nnne xi Related Documentation 5 peer teezr rr ertt rr EI ee ere ee RENE ee Te eut xii Customer Communication eeseeceeeeeeeeeeeeeeeeee eene ee nennen nemen ener nenne xii Chapter 1 NIS488 Functions eene eR b 1 1 Function Names 4 eie ee kc ee aeree EE ede 1 1 lup EE 1 1 DOS FOEFmIn at e En cetero eerte re E A budbevt eto E 1 1 Windows Format eeeseeeeeeeeeeeee n I nennen ne
126. ither ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress ESAC Board does not have System Controller capability NI 488 2 FRM for DOS Windows 1 104 National Instruments Corp Chapter 1 NI 488 Functions IBSRQ Board Level IBSRQ Purpose Request an SRQ interrupt routine DOS Format C void ibsrq void far funcname void QuickBASIC BASIC Not supported see Chapter 7 GPIB Programming Techniques in the NI 488 2 User Manual for DOS for information about ON SRQ capability BASICA Not supported see Chapter 7 GPIB Programming Techniques in the NI 488 2 User Manual for DOS for information about ON SRQ capability Windows Format Not supported Input funcname C interrupt handling routine Description ibsrq establishes a call to the C routine funcname whenever the SRQI bit is set in the status word ibsta If SRQI is set the language interface calls funcname before returning to the application program If ibsrq is called with funcname equal to NULL SRQ servicing is turned off Note You must disable automatic serial polling with ipconfig option IbcAUTOPOLL before using this function Also device level calls should not be used when ibsrqis in effect Device level calls mask the SRQI bit preventing funcname from being called National Instruments Corp 1 105 NI 488 2 FRM for DOS Windows
127. l boardID ByVal buffer ByVal cnt amp ByVal termination ibsta iberr ibcntl amp National Instruments Corp 2 41 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 RcvRespMsg RcvRespMsg Continued Input boardID The interface board number cnt Number of bytes read termination Description of the data termination mode STOPend or an 8 bit EOS character Output buffer Stores the received data bytes Description RcvRespMsg reads up to cnt bytes from the GPIB and places these bytes into buffer Data bytes are read until either cnt data bytes have been read or the termination condition is detected If the termination condition is STOPend the read is stopped when a byte is received with the EOI line asserted Otherwise the read is stopped when the 8 bit EOS character is detected The actual number of bytes transferred is returned in the global variable ibcnt1l RcvRespMsg assumes that the interface board is already in listen active state and a device is already addressed to be a Talker see ReceiveSetup or Receive NI 488 2 FRM for DOS Windows 2 42 National Instruments Corp Chapter 2 RcvRespMsg NI 466 2 Routines RcvRespMsg Continued Possible Errors EABO EADR EARG ECIC EDVR ENEB EOIP The I O timeout period elapsed before all the bytes were received The interface board is not in the listen active state use ReceiveSetup to address the GPIB properly The ter
128. le Errors Each routine description includes a list of errors that could occur when the routine is invoked List of NI 488 2 Routines The following table contains an alphabetical list of each NI 488 2 routine Table 2 1 List of NI 488 2 Routines Routine repe EnableLocal Enable operations from the front panel of devices leave remote programming mode Sais oe ZI CSS sree Eau eee E E pom eels SR ISENEPUES a Listener in preparation for RcvRespMsg a continues National Instruments Corp 2 3 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 Table 2 1 List of NI 488 2 Routines Continued Rowe Purpose 0 SendSetup Set up devices to receive data in preparation for SendDataBytes Place devices in remote with lockout state Determine the current state of the GPIB Service Request SRQ line Cause the IEEE 488 2 compliant devices to conduct self tests Trigger multiple devices Wait until a device asserts the GPIB Service Request SRQ line NI 488 2 FRM for DOS Windows 2 4 National Instruments Corp Chapter 2 NI 488 2 Routines AllSpoll AllSpoll Purpose Serial poll all devices DOS Format C void AllSpoll int boardID Addr4882 t addrlist short resultlist QuickBASIC BASIC CALL AllSpoll boardID addrlist resultlist BASICA CALL AllSpoll boardID addrlist 0 resultlist 0 Windows Format C void AllSpoll int bo
129. led or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 6 National Instruments Corp Chapter 2 NI 488 2 Routines DevClear DevClear Purpose Clear a single device DOS Format C void DevClear int boardID Addr4882 t address BASICA QuickBASIC BASIC CALL DevClear boardID address Windows Format C void DevClear int boardID Addr4882 t address Visual Basic CALL DevClear boardID address Direct Entry with C DLLDevClear int boardID Addr4882 t address int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLDevClear Lib gpib dll ByVal boardID ByVal address ibsta iberr ibcntl amp Input boardID The interface board number address Address of the device you want to clear National Instruments Corp 2 7 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 DevClear DevClear Continued Description DevClear sends the Selected Device Clear SDC GPIB message to the device described by address If address is the constant NOADDR then the Universal Device Clear DCL message is sent to all devices Possible Errors EARG EBUS ECIC EDVR ENEB EOIP An address parameter is invalid out of range No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed
130. ler Ensure that your code and data segments are fixed in memory if your application is written for Microsoft Windows 3 You can do this in the module definition file of your application The Address Selection Function The driver calls the address selection function whenever a primary or secondary GPIB address is present on the bus The driver passes the GPIB address to the function The function determines whether to accept or reject the given address If the function accepts the address the interface board uses the given GPIB address The application program can then read from or write to the bus as if it were the device at the given GPIB address Here is the function prototype of the address selection function unsigned short far loadds addrfunc short board unsigned short type unsigned short addr The far directive tells the compiler to generate a far return when this function exits The 1oadds directive tells the compiler to load the Data Segment register with the default data segment of the application The function can now access the global variables of the application board is the index of the interface board on which the GPIB address is present t ype is the type of address that is present on the bus either a talk address a listen address or a talk address while the board is in Serial Poll Mode State These types are defined by the constants MultAddrListen MultAddrTalk and MultAddrSerialPoll which are defined in the languag
131. ller In Charge see SendIFC EDVR Either boardID is invalid out of range or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 56 National Instruments Corp Chapter 2 NI 488 2 Routines PPollUnconfig PPollUnconfig Purpose Unconfigure devices for parallel polls DOS Format C void PPollUnconfig QuickBASIC BASIC CALL PPollUnconfig BASICA CALL PPollUnconfig Windows Format C void PPollUnconfig Visual Basic CALL PPollUnconfig Direct Entry with C int boardID Addr4882 t addrlist boardID addrlist boardID addrlist 0 int boardID Addr4882_t addrlist boardID addrlist DLLPPollUnconfig int boardID Addr4882_t _far addrlist int _far ibsta int _far iberr long _far ibcntl Direct Entry with Visual Basic Declare Sub DLLPPollUnconfig Lib gpib dll ByVal boardID addrlist ibsta iberr ibcntl amp National Instruments Corp 2 39 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 PPollUnconfig PPollUnconfig Continued Input boardID The interface board number addrlist A list of device addresses that is terminated by NOADDR Description PPollUnconfig unconfigures all the devices described by addr1list for parallel polls If addrlist contains only the constant NOADDR then the Parallel Poll Unconfigure
132. ly configured National Instruments Corp 1 109 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBTMO Board Level IBTMO Device Level Continued Table 1 8 Timeout Code Values of v Timeout TNONE disabled no timeout NI 488 2 FRM for DOS Windows 1 110 National Instruments Corp Chapter 1 NI 488 Functions IBTRAP Board Level IBTRAP Purpose Change the trap and display modes of the GPIB Applications Monitor utility appmon DOS Format C void ibtrap int mask int mode QuickBASIC BASIC CALL ibtrap mask mode Or status iltrap mask mode BASICA CALL ibtrap mask mode Windows Format Not supported refer to Chapter 6 GPIB Spy in the NI 488 2 User Manual for Windows for information about the monitoring utility for Windows applications Input mask Trap bit mask mode Trap mode National Instruments Corp 1 111 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IB TRAP Board Level IBTRAP Continued Description mask specifies a bit mask with the same bit assignments as ibsta Each mask bit can be set to trap a call to the driver when the corresponding bit appears in the status word after the GPIB call If all the bits are set then every GPIB call is trapped Mode determines whether the recording and trapping occur The valid values of mode are as follows Mode Value Effect 1 Turn monitor off No recording or trapping occurs 2 Turn recording on
133. ly the value of ibsta Description The description section gives details about the purpose and effect of each function Examples Some function descriptions include sample code showing how to use the function For more detailed and complete examples refer to the example programs that are included with your NI 488 2 software The example programs are described in Chapter 2 of the NI 488 2 user manual Possible Errors Each function description includes a list of errors that could occur when the function is invoked NI 488 2 FRM for DOS Windows 1 2 National Instruments Corp Chapter 1 NI 488 Functions List of NI 488 Functions The following tables contain alphabetical lists of each NI 488 function along with its purpose Table 1 1 lists the device level functions Table 1 2 lists the board level functions Table 1 1 List of NI 488 Device Level Functions ibeos ibeot ibln ibloc ibonl ibpad ibpct Configure the end of string EOS termination mode or character the end of write I O operations continues National Instruments Corp 1 3 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 Table 1 1 List of NI 488 Device Level Functions Continued NI 488 2 FRM for DOS Windows 1 4 National Instruments Corp Chapter 1 NI 488 Functions Table 1 2 List of NI 488 Board Level Functions i ibeos ibeot bevent ibfind ibgts ibist iblines ibln ibloc ibonl ibpad
134. mination parameter is invalid It must be either STOPend or an 8 bit EOS character The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress National Instruments Corp 2 43 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 ReadStatusByte ReadStatusByte Purpose Serial poll a single device DOS Format C void ReadStatusByte int boardID Addr4882 t address short result BASICA QuickBASIC BASIC CALL ReadStatusByte boardID address result Windows Format C void ReadStatusByte int boardID Addr4882 t address short result Visual Basic CALL ReadStatusByte boardID address result Direct Entry with C DLLReadStatusByte int boardID Addr4882 t address short far result int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLReadStatusByte Lib gpib dll ByVal boardID ByVal address result ibsta iberr ibcntl NI 488 2 FRM for DOS Windows 2 44 National Instruments Corp Chapter 2 NI 488 2 Routines ReadStatusByte ReadStatusByte Continued Input boardID The interface board number address A device address Output result Serial poll response byte Description ReadStatusByte serial polls the device described by address
135. n eese serene nene n eere rennen nnn 1 2 Input and Output I erected ete eto eth Pe estes 1 2 D Scription oerte o er rp Pr gd E 1 2 Examples ERI 1 2 Possible Brrors uini actes ee Bee teret ele hx ee cinta 1 2 List of NI 488 Functions eeeeeeeeeeeeeeeeeene ene eene nneenee ener etre nnns 1 3 IBASK 35x envase e VN ERES a aaa 1 7 IBBNA eie etre rete ettet et eed 1 17 IBCA ra EER EE aan eu INI IS 1 19 IBCER 2555 ane cas cat NEA o M e es es 1 21 IBCMD moenia u EHE 1 23 IBCMDA 31 sr ne rna Er er AA 1 25 IBCONEIG icone tee e eee retire 1 28 1B cem 1 38 IBIOM A 4 oreet oe ct REE NE EEA E doe severed terre edes eere e esu 1 41 IBE OS Seius ne oo Md Pr fe ar Mr C Er 1 43 IBEQ E o ccs coh Stace EE EEA e tee Lee n Ef 1 46 IBEVENT nui a o 1 48 1053 oj D Tv 1 51 IBGEESs 5 ues eio ETE ade Nene a eh a A er EE eden 1 53 IBIS TA ueteris os sedo teni Mites shed E Bk dre ale eaten stan sak 1 55 IBEINBS nnoer etuer ete Un ee 1 57 IBIN sme ent Bele eH ne CI 1 60 TBD OG ao ettet ham eu eie ione E 1 63 iioc EN 1 65 IBPAD tr e d CIR dai 1 67 TBP Wea utens deed o esL tod tan E DEM te 1 69 IBPP eco eee Se cue eae ULLA NITE 1 71 IBRDA zx DUI nee uae nene ea 1 74 IBRDA 4 hee e eere a e eed 1 77 IBRIDESt uL AL ed n e 1 80 IBRIIE 2 xim EAR A E A ME 1 83 National Instruments Corp v NI 488 2 FRM for DOS Windows Contents dub 1 86 PRP inocente acetedeetudt editt 1 90 IBRSG
136. n of terms used in this manual including abbreviations acronyms metric prefixes mnemonics and symbols The ndex contains an alphabetical list of key terms and topics in this manual including the page where you can find each one NI 488 2 FRM for DOS Windows x National Instruments Corp About This Manual Conventions Used in This Manual The following conventions are used in this manual italic bold italic monospace IEEE 488 and IEEE 488 2 NI 488 2 software Italic text denotes emphasis a cross reference or an introduction to a key concept Bold italic text denotes a note caution or warning Text in this font denotes text or characters that are to be literally input from the keyboard sections of code programming examples and syntax examples This font is also used for the proper names of disk drives paths directories programs subprograms subroutines device names functions constants variables filenames and extensions and for statements and comments taken from program code Angle brackets enclose the name of a key on the keyboard for example lt PageDown gt IEEE 488 and IEEE 488 2 are used throughout this manual to refer to the ANSI IEEE Standard 488 1 1987 and the ANSI IEEE Standard 488 2 1992 respectively which define the GPIB The term NI 488 2 software is used throughout this manual to refer to the NI 488 2 software for DOS or Windows unless otherwise noted Abbreviations acro
137. n the gram must be addressed to talk or listen sting TRUE If the address is a listen address then read in data byte for the simulated device After reading in the bytes call GenerateREQT to request servic for the simulated device SimulatedAddress amp LAD TAD LAD printf Address d is listening n SimulatedAddress amp LAD Read a buffer for the given devic Ar RcvRespMsg 0 buffer unsigned long BUFSIZE STOPend if ibsta amp ERR printf Error from RcvRespMsg n ibonl 0 03 exit 1 Put a NULL byte at the end of the buffer and call printf to output the buffer to the screen xf buffer ibcntl 0 printf Received s for PAD d n buffer SimulatedAddress amp LAD National Instruments Corp 2 31 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 GotoMultAddr GotoMultAddr Continued Now assert SRQ to request service for the simulated device Ef GenerateREQT 0 SimulatedAddress amp LAD If the address is a talk address then output a buffer containing the GPIB address of the simulated device Then call GenerateREQF to cancel the servic request for the simulated device EJ else if SimulatedAddress amp LAD TAD TAD printf Address d talking n SimulatedAddress amp TAD sprintf buffer Data from GPIB address d
138. nal Instruments Corp Chapter 1 NI 488 Functions IBWRTF Board Level IBWRTF Device Level Purpose Write data to a device from a file DOS Format C int ibwrtf int ud char flname QuickBASIC BASIC CALL ibwrtf ud flname Or status ilwrtf ud flname BASICA CALL ibwrtf ud flname Windows Format C int ibwrtf int ud char flname Visual Basic CALL ibwrtf ud flname Or status ilwrtf ud flname Direct Entry with C DLLibwrtf int ud char far flname int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Function DLLibwrtf Lib gpib dll ByVal ud ByVal flname ibsta iberr ibcntl As Integer National Instruments Corp 1 125 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBWRTF Board Level IBWRTF Device Level Continued Input ud Board or device descriptor flname Name of file containing the data to be written Output Function Return The value of ibsta Description Device Level If ud is a device descriptor ibwrtf addresses the GPIB and writes all of the bytes in the file 1name to a GPIB device The operation terminates normally when all of the bytes have been sent The operation terminates with an error if all of the bytes could not be sent within the timeout period The actual number of bytes transferred is returned in the global variable ibcnt1l Board Level If udis a board descriptor ibwrtf wri
139. nctions requiring System Controller capability are subsequently allowed If no error occurs during the call then iberr contains the previous System Controller state of the board Possible Errors EARG EDVR ENEB EOIP ud is a valid descriptor but does not refer to a board Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress National Instruments Corp 1 93 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBRSP Device Level IBRSP Purpose Conduct a serial poll DOS Format C int ibrsp int ud char spr QuickBASIC BASIC CALL ibrsp ud spr Or status ilrsp ud spr BASICA CALL ibrsp ud spr Windows Format C int ibrsp int ud char spr Visual Basic CALL ibrsp ud spr Or status ilrsp ud spr Direct Entry with C DLLibrsp int ud char far spr int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibrsp Lib gpib dll ByVal ud spr ibsta iberr ibcntl amp As Integer NI 488 2 FRM for DOS Windows 1 94 National Instruments Corp Chapter 1 NI 488 Functions IBRSP Device Level IBRSP Continued Input ud Device descriptor Output spr Serial poll response byte Function Return Description The value of ibsta The ibrsp function is used to serial poll the device ud The serial poll response
140. nd or data bytes from one device to another Dynamic link library High speed data transfer between the GPIB board and memory that is not handled directly by the CPU Not available on some systems See programmed I O Device driver software installed within the operating system Glossary 2 National Instruments Corp E END or END message EOI EOS or EOS byte EOT ESB G GET Go To Local GPIB GPIB address GPIB board Group Executed Trigger GTL Glossary A message that signals the end of a data string END is sent by asserting the GPIB End or Identify EOI line with the last data byte A GPIB line that is used to signal either the last byte of a data message END or the parallel poll Identify IDY message A 7 or 8 bit end of string character that is sent as the last byte of a data message End of transmission The Event Status bit is part of the IEEE 488 2 defined status byte which is received from a device responding to a serial poll Group Execute Trigger is the GPIB command used to trigger a device or internal function of an addressed Listener See GTL General Purpose Interface Bus is the common name for the communications interface system defined in ANSI IEEE Standard 488 1 1987 and ANSI IEEE Standard 488 2 1987 The address of a device on the GPIB composed of a primary address MLA and MTA and an optional secondary address MSA The GPIB board has both a GPIB address and
141. ng far ibcntl Direct Entry with Visual Basic Declare Function DLLibist Lib gpib dll ByVal ud ByVal v ibsta iberr ibcntl amp As Integer National Instruments Corp 1 55 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBIST Board Level IBIST Continued Input ud Board descriptor v Indicates whether to set or clear the ist bit Output Function Return The value of ibsta Description ibist sets the interface board ist individual status bit according to v If v is zero the ist bitis cleared if v is non zero ist bitis set The previous value of the ist bit is returned in iberr For more information on parallel polling refer to the NI 488 2 user manual Possible Errors EARG ud is valid but does not refer to an interface board EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 56 National Instruments Corp Chapter 1 NI 488 Functions IBLINES Board Level IBLINES Purpose Return the status of the eight GPIB control lines DOS Format C int iblines int ud short clines QuickBASIC BASIC CALL iblines ud clines Or status illines ud clines BASICA CALL iblines ud clines Windows Format C int iblines int ud short clines Visual Basic CALL iblines ud clines Or status
142. normally when END is received The operation terminates with an error if the transfer could not complete within the timeout period or if the board is not the CIC the CIC sends a Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcntl National Instruments Corp 1 81 NI 488 2 FRM for DOS Windows NI 488 Functions IBRDF Chapter 1 Board Level IBRDF Device Level Continued Possible Errors EABO EADR EBUS ECIC EDVR EFSO ENEB EOIP Either cnt bytes or END was not received within the timeout period or ud is a board descriptor and Device Clear was received after the read operation began Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad Device level No devices are connected to the GPIB Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed ibrdf could not access 1name The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 82 National Instruments Corp Chapter 1 NI 488 Functions IBRDI Board Level IBRDI Device Level Purpose Read data from a device into a u
143. not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress National Instruments Corp 1 91 NI 488 2 FRM for DOS Windows NI 488 Functions IBRS C Board Level Chapter 1 IBRSC Purpose Request or release system control DOS Format C int ibrsc int ud int v QuickBASIC BASIC CALL ibrsc ud v Or BASICA CALL ibrsc ud v Windows Format C int 1brsc int ud int v Visual Basic CALL ibrsc ud v Or Direct Entry with C ilrsc ud v DLLibrsc int ud int v int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibrsc Lib ByVal ud ByVal v Integer NI 488 2 FRM for DOS Windows gpib dll iberr ibcntl amp As National Instruments Corp Chapter 1 IBRSC NI 488 Functions Board Level IBRSC Continued Input ud Output Function Return Description Board descriptor Determines if system control is to be requested or released The value of ibsta ibrsc requests or releases the capability to send Interface Clear IFC and Remote Enable REN messages to devices If v is zero the board releases system control and functions requiring System Controller capability are not allowed If v is non zero fu
144. not possible because the GPIB SRQ line is stuck on This situation can be caused by the following events Usually a device unknown to the software is asserting SRQ Because the software does not know of this device it can never serial poll the device and unassert SRQ A GPIB bus tester or similar equipment might be forcing the SRQ line to be asserted A cable problem might exist involving the SRQ line Although the occurrence of ESRQ warns you of a definite GPIB problem it does not affect GPIB operations except that you cannot depend on the RQS bit while the condition lasts Solutions Check to see if other devices not used by your application are asserting SRQ Disconnect them from the GPIB if necessary ETAB 20 ETAB occurs only during the FindLstn FindRQS and ibevent functions ETAB indicates that there was some problem with a table used by these functions In the case of FindLstn ETAB means that the given table did not have enough room to hold all the addresses of the Listeners found In the case of FindRQS ETAB means that none of the devices in the given table were requesting service In the case of ibevent ETAB means the event queue overflowed and event information was lost Solutions In the case of FindLstn increase the size of result arrays In the case of FindRQS check to see if other devices not used by your application are asserting SRQ Disconnect them from the GPIB if necessary In the case of ETAB r
145. ns immediately with the updated ibsta status word If TIMO is set in the wait mask ibwait returns when the timeout period has elapsed if one or more of the other specified events have not already occurred If TIMO is not set in the wait mask then the function waits indefinitely for one or more of the specified events to occur The ibwait mask bits are identical to the ibsta bits and they are described in Table 1 9 If ud is a device descriptor the only valid wait mask bits are TIMO END RQS and CMPL If ud is a board descriptor all wait mask bits are valid except for RQS You can configure the timeout period using the ibtmo function NI 488 2 FRM for DOS Windows 1 116 National Instruments Corp Chapter 1 IBWAIT NI 488 Functions Board Level IBWAIT Device Level Continued Possible Errors EARG EBUS ECIC EDVR ENEB ESRQ The bit set in mask is invalid Device level No devices are connected to the GPIB Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Device level If RQS is set in the wait mask then ESRQ indicates that the Stuck SRQ condition exists For more information on serial polling refer to the NI 488 2 user manual National Instruments Corp 1 117 NI 488 2 FRM for DOS Windows N
146. nt state of the GPIB Service Request SRQ line DOS Format C void TestSRQ int boardID short result BASICA QuickBASIC BASIC CALL TestSRQ boardID result Windows Format C void TestSRQ int boardID short result Visual Basic CALL TestSRQ boardID result Direct Entry with C DLLTestSRQ int boardID short far result int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLTestSRQ Lib gpib dll ByVal boardID result ibsta iberr ibcntl NI 488 2 FRM for DOS Windows 2 72 National Instruments Corp Chapter 2 NI 488 2 Routines TestSRQ TestSRQ Continued Input boardID The interface board number Output result State of the SRQ line non zero if the line is asserted zero if the line is not asserted Description TestSRQ returns the current state of the GPIB SRQ line in result If SRQ is asserted then result contains a non zero value Otherwise result contains a zero Use TestSRQ to get the current state of the GPIB SRQ line Use Wait SRQ to wait until SRQ is asserted Possible Errors EDVR Either boardID is invalid out of range or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured National Instruments Corp 2 73 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 TestSys TestSys Purpose Cause IEEE 488 2 compliant devices to conduct self tests DOS Format
147. nts Corp 1 127 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBWRTI Board Level IBWRTI Device Level Purpose Write data to a device from a user integer buffer DOS Format C Not supported use ibwrt QuickBASIC BASIC CALL ibwrti ud wrtbuf cnt amp Or status ilwrti ud wrtbuf cnt amp BASICA CALL ibwrti ud wrtbuf 0 cnt Windows Format C Not supported use ibwrt Visual Basic CALL ibwrti ud wrtbuf cnt amp Or status ilwrti ud wrtbuf cnt amp Direct Entry with C Not supported use ibwrt NI 488 2 FRM for DOS Windows 1 128 National Instruments Corp Chapter 1 NI 488 Functions IBWRTI Board Level IBWRTI Device Level Continued Direct Entry with Visual Basic Declare Function DLLibwrt Lib gpib dll ByVal ud wrtbuf ByVal cnt amp ibsta iberr ibcntl amp As Integer Note For direct entry with Visual Basic the correct format is DLLibwrt not DLLibwrti Input ud Board or device descriptor wrtbuf Address of the integer buffer containing the bytes to write You can replace wrtbuf with wrtbuf amp to send long integer data cnt Number of bytes to be written Output Function Return The value of ibsta Description Device Level If ud is a device descriptor ibwrti addresses the GPIB and writes cnt bytes from the memory location specified by wrtbuf to a GPIB device The operation terminates normally when cnt bytes have been sent
148. nual for more information about parallel polls continues National Instruments Corp 1 11 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBASK Board Level IBASK Device Level Continued Table 1 3 ibask Board Configuration Parameter Options Continued Options Options Constants Values Returned Information IbaTIMING 0x0011 The current bus timing of the board 1 Normal timing T1 delay of 2 us 2 High speed timing T1 delay of 500 ns 3 Very high speed timing T1 delay of 350 ns IbaDMA 0x0012 zero The board will not use DMA for GPIB transfers non zero The board will use DMA for GPIB transfers See ibdma IbaReadAdjust 0x0013 0 Read operations do not have pairs of bytes swapped 1 Read operations have each pair of bytes swapped IbaWriteAdjust 0x0014 0 Write operations do not have pairs of bytes swapped 1 Write operations have each pair of bytes swapped IbaEventQueue 0x0015 zero The event queue is disabled non zero The event queue is enabled See ibevent IbaSpollBit 0x0016 zero The SPOLL bit of ibsta is disabled non zero The SPOLL bit of ibsta is enabled See the NI 488 2 user manual for information about Talker Listener applications IbaSendLLO 0x0017 zero The GPIB LLO command is not sent when a device is put online ibfindor ibdev non zero The LLO command is sent continues NI 488 2 FRM for DOS Windows 1 12 National Instruments Corp C
149. nyms metric prefixes mnemonics symbols and terms are listed in the Glossary National Instruments Corp xi NI 488 2 FRM for DOS Windows About This Manual Related Documentation The following documents contain information that you may find helpful as you read this manual Microsoft MS DOS User s Guide Microsoft Windows User s Guide Microsoft Windows Software Development Kit Programmer s Reference ANSI TEEE Standard 488 1 1987 IEEE Standard Digital Interface for Programmable Instrumentation ANSI IEEE Standard 488 2 1992 IEEE Standard Codes Formats Protocols and Common Commands Customer Communication National Instruments wants to receive your comments on our products and manuals We are interested in the applications you develop with our products and we want to help if you have problems with them To make it easy for you to contact us this manual contains comment and configuration forms for you to complete These forms are in Appendix D Customer Communication at the end of this manual NI 488 2 FRM for DOS Windows xii National Instruments Corp Chapter 1 NI 488 Functions This chapter lists the available NI 488 functions and describes the purpose format input and output parameters and possible errors for each function For general programming information refer to the NI 488 2 user manual The user manual explains how to develop and debug your program It also describes the example programs in
150. o Interrupts are enabled IbaSC 0x000A zero The board is not the GPIB System Controller non zero The board is the System Controller See ibrsc continues NI 488 2 FRM for DOS Windows 1 10 National Instruments Corp Chapter 1 NI 488 Functions IBASK Board Level IBASK Device Level Continued Table 1 3 ibask Board Configuration Parameter Options Continued Options Options Constants Values Returned Information IbaSRE Ox000B_ zero The board does not automatically assert the GPIB REN line when it becomes the System Controller non zero The board automatically asserts REN when it becomes the System Controller See ibrsc and ibsre IbaEOSrd Ox000C_ zero The EOS character is ignored during read operations non zero Read operation is terminated by the EOS character See ibeos IbaEOSwrt Ox000D zero The EOI line is not asserted when the EOS character is sent during a write operation non zero The EOI line is asserted when the EOS character is sent during a write operation See ibeos IbaEOScmp OxO00E zero A 7 bit compare is used for all EOS comparisons non zero An 8 bit compare is used for all EOS comparisons See ibeos IbaEOSchar 0x000F The current EOS character of the board See ibeos IbaPP2 0x0010 zero The board is in PP1 mode remote parallel poll configuration non zero The board is in PP2 mode local parallel poll configuration Refer to the NI 488 2 user ma
151. o devices are connected to the GPIB ECIC The interface board is not the Controller In Charge see SendIFC EDVR Either boardID is invalid out of range or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress ESAC The interface board is not configured as System Controller National Instruments Corp 2 67 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 SendSetup SendSetup Purpose Set up devices to receive data in preparation for SendDataBytes DOS Format C void SendSetup int boardID Addr4882 t addrlist QuickBASIC BASIC CALL SendSetup boardID addrlist BASICA CALL SendSetup boardID addrlist 0 Windows Format C void SendSetup int boardID Addr4882 t addrlist Visual Basic CALL SendSetup boardID addrlist Direct Entry with C DLLSendSetup int boardID Addr4882 t far addrlist int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLSendSetup Lib gpib dll ByVal boardID addrlist ibsta iberr ibcntl amp NI 488 2 FRM for DOS Windows 2 66 National Instruments Corp Chapter 2 NI 488 2 Routines SendSetup SendSetup Continued Input boardID The interface board number addrlist A list of device addresses that is terminated by NOADDR Description SendSetup makes the devices described by addrlist listen activ
152. ode Visual Basic CALL Send boardID address buffer eotmodes Direct Entry with C DLLSend int boardID Addr4882 t address void far buffer long datacnt int eotmode int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLSend Lib gpib dll ByVal boardID ByVal address ByVal buffers ByVal datacnt amp ByVal eotmode ibsta iberrs ibcntl amp National Instruments Corp 2 53 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 Send Send Continued Input boardID The interface board number address Address of a device to which data is sent buffer The data bytes to be sent datacnt Number of bytes to be sent eotmode The data termination mode DABend NULLend or NLend Description Send addresses the device described by address to listen and the interface board to talk Then datacnt bytes from buffer are sent to the device The last byte is sent with the EOI line asserted if eotmode is DABend The last byte is sent without the EOI line asserted if eotmode is NULLend If eotmode is NLend then a new line character Xn is sent with the EOI line asserted after the last byte of buffer The actual number of bytes transferred is returned in the global variable ibcntl NI 488 2 FRM for DOS Windows 2 54 National Instruments Corp Chapter 2 Send NI 466 2 Routines Send Continued Possible Errors EABO EARG EBUS ECIC EDVR
153. ode C 4 EARG error code C 4 to C 5 EBUS error code C 8 ECAP error code C 7 ECIC error code C 3 EDMA error code C 6 to C 7 EDVR error code for DOS C 1 to C 2 for Windows C 2 to C 3 EFSO error code C 8 EnableLocal routine 2 11 to 2 12 EnableRemote routine 2 13 to 2 14 END status word condition B 2 ENEB error code C 6 ENOL error code C 3 to C 4 EOI line assertion See ibeot function EOIP error code C 7 EOS termination mode or character See ibeos function ERR status word condition B 2 error codes and solutions EABO C 5 EADR C 4 EARG C 4 to C 5 EBUS C 8 ECAP C 7 ECIC C 3 EDMA C 6 to C 7 EDVR for DOS C 1 to C 2 for Windows C 2 to C 3 EFSO C 8 ENEB C 6 ENOL C 3 to C 4 EOIP C 7 ESAC C 5 ESRQ C 9 ESTB C 8 ETAB C 9 NI 488 2 FRM for DOS Windows Index 2 National Instruments Corp ESAC error code C 5 ESRQ error code C 9 ESTB error code C 8 ETAB error code C 9 EVENT status word condition B 3 events returning See ibevent function F fax technical support D 1 finding boards devices or listeners FindLstn routine 2 15 to 2 17 FindRQS routine 2 18 to 2 19 ibfind function 1 51 to 1 52 ibln function 1 60 to 1 62 FindLstn routine 2 15 to 2 17 FindRQS routine 2 18 to 2 19 G GenerateREQT routine 2 22 to 2 23 GotoMultAddr routine 2 24 to 2 32 address selection function 2 26 description 2 25 to 2 27 example 2 28 to 2 32 serial poll respons
154. of bytes transferred is returned in the global variable ibcntl NI 488 2 FRM for DOS Windows 1 84 National Instruments Corp Chapter 1 NI 488 Functions IBRDI Board Level IBRDI Device Level Continued Board Level If ud is a board descriptor ibrdi reads up to cnt bytes of data from a GPIB device and places the data into the buffer specified by rdbuf A board level ibrdi assumes that the GPIB is already properly addressed The operation terminates normally when cnt bytes have been received or END is received The operation terminates with an error if the transfer could not complete within the timeout period or if the board is not the CIC when the CIC sends a Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcntl Note The cnt parameter specifies the number of bytes to transfer For example if you want to transfer 16 integers the number of bytes is 16 2 32 Possible Errors EABO Neither cnt bytes nor End was received within the timeout period or a Device Clear message was received after the read operation began EADR Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad EBUS Device level No devices are connected to the GPIB ECIC Device level The access board is not CIC See the Device Level Calls an
155. ontains the previous access board index Possible Errors EARG ECIC EDVR ENEB EOIP Either ud does not refer to a device or bname does not refer to a valid board name The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The access board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 18 National Instruments Corp Chapter 1 NI 488 Functions IB CAC Board Level IB CAC Purpose Become Active Controller DOS Format C int ibcac int ud int v QuickBASIC BASIC CALL ibcac ud v Or status ilcac ud v BASICA CALL ibcac ud v Windows Format C int ibcac int ud int v Visual Basic CALL ibcac ud v Or status ilcac ud v Direct Entry with C DLLibcac int ud int v int _far ibsta int _far iberr long _far ibcntl Direct Entry with Visual Basic Declare Function DLLibcac Lib gpib dll ByVal ud ByVal v ibsta iberr ibcntl amp As Integer National Instruments Corp 1 19 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IB CAC Board Level IB CAC Continued Input ud A board unit descriptor v Determines if control is to be taken asynchronously or synchronously Output Function Return The value of ibsta Description Using ibcac the designated GPIB
156. or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 62 National Instruments Corp Chapter 1 NI 488 Functions IBLOC Board Level IBLOC Device Level Purpose Go to Local DOS Format C int ibloc int ud QuickBASIC BASIC CALL ibloc ud o o status illoc ud BASICA CALL ibloc ud Windows Format C int ibloc int ud Visual Basic CALL ibloc ud or 5 status illoc ud Direct Entry with C DLLibloc int ud int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibloc Lib gpib dll ByVal ud ibsta iberr ibcntl amp As Integer National Instruments Corp 1 63 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBLOC Board Level IBLOC Device Level Continued Input ud Board or device descriptor Output Function Return The value of ibsta Description Board Level If the board is not in a lockout state LOK does not appear in the status word ibsta ibloc places the board in local mode Otherwise the call has no effect The ibloc function is used to simulate a front panel RTL Return to Local switch if the computer is used as an instrument Device Level Unless the REN Remote Enable line has been unasserted with the ibsre function all device level functions automatically place the spec
157. p BusREN printf REN is asserted NI 488 2 FRM for DOS Windows 1 58 National Instruments Corp Chapter 1 IBLINES NI 488 Functions Board Level IBLINES Continued Possible Errors EARG EDVR ENEB ud is valid but does not refer to an interface board Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured National Instruments Corp 1 59 NI 488 2 FRM for DOS Windows NI 488 Functions IBLN Board Level Device Level Chapter 1 IBLN Purpose Check for the presence of a device on the bus DOS Format C int ibln int ud int pad int sad short listen QuickBASIC BASIC CALL ibln ud pad sad listen or status illn ud pad sad listens BASICA CALL ibln ud pad sad listens Windows Format C int ibln int ud int pad int sad short listen Visual Basic CALL ibln ud pad sad listens or status illn ud pad sad listens Direct Entry with C DLLibln int ud int pad int sad short _far listen int far ibsta int _far Direct Entry with Visual Basic Declare Function DLLibln Lib gpib ByVal ud ByVal pad ByVal iberr ibcntl amp As Integer NI 488 2 FRM for DOS Windows 1 60 iberr long far ibontl dll sad listen ibsta National Instruments Corp Chapter 1 NI 488 Functions IBLN Board Level IBLN Device Level Continued
158. pMsg 2 41 to 2 43 ReadStatusByte 2 44 to 2 45 Index 6 National Instruments Corp Receive 2 46 to 2 48 ReceiveSetup 2 49 to 2 50 ResetSys 2 51 to 2 52 Send 2 53 to 2 56 SendCmds 2 56 to 2 57 SendDataBytes 2 58 to 2 60 SendIFC 2 61 to 2 62 SendList 2 63 to 2 65 SendLLO 2 66 to 2 67 SendSetup 2 68 to 2 69 SetRWLS 2 70 to 2 71 TestSRQ 2 72 to 2 73 TestSys 2 74 to 2 76 Trigger 2 77 to 2 78 TriggerList 2 79 to 2 80 WaitSRQ 2 81 to 2 82 Windows format 2 2 O online offline function See ibonl function P parallel poll functions routines ibppc 1 71 to 1 73 ibrpp 1 90 to 1 91 PPoll routine 2 35 to 2 36 PPollConfig routine 2 37 to 2 38 PPollUnconfig routine 2 39 to 2 40 PassControl routine 2 33 to 2 34 PPoll routine 2 35 to 2 36 PPollConfig routine 2 37 to 2 38 PPollUnconfig routine 2 39 to 2 40 primary address functions routines GotoMultAddr routine 2 24 to 2 32 ibpad 1 67 to 1 68 National Instruments Corp Index 7 Index NI 488 2 FRM for DOS Windows Index R RcvRespMsg routine 2 41 to 2 43 read functions routines ibrd 1 74 to 1 76 ibrda 1 77 to 1 79 ibrdf 1 80 to 1 82 ibrdi 1 83 to 1 85 ibrdia 1 86 to 1 89 RcvRespMsg routine 2 41 to 2 43 Receive routine 2 46 to 2 48 ReadStatusByte routine 2 44 to 2 45 Receive routine 2 46 to 2 48 ReceiveSetup routine 2 49 to 2 50 REM status word condition B 4 remote enable functions routines EnableRemote routine 2 13 to 2 14
159. perations while the I O is in progress Once the asynchronous I O has begun further GPIB calls are strictly limited Any calls that would interfere with the I O in progress are not allowed the driver returns EOIP in this case Once the I O is complete the application must resynchronize with the NI 488 2 driver Resynchronization is accomplished by using one of the following three functions ibwait If the returned ibsta mask has the CMPL bit set then the driver and application are resynchronized ibstop The I O is canceled the driver and application are resynchronized ibonl The I O is canceled and the interface is reset the driver and application are resynchronized Possible Errors EABO Board level a Device Clear message was received from the CIC EADR Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad EBUS Device level No devices are connected to the GPIB ECIC Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual EDVR Either ud is invalid or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured ENOL No Listeners were detected on the bus EOIP Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 124 Natio
160. ption constants included in Table 1 4 Constants Values Constants Values IbaBNA 0x0200 IbaReadAdjust 0x0013 IbaREADDR 0x0006 IbaEndBitIsNormal 0x001A baEOSchar 0x000F IbaSAD 0x0002 e IbaEOScmp 0x000E baSPollTime 0x0018 baEOSrd 0x000C baTMO 0x0003 baEOSwrt 0x000D IbaUnAddr 0x001B baEOT 0x0004 e IbaWriteAdjust 0x0014 IbaPAD 0x0001 NI 488 2 FRM for DOS Windows 1 14 National Instruments Corp Chapter 1 IBASK NI 488 Functions Board Level IBASK Device Level Continued Table 1 4 ibask Device Configuration Parameter Options Options Options Constants Values IbaPAD 0x0001 IbaSAD 0x0002 IbaTMO 0x0003 IbaEOT 0x0004 IbaREADDR 0x0006 IbaEOSrd 0x000C IbaEOSwrt 0x000D IbaEOScmp 0x000E National Instruments Corp Returned Information The current primary address of the device See ibpad The current secondary address of the device See ibsad The current I O timeout of the device See ibtmo zero The GPIB EOI line is not asserted at the end of a write operation non zero EOI is asserted at the end of a write operation See ibeot zero No unnecessary addressing is performed between device level read and write operations non zero Addressing is always performed before a device level read or write operation zero The EOS character is ignored during read operations non zero Read operation is terminated by the EOS character See ibeos zero Th
161. ptor v J Indicates whether the board or device is to be put online or taken offline Output Function Return Description The value of ibsta ibonl resets the board or device and places all its software configuration parameters in their pre configured state In addition if v is zero the device or interface board is taken offline If v is non zero the device or interface board is left operational or online If a device or an interface board is taken offline the board or device descriptor ud is no longer valid You must execute an ibfind or ibdev to access the board or device again Possible Errors EDVR ENEB Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured NI 488 2 FRM for DOS Windows 1 66 National Instruments Corp Chapter 1 NI 488 Functions IBPAD Board Level IBPAD Device Level Purpose Change the primary address DOS Format C int ibpad int ud int v QuickBASIC BASIC CALL ibpad ud v Or status ilpad ud v BASICA CALL ibpad ud v Windows Format C int ibpad int ud int v Visual Basic CALL ibpad ud v Or Status ilpad ud v Direct Entry with C DLLibpad int ud int v int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibpad Lib gpib dll ByVal ud ByVal v ibsta iberr ibcntl amp As Integer National Instrument
162. red in resultlist NI 488 2 FRM for DOS Windows 2 16 National Instruments Corp Chapter 2 FindLstn NI 466 2 Routines FindLstn Continued Possible Errors EARG EBUS ECIC EDVR ENEB EOIP ETAB An invalid primary address out of range appears in padlist ibcnt1 is the index of the invalid address in the padlist array No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress The number of devices found on the GPIB exceed limit National Instruments Corp 2 17 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 FindRQS FindRQS Purpose Determine which device is requesting service DOS Format C void FindRQS int boardID Addr4882 t addrlist short result QuickBASIC BASIC CALL FindRQS boardID addrlist result BASICA CALL FindRQS boardID addrlist 0 result Windows Format C void FindRQS int boardID Addr4882 t addrlist short result Visual Basic CALL FindRQS boardID addrlist result Direct Entry with C DLLFindRQS int boardID Addr4882 t far addrlist short far result int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Sub DLLFindRQS Lib gpib
163. reproduce the problem Documentation Comment Form National Instruments encourages you to comment on the documentation supplied with our products This information helps us provide quality products to meet your needs Title NI 488 2 Function Reference Manual for DOS Windows Edition Date August 1996 Part Number 320702C 01 Please comment on the completeness clarity and organization of the manual continues If you find errors in the manual please record the page numbers and describe the errors Thank you for your help Name Title Company Address Phone Mail to Technical Publications National Instruments Corporation 6504 Bridge Point Parkway Austin TX 78730 5039 Fax to Technical Publications National Instruments Corporation 512 794 5678 Glossary ee om o A acceptor handshake access board ANSI ASCII asynchronous automatic serial polling autopolling B base I O address BIOS board level function National Instruments Corp Listeners use this GPIB interface function to receive data and all devices use it to receive commands See source handshake and handshake The GPIB board that controls and communicates with the devices on the bus that are attached to it American National Standards Institute American Standard Code for Information Interchange An action or event tha
164. ress NI 488 2 FRM for DOS Windows 1 24 National Instruments Corp Chapter 1 NI 488 Functions IB CMDA Board Level IB CMDA Purpose Send GPIB commands asynchronously DOS Format C int ibcmda int ud void cmdbuf long cnt QuickBASIC BASIC CALL ibcmda ud cmdbuf Or status ilcmda ud cmdbuf cnt amp BASICA CALL ibcmda ud cmdbuf Windows Format C int ibcmda int ud void cmdbuf long cnt Visual Basic CALL ibcmda ud cmdbuf Or status ilcmda ud cmdbuf cnt amp Direct Entry with C DLLibcmda int ud void far cmdbuf long cnt int far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibcmda Lib gpib dll ByVal ud ByVal cmdbuf ByVal cnt amp ibsta iberr ibcntl amp As Integer National Instruments Corp 1 25 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IB CMDA Board Level IB CMDA Continued Input ud A board unit descriptor cmdbuf Buffer of command bytes to send cnt Number of command bytes to send Output Function Return The value of ibsta Description ibcmda sends cnt bytes from cmdbuf over the GPIB as command bytes interface messages The number of command bytes transferred is returned in the global variable ibcntl Refer to Appendix A Multiline Interface Messages for a table of the defined interface messages Command bytes are used to configure the state of the GPIB
165. rlist int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLEnableRemote Lib gpib dll ByVal boardID addrlist ibsta iberr ibcntl amp National Instruments Corp 2 13 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 EnableRemote EnableRemote Continued Input boardID The interface board number addrlist A list of device addresses that is terminated by NOADDR Description EnableRemote asserts the Remote Enable REN GPIB line All devices described by addrlist are put in a listen active state Possible Errors EARG EBUS ECIC EDVR ENEB EOIP ESAC An invalid address out of range appears in addrlist ibcnt1 is the index of the invalid address in the addrlist array No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress The interface board is not configured as System Controller NI 488 2 FRM for DOS Windows 2 14 National Instruments Corp Chapter 2 NI 488 2 Routines FindLstn FindLstn Purpose Find listening devices on the GPIB DOS Format C void FindLstn int boardID Addr4882 t padlist Addr4882 t resultlist int limit QuickBASIC BASIC CALL FindLstn boardI
166. rn Material Authorization RMA number must be obtained from the factory and clearly marked on the outside of the package before any equipment will be accepted for warranty work National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty National Instruments believes that the information in this manual is accurate The document has been carefully reviewed for technical accuracy In the event that technical or typographical errors exist National Instruments reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition The reader should consult National Instruments if errors are suspected In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it EXCEPT AS SPECIFIED HEREIN NATIONAL INSTRUMENTS MAKES NO WARRANTIES EXPRESS OR IMPLIED AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE CUSTOMER S RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA PROFITS USE OF PRODUCTS OR INCIDENTAL OR CONSEQUENTIAL DAMAGES EVEN IF ADVISED OF THE POSSIBILITY THEREOF This limitation of the liability of National Instruments will apply regardles
167. rrors EABO EADR EARG ECIC EDVR ENEB ENOL EOIP The I O timeout period expired before all of the bytes were sent Interface boardID is not talk active use SendSetup to address the GPIB properly The eotmode parameter is invalid it can be only DABend NULLend or NLend or the buffer is empty and the otmode is DABend The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured No Listeners are on the GPIB to accept the data bytes use SendSetup to address the GPIB properly Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 60 National Instruments Corp Chapter 2 NI 488 2 Routines SendIFC SendIFC Purpose Reset the GPIB by sending interface clear DOS Format C void SendIFC int boardID BASICA QuickBASIC BASIC CALL SendIFC boardID Windows Format C void SendIFC int boardID Visual Basic CALL SendIFC boardID Direct Entry with C DLLSendIFC int boardID int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLSendIFC Lib gpib dll ByVal boardID ibsta iberr ibocntl amp Input boardID The interface board number National Instruments Corp 2 61 NI 488 2 FRM for DOS Windows NI 488 2 Routines SendIFC Chapter 2 SendIFC Continu
168. s Corp 1 67 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBPAD Board Level IBPAD Device Level Continued Input ud Board or device descriptor v GPIB primary address Output Function Return Description The value of ibsta ibpad sets the primary GPIB address of the board or device to v an integer ranging from 0 to 30 If no error occurs during the call then iberr contains the previous GPIB primary address Possible Errors EARG EDVR ENEB EOIP v is not a valid primary GPIB address it must be in the range 0 to 30 Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 1 68 National Instruments Corp Chapter 1 NI 488 Functions IBPCT Device Level IBPCT Purpose Pass control to another GPIB device with Controller capability DOS Format C int ibpct int ud QuickBASIC BASIC CALL ibpct ud or status ilpct ud BASICA CALL ibpct ud Windows Format C int ibpct int ud Visual Basic oe CALL ibpct ud or status ilpct ud Direct Entry with C DLLibpct int ud int _far ibsta int far iberr long far ibcntl Direct Entry with Visual Basic Declare Function DLLibpct Lib gpib dll ByVal ud ibsta iberr ibcntl amp As Integer National Instruments Corp 1 69 NI 488 2 FRM for DOS Windows
169. s of the form of action whether in contract or tort including negligence Any action against National Instruments must be brought within one year after the cause of action accrues National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control The warranty provided herein does not cover damages defects malfunctions or service failures caused by owner s failure to follow the National Instruments installation operation or maintenance instructions owner s modification of the product owner s abuse misuse or negligent acts and power failure or surges fire flood accident actions of third parties or other events outside reasonable control Copyright Under the copyright laws this publication may not be reproduced or transmitted in any form electronic or mechanical including photocopying recording storing in an information retrieval system or translating in whole or in part without the prior written consent of National Instruments Corporation Trademarks NI 488 and NI 488 2 are trademarks of National Instruments Corporation Product and company names listed are trademarks or trade names of their respective companies WARNING REGARDING MEDICAL AND CLINICAL USE OF NATIONAL INSTRUMENTS PRODUCTS National Instruments products are not designed with components and testing intended to ensure a level of reliability suitable for use in treatment and diagnosis of humans Applicat
170. ser integer buffer DOS Format C Not supported use ibrd QuickBASIC BASIC CALL ibrdi ud rdbuf ocnt amp Or status ilrdi ud rdbuf cnt amp BASICA CALL ibrdi ud rdbuf 0 cnt Windows Format C Not supported use ibrd Visual Basic CALL ibrdi ud rdbuf ocnt amp Or status ilrdi ud rdbuf cnt amp Direct Entry with C Not supported use ibrd National Instruments Corp 1 83 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBRDI Board Level IBRDI Device Level Continued Direct Entry with Visual Basic Declare Function DLLibrd Lib gpib dll ByVal ud rdbuf ByVal cnt amp ibsta iberr ibcntl amp As Integer Note For direct entry with Visual Basic the correct format is DLLibrd not DLLibrdi Input ud Board or device descriptor cnt Number of bytes to be read from the GPIB Output rdbuf Address of buffer into which integer data is read You can replace rdbuf with rdbuf to read long integer data Function Return The value of ibsta Description Device Level If ud is a device descriptor ibrdi addresses the GPIB begins a read of up to cnt bytes of data from a GPIB device and places the data into the memory location specified by rdbuf The operation terminates normally when cnt bytes have been received or END is received The operation terminates with an error if the transfer could not complete within the timeout period The actual number
171. soft Visual Basic version 1 0 or higher Direct entry into the Windows Dynamic Link Library gpib dll Direct entry for Microsoft C version 5 1 or higher Direct entry for Microsoft Visual BASIC version 1 0 or higher Input and Output The input and output parameters for each routine are listed Most of the NI 488 2 routines have an input parameter which is either a single address or a list of addresses The address parameter is a 16 bit integer that has two components the low byte is a valid primary address 0 to 30 and the high byte is a valid secondary address NO SAD 0 or 96 to 126 A list of addresses is an array of single addresses You must mark the end of this list with the constant NOADDR An empty address list is either an array with only the NOADDR constant in it or a NULL pointer The C language interface header file includes the definition of a type typedef called Addr4882 t Usethe Addr4882 t type when declaring addresses or address lists Description The description section gives details about the purpose and effect of each routine Examples Some function descriptions include sample code showing how to use the function For more detailed and complete examples refer to the example programs that are included with your NI 488 2 software The example programs are described in Chapter 2 of the NI 488 2 user manual NI 488 2 FRM for DOS Windows 2 2 National Instruments Corp Chapter 2 NI 488 2 Routines Possib
172. ssages This appendix contains a multiline interface message reference list which describes the mnemonics and messages that correspond to the interface functions These multiline interface messages are sent and received with ATN TRUE For more information on these messages refer to the ANSI IEEE Standard 488 1 1987 IEEE Standard Digital Interface for Programmable Instrumentation National Instruments Corp A 1 NI 488 2 FRM for DOS Windows Multiline Interface Messages Appendix A Multiline Interface Messages Hex Oct Dec ASCII Msg Hex Oct Dec ASCII Msg 00 000 0 NUL 20 040 32 SP MLAO 01 001 1 SOH GTL 21 041 33 MLAI 02 002 2 STX 22 042 34 E MLA2 03 003 3 ETX 23 043 35 MLA3 04 004 4 EOT SDC 24 044 36 MLA4 05 005 5 ENQ PPC 25 045 37 MLAS 06 006 6 ACK 26 046 38 amp MLA6 07 007 7 BEL 27 047 39 MLA7 08 010 8 BS GET 28 050 40 MLAS 09 011 9 HT TCT 29 051 41 MLA9 0A 012 10 LF 2A 052 42 MLA10 OB 013 11 VT 2B 053 43 MLAII 0C 014 12 FF 2C 054 44 2 MLA12 oD 015 13 CR 2D 055 45 MLA13 OE 016 14 SO 2E 056 46 MLA14 OF 017 15 SI 2F 057 47 MLA15 10 020 16 DLE 30 060 48 0 MLA16 11 021 17 DCI LLO 31 061 49 1 MLA17 12 022 18 DC2 32 062 50 2 MLA18 13 023 19 DC3 33 063 51 3 MLAI9 14 024 20 DC4 DCL 34 064 52 4 MLA20 15 025 21 NAK PPU 35 065 53 5 MLA21 16 026 22 SYN 36 066 54 6 MLA22 17 027 23 ETB 37 067 55 7 MLA23 18 030 24 CAN SPE 38 070 56 8 MLA24 19 031 25 EM SPD 39 071 57 9 MLA25 1A 032 26 SUB 3A 072 58 MLA26
173. t far addrfunc unsigned short far spollfunc 0 int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Not supported NI 488 2 FRM for DOS Windows 2 24 National Instruments Corp Chapter 2 NI 488 2 Routines GotoMultAddr GotoMultAddr Continued Input boardID The interface board number type Either the constant Mult AddrPrimary or MultAddrSecondary addrfunc The address of your address selection function spollfunc The address of your serial poll response function Description Got oMultAddr places the driver in multiple address mode You must call GotoMultAddr once for every board at the beginning of any program that simulates multiple GPIB addresses The t ype parameter specifies whether you want to use primary or secondary address mode You cannot use both addrfunc and spollfunc are pointers to functions you have written as part of the application addrfunc points to your address selection function It is called whenever a GPIB address is on the bus Your address selection function must determine whether the address is the address of one of the simulated GPIB devices If it is a simulated address addrfunc should return 1 If it is not addrfunc should return 0 spollfunc points to your serial poll response function It is called whenever one of the simulated devices is serial polled spollfunc should return the serial poll response byte To disable multiple address mode call i
174. t GP Baddr needs service from the CIC GenerateREQT causes the driver to assert the SRQ line When the Controller determines that SRQ is asserted it conducts a serial poll of the device The spollfunc then returns the appropriate serial poll response byte The driver sets the RSV Request Service bit to 1 before sending the response byte to the Controller For an example of the Generat eREQT routine call refer to the description of the GotoMultAddr routine Possible Errors EARG GPIBaddr is an invalid 5 bit GPIB address See GotoMultAddr for a description of valid 5 bit GPIB addresses EDVR Either boardID is invalid out of range or the NI 488 2 driver is not installed ENEB boardID is not installed or is not properly configured EOIP Asynchronous I O is in progress National Instruments Corp 2 23 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 GotoMultAddr GotoMultAddr Purpose Place the driver in multiple primary or secondary address mode DOS Format C void GotoMultAddr int boardID unsigned short type unsigned short far addrfunc unsigned short far spollfunc QuickBASIC BASIC Not supported BASICA Not supported Windows Format C void GotoMultAddr int boardID unsigned short type unsigned short far addrfunc unsigned short far spollfunc Visual Basic Not supported Direct Entry with C DLLGotoMultAddr int boardID unsigned short type unsigned shor
175. t address int dataline int lineSense int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLPPollConfig Lib gpib dll ByVal boardID ByVal address ByVal dataline ByVal lineSense ibsta iberr ibcntl amp National Instruments Corp 2 37 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 PPollConfig PPollConfig Continued Input boardID The interface board number address Address of the device to be configured dataline Data line a value in the range of 1 to 8 on which the device responds to parallel polls lineSense Sense either 0 or 1 of the parallel poll response Description PPollConfig configures the device described by address to respond to parallel polls by asserting or not asserting the GPIB data line dataline If lineSense equals the individual status ist bit of the device then the assigned GPIB data line is asserted during a parallel poll Otherwise the data line is not asserted during a parallel poll The Controller can use parallel polling to obtain one bit device dependent status messages from up to eight devices simultaneously For more information on parallel polling refer to the NI 488 2 user manual Possible Errors EARG The address parameter is invalid out of range or NOADDR dataline is not in the range to 8 or LineSense is not 0 or 1 EBUS No devices are connected to the GPIB ECIC The interface board is not the Contro
176. t amp ibsta iberr ibcntl amp As Integer NI 488 2 FRM for DOS Windows 1 122 National Instruments Corp Chapter 1 NI 488 Functions IBWRTA Board Level IBWRTA Device Level Continued Input ud Board or device descriptor wrtbuf Address of the buffer containing the bytes to write cnt Number of bytes to be written Output Function Return The value of ibsta Description Device Level If ud is a device descriptor ibwrta addresses the GPIB and writes cnt bytes from the buffer wrtbuf to a GPIB device The operation terminates normally when cnt bytes have been sent The actual number of bytes transferred is returned in the global variable ibcntl Board Level If ud is a board descriptor ibwrta begins an asynchronous write of cnt bytes of data from the buffer pointed to by wrt buf to a GPIB device A board level ibwrta assumes that the GPIB is already properly addressed The operation terminates normally when cnt bytes have been sent The operation terminates with an error if the board is not CIC or if the CIC sends the Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcnt1l National Instruments Corp 1 123 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBWRTA Board Level IBWRTA Device Level Continued Board and Device Level The asynchronous I O calls ibcmda ibrda ibwrta are designed so that applications can perform other non GPIB o
177. t is placed in result Each of the eight bits of result represents the status information for each device configured for a parallel poll The interpretation of the status information is based on the latest parallel poll configuration command sent to each device see PPol1Config and PPollUnconfig The Controller can use parallel polling to obtain one bit device dependent status messages from up to eight devices simultaneously For more information on parallel polling refer to the NI 488 2 user manual Possible Errors EBUS No devices are connected to the GPIB ECIC The interface board is not the Controller In Charge see SendIFC EDVR Either boardID is invalid out of range or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured EOIP Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 36 National Instruments Corp Chapter 2 NI 488 2 Routines PPollConfig PPollConfig Purpose Configure a device to respond to parallel polls DOS Format C void PPollConfig int boardID Addr4882 t address int dataline int lineSense BASICA QuickBASIC BASIC CALL PPollConfig boardID address dataline lineSense Windows Format C void PPollConfig int boardID Addr4882 t address int dataline int lineSense Visual Basic CALL PPollConfig boardID address dataline lineSense Direct Entry with C DLLPPollConfig int boardID Addr4882
178. t occurs at an unpredictable time with respect to the execution of a program A feature of the NI 488 2 software in which serial polls are executed automatically by the driver whenever a device asserts the GPIB SRQ line See I O address Basic Input Output System A rudimentary function that performs a single operation Glossary 1 NI 488 2 FRM for DOS Windows Glossary C CFE CFGn CIC Controller In Charge CIC CPU D DAV Data Valid DCL Device Clear device level function DIO1 through DIO8 DLL DMA direct memory access driver NI 488 2 FRM for DOS Windows Configuration Enable is the GPIB command which precedes CFGn and is used to place devices into their configuration mode These GPIB commands CFGI through CFG15 follow CFE and are used to configure all devices for the number of meters of cable in the system so that HS488 transfers occur without errors See Controller In Charge The device that manages the GPIB by sending interface messages to other devices Central processing unit One of the three GPIB handshake lines See handshake Device Clear is the GPIB command used to reset the device or internal functions of all devices See SDC See DCL A function that combines several rudimentary board operations into one function so that the user does not have to be concerned with bus management or other GPIB protocol matters The GPIB lines that are used to transmit comma
179. tes all of the bytes in the file 1name to a GPIB device A board level ibwrt f assumes that the GPIB is already properly addressed The operation terminates normally when all of the bytes have been sent The operation terminates with an error if all of the bytes could not be sent within the timeout period or if the board is not CIC the CIC sends the Device Clear message on the GPIB The actual number of bytes transferred is returned in the global variable ibcnt1 NI 488 2 FRM for DOS Windows 1 126 National Instruments Corp Chapter 1 IBWRTF NI 488 Functions Board Level IBWRTF Device Level Continued Possible Errors EABO EADR EBUS ECIC EDVR EFSO ENEB EOIP Either the file could not be transferred within the timeout period or a Device Clear message was received after the write operation began Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad Device level No devices are connected to the GPIB Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed ibwrtf could not access flname The interface board is not installed or is not properly configured Asynchronous I O is in progress National Instrume
180. that the EOS byte has been received if the software is configured to terminate a read on an EOS byte If the GPIB board is performing a shadow handshake as a result of the ibgt s function any other function can return a status word with the END bit set if the END condition occurs before or during that call END is cleared when any I O operation is initiated Some applications might need to know the exact I O read termination mode of a read operation EOI by itself the EOS character by itself or EOI plus the EOS character You can use the ibconfig function option IbcEndBitIsNormal to enable a mode in which the END bit is set only when EOI is asserted In this mode if the I O operation completes because of the EOS character by itself END is not set The application should check the last byte of the received buffer to see if it is the EOS character SRQI brd SRQI indicates that a GPIB device is requesting service SRQI is set whenever the GPIB board is CIC the GPIB SRQ line is asserted and the automatic serial poll capability is disabled SRQI is cleared either when the GPIB board ceases to be the CIC or when the GPIB SRQ line is unasserted NI 488 2 FRM for DOS Windows B 2 National Instruments Corp Appendix B Status Word Conditions RQS dev RQS appears in the status word only after a device level call It indicates that one or more serial poll response bytes are waiting in the device s serial poll response queue Automatic
181. the failure code A test result of 1 indicates that the I O timeout period elapsed before the device sent its result code ibcnt1 contains the number of devices that failed National Instruments Corp 2 75 NI 488 2 FRM for DOS Windows NI 488 2 Routines TestSys Chapter 2 TestSys Continued Possible Errors EABO EARG EBUS ECIC EDVR ENEB ENOL EOIP The interface board timed out before receiving a result from a device ibcnt1 contains the index of the first device that timed out 1 is stored as the test result for the timed out device An invalid address out of range appears in addrlist ibcnt1 is the index of the invalid address in the addrlist array or the addrlist is empty No devices are connected to the GPIB The interface board is not the Controller In Charge see SendIFC Either boardID is invalid out of range or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured No Listeners are on the GPIB Asynchronous I O is in progress NI 488 2 FRM for DOS Windows 2 76 National Instruments Corp Chapter 2 NI 488 2 Routines Trigger Trigger Purpose Trigger a device DOS Format C void Trigger int boardID Addr4882 t address BASICA QuickBASIC BASIC CALL Trigger boardID address Windows Format C void Trigger int boardID Addr4882 t address Visual Basic CALL Trigger boardID address
182. tines WaitSRQ WaitSRQ Purpose Wait until a device asserts the GPIB Service Request SRQ line DOS Format C void WaitSRQ int boardID short result BASICA QuickBASIC BASIC CALL WaitSRQ boardID result Windows Format C void WaitSRQ int boardID short result Visual Basic CALL WaitSRQ boardID result Direct Entry with C DLLWaitSRQ int boardID short far result int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Sub DLLWaitSRQ Lib gpib dll ByVal boardID result ibsta iberr ibocntl amp National Instruments Corp 2 81 NI 488 2 FRM for DOS Windows NI 488 2 Routines Chapter 2 WaitSRQ WaitSRQ Continued Input boardID The interface board number Output result State of the SRQ line non zero if line is asserted zero if line not asserted Description WaitSRQ waits until either the GPIB SRQ line is asserted or the timeout period has expired see ibtmo When Wait SRQ returns result contains a non zero value if SRQ is asserted Otherwise result contains a zero Use Test SRQ to get the current state of the GPIB SRQ line Use WaitSRQ to wait until SRQ is asserted Possible Errors EDVR Either boardID is invalid out of range or the NI 488 2 driver is not installed ENEB The interface board is not installed or is not properly configured NI 488 2 FRM for DOS Windows 2 82 National Instruments Corp Appendix A Multiline Interface Me
183. tions Options Constants Values Legal Values IbcSRE OxOO0B Assert the Remote Enable REN line Identical to ibsre Default zero IbcEOSrd 0x000C zero Ignore EOS character during read operations non zero Terminate reads when the EOS character is read match occurs IbcEOSwrt Ox000D zero Do not assert EOI with the EOS character during write operations non zero Assert EOI with the EOS character during writes operations IbcEOScmp 0x000E zero Use 7 bits for the EOS character comparison non zero Use 8 bits for the EOS character comparison IbcEOSchar 0x000F Any 8 bit value This byte becomes the new EOS character IbcPP2 0x0010 zero PP1 mode remote parallel poll configuration non zero PP2 mode local parallel poll configuration Default zero Refer to the NI 488 2 user manual for more information about parallel polling IbcTIMING 0x0011 1 Normal timing T1 delay of 2 us 2 High speed timing T1 delay of 500 ns 3 Very high speed timing T1 delay of 350 ns The T1 delay is the GPIB source handshake timing continues NI 488 2 FRM for DOS Windows 1 32 National Instruments Corp Chapter 1 IBCONFIG NI 488 Functions Board Level IB CONFIG Device Level Continued Table 1 5 ibconfig Board Configuration Parameter Options Continued Options Options Constants Values Legal Values IbcReadAdjust 0x0013 IbcWriteAdjust 0x0014 IbcEventQueue 0x0015 IbcSpollBit 0x0
184. uments Corp Chapter 1 NI 488 Functions IBSAD Board Level IB SAD Device Level Purpose Change or disable the secondary address DOS Format C int ibsad int ud int v QuickBASIC BASIC CALL ibsad ud v Or status ilsad ud v BASICA CALL ibsad ud v Windows Format C int ibsad int ud int v Visual Basic CALL ibsad ud v Or status ilsad ud v Direct Entry with C DLLibsad int ud int v int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Function DLLibsad Lib gpib dll ByVal ud ByVal v ibsta iberr ibcntl amp As Integer National Instruments Corp 1 99 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBSAD Board Level IBSAD Device Level Continued Input ud Board or device descriptor v GPIB secondary address Output Function Return Description The value of ibsta ibsad changes the secondary GPIB address of the board or device to v an integer in the range 96 to 126 hex 60 to hex 7E or zero If v is zero secondary addressing is disabled If no error occurs during the call then the previous secondary address is returned in iberr Possible Errors EARG EDVR ENEB EOIP v is non zero and outside the legal range 96 to 126 Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured Asynchronous I O is in progress NI 4
185. vice Clear message was received after the write operation began Board level The GPIB is not correctly addressed Use ibcmd to address the GPIB Device level A conflict exists between the device GPIB address and the GPIB address of the device access board Use ibpad and ibsad Device level No devices are connected to the GPIB Device level The access board is not CIC See the Device Level Calls and Bus Management section in the NI 488 2 user manual Either ud is invalid or the NI 488 2 driver is not installed The interface board is not installed or is not properly configured No Listeners were detected on the bus Asynchronous I O is in progress National Instruments Corp 1 121 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IBWRTA Board Level IBWRTA Device Level Purpose Write data asynchronously to a device from a user buffer DOS Format C int ibwrta int ud void wrtbuf long cnt QuickBASIC BASIC CALL ibwrta ud wrtbuf Or status ilwrta ud wrtbuf cnt amp BASICA CALL ibwrta ud wrtbuf Windows Format C int ibwrta int ud void wrtbuf long cnt Visual Basic CALL ibwrta ud wrtbuf Or status ilwrta ud wrtbuf cnt amp Direct Entry with C DLLibwrta int ud void far wrtbuf long cnt int far ibsta int far iberr long far ibocntl Direct Entry with Visual Basic Declare Function DLLibwrta Lib gpib dll ByVal ud ByVal wrtbufS ByVal cn
186. y address of the device Identical to ibpad IbcSAD 0x0002 Changes the secondary address of the device Identical to ibsad IbcTMO 0x0003 Changes the device I O timeout limit Identical to ibtmo continues National Instruments Corp 1 35 NI 488 2 FRM for DOS Windows NI 488 Functions Chapter 1 IB CONFIG Board Level IB CONFIG Device Level Continued Table 1 6 ibconfig Device Configuration Parameter Options Continued Options Options Constants Values Legal Values IbcEOT 0x0004 Changes the data termination method for writes Identical to ibeot IbcREADDR 0x0006 zero No unnecessary readdressing is performed between device level reads and writes non zero Addressing is always performed before a device level read or write IbcEOSrd 0x000C non zero Terminate reads when the EOS character is read IbcEOSwrt 0x000D zero Do not send EOI with the EOS character during write operations non zero Send EOI with the EOS character during writes IbcEOScmp OxOO0E zero Use seven bits for the EOS character comparison non zero Use 8 bits for the EOS character comparison IbcEOSchar 0x000F Any 8 bit value This byte becomes the new EOS character IbcReadAdjust 0x0013 0 No byte swapping 2 Swap pairs of bytes during a read Default zero IbcWriteAdjust 0x0014 0 No byte swapping 1 Swap pairs of bytes during a write Default zero continues NI 488 2 FRM for DOS Windows
187. ystem error code 2 Device Not Found or 110 Open failed EDVR is also returned when an invalid unit descriptor is passed to any function call In this case the variable ibcnt1 contains the system error code 6 Invalid handle EDVR is also returned when the driver gpib com is not installed National Instruments Corp C 1 NI 488 2 FRM for DOS Windows Error Codes and Solutions Appendix C Solutions e Use ibdev to open a device without specifying its symbolic name e Use only device or board names that are configured in the utility program ibconf as parameters to the ibfind function e Use the unit descriptor returned from the ibfind function as the first parameter in subsequent NI 488 functions Examine the variable after the ibfind and before the failing function to make sure it was not corrupted Make sure the NI 488 2 driver is installed by checking the con ig sys file in the root directory Make sure it contains the following line device drive NpathNgpib com where drive is the drive usually c and pat his the directory for example at gpib EDVR 0 NI 488 2 for Windows EDVR is returned in the following cases The board or device name passed to ibfindis not configured in the software In this case the variable ibcnt1 contains the DOS error code 2 Device Not Found Aninvalid unit descriptor is passed to any function call In this case the variable ibcntl contains the DOS error code 6 Invalid handle T

Download Pdf Manuals

image

Related Search

Related Contents

Temperature control unit - Legrand E  TWIN HD DVB-T Reconden  Règlement de Consultation - Ministère de la Culture et de la  4.5MB  Optoma X304M data projector  

Copyright © All rights reserved.
Failed to retrieve file