background image

2-12

Return to 

Section Topics

KPCI-488LPA-900-01 Rev. A / December 2008

Section 2: NI Command Compatible Functions

Model KPCI-488LPA GPIB Controller Interface Card User’s Manual

ibcac

Description

This command sets the assigned GPIB board to be the active controller by setting the 

ATN line

 to enable. The GPIB board must be the CIC (controller in charge) before 

calling 

ibcac

. Use 

ibsic

 to set the board as the CIC. The board can take control 

synchronously (1),  asynchronously (2), or either (v). If either, the GPIB board tries to 
create the ATN signal but does not terminate the data transfer (synchronous control is 
tried first). If this fails, the board takes asynchronous control by immediately creating 
the ATN signal without considering any current data transfer for asynchronous control.

Support Level

Board level

Syntax

Microsoft C/C++ and Borland C++

int ibcac(int ud, int synchronous)

Visual Basic

idcac (ByVal ud As Integer, ByVal v As Integer) As

 

  Integer

- or -

call ibcac (ByVal ud As Integer, ByVal v As Integer)

Parameters

ud

: board unit descriptor

v

: either synchronous or asynchronous control

0: asynchronously

1: synchronously

Return Value

The value of the 

ibsta

Error Codes

EARG, ECIC, EDVR, EOIP, ENEB 

ibclr

Description

This command sends the 

GPIB Selected Device Clear 

(SDC) message to the 

assigned device.

Support Level

Device level

Syntax

Microsoft C/C++ and Borland C++

int ibclr (int ud)

Visual Basic

idclr (ByVal ud As Integer) As Integer

  - or -

call ibclr (ByVal ud As Integer)

Parameters

ud

: device unit descriptor

Return Value

The value of the 

ibsta

Error Codes

EARG, EBUS, ECIC, EDVR, EOIP, ENEB 

Summary of Contents for KPCI-488 LPA

Page 1: ...o c y e l h t i e k w w w E C N E D I F N O C F O E R U S A E M R E T A E R G A KPCI 488LPA GPIB Controller Interface Card User s Manual KPCI 488LPA 900 01 Rev A December 2008 KPCI 488LPA GPIB Contro...

Page 2: ......

Page 3: ...duct returned transportation prepaid Repaired or replaced products are warranted for the balance of the original warranty period or at least 90 days LIMITATION OF WARRANTY This warranty does not apply...

Page 4: ......

Page 5: ...e with electrical signals that are rated Measurement Category I and Measurement Category II as described in the International Electrotechnical Commission IEC Standard IEC 60664 Most measurement contro...

Page 6: ...d common mode voltages Use standard safety precautions to avoid personal contact with these voltages The symbol on an instrument shows that the surface may be hot Avoid personal contact to prevent bur...

Page 7: ...Model KPCI 488LPA GPIB Controller Interface Card User s Manual 2008 Keithley Instruments Inc All rights reserved Cleveland Ohio U S A Document Number KPCI 488LPA 900 01 Rev A December 2008...

Page 8: ......

Page 9: ...9 SETPORT 1 9 SETTIMEOUT 1 9 SPOLL 1 9 SRQ 1 10 TARRAY 1 10 TRANSMIT 1 10 WAITSRQDEVICE 1 12 2 NI Command Compatible Functions 2 1 Introduction 2 3 Using NI Command Compatible functions 2 3 Microsoft...

Page 10: ...wrta 2 34 ibwrtf 2 35 Multi device functions 2 36 AllSpoll 2 36 DevClear 2 36 DevClearList 2 37 EnableLocal 2 37 EnableRemote 2 37 FindLstn 2 38 FindRQS 2 38 PassControl 2 39 PPoll 2 39 PPollConfig 2...

Page 11: ...Section Figure Title Page 1 Figure 1 1 Open Project dialog box 1 2 2 Figure 2 1 Open Project dialog box 2 3 List of Figures...

Page 12: ...This page left blank intentionally List of Figures Model KPCI 488LPA GPIB Controller Interface Card User s Manual iv KPCI 488LPA 900 01 Rev A December 2008...

Page 13: ...9 2 Table 2 6 ibask device configuration parameter options 2 10 2 Table 2 7 Board configuration parameter options 2 14 2 Table 2 8 Device configuration parameter options 2 15 2 Table 2 9 EOS mode V va...

Page 14: ...This page left blank intentionally List of Tables Model KPCI 488LPA GPIB Controller Interface Card User s Manual vi KPCI 488LPA 900 01 Rev A December 2008...

Page 15: ...rsion 6 0 1 2 Microsoft Visual C C 1 4 Keithley Command Compatible function reference 1 5 GPIBBOARDPRESENT 1 5 BOARDSELECT 1 5 DMACHANNEL 1 5 ENTER 1 5 FEATURE 1 6 INITIALIZE 1 6 LISTENERPRESENT 1 7 P...

Page 16: ...Command Compatible application using the API and Microsoft Visual Basic follow these steps Step 1 Enter Visual Basic and open or create a project to use the Keithley Command Compatible functions To cr...

Page 17: ...tool to reposition or resize controls Step 4 Set control properties Set control properties from the properties list To view the properties list select the desired control and do one of the following P...

Page 18: ...Keithley Command Compatible functions NOTE The project can be a new or existing one Step 2 Include function declarations and constants file IEEE C H Include IEEE C H in the C C source files that call...

Page 19: ...Basic GpibBoardPresent As Long Return Value 0 if no GPIB is installed 1 if a GPIB board is installed BOARDSELECT Description This function selects a board to be the active board Syntax Microsoft C C a...

Page 20: ...Valid FEATURE values are contained in Table 1 1 Table 1 1 FEATURE parameters Feature Constants Features Values Returned Information IEEEListener 0 Checking if ListenerPresent function is supported by...

Page 21: ...the status of devices Syntax Microsoft C C and Borland C int ppoll char poll Visual Basic call ppoll poll As Integer Parameters poll returned parallel polling status RARRAY Description This function...

Page 22: ...ta to receive len returns the actual number of received data bytes Return Value 0 read data successfully 8 timeout error SEND Description This function sends commands to a specified GPIB device Syntax...

Page 23: ...void setport long int bd unsigned io Visual Basic call setport ByVal bd As Long ByVal io As Long Parameters bd the board number io the I O base address set to the device SETTIMEOUT Description This fu...

Page 24: ...s Long ByVal eoi As Integer status As Integer Parameters buf the buffer storing the data to send count the maximum number of data bytes to be transmitted eoi enable or disable EOI mode of the device 0...

Page 25: ...the talker MTA MLA My Listen Address Assigns the active GPIB board as the listener MLA DATA Starts the data part Before the DATA command the GPIB board has to be set as the talker Strings are enclose...

Page 26: ...face Card User s Manual WAITSRQDEVICE Description This function waits until a device is requesting service or a timeout error occurs Syntax Microsoft C C and Borland C long int waitSRQDevice long int...

Page 27: ...functions 2 5 IEEE 488 board level functions 2 6 IEEE 488 2 functions 2 7 Data Types 2 8 NI command compatible function reference 2 9 ibask 2 9 ibbna 2 11 ibcac 2 11 ibclr 2 12 ibcmd 2 12 ibcmda 2 13...

Page 28: ...2 33 ibwrta 2 34 ibwrtf 2 35 Multi device functions 2 36 AllSpoll 2 36 DevClear 2 36 DevClearList 2 36 EnableLocal 2 37 EnableRemote 2 37 FindLstn 2 38 FindRQS 2 38 PassControl 2 38 PPoll 2 39 PPollCo...

Page 29: ...ineers at 1 800 KEITHLEY US only or visit our website at www keithley com Using NI Command Compatible functions This section provides the fundamentals of building Windows XP 2000 Vista applications us...

Page 30: ...e needed control from the Toolbox 2 Draw the control on the form Alternatively to place the default sized control on the form click the form Use the Select Objects tool to reposition or resize control...

Page 31: ...2 Select Build from the Build menu Visual C C 4 0 and higher 3 Remember to link the NI command compatible import library GPIB 32 lib Overview of NI command compatible functions The NI command compatib...

Page 32: ...device Table 2 2 IEEE 488 board level functions Function Description ibask Returns the current value of the selected configuration item ibcac Sets the assigned GPIB board to be the active controller b...

Page 33: ...DevClear Sends the Selected Device Clear SDC GPIB message to clear the selected device DevClearList Clears multiple devices EnableLocal Sends Go To Local GTL GPIB message to multiple devices to allow...

Page 34: ...2 ssize_t 32 bit signed integer 2147483648 2147483647 Long Long Cardinal U32 size_t 32 bit unsigned integer 0 4294967295 Unsigned long Not supported Placed by I32 Single F32 32 bit single precision fl...

Page 35: ...fer to valid options as shown in Table 2 5 and Table 2 6 value the current value of the selected configuration item returned Return Value The value of the ibsta Error Codes EARG ECAP EDVR Table 2 5 ib...

Page 36: ...ansfer ibaSpollBit 0x0016 0 Disable the SPOLL bit of the ibsta 1 Enable the SPOLL bit of the ibsta ibaSendLLO 0x0017 0 The GPIB LLO command is not sent while the device is connected by ibfind or ibdev...

Page 37: ...vel writing or reading ibaEOSrd 0x000C 0 Ignore the EOS character during reading 1 The reading is stopped while the EOS character is read ibaEOSwrt 0x000D 0 The EOI line is not set to enable when the...

Page 38: ...reating the ATN signal without considering any current data transfer for asynchronous control Support Level Board level Syntax Microsoft C C and Borland C int ibcac int ud int synchronous Visual Basic...

Page 39: ...ronously Command words are used to configure the GPIB status and control GPIB devices ibwrt is used to send the device self control command To return the number of transferred command bytes in the glo...

Page 40: ...int value Syntax Visual Basic idconfig ByVal ud As Integer ByVal opt As Integer ByVal v As Integer As Integer or call ibconfig ByVal ud As Integer ByVal opt As Integer ByVal v As Integer Parameters ud...

Page 41: ...pairs of bytes during reading Default 0 ibcWriteAdjust 0x0014 0 No byte swapping 1 Swap pairs of bytes during writing Default 0 ibcSpollBit 0x0016 0 Disable the SPOLL bit of the ibsta 1 Enable the SP...

Page 42: ...imeout value eot enable or disable the device EOI mode eos configure the device EOS character and device EOS modes ibcREADDR 0x0006 0 Unnecessary addressing is not operated during device level writing...

Page 43: ...rd descriptor dma enable or disable DMA mode Return Value The value of the ibsta Error Codes EARG ECAP EDVR ENEB EOIP ibeot Description This command enables or disables the action that is setting GPIB...

Page 44: ...tions and the corresponding values of v Configure bit A and bit C to determine how to terminate the I O reading If bit A is set and bit C is clear the I O reading is terminated when a byte that matche...

Page 45: ...oft C C and Borland C int ibfind const char boardname Visual Basic ibfind ByVal boardname As String As Integer or call ibfind ByVal boardname As String ud As Integer Parameters boardname board name fo...

Page 46: ...has the capability to automatically detect the status of each GPIB control line The upper byte bits 8 to 15 shows the status of the GPIB control line A description of each byte is listed in Table 2 1...

Page 47: ...vice if ud is a device descriptor If a listener is detected a non zero value is returned in the found_listener pad device primary address addressing value between 0 and 30 sad the device secondary add...

Page 48: ...led use ibdev or ibfind to access the board or device Support Level Board device level Syntax Microsoft C C and Borland C int ibonl int ud int onl Visual Basic ibonl ByVal ud As Integer ByVal onl As I...

Page 49: ...nts specified by mask are monitored by ibnotify while one or more of the events appears the callback function is called For board level ibnotify call all mask bits are valid except for ERR and RQS For...

Page 50: ...ion This command sets or disables a board or device secondary GPIB address Support Level Board device level Syntax Microsoft C C and Borland C int ibsad int ud int v Visual Basic ibsad ByVal ud As Int...

Page 51: ...lel Poll Disable PPD message Valid parallel poll messages are 96 to 126 hex 60 to hex 7E or zero corresponding to sent PPD If ud is a board descriptor ibppc uses the parallel poll configuration value...

Page 52: ...s Integer buf As String ByVal cnt As Long As Integer or call ibrd ByVal ud As Integer buf As String Parameters ud device descriptor buf the buffer that stores the data that is read from the GPIB cnt t...

Page 53: ...As String ByVal cnt As Long As Integer or call ibrda ByVal ud As Integer buf As String Parameters ud device descriptor buf the buffer that stores the data that is read from the GPIB cnt the number of...

Page 54: ...ion This command performs parallel polling Support Level Board device level Syntax Microsoft C C and Borland C int ibrpp int ud char ppr Visual Basic ibrpp ByVal ud As Integer ppr As Integer As Intege...

Page 55: ...e response is set If automatic sequential polling is enabled the device has already been polled and the previous status byte value is returned by ibrsp Support Level Device level Syntax Microsoft C C...

Page 56: ...or call ibsic ByVal ud As Integer Parameters ud device descriptor Return Value The value of the ibsta Error Codes EARG EDVR ENEB EOIP ESAC ibsre Description This command sets or clears the Remote Enab...

Page 57: ...tion This command sets the board or device timeout period The timeout period is the maximum continuous time allowed for synchronous I O operation ibrd and ibwrt for example or the maximum waiting time...

Page 58: ...more events described by mask including TIMO to occur If TIMO in the wait mask is set ibwait returns when the timeout period has expired even if no other GPIB events occur Setting TIMO to zero returns...

Page 59: ...alker LACS 2 4 GPIB board as a listener DTAS 1 2 GPIB board is in Device Trigger Status DCAS 0 1 GPIB board is in Device Clear Status Return Value The value of the ibsta Error Codes EARG EBUS ECIC EDV...

Page 60: ...l When ud is a board descriptor the board level ibwrt automatically writes cnt data bytes from the buffer to the GPIB device Normally this operation ends when the count data bytes are completely writt...

Page 61: ...a bytes have been written if all the bytes are not written during the timeout period the operation stops with an error The number of bytes actually transferred is returned in the global variable ibcnt...

Page 62: ...yVal board_desc As Integer addressList As Integer resultList As Integer Parameters board_desc board ID addressList the list of the device addresses ended by NOADDR resultList the list of sequential po...

Page 63: ...ssage to multiple devices This sets multiple devices in local mode allowing local operation If only the constant in addrlist is NOADDR the Remote Enable REN GPIB line is set to disable Syntax Microsof...

Page 64: ...indLstn ByVal ud As Integer padList As Integer resultList As Integer ByVal maxNumResults As Integer Parameters board_desc board ID padList the list of the GPIB primary addresses ended by NOADDR result...

Page 65: ...oller can simultaneously obtain one bit status messages relayed from up to eight devices when parallel polling is performed Syntax Microsoft C C and Borland C void PPoll int board_desc short result Vi...

Page 66: ...Integer addressList As Integer Parameters board_desc board ID addressList the list of the device addresses ended by NOADDR Error Codes EAGR EBUS ECIC EDVR EOIP ENEB RcvRespMsg Description This command...

Page 67: ...addressing to a talker setting the interface to a receiver reading count data bytes from the device and storing these data bytes into the buffer The operation is normally stopped when the count data...

Page 68: ...s three steps First reset the GPIB by controlling the Remote Enable REN line and then controlling the Interface Clear IFC line Second send the Universal Device Clear DCL GPIB message to clear all devi...

Page 69: ...mand bytes in the global variable ibcntl Syntax Microsoft C C and Borland C void SendCmds int board_desc const void cmdbuf long count Visual Basic call SendCmds ByVal ud As Integer ByVal cmdbuf As Str...

Page 70: ...interface to talk and then transfers the data from the buffer to the devices If eotmode is DABend the EOI line is set to enable while the final byte is sent If eotmode is NULLend the EOI line is set...

Page 71: ...messages SendLLO is reserved for use in uncommon local remote situations Under typical situations SetRWLS is used to place a device in remote with lockout Syntax Microsoft C C and Borland C void Send...

Page 72: ...ero value Otherwise the result contains a zero value TestSRQ is used to get the current status of GPIB SRQ line WaitSRQ is used to wait until the device controls the GPIB SRQ line Syntax Microsoft C C...

Page 73: ...e GET messages are sent to the devices that are currently listen active on the GPIB bus Syntax Microsoft C C and Borland C void Trigger int board_desc Addr4882_t address Visual Basic call Trigger ByVa...

Page 74: ...returns the result contains a non zero value if the SRQ line in controlled Otherwise the result contains a zero value Get the current status of the GPIB SRQ line by using TestSRQ Use WaitSRQ to wait...

Page 75: ...Appendix A Status Error Codes In this section Topic Page NI command compatible status codes A 2 NI command compatible function error codes A 3...

Page 76: ...means the condition did not occur Table A 1 NI command compatible status codes Mnemonic Position Hex Type Description ERR 15 8000 device board GPIB error TIMO 14 4000 device board Timeout END 13 2000...

Page 77: ...Table A 2 NI command compatible function error codes Error Mnemonic iberr Value Meaning Description EDVR 0 OS error ECIC 1 Function requests GPIB board as CIC ENOL 2 No listen device on the GPIB bus E...

Page 78: ...This page left blank intentionally A 4 KPCI 488LPA 900 01 Rev A December 2008 Appendix A Status Error Codes Model KPCI 488LPA GPIB Controller Interface Card User s Manual...

Page 79: ...Unstable Will not read applied input Overload Calibration only Certificate of calibration required Data required attach any additional sheets as necessary Show a block diagram of your measurement sys...

Page 80: ......

Page 81: ......

Page 82: ...of Keithley Instruments Inc All other trademarks and trade names are the property of their respective companies A G R E A T E R M E A S U R E O F C O N F I D E N C E Keithley Instruments Inc Corporate...

Reviews: