Home

NI-VISA Programmer Reference Manual

image

Contents

1. Error Codes Values Meaning VI_ERROR_NIMPL_OPER BFFF0081h The given operation is not implemented VI ERROR INV LENGTH BFFF0083h Invalid length specified VI ERROR INV MODE BFFF0091h The specified mode is invalid VI ERROR SESN NLOCKED BFFF009Ch The current session did not have any lock on the resource VI ERROR MEM NSHARED BFFF009Dh The device does not export any memory VI ERROR LIBRARY NFOUND BFFFOO9Eh code library required by VISA could not be located or loaded VI_ERROR_NSUP_INTR BFFF009Fh The interface cannot generate an interrupt on the requested level or with the requested statusID value VI ERROR LINE BFFFOOAOh The value specified by the line parameter is invalid VI_ERROR_FILE_ACCESS BFFFOOA Ih An error occurred while trying to open the specified file Possible reasons include an invalid path or lack of access rights VI_ERROR_FILE_IO BFFFOOA2h An error occurred while performing on the specified file VI ERROR NSUP LINE BFFF00A3h One of the specified lines trigSrc or trigDest is not supported by this VISA implementation or the combination of lines is not a valid mapping VI ERROR NSUP MECH BFFF00A4h The specified mechanism is not supported by the given event type VI ERROR INTF NUM NCONFIG BFFF00A5h The interface type is valid but the specified interface number is not configured VI ERROR CONN LOST BFFF00A6h The co
2. Completion Codes Description VI_SUCCESS Mapping successful Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_NSUP_OPER The given vi does not support this operation VI ERROR INV SPACE Invalid address space specified VI ERROR INV OFFSET Invalid offset specified VI ERROR NSUP OFFSET Specified region is not accessible from this hardware VI ERROR TMO viMapAddress could not acquire resource or perform mapping before the timer expired VI ERROR INV SIZE Invalid size of window specified VI ERROR ALLOC Unable to allocate window of at least the requested size VI ERROR INV ACC MODE Invalid access mode VI ERROR WINDOW MAPPED The specified session already contains a mapped window VI ERROR INV SETUP Unable to start operation because setup is invalid due to attributes being set to an inconsistent state Description The viMapAddress operation maps in a specified memory space The memory space that is mapped is dependent on the type of interface specified by the vi parameter and the mapSpace parameter The address parameter returns the address in your process space where memory is mapped The following table lists the valid entries for the mapSpace parameter National Instruments Corporation 5 59 NI VISA Programmer Reference Manual Chapter 5 Operations Value Description VXI VME and VI_A16_SPACE
3. Access Privilege Data Type Range Default Read Write ViUInt16 VI ASRL END NONE 0 VI ASRL END Local VI ASRL END LAST BIT 1 VI ASRL END TERMCHAR 2 VI ASRL END BREAK 3 Description VI ATTR ASRL END OUT indicates the method used to terminate write operations If it is set to ASRL END NONE the write will transmit the exact contents of the user buffer without modifying it and without appending anything to the data being written Ifitissetto VI ASRL END LAST BIT andVI ATTR SEND END ENissetto VI TRUE the write will send all but the last character with the highest bit clear then transmit the last character with the highest bit set For example if VI ATTR ASRL DATA BITS is set to 8 the write will clear the 8th bit for all but the last character then transmit the last character with the 8th bit set If VI SEND END EN is set to VI FALSE the write will send all the characters with the highest bit clear Ifitissetto VI ASRL END TERMCHAR and VI ATTR SEND END EN is set to VI TRUE the write will send the character in VI ATTR TERMCHAR after the data being transmitted If ATTR SEND END ENissetto VI FALSE the write will transmit the exact contents of the user buffer without modifying it and without appending anything to the data being written If itis set to
4. Access Data Privilege Type Range Default Read Write VilInt16 VI_STATE_ASSERTED 1 VI_STATE_UNASSERTED Global VI_STATE_UNASSERTED 0 VI_STATE_UNKNOWN 1 Description If set to VI STATE ASSERTED it suspends character transmission and places the transmission line in a break state until this attribute is reset to VI_STATE_UNASSERTED This attribute lets you manually control the assertion state and length of a break signal If you want VISA to automatically send a break signal after each write operation use the VI_ATTR_ASRL_BREAK_LEN and VI_ATTR_ASRL Related Items END_OUT attributes instead Refer to the VI ATTR ASRL BREAK LEN VI ATTR ASRL END OUT and VI ATTR ASRL ALLOW TRANSMIT descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 7 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL CTS STATE Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Only Vilnt16 VI STATE ASSERTED 1 Global VI_STATE_UNASSERTED 0 VI_STATE_UNKNOWN 1 Description VI_ATTR_ASRL_CTS_STATE shows the current state of the Clear To Send CTS input signal Related Items Refer to the VI_ATTR_ASRI L DCD STATE VI ATTR ASRL DSR
5. Value Action Description VI TRIG TTLO Unmap the specified VXI TTL trigger line VI TRIG TTL7 VI TRIG ECLO Unmap the specified VXI ECL trigger line VI TRIG VI TRIG PANEL IN Unmap the controller s front panel trigger input line VI TRIG PANEL OUT Unmap the controller s front panel trigger output line NI VISA Programmer Reference Manual 5 152 ni com Special Values for trigDest Parameters Chapter 5 Operations Value Action Description VI_TRIG_TTLO VI_TRIG_TTL7 Unmap the specified VXI TTL trigger line VI TRIG ECLO Unmap the specified VXI ECL trigger line VI TRIG ECL1 VI TRIG PANEL IN Unmap the controller s front panel trigger input line VI TRIG PANEL OUT Unmap the controller s front panel trigger output line VI TRIG ALL Unmap all trigger lines to which trigSrc is currently connected This operation unmaps only one trigger mapping per call In other words if viMapTrigger was called multiple times on the same BACKPLANE Resource and created multiple mappings for either trigSrc or trigDest trigger mappings other than the one specified by trigSre and trigDest should remain in effect after this call completes Related Items Refer to the viMapTrigger description of this chapter and the BACKPLANE Resource description of Appendix B Resources National Instruments Corporation
6. Events VI EVENT IO COMPLETION NI VISA Programmer Reference Manual B 6 ni com Resource National Instruments Corporation B 7 Appendix B Resources Operations viln8 vi space offset vals 1 16 space offset 116 viln32 vi space offset val32 viMapAddress vi mapSpace mapBase mapSize access suggested address viMove vi srcSpace srcOffset srcWidth destSpace destOffset destWidth length viMoveAsync vi srcSpace srcOffset srcWidth destSpace destOffset destWidth length jobId viMovelIn8 vi space offset length buf8 1 16 space offset length buf16 viMoveIn32 vi space offset length buf32 viMoveOut8 vi space offset length buf8 viMoveOuti6 vi space offset length buf16 viMoveOut32 vi space offset length buf32 viOut8 vi space offset val8 viOut16 vi space offset 116 viOut32 vi space offset val32 viPeek8 vi addr val8 viPeek16 vi addr 116 viPeek32 vi addr val32 viPoke8 vi addr vals viPokel6 vi addr 116 viPoke32 vi addr val32 viUnmapAddress vi This section lists the attributes events and operations for the INTFC Resource The attributes events and operations in the VISA Resource Template are available to this resource in addition to the attributes and operations listed below Attributes VI ATTR STATUS BYTE VI ATTR A
7. 2 2 3 49 VI ATIR GPIB UNADDR EN nete nti t eei 3 50 VI ATTR IMMEDIATE SERV cerent rennen rennen 3 51 02 ee niece ee tein 3 52 VI ATIR INTE NUM e tet RR que eee etre 3 53 VI ATIR PARENT NUM ettet ttbi eene dn 3 54 NI VISA Programmer Reference Manual vi ni com Contents a te Ee tee idee 3 55 VI ATTR INTR STATUS ID intet ere tree reste 3 56 NVI ATTR IO PROT ER E ERR NER Rete 3 57 VIE ATTR JOB ID ti tnt e ee Fr eed OT eue quy 3 58 VI ATTR MAINFRAME LA Ae HER Tee EUER 3 59 VI ATTR MANEID eter RR 3 60 VI AITR MANE NAME rh Rr e RU Ha EARTH bd Pea te MEE te ETE 3 61 VI ATTR MAX QUEUBE LENGTH rrt pitt ee ade ptis 3 62 VI ATTR MEM BASE iii ter ete bei e o a ede device EES 3 63 VATTR MEM SE eeu ie qeoieconiis 3 64 VI MEM SPACE tn ten RC net ved de eb etae Pee 3 65 VI ATTR MODEL CODE tee tete P a diede E 3 66 VI AITR MODEL NAME t e e ree ERR ERE cad tv teri e edens 3 67 VI ATTR OPER NAME 5 eodeni pp drerit er edis 3 68 VE ATTR PXI BUS NUM iine ERR es EEEE 3 69 VL ATTR PXI GHASSIS endete redeo paa tein 3 70 VI
8. 24024440 iiaeia ei ees an 4 8 VICEVENTZCLEBAR i tede Hebe e eerte E e pO 4 9 VIZEVENT EXCEPTION Aet e ELE RE e ete etel EO prece 4 10 VICEVENT ZGPIBZCIG rettet ettet eta ede fortes 4 12 VI EVENT GPIB LISTEN aiii eI onde ie qi e ege aede tete al 4 13 VI EVENTGPIB FALDK ttu ate eerte tere eh 4 14 VI EVENT IO COMPLETION 4 uide eta a te e eta al 4 15 VISEVENTSPXT INTR 4 16 VI EVENT SERVICE REQ 35i etd tot a dese o eis 4 17 VICEVENT STRIG tee a ah de p eee e e eu yh 4 18 VI EVENT USB INTR n nir rei dee eer ET an Te 4 19 VI CEVENT VXI SSIGP uH eR edet anite eut 4 20 VI EVENT VXI L VME INTR cede ee eb dede e te tete ad 4 21 VI EVENT VXI SYSFALL nete e ea tette ts 4 22 VI EVENT VXI VME SYSREBESET ian etii dd eee tte te reos 4 23 Chapter 5 Operations VrAssertIntrS1gn l rtr be E E on ob ee e pn 5 2 VrASSett TIS BEF ent tebbistetiea enclave E E S 5 4 viAssert UtilSignal 5 eei dt epp etenim 5 7 VIBUPREAG PIE 5 9 VIBUEWTIE cio nee babu ck nce e irte d eie SEN 5 12 VICI CAI areae eee ere nette eee oe Yous IP re pese petite 5 14 Gn cR 5 16 viDisableEVent oe ten eed ede ee PE ad tae 5 18 National Instruments Corporation ix NI VISA Programmer Reference Manual Contents vibiscardEVents x ise teas audi
9. ee EA 3 25 VEATTR BUFFER i eoe reto HERES 3 26 VI ATIR CMDRLLEA 5352 eet ai d RE d Jovian ces A TRES 3 27 VI ATIR DEST ACCESS PRIV tense eee 3 28 VI ATTR DEST BYTE ORDER utere ertet tre oet eret Heredes 3 29 VI ATIR DEST INCREMENT tte te ete ebd epe e ep hedge 3 30 VI ATIR DEV STATUS BYTE iioii et eto te ect ten ipee eda 3 31 VILATTRIDMA ALLOW EN neenon peer 3 32 ire ep re e d RR 3 33 VEATIR FDC iR De p 3 34 VI ATIR FDC MODEL needed d e er et M etie eS 3 35 VI ATIR FDC USE PAIR hende elemen due 3 36 VI ATTRZEIEE APPEND EN inen ier Re ghe re ee e rre G 3 37 VI ATIR GPIB ADDR 3 38 STATE eter Reine ee A RE Reo oen Eve cd 3 39 VI ATIR GPIB CIC STATE 2 ete teens 3 40 VI ATTR GPIB 5488 LEN erem Henne eene ene 3 41 NDAC STATE epe reete rtr eb sata reps n 3 42 VI ATTR GPIB PRIMARY ADDBDR eee eene enne ennemi 3 43 VI ATIR GPIB READDR EN tette re RO pee repete een 3 44 VI ATTR GPIB RECV CIC STATE i ciet tette ea eee fe ao 3 45 VI ATIR GPIB REN STATE 3 46 VI GPIB SECONDARY 3 47 VI ATIR GPIB SRO STATE enirn tit ett pe ep ep regere 3 48 VI ATTR GPIB SYS CNTRL STATE
10. National Instruments Corporation 4 9 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT EXCEPTION Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Description This event notifies the application that an error condition has occurred during an operation invocation In VISA exceptions are defined as events The exception handling model follows the event handling model for callbacks and is like any other event in VISA except that the queueing and suspended handler mechanisms are not allowed A VISA operation generating an exception blocks until the exception handler execution is completed However an exception handler sometimes may prefer to terminate the program prematurely without returning the control to the operation generating the exception VISA does not preclude an application from using a platform specific or language specific exception handling mechanism from within the VISA exception handler For example the C try catch block can be used in an application in conjunction with the C throw mechanism from within the VISA exception handler When using the C try catch throw or other exception handling mechanisms the control will not return to the VISA system This has some important repercussions e I
11. Parameters Name Direction Description vi IN Unique logical identifier to a session buf OUT Location of a buffer to receive data from device count IN Number of bytes to be read jobId OUT Job ID of this asynchronous read operation Return Values Completion Codes Description VI_SUCCESS Asynchronous read operation successfully queued VI_SUCCESS_SYNC Read operation performed synchronously National Instruments Corporation 5 117 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR QUEUE ERROR Unable to queue read operation VI ERROR IN PROGRESS Unable to queue the asynchronous operation because there is already an operation in progress Description The viReadAsync operation asynchronously transfers data The data read is to be stored in the buffer represented by buf This operation normally returns before the transfer terminates Before calling this operation you should enable the session for receiving I O completion events After the transfer has completed an I O completion event is posted The operation returns jobId which you can use with either viTerminate to abort the operation or
12. National Instruments Corporation 3 137 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR VXI VME SYSFAIL STATE Resource Classes GPIB VXI BACKPLANE VXI BACKPLANE Attribute Information Access Privilege Data Type Range Default Read Only VilInt16 VI_STATE_ASSERTED 1 N A Global VI_STATE_DEASSERTED 0 VI_STATE_UNKNOWN 1 Description This attribute shows the current state of the VXI VME SYSFAIL SYStem FAILure backplane line Related Items Refer to the VI ATTR VXI TRIG STATUS and VI ATTR VXI E INTR STATUS descriptions of this chapter Also refer to the BACKPLANE Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 138 ni com Chapter 3 Attributes ATTR WIN ACCESS Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 VI_NMAPPED 1 VI_NMAPPED Local VI_USE_OPERS 2 VI_DEREF_ADDR 3 Description VI_ATTR_WIN_ACCESS specifies the modes in which the current window may be accessed e If VI_NMAPPED the window is not currently mapped e USE OPERS the window is accessible through the and viPokeXx operations only e DEREF ADDR you can either use operations or directly der
13. Access Privilege Data Type Range Default Read Write ViUInt16 VI_ASRL_END_NONE 0 VI_ASRL_END_TERMCHAR Local VI_ASRL_END_LAST_BIT 1 VI_ASRL_END_TERMCHAR 2 Description VI_ATTR_ASRL_END_IN indicates the method used to terminate read operations e Ifitis set to VI ASRL END NONE the read will not terminate until all of the requested data 1s received or an error occurs e fitissetto VI ASRL END LAST the read will terminate as soon as a character arrives with its last bit set For example if VI ATTR ASRL DATA BITS is set to 8 the read will terminate when a character arrives with the 8th bit set e If it is set to VI END TERMCHAR the read will terminate as soon as the character in VI ATTR TERMCHAR is received In this case TERMCHAR is ignored Because the default value of vr ATTR TERMCHAR is OAh linefeed read operations on serial ports will stop reading whenever a linefeed is encountered To change this behavior you must change the value of one of these attributes VvI ATTR ASRL END IN or VI ATTR TERMCHAR Related Items Refer to the vr ATTR ASRL END OUT and VI ATTR TERMCHAR descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 14 ni com Chapter 3 Attributes VI ATTR ASRL END OUT Resource Classes Serial INSTR Attribute Information
14. Name Direction Description buf OUT The data buffer that receives the data from the optional data stage of the control transfer This is ignored if wLength is 0 retCnt OUT Number of bytes actually transferred in the optional data stage of the control transfer This parameter may be VI_NULL if you do not need this information Return Values Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI_ERROR_TMO Timeout expired before operation completed VI ERROR INV SETUP Unable to start write operation because setup is invalid due to attributes being set to an inconsistent state VI ERROR IO An unknown I O error occurred during transfer VI ERROR CONN LOST The I O connection for the given session has been lost VI ERROR INV PARAMETER The value of some parameter which parameter is not known is invalid VI ERROR INV MASK The bmRequestType parameter contains an invalid mask Description The viUsbControlIn operation synchronously performs a USB control pipe transfer from the device The values of the data payload in the setup stage of the control transfer are taken as parameters and include bmRequestType bRequest wValue wIndex and wLength An optional data bu
15. Parameters Name Direction Description vi IN Unique logical identifier to a session readFmt IN String describing the format to apply to params params OUT A list with the variable number of parameters into which the data is read and the format string is applied Return Values Completion Codes Description VI_SUCCESS Data was successfully read and formatted into params parameter s NI VISA Programmer Reference Manual 5 164 ni com Chapter 5 Operations Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR IO Could not perform read operation because of I O error VI ERROR TMO Timeout expired before read operation completed VI ERROR INV FMT A format specifier in the readF mt string is invalid VI_ERROR_NSUP_FMT A format specifier in the readF mt string is not supported VI ERROR ALLOC The system could not allocate a formatted I O buffer because of insufficient resources Description This operation is similar to viScanf except that the params parameters list provides the parameters rather than separate arg parameters R Note Because the prototype for this function cannot provide complete type checking remember that all output parameters
16. VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access NI VISA Programmer Reference Ma nual 5 136 ni com Chapter 5 Operations Error Codes Description VI ERROR ALLOC The system could not allocate the buffer s of the specified size because of insufficient resources VI ERROR INV MASK The system cannot set the buffer for the given mask Description The viSetBuf operation changes the buffer size of the read and or write buffer for formatted I O and or serial communication The mask parameter specifies the buffer for which to set the size The mask parameter can specify multiple buffers by bit ORing any of the following values together Flags Interpretation VI READ BUF 1 Formatted I O read buffer VI WRITE BUF 2 Formatted I O write buffer VI IO IN BUF 16 I O communication receive buffer VI IO OUT BUF 32 I O communication transmit buffer call to visetBu flushes the session s related Read Write buffer s Although you can explicitly flush the buffers by making a call to virlush the buffers are flushed implicitly under some conditions These conditions vary for the viPrintf and viScanf operations Since not all serial drivers support user defined buffer sizes it is possible that a specific implementation of VISA may not be able to contr
17. E_PATR to VI_TRUI Access Privilege Data Type Range Default Read Write ViBoolean VI_TRUE 1 VI_FALSE Local VI_FALSE 0 data Otherwise only one channel will be used Related Items E specifies to use a channel pair for transferring Refer to the vr ATTR FDC CHNL and VI ATTR FDC MODE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR FILE APPEND EN Chapter 3 Attributes Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViBoolean VI_TRUE 1 VI_FALSE Local VI_FALSE 0 Description This attribute specifies whether viReadToFile will overwrite truncate or append when opening a file Related Items Refer to viReadToFile description of Chapter 5 Operations Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR GPIB ADDR STATE Resource Classes GPIB INTFC GPIB SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViInt16 VI GP
18. The VXI interrupt level on which the interrupt was received Related Items Refertothe VI ATTR EVENT TYPE VI ATTR INTR STATUS ID and VI ATTR RECV INTR LEVEL descriptions of Chapter 3 Attributes Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 4 21 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT VXI VME SYSFAIL Resource Classes VXI BACKPLANE Description Notification that the VXI VME SYSFAIL line has been asserted Event Attributes Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event Related Items Refertothe vr ATTR EVENT TYPE description of Chapter 3 Attributes Also refer to the BACKPLANE Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 4 Events VI EVENT VXI VME SYSRESET Resource Classes VXI BACKPLANE VXI SERVANT Description Notification that the VXI VME SYSRESET line has been asserted Event Attributes Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event Related Items Refer to the ATTR EVENT TYPE description of Chapter 3 Attributes Also refer to the BACKPLANE Resource and SERVANT Resource descriptions of Appendix B Resources National Instruments Corporation 4 23 NI V
19. 4 dra i dete tiec 5 90 viOut8 viOut16 viOut32 5 92 VIP ATSER 5 soie duode eue E E 5 95 VIParse RSICEX tbe Tee 5 97 viPeek87viPeekTOo viPeek32 v ae er 5 100 1 8 16 1 32 5 101 ursus BI EIE 5 102 jj M 5 112 VIR CAG De undae aded o met etn 5 114 ViRead ASync cecidi geo ano gei gn pole qon 5 117 viReadS TB sostenuta tem 5 119 viReadToFile tabs tnm aee ntc dite 5 121 VAS CAME Jc e A RIVA nM 5 124 viSetAttribute i eite tieniti edidi an eae 5 134 5 136 5 138 VIS S CAML Ses eo aed attive dee d tet ebat 5 140 VIS tatus esc ssa qe ERO e utu desees is 5 142 vaTerimiiate iacet m dta oi ndun iN 5 144 viUnmstallHandler 3 2 B est 5 146 NI VISA Programmer Reference Manual X ni com Contents VS 5 148 viUnmapAddress eat eee rie tonne sas db pri POI CERT 5 150 viUnmapTrigget s um na et tn RENE DE URINE ERR SR teeta Ene ee reped 5 151 viUsbCGontrolIn 5 5 3 pre Rete et ONU E TU a S TREE DUNS CN 5 154 viUsbControlOUt i e EGRE ERIS ve 5 157 VIVPrintE itd d aee ped du 5 160 WAV QUEL E E 5 162 HR VEG E EDI SHEE
20. Completion Codes Description VI_SUCCESS The operation completed successfully Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR SRQ NOCCURRED Service request has not been received for the session National Instruments Corporation 5 119 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI_ER ROR_TMO Timeout expired before operation completed VI_ER ROR_RAW_WR_PROT_VIOL Violation of raw write protocol occurred during transfer VI_ER ROR_RAW_RD_PROT_VIOL Violation of raw read protocol occurred during transfer VI_ERROR_BERR Bus error occurred during transfer VI_ERROR_NCIC The interface associated with the given vi is not currently the controller in charge VI_ERROR_NLISTENERS No Listeners condition is detected both NRFD and NDAC are unasserted VI_ER ROR_INV_SETUP Unable to start operation because setup is invalid due to attributes being set to an inconsistent state VI_ER ROR_CONN_LOST The I O connection for the given session has been lost Description The operation reads a service request status from a service
21. MEM BASE BARO VI MEM BASE BARA VI ATTR PXI MEM TYPE ATTR PXI MEM TYPE ATTR PXI MEM BASE MI MI MI MI ATTR PXI MEM BASE BAR3 BAR5 BAR1 BAR3 ATTR PXI MEM BASE 5 descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 3 Attributes VI ATTR PXI TYPE BARO VI ATTR MEM BAR1 VI ATTR PXI MEM TYPE BAR2 VI ATTR PXI MEM TYPE BAR3 VI ATTR PXI MEM TYPE BARA VI ATTR PXI MEM TYPE BARS Resource Classes PXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 VI PXI ADDR NONE 0 N A Global VI PXI ADDR MEM 1 VI PXI ADDR IO 2 Description Memory type used by the device in the specified BAR if applicable Related Items Refer to the VI ATTR PXI MEM SIZE BARO VI ATTR PXI MEM SIZE BAR1 EM SIZE BAR2 VI EM SIZE BARA VI VI ATTR PXI MEM BASE BARO VI VI ATTR PXI MEM BASE BAR2 VI VI ATTR PXI MEM BASE BARA VI VI ATTR PXI VI ATTR PXI M M M M ATTR PXI MEM SIZE BAR3 ATTR PXI MEM SIZE BAR5 and ATTR PXI MEM BASE BAR1 ATTR PXI MEM BASE BAR3 ATTR PXI MEM BASE 5 descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources Nati
22. EN specifies whether to unaddress the device UNT and UNL EADDR EN description of this chapter Also refer to the INSTR ni com VI ATTR IMMEDIATE SERV Chapter 3 Attributes Resource Classes GPIB VXI INSTR VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViBoolean VI TRUE 1 N A Global VI FALSE 0 Description VI ATTR IMMEDIATE SI immediate servant of the controller running VISA Related Items Refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation ERV specifies whether the device associated with this session is an NI VISA Programmer Reference Manual Chapter 3 Attributes VI_ATTR_INTF_INST_NAME Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViString N A N A Global Description VI ATTR INTF INST NAME specifies human readable text that describes the given interface Related Items Refer to the vr ATTR INTF NUM and VI ATTR INTF TYPE descriptions of this chapter Also refer to the INSTR Resource MEMACC Resource INTFC Resource BACKPLANE Resource SERVANT Resource and SOCKET Re
23. NI VISA Programmer Reference Manual 5 22 ni com Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_INV_EVENT Specified eventType is not supported by the resource VI_ERROR_INV_MECH Invalid mechanism specified for the event VI_ERROR_INV_CONTEXT Specified event context is invalid VI_ERROR_INV_SETUP Unable to start write operation because setup is invalid due to attributes being set to an inconsistent state VI_ERROR_HNDLR_NINSTALLI A handler is not currently installed for the specified event The session cannot be enabled for the VI_HNDLR mode of the callback mechanism VI_ERROR_NSUP_MECH The specified mechanism is not supported for the given eventType Description The viEnableEvent operation enables notification of an event identified by the eventType parameter for mechanisms specified in the mechanism parameter The specified session can be enabled to queue events by specifying VI_QUEUE Applications can enable the session to invoke a callback function to execute the handler by specifying VI_HNDLR The applications are required to install at least one handler to be enabled for this mode Specifying VI SUSPEND HNDLR enables the session to receive callbacks but the invocation of the handler is deferred to a later time Successive calls to this operation replace the old ca
24. Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event This attribute always has the value of vi EVENT TRIG for this event type VI ATTR RECV TRIG ID The identifier of the triggering mechanism on which the specified trigger event was received Related Items Refer to the VI ATTR TRIG ATTR EVENT and VI ATTR TRIG ID descriptions of Chapter 3 Attributes Also refer to the INSTR Resource INTFC Resource BACKPLANE Resource and SERVANT Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 4 18 ni com Chapter 4 Events VI EVENT USB INTR Resource Classes USB INSTR USB RAW Description This event notifies that a USB interrupt has occurred Event Attributes Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event VI ATTR STATUS Contains the status code returned by this event VI ATTR USB RECV INTR SIZE The number of bytes of USB interrupt data that is stored VI ATTR USB RECV INTR DATA The actual received data from the USB Interrupt Related Items Refertothe VI ATTR EVENT TYPE VI ATTR STATUS VI ATTR USB RECV INTR DATA and VI ATTR USB RECV INTR SIZE descriptions of Chapter 3 Attributes Also refer to the INSTR Resource and RAW Resource descriptions of Appendix B Resources National Instruments
25. ASRL END BREAK and VI ATTR SEND END ENissetto VI the write will transmit a break after all the characters for the write have been sent If ATTR SEND END ENissetto VI FALSE the write will transmit the exact contents of the user buffer without modifying it and without appending anything to the data being written Related Items Refer to the VI ATTR ASRL END INand VI ATTR TERMCHAR descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 15 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL FLOW CNTRL Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI ASRL FLOW NONE 0 VI ASRL FLOW NONE Global VI ASRL FLOW XON XOFF 1 VI ASRL FLOW RTS CTS 2 VI ASRL FLOW DTR DSR 4 Description VI ATTR ASRL FLOW CNTRL indicates the type of flow control used by the transfer mechanism If this attribute is set to VI ASRL FLOW NONE the transfer mechanism does not use flow control and buffers on both sides of the connection are assumed to be large enough to hold all data transferred If this attribute is set to ASRL FLOW XOFF the transfer mechanism uses the XON and XOFF characters to perform flow control The transfer mechanism contr
26. CMDR LA 3 27 VI DEST ACCESS PRIV 3 28 NI VISA Programmer Reference Manual VI ATTR DEST BYTE ORDER 3 29 VI DEST INCREMENT 3 30 VI DEV STATUS BYTE 3 31 VI ATTR DMA ALLOW EN 3 32 VI ATTR EVENT TYPE 3 33 VI ATTR FDC CHNL 3 34 VI ATTR FDC 3 35 VI ATTR FDC USE PAIR 3 36 VI ATTR FILE APPEND EN 3 37 VI GPIB ADDR STATE 3 38 VI ATTR GPIB ATN STATE 3 39 VI ATTR GPIB CIC STATE 3 40 VI GPIB 5488 LEN 3 41 VI ATTR GPIB NDAC STATE 3 42 VI ATTR GPIB PRIMARY ADDR 3 43 VI READDR EN 3 44 VI ATTR GPIB RECV CIC STATE 3 45 VI ATTR GPIB REN STATE 3 46 VI GPIB SECONDARY ADDR 3 47 VI ATTR GPIB SRQ STATE 3 48 VI GPIB SYS CNTRL STATE 3 49 VI ATTR GPIB UNADDR EN 3 50 VI ATTR IMMEDIATE SERV 3 51 VI ATTR INTF INST NAME 3 52 VI ATTR NUM 3 53 VI ATTR INTF PARENT NUM 3 54 VI ATTR INTF TYPE 3 55 VI ATTR INTR STATUS ID 3 56 VI ATTR IO PROT 3 57 VI ATTR JOB ID 3 58 VI ATTR MAINFRAME LA 3 59 VI ATTR MANF ID 3 60 VI ATTR MANF NAME 3 61 VI MAX QUEUE LENGTH 3 62 VI ATTR MEM BASE 3 63 NI VISA Programmer Reference Manual 2 VI MEM SIZE 3 64 VI ATTR MEM SPACE 3 65 VI ATTR MODEL CODE 3 66 VI ATTR MODEL NAME 3 67 VI ATTR OPER NAME 3 68 VI ATTR PXI BUS NUM 3 69 VI ATTR PXI CHASSIS 3 70 VI ATTR
27. GPIB SECONDARY VI USB MAX INTR ADDR 3 47 SIZE 3 124 VI INTF INST VI USB NUM NAME 3 52 INTFCS 3 125 VI ATTR NUM 3 53 VI USB NUM VI ATTR INTF TYPE 3 55 PIPES 3 126 VI ATTR IO PROT 3 57 VI USB PROTOCOL 3 127 NI VISA Programmer Reference Manual I 12 ni com National Instruments Corporation VI RD BUF OPER MODE 3 82 VI SEND END EN 3 97 VI ATTR TERMCHAR 3 111 VI ATTR TERMCHAR EN 3 112 VI VALUE 3 113 VI ATTR TRIG ID 3 114 VI ATTR VXI LA 3 134 VI ATTR VXI VME SYSFAIL STATE 3 138 VI WR BUF OPER MODE 3 144 basic I O services 2 5 events B 10 VI EVENT CLEAR 4 9 VI EVENT GPIB LISTEN 4 13 VI EVENT GPIB TALK 4 14 VI EVENT IO COMPLETION 4 15 VI EVENT TRIG 4 18 VI EVENT VXI VME SYSRESET 4 23 formatted I O services 2 5 operations B 10 viAssertIntrSignal 5 2 viAssertUtilSignal 5 7 viBufRead 5 9 viBufWrite 5 12 viFlush 5 34 viPrintf 5 102 viRead 5 114 viReadAsync 5 117 viReadToFile 5 121 viScanf 5 124 viSetBuf 5 136 viSPrintf 5 138 viSScanf 5 140 viVPrintf 5 160 viVScanf 5 164 viVSPrintf 5 166 viVSScanf 5 168 I 13 Index viWrite 5 176 viWriteAsync 5 178 viWriteFromFile 5 180 purpose and use 2 4 SERVANT Resource type description 2 4 service requests VI EVENT SERVICE REQ 4 17 viReadSTB 5 119 sessions VI ATTR INTF TYPE 3 55 VI ATTR
28. Note For advanced users If the user handler will not return to VISA the application should call viclose on the event context to manually delete the event object This situation may occur when a handler throws a C exception in response to a VISA exception event Normally an application should always return SUCCESS from all callback handlers If a specific handler does not want other handlers to be invoked for the given event for the given session it should return SUCCESS NCHAIN No return value from a handler on one session will affect callbacks on other sessions Future versions of VISA or specific implementations of VISA may take actions based on other return values so a user should return VI SUCCESS from handlers unless there is a specific reason to do otherwise Related Items See viInstallHandler and viUninstallHandler descriptions of this chapter Also refer to the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual 5 26 ni com Chapter 5 Operations viFindNext Purpose Returns the next resource from the list of resources found during a previous call to viFindRsrc C Syntax ViStatus viFindNext ViFindList findList ViChar instrDesc Visual Basic Syntax viFindNext amp ByVal findList amp ByVal instrDesc Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC
29. ASRL FLOW RTS CTS this attribute is Read Only Querying the value will return VI STATE UNKNOWN Related Items Refer to the ATTR ASRL CTS STATI VI ATTR ASRL DSR STATI E ATTR ASRL DCD STATE E VI ATTR ASRL DTR STATE and VI ATTR ASRL RI STATE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 21 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL STOP BITS Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI_ASRL_STOP_ONE 10 VI_ASRL_STOP_ONE Global VI_ASRL_STOP_ONE5 15 VI_ASRL_STOP_TWO 20 Description VI_ATTR_ASRL_STOP_BITS is the number of stop bits used to indicate the end of a frame The value VI ASRL STOP ONES indicates one and one half 1 5 stop bits Related Items Refer to the VI ASRL BAUD VI ATTR ASRI VI ATTR ASRL FLOW L DATA BITS and VI ASRI L PARITY descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 22 ni com Chapter 3 Attributes VI ATTR ASRL WIRE MODE Resource Classes Serial INSTR Attribute Information Access
30. Purpose Pulse the interface clear line IFC for at least 100 microseconds C Syntax ViStatus viGpibSendIFC ViSession vi Visual Basic Syntax viGpibSendIFC amp ByVal vi amp Resource Classes GPIB INTFC Parameters Name Direction Description vi IN Unique logical identifier to a session Return Values Completion Codes Description SUCCESS Operation completed successfully Error Codes Description VI ERROR OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR NSYS CNTLR The interface associated with this session is not the system controller NI VISA Programmer Reference Manual 5 48 ni com Chapter 5 Operations Description This operation asserts the IFC line and becomes controller in charge CIC The local board must be the system controller This operation is valid only on GPIB INTFC interface sessions Related Items Refer to the INTFC Resource description of Appendix B Resources National Instruments Corporation 5 49 NI VISA Programmer Reference Manual Chapter 5 Operations viln8 viln16 viln32 Purpose Reads in an 8 bit 16 bit or 32 bit value from the specified memory space and offset C Syntax ViS
31. Refer to the NI VISA User Manual for detailed information on how to program using VISA Refer to the NI VISA Programmer Reference Manual for specific information about the attributes events and operations such as format syntax parameters and possible errors 3 bold italic The following conventions appear in this manual Square brackets enclose optional items for example response This icon denotes a note which alerts you to important information Bold text denotes items that you must select or click in the software such as menu items and dialog box options Bold text also denotes parameter names Italic text denotes variables emphasis a cross reference or an introduction to a key concept This font also denotes text that is a placeholder for a word or value that you must supply National Instruments Corporation xiii NI VISA Programmer Reference Manual About This Manual monospace monospace bold monospace italic Text in this font denotes text or characters that you should enter 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 operations variables filenames and extensions and code excerpts Bold text in this font denotes the messages and responses that the computer automatically prints to the screen This font also empha
32. Related Items Refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR SRC ACCESS PRIV Resource Classes GPIB VXI INSTR GPIB VXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI_DATA_PRIV 0 VI_DATA_PRIV Local VI_DATA_NPRIV 1 VI_PROG_PRIV 2 VI_PROG_NPRIV 3 VI_BLCK_PRIV 4 VI_BLCK_NPRIV 5 VI_D64_PRIV 6 VI_D64_NPRIV 7 Description VI_ATTR_SRC_ACCESS_PRIV specifies the address modifier to be used in high level access operations such as and viMoveInxXx when reading from the source Note The values 064 PRIV 6 and VI_D64_NPRIV 7 apply to only the block move operations If you set this attribute to one of these values and then call one of the vilnXX operations the operation returns VI_ERROR_INV_SETUP Related Items Refertothe VI ATTR DEST ACCESS PRIV VI ATTR SRC BYTE ORDER VI ATTR SRC INCREMENT and VI ATTR WIN ACCESS PRIV descriptions of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix Resources NI VISA Programmer Reference Manual 3 100 ni com VI ATTR SRC BYTE ORDER Chapter 3 Attributes Resource Classes GPIB VXI INSTR GPIB VXI MEMACC VXI INSTR VXI MEMACC Attribute Inf
33. space IN Specifies the address space Refer to the table included in the Description section offset IN Offset in bytes of the starting address to read length IN Number of elements to transfer where the data width of the elements to transfer is identical to data width 8 16 or 32 bits buf8 buf16 OUT Data read from bus 8 bits for viMovern8 16 bits for or buf32 viMoveIn16 and 32 bits for viMoveIn32 NI VISA Programmer Reference Manual 5 76 ni com Return Values Chapter 5 Operations Completion Codes Description VI_SUCCESS Operation completed successfully Error Codes Description VI _ERROR_INV_OBJECT The given session reference is invalid VI ERROR_NSUP_OPER The given vi does not support this operation VI ERROR LOCKI E s Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR BERR Bus error occurred during transfer VI ERROR INV SPACE Invalid address space specified VI ERROR INV OFFSET Invalid offset specified VI ERROR NSUP OFFSET Specified offset is not accessible from this hardware VI ERROR NSUP WIDTH Specified width is not supported by this hardware VI ERROR INV LENGTH Invalid length specified VI ERROR NSUP ALIGN OFFSET The specified offset is not
34. viParseRsrc descriptions of this chapter Also refer to the VISA Resource Manager description of Appendix B Resources National Instruments Corporation 5 89 NI VISA Programmer Reference Manual Chapter 5 Operations viOpenDefaultRM Purpose This function returns a session to the Default Resource Manager resource C Syntax ViStatus viOpenDefaultRM ViPSession sesn Visual Basic Syntax viOpenDefaultRM amp sesn amp Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description sesn OUT Unique logical identifier to a Default Resource Manager session Return Values Completion Codes Description VI SUCCESS created successfully Session to the Default Resource Manager resource VI WARN CONFIG NLOADED be loaded At least one configured Passport module could not NI VISA Programmer Reference Manual 5 90 ni com Chapter 5 Operations Error Codes Description VI_ERROR_SYSTEM_ERROR The VISA system failed to initialize VI ERROR ALLOC Insufficient system resources to create a session to the Default Resource Manager resource VI ERROR INV SETUP Some
35. Refer to the NI VISA User Manual for more information NI VISA Programmer Reference Manual 5 88 ni com Chapter 5 Operations Address String Description A22 5 INSTR USB 0x1234 125 A USB Test amp Measurement class device with manufacturer ID 0x1234 model code 125 and serial number A22 5 This uses the device s first available USBTMC interface This is usually number 0 SN999 1 RAW USB 0x5678 0x33 raw USB nonclass device with manufacturer ID 0x5678 model code 0x33 and serial number SN999 This uses the device s interface number 1 For the parameter accessMode the value VI_EXCLUSIVE_LOCK 1 is used to acquire an exclusive lock immediately upon opening a session if a lock cannot be acquired the session is closed and an error is returned The value LOAD CONFIG 4 is used to configure attributes to values specified by some external configuration utility Multiple access modes can be used simultaneously by specifying a bit wise OR of the values other than VI NULL NI VISA currently supports VI LOAD CONFIG only on Serial INSTR sessions resource strings returned by virindRsrc will always be recognized by viopen However virindRsrc will not necessarily return all strings that you can pass to viParseRsrc or viOpen This is especially true for network and TCPIP resources Related Items Refer to the viClose viFindRsrc viOpenDefaultRM
36. Resource Classes Serial INSTR Description National Instruments Notification that the Clear To Send CTS line changed state If the CTS line changes state quickly several times in succession not all line state changes will necessarily result in event notifications Event Attributes Symbolic Name Description VI_ATTR_EVENT_TYPE Unique logical identifier of the event Related Items Refer to the VI ATTR EVENT and VI ATTR ASRL CTS STATI Chapter 3 Attributes Also refer to the INSTR Resource description of Resources NI VISA Programmer Reference Manual 4 4 E descriptions of Appendix B ni com Chapter 4 Events VI EVENT ASRL DCD Note This event is valid only on Windows and platforms on which National Instruments supports its ENET Serial products Resource Classes Serial INSTR Description Notification that the Data Carrier Detect DCD line changed state If the DCD line changes state quickly several times in succession not all line state changes will necessarily result in event notifications Event Attributes Symbolic Name Description VI_ATTR_EVENT_TYPE Unique logical identifier of the event Related Items Refer to the and VI_ATTR_ASRL_DCD_STATE descriptions of Chapter 3 Attributes Also refer to the INSTR Resource description of Appendix B Resources National
37. The following three chapters describe the individual attributes events and operations These are listed in alphabetical order within each access mechanism Since a particular item can refer to more than one resource or interface type each item is clearly marked with the resource and interface that support it Refer to Appendix B Resources for a quick reference of how the attributes events and operations map to the available resources NI VISA Programmer Reference Manual 2 6 ni com Attributes This chapter describes the VISA attributes The attribute descriptions are listed in alphabetical order for easy reference Each attribute description contains a list below the title indicating the supported resource classes such as GPIB Serial etc The Attribute Information table lists the access privilege the data type range of values and the default value National Instruments Corporation 3 1 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR 4882 COMPLIANT Resource Classes GPIB VXI INSTR USB INSTR VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViBoolean VI TRUE 1 N A Global VI FALSE 0 Description VI ATTR 4882 COMPLIANT specifies whether the device is 488 2 compliant Related Items Refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 2 ni com VI ATTR ASRL ALLOW TRANSMI
38. VI DEST INCREMENT 3 30 VI ATTR DEV STATUS BYTE 3 31 VI ATTR DMA ALLOW EN 3 32 VI ATTR EVENT TYPE 3 33 VI ATTR FDC CHNL 3 34 VI FDC MODE 3 35 VI ATTR FDC USE PAIR 3 36 VI ATTR FILE APPEND EN 3 37 VI ATTR GPIB ADDR STATE 3 38 VI ATTR STATE 3 39 VI ATTR GPIB CIC STATE 3 40 VI ATTR GPIB 5488 CBL LEN 3 41 VI ATTR GPIB NDAC STATE 3 42 VI GPIB PRIMARY ADDR 3 43 VI ATTR GPIB READDR EN 3 44 VI ATTR GPIB RECV CIC STATE 3 45 VI ATTR GPIB REN STATE 3 46 VI GPIB SECONDARY ADDR 3 47 VI ATTR GPIB SRQ STATE 3 48 National Instruments Corporation 15 Index VI 5 5 CNTRL 5 3 49 VI_ATTR_GPIB_UNADDR_EN 3 50 VI ATTR IMMEDIATE SERV 3 51 VI ATTR INTF INST 3 52 VI ATTR INTF NUM 3 53 VI ATTR INTF PARENT NUM 3 54 VI ATTR INTF TYPE 3 55 VI ATTR INTR STATUS ID 3 56 VI ATTR IO PROT 3 57 VI ATTR JOB ID 3 58 VI MAINFRAME LA 3 59 VI ID 3 60 VI NAME 3 61 VI ATTR MAX QUEUE LENGTH 3 62 VI ATTR MEM BASE 3 63 VI ATTR MEM SIZE 3 64 VI ATTR MEM SPACE 3 65 VI ATTR MODEL CODE 3 66 VI ATTR MODEL NAME 3 67 VI OPER NAME 3 68 VI ATTR PXI BUS NUM 3 69 VI ATTR PXI CHASSIS 3 70 VI ATTR PXI DEV NUM 3 71 VI ATTR PXI FUNC NUM 3 72 VI PXI MEM BASE BARx 3 73 VI ATTR PXI MEM SIZE BAR
39. an INSTR Resource is the offset address relative to the device s allocated address base for the corresponding address space that was specified For example if space specifies VI A16 SPACE then offset specifies the offset from the logical address base address of the specified VXI device If space specifies A24 SPACEOrVI A32 SPACE then offset specifies the offset from the base address of the VXI device s memory space allocated by the VXI Resource Manager within V XI A24 or A32 space MEMACC Specific For MEMACC Resource the offset parameter specifies an absolute address Related Items Refer to the viOut8 viOut16 viOut32 description of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 52 ni com Chapter 5 Operations vilnstallHandler Purpose Installs handlers for event callbacks C Syntax ViStatus vilnstallHandler ViSession vi ViEventType eventType ViHndlr handler ViAddr userHandle Visual Basic Syntax N A Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session eventType IN Logical event identifier hand
40. of Appendix B Resources NI VISA Programmer Reference Manual EFAULT is the only valid PROT_DEFAULT is equivalent to ESERVE are D description of Chapter 3 Attributes Also refer to the INSTR Resource SOCKET Resource BACKPLANE Resource and INTFC Resource descriptions 5 6 ni com viAssertUtilSignal Chapter 5 Operations Purpose Asserts or deasserts the specified utility bus signal C Syntax viStatus viAssertUtilSignal ViSession vi ViUInt16 line Visual Basic Syntax viAssertUtilSignal amp ByVal vi amp ByVal line Resource Classes GPIB VXI BACKPLANE VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session line IN Specifies the utility bus signal to assert This can be the value VI UTIL ASSERT SYSRESET VI UTIL ASSERT SYSFAIL or VI UTIL DEASSERT SYSFAIL Return Values Completion Code Description VI SUCCESS Operation completed successfully Error Codes Description VI ERROR_INV_OBJECT The given session reference is invalid VI _ERROR_NSUP_OPER The given vi does not support this operation VIz ERROR LOCKI E Specified operation could not be performed because the resource identified by vi has been locked for this kind of access National Instruments Corporation 5 7 NI VISA Programmer Reference Manual
41. operation is similar to viRead and does not perform any kind of data formatting It differs from viRead in that the data is read from the formatted I O read buffer the same buffer used by viscanf and related operations rather than directly from the device You can intermix this operation with viScanf but you should not mix it with viRead VI NULL is a special value for the retCount parameter If you pass NULL for retCount the number of bytes transferred is not returned You may find this useful if you need to know only whether the operation succeeded or failed NI VISA Programmer Reference Manual 5 10 ni com Chapter 5 Operations Related Items Refer to the viRead and viBufWrite descriptions of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 11 NI VISA Programmer Reference Manual Chapter 5 Operations viBufWrite Purpose Writes data to a formatted I O write buffer synchronously C Syntax ViStatus viBufWrite ViSession vi ViBuf buf ViUInt32 count ViPUInt32 retCount Visual Basic Syntax viBufWrite amp ByVal vi amp Resource Classes ByVal buf ByVal count amp retCount amp GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Parameters Name Dire
42. 32 bits If the optional 01 modifier is present the data is sent in little endian format otherwise the data sent in standard IEEE 488 2 format The data will be byte swapped and padded as appropriate to native computer format Length modifier z arg points to an array of doubles The count specifies the number of double floats 64 bits If the optional o1 modifier is present the data is sent in little endian format otherwise the data sent in standard IEEE 488 2 format The data will be byte swapped and padded as appropriate to native computer format Byte order modifier ob Data is sent in standard IEEE 488 2 big endian format This is the default behavior if neither ob nor 01 is present Byte order modifier 01 Data is sent in little endian format NI VISA Programmer Reference Manual 5 110 ni com Chapter 5 Operations Other ANSI C Conversion Codes For ANSI C compatibility VISA also supports the following conversion codes for output codes i o u n x X g G and For further explanation of these conversion codes see the ANSI C Standard Also refer to your ANSI C documentation for information on the printf function ER Note VISA will not send out the data across the bus by default until a character is encountered in the format string not the data stream You can modify this behavior with the VI ATTR WR BUF
43. 5 153 NI VISA Programmer Reference Manual Chapter 5 Operations viUsbControlin Purpose Performs a USB control pipe transfer from the device 5 Note This operation is intended only for users familiar with the USB protocol C Syntax ViStatus viUsbControlIn ViSession vi Vilnt16 bmRequestType VilInt16 bRequest ViUInt16 wValue ViUInt16 wIndex ViUInt16 wLength ViPBuf buf ViPUInt16 retCnt Visual Basic Syntax viUsbControlIn amp ByVal vi amp ByVal bmRequestType ByVal bRequest ByVal wValue ByVal wIndex ByVal wLength buf As Byte retCnt Resource Classes USB INSTR USB RAW Parameters Name Direction Description vi IN Unique logical identifier to a session bmRequest IN The bmRequestType parameter of the setup stage of a Type USB control transfer Refer to the USB specification for further details bRequest IN The bRequest parameter of the setup stage of a USB control transfer wValue IN The wValue parameter of the setup stage of a USB control transfer windex IN The wIndex parameter of the setup stage of a USB control transfer This is usually the index of the interface or endpoint wLength IN The wLength parameter of the setup stage of a USB control transfer This value also specifies the size of the data buffer to receive the data from the optional data stage of the control transfer NI VISA Programmer Reference Manual 5 154 ni com Chapter 5 Operations
44. An argument The argument length modifiers specify one of the length following h b B format a The h modifier promotes the argument to a h l L z and codes short or unsigned short depending on the z are legal format code type 520 1 f b B b The 1 modifier promotes the argument to a ANSI C format codes long or unsigned long standard L format c The L modifier promotes the argument to a modifiers code long double parameter z b B format codes 7 b B format codes d The z modifier promotes the argument to an array of floats e The z modifier promotes the argument to an array of doubles Enhanced Modifiers to ANSI C Standards Modifier Supported with Format Code Description A comma followed by an integer n where n represents the array size d plus variants and only The corresponding argument is interpreted as a reference to the first element of an array of size n The first n elements of this list are printed in the format specified by the format code An asterisk may be present after the comma modifier in which case an extra arg is used This arg must be an integer representing the array size of the given type NI VISA Programmer Reference Manual 5 106 ni com Chapter 5 Operations Supported with Modifier Format Code Description 1 plus Converts to an IEEE 488 2
45. Chapter 3 Attributes VI ATTR RSRC CLASS Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViString N A N A Global Description VI ATTR RSRC CLASS specifies the resource class for example INSTR as defined by the canonical resource name Related Items Refer to the VI ATTR RSRC Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual E description in this chapter Also refer to the VISA ni com VI ATTR RSRC IMPL VERSION Chapter 3 Attributes Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViVersion Oh to FFFFFFFFh N A Global Description VI ATTR RSRC IMPL VI ERSION is the resource version that uniquely identifies each of the different revisions or implementations of a resource This attribute value is defined by the individual manufacturer and increments with each new r
46. Chapter 5 Operations Error Codes Description VI ERROR TMO Timeout expired before operation completed VI ERROR INV LINE The value specified by the line parameter is invalid Description This operation can be used to assert either the SYSFAIL or SYSRESET utility bus interrupts on the VXIbus backplane This operation is valid only on BACKPLANE mainframe and VXI SERVANT servant sessions Asserting SYSRESET also known as HARD RESET in the VXI specification should be used only when it is necessary to promptly terminate operation of all devices in a VXIbus system This is a serious action that always affects the entire V XIbus system Related Items Refer to the viAssertIntrSignal description of this chapter and the BACKPLANE Resource and SERVANT Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 8 ni com Chapter 5 Operations viBufRead Purpose Reads data from device or interface through the use of a formatted I O read buffer C Syntax ViStatus viBufRead ViSession vi ViPBuf buf ViUInt32 count ViPUInt32 retCount Visual Basic Syntax viBufRead amp ByVal vi amp ByVal buf ByVal count amp retCount amp Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifi
47. Default VI_TRUE 1 VI_FALSE Description E 0 VI TRUE P The Nagle algorithm is disabled when this attribute is enabled and vice versa The Nagle algorithm improves network performance by buffering send data until a full size packet can be sent This attribute is enabled by default in VISA to verify that synchronous writes get flushed immediately Related Items Refer to the TCPIP KEEPALIVI SOCKET Resource description of Appendix B Resources E description of this chapter Also refer to the National Instruments Corporation 3 109 NI VISA Programmer Reference Manual Chapter 3 Attributes ATTR PORT Resource Classes TCPIP SOCKET Attribute Information Description Access Privilege Data Type Range Default Read Only viUInt16 0 to FFFFh N A Global This specifies the port number for a given TCP IP address For a TCPIP SOCKET Resource this is a required part of the address string Related Items Refer to the SOCKET Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 110 ni com VI ATTR TERMCHAR Chapter 3 Attributes Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViUInt8 0
48. EN 3 32 VI ATTR GPIB PRIMARY ADDR 3 43 VI GPIB SECONDARY ADDR 3 47 VI ATTR INTF INST NAME 3 52 VI ATTR NUM 3 53 VI ATTR INTF PARENT NUM 3 54 VI ATTR INTF TYPE 3 55 VI SRC ACCESS PRIV 3 100 VI ATTR SRC BYTE ORDER 3 101 VI ATTR SRC INCREMENT 3 102 VI VALUE 3 113 VI ATTR VXI LA 3 134 VI ATTR WIN ACCESS 3 139 VI ATTR WIN ACCESS PRIV 3 140 VI ATTR WIN BASE ADDR 3 141 VI ATTR WIN BYTE ORDER 3 142 VI ATTR WIN SIZE 3 143 events B 6 VI EVENT IO _ COMPLETION 4 15 memory I O services 2 3 operations B 7 vilnx 5 50 viMapAddress 5 58 viMove 5 68 viMoveAsync 5 72 viMovelInx 5 76 viMoveOutx 5 80 NI VISA Programmer Reference Manual 1 10 viOutx 5 92 viPeekx 5 100 viPokex 5 101 viUnmapAddress 5 150 purpose and use 2 3 MEMACC Resource type description 2 3 memory I O services INSTR Resource 2 2 MEMACC Resource 2 3 memory space operations viln8 viIn16 viIn32 5 50 viMoveln viMoveIn16 viMovelIn32 5 76 viMoveOut8 viMoveOut 16 viMoveOut32 5 80 viOut8 viOut16 viOut32 5 92 viPeek8 viPeek16 viPeek32 5 100 viPoke8 viPoke16 viPoke32 5 101 move operations viMove 5 68 viMoveAsync 5 72 viMovelIn8 viMoveIn16 viMoveln32 5 76 viMoveOut8 viMoveOut 16 viMoveOut32 5 80 National Instruments customer education C 1 professional services C 1 system
49. NI VISA Programmer Reference Manual B 14 ni com Technical Support and Professional Services Visit the following sections of the National Instruments Web site at ni com for technical support and professional services e Support Online technical support resources include the following Self Help Resources For immediate answers and solutions visit our extensive library of technical support resources available in English Japanese and Spanish at ni com support These resources are available for most products at no cost to registered users and include software drivers and updates a KnowledgeBase product manuals step by step troubleshooting wizards conformity documentation example code tutorials and application notes instrument drivers discussion forums a measurement glossary and so on Assisted Support Options Contact NI engineers and other measurement and automation professionals by visiting ni com support Our online system helps you define your question and connects you to the experts by phone discussion forum or email Training Visitni com custed for self paced tutorials videos and interactive CDs You also can register for instructor led hands on courses at locations around the world e System Integration lIf you have time constraints limited in house technical resources or other project challenges NI Alliance Program members can help To learn more call your local NI office or visit ni com al
50. Privilege Data Type Range Default Read Write ViInti16 VI ASRL WIRE 485 4 0 N A Global VI ASRL WIRE 485 2 DTR ECHO 1 VI ASRL WIRE 485 2 DTR CTRL 2 VI ASRL WIRE 485 2 AUTO 3 VI STATE UNKNOWN 1 Description This attribute is valid only with the RS 485 serial driver developed by National Instruments and sets the transceiver mode WIRE_485_4 uses 4 wire mode DTR_ECHO uses 2 wire DTR mode controlled with VI_ASRL VI_ASRL_WIRE_485_2 VI_ASRL_WIRE_485_2 VI_ASRL echo DTR_CTRL uses 2 wire DTR mode controlled without echo WIRE 485 2 AUTO uses 2 wire auto mode controlled with TXRDY Note This attribute is valid only on the platforms on which National Instruments supports its RS 485 products Related Items Refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 23 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL XOFF CHAR Resource Classes Serial INSTR Attribute Information Description Access Privilege Data Type Range Default Read Write ViUInt8 0 to FFh Control S 13h Local VI ATTR ASRL XOFF CHAR specifies the value of the character used for XON XOFF flow control both directions If XON XOFF flow control software handshaking is not being used the value of this attribute is ignored Related Items Refer to the vi ATTR ASRL CHAR and V
51. RM SESSION 3 87 viClose 5 16 viOpen 5 84 shared memory services INSTR Resource 2 2 SOCKET Resource attributes B 11 VI ATTR FILE APPEND EN 3 37 VI ATTR INTF INST 3 52 VI INTF NUM 3 53 VI ATTR INTF TYPE 3 55 VI ATTR IO PROT 3 57 VI RD BUF OPER MODE 3 82 VI SEND END EN 3 97 VI ATTR TCPIP ADDR 3 105 VI ATTR TCPIP _ HOSTNAME 3 107 VI ATTR TCPIP _ KEEPALIVE 3 108 VI ATTR TCPIP _ NODELA Y 3 109 VI ATTR TCPIP PORT 3 110 VI ATTR TERMCHAR 3 111 VI TERMCHAR EN 3 112 VI ATTR TMO VALUE 3 113 VI TRIG ID 3 114 NI VISA Programmer Reference Manual Index VI_ATTR_WR_BUF_OPER MODE 3 144 basic I O services 2 5 events B 12 VI_LEVENT_IO_ COMPLETION 4 15 formatted I O services 2 5 operations B 12 viAssertTrigger 5 4 viBufRead 5 9 viBufWrite 5 12 viClear 5 14 viFlush 5 34 viPrintf 5 102 viQueryf 5 112 viRead 5 114 viReadAsync 5 117 viReadSTB 5 119 viReadToFile 5 121 viScanf 5 124 viSetBuf 5 136 viSPrintf 5 138 viSScanf 5 140 viVPrintf 5 160 viVQueryf 5 162 viVScanf 5 164 viVSPrintf 5 166 viVSScanf 5 168 viWrite 5 176 viWriteAsync 5 178 viWriteFromFile 5 180 purpose and use 2 5 SOCKET Resource type description 2 5 software drivers C 1 status codes completion codes table A 1 error codes table A 2 retrieving with viStatusDesc operation 5 142 stop bits 3 22 NI VISA Programmer Reference M
52. Refer to the VI_ATTR_ASRI L CTS STATE VI ATTR ASRL DCD STATE VI ATTR ASRL STATE ATTR ASRL RI STATE d i VI ATTR ASRL RTS STATE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR ASRL DTR STATE Chapter 3 Attributes Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViInt16 VI STATE ASSERTED 1 N A Global STATE UNASSERTED 0 VI STATE UNKNOWN 1 Description VI ATTR ASRL DTR STATI DTR input signal E shows the current state of the Data Terminal Ready When the ATTR ASRL FLOW CNTRL attribute is set to ASRL FLOW DTR DSR this attribute is Read Only Querying the value will return STATE UNKNOWN Related Items Refer to the VI ATTR ASRL CTS STATE VI ATTR ASRL DCD STATE ATTR ASRL DSR STATE VI ATTR ASRL RI STATE and VI ATTR ASRL STATE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 13 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL END IN Resource Classes Serial INSTR Attribute Information
53. Resources National Instruments Corporation 5 145 NI VISA Programmer Reference Manual Chapter 5 Operations viUninstallHandler Purpose Uninstalls handlers for events C Syntax ViStatus viUninstallHandler ViSession vi ViEventType eventType ViHndlr handler ViAddr userHandle Visual Basic Syntax N A Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session eventType IN Logical event identifier handler IN Interpreted as a valid reference to a handler to be uninstalled by a client application userHandle IN A value specified by an application that can be used for identifying handlers uniquely in a session for an event Return Values Completion Codes Description VI SUCCESS Event handler successfully uninstalled NI VISA Programmer Reference Manual 5 146 ni com Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_INV_EVENT Specified event type is not supported by the resource VI_ERROR_INV_HNDLR_REF Either the specified handler reference or the user context
54. The VISA locking mechanism enforces arbitration of accesses to resources on an individual basis If a session locks a resource operations invoked by other sessions to the same resource are serviced or returned with a locking error depending on the operation and the type of lock used If a session has an exclusive lock other sessions cannot modify global attributes or invoke operations but can still get attributes and set local attributes If the session has a shared lock other sessions that have shared locks can also modify global attributes and invoke operations Regardless of which type of lock a session has if the session is closed without first being unlocked VISA automatically performs a viUnlock on that session The locking mechanism works for all processes and resources existing on the same computer When using remote resources however the networking protocol may not provide the ability to pass lock requests to the remote device or resource In this case locks will behave as expected from multiple sessions on the same computer but not necessarily on the remote device For example when using the VXI 11 protocol exclusive lock requests can be sent to a device but shared locks can only be handled locally Related Items Refer to the viUnlock description of this chapter Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 57 NI VISA Programmer Reference Manual C
55. USB RAW Attribute Information Access Privilege Data Type Range Default Read Write Vilnti16 0 to FFh N A Local Description VI ATTR USB ALT SETTING specifies the USB alternate setting used by the given session Related Items Refer to the RAW Resource description of Appendix B Resources National Instruments Corporation 3 115 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR USB BULK IN PIPE Resource Classes USB RAW Attribute Information Description VI ATTR USB BULK IN PIPI Access Privilege Data Type Range Default Read Write ViInt16 1 O1h to 81h to 8Fh N A Local E specifies the endpoint number of the USB bulk in pipe used by the given session An initial value of 1 signifies that this resource does not have bulk in pipes Related Items Refertothe VI ATTR USB NUM PIPES VI ATTR USI VI ATTR USB INTR IN PIPI description of Appendix B Resources NI VISA Programmer Reference Manual 3 116 B BULK OUT PIPE E descriptions of this chapter and the RAW Resource ni com Chapter 3 Attributes VI ATTR USB BULK IN STATUS Resource Classes USB RAW Attribute Information Access Privilege Data Type Range Default Read Write ViInti16 VI USB PIPE STATE UNKNOWN 1 N A Local VI USB PIPE READY 0 VI USB PIPE STALLED 1 Descriptio
56. VALUE R_USB_ALT_SETTING VI_AT ny USB PIPI 1 ny PR USB BULK IN STATUS VI 1 ny R_USB_BULK_OUT_PIPE 1 ny R_USB_BULK_OUT_STATUS VI_AT 1 ny ny USB CLASS USB INTFC NUM VI 1 ny USB INTR IN PIPE VI 1 ny w PR USB INTR IN STATUS VI 1 ny R_USB_MAX INTR SIZE VI 1 n USB NUM INTFCS VI A ny R_USB_NUM_PIPES 1 VI_AT ny ny UR USB PROTOCOL USB SERIAL NUM VI AJ VI 1 VI 1 ny ny ny TR WR BUF OPER MODI USB SUBCLASS USER DATA Lj VI 1 ny R_WR_BUF_SIZE Events VI_EVENT_USB_INTR National Instruments Corporation Appendix B Resources NI VISA Programmer Reference Manual Appendix Resources Operations viAssertTrigger viBufRead viBufWrite viClear viClose viDisableEvent viDiscardEvents viEnableEvent viEventHandler viFindNext viFindRsrc viGetAttribute vilnstallHandler viLock viOpen viOpenDefaultRM viParseRsrc E viParseRsrcl viPrintf viReadAsync viReadSTB viReadToFile viRead viScanf viSetAttribute viTerminate viUninstallHandler viUnlock viUsbControlIn viUsbControlOut viVPrintf viVScanf viVSPrintf viVSScanf viWaitOnEvent viWrite viWriteAsync viWriteFromFile
57. VALUE 3 113 VI ATTR TRIG ID 3 114 VI WR BUF OPER MODE 3 144 basic I O services 2 4 events B 8 VI EVENT CLEAR 4 9 VI EVENT GPIB CIC 4 12 VI EVENT GPIB LISTEN 4 13 VI EVENT GPIB TALK 4 14 VI EVENT IO COMPLETION 4 15 VI EVENT SERVICE REQ 4 17 VI EVENT TRIG 4 18 formatted I O services 2 4 operations B 8 viAssertTrigger 5 4 viBufRead 5 9 viBufWrite 5 12 viFlush 5 34 viGpibCommand 5 39 viGpibControlATN 5 41 viGpibControlREN 5 44 viGpibPassControl 5 46 viGpibSendIFC 5 48 viPrintf 5 102 viRead 5 114 viReadAsync 5 117 viReadToFile 5 121 viScanf 5 124 National Instruments Corporation 9 Index viSetBuf 5 136 viSPrintf 5 138 viSScanf 5 140 viVPrintf 5 160 viVScanf 5 164 viVSPrintf 5 166 viVSScanf 5 168 viWrite 5 176 viWriteAsync 5 178 viWriteFromFile 5 180 purpose and use 2 4 INTFC Resource type description 2 4 K KnowledgeBase 1 L locking VI ATTR RSRC LOCK STATE 3 90 viLock 5 55 viUnlock 5 148 logical address VI ATTR CMDR LA 3 27 VI MAINFRAME LA 3 59 VI ATTR VXI LA 3 134 manufacturer information VI ID 3 60 VI RSRC ID 3 91 VI RSRC NAME 3 92 MEMACC Resource attributes B 6 VI DEST ACCESS PRIV 3 28 VI DEST BYTE ORDER 3 29 NI VISA Programmer Reference Manual Index VI_LATTR_DEST_ INCREMENT 3 30 VI ATTR DMA ALLOW
58. VI A16 SPACE then offset specifies the offset from the logical address base address of the specified VXI device If space specifies VI A24 SPACE or VI 432 SPACE then offset specifies the offset from the base address of the VXI device s memory space allocated by the VXI Resource Manager within VXI A24 or A32 space MEMACC Specific For MEMACC Resource the offset parameter specifies an absolute address Related Items Refer to the vi In8 16 viiIn32 description of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 94 ni com Chapter 5 Operations viParseRsrc Purpose Parse a resource string to get the interface information C Syntax ViStatus viParseRsrc ViSession sesn ViRsrc rsrcName ViPUInt16 intfType ViPUInt16 intfNum Visual Basic Syntax viParseRsrc amp ByVal sesn amp ByVal rsrcName intfType intfNum Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description sesn IN Resource Manager session should always be the Default Resource Manager for VISA returned from viOpenDefaultRM rsrcName IN Unique symbolic name of a resource intfType OU
59. VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViBusAddress Oh to FFFFFFFFh N A Global Description VI ATTR MEM BASE specifies the base address of the device in VXIbus memory address space This base address is applicable to A24 or A32 address space If the value of VI ATTR MEM 15 VI A16 SPACE the value of this attribute is meaningless for the given VXI device Related Items Refer to the ATTR MEM SIZE and VI ATTR MEM SPACE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 63 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR MEM SIZE Resource Classes GPIB VXI INSTR VXI INSTR Attribute Information Description Access Privilege Data Type Range Default Read Only ViBusSize Oh to FFFFFFFFh N A Global VI ATTR MEM SIZE specifies the size of memory requested by the device in V XIbus address space If the value of VI ATTR MEM SPAC meaningless for the given VXI device Related Items Eis VI A16 SPACE the value of this attribute is Refertothe vr ATTR MEM BASE and VI ATTR MEM SPACE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR MEM SPACE Chapter 3 Attribute
60. and ordinary characters The white characters blank vertical tabs horizontal tabs form feeds new line linefeed and carriage return are ignored except in the case of c and All other ordinary characters except should match the next character read from the device The format string consists of a followed by optional modifier flags followed by one of the format codes in that sequence It is of the form modifier format code where the optional modifier describes the data format while format code indicates the nature of data data type One and only one format code should be performed at the specifier sequence A format specification directs the conversion to the next input arg The results of the conversion are placed in the variable that the corresponding argument points to unless the assignment suppressing character is given In such a case no arg is used and the results are ignored The viScanf operation accepts input until an END indicator is read or all the format specifiers in the readFmt string are satisfied Thus detecting an END indicator before the readF mt string is fully consumed will result in ignoring the rest of the format string Also if National Instruments Corporation 5 125 NI VISA Programmer Reference Manual Chapter 5 Operations some data remains in the buffer after all format specifiers in the readFmt string are satisfied the data will be kept in the buffer and will be used by the n
61. long integer must appear as a flag that specifies the number of elements by default bytes in the block A field width or precision modifier is not allowed with this format code asterisk An asterisk may be present instead of the count In such a case two args are used the first of which is a long integer specifying the count of the number of elements in the data block The second arg is a reference to the data block The size of an element is determined by the optional length modifier see below and the default is byte width Length modifier h arg points to an array of unsigned short integers 16 bits The count corresponds to the number of words rather than bytes If the optional 01 byte order modifier is present the data is sent in little endian format otherwise the data is sent in standard IEEE 488 2 format data will be byte swapped and padded as appropriate if native computer representation is different Length modifier 1 arg points to an array of unsigned long integers 32 bits The count specifies the number of longwords rather than bytes If the optional 01 byte order modifier is present the data is sent in little endian format otherwise the data is sent in standard IEEE 488 2 format The data will be byte swapped and padded as appropriate if native computer representation is different Length modifier z arg points to an array of floats The count specifies the number of floating point numbers
62. 1 GPIB VXI VI A24 SPACE 2 VI A32 SPACE 3 PXI INSTR VI PXI CFG SPACE 10 VI PXI BARO SPACE 11 toVI PXI BAR5 SPACE 16 PXI MEMACC VI PXI ALLOC SPACE 9 INSTR Specific Notice that mapBase specified in the viMapAddress operation for an INSTR Resource is the offset address relative to the device s allocated address base for the corresponding address space that was specified For example if mapSpace specifies A16 SPACE then mapBase specifies the offset from the logical address base address of the specified VXI device If mapSpace specifies 424 SPACE or VI A32 SPACE then mapBase specifies the offset from the base address of the VXI device s memory space allocated by the VXI Resource Manager within VXI A24 or A32 space MEMACC Specific For a MEMACC Resource the mapBase parameter specifies an absolute address Related Items Refer to the viUnmapAddress description of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 60 ni com Chapter 5 Operations viMapTrigger Purpose Map the specified trigger source line to the specified destination line C Syntax viStatus viMapTrigger ViSession vi VilInt16 trigSrc Vilnti16 trigDest ViUInt16 mode Visual Basic Syntax viMapTrigger amp ByVal vi amp ByVal trigSrc ByVal trigDest ByVal mode Resource Classes GPIB VXI BACK
63. 3 74 VI PXI MEM TYPE BAR 3 75 VI ATTR PXI SLOT LBUS LEFT 3 76 VI ATTR PXI SLOT LBUS RIGHT 3 77 VI ATTR PXI SLOTPATH 3 78 VI ATTR PXI STAR TRIG BUS 3 79 VI ATTR PXI STAR TRIG LINE 3 80 VI ATTR PXI BUS 3 81 VI RD OPER 3 82 VI ATTR RD BUF SIZE 3 83 VI INTR LEVEL 3 84 VI ATTR RECV TRIG ID 3 85 VI ATTR RET COUNT 3 86 VI ATTR RM SESSION 3 87 VI RSRC CLASS 3 88 NI VISA Programmer Reference Manual Index VI ATTR RSRC IMPL VERSION 3 89 VI ATTR RSRC LOCK STATE 3 90 VI RSRC ID 3 91 VI ATTR RSRC NAME 3 92 VI ATTR 5 3 93 VI ATTR RSRC SPEC VERSION 3 96 VI ATTR SEND END EN 3 97 VI ATTR SIGP STATUS ID 3 98 VI ATTR SLOT 3 99 VI ATTR SRC ACCESS PRIV 3 100 VI ATTR SRC BYTE ORDER 3 101 VI SRC INCREMENT 3 102 VI ATTR STATUS 3 103 VI ATTR SUPPRESS END EN 3 104 VI ATTR TCPIP ADDR 3 105 VI ATTR TCPIP DEVICE NAME 3 106 VI HOSTNAME 3 107 VI ATTR TCPIP KEEPALIVE 3 108 VI ATTR TCPIP NODELA Y 3 109 VI ATTR TCPIP PORT 3 110 VI ATTR TERMCHAR 3 111 VI ATTR TERMCHAR EN 3 112 VI VALUB 3 113 VI ATTR TRIG ID 3 114 VI ATTR USB ALT SETTING 3 115 VI ATTR USB BULK IN PIPE 3 116 VI ATTR USB BULK IN STATUS 3 117 VI ATTR USB BULK 3 118 VI ATTR USB BULK OUT STATUS 3 119 VI ATTR USB CLASS 3 120
64. 4 value is specified for the pending events in the callback mechanism It is possible to specify both mechanisms simultaneously by specifying ALL MECH FFFFh Return Values Completion Codes Description SUCCESS Event queue flushed successfully VI SUCCESS QUEUE EMPTY Operation completed successfully but queue was already empty NI VISA Programmer Reference Manual 5 20 ni com Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_INV_EVENT Specified eventType is not supported by the resource VI_ERROR_INV_MECH Invalid mechanism specified Description The viDiscardEvents operation discards all pending occurrences of the specified event types and mechanisms from the specified session Specifying VI ALL ENABLED EVENTS for the eventType parameter discards events of every type that is enabled for the given session The information about all the event occurrences that have not yet been handled is discarded This operation is useful to remove event occurrences that an application no longer needs The discarded event occurrences are not available to a session at a later time This operation does not apply to event contexts that have already been delivered to the application Related Items Refer to the viEnableEvent viDisableEvent
65. 44 vilnx 5 50 viMapAddress 5 58 viMemAlloc 5 64 viMemFree 5 66 viMove 5 68 viMoveAsync 5 72 viMovelnx 5 76 viMoveOutx 5 80 viOutx 5 92 viPeekx 5 100 viPokex 5 101 viPrintf 5 102 viQueryf 5 112 viRead 5 114 viReadAsync 5 117 viReadSTB 5 119 viReadToFile 5 121 viScanf 5 124 viSetBuf 5 136 viSPrintf 5 138 viSScanf 5 140 viUnmapAddress 5 150 NI VISA Programmer Reference Manual 8 viVPrintf 5 160 viVQueryf 5 162 viVScanf 5 164 viVSPrintf 5 166 viVSScanf 5 168 viVxiCommandQuery 5 170 viWrite 5 176 viWriteAsync 5 178 viWriteFromFile 5 180 purpose and use 2 2 shared memory services 2 2 INSTR Resource type description 2 2 instrument drivers C 1 interrupts VI_ATTR_INTR_STATUS_ID 3 56 VI EVENT VXI VME INTR 4 21 INTFC Resource attributes B 7 VI ATTR DEV STATUS BYTE 3 31 VI ATTR DMA ALLOW _ EN 3 32 VI ATTR FILE APPEND EN 3 37 VI ATTR GPIB STATE 3 39 VI ATTR GPIB CIC STATE 3 40 VI ATTR GPIB 5488 LEN 3 41 VI GPIB NDAC STATE 3 42 VI ATTR GPIB PRIMARY ADDR 3 43 VI ATTR GPIB REN STATE 3 46 VI ATTR GPIB SECONDARY ADDR 3 47 VI ATTR GPIB SRQ STATE 3 48 ni com VI_ATTR_GPIB_SYS_CNTRL STATE 3 49 VI_LATTR_INTF_INST NAME 3 52 VI ATTR INTF NUM 3 53 VI ATTR INTF TYPE 3 55 VI RD BUF OPER MODE 3 82 VI SEND END EN 3 97 VI ATTR TERMCHAR 3 111 VI TERMCHAR EN 3 112 VI
66. Also refer to the INTFC Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 42 ni com Chapter 3 Attributes VI ATTR GPIB PRIMARY ADDR Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE Attribute Information Access Privilege Data Type Range Default INSTR MEMACC ViUInt16 0 to 30 N A BACKPLANE Read Only Global INTFC SERVANT Read Write Global Description VI_ATTR_GPIB_PRIMARY_ADDR specifies the primary address of the GPIB device used by the given session For the GPIB INTFC and GPIB SERVANT Resources this attribute is Read Write Related Items Refer to the VI ATTR GPIB SECONDARY ADDR description of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource BACKPLANE Resource and MEMACC Resource descriptions of Appendix B Resources National Instruments Corporation 3 43 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR GPIB READDR EN Resource Classes GPIB INSTR GPIB VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViBoolean VI_TRUE 1 VI_TRUE Local VI_FALSE 0 Description VI_ATTR_GPIB_READDR_EN specifies whether to use repeat addressing before each read or write operation Related Items Refer to the VI_ATTR_GPIB_UNADDR_EN description of this chapter Also r
67. ByVal vi amp ByVal space ByVal offset amp ByVal val8 as Byte viOuti16 amp ByVal vi amp ByVal space ByVal offset amp ByVal 116 viOut32 amp ByVal vi amp ByVal space ByVal offset amp ByVal val32 amp Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session space IN Specifies the address space Refer to the table included in the Description section for more information offset IN Offset in bytes of the address or register to which to read val8 val16 or IN Data to write to bus 8 bits for viout8 16 bits for val32 viout16 and 32 bits for viout32 Return Values Completion Codes Description VI_SUCCESS Operation completed successfully NI VISA Programmer Reference Manual 5 92 ni com Chapter 5 Operations Error Codes Description VI ERROR_INV_OBJECT The given session reference is invalid VI ERROR_NSUP_OPER The given vi does not support this operation VI ERROR RSRC LOCKI E Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR_BERR Bus error occurred during transfer VI RROR_INV_SPACE Invalid address space specified VI R
68. DEST BYTE ORDER VI_ATTR_DEST_INCREMENT VI ATTR SRC ACCESS PRIV and VI ATTR WIN ACCESS PRIV descriptions of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 28 ni com VI ATTR DEST BYTE ORDER Chapter 3 Attributes Resource Classes GPIB VXI INSTR GPIB VXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI_BIG_ENDIAN 0 VI_BIG_ENDIAN Local VI_LITTLE_ENDIAN 1 Description VI ATTR DEST BYTE ORD ER specifies the byte order to be used in high level access operations such as vioutXX and viMoveOutXx when writing to the destination Related Items Refer to the VI ATTR DEST ACCESS PRIV VI ATTR DEST INCREMENT VI ATTE SRC BYTE ORDER and VI ATTR WIN BYTE ORDER descriptions of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources National Instruments Corporation 3 29 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR DEST INCREMENT Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Write Vilnt32 0tol 1 Local Description VI ATTR D
69. Description VI_SUCCESS Operation completed successfully Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access NI VISA Programmer Reference Manual 5 44 ni com Chapter 5 Operations Error Codes Description VI_ERROR_NCIC The interface associated with this session is not currently the controller in charge VI ERROR NLISTENERS No Listeners condition is detected both NRFD and NDAC are unasserted VI ERROR NSYS CNTLR interface associated with this session is not the system controller VI ERROR MODE The value specified by the mode parameter is invalid Description The viGpibControlRI EN operation asserts or unasserts the GPIB REN interface line according to the specified mode The mode can also specify whether the device associated with this session should be placed in local state before deasserting REN or remote state after asserting REN This operation is valid only if the GPIB interface associated with the session specified by vi is currently the system controller The following table lists special values for the mode parameter Va
70. Description vi IN Unique logical identifier to a session mode IN This specifies how to assert the interrupt Refer to the Description section for actual values statusID IN This is the status value to be presented during an interrupt acknowledge cycle Refer to the Description section for valid values Return Values Completion Code Description SUCCESS Operation completed successfully NI VISA Programmer Reference Manual 5 2 ni com Chapter 5 Operations Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR BERR Bus error occurred during transfer VI ERROR INTR PENDING An interrupt is still pending from a previous call VI ERROR MODE The value specified by the mode parameter is invalid VI ERROR NSUP INTR The interface cannot generate an interrupt on the requested level or with the requested statusID value VI ERROR NSUP MODI E The specified mode is not supported by this VISA implementation Description This operation can be used to assert a device interrupt condition In VXI for example this can be done with either a VXI signal or a VXI in
71. EVENT EXC EPTION and VI EVI ENT IO COMPLI Chapter 4 Events Also see Appendix B Resources NI VISA Programmer Reference Manual ENT TYPE descriptions of this chapter and ETION event descriptions of ni com VI ATTR PXI BUS NUM Chapter 3 Attributes Resource Classes PXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 0 to 255 N A Global Description VI_ATTR_PXI_BUS_NUM specifies the PCI bus number of this device Related Items Refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI PXI CHASSIS Resource Classes PXI INSTR Attribute Information Description Access Privilege Data Type Range Default Read Only ViInti16 0 to 255 N A Global VI ATTR PXI CHASSIS specifies the PCI chassis number of this device A value of 1 means that the chassis number is unknown Related Items Refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR PXI DEV NUM Chapter 3 Attributes Resource Classes PXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 0 to 31 N A Global Description This is the PXI device number Related Items Refer to t
72. I O communication buffers to be flushed For example calling virlush with VI WRITE BUF also flushes the VI IO OUT BUF In previous versions of VISA vr IO IN BUF was known as VI ASRL IN BUF and VI IO OUT BUF was known as VI ASRL OUT BUF Implicit versus Explicit Flushing Although you can explicitly flush the buffers by making a call to virlush the buffers are flushed implicitly under some conditions These conditions vary for the viPrintf and viScanf operations Flushing a write buffer immediately sends any queued data to the device The write buffer is maintained by the viPrintf operation To explicitly flush the write buffer you can make acall to the viFlush operation with a write flag set In addition the write buffer is flushed automatically under the following conditions e When an END indicator character is sent that is the n character is specified in the formatting string When the buffer is full e Inresponse to a call to viSetBuf with the WRITE BUF flag set Flushing a read buffer discards the data in the read buffer This guarantees that the next call to a viScanf or related operation reads data directly from the device rather than from queued data residing in the read buffer The read buffer is maintained by the viScanf operation To explicitly flush the read buffer you can make a call to the virlush operation with a read flag set Also the formatted I O buffers of a sessi
73. IO Could not perform Read Write operation because of I O error VI ERROR TMO Timeout occurred before Read Write operation completed VI ERROR INV FMT A format specifier in the writeFmt or readFmt string is invalid VI ERROR NSUP FMT The format specifier is not supported for current argument type VI ERROR ALLOC The system could not allocate a formatted I O buffer because of insufficient resources Description This operation is similar to viQueryf except that the params parameters list provides the parameters rather than the separate arg parameter list RE Note Because the prototype for this function cannot provide complete type checking remember that all output parameters must be passed by reference Related Items Refer to the vigueryf description of this chapter Also refer to the INSTR Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 163 NI VISA Programmer Reference Manual Chapter 5 Operations viVScanf Purpose Reads converts and formats data using the format specifier Stores the formatted data in the parameters designated by params C Syntax ViStatus viVScanf ViSession vi ViString readFmt ViVAList params Visual Basic Syntax vivScanf amp ByVal vi amp ByVal readFmt params as Any Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT
74. In case of field width characters already read before encountering a white space additional characters are read and discarded until a white space character is found In case of field width the actual number of characters that were copied into the user array not counting the trailing NULL character are stored back in the integer pointed to by the first argument National Instruments Corporation 5 129 NI VISA Programmer Reference Manual Chapter 5 Operations Enhanced Format Codes b Argument type A reference to a data array Flags or Modifiers Interpretation Default functionality The data must be in IEEE 488 2 lt ARBITRARY BLOCK PROGRAM DATA format The format specifier sequence should have a flag describing the field width which will give maximum count of the number of bytes or words or longwords depending on length modifiers to be read from the device If the field width contains a sign two arguments are used The first arg read is a pointer to a long integer specifying the maximum number of elements that the array can hold The second arg should be a reference to an array Also the actual number of elements read is stored back in the first argument In absence of length modifiers the data is assumed to be of byte size elements In some cases data might be read until an END indicator is read Length modifier h arg points to an array of 16 bit words and count specifies the number of words
75. Instruments Corporation 4 5 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT ASRL DSR 3 Note This event is valid only on Windows and platforms on which supports its ENET Serial products Resource Classes Serial INSTR Description National Instruments Notification that the Data Set Ready DSR line changed state If the DSR line changes state quickly several times in succession not all line state changes will necessarily result in event notifications Event Attributes Symbolic Name Description VI_ATTR_EVENT_TYPE Unique logical identifier of the event Related Items Refer to the VI ATTR EVENT TYPE and VI ATTR ASRL DSR STATI Chapter 3 Attributes Also refer to the INSTR Resource description of Resources NI VISA Programmer Reference Manual 4 6 E descriptions of Appendix B ni com Chapter 4 Events VI EVENT ASRL RI 5 Note This event is valid only Windows and platforms on which National Instruments supports its ENET Serial products Resource Classes Serial INSTR Description Notification that the Ring Indicator RI input signal was asserted Event Attributes Symbolic Name Description VI_ATTR_EVENT_TYPE Unique logical identifier of the event Related Items Refer to the ATTR EVENT and VI ATTR ASRL RI STATE descriptions of Chapter 3 Attributes Also refer to the INSTR Resource description of App
76. Modifier Format Code Description An integer d s format This specifies the minimum field width of the specifying codes converted argument If an argument is shorter than field width the field width it will be padded on the left or on the right if the flag is present Special case For and flags the field width includes the 0 and B strings respectively An asterisk may be present in lieu of a field width modifier in which case an extra arg is used This arg must be an integer representing the field width An integer format The precision string consists of a string of decimal specifying codes digits A decimal point must prefix the precision precision string The precision string specifies the following a The minimum number of digits to appear for the 1 and flags and the i u x and format codes b The maximum number of digits after the decimal point in case of format codes c The maximum numbers of characters for the string s specifier d Maximum significant digits for g format code An asterisk may be present in lieu of a precision modifier in which case an extra arg is used This arg must be an integer representing the precision of a numeric field National Instruments Corporation 5 105 NI VISA Programmer Reference Manual Chapter 5 Operations Supported with Modifier Format Code Description
77. PID Related Items Refer to the VI ATTR PXI TRIG BUS VI ATTR and VI ATTR MODEL descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR MODEL Chapter 3 Attributes Resource Classes GPIB VXI INSTR PXI INSTR USB INSTR USB RAW VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViString N A N A Global Description This string attribute is the model name of the device The value of this attribute should be used for display purposes only and not for programmatic decisions as the value can be different between VISA implementations and or revisions Related Items Refer to the ATTR MODEL CODI E VI ATTR PXI TRIG BUS and VI ATTR MANF NAME descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR OPER NAME Resource Classes VI EVENT IO COMPLETION VI EVENT EXCEPTION Attribute Information Description Access Privilege Data Type Range Default Read Only ViString N A N A VI ATTR OPER NAME contains the name of the operation generating this event Related Items Refertothe VI ATTR STATUS and VI ATTR EVI see the vI
78. Programmer Reference Manual Chapter 5 Operations viUnmapAddress Purpose Unmaps memory space previously mapped by viMapAddress C Syntax ViStatus viUnmapAddress ViSession vi Visual Basic Syntax viUnmapAddress amp ByVal vi amp Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session Return Values Completion Codes Description VI SUCCESS Operation completed successfully Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation ERROR WINDOW NMAPPED The specified session is not currently mapped Description The viUnmapAddress operation unmaps the region previously mapped by the viMapAddress operation for this session Related Items Refer to the viMapAddress description of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 150 ni com Chapter 5 Operations viUnmapTrigger Purpose Undo a previous map from the specified trigger source line to the specified destination line C Syntax ViStatus viUnmapTrigger ViSession vi ViInt16 trigSrc VilInti16 trigDest Visual Basic Syntax viUnmapTrigger amp ByVal vi am
79. Range GPIB VI TRIG PROT DEFAULT 0 VXI GPIB VXI VI_TRIG_PROT_DEFAULT 0 VI_TRIG_PROT_ON 1 VI_TRIG_PROT_OFF 2 VI_TRIG_PROT_SYNC 5 PXI VI_TRIG_PROT_RESERVE 6 VI_TRIG_PROT_UNRESERVE 7 Serial TCPIP USB NI VISA Programmer Reference Manual 5 4 ni com Chapter 5 Operations Return Values Completion Codes Description VI_SUCCESS The specified trigger was successfully asserted to the device Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR INV PROT The protocol specified is invalid VI ERROR TMO Timeout expired before operation completed VI ERROR RAW WR PROT VIOL Violation of raw write protocol occurred during transfer VI ERROR RAW RD PROT VIOL Violation of raw read protocol occurred during transfer VI ERROR INP PROT VIOL Device reported an input protocol error during transfer VI ERROR BERR Bus error occurred during transfer VI ERROR LINE IN USE The specified trigger line is currently in use VI ERROR NCIC The interface associated with the given vi is not currently the controll
80. TRIG STATUS 3 135 VI ATTR VXI TRIG SUPPORT 3 136 VI ATTR VXI VME INTR STATUS 3 137 VI VXI SYSFAIL STATE 3 138 events B 9 VI EVENT TRIG 4 18 VI EVENT VXI VME SYSFAIL 4 22 VI_EVENT_VXI_VME SYSRESET 4 23 operations B 9 viAssertIntrSignal 5 2 viAssertTrigger 5 4 viAssertUtilSignal 5 7 viMapTrigger 5 61 viUnmapTrigger 5 151 purpose and use 2 4 BACKPLANE Resource type description 2 4 base address VI ATTR MEM BASE 3 63 VI ATTR WIN BASE ADDR 3 141 basic I O services INSTR Resource 2 2 INTFC Resource 2 4 SERVANT Resource 2 5 SOCKET Resource 2 5 basic I O services INSTR Resource 2 2 baud rate 3 5 buffer operations viBufRead 5 9 viBufWrite 5 12 viFlush 5 34 viSetBuf 5 136 NI VISA Programmer Reference Manual 1 4 byte order VI_ATTR_DEST_BYTE_ORDER 3 29 VI_ATTR_SRC_BYTE_ORDER 3 101 VI_ATTR_WIN_BYTE_ORDER 3 142 C closing sessions with viClose operation 5 17 completion codes table A 1 contacting National Instruments C 1 conventions xiii customer education C 1 professional services C 1 technical support C 1 D data bits 3 9 description of the API 2 6 destination attributes VI ATTR DEST ACCESS PRIV 3 28 VI ATTR DEST BYTE ORDER 3 29 VI DEST INCREMENT 3 30 diagnostic resources C 1 disabling events with viDisableEvent operation 5 19 discarding events with viDiscardEvents operation 5 21 documentation online libra
81. USB bulk out pipe used by the given session is stalled or ready This attribute can be set to only USB PIPE READY Related Items Refer to the RAW Resource description of Appendix B Resources National Instruments Corporation 3 119 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR USB CLASS Resource Classes USB RAW Attribute Information Description VI_ATTR_USB_CLASS specifies the USB class used by the given session Related Items Refer to the RAW Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 120 Access Privilege Data Type Range Default Read Only Vilnt16 0 to FFh N A Global ni com Chapter 3 Attributes VI ATTR USB INTFC NUM Resource Classes USB INSTR USB RAW Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 0 to FEh 0 Global Description VI ATTR USB INTFC NUM specifies the USB interface number used by the given session Related Items Refer to the INSTR Resource and RAW Resource descriptions of Appendix B Resources National Instruments Corporation 3 121 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR USB INTR IN PIPE Resource Classes USB RAW Attribute Information Description VI ATTR USB INTR IN PIPI Access Privilege Data Type Range Default Read Write ViInt16 1 O1h
82. VI ATTR INTF TYPE and VI ATTR INTF NUM These values would be the same if a user opened that resource with viopen and queried the attributes with viGetAttribute Calling viParseRsrc with VXI 1 INSTR will produce the same results as invoking it with vxi 1 instr Related Items Refer to the viFindRsrc viOpen and viParseRsrcEx descriptions of this chapter Also refer to the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual 5 96 ni com Chapter 5 Operations viParseRsrcEx Purpose Parse a resource string to get extended interface information C Syntax ViStatus viParseRsrcEx ViSession rmSesn ViRsrc rsrcName ViPUInt16 intfType ViPUInt16 intfNum ViChar rsrcClass ViChar expandedUnaliasedName ViChar aliasIfExists l Visual Basic Syntax viParseRsrcEx amp ByVal sesn amp ByVal desc intfType intfNum ByVal rsrcClass ByVal expandedUnaliasedName ByVal aliasIfExists Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description sesn IN Resource Manager session should always be the Default Resource Manager for VISA returned from viOpenDefaultRM rsrcName IN Unique symbolic nam
83. VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR QUEUE ERROR Unable to queue move operation VI ERROR IN PROGRESS Unable to queue the asynchronous operation because there is already an operation in progress Description The viMoveAsync operation asynchronously moves data from the specified source to the specified destination This operation queues up the transfer in the system then it returns immediately without waiting for the transfer to carry out or complete When the transfer terminates VI EVENT IO COMPLETION event is generated which indicates the status of the transfer This operation returns jobId which you can use either with viTerminate to abort the operation or with VI EVENT IO COMPLETION events to identify which asynchronous move operations completed VISA will never return VI NULL for a valid jobId The source and the destination can either be local memory or the offset of the interface with which this INSTR or MEMACC Resource is associated This operation uses the specified data width and address space In some systems such as VXI users can specify additional settings for the transfer such as byte order and access privilege by manipulating the appropriate attributes National Instruments Corporation 5 73 NI VISA Programmer Reference Manual Chapter 5 Operations The fo
84. WIN BYTE ORDER and VI ATTR WIN SIZE descriptions of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 140 ni com Chapter 3 Attributes VI ATTR WIN BASE ADDR Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Only ViBusAddress Oh to FFFFFFFFh N A Local Description VI ATTR WIN BASE ADDR specifies the base address of the interface bus to which this window is mapped If the value of VI ATTR WIN ACCESS 15 VI NMAPPED the value of this attribute is meaningless Related Items Refer to the ATTR WIN ACCESS VI ATTR WIN ACCESS PRIV VI ATTR WIN BYTE ORDER and VI ATTR WIN SIZE descriptions of this chapter Also see the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources National Instruments Corporation 3 141 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR WIN BYTE ORDER Resource Classes GPIB VXI INSTR GPIB VXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI_BIG_ENDIAN 0 VI_BIG_ENDIAN Local VI_LITTLE_ENDIAN 1 Description VI ATTR WIN BYTE ORDI ER specifies the byte order to be used in low le
85. and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 3 113 NI VISA Programmer Reference Manual Attributes Chapter 3 Attributes VI_ATTR_TRIG_ID Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI BACKPLANE GPIB VXI INSTR PXI INSTR TCPIP INSTR VXI BACKPLANE VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write Vilnt16 GPIB Serial TCPIP VI_TRIG_SW Local VI_TRIG_SwW 1 VXI GPIB VXI VI_TRIG_SW VI_TRIG_SW 1 VI_TRIG_TTLO 0 to VI_TRIG_TTL7 7 VI_TRIG_ECLO 8 to VI_TRIG_ECL1 9 PXI INSTR VI_TRIG_SW VI_TRIG_SW 1 VI_TRIG_TTLO 0 to VI_TRIG_TTL7 7 Description VI_ATTR_TRIG_ID is the identifier for the current triggering mechanism VI_ATTR_TRIG_ID is Read Write when the corresponding session is not enabled to receive trigger events When the session is enabled to receive trigger events the attribute VI ATTR TRIG ID is Read Only Related Items Refertothe vr ATTR RECV TRIG ID description of this chapter and the viAssertTrigger description of Chapter 5 Operations Also refer to the INTFC Resource BACKPLANE Resource INSTR Resource and SERVANT Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 114 ni com Chapter 3 Attributes VI ATTR USB ALT SETTING Resource Classes
86. array of unsigned short integers 16 bits The count corresponds to the number of words rather than bytes If the optional o1 modifier is present the data read is assumed to be in little endian format otherwise the data read is assumed to be in standard IEEE 488 2 format The data will be byte swapped and padded as appropriate to native computer format Length modifier 1 The data block is assumed to be a reference to an array of unsigned long integers 32 bits The count corresponds to the number of longwords rather than bytes If the optional 1 modifier is present the data read is assumed to be in little endian format otherwise the data read is assumed to be in standard IEEE 488 2 format The data will be byte swapped and padded as appropriate to native computer format Length modifier z The data block is assumed to be a reference to an array of single precision floating point numbers 32 bits The count corresponds to the number of floats rather than bytes If the optional o1 modifier is present the data read is assumed to be in little endian format otherwise the data read is assumed to be in standard IEEE 488 2 format The data will be byte swapped and padded as appropriate to native computer format NI VISA Programmer Reference Manual 5 132 ni com Chapter 5 Operations Modifier Interpretation Length modifier z The data block is assumed to be a reference to an array of double precision floa
87. circumstances calling visetAttribute on that attribute returns VI ERROR ATTR READONLY The error code VI ERROR RSRC LOCKED is returned only if the specified attribute is Read Write and Global and the resource is locked by another session Related Items Refer to the viGetAttribute description of this chapter Also refer to the VISA Resource Template description of Appendix B Resources and the attribute descriptions of Chapter 3 Attributes National Instruments Corporation 5 135 NI VISA Programmer Reference Manual Chapter 5 Operations viSetBuf Purpose Sets the size for the formatted I O and or low level I O communication buffer s C Syntax ViStatus viSetBuf ViSession vi ViUInt16 mask ViUInt32 size Visual Basic Syntax viSetBuf amp ByVal vi amp Resource Classes ByVal mask ByVal size amp GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session mask IN Specifies the type of buffer size IN The size to be set for the specified buffer s Return Values Completion Codes Description VI SUCCESS Buffer size set successfully VI WARN NSUP BUF The specified buffer is not supported Error Codes Description VI ERROR INV OBJECT The given session reference is invalid
88. com VI ATTR CMDR LA Chapter 3 Attributes Resource Classes GPIB VXI INSTR VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 0 to 255 N A Global VI UNKNOWN LA 1 Description VI ATTR CMDR LA is the unique logical address of the commander of the VXI device used by the given session Related Items Refer to the INSTR Resource and SERVANT Resource descriptions of Appendix B Resources National Instruments Corporation 3 27 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR DEST ACCESS PRIV Resource Classes GPIB VXI INSTR GPIB VXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI DATA PRIV 0 VI DATA PRIV Local VI DATA NPRIV 1 VI PROG PRIV 2 VI PROG NPRIV 3 VI BLCK PRIV 4 VI BLCK NPRIV 5 VI D64 PRIV 6 D64 NPRIV 7 Description VI ATTR DEST ACCESS PRIV specifies the address modifier to be used in high level access operations such as vioutXx and viMoveOutXX when writing to the destination 5 Note The values VI_D64_PRIV 6 and VI_D64_NPRIV 7 apply to only the block move operations If you set this attribute to one of these values and then call one of the viOutXX operations the operation returns VI_ERROR_INV_SETUP Related Items Refer to the VI ATTR
89. data that will be stored by any given USB interrupt If a USB interrupt contains more data than this size the data in excess of this size will be lost VI ATTR USB MAX INTR 5171 E is Read Write when the corresponding session is not enabled to receive USB interrupt events When the session is enabled to receive USB interrupt events the attribute VI ATTR USB MAX INTR SIZI Related Items Refer to the EVENT 1761 NI VISA Programmer Reference Manual 3 124 E is Read Only B INTR event description of Chapter 4 Events and the INSTR Resource and RAW Resource descriptions of Appendix B Resources ni com VI ATTR USB NUM INTFCS Chapter 3 Attributes Resource Classes USB RAW Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 1 to FFh N A Global Description VI ATTR USB NUM INTFCS specifies the number of interfaces supproted by this USB device Related Items Refer to the RAW Resource description of Appendix B Resources National Instruments Corporation 3 125 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR USB NUM PIPES Resource Classes USB RAW Attribute Information Description VI ATTR USB NUM This does not include the default control pipe Related Items Refertothe VI ATTR USB BULK IN PIPE VI ATTR USB BULK OUT PIPE VI ATTR USB I
90. defined NR1 compatible variants and number which is an integer without any decimal f only point for example 123 2 d plus Converts to an IEEE 488 2 defined NR2 compatible variants and number The NR2 number has at least one digit after f only the decimal point for example 123 45 e3 plus Converts to an IEEE 488 2 defined NR3 compatible variants and number An NR3 number is a floating point number f only represented in an exponential form for example 1 2345E 67 eH d plus Converts to an IEEE 488 2 defined variants and HEXADECIMAL NUMERIC RESPONSE f only DATA The number is represented in a base of sixteen form Only capital letters should represent numbers The number is of form where XXX 18 a hexadecimal number for example HAF3 5B plus Converts to an IEEE 488 2 defined lt OCTAL variants and NUMERIC RESPONSE DATA The number is f only represented in a base of eight form The number is of the form QYYy where YYY is an octal number for example 071234 eB plus Converts to an IEEE 488 2 defined BINARY variants and NUMERIC RESPONSE DATA The number is f only represented in a base two form The number is of the form BZZZ where 222 is a binary number for example 48011101001 The following are the allowed format code characters A format specifier sequence should include one and only one format code ANSI C Standard Format Codes Send t
91. exported by the given destSpace Related Items Refer to the viMove description of this chapter and the ATTR DEST INCREMENT and VI ATTR SRC INCREMENT descriptions of Chapter 3 Attributes Also refer to the VI EVENT IO COMPLETION description of Chapter 4 Events and the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources National Instruments Corporation 5 75 NI VISA Programmer Reference Manual Chapter 5 Operations viMoveln8 viMoveln16 viMoveln32 Purpose Moves a block of data from the specified address space and offset to local memory C Syntax ViStatus viMoveIn8 ViSession vi ViUInt16 space ViBusAddress offset ViBusSize length ViAUInt8 buf8 ViStatus viMoveIni16 ViSession vi ViUInt16 space ViBusAddress offset ViBusSize length ViAUInt16 buf16 ViStatus viMoveIn32 ViSession vi ViUInt16 space ViBusAddress offset ViBusSize length ViAUInt32 buf32 Visual Basic Syntax viMoveIn8 amp ByVal vi amp ByVal space ByVal offset amp ByVal length buf8 as Byte viMoveIn16 amp ByVal vi amp ByVal space ByVal offset amp ByVal lengths amp buf16 viMoveIn32 amp ByVal vi amp ByVal space ByVal offset amp ByVal lengths amp buf32 amp Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session
92. in the readF mt string is not supported VI ERROR_ALLOC The system could not allocate a formatted I O buffer because of insufficient resources Description The vivSScanf operation is similar to vivScanf except that the data is read from user specified buffer rather than a device Note Because the prototype for this function cannot provide complete type checking remember that all output parameters must be passed by reference Related Items Refer to the viScanf viSScanf vivSPrintf and vivScanf descriptions of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 169 NI VISA Programmer Reference Manual Chapter 5 Operations viVxiCommandQuery Purpose Sends the device a miscellaneous command or query and or retrieves the response to a previous query C Syntax ViStatus viVxiCommandQuery ViSession vi ViUInt16 mode ViUInt32 cmd ViPUInt32 response Visual Basic Syntax viVxiCommandQuery amp ByVal vi amp ByVal mode ByVal cmd amp response amp Resource Classes GPIB VXI INSTR VXI INSTR Parameters Name Direction Description vi IN Unique logical identifier to a session mode IN Specifies whether to issue a command and or retrieve a response Refer to the Description section for actual values cmd IN The miscellan
93. 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 CVI IMAQ IVI LabVIEW Measurement Studio National Instruments NI NI 488 NI 488 2 ni com NI Motion NI VISA and NI VXI are trademarks of National Instruments Corporation Tektronix and Tek are registered trademarks of Tektronix Inc Other product and company names mentioned herein are trademarks or trade names of their respective companies Patents For patents covering National Instruments products refer to the appropriate location Help Patents in your software the patents txt file on your CD or ni com patents WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS 1 NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF RELIABILITY SUITABLE FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN ANY LIFE SUPPORT SYSTEMS WHOSE FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT INJURY TO A HUMAN 2 IN ANY APPLICATION INCLUDING THE ABOVE RELIABILITY OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE IMPAIRED BY ADVERSE FACTORS INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY COMPUTER HARDWARE MALFUN
94. must be passed by reference Related Items Refer to the viScanf viSScanf vivPrintf and vivSScanf descriptions of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 165 NI VISA Programmer Reference Manual Chapter 5 Operations viVSPrintf Purpose Converts formats and sends the parameters designated by params to a user specified buffer as specified by the format string C Syntax ViStatus viVSPrintf ViSession vi ViPBuf buf ViString writeFmt ViVAList params Visual Basic Syntax viVSPrintf amp ByVal vi amp Resource Classes ByVal buf ByVal writeFmt params as Any GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session buf OUT Buffer where data is to be written writeFmt IN The format string to apply to parameters in ViVAList params IN A list containing the variable number of parameters on which the format string is applied The formatted data is written to the specified buf Return Values Completion Codes Description VI SUCCESS Parameters were successfully formatted NI VISA Programmer Reference Manual 5 166 ni com Chapte
95. of data asynchronously C Syntax ViStatus viMoveAsync ViSession vi ViUInt16 srcSpace ViBusAddress srcOffset ViUInt16 srcWidth ViUInt16 destSpace ViBusAddress destOffset ViUInt16 destWidth ViBusSize length ViPJobId jobId Visual Basic Syntax N A Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session srcSpace IN Specifies the address space of the source srcOffset IN Offset of the starting address or register from which to read srcWidth IN Specifies the data width of the source destSpace IN Specifies the address space of the destination destOffset IN Offset of the starting address or register to which to write destWidth IN Specifies the data width of the destination length IN Number of elements to transfer where the data width of the elements to transfer is identical to the source data width jobId OUT Job identifier of this asynchronous move operation NI VISA Programmer Reference Manual 5 72 ni com Chapter 5 Operations Return Values Completion Codes Description VI_SUCCESS Asynchronous operation successfully queued VI_SUCCESS_SYNC Operation performed synchronously Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation
96. operating systems that have their own communication protocols An operating system element that consists of a flow of control within a process In some operating systems a single process can have multiple threads each of which can access the same data space within the process However each thread has its own stack and all threads can execute concurrently with one another either on multiple processors or by time sharing a single processor Universal Serial Bus This common computer peripheral bus allows up to 127 individual USB peripherals per USB root node A name given to the grouping of software modules in this case VISA resources with any associated or required hardware to give the functionality of a traditional stand alone instrument Within VISA a virtual instrument is the logical grouping of any of the VISA resources Virtual Instrument Software Architecture This is the general name given to this product and its associated architecture The architecture consists of two main VISA components the VISA resource manager and the VISA resources This is the name given to the part of VISA that defines all of the device specific resource classes VISA Instrument Control resources encompass all defined device capabilities for direct low level instrument control This is the name given to the part of VISA that defines all of the register or memory specific resource classes The VISA MEMACC resources encompass all high and low lev
97. operation Return Values Completion Codes Description SUCCESS Description successfully returned VI WARN UNKNOWN STATUS The status code passed to the operation could not be interpreted Description The viStatusDesc operation is used to retrieve a user readable string that describes the status code presented If the string cannot be interpreted the operation returns the warning NI VISA Programmer Reference Manual 5 142 ni com Chapter 5 Operations code VI_WARN_UNKNOWN_STATUS However the output string desc is valid regardless of the status return value hy Note size of the desc parameter should be at least 256 bytes Related Items See Appendix A Status Codes for a complete list of the possible status codes for each operation Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 143 NI VISA Programmer Reference Manual Chapter 5 Operations viTerminate Purpose Requests a VISA session to terminate normal execution of an operation C Syntax ViStatus viTerminate ViObject vi ViUInt16 degree ViJobId jobId Visual Basic Syntax N A Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Na
98. params viVSPrintf vi buf writeFmt params viVSScanf vi buf readFmt params viWrite vi buf count retCount viWriteAsync vi buf count jobId viWriteFromFile vi fileName count retCount Resources This section lists the attributes events and operations for the SOCKET Resource The attributes events and operations in the VISA Resource Template are available to this resource in addition to the attributes and operations listed below Attributes VI ATTR FILE APPEND EN VI ATTR INTF INST NAMI VI ATTR INTF NUM VI ATTR INTF TYPE VI ATTR IO PROT VI ATTR RD BUF OPER MODI VI ATTR SEND END EN VI ATTR TCPIP ADDR VI ATTR TCPIP HOSTNAME VI ATTR TCPIP KEEPALIVE VI ATTR TCPIP NODELAY VI ATTR TCPIP PORT VI ATTR TERMCHAR VI ATTR TERMCHAR EN VI ATTR VALUE VI ATTR TRIG ID VI ATTR WR BUF OPER MODI CG 11 NI VISA Programmer Reference Manual Appendix Resources Events VI_EVENT_IO_COMPLETION Operations viAssertTrigger vi protocol viBufRead vi buf count retCount viBufWrite vi buf count retCount viClear vi viFlush vi mask viPrintf vi writeFmt viQueryf writeFmt readFmt viRead vi buf count retCount viReadAsync vi buf count jobId viReadSTB vi status viReadToFile vi fileName count retCount viScanf vi readFmt viSetBuf vi mask size viSPrintf vi buf writ
99. to FFh OAh Local linefeed Description VI ATTR TERMCHAR is the termination character When the termination character is read and VI ATTR TERMCHAR EN is enabled during a read operation the read operation terminates For a Serial INSTR session TERMCHAR is Read Write when the corresponding session is not enabled to receive VI EVENT ASRL TERMCHAR events When the session is enabled to receive VI 1 EVENT ASRL TERMCHAR events the attribute VI ATTR TERMCHAR is Read Only For all other session types the attribute ATTR TERMCHAR is always Read Write Related Items Refer to the VI ATTR TERMCHAR EN description of this chapter Also refer to the INSTR Resource INTFC Resource SOCKET Resource and SERVANT Resource descriptions of Appendix B Resources National Instruments Corporation 3 111 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR TERMCHAR EN Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViBoolean VI_TRUE 1 VI_FALSE Local VI_FALSE 0 Description VI ATTR TERMCHAR EN is a flag that determines whether the read operation should terminate when a termination character is received This attribute is valid for both raw I O viRead
100. with an I O completion event to identify which asynchronous read operation completed VISA will never return VI NULL for a valid jobID B Note If you have enabled VI_EVENT_IO_COMPLETION for queueing VI_QUEUE for each successful call to viReadAsync you must call viwaitOnEvent to retrieve the I O completion event This is true even if the I O is done synchronously that is if the operation returns SUCCESS SYNC If you are using LabVIEW this is done for you automatically Related Items Refer to the viEnableEvent viRead viTerminate viWaitOnEvent and viWriteAsync descriptions of this chapter and the vi EVENT IO COMPLETION description of Chapter 4 Events Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 118 ni com Chapter 5 Operations viReadSTB Purpose Reads a status byte of the service request C Syntax ViStatus viReadSTB ViSession vi ViPUInt16 status Visual Basic Syntax viReadSTB amp ByVal vi amp status Resource Classes GPIB INSTR GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR Parameters Name Direction Description vi IN Unique logical identifier to a session status OUT Service request status byte Return Values
101. 1 arg is a double float Length modifier L arg is a long double array size arg points to an array of floats or doubles or long doubles depending on the length modifier of size array size The elements of this array are separated by array size 1 commas and output in the specified format Argument type A reference to a NULL terminated string that is sent to the device without change NI VISA Programmer Reference Manual 5 108 ni com Chapter 5 Operations Enhanced Format Codes b Argument type A location of a block of data Flag or Modifier Interpretation Default functionality The data block is sent as an IEEE 488 2 lt DEFINITE LENGTH ARBITRARY BLOCK RESPONSE DATA A count long integer must appear as a flag that specifies the number of elements by default bytes in the block A field width or precision modifier is not allowed with this format code asterisk An asterisk may be present instead of the count In such a case two args are used the first of which is a long integer specifying the count of the number of elements in the data block The second arg is a reference to the data block The size of an element is determined by the optional length modifier see below and the default is byte width Length modifier h arg points to an array of unsigned short integers 16 bits The count corresponds to the number of words rather than bytes The data is sw
102. 2 formats lt DECIMAL NUMERIC PROGRAM DATA or lt NON DECIMAL NUMERIC PROGRAM DATA 0 and 8 field width The input will be stored in a field at least this wide Length modifier 1 arg is a reference to a double floating point number Length modifier L arg is a reference to a long double number array size arg points to an array of floats or double or long double depending on the length modifier of size array size The elements of this array should be separated by commas Elements will be read until either array size number of elements are consumed or they are no longer separated by commas If the array size contains a number sign two arguments are used The first arg read is a pointer to an integer specifying the maximum number of elements that the array can hold The second arg should be a reference to an array Also the actual number of elements read is stored back in the first argument s Argument type A reference to a string Flags or Modifiers Interpretation Default functionality All leading white space characters are ignored Characters are read from the device into the string until a white space character is read field width This flag gives the maximum string size If the field width contains a number sign two arguments are used The first argument read is a pointer to an integer specifying the maximum array size The second should be a reference to an array
103. 4 or A32 space Notice also that the length specified in the viMovernxx operations for an INSTR Resource is the number of elements of the size corresponding to the operation to transfer beginning at the specified offset Therefore offset length size cannot exceed the amount of memory exported by the device in the given space MEMACC Specific For MEMACC Resource the offset parameter specifies an absolute address Notice also that the length specified in the viMoveOutXXx operations for MEMACC Resource is the number of elements of the size corresponding to the operation to transfer beginning at the specified offset Therefore offset length size cannot exceed the total amount of memory available in the given space NI VISA Programmer Reference Manual 5 82 ni com Chapter 5 Operations Related Items Refer to the viMoveIn8 viMoveIn16 viMoveiIn32 description of this chapter Refer to the VI_LATTR_DEST_INCREMENT description of Chapter 3 Attributes Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources National Instruments Corporation 5 83 NI VISA Programmer Reference Manual Chapter 5 Operations viOpen Purpose Opens a session to the specified resource C Syntax ViStatus viOpen ViSession sesn ViRsrc rsrcName ViAccessMode accessMode ViUInt32 openTimeout ViPSession vi Visual Basic Syntax viOpen amp ByVal sesn amp ByVal rsrcName ByVal accessMode
104. 6 bits for or buf32 viMoveOut16 and 32 bits for viMoveOut32 NI VISA Programmer Reference Manual 5 80 ni com Return Values Chapter 5 Operations Completion Codes Description VI_SUCCESS Operation completed successfully Error Codes Description VI ERROR_INV_OBJECT The given session reference is invalid VI ERROR_NSUP_OPER The given vi does not support this operation VI ERROR RSRC LOCKI E s Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR BERR Bus error occurred during transfer VI ERROR INV SPACE Invalid address space specified VI ERROR INV OFFSET Invalid offset specified VI ERROR NSUP OFFSET Specified offset is not accessible from this hardware VI ERROR NSUP WIDTH Specified width is not supported by this hardware VI ERROR INV LENGTH Invalid length specified VI ERROR NSUP ALIGN OFFSET The specified offset is not properly aligned for the access width of the operation VI ERROR INV SETUP Unable to start operation because setup is invalid due to attributes being set to an inconsistent state Description The viMoveOut Xx operations use the specified address space to write 8 16 or 32 bits of data respectively to the specified offset These operations do not
105. A D size VXIbus system will have three sets of bused connectors called the J1 J2 and J3 backplane Each PCI or PXI device has six of these BARO through BARS At power on each BAR requests a given size of memory or I O space Each device can request from 0 to 6 regions of PCI memory or I O space After the operating system starts each BAR contains an assigned base address in PCI address space A value of 0 in a given BAR indicates that the device is not using that BAR An error that signals failed access to an address Bus errors occur with low level accesses to memory and usually involve hardware with bus mapping capabilities For example nonexistent memory a nonexistent register or an incorrect device access can cause a bus error ni com byte order C callback CIC commander communication channel configuration registers controller CPU D device DLL National Instruments Corporation 6 3 Glossary How bytes are arranged within a word or how words are arranged within a longword Motorola big endian ordering stores the most significant byte MSB or word first followed by the least significant byte LSB or word Intel little endian ordering stores the LSB or word first followed by the MSB or word A software routine that is invoked when an asynchronous event occurs In VISA callbacks can be installed on any session that processes events Also known as handler Controller In Charge The devi
106. C GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session fileName IN Name of file to which data will be written count IN Number of bytes to be read retCount OUT Number of bytes actually transferred Return Values Completion Codes Description VI SUCCESS The operation completed successfully and the END indicator was received for interfaces that have END indicators VI SUCCESS TERM CHAR The specified termination character was read VI SUCCESS MAX CNT The number of bytes read is equal to count National Instruments Corporation 5 121 NI VISA Programmer Reference Manual Chapter 5 NI VISA Programmer Reference Manual Operations Error Codes Description VI ERROR INV OBJECT The given session or object reference is invalid both are the same value VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR TMO Timeout expired before operation completed VI ERROR RAW WR PROT VIOL Violation of raw write protocol occurred during transfer VI ERROR RAW RD PROT VIOL Violation of raw read protocol occurred
107. CPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session eventType IN Logical event identifier context IN A handle specifying the unique occurrence of an event userHandle IN A value specified by an application that can be used for identifying handlers uniquely in a session for an event Return Values Completion Codes Description VI_SUCCESS Event handled successfully VI_SUCCESS_NCHAIN Event handled successfully Do not invoke any other handlers on this session for this event National Instruments Corporation 5 25 NI VISA Programmer Reference Manual Chapter 5 Operations Description viEventHandler is not an actual VISA operation Rather it is the prototype for a user event handler that is installed with the viInstallHandler operation The user handler is called whenever a session receives an event and is enabled for handling events in the VI_HNDLR mode The handler services the event and returns VI_SUCCESS on completion The VISA system automatically invokes viClose operation on the event context when a user handler returns Because the event context must still be valid after the user handler returns so that VISA can free it up an application should not invoke the viClose operation an event context passed to a user handler
108. CTIONS COMPUTER OPERATING SYSTEM SOFTWARE FITNESS FITNESS OF COMPILERS AND DEVELOPMENT SOFTWARE USED TO DEVELOP AN APPLICATION INSTALLATION ERRORS SOFTWARE AND HARDWARE COMPATIBILITY PROBLEMS MALFUNCTIONS OR FAILURES OF ELECTRONIC MONITORING OR CONTROL DEVICES TRANSIENT FAILURES OF ELECTRONIC SYSTEMS HARDWARE AND OR SOFTWARE UNANTICIPATED USES OR MISUSES OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER ADVERSE FACTORS SUCH AS THESE ARE HEREAFTER COLLECTIVELY TERMED SYSTEM FAILURES ANY APPLICATION WHERE A SYSTEM FAILURE WOULD CREATE A RISK OF HARM TO PROPERTY OR PERSONS INCLUDING THE RISK OF BODILY INJURY AND DEATH SHOULD NOT BE RELIANT SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE TO AVOID DAMAGE INJURY OR DEATH THE USER OR APPLICATION DESIGNER MUST TAKE REASONABLY PRUDENT STEPS TO PROTECT AGAINST SYSTEM FAILURES INCLUDING BUT NOT LIMITED TO BACK UP OR SHUT DOWN MECHANISMS BECAUSE EACH END USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM NATIONAL INSTRUMENTS TESTING PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS PRODUCTS IN COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUATED OR CONTEMPLATED BY NATIONAL INSTRUMENTS THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING THE SUITABILITY OF NATIONAL INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE INCORPORATED IN A SYSTEM OR APPLICATION INCLUDING WITHOUT LIMITATIO
109. Corporation 4 19 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT SIGP Resource Classes VXI INSTR Description This event notifies the application that a V XIbus signal or V XIbus interrupt was received from the device associated with the given session Event Attributes Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event This attribute always has the value of vr EVENT VXI SIGP for this event type VI ATTR SIGP STATUS ID The 16 bit Status ID value retrieved during the IACK cycle or from the Signal register Related Items Refer to the vr ATTR EVENT and VI ATTR SIGP STATUS ID descriptions of Chapter 3 Attributes Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 4 20 ni com VI EVENT VXI VME INTR Chapter 4 Events Resource Classes VXI INSTR Description This event notifies the application that a V XIbus interrupt was received from the device associated with the given session Event Attributes Symbolic Name Description VI ATTR EVENT Unique logical identifier of the event This attribute always has the value of EVENT VXI INTR for this event type VI ATTR INTR STATUS ID The 32 bit Status ID value retrieved during the IACK cycle VI ATTR RECV INTR LEVEL
110. DEVICE NAME rh eret perpe Pee 3 106 VI ATTR TCPIP HOSTNAME reete etn bae eer ette Lage aerae 3 107 VI ATIR TCPIP KEEPATIV B rtt te e Ree repetere edi 3 108 VI NODELAY Pp RI HR eR 3 109 VIATIR TCPIP E 3 110 ad d Ree e ea P en edi teet 3 111 VI ATIR TERMCHAR EN ette i Re E Reo Re tee 3 112 VI ATTR TMO VALUE erint rt ye ete A a oen 3 113 VE ATIR TRIG ID eet Te ERN ez 3 114 VI ATTR USB ALT SETTING ertet Revi he E d hen cb mea 3 115 VI ATIR USB BULK eire retener rege 3 116 VI ATTR USB BULK IN STATUS 2 2 2 3 117 VI ATIR USB BULK OUT_PIPE 2 20 3 118 VI USB BULK OUT STATUS cieie re i aaa 3 119 VI ATIR USB CLASS nee etie DE RI a T ae 3 120 VI ATIR USB INTEC NUM wos nete Re tere eie eerte din 3 121 VI ATIR USB INTRIN PIBE irte eite eet rete tet de tees 3 122 VI ATTR USB INTR JN STATUS eve 3 123 VI ATIR USB MAX INTR SIZE hri terrre terere 3 124 VI ATTR USB NUM INTFGS iieri rtt riter en 3 125 VILATTR USB NUM PIPES itte tetro te trier tete 3 126 VI ATTR USB PROTOQCOL tende Rein ade iei Pee a tues 3 127 VI ATIR USB RECV JNTR DATA tette tpe terre 3 128 V
111. Data that is read is assumed to be in IEEE 488 2 byte ordering It will be byte swapped and padded as appropriate to native computer format Length modifier 1 arg points to an array of 32 bit longwords and count specifies the number of longwords Data that is read is assumed to be in IEEE 488 2 byte ordering It will be byte swapped and padded as appropriate to native computer format Length modifier z arg points to an array of floats and count specifies the number of floating point numbers Data that is read is an array of 32 bit IEEE 754 format floating point numbers Length modifier z arg points to an array of doubles and the count specifies the number of floating point numbers Data that is read is an array of 64 bit IEEE 754 format floating point numbers NI VISA Programmer Reference Manual 5 130 ni com Chapter 5 Operations t Argument type A reference to a string Flags or Modifiers Interpretation Default functionality Characters are read from the device until the first END indicator is received The character on which the END indicator was received is included in the buffer field width This flag gives the maximum string size If an END indicator is not received before field width number of characters additional characters are read and discarded until an END indicator arrives field width has the same meaning as in s T Argument type A reference to a string Flags or Modi
112. E PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 Oh to 3FFFh N A Global Description VI ATTR RSRC MANF ID is a value that corresponds to the VXI manufacturer ID of the vendor that implemented the VISA library This attribute is not related to the device manufacturer attributes Related Items Refer to the ATTR RSRC Resource Template description of Appendix B Resources National Instruments Corporation E description of this chapter Also refer to the VISA NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR RSRC MANF NAME Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViString N A N A Global Description VI ATTR RSRC NAME is String that corresponds to the manufacturer name of the vendor that implemented the VISA library This attribute is not related to the device manufacturer attributes Related Items Refertothe vr ATTR RSRC MANF ID description of this c
113. E ATIR PXI DEV NUM e dette te edente det 3 71 VI ATTR PXI FUNG NUM iett ette rtp te tire eit 3 72 VI PXI MEM BASE ATTR PXI MEM BASE BARI VI PXI MEM BASE 2 ATTR PXI MEM BASE BAR3 VI ATTR PXI MEM BASE 4 ATTR PXI MEM BASE BARS 3 73 VI ATTR PXI MEM SIZE BARO VI ATTR PXI MEM SIZE 1 VI ATTR PXI MEM SIZE BAR2 VI ATTR PXI MEM SIZE BAR3 VI ATTR PXI MEM SIZE BARZA VI ATTR PXI MEM SIZE 5 3 74 VI PXI TYPE BARO VI ATTR PXI MEM TYPE VI ATTR PXI MEM BAR2 VI ATTR PXI MEM BAR3 VI ATTR PXI TYPE BARZ4 VI ATTR PXI MEM BARS5 3 75 VI ATTR PXI SLOT LBUS EBET uite tette I rere pas 3 76 VI ATTR PXI SLOT LBUS RIGHT eerte eee eere 3 77 VI ATTR PXI SEOTPATH tet rer etg 3 78 VI AITR PXI STAR TRIG BUS sais costs noire e 3 79 VI ATTR PXI STAR TRIG et eir t tee eee repas 3 80 VIE ATTR PXI TRIG BUS iret rtm tee teet rep dieu i a epe dn 3 81 VI ATTR RD MODE inrita imt rdi 3 82 NVI ATTR RD BUE SIZE 3 83 VI ATTR RECV INTR LEVEL etm eere hRDeS 3 84 VL ATTR RECV TRIG JD rei een eee ERI RA Eee edid 3 85 VIATTR RET COUNT ae eri tenete oid 3 86 VEATTR RM SESSION irn ger ER ETE E AR 3 87
114. ENT_TYPE Unique logical identifier of the event Related Items Refer to the VI_ATTR_EVENT_TYPE and VI_ATTR_ASRL_BREAK_STATE descriptions of Chapter 3 Attributes Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 4 2 ni com Chapter 4 Events VI EVENT ASRL CHAR Note This event is valid only Windows and platforms on which National Instruments supports its ENET Serial products Resource Classes Serial INSTR Description Notification that at least one data byte has been received Each data character will not necessarily result in an event notification In other words if multiple data bytes arrive at once you may get only one event After receiving this event you should query the serial port for the number of bytes available via the VI_LATTR_ASRL_AVAIL_NUM attribute Event Attributes Symbolic Name Description VI_ATTR_EVENT_TYPE Unique logical identifier of the event Related Items Refer to the ATTR EVENT and VI ATTR ASRL AVAIL NUM descriptions of Chapter 3 Attributes Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 4 3 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT ASRL CTS 3 Note This event is valid only on Windows and platforms on which supports its ENET Serial products
115. EST INCREMI ENT is used in the viMoveOutXX operations to specify by how many elements the destination offset is to be incremented after every transfer The default value of this attribute is 1 that is the destination address will be incremented by 1 after each transfer and the viMoveOutXX operations move into consecutive elements If this attribute is set to 0 the viMoveOutXx operations will always write to the same element essentially treating the destination as a FIFO register Related Items Refer to the ATTR DEST ACC VI ATTR SRC INCREMI ESS PRIV VI ATTR D EST BYTE ORDER and and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual ENT descriptions of this chapter Also refer to the INSTR Resource ni com VI ATTR DEV STATUS BYTE Chapter 3 Attributes Resource Classes GPIB INTFC GPIB SERVANT VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViUInt8 0 to FFh N A Global Description This attribute specifies the 488 style status byte of the local controller or device associated with this session If this attribute is written and bit 6 40h is set this device or controller will assert a service request SRQ if it is defined for this interface Related Items See INTFC Resource and SERVANT Resource of Appendix B Resources National Instrument
116. ET USB INSTR USB RAW VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI_FLUSH_ON_ACCESS 1 VI FLUSH DISABLE Local VI FLUSH DISABLE 3 Description VI ATTR RD BUF OPER MODE specifies the operational mode of the formatted I O read buffer When the operational mode is set to FLUSH DISABLE default the buffer is flushed only on explicit calls to viFlush If the operational mode is set to VI FLUSH ON ACCESS the write buffer is flushed every time a viScanf or related operation completes Related Items Refertothe vr ATTR WR BUF OPER MODE description of this chapter Refer to the viFlush and viScanf descriptions of Chapter 5 Operations Also refer to the INSTR Resource INTFC Resource SOCKET Resource and SERVANT Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 82 ni com Chapter 3 Attributes VI ATTR RD BUF SIZE Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViUInt32 N A N A Local Description This is the current size of the formatted I O input buffer for this session The user can modify this value by calling visetBuf Related Items Refer to the AT
117. EV ENT VXI EV ENT VXI VME INTR Operations viAssertTrigger vi viBufRead vi buf count NI VISA Programmer Reference Manual protocol retCount ni com Appendix Resources viBufWrite vi buf count retCount viClear vi viFlush vi mask viGpibControlREN vi mode viln8 vi space offset val8 1 16 space offset 116 viln32 vi space offset val32 viMapAddress vi mapSpace mapBase mapSize access suggested address viMemAlloc vi size offset viMemFree vi offset viMove vi srcSpace srcOffset srcWidth destSpace destOffset destWidth length viMoveAsync vi srcSpace srcOffset srcWidth destSpace destOffset destWidth length jobId viMoveIn8 vi space offset length buf8 1 16 space offset length buf16 viMoveIn32 vi space offset length buf32 viMoveOut8 vi space offset length buf8 viMoveOuti6 vi space offset length buf16 viMoveOut32 vi space offset length buf32 viOut8 vi space offset val8 viOut16 vi space offset 116 viOut32 vi space offset val32 viPeek8 vi addr val8 16 addr 116 32 addr val32 8 addr val8 16 addr 116 32 addr val32 viPrintf vi writeFmt viQueryf vi writeFmt readFmt viRead vi buf count retCount viReadAsync vi b
118. FFF0046h The specified mode is not supported by this VISA implementation VI ERROR SRO NOCCURRED BFFF004Ah Service request has not been received for the session VI ERROR INV SPACE BFFF004Eh Invalid address space specified VI ERROR INV OFFSET BFFF0051h Invalid offset specified VI ERROR INV WIDTH BFFF0052h Invalid source or destination width specified VI ERROR NSUP OFFSET BFFF0054h Specified offset is not accessible from this hardware VI ERROR NSUP VAR WIDTH BFFF0055h Cannot support source and destination widths that are different VI ERROR WINDOW NMAPPED BFFF0057h The specified session is not currently mapped VI ERROR RESP PENDING BFFF0059h A previous response is still pending causing a multiple query error VI ERROR NLISTENERS BFFF005Fh No Listeners condition is detected both NRFD and NDAC are deasserted VI ERROR NCIC BFFF0060h interface associated with this session is not currently the controller in charge National Instruments Corporation 5 NI VISA Programmer Reference Manual Appendix A Status Codes Table A 2 Error Codes Continued Error Codes Values Meaning VI_ERROR_NSYS_CNTLR 0061 The interface associated with this session is not the system controller VI_ERROR
119. I ATTR USB INTR SIZE eite tete eerte ree Padres 3 129 VI ATIR USB SERIAT NUM tin e e rb eed ep 3 130 VI ATTR USB SUBCLASS 3 131 VI ATIR USER DATA ftrt gn dee 3 132 VI ATIR VXI DEV CEASS 3 2 ir RR e e x etn 3 133 VEATTR VXL LA iie ee Paene eni ne 3 134 VI ATTR VXI TRIG STATUS rrt rero tte rette e ttp tn 3 135 VI ATIR VXI TRIG SUPPORT 5 etes ete 3 136 VI VXI INTR 5 2 3 137 VI ATTR VXI SYSFAIL 8 3 138 NI VISA Programmer Reference Manual Viii ni com Contents VI_AT TR WIN ACCESS ics ise dud de t ed te ena at 3 139 VL ATTR WIN ACCESS PRIV eani eiecit inr aie eR 3 140 VI ATTR WIN BASE ADDR cred ee ae eds 3 141 VI ATIR WIN BYTE ett eet e OE dons 3 142 ME ATTR WIN SIZE 3 3 gites eee D ihe eol e Ue t 3 143 VI ATTR WR BUF OPER MODE esent 3 144 VI ATTR WR BUECSIZE Paintin teil n eu a nt ide 3 145 Chapter 4 Events VI EVENT ASRE BREAK inis eh ORE p BOR EORR 4 2 VIJEVENTZASRLEZCHAR ern eee ee ee 4 3 VI EVENTZASRL CTS ies bet Aiki oed Se ie 4 4 VIGEVENTLASRE DCD reo e Ue te ettet detti ire esee 4 5 VI EVENTLASRL DSR atia ae o d det t tes 4 6 VICEVENTZASRLDE CRE n t ote rrt E EU C E ER TRECE 4 7 VI EVENT
120. I ATTR ASRL FLOW CNTRL descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR ASRL XON CHAR Chapter 3 Attributes Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViUInt8 0 to FFh Control Q 11h Local Description VI ATTR ASRL CHAR specifies the value of the XON character used for XON XOFF flow control both directions If XON XOFF flow control software handshaking is not being used the value of this attribute is ignored Related Items Refertothe VI ATTR ASRL XOFF CHAR and VI ATTR ASRL FLOW CNTRL descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 25 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR BUFFER Resource Classes VI EVENT IO COMPLETION Attribute Information Description Access Privilege Data Type Range Default Read Only ViBuf N A N A VI ATTR BUFFER contains the address of a buffer that was used in an asynchronous operation Related Items Refertothe VI ATTR STATUS VI ATTR JOB ID andVI ATTR RET COUNT descriptions of this chapter Refer to the EVENT COMPLETION event description of Chapter 4 Events NI VISA Programmer Reference Manual ni
121. I ERROR INV FMT A format specifier in the writeFmt string is invalid VI ERROR NSUP FMT A format specifier in the writeFmt string is not supported VI ERROR ALLOC The system could not allocate a formatted I O buffer because of insufficient resources Description The viPrintf operation sends data to a device as specified by the format string Before sending the data the operation formats the arguments in the parameter list as specified in the writeFmt string The viwrite operation performs the actual low level I O to the device As a result you should not use the viwrite and viPrintf operations in the same session The writeFmt string can include regular character sequences special formatting characters and special format specifiers The regular characters including white spaces are written to the device unchanged The special characters consist of N backslash followed by a character The format specifier sequence consists of percent followed by an optional modifier flag followed by a format code Special Formatting Characters Special formatting character sequences send special characters The following table lists the special characters and describes what they send to the device Formatting Character Character Sent to Device Sends the ASCII LF character The END identifier will also be automatically sent Sends an ASCII CR character t Sends an ASCII TAB charac
122. I TRUE Local VI FALSE 0 Description VI ATTR SEND END EN specifies whether to assert END during the transfer of the last byte of the buffer Related Items Refer to the viwrite description of Chapter 5 Operations and the INSTR Resource INTFC Resource SOCKET Resource and SERVANT Resource descriptions of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Attributes Chapter 3 Attributes ATTR SIGP STATUS ID Resource Classes VI EVENT VXI SIGP Attribute Information Description Access Privilege Data Type Range Default Read Only viUInt16 Oh to FFFFh N A VI_ATTR_SIGP_STATUS_ID is the 16 bit Status ID value retrieved during the IACK cycle or from the Signal register Related Items Refer to the vr EVENT VXI SIGP event description of Chapter 4 Events Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com SLOT Chapter 3 Attributes Resource Classes GPIB VXI INSTR PXI INSTR VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 VXI N A Global to 12 VI UNKNOWN SLOT 1 1 to 18 VI_UNKNOWN_SLOT 1 Description VI_ATTR_SLOT specifies the physical slot location of the device If the slot number is not known VI UNKNOWN SLOT is returned
123. IB UNADDRESSED 0 N A Global VI GPIB TALKER 1 VI GPIB LISTENER 2 Description This attribute shows whether the specified GPIB interface is currently addressed to talk or listen or is not addressed Related Items Also refer to the INTFC Resource and SERVANT Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR GPIB STATE Chapter 3 Attributes Resource Classes GPIB INTFC Attribute Information Access Privilege Data Type Range Default Read Only Vilnt16 VI STATE ASSERTED 1 N A Global VI STATE UNASSERTED 0 VI STATE UNKNOWN 1 Description This attribute shows the current state of the GPIB ATN ATtentioN interface line Related Items Refer to the ATTR GPIB REN STATI VI ATTR GPIB SRQ STATI E ATTR GPIB NDAC STATE and E descriptions of this chapter and the viGpibControlATN description of Chapter 5 Operations Also refer to the INTFC Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR GPIB CIC STATE Resource Classes GPIB INTFC Attribute Information Description Access Privilege Data Type Range Default Read Only ViBoolean VI_TRUE 1 N A Global VI_FALSE 0 This attribute shows whether the specified GPIB interface is
124. INSTR A GPIB device at primary address 1 and secondary address 0 in GPIB interface 0 ASRL1 INSTR A serial device attached to interface 1 VXI MEMACC Board level register access to the VXI interface 1 Board level register access GPIB VXI interface number 1 GPIB2 INTFC Interface or raw resource for GPIB interface 2 VXI 1 BACKPLANE Mainframe resource for chassis 1 on the default VXI system which is interface 0 GPIB VXI2 BACKPLANI 161 Mainframe resource for default chassis GPIB VXI interface 2 GPIB1 SERVANT Servant device side resource for GPIB interface 1 VXI0O SERVANT Servant device side resource for VXI interface 0 PXI 15 INSTR PXI device number 15 on bus 0 with implied function 0 PXI0 2 12 1 INSTR PXI bus number 2 device 12 with function 1 0 MEMACC session TCPIPO 1 2 3 4 7 999 SOCKET Raw TCP IP access to port 999 at the specified IP address TCPIP dev company com INSTR A TCP IP device using VXI 11 located at the specified address This uses the default LAN Device Name of instO visa hostname resource The resource on the specified remote system The hostname can be represented as either an IP address dot notation or network machine name This remote system need not be a configured remote system
125. ISA Programmer Reference Manual Operations This chapter describes the VISA operations The operation descriptions are listed in alphabetical order for easy reference Each event description contains a brief Purpose statement below the title You will then see the operation defined in both ANSI C and Visual Basic version 4 syntax with the parameters set in boldface type A list indicating the supported resource classes such as GPIB Serial etc is followed by a table that describes each parameter and indicates whether it is an input or output parameter or both in some cases The Return Values section describes the completion and error codes followed by a detailed Description section The Related Items section directs you toward related operations attributes events or resource descriptions If you want to know specifically about attributes events and operations of the INSTR Resource for example you should refer to the INSTR Resource section of Appendix B Resources National Instruments Corporation 5 1 NI VISA Programmer Reference Manual Chapter 5 Operations viAssertintrSignal Purpose Asserts the specified interrupt or signal C Syntax ViStatus viAssertIntrSignal ViSession vi ViInt16 mode ViUInt32 statusID Visual Basic Syntax viAssertIntrSignal amp ByVal vi amp ByVal mode ByVal statusID amp Resource Classes GPIB VXI BACKPLANE VXI BACKPLANE VXI SERVANT Parameters Name Direction
126. LLOW EN ATTR FILE APPEND EN VI ATTR GPIB ATN STAT VI ATTR GPIB CIC STATI VI ATTR GPIB HS488 CB VI ATTR GPIB NDAC STATE VI ATTR GPIB PRIMARY ADDR o NI VISA Programmer Reference Manual Appendix Resources VI_ATTR_GPIB_REN_STATE VI_ATTR_GPIB_SECONDARY_ADDR VI ATTR GPIB SRQ STATE VI ATTR GPIB SYS CNTRL STATE VI ATTR INTF INST NAME VI ATTR INTF NUM VI ATTR INTF TYPE VI ATTR RD BUF OPER MODE VI ATTR SEND END EN VI ATTR TERMCHAR VI ATTR TERMCHAR EN VI ATTR TMO VALUE VI ATTR TRIG ID VI ATTR WR BUF OPER MODE Events VI EVENT CLEAR VL EVENT GPIB CIC VI EVENT GPIB LISTEN VI EVENT GPIB TALK VI EVENT IO COMPLETION VI EVENT SERVICE VI EVENT TRIG Operations viAssertTrigger vi protocol viBufRead vi buf count retCount viBufWrite vi buf count retCount viFlush vi mask viGpibCommand vi buf count retCount viGpibControlATN vi mode viGpibControlREN vi mode viGpibPassControl vi primAddr secAddr viGpibSendIFC vi viPrintf vi writeFmt viRead vi buf count retCount viReadAsync vi buf count jobId viReadToFile vi fileName count retCount viScanf vi readFmt viSetBuf vi mask size viSPrintf vi buf writeFmt viSScanf vi buf readFmt NI VISA Programmer Reference Manual 8 ni com Append
127. N THE APPROPRIATE DESIGN PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION Contents About This Manual How to Use the Manual Set eene nennen nentes xiii C onventionsEic ausencia ehe ipsemet isole eos E Uie xiii Related Doc mentatiorn 5 5 te te eet v ee A xiv Chapter 1 Introduction What You Need to Get Started esses eene eene nne 1 1 VXIplug amp play OvV6etview ti ene nee ripe 1 1 Supported Platforms osiensa e bet etie dt te i tee e c neci ien 1 2 Chapter 2 Overview of the VISA API VISA Access Mechanisms rrr tec derer e oti en Pe P Cove eve e celu 2 1 Attributes bec tuere t REESE CREER D Etre ug 2 1 eer tts ree a ees rv e ee ex 2 1 Opefations pete e EL EO EE e HIR 2 2 MIS A Resource Ty pes dm been mene mede 2 2 ee nA 2 2 ae e e 2 3 aem audebit ds 2 4 BAGCKPI ANE rerit beste Ero 2 4 SERVANT uo ean EE en 2 4 SOCKET onda reet eset od Hec 2 5 pog 2 5 Desctiption ofthe iai eite nme eee ede indes 2 6 Chapter 3 Attributes VI ATTR 4882 COMPLIANT oce tee levine 3 2 VI ASRL ALLOW 2 0 0 100 3 3 VI ATTR ASRLE AVAIE NUM e NR
128. NSTR and ASRL11 INSTR but not ASRL2 INSTR GPIB VXI INSTR Matches GPIB1 5 INSTR and VX1I0 3 INSTR but not ASRL2 INSTR GPIBO VXIO 1 INSTR Matches GPIBO 1 INSTR and VXIO 1 INSTR INSTR Matches all INSTR device resources VXI 0 9 MEMACC Matches VXIO0 and 1 VXIO Matches VXI0 1 INSTR VXI0 2 INSTR and VXIO MEMACC Matches all resources visa hostname Matches all resources on the specified remote system The hostname can be represented as either an IP address dot notation or network machine name This remote system need not be a configured remote system NI VISA Programmer Reference Manual 5 32 ni com Chapter 5 Operations Regular Expression Sample Matches Matches all resources on the local machine Configured remote systems are not queried visa ASRL INSTR Matches all ASRL resources on the local machine and returns them in URL format for example visa ASRL1 INSTR You can use the NI VISA configuration utility Measurement amp Automation Explorer MAX on Windows visaconf on UNIX to access certain NI VISA servers by default All expressions without the preceding will be matched with resources on the configured remote systems For more information refer to the NI VISA User Manual By using the optional attri
129. NTR IN PIPI description of Appendix B Resources NI VISA Programmer Reference Manual 3 126 Access Privilege Data Type Range Default Read Only Vilnt16 0 to 30 Global ES specifies the number of pipes supported by this USB interface E descriptions of this chapter and the RAW Resource ni com Chapter 3 Attributes VI ATTR USB PROTOCOL Resource Classes USB INSTR USB RAW Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 0 to FFh N A Global Description VI ATTR USB PROTOCOL specifies the USB protocol used by the given session Related Items Refer to the INSTR Resource and RAW Resource descriptions of Appendix B Resources National Instruments Corporation 3 127 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR USB RECV INTR DATA Resource Classes VI EV ENT USB INTR Attribute Information Access Privilege Data Type Range Default Read Only ViAUInt8 N A N A Description VI ATTR USB RECV INTR DATA contains the actual received data from the USB Interrupt The passed in data buffer must be of size at least equal to the value of VI ATTR USB RECV INTR SIZE Related Items V Refertothe VI ATTR USB RECV INTR 5171 VI E E description of this chapter and the ENT USB INTR description of Chapter 4 Events NI VISA Programmer Reference Manu
130. OPER MODE attribute or with the viFlush operation Related Items Refer to the viFlush viSPrintf viVPrintf viVSPrintf and viScanf descriptions of this chapter and the vr ATTR WR BUF OPER MODE description of Chapter 3 Attributes Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources and refer to your ANSI C documentation for information on the printf function National Instruments Corporation 5 111 NI VISA Programmer Reference Manual Chapter 5 Operations viQueryf Purpose Performs a formatted write and read through a single call to an operation C Syntax ViStatus viQueryf ViSession vi ViString writeFmt ViString readFmt Visual Basic Syntax N A Resource Classes GPIB INSTR GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR Parameters Name Direction Description vi IN Unique logical identifier to a session writeFmt IN String describing the format of write arguments readFmt IN String describing the format of read arguments IN OUT Parameters to which write and read format strings applied Return Values Completion Codes Description VI_SUCCESS Successfully completed the query operation Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI ERROR IO Could not perform Re
131. OR NLISTENERS No Listeners condition is detected both NRFD and NDAC are unasserted VI ERROR ASRL PARITY A parity error occurred during transfer VI ERROR ASRL FRAMING A framing error occurred during transfer VI ERROR ASRL OVERRUN An overrun error occurred during transfer A character was not read from the hardware before the next character arrived VI ERROR IO An unknown I O error occurred during transfer VI ERROR CONN LOST The I O connection for the given session has been lost Description The viRead operation synchronously transfers data The data read is to be stored in the buffer represented by buf This operation returns only when the transfer terminates Only one synchronous read operation can occur at any one time Related Items Refer to the viReadAsync viBufRead viReadToFile and viWwrite descriptions of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 116 ni com Chapter 5 Operations viReadAsync Purpose Reads data from device or interface asynchronously C Syntax ViStatus viReadAsync ViSession vi ViPBuf buf ViUInt32 count ViPJobId jobId Visual Basic Syntax N A Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR USB INSTR USB RAW TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT
132. OUT PIPE 3 118 VI ATTR USB BULK OUT STATUS 3 119 VI ATTR USB CLASS 3 120 VI ATTR USB INTFC NUM 3 121 VI ATTR USB INTR IN PIPE 3 122 VI ATTR USB INTR IN STATUS 3 123 VI ATTR USB MAX INTR SIZE 3 124 VI ATTR USB NUM INTFCS 3 125 VI ATTR USB NUM PIPES 3 126 VI ATTR USB PROTOCOL 3 127 VI ATTR USB RECV INTR DATA 3 128 National Instruments Corporation F3 Index VI USB INTR SIZE 3 129 VI ATTR USB SERIAL NUM 3 130 VI ATTR USB SUBCLASS 3 131 VI ATTR USER DATA 3 132 VI ATTR VXI DEV CLASS 3 133 VI ATTR VXI LA 3 134 VI VXI STATUS 3 135 VI ATTR VXI TRIG SUPPORT 3 136 VI ATTR VXI VME INTR STATUS 3 137 VI ATTR VXI SYSFAIL STATE 3 138 VI ATTR WIN ACCESS 3 139 VI ATTR WIN ACCESS PRIV 3 140 VI WIN BASE 3 141 VI ATTR WIN BYTE ORDER 3 142 VI ATTR WIN SIZE 3 143 VI WR BUF OPER MODE 3 144 VI WR BUF SIZE 3 145 VISA Resource Manager B 2 VISA Resource Template B 1 BACKPLANE Resource attributes B 9 VI GPIB PRIMARY ADDR 3 43 VI GPIB SECONDARY ADDR 3 47 VI ATTR INTF INST NAME 3 52 VI INTF NUM 3 53 VI ATTR INTF PARENT NUM 3 54 VI ATTR TYPE 3 55 VI MAINFRAME LA 3 59 NI VISA Programmer Reference Manual Index VI ATTR TMO VALUB 3 113 VI ATTR TRIG ID 3 114 VI ATTR VXI
133. PIP INSTR TCPIP board host address LAN device name INSTR TCPIP SOCKET TCPIP board host address port SOCKET USB INSTR USB board manufacturer ID model code serial number USB interface number INSTR USB RAW USB board l manufacturer ID model code serial number USB interface number RAW Use the GPIB keyword to establish communication with GPIB resources Use the VXI keyword for VXI resources via embedded MXIbus or 1394 controllers Use the GPIB VXI keyword for VXI resources via a GPIB VXI controller Use the ASRL keyword to establish communication with an asynchronous serial such as RS 232 or RS 485 device Use the PXI keyword for PXI and PCI resources Use the TCPIP keyword for Ethernet communication The following table shows the default value for optional string segments Optional String Segments Default Value board 0 GPIB secondary address none LAN device name instO PXI bus 0 PXI function 0 USB interface number lowest numbered relevant interface The following table shows examples of address strings Address String Description VXI0 1 INSTR A VXI device at logical address 1 in VXI interface VXIO GPIB VXI 9 INSTR A VXI device at logical address 9 in a GPIB VXI controlled system National Instruments Corporation 5 87 NI VISA Programmer Reference Manual Chapter 5 Operations Address String Description GPIB 1 0
134. PLANE VXI BACKPLANE Parameters Name Direction Description vi IN Unique logical identifier to a session trigSrc IN Source line from which to map Refer to the Description section for actual values trigDest IN Destination line to which to map Refer to the Description section for actual values mode IN VI NULL Return Values Completion Code Description VI SUCCESS Operation completed successfully VI SUCCESS TRIG MAPPED The path from trigSrc trigDest is already mapped National Instruments Corporation 5 61 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_NSUP_OPER The given vi does not support this operation VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR TMO Timeout expired before operation completed VI ERROR INV MODE The value specified by the mode parameter is invalid VI ERROR LINE IN USE One of the specified lines trigSrc or trigDest is currently in use VI ERROR INV LINE One of the specified lines trigSrc or trigDest is invalid VI ERROR NSUP LINE One of the specified lines trigSrc or trigDest is not supported by this VISA implementation Description This operation can be used
135. PLANE Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 3 Attributes VI ATTR INTF TYPE Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 VI_INTF_GPIB 1 N A Global VI INTF VXI 2 VI INTF GPIB VXI 3 VI INTF ASRL 4 VI INTF PXI 5 VI INTF TCPIP 6 VI INTF USB 7 Description VI ATTR INTF TYPE specifies the interface type of the given session Related Items Refer to the vi ATTR INTF NUM description of this chapter Also refer to the IVSTR Resource MEMACC Resource INTFC Resource BACKPLANE Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 3 55 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR INTR STATUS ID Resource Classes VI EVENT VXI VME INTR Attribute Information Description Access Privilege Data Type Range Default Read Only ViUInt32 0 to FFFFFFFFh N A Global VI ATTR INTR STATUS ID specifies the 32 bit status ID retrieved during the IACK cycle Related Items Refer to the VI ATTR EVI chapter Refer to the vr Evi ENT
136. PXI DEV NUM 3 71 VI ATTR PXI FUNC NUM 3 72 VI ATTR PXI MEM BASE BARx 3 73 VI ATTR PXI MEM SIZE BARx 3 74 VI ATTR PXI MEM TYPE BARx 3 75 VI ATTR PXI SLOT LBUS LEFT 3 76 VI ATTR PXI SLOT LBUS RIGHT 3 77 VI ATTR PXI SLOTPATH 3 78 VI ATTR PXI STAR TRIG BUS 3 79 VI ATTR PXI STAR TRIG LINE 3 80 VI ATTR PXI TRIG BUS 3 81 VI ATTR RD BUF OPER MODE 3 82 VI ATTR RD BUF SIZE 3 83 VI ATTR RECV INTR LEVEL 3 84 VI ATTR RECV TRIG ID 3 85 VI ATTR RET COUNT 3 86 VI ATTR RM SESSION 3 87 VI ATTR RSRC CLASS 3 88 VI ATTR RSRC IMPL VERSION 3 89 VI ATTR RSRC LOCK STATE 3 90 VI RSRC ID 3 01 VI ATTR RSRC MANF NAME 3 92 VI RSRC NAME 3 93 VI ATTR RSRC SPEC VERSION 3 96 ni com VI SEND END EN 3 97 VI SIGP STATUS ID 3 98 VI ATTR SLOT 3 99 VI SRC ACCESS PRIV 3 100 VI SRC BYTE ORDER 3 101 VI SRC INCREMENT 3 102 VI STATUS 3 103 VI SUPPRESS END EN 3 104 VI ATTR TCPIP ADDR 3 105 VI ATTR TCPIP DEVICE NAME 3 106 VI TCPIP HOSTNAME 3 107 VI ATTR TCPIP KEEPALIVE 3 108 VI ATTR TCPIP NODELAY 3 109 VI ATTR TCPIP PORT 3 110 VI ATTR TERMCHAR 3 111 VI ATTR TERMCHAR EN 3 112 VI VALUE 3 113 VI ATTR TRIG ID 3 114 VI ATTR USB ALT SETTING 3 115 VI ATTR USB BULK IN PIPE 3 116 VI ATTR USB BULK IN STATUS 3 117 VI ATTR USB BULK
137. PXI STAR TRIG LINEand VI ATTR PXI TRIG BUS descriptions of this chapter and the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR PXI STAR TRIG LINE Resource Classes PXI INSTR Attribute Information Description Access Privilege Data Type Range Default Read Only Vilnt16 N A N A Global VI ATTR PXI STAR TRIG LINE specifies the PXI STAR line connected to this device Related Items Refertothe vr ATTR PXI STAR TRIG BUS and VI ATTR PXI TRIG BUS descriptions of this chapter and the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR PXI TRIG BUS Chapter 3 Attributes Resource Classes PXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 N A N A Global Description VI ATTR PXI TRIG BUS specifies the trigger bus number of this device Related Items Refertothe VI ATTR PXI STAR TRIG BUS and VI ATTR PXI STAR TRIG LINE descriptions of this chapter and the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR RD BUF OPER MODE Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCK
138. Purpose Relinquishes a lock for the specified resource C Syntax ViStatus viUnlock ViSession vi Visual Basic Syntax viUnlock amp ByVal vi amp Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session Return Values Completion Codes Description VI_SUCCESS Lock successfully relinquished VI_SUCCESS_NESTED_EXCL USIVE us Call succeeded but this session still has nested exclusive locks VI SUCCESS NESTED SHARE Call succeeded but this session still has nested shared locks Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR SESN NLOCKED The current session did not have any lock on the resource NI VISA Programmer Reference Manual 5 148 ni com Chapter 5 Operations Description This operation is used to relinquish the lock previously obtained using the viLock operation Related Items Refer to the viLock description of this chapter Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 149 NI VISA
139. R Resource and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 100 ni com Chapter 5 Operations viPoke8 viPoke16 viPoke32 Purpose Writes an 8 bit 16 bit or 32 bit value to the specified address C Syntax void viPoke8 ViSession vi ViAddr addr ViUInt8 18 void viPokel6 ViSession vi ViAddr addr ViUInt16 val16 void viPoke32 ViSession vi ViAddr addr ViUInt32 132 Visual Basic Syntax viPoke8 ByVal vi amp ByVal addr amp ByVal val8 as Byte viPoke16 ByVal vi amp ByVal addr amp ByVal val16 viPoke32 ByVal vi amp ByVal addr amp ByVal val32 amp Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session addr IN Destination address to store the value val8 val16 or IN Value to be stored 8 bits for viPoke8 16 bits for val32 16 and 32 bits for viPoke32 Return Values None Description The viPokexx operations store the content of an 8 bit 16 bit or 32 bit value respectively to the address pointed to by addr The address must be a valid memory address in the current process mapped by a previous viMapAddress call Related Items Refer to the viMapAddress and viPeek8 viPeek16 viPeek32 descriptions of this chapter Refer to the VI_LATTR_WIN_ACCESS description of C
140. R INTF UTR IO PROT UTR MAINFRAME LA UTR MANF ID UTR MANF NAME UTR MEM BASE UTR MEM SIZE VI 1 National Instruments Corporation MEM SPACE UTR GPIB SECONDARY ADDR Appendix B Resources NI VISA Programmer Reference Manual Appendix Resources VI VI VI VI VI VI VI VI VI VI VI VI VI VI VI VI VI VI VI VI VI UTR MODEL CODE UTR MODI UTR RD BUF OPER MODE z l R SEND END EN UTR SLOT PTR ACCESS PRIV SRC BYTE ORDER UTR SRC INCREMENT UTR SUPPRESS END EN UTR TCPIP ADDR UTR TCPIP DEVICE NAME UTR TERMCHAR EN UTR TCPIP HOSTNAME UTR TERMCHAR UTR VALUE UTR TRIG ID UTR VXI DEV CLASS UTR VXI LA UTR VXI TRIG SUPPORT WIN ACCESS WIN ACCESS PRIV WIN BASE ADDR WIN BYTE ORDER UTR WIN SIZE UTR WR BUF OPER MODE Events XE VI VL VI VIL VI VL XE VI VI VIL VI EV ENT_ASRL_BREAK EV ENT ASRL CHAR EV ENT ASRL CTS EV ENT ASRL DCD EV ENT ASRL DSR EV ENT ASRL RI EV ENT ASRL TERMCHAR EV ENT IO COMPLETION EV ENT SERVICE REQ EV ENT TRIG
141. R P 5 164 VIVSPrintt ni ete Sade Re e TR erattu th an 5 166 VIV SS CAINS t T 5 168 viVxiCommandQuery etate cubes Pee tere e deg 5 170 vyiWaitOnEBVent 5 cun t rrt RENTA IE e TRES CI 5 173 oir E 5 176 VIWA SYNC RU petes 5 178 viWrteEromFlile aiu ated e e ep ee Re RR ER NR ret HD SEE ede 5 180 Appendix A Status Codes Appendix B Resources Appendix C Technical Support and Professional Services Glossary Index National Instruments Corporation Xi NI VISA Programmer Reference Manual About This Manual This manual describes the attributes events and operations that comprise the VISA Application Programming Interface API This manual is meant to be used with the NI VISA User Manual How to Use the Manual Set Conventions If you are using NI VISA with another National Instruments product LabVIEW Measurement Studio NI 488 NI VXI etc verify that you have installed NI VISA as a component of that product s installer If you have not yet installed NI VISA you can do so by inserting the NI VISA CD into your computer and running the appropriate installer for your operating system For all Windows operating systems the OS launches the NI VISA installer automatically when you insert the CD Use Measurement amp Automation Explorer MAX to configure your system
142. ROR_INV_OFFSET Invalid offset specified VI RROR_NSUP_OFFSET Specified offset is not accessible from this hardware VI ERROR_NSUP_WIDTH Specified width is not supported by this hardware VI RROR_NSUP_ALIGN_OFFSET The specified offset is not properly aligned for the access width of the operation VI RROR_INV_SETUP Unable to start operation because setup is invalid due to attributes being set to an inconsistent state Description The vioutxx operations use the specified address space to write 8 16 or 32 bits of data respectively to the specified offset These operations do not require viMapAddress to be called prior to their invocation The following table lists the valid entries for specifying address space Value Description VXI VME and VI_A16_SPACE 1 GPIB VXI VI_A24 SPACE 2 VI_A32_SPACE 3 PXI INSTR VI_PXI_CFG_SPACE 10 VI PXI BARO SPACE 11 toVI PXI BAR5 SPACE 16 PXI MEMACC VI PXI ALLOC SPACE 9 National Instruments Corporation 5 93 NI VISA Programmer Reference Manual Chapter 5 Operations INSTR Specific Notice that offset specified in the viout8 viOut16 and viOut32 operations for an INSTR Resource is the offset address relative to the device s allocated address base for the corresponding address space that was specified For example if space specifies
143. RROR RAW RD PROT VIOL Violation of raw read protocol occurred during transfer VI ERROR INP PROT VIOL Device reported an input protocol error during transfer VI ERROR BERR Bus error occurred during transfer VI ERROR INV SETUP Unable to start write operation because setup is invalid due to attributes being set to an inconsistent state VI ERROR NCIC The interface associated with the given vi is not currently the controller in charge VI ERROR NLISTENERS No Listeners condition is detected both NRFD and NDAC are unasserted VI ERROR IO An unknown I O error occurred during transfer VI ERROR CONN LOST The I O connection for the given session has been lost Description The viwrite operation synchronously transfers data The data to be written is in the buffer represented by buf This operation returns only when the transfer terminates Only one synchronous write operation can occur at any one time Related Items Refer to the viRead viBufWrite viWriteAsync and viWriteFromFile descriptions of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 177 NI VISA Programmer Reference Manual Chapter 5 Operations viWriteAsync Purpose Writes data to device or interface asynchronously C Syntax ViStatus viWriteAsync ViSession vi ViBuf buf ViUInt32 count ViPJobId jobId Visual Basic Sy
144. RY VME devices are usually either register based or belong to a miscellaneous class VI CLASS OTHER Related Items Refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 133 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR VXI LA Resource Classes GPIB VXI INSTR GPIB VXI MEMACC VXI INSTR VXI MEMACC VXI SERVANT Attribute Information Description Access Privilege Data Type Range Default Read Only Vilnt16 0 to 511 N A Global For an INSTR session VI ATTR VXI LA specifies the logical address of the VXI or VME device used by the given session For a MEMACC or SERVANT session this attribute specifies the logical address of the local controller Related Items Refer to the INSTR Resource MEMACC Resource and SERVANT Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 134 ni com ATTR TRIG STATUS Chapter 3 Attributes Resource Classes GPIB VXI BACKPLANE VXI BACKPLANE Attribute Information Access Privilege Data Type Range Default Read Only ViUInt32 N A N A Global Description This attribute shows the current state of the VXI trigger lines This is a bit vector with bits 0 9 corresponding to VI TRIG TTLO through VI TRIG Related Items ECL1 Refer to the VI ATTR VXI VME INTR STATUS VI_ATTR_V
145. Refertothe VI ATTR FDC CHNL VI ATTR FDC MODE VI ATTR GPIB HS488 LEN VI USE PAIR descriptions of this chapter Also refer to the INSTR Resource SOCKET Resource SERVANT Resource INTFC Resource and RAW Resource descriptions of Appendix B Resources National Instruments Corporation 3 57 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR JOB ID Resource Classes VI EVENT IO COMPLETION Attribute Information Description Access Privilege Data Type Range Default Read Only ViJobId N A N A VI ATTR JOB ID contains the job ID of the asynchronous operation that has completed Related Items Refertothe VI ATTR STATUS VI ATTR BUFF NI VISA Programmer Reference Manual ER and VI ATTR RET COUNT descriptions of this chapter Refer to the EVENT IO COMPLETION event description of Chapter 4 Events Also see Appendix B Resources ni com VI ATTR MAINFRAME LA Chapter 3 Attributes Resource Classes GPIB VXI INSTR GPIB VXI BACKPLANE VXI INSTR VXI BACKPLANE Attribute Information Access Privilege Data Type Range Default Read Only Vilnt16 0 to 255 N A Global VI UNKNOWN LA 1 Description VI ATTR MAINFRAME LA specifies the lowest logical address in the mainframe If the logical address is not known VI UNKNOWN LA is returned Related Items Refer to the INSTR Resource and BACKPLANE Resource descrip
146. SA Programmer Reference Manual Chapter 3 Attributes VI ATTR RSRC SPEC VERSION Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViVersion Oh to FFFFFFFFh 00300000h Global Description VI ATTR RSRC SPEC VI ERSION is the resource version that uniquely identifies the version of the VISA specification to which the implementation is compliant The format of the value has the upper 12 bits as the major number of the version the next lower 12 bits as the minor number of the version and the lowest 8 bits as the sub minor number of the version The current VISA specification defines the value to be 00300000h Related Items Refertothe vr ATTR RSRC IMPL VERSION description of this chapter Also refer to the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR SEND END EN Chapter 3 Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViBoolean VI TRUE 1 V
147. SA sockets application sends or receives packets of data across a network IEEE 488 Service Request This is an asynchronous request from a remote device that requires service A service request is essentially an interrupt from a remote device For GPIB this amounts to asserting the SRQ line on the GPIB For VXI this amounts to sending the Request for Service True event REQT A byte of information returned from a remote device that shows the current state and status of the device If the device follows IEEE 488 conventions bit 6 of the status byte indicates whether the device is currently requesting service A value returned during an IACK cycle In VME usually an 8 bit value which is either a status data value or a vector ID value used by the processor to determine the source In VXI a 16 bit value used as a data the lower 8 bits form the VXI logical address of the interrupting device and the upper 8 bits specify the reason for interrupting NI VISA Programmer Reference Manual G 8 ni com T TCP IP thread USB V virtual instrument VISA VISA Instrument Control Resources VISA memory access resources National Instruments Corporation G 9 Glossary Transmission Control Protocol Internet Protocol The de facto standard for transmitting data over networks TCP IP is a multi layered suite of communication protocols used to connect hosts on LANs WANs and the Internet It is very widely supported even by network
148. SB control transfer This is usually the index of the interface or endpoint National Instruments Corporation 5 157 NI VISA Programmer Reference Manual Chapter 5 Operations Name Direction Description wLength IN The wLength parameter of the setup stage of a USB control transfer This value also specifies the size of the data buffer that contains the data to send in the optional data stage of the control transfer buf IN The data buffer that sends the data from the optional data stage of the control transfer This is ignored if wLength is 0 Return Values Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR TMO Timeout expired before operation completed VI ERROR INV SETUP Unable to start write operation because setup is invalid due to attributes being set to an inconsistent state VI ERROR IO An unknown I O error occurred during transfer VI ERROR CONN LOST The I O connection for the given session has been lost VI ERROR INV PARAMETER The value of some parameter which parameter is not known is invalid VI ERROR INV MASK The bmRequestType parameter contains an invalid mask Des
149. STATE VI ATTR ASRL DTR STATE VI ATTR ASRL STATE and VI ATTR ASRL RTS STATE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI_ATTR_ASRL_DATA_BITS Chapter 3 Attributes Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 5108 8 Global Description VI_ATTR_ASRL_DATA_BITS is the number of data bits contained in each frame from 5 to 8 The data bits for each frame are located in the low order bits of every byte stored in memory Related Items Refer to the VI_ATTR_ASRL_BAUD VI_ATTR_ASRL_FLOW_CNTRL VI_ATTR_ASRL_PARITY and VI_ATTR_ASRL_STOP Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation BITS descriptions of this chapter 3 9 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL DCD STATE Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Only VilInt16 VI STATE ASSERTED 1 N A Global VI STATE UNASSERTED 0 VI STATE UNKNOWN 1 Description VI ATTR ASRL DCD STATE shows the current state of the Data Carrier Detect DCD input signal The DCD signal is often used by modems to indicate the det
150. Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description findList IN Describes a find list This parameter must be created by viFindRsrc instrDesc OUT Returns a string identifying the location of a device Strings can then be passed to viOpen to establish a session to the given device Return Values Completion Codes Description VI SUCCESS Resource s found National Instruments Corporation 5 27 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI ERROR INV OBJECT The given object reference is invalid VI ERROR NSUP OPER The given findList does not support this operation VI ERROR RSRC NFOUND There are no more matches Description The viFindNext operation returns the next device found in the list created by viFindRsrc The list is referenced by the handle that was returned by viFindRsrc B Note The size of the instrDesc parameter should be at least 256 bytes Related Items Refer to the virindRsrc description of this chapter Also refer to the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual 5 28 ni com Chapter 5 Operations viFindRsrc Purpose Queries a VISA system to locate the resources associated with a specified interface C
151. Syntax ViStatus viFindRsrc ViSession sesn ViString expr ViPFindList findList ViPUInt32 retcnt ViChar instrDesc Visual Basic Syntax viFindRsrc amp ByVal sesn amp ByVal expr findList amp retcnt amp ByVal instrDesc Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description sesn IN Resource Manager session should always be the session returned from viOpenDefaultRM expr IN This is a regular expression followed by an optional logical expression Refer to the discussion of the Description String in the Description section of this operation findList OUT Returns a handle identifying this search session This handle will be used as an input in viFindNext OUT Number of matches instrDesc OUT Returns a string identifying the location of a device Strings can then be passed to viOpen to establish a session to the given device National Instruments Corporation 5 29 NI VISA Programmer Reference Manual Chapter 5 Operations Return Values Completion Codes Description VI_SUCCESS Resource s found Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_NSUP_OPER The given ses
152. T Chapter 3 Attributes Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write Description Global ViBoolean VI TRUE VI FALSE 1 0 VI TRUE Ifsetto VI FALSE it suspends transmission as if an XOFF character has been received If set to VI TRUE it resumes transmission as if an XON character has been received If XON XOFF flow control software handshaking is not being used it is invalid to set this attribute to VI FALSE Related Items Refertothe VI ATTR ASRL FLOW CNTRL description of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL AVAIL NUM Resource Classes Serial INSTR Attribute Information Description Access Privilege Data Type Range Default Read Only ViUInt32 0 to FFFFFFFFh N A Global VI ATTR ASRL AVAIL NUM shows the number of bytes available in the global receive buffer Related Items Refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 4 ni com VI ATTR ASRL BAUD Chapter 3 Attributes Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViUInt32 0 to FFFFFFFFh 9600 Global Des
153. T Interface type of the given resource string intfNum OUT Board number of the interface of the given resource string Return Values Completion Codes Description VI SUCCESS Resource string is valid National Instruments Corporation 5 95 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI ERROR NSUP OPER The given sesn does not support this operation For VISA this operation is supported only by the Default Resource Manager session VI ERROR INV RSRC NAMI Lj Invalid resource reference specified Parsing error VI ERROR RSRC NFOUND Insufficient location information or resource not present in the system VI ERROR ALLOC Insufficient system resources to parse the string VI ERROR LIBRARY NFOUND A code library required by VISA could not be located or loaded VI ERROR INTF NUM NCONFIG The interface type is valid but the specified interface number is not configured Description This operation parses a resource string to verify its validity It should succeed for all strings returned by viFindRsrc and recognized by This operation is useful if you want to know what interface a given resource descriptor would use without actually opening a session to it The values returned in and intfNum correspond to the attributes
154. TE 3 10 VI ASRL DISCARD NULL 3 11 VI ASRL DSR STATE 3 12 VI ASRL STATE 3 13 VI ASRL END IN 3 14 VI ASRL END OUT 3 15 VI ATTR ASRL FLOW CNTRL 3 16 VI ATTR ASRL PARITY 3 18 VI ATTR ASRL REPLACE _ CHAR 3 19 VI ATTR ASRL RI STATE 3 20 VI ATTR ASRL RTS STATE 3 21 VI ASRL STOP BITS 3 22 VI ATTR ASRL WIRE MODE 3 23 VI ATTR ASRL XOFF CHAR 3 24 VI ATTR ASRL CHAR 3 25 VI CMDR LA 3 27 VI ATTR DEST ACCESS _ PRIV 3 28 VI ATTR DEST BYTE ORDER 3 29 VI ATTR DEST INCREMENT 3 30 VI ATTR ALLOW EN 3 32 VI ATTR FDC CHNL 3 34 ni com VI FDC 3 35 VI ATTR FDC USE PAIR 3 36 VI ATTR FILE APPEND EN 3 37 VI GPIB PRIMARY ADDR 3 43 VI ATTR GPIB READDR EN 3 44 VI GPIB REN STATE 3 46 VI GPIB SECONDARY ADDR 3 47 VI UNADDR EN 3 50 VI ATTR IMMEDIATE SERV 3 51 VI ATTR INTF INST NAME 3 52 VI ATTR INTF NUM 3 53 VI ATTR INTF PARENT NUM 3 54 VI ATTR INTF TYPE 3 55 VI ATTR IO PROT 3 57 VI ATTR MAINFRAME LA 3 59 VI ATTR MANF ID 3 60 VI ATTR MANF NAME 3 61 VI ATTR MEM BASE 3 63 VI ATTR MEM SIZE 3 64 VI ATTR MEM SPACE 3 65 VI ATTR MODEL CODE 3 66 VI ATTR MODEL NAME 3 67 VI ATTR RD BUF OPER MODE 3 82 VI SEND END EN 3 97 VI ATTR SLOT 3 99 VI ATTR SRC ACCESS PRIV 3 100
155. TR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViUInt32 N A N A Local Description This is the current size of the formatted I O output buffer for this session The user can modify this value by calling visetBuf Related Items Refertothe VI ATTR RD BUF SIZE and VI ATTR WR BUF OPER MODE descriptions of this chapter Also refer to the visetBuf description of Chapter 5 Operations National Instruments Corporation 3 145 NI VISA Programmer Reference Manual Events This chapter describes the VISA events The event descriptions are listed in alphabetical order for easy reference Each event description contains a list below the title indicating the supported resource classes such as GPIB Serial etc The event description contains a brief description of the event attributes Chapter 3 Attributes contains more detailed descriptions of the event attributes National Instruments Corporation 4 1 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT ASRL BREAK 3 Note This event is valid only on Windows and platforms on which National Instruments supports its ENET Serial products Resource Classes Serial INSTR Description Notification that a break signal was received Event Attributes Symbolic Name Description VI_ATTR_EV
156. TR RD BUF OPER MODE and VI ATTR WR BUF SIZE descriptions of this chapter Also refer to the viSetBuf description of Chapter 5 Operations National Instruments Corporation 3 83 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR RECV INTR LEVEL Resource Classes VI EVENT VXI VME INTR Attribute Information Description VI_ATTR_RECV_INTR Related Items Refer to the 1 Access Privilege Data Type Range Default Read Only Vilnt16 to 7 N A VI UNKNOWN LEVEL 1 LEVEL is the VXI interrupt level on which the interrupt was received EVENT TYPE and VI ATTR INTR STATUS ID descriptions of this chapter and the vi EVENT VXI VME INTR event description of Chapter 4 Events Also see the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 3 Attributes VI ATTR RECV TRIG ID Resource Classes VI EVENT TRIG Attribute Information Access Privilege Data Type Range Default Read Only Vilnt16 VI TRIG SW 1 N A VI TRIG TTLO 0 to VI TRIG TTL7 7 VI TRIG ECLO 8 to VI TRIG ECL1 9 Description VI ATTR RECV TRIG ID identifies the triggering mechanism on which the specified trigger event was received Related Items Refer to the EVENT TRIG event description of Chapter 4 Events Also refer to the BACKPLANE Resource INSTR Re
157. TTR TCPIP HOSTNAME Chapter 3 Attributes Resource Classes TCPIP INSTR TCPIP SOCKET Attribute Information Access Privilege Data Type Range Default Read Only ViString N A N A Global Description This specifies the host name of the device If no host name is available this attribute returns an empty string Related Items Refer to the INSTR Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 3 107 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR TCPIP KEEPALIVE Resource Classes TCPIP SOCKET Attribute Information Description Access Privilege Data Type Range Default Read Write ViBoolean VI_TRUE 1 VI_FALSE Local VI_FALSE 0 An application can request that a TCP IP provider enable the use of keep alive packets on TCP connections by turning on this attribute If a connection is dropped as a result of keep alive packets the error code VI ERROR CONN LOST is returned Related Items Refertothe vr ATTR TCPIP NODELAY description of this chapter Also refer to the SOCKET Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 108 ni com VI ATTR TCPIP NODELAY Chapter 3 Attributes Resource Classes TCPIP SOCKET Attribute Information Access Privilege Data Type Read Write Range ViBoolean Local
158. TYPE and VI ATTR RI NI VISA Programmer Reference Manual ECV INTR LEVEL descriptions of this ENT VXI VME INTR event description of Chapter 4 Events Also refer to the INSTR Resource description of Appendix B Resources ni com ATTR IO PROT Chapter 3 Resource Classes GPIB INTFC GPIB INSTR GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Attribute Information Attributes Access Privilege Data Type Range Default Read Write ViUInt16 GPIB VI PROT NORMAL Local VI PROT NORMAL 1 VI PROT 5488 3 VI_PROT_NORMAL VI_PROT_NORMAL 1 VI_PROT_FDC 2 GPIB VXI VI PROT NORMAL VI PROT NORMAL 1 Serial TCPIP USB RAW VI PROT NORMAL VI PROT NORMAL 1 VI PROT 4882 STRS 4 USB INSTR PROT NORMAL VI PROT NORMAL 1 VI PROT USBTMC VENDOR 5 Description VI ATTR IO PROT specifies which protocol to use In VXI you can choose normal word serial or fast data channel FDC In GPIB you can choose normal or high speed HS 488 transfers In serial TCPIP or USB RAW you can choose normal transfers or 488 2 defined strings In USB INSTR you can choose normal or vendor specific transfers In previous versions of VISA vr PROT NORMAL was known as NORMAL VI PROT FDC was known as VI FDC VI PROT HS488 was known as VI HS488 and PROT 4882 STRS was known as VI ASRL488 Related Items
159. Textual Languages VPP 4 3 3 VISA Implementation Specification for the G Language VPP 6 Installation and Packaging Specification VPP 7 Soft Front Panel Specification VPP 8 VXI Module Mainframe to Receiver Interconnection VPP 9 Instrument Vendor Abbreviations VXI 11 TCP IP Instrument Protocol VXIbus Consortium NI VISA Programmer Reference Manual Introduction This chapter lists what you need to get started and presents a brief overview of VISA What You Need to Get Started Appropriate hardware support in the form of a National Instruments GPIB GPIB VXI MXI V XI or serial interface board For other hardware interfaces the computer s standard ports should be sufficient for most applications For GPIB applications you need to install NI 488 For VXI applications you need to install NI VXI For other hardware interfaces NI VISA uses the system s standard drivers L NI VISA distribution media Q If you have a GPIB VXI command module from another vendor you need that vendor s GPIB VXI VISA component To download the latest version of the NI VISA distribution media point your Web browser to ni com visa VXI plug amp play Overview The main objective of the VXIplug amp play Systems Alliance is to increase ease of use for end users through open multivendor systems The alliance members share a common vision for multivendor systems architecture encompassing both hardware and software This
160. VELSATTR RSRGCGLASS uis et cere e e reo m tas 3 88 VI ATTR IMPL 220001 3 89 VI ATTR RSRC LOCK STATE joss cots kenne eii 3 90 VI AITR RSRC MANE ID ettet e er 3 9 VI ATTR RSRC MANE NAME ote ei ete ist er ect eais 3 02 National Instruments Corporation NI VISA Programmer Reference Manual Contents VI ATTR RSRC NAME deett 3 93 VI ATIR RSRC SPEC VERSION inndoieeitittecdiseetet estet oett dens 3 06 VI ATTR SEND END EN ete P det He e 3 97 VI ATIR SIGP STATUS ID ione trn PH rn des 3 98 ae ita ene 3 99 SRC 55 3 100 VI 8 ORDER etre 3 101 VLEATTR SRCINCREMEN J 3 102 VLATTR STATUS eiir ieee ith EREA ee testet epe ERE AEREAS 3 103 VL ATTR 55 2 e pg pte 3 104 VIL ATTR TCPIP ADDR entier Senda sis stays a e Xen gen e 3 105 VI ATIR
161. VI FILE APPEND EN is FALSE any existing contents are destroyed otherwise the file contents are preserved The data read is written to the file This operation returns only when the transfer terminates This operation is useful for storing raw data to be processed later Special Values for retCount Parameter Value Action Description VI NULL Do not return the number of bytes transferred Related Items Refer to the viRead and viwriterFromFile descriptions of this chapter and VI ATTR FILE APPEND EN of Chapter 3 Attributes Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 123 NI VISA Programmer Reference Manual Chapter 5 Operations viScanf Purpose Reads converts and formats data using the format specifier Stores the formatted data in the parameters designated by C Syntax ViStatus viScanf ViSession vi ViString readFmt Visual Basic Syntax N A Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session readFmt IN String describing the format for arguments OUT Parameters into which the data is read and the format string is applied Retur
162. VI ATTR SRC BYTE ORDER 3 101 VI ATTR _ INCREMENT 3 102 National Instruments Corporation I 7 Index VI SUPPRESS END EN 3 104 VI TCPIP ADDR 3 105 VI ATTR TCPIP DEVICE NAME 3 106 VI ATTR HOSTNAME 3 107 VI TERMCHAR 3 111 VI TERMCHAR EN 3 112 VI VALUE 3 113 VI ATTR TRIG ID 3 114 VI ATTR USB INTFC NUM 3 121 VI USB MAX INTR SIZE 3 124 VI ATTR USB PROTOCOL 3 127 VI USB SERIAL NUM 3 130 VI ATTR VXI DEV CLASS 3 133 VI VXI LA 3 134 VI ATTR VXI TRIG SUPPORT 3 136 VI WIN ACCESS 3 139 VI ATTR WIN ACCESS _ PRIV 3 140 VI ATTR WIN BASE ADDR 3 141 VI ATTR WIN BYTE ORDER 3 142 VI ATTR WIN SIZE 3 143 VI WR OPER MODE 3 144 basic I O services 2 2 events B 4 VI EVENT ASRL BREAK 4 2 VI EVENT ASRL CHAR 4 3 VI EVENT ASRL CTS 4 4 VI EVENT ASRL DCD 4 5 VI EVENT ASRL DSR 4 6 NI VISA Programmer Reference Manual Index VI EVENT ASRL 4 7 VI EVENT ASRL TERMCHAR 4 8 VI EVENT IO _ COMPLETION 4 15 VI EVENT SERVICE REQ 4 17 VI EVENT TRIG 4 18 VI EVENT VXI SIGP 4 20 VI EVENT VXI VME INTR 4 21 formatted I O services 2 2 memory I O services 2 2 operations B 5 viAssertTrigger 5 4 viBufRead 5 9 viBufWrite 5 12 viClear 5 14 viFlush 5 34 viGpibControIREN 5
163. VI ATTR USB INTFC NUM 3 121 VI ATTR USB INTR IN PIPE 3 122 VI ATTR USB INTR IN STATUS 3 123 VI ATTR USB MAX INTR SIZE 3 124 VI ATTR USB NUM INTFCS 3 125 VI ATTR USB NUM PIPES 3 126 VI ATTR USB PROTOCOL 3 127 VI ATTR USB RECV INTR DATA 3 128 VI ATTR USB RECV INTR SIZE 3 129 NI VISA Programmer Reference Manual 1 16 VI ATTR USB SERIAL NUM 3 130 VI ATTR USB SUBCLASS 3 131 VI ATTR USER DATA 3 132 VI VXI CLASS 3 133 VI ATTR VXI LA 3 134 VI VXI TRIG STATUS 3 135 VI ATTR VXI SUPPORT 3 136 VI ATTR VXI INTR STATUS 3 137 VI VXI SYSFAIL STATE 3 138 VI WIN ACCESS 3 139 VI WIN ACCESS PRIV 3 140 VI WIN BASE ADDR 3 141 VI ATTR WIN BYTE ORDER 3 142 VI ATTR WIN SIZE 3 143 VI ATTR WR OPER 3 144 VI ATTR WR BUF SIZE 3 145 VI EVENT ASRL BREAK 4 2 VI EVENT ASRL CHAR 4 3 VI EVENT ASRL CTS 4 4 VI EVENT ASRL DCD 4 5 VI EVENT ASRL DSR 4 6 VI EVENT ASRL 4 7 VI EVENT ASRL TERMCHAR 4 8 VI EVENT CLEAR 4 9 VI EVENT EXCEPTION 4 10 VI EVENT GPIB CIC 4 12 VI EVENT GPIB LISTEN 4 13 VI EVENT GPIB TALK 4 14 VI EVENT IO COMPLETION 4 15 VI EVENT PXI INTR 4 16 VI EVENT SERVICE 4 17 VI EVENT TRIG 4 18 VI EVENT VXI SIGP 4 20 VI EVENT VXI VME INTR 4 21 VI EVENT VXI VME SYSFAIL 4 22 VI EVENT VXI VME SYSRESET 4 23 viAssertIntrSignal 5 2 viAssertTrigg
164. VISA NI VISA Programmer Reference Manual Wy NATIONAL March 2003 Edition P INSTRUMENTS Part Number 370132C 01 Worldwide Technical Support and Product Information ni com National Instruments Corporate Headquarters 11500 North Mopac Expressway Austin Texas 78759 3504 USA Tel 512 683 0100 Worldwide Offices Australia 1800 300 800 Austria 43 0 662 45 79 90 0 Belgium 32 0 2 757 00 20 Brazil 55 11 3262 3599 Canada Calgary 403 274 9391 Canada Montreal 514 288 5722 Canada Ottawa 613 233 5949 Canada Qu bec 514 694 8521 Canada Toronto 905 785 0085 Canada Vancouver 514 685 7530 China 86 21 6555 7838 Czech Republic 420 2 2423 5774 Denmark 45 45 76 26 00 Finland 385 0 9 725 725 11 France 33 0 1 48 14 24 24 Germany 49 0 89 741 31 30 Greece 30 2 10 42 96 427 India 91 80 51190000 Israel 972 0 3 6393737 Italy 39 02 413091 Japan 81 3 5472 2970 Korea 82 02 3451 3400 Malaysia 603 9131 0918 Mexico 001 800 010 0793 Netherlands 31 0 348 433 466 New Zealand 1800 300 800 Norway 47 0 66 90 76 60 Poland 48 0 22 3390 150 Portugal 351 210 311 210 Russia 7 095 238 7139 Singapore 65 6226 5886 Slovenia 386 3 425 4200 South Africa 27 0 11 805 8197 Spain 34 91 640 0085 Sweden 46 0 8 587 895 00 Switzerland 41 56 200 51 51 Taiwan 886 2 2528 7227 Thailand 662 992 7519 United Kingdom 44 0 1635 523545 For further support information refer to the Technical Support and Professional Services appendix To comment on the docu
165. XI_TRIG_SUPPORT and VI ATTR VXI VME SYSFAIL STAT E descriptions of this chapter Also refer to the BACKPLANE Resource description of Appendix B Resources National Instruments Corporation 3 135 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR VXI TRIG SUPPORT Resource Classes GPIB VXI INSTR GPIB VXI BACKPLANE VXI INSTR VXI BACKPLANE Attribute Information Description Access Privilege Data Type Range Default Read Only ViUInt32 N A N A Global This attribute shows which VXI trigger lines this implementation supports This is a bit vector with bits 0 9 corresponding to TRIG TTLO0 through VI TRIG Related Items ECL1 Refer to the BACKPLANE Resource and INSTR Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 136 ni com Chapter 3 Attributes VI ATTR VXI VME INTR STATUS Resource Classes GPIB VXI BACKPLANE VXI BACKPLANE Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 N A N A Global Description This attribute shows the current state of the VXI VME interrupt lines This is a bit vector with bits 0 6 corresponding to interrupt lines 1 7 Related Items Refer to the VI ATTR VXI TRIG STATUS and VI ATTR VXI VME SYSFAIL STATE descriptions of this chapter Also refer to the BACKPLANE Resource description of Appendix B Resources
166. _CONFIG_NLOADED The specified configuration either does not exist or could not be loaded using VISA specified defaults Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given sesn does not support this operation This operation is supported only by a Resource Manager session VI ERROR INV NAME Invalid resource reference specified Parsing error VI ERROR INV ACC MODE Invalid access mode VI ERROR RSRC NFOUND Insufficient location information or resource not present in the system VI ERROR ALLOC Insufficient system resources to open a session VI ERROR RSRC BUSY The resource is valid but VISA cannot currently access it VI ERROR RSRC LOCKED Specified type of lock cannot be obtained because the resource is already locked with a lock type incompatible with the lock requested VI ERROR TMO session to the resource could not be obtained within the specified openTimeout period VI ERROR LIBRARY NFOUND A code library required by VISA could not be located or loaded VI ERROR INTF NUM NCONFIG The interface type is valid but the specified interface number is not configured National Instruments Corporation 5 85 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI ERROR MACHINE NAVAIL The remote machine does not exist or is not accepting any connections If the NI VISA server is installed and running on
167. _NSUP_OPER BFFF0067h The given session or object reference does not support this operation VI ERROR INTR PENDING BFFFO0068h An interrupt is still pending from a previous call VI ERROR ASRL PARITY BFFF006Ah A parity error occurred during transfer VI ERROR ASRL FRAMING BFFF006Bh A framing error occurred during transfer VI ERROR ASRL OVERRUN BFFF006Ch An overrun error occurred during transfer A character was not read from the hardware before the next character arrived VI ERROR TRIG NMAPPED BFFFOO6Eh The path from trigSrc to trigDest is not currently mapped VI ERROR NSUP ALIGN OFFSET BFFF0070h The specified offset is not properly aligned for the access width of the operation VI ERROR USER BUF BFFF0071h A specified user buffer is not valid or cannot be accessed for the required size VI ERROR RSRC BUSY BFFF0072h The resource is valid but VISA cannot currently access it VI ERROR NSUP WIDTH BFFF0076h Specified width is not supported by this hardware VI ERROR INV PARAMETER BFFF0078h The value of some parameter which parameter is not known is invalid VI_ERROR_INV_PROT BFFF0079h The protocol specified is invalid VI ERROR SIZE BFFF007Bh Invalid size of window specified VI ERROR WINDOW MAPPED BFFFO0080h The specified session currently contains a mapped window NI VISA Programmer Reference Manual A 6 ni com Table 2 Error Codes Continued Appendix A Status Codes
168. ad Write operation because of I O error NI VISA Programmer Reference Manual 5 112 ni com Chapter 5 Operations Error Codes Description VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR TMO Timeout occurred before Read Write operation completed VI ERROR INV FMT A format specifier in the writeFmt or readFmt string is invalid VI ERROR NSUP FMT The format specifier is not supported for current argument type VI ERROR ALLOC The system could not allocate a formatted I O buffer because of insufficient resources Description This operation provides a mechanism of Send then receive typical to a command sequence from a commander device In this manner the response generated from the command can be read immediately This operation is a combination of the viPrintf and viScanf operations The first n arguments corresponding to the first format string are formatted by using the writeFmt string then sent to the device The write buffer is flushed immediately after the write portion of the operation completes After these actions the response data is read from the device into the remaining parameters starting from parameter n 1 using the readFmt string 3 Note Because the prototype for this function cannot provide complete type checking remember that all output parameters mu
169. al 3 128 ni com VI ATTR USB RECV INTR SIZE Chapter 3 Attributes Resource Classes VI EVENT USB INTR Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 N A N A Description VI_ATTR_USB_RECV_INTR_SIZE contains the number of bytes of USB interrupt data that is stored Related Items Refer to the VI_ATTR_USB_RI EVENT_USB_INTR description of Chapter 4 Events VI National Instruments Corporation 3 129 ECV INTR DATA description of this chapter and the NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR USB SERIAL NUM Resource Classes USB INSTR USB RAW Attribute Information Description Access Privilege Data Type Range Default Read Only ViString N A N A Global VI ATTR USB SERIAL NUM specifies the USB serial number of this device Related Items Refer to the INSTR Resource and RAW Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 130 ni com Chapter 3 Attributes VI ATTR USB SUBCLASS Resource Classes USB RAW Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 0 to FFh N A Global Description VI ATTR USB SUBCLASS specifies the USB subclass used by the given session Related Items Refer to the RAW Resource description of Appendix B Resources National I
170. amp ByVal openTimeout amp vi amp Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description sesn IN Resource Manager session should always be a session returned from viOpenDefaultRM rsrcName IN Unique symbolic name of a resource Refer to the Description section for more information accessMode IN Specifies the mode by which the resource is to be accessed Refer to the Description section for valid values If the parameter value is VI NULL the session uses VISA supplied default values openTimeout IN Specifies the maximum time period in milliseconds that this operation waits before returning an error This does not set the I O timeout to do that you must call viSetAttribute with the attribute VI ATTR TMO VALUE vi OUT Unique logical identifier reference to a session NI VISA Programmer Reference Manual 5 84 ni com Chapter 5 Operations Return Values Completion Codes Description VI_SUCCESS Session opened successfully VI_SUCCESS_DEV_NPRESENT Session opened successfully but the device at the specified address is not responding VI_WARN
171. and RAW Most VISA applications and instrument drivers use only the INSTR Resource A VISA Instrument Control INSTR Resource lets a controller interact with the device associated with the given resource This resource type grants the controller the following services to perform message based and or register based I O depending on the type of device and the interface to which the device is connected Basic I O services include the ability to send and receive blocks of data to and from the device The meaning of the data is device dependent and could be a message command or other binary encoded data For devices compliant with IEEE 488 the basic I O services also include triggering both software and hardware servicing requests reading status bytes and clearing the device NI VISA Programmer Reference Manual 2 2 ni com Chapter 2 Overview of the VISA API Formatted I O services provide both formatted and buffered I O capabilities for data transfers to and from devices The formatting capabilities include those specified by ANSI C with extensions for common protocols used by instrumentation systems Buffering improves system performance by making it possible to not only transfer large blocks of data but also send several commands at one time Memory I O or Register I O services allow register level access to devices connected to interfaces that support direct memory access such as the VXIbus or VMEbus Both high level and low leve
172. and formatted I O viScanf Related Items Refer to the VI ATTR Tl ERMCHAR description of this chapter Also refer to the INSTR Resource INTFC Resource SOCKET Resource and SERVANT Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 112 ni com VI ATTR TMO VALUE Chapter 3 Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViUInt32 VI TMO IMMEDIATE 0 2000 Local 1 to FFFFFFFEh INFINITE FFFFFFFFh Description VI_ATTR_TMO VAL UE specifies the minimum timeout value to use in milliseconds when accessing the device associated with the given session A timeout value of VI DIAT A timeout value of VI_TMO_INFINIT Notice that the actual timeout value used by the driver may be higher than the requested one The actual timeout value is returned when this attribute is retrieved via viGetAttribute Related Items means that operations should never wait for the device to respond E disables the timeout mechanism Refer to the INSTR Resource MEMACC Resource INTFC Resource BACKPLANE Resource SERVANT Resource
173. and from arbitrary addresses When using a MEMACC Resource all address parameters are absolute within the given address space knowing a device s base address is both required by and relevant to the user National Instruments Corporation 2 3 NI VISA Programmer Reference Manual Chapter 2 Overview of the VISA API INTFC BACKPLANE SERVANT A VISA GPIB Bus Interface INTFC Resource lets a controller interact with any devices connected to the board associated with the given resource Advanced GPIB users who need to control multiple devices simultaneously or need to have multiple controllers in a single system typically use the INTFC Resource This resource type provides basic and formatted I O services In addition the controller can directly query and manipulate specific lines on the bus and also pass control to other devices with controller capability Basic I O services include the ability to send and receive blocks of data onto and from the bus The meaning of the data is device dependent and could be a message command or other binary encoded data The basic I O services also include triggering devices on the bus and sending miscellaneous commands to any or all devices Formatted I O services provide both formatted and buffered I O capabilities for data transfers to and from devices The formatting capabilities include those specified by ANSI C with extensions for common protocols used by instrumentation systems Buffering im
174. and viWaitOnEvent descriptions of this chapter Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 21 NI VISA Programmer Reference Manual Chapter 5 Operations viEnableEvent Purpose Enables notification of a specified event C Syntax ViStatus viEnableEvent ViSession vi ViEventType eventType ViUInt16 mechanism ViEventFilter context Visual Basic Syntax viEnableEvent amp ByVal vi amp ByVal eventType amp ByVal mechanism ByVal context Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session eventType IN Logical event identifier mechanism IN Specifies event handling mechanisms to be enabled The queuing mechanism is enabled by specifying VI QUEUE 1 and the callback mechanism is enabled by specifying HNDLR 2 or SUSPEND HNDLR 4 context IN VI NULL 0 Return Values Completion Codes Description VI SUCCESS Event enabled successfully VI SUCCESS E ENT EN Specified event is already enabled for at least one of the specified mechanisms
175. anual 1 14 support technical C 1 supported platforms 1 2 NI VISA support table 1 2 system integration services C 1 T technical support C 1 telephone technical support C 1 termination VI ASRL END IN 3 14 VI ATTR ASRL END OUT 3 15 VI ATTR TERMCHAR 3 111 VI ATTR TERMCHAR EN 3 112 viTerminate 5 144 timeout value VI ATTR VALUE 3 113 training customer C 1 triggering VI ATTR RECV TRIG ID 3 85 VI ATTR TRIG ID 3 114 VI EVENT TRIG 4 18 viAssertTrigger 5 4 troubleshooting resources C 1 U user data See VI ATTR USER DATA V VI ATTR 4882 COMPLIANT 3 2 VI ATTR ASRL ALLOW TRANSMIT 3 3 VI ASRL AVAIL NUM 3 4 VI ASRL BAUD 3 5 VI ATTR ASRL BREAK LEN 3 6 VI ATTR ASRL BREAK STATE 3 7 VI ASRL CTS STATE 3 8 ni com VI_LATTR_ASRL_DATA BITS 3 9 VI ATTR ASRL DCD STATE 3 10 VI ASRL DISCARD NULL 3 11 VI ASRL DSR STATE 3 12 VI ATTR ASRL DTR STATE 3 13 VI ASRL END IN 3 14 VI ASRL END OUT 3 15 VI ASRL FLOW CNTRL 3 16 VI ATTR ASRL PARITY 3 18 VI ASRL REPLACE CHAR 3 19 VI ATTR ASRL RI STATE 3 20 VI ASRL RTS STATE 3 21 VI ASRL STOP BITS 3 22 VI ASRL WIRE MODE 3 23 VI ATTR ASRL XOFF CHAR 3 24 VI ASRL XON CHAR 3 25 VI BUFFER 3 26 VI CMDR LA 3 27 VI ATTR DEST ACCESS PRIV 3 28 VI ATTR DEST BYTE ORDER 3 29
176. apped and padded into standard IEEE 488 2 format if native computer representation is different Length modifier 1 arg points to an array of unsigned long integers The count specifies the number of longwords 32 bits Each longword data is swapped and padded into standard IEEE 488 2 format if native computer representation is different Length modifier z arg points to an array of floats The count specifies the number of floating point numbers 32 bits The numbers are represented in IEEE 754 format if native computer representation is different Length modifier z arg points to an array of doubles The count specifies the number of double floats 64 bits The numbers will be represented in IEEE 754 format if native computer representation is different B Argument type A location of a block of data The functionality is similar to b except the data block is sent as an IEEE 488 2 lt INDEFINITE LENGTH ARBITRARY BLOCK RESPONSE DATA This format involves sending an ASCII LF character with the END indicator set after the last byte of the block The END indicator is not appended when LF n is part of a binary data block as with Sb Or SB National Instruments Corporation 5 109 NI VISA Programmer Reference Manual Chapter 5 Operations y Argument type A location of a block of binary data Modifier Interpretation Default functionality The data block is sent as raw binary data A count
177. as sles ta 5 20 viEnable Event a 5 22 vaEyentHandlet 3 eu 5 25 5 27 Wn Watt Rem 5 29 VIEIUSDz v eve to 5 34 viGstAttribute a ai deae e 5 37 vi GpibCommand ned n ete re i o e rep S 5 39 viGpibControlATN 3 2 cus ned iie vs ad d e P a e eed eee eei e na 5 41 viGpibControIREN edet 5 44 viGpibPassControl 2 2 tte eter e I ee DR e e ee wecuteys 5 46 vibGpibSendIEG n iate ee dec t E ENT TOO OE E tet 5 48 amne vilnt6 y1n32 5 e En REA eed dendi aeu mice Sv ike 5 50 viInstallHandler 5 2 eed eint 5 53 Milbdc EP 5 55 vwaMapAddress 2 ec een e tree re eo D HO ORE 5 58 VIMapT rigger Re ai do ate te e eei rd 5 61 vIMeTmAITOGa t es ae ea 5 64 viMembtree ttum dutem e tuta ttem e 5 66 VIMOVE sis iota ese voe s edm cc 5 68 VIMOVEASYNC ose E M 5 72 8 16 1132 5 76 viMoveOut8 viMoveOut16 viMoveOut32 5 80 VOEN 5 84 ViOpenDefaultRM
178. ata from a user specified buffer using the format specifier Stores the formatted data in the parameters designated by params C Syntax ViStatus viVSScanf ViSession vi ViBuf buf ViString readFmt ViVAList params Visual Basic Syntax viVSScanf amp ByVal vi amp ByVal buf ByVal readFmt params as Any Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session buf IN Buffer from which data is read and formatted readFmt IN String describing the format to apply to params params OUT A list with the variable number of parameters into which the data is read and the format string is applied Return Values Completion Codes Description VI_SUCCESS Data was successfully read and formatted into params parameter s NI VISA Programmer Reference Manual 5 168 ni com Chapter 5 Operations Error Codes Description VI ERROR_INV_OBJECT The given session reference is invalid VI ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI _ERROR_INV_FMT A format specifier in the readF mt string is invalid VI ERROR_NSUP_FMT A format specifier
179. ate of an attribute C Syntax ViStatus viSetAttribute ViObject vi ViAttr attribute ViAttrState attrState Visual Basic Syntax viSetAttribute amp ByVal vi amp ByVal attribute amp ByVal attrState amp Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session attribute IN Attribute for which the state is to be modified attrState IN The state of the attribute to be set for the specified object The interpretation of the individual attribute value is defined by the object Return Values Completion Codes Description VI SUCCESS Attribute value set successfully VI WARN NSUP ATTR STATE Although the specified attribute state is valid it is not supported by this implementation NI VISA Programmer Reference Manual 5 134 ni com Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given object reference is invalid VI ERROR NSUP ATTR The specified attribute is not defined by the referenced object VI ERROR NSUP ATTR STATE The specified state of the attribute is not valid or is not supported as d
180. ations B 1 viClose 5 16 viDisableEvent 5 18 viDiscardEvents 5 20 viEnableEvent 5 22 viGetAttribute 5 37 viQueryf 5 112 viRead 5 114 viReadAsync 5 117 viReadSTB 5 119 National Instruments Corporation 17 NI VISA Programmer Reference Manual Index vilnstallHandler 5 53 viLock 5 55 viSetAttribute 5 134 viStatusDesc 5 142 viTerminate 5 144 viUninstallHandler 5 146 viUnlock 5 148 viWaitOnEvent 5 173 VISA Resource types descriptions BACKPLANE 2 4 INSTR 2 2 INTFC 2 4 MEMACC 2 3 RAW 2 5 SERVANT 2 4 SOCKET 2 5 viScanf 5 124 viSetAttribute 5 134 viSetBuf 5 136 viSPrintf 5 138 viSScanf 5 140 viStatusDesc 5 142 viTerminate 5 144 viUninstallHandler 5 146 viUnlock 5 148 viUnmapAddress 5 150 viUnmapTrigger 5 151 viVPrintf 5 160 viVQueryf 5 162 viVScanf 5 164 NI VISA Programmer Reference Manual 1 18 viVSPrintf 5 166 viVSScanf 5 168 viVxiCommandQuery 5 170 viWaitOnEvent 5 173 viWrite 5 176 viWriteAsync 5 178 viWriteFromFile 5 180 VXIplug amp play overview 1 1 W Web professional services C 1 technical support C 1 window attributes VI_ATTR_WIN_ACCESS 3 139 VI_ATTR_WIN_ACCESS_PRIV 3 140 VI_ATTR_WIN_BASE_ADDR 3 141 VI_ATTR_WIN_BYTE_ORDER 3 142 VI_ATTR_WIN_SIZE 3 143 worldwide technical support C 1 write operations viWrite 5 176 viWriteAsync 5 178 X XOFF character 3 24 XON character 3 25 ni com
181. atusDesc 5 142 viTerminate 5 144 viUninstallHandler 5 146 viUnlock 5 148 viUnmapAddress 5 150 viUnmapTrigger 5 151 viVPrintf 5 160 viVQueryf 5 162 viVScanf 5 164 viVSPrintf 5 166 viVSScanf 5 168 viVxiCommandQuery 5 170 viWaitOnEvent 5 173 NI VISA Programmer Reference Manual Index viWrite 5 176 VI ATTR USB SERIAL viWriteAsync 5 178 NUM 3 130 viWriteFromFile 5 180 VI ATTR USB SUBCLASS 3 131 events B 13 P operations B 14 parity 3 18 purpose and use 2 5 phone technical support C 1 RAW Resource type professional services C 1 description 2 5 programming examples C 1 read operations programming language support for NI VISA viBufRead 5 9 table 1 2 viRead 5 114 viReadAsync 5 117 viReadS TB 5 119 R related documentation xiv RAW Resource Resource Manager See VISA Resource attributes B 12 Manager VI USB ALT SETTING 3 115 VI ATTR USB BULK IN S PIPE 3 116 SERVANT Resource VI ATTR USB BULK IN attributes B 10 STATUS 3 117 VI CMDR LA 3 27 VI ATTR USB BULK OUT VI STATUS PIPE 3 118 BYTE 3 31 _ VI ATTR USB BULK OUT VI ATTR ALLOW STATUS 3 119 EN 3 32 VI_ATTR_USB_CLASS 3 120 VI ATTR FILE APPEND VI USB EN 3 37 NUM 3 121 VI ATTR GPIB PRIMARY _ VI ATTR USB INTR IN ADDR 3 43 PIPE 3 122 VI GPIB REN VI USB INTR STATE 3 46 STATUS 3 123 VI
182. borted VI ERROR RAW WR PROT VIOL BFFF0034h Violation of raw write protocol occurred during transfer VI ERROR RAW RD PROT VIOL BFFFO0035h Violation of raw read protocol occurred during transfer VI ERROR OUTP PROT VIOL BFFF0036h Device reported an output protocol error during transfer VI ERROR INP PROT VIOL BFFF0037h Device reported an input protocol error during transfer VI ERROR BERR BFFF0038h Bus error occurred during transfer VI ERROR IN PROGRESS BFFF0039h Unable to queue the asynchronous operation because there is already an operation in progress VI ERROR INV SETUP BFFF003Ah Unable to start operation because setup is invalid due to attributes being set to an inconsistent state VI ERROR QUEUE ERROR BFFF003Bh Unable to queue asynchronous operation VI ERROR ALLOC BFFF003Ch Insufficient system resources to perform necessary memory allocation NI VISA Programmer Reference Manual A 4 ni com Appendix A Status Codes Table A 2 Error Codes Continued Error Codes Values Meaning VI_ERROR_INV_MASK BFFF003Dh Invalid buffer mask specified VI ERROR IO Could not perform operation because of I O error VI ERROR INV FMT BFFF003Fh A format specifier in the format string is invalid VI ERROR NSUP FMT BFFF0041h A format specifier in the format string is not supported VI ERROR LINE IN USE BFFF0042h The specified trigger line is currently in use VI ERROR NSUP MODE B
183. buf IN Buffer containing valid GPIB commands count IN Number of bytes to be written retCount OUT Number of bytes actually transferred Return Values Completion Code Description VI SUCCESS Operation completed successfully Error Codes Description VI ERROR_INV_OBJECT The given session reference is invalid VI ERROR_NSUP_OPER The given vi does not support this operation MEG ERROR LOCKI Ei s Specified operation could not be performed because the resource identified by vi has been locked for this kind of access National Instruments Corporation 5 39 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI ERROR TMO Timeout expired before operation completed VI ERROR INV SETUP Unable to start write operation because setup is invalid due to attributes being set to an inconsistent state VI ERROR NCIC The interface associated with the given vi is not currently the controller in charge VI ERROR NLISTENERS No Listeners condition is detected both NRFD and NDAC are deasserted VI ERROR IO Description An unknown I O error occurred during transfer This operation attempts to write count number of bytes of GPIB commands to the interface bus specified by vi This operation is valid only on GPIB INTFC interface sessions Thi
184. bute expression you can construct flexible and powerful expressions with the use of logical ANDs amp amp ORs and NOTS 1 You can use equal and unequal comparators to compare attributes of any type and other inequality comparators gt gt lt to compare attributes of numeric type Use only global attributes in the attribute expression Local attributes are not allowed in the logical expression part of the expr parameter Expr Parameter Meaning GPIB 0 9 INSTR VI ATTR GPIB SECONDARY ADDR 0 amp amp VI ATTR GPIB SECONDARY ADDR 10 Find all GPIB devices that have secondary addresses from 1 to 9 ASRL INSTR VI ATTR ASRL BAUD 9600 Find all serial ports configured at 9600 baud VXI INSTR VI ATTR MANF ID OxFF6 amp amp VI ATTR VXI LA 0 VI ATTR SLOT 0 Find all VXI instrument resources having manufacturer ID FF6 and which are not logical address 0 slot 0 or external controllers Related Items Refer to the viclose and viFindNext descriptions of this chapter Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 33 NI VISA Programmer Reference Manual Chapter 5 Operations viFlush Purpose Manually flushes the specified buffers associated with formatted I O operations and or serial communication C Syntax ViStatus viFlush ViSe
185. by the locking session before returning an error requestedKey IN This parameter is not used and should be set to VI NULL when lockType is EXCLUSIVE LOCK Refer to the Description section for more details about using VI SHARED LOCK accessKey OUT This parameter should be set to NULL when lockType is VI EXCLUSIVE LOCK When lock Type is VI SHARED LOCRK the resource returns a unique access key for the lock if the operation succeeds This accessKey can then be passed to other sessions to share the lock National Instruments Corporation 5 55 NI VISA Programmer Reference Manual Chapter 5 Operations Return Values Completion Codes Description VI SUCCI 55 Specified access mode was acquired Xj VI SUCCESS NESTED EXCLUSIVI Specified access mode is successfully acquired and this session has nested exclusive locks VI SUCCESS NESTED SHARED Specified access mode is successfully acquired and this session has nested shared locks Error Codes Description VI ERROR OBJECT The given session reference is invalid VI ERROR RSRC LOCKED Specified lockType cannot be obtained because the resource is already locked with a lock type incompatible with the lock requested VI ERROR INV LOCK TYPE Specified lockType is not supported by this resource VI ERROR INV ACCESS KEY The requestedKey value passed in i
186. c 5 29 format operations viPrintf 5 102 viQueryf 5 112 viScanf 5 124 viSPrintf 5 138 viSScanf 5 140 viVPrintf 5 160 viVQueryf 5 162 viVScanf 5 164 viVSPrintf 5 166 viVSScanf 5 168 formatted I O services INTFC Resource 2 4 SERVANT Resource 2 5 SOCKET Resource 2 5 formatted I O services INSTR Resource 2 2 G getting started 1 1 GPIB attributes VI GPIB ADDR STATE 3 38 VI STATE 3 39 VI ATTR GPIB CIC STATE 3 40 NI VISA Programmer Reference Manual Index VI_ATTR_GPIB_HS488_CBL LEN 3 41 VI ATTR GPIB NDAC STATE 3 42 VI ATTR GPIB PRIMARY ADDR 3 43 VI READDR EN 3 44 VI ATTR GPIB RECV CIC STATE 3 45 VI ATTR GPIB REN STATE 3 46 VI ATTR GPIB SECONDARY ADDR 3 47 VI ATTR GPIB SRQ STATE 3 48 VI ATTR GPIB SYS CNTRL STATE 3 49 VI ATTR GPIB UNADDR EN 3 50 VI ATTR INTF PARENT NUM 3 54 H handlers viEventHandler 5 25 vilnstallHandler 5 53 viUninstallHandler 5 146 help professional services C 1 technical support C 1 how to use this manual set xiii INSTR Resource attributes B 2 VI 4882 COMPLIANT 3 2 VI ASRL ALLOW TRANSMIT 3 3 VI ATTR ASRL AVAIL NUM 3 4 VI ATTR ASRL BAUD 3 5 VI ASRL BREAK LEN 3 6 NI VISA Programmer Reference Manual 6 VI ATTR ASRL BREAK _ STATE 3 7 VI ATTR ASRL CTS STATE 3 8 VI ATTR ASRL DATA BITS 3 9 VI ASRL DCD STA
187. ce Manual Chapter 5 Operations viWrite Purpose Writes data to device or interface synchronously C Syntax ViStatus viWrite ViSession vi ViBuf buf ViUInt32 count ViPUInt32 retCount Visual Basic Syntax viWrite amp ByVal vi amp ByVal buf ByVal count amp retCount amp Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR USB INSTR USB RAW TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session buf IN Location of a data block to be sent to a device count IN Number of bytes to be written retCount OUT Number of bytes actually transferred Return Values Completion Codes Description VI SUCCESS Transfer completed NI VISA Programmer Reference Manual 5 176 ni com Chapter 5 Operations Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR TMO Timeout expired before operation completed VI ERROR RAW WR PROT VIOL Violation of raw write protocol occurred during transfer VI E
188. ce that manages the GPIB by sending interface messages to other devices A device that has the ability to control another device This term can also denote the unique device that has sole control over another device as with the VXI Commander Servant hierarchy A communication path between a software element and a resource Every communication channel in VISA is unique Also known as session A set of registers through which the system can identify a module device type model manufacturer address space and memory requirements In order to support automatic system and memory configuration the PXI and VXIbus specifications require that all PXI and VXIbus devices have a set of such registers An entity that can control another device s or is in the process of performing an operation on another device Central processing unit An entity that receives commands from a controller device can be an instrument a computer acting in a non controller role or a peripheral such as a plotter or printer Dynamic Link Library A file containing a collection of functions that can be used by multiple applications This term is usually used for libraries on Windows platforms Also known as shared library or shared object NI VISA Programmer Reference Manual Glossary DMA E embedded controller event external controller FIFO GPIB H handler handshaking Direct memory access High speed data transfer between a boar
189. chanism for VISA API attributes 2 1 events 2 1 operations 2 2 address modifiers VI ATTR DEST ACCESS PRIV 3 28 VI ATTR SRC ACCESS PRIV 3 100 ANSI C format codes viPrintf 5 102 viScanf 5 124 API description of 2 6 asynchronous transfers VI ATTR JOB ID 3 58 VI ATTR COUNT 3 86 VI ATTR STATUS 3 103 VI EVENT IO COMPLETION 4 15 viMoveAsync 5 72 viReadAsync 5 117 viWriteAsync 5 178 attributes access mechanism for VISA 2 1 National Instruments Corporation l 1 BACKPLANE Resource B 9 definition 2 1 INSTR Resource B 2 INTFC Resource B 7 Resource 6 overview 2 1 RAW Resource B 12 SERVANT Resource B 10 SOCKET Resource B 11 VI 4882 COMPLIANT 3 2 VI_LATTR_ASRL_ALLOW_ TRANSMIT 3 3 VI ATTR ASRL AVAIL NUM 3 4 VI ATTR ASRL BAUD 3 5 VI ASRL BREAK LEN 3 6 VI ASRL BREAK STATE 3 7 VI ASRL CTS STATE 3 8 VI ATTR ASRL DATA BITS 3 9 VI ASRL DCD STATE 3 10 VI ASRL DISCARD NULL 3 11 VI ASRL DSR STATE 3 12 VI ASRL STATE 3 13 VI ASRL END IN 3 14 VI ATTR ASRL END OUT 3 15 VI ASRL FLOW CNTRL 3 16 VI ASRL PARITY 3 18 VI ATTR ASRL REPLACE CHAR 3 19 VI ASRL STATE 3 20 VI ASRL RTS STATE 3 21 VI ASRL STOP BITS 3 22 VI ATTR ASRL WIRE MODE 3 23 VI ATTR ASRL XOFF CHAR 3 24 VI ASRL XON CHAR 3 25 VI BUFFER 3 26 VI
190. cifier in the readF mt string is invalid VI ERROR_NSUP_FMT A format specifier in the readF mt string is not supported VI ERROR_ALLOC The system could not allocate a formatted I O buffer because of insufficient resources Description The viSScanf operation is similar to viScanf except that the data is read from a user specified buffer rather than from a device Related Items Refer to the viScanf viSPrintf viVScanf and vivSScanf descriptions of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 141 NI VISA Programmer Reference Manual Chapter 5 Operations viStatusDesc Purpose Returns a user readable description of the status code passed to the operation C Syntax ViStatus viStatusDesc ViObject vi ViStatus status ViChar desc Visual Basic Syntax viStatusDesc amp ByVal vi amp ByVal status amp ByVal desc Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session status IN Status code to interpret desc OUT The user readable string interpretation of the status code passed to the
191. common vision enables the members to work together to define and implement standards for system level issues As a step toward industry wide software compatibility the alliance developed one specification for I O software the Virtual Instrument System Architecture or VISA The VISA specification defines a next generation I O software standard not only for VXI but also for GPIB National Instruments Corporation 1 1 NI VISA Programmer Reference Manual Chapter 1 Introduction Serial and other interfaces With the VISA standard endorsed by more than 35 of the largest instrumentation companies in the industry including Tektronix Hewlett Packard and National Instruments VISA unifies the industry to make software interoperable reusable and able to stand the test of time The alliance also grouped the most popular operating systems application development environments and programming languages into distinct frameworks and defined in depth specifications to guarantee interoperability of components within each framework Supported Platforms This manual and the NI VISA User Manual describe how to use NI VISA the National Instruments implementation of the VISA I O standard in any environment using LabWindows CVI any ANSI C compiler or Microsoft Visual Basic NI VISA currently supports the frameworks and programming languages shown in Table 1 1 For information on programming VISA from LabVIEW refer to the VISA documen
192. cription VI ATTR ASRL BAUDis the baud rate of the interface It is represented as an unsigned 32 bit integer so that any baud rate can be used but it usually requires a commonly used rate such as 300 1200 2400 or 9600 baud Related Items Refer to the ATTR ASRL DATA BITS VI ATTR ASRI ATTR ASRL PARITY VI ATTR ASRL STOP L FLOW CNTRL S descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 5 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL BREAK LEN Resource Classes Serial INSTR Attribute Information Description Access Privilege Data Type Range Default Read Write Vilnt16 1 to 500 250 Local This controls the duration in milliseconds of the break signal asserted when VI ATTR ASRL END OUTissettoVI ASRL END BREAK To manually control the assertion state and length of a break signal use the VI ATTR ASRL Related Items Refer to the VI ATTR ASRL BREAK STAT BRI EAK STATE attribute instead E and Vr ATTR ASRL END OUT descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 6 ni com VI ATTR ASRL BREAK STATE Chapter 3 Attributes Resource Classes Serial INSTR Attribute Information
193. cription The viUsbControlOut operation synchronously performs a USB control pipe transfer to the device The values of the data payload in the setup stage of the control transfer are taken as parameters and include bmRequestType bRequest wValue wIndex and wLength An optional data buffer buf contains the data to send if a data stage is required for this transfer Only one USB control pipe transfer operation can occur at any one time NI VISA Programmer Reference Manual 5 158 ni com Chapter 5 Operations Related Items Refer to the viUsbControlrn description of this chapter and the INSTR Resource and RAW Resource descriptions of Appendix B Resources National Instruments Corporation 5 159 NI VISA Programmer Reference Manual Chapter 5 Operations viVPrintf Purpose Converts formats and sends the parameters designated by params to the device or interface as specified by the format string C Syntax ViStatus viVPrintf ViSession vi ViString writeFmt ViVAList params Visual Basic Syntax viVPrintf amp ByVal vi amp ByVal writeFmt params as Any Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session writeFmt IN String describing the format to apply to params params IN A list containing the variable number of paramet
194. cription VI ATTR PXI SLOTPATH specifies the slot path of this device The purpose of a PXI slot path is to describe the PCI bus hierarchy in a manner independent of the PCI bus number PXI slot paths are a sequence of values representing the PCI device number and function number of a PCI module and each parent PCI bridge that routes the module to the host PCI bridge bus 0 Each value is represented as func where the function number is listed only if it is non zero When a PXI slot path includes multiple values the values are comma separated The string format of the attribute value looks like this devicel function1 device2 function2 An example string is 5 1 12 8 In this case there is a PCI to PCI bridge on device 8 on the root bus On its secondary bus there is another PCI to PCI bridge on device 12 On its secondary bus there is an instrument on device 5 function 1 The example string value describes this instrument s slot path Related Items Refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 78 ni com VI ATTR PXI STAR TRIG BUS Chapter 3 Attributes Resource Classes PXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 N A N A Global Description VI ATTR PXI STAR TRIG BUS specifies the star trigger bus number of this device Related Items Refertothe VI ATTR
195. cription of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL RI STATE Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Only VilInt16 VI STATE ASSERTED 1 N A Global VI STATE UNASSERTED 0 VI STATE UNKNOWN 1 Description VI ATTR ASRL RI STATI E shows the current state of the Ring Indicator RI input signal The RI signal is often used by modems to indicate that the telephone line is ringing Related Items Refer to the v1 ATTR ASRL CTS STATE VI ATTR ASRL DCD STATE VI ATTR ASRI L DSR STATE VI ATTR ASRL DTR STATE and VI ATTR ASRI i L RTS STATE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 20 ni com VI ATTR ASRL RTS STATE Chapter 3 Attributes Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViInt16 VI STATE ASSERTED 1 N A Global VI STATE UNASSERTED 0 VI STATE UNKNOWN 1 Description VI ATTR ASRL RTS STATI Send RTS output signal E is used to manually assert or unassert the Request To When the VI ATTR ASRL FLOW CNTRL attribute is set to
196. ction Description vi IN Unique logical identifier to a session buf IN Location of a block of data count IN Number of bytes to be written retCount OUT Number of bytes actually transferred Return Values Completion Codes Description VI SUCCESS Operation completed successfully NI VISA Programmer Reference Manual 5 12 ni com Chapter 5 Operations Error Codes Description VI ERROR_INV_OBJECT The given session reference is invalid VI ERROR_NSUP_OPER The given vi does not support this operation VI ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access WIE ERROR_TMO Timeout expired before operation completed VI ERROR_INV_SETUP Unable to start write operation because setup is invalid due to attributes being set to an inconsistent state ERROR IO An unknown I O error occurred during transfer Description The viBufWrite operation is similar to viwrite and does not perform any kind of data formatting It differs from viwrite in that the data is written to the formatted I O write buffer the same buffer used by viPrintf and related operations rather than directly to the device You can intermix this operation with viPrintf but you should not mix it with viwrite If this opera
197. currently CIC Controller In Charge Related Items Refer to the ATTR the Resource description of Appendix Resources NI VISA Programmer Reference Manual B_SYS_CNTRL_STATE description of this chapter Also refer to ni com VI_ATTR_GPIB_HS488 LEN Chapter 3 Attributes Resource Classes GPIB INTFC Attribute Information Access Privilege Data Type Range Default Read Write VilInt16 VI_GPIB_HS488_NIMPL 1 N A Global 5488 DISABLED 0 1 15 Description This attribute specifies the total number of meters of GPIB cable used in the specified GPIB interface Related Items Refer to the VI_ATTR_IO_PROT description of this chapter Also refer to the Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR GPIB NDAC STATE Resource Classes GPIB INTFC Attribute Information Access Privilege Data Type Range Default Read Only VilInt16 VI STATE ASSERTED 1 N A Global VI STATE UNASSERTED 0 VI STATE UNKNOWN 1 Description This attribute shows the current state of the GPIB NDAC Not Data Accepted interface line Related Items Refer to the VI ATTR GPIB REN STATE VI ATTR GPIB STAT E and VI ATTR GPIB SRO STATE descriptions of this chapter
198. d and memory that is not handled directly by the CPU Not available on some systems See also programmed I O A computer plugged directly into the VXI backplane An example is the National Instruments V XIpc 870 An asynchronous occurrence that is independent of the normal sequential execution of the process running in a system A desktop computer or workstation connected to the VXI system via an MXI interface board An example is a standard personal computer with a PCI MXI installed First In First Out A method of data storage in which the first element stored is the first one retrieved 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 1992 A software routine that is invoked when an asynchronous event occurs In VISA callbacks can be installed on any session that processes events See also callback A type of protocol that makes it possible for two devices to synchronize operations NI VISA Programmer Reference Manual G 4 ni com TEEE instrument instrument driver interface interrupt lock logical address mapping National Instruments Corporation G 5 Glossary Input output Institute of Electrical and Electronics Engineers A device that accepts some form of stimulus to perform a designated task test or measurement function Two common forms of stimuli are message passing and registe
199. d list VI_ERROR_NSUP_ATTR_STATE 001 The specified state of the attribute is not valid or is not supported as defined by the session event or find list VI ERROR ATTR READONLY BFFFO0O1Fh The specified attribute is Read Only VI ERROR INV LOCK TYPE BFFF0020h The specified type of lock is not supported by this resource VI ERROR INV ACCESS KEY BFFF0021h The access key to the resource associated with this session is invalid VI ERROR INV EVENT BFFF0026h Specified event type is not supported by the resource National Instruments Corporation A 3 NI VISA Programmer Reference Manual Appendix A Status Codes Table A 2 Error Codes Continued Error Codes Values Meaning VI_ERROR_INV_MECH BFFF0027h Invalid mechanism specified VI ERROR HNDLR NINSTALLED BFFF0028h A handler is not currently installed for the specified event VI ERROR INV HNDLR REF BFFF0029h The given handler reference is invalid VI ERROR INV CONTEXT BFFF002Ah Specified event context is invalid VI ERROR QUEUE OVERFLOW BFFF002Dh The event queue for the specified type has overflowed usually due to previous events not having been closed VI ERROR NENABLED BFFF002Fh session must be enabled for events of the specified type in order to receive them VI ERROR ABORT BFFF0030h The operation was a
200. d with the given INSTR resource Similarly if destspace is neither LOCAL SPACE nor VI OPAQUE SPACE destOffset is a relative address of the device associated with the given INSTR resource NI VISA Programmer Reference Manual 5 70 ni com Chapter 5 Operations The primary intended use of this operation with an INSTR session is to asynchronously move data to or from the device Therefore either the srcSpace or destSpace parameter will usually be VI LOCAL SPACE MEMACC Specific The destOffset and srcOffset parameters specify absolute addresses Notice also that the length specified in the viMove operation is the number of elements of the size corresponding to the sreWidth parameter to transfer beginning at the specified offsets Therefore srcOffset length src Width cannot exceed the total amount of memory exported by the given srcSpace Similarly destOffset length src Width cannot exceed the total amount of memory exported by the given destSpace Related Items Refer to the viMoveAsync description of this chapter and the VI ATTR DEST INCREM ENT and VI ATTR SRC INCR ENT descriptions of Chapter 3 Attributes Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources National Instruments Corporation 5 71 NI VISA Programmer Reference Manual Chapter 5 Operations viMoveAsync Purpose Moves a block
201. data is written to the specified buf Return Values Completion Codes Description VI_SUCCESS Parameters were successfully formatted NI VISA Programmer Reference Manual 5 138 ni com Chapter 5 Operations Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR INV FMT A format specifier in the writeFmt string is invalid VI ERROR NSUP FMT A format specifier in the writeFmt string is not supported VI ERROR ALLOC The system could not allocate a formatted buffer because of insufficient resources Description The visPrintf operation is similar to vi Printf except that the output is not written to the device it is written to the user specified buffer This output buffer will be NULL terminated If this operation outputs an END indicator before all the arguments are satisfied then the rest of the writeFmt string is ignored and the buffer string is still terminated by a NULL 5 Note size of the buf parameter should be large enough to hold the formatted I O contents plus the NULL termination character Related Items Refer to the viPrintf viSScanf viVPrintf and vivSPrintf descriptions of this chapter Also refer to the INSTR R
202. does not have a secondary address this parameter should contain the value VI NO SEC ADDR Return Values Completion Code Description SUCCESS Operation completed successfully NI VISA Programmer Reference Manual 5 46 ni com Chapter 5 Operations Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR TMO Timeout expired before operation completed VI ERROR NCIC The interface associated with the given vi is not currently the controller in charge VI ERROR NLISTENERS No Listeners condition is detected both NRFD and NDAC are deasserted VI ERROR IO An unknown I O error occurred during transfer Description This operation passes controller in charge status to the device indicated by primAddr and secAddr and then deasserts the ATN line This operation assumes that the targeted device has controller capability This operation is valid only on GPIB INTFC interface sessions Related Items Refer to the INTFC Resource description of Appendix B Resources National Instruments Corporation 5 47 NI VISA Programmer Reference Manual Chapter 5 Operations viGpibSendlFC
203. during transfer VI ERROR OUTP PROT VIOL Device reported an output protocol error during transfer VI ERROR BERR Bus error occurred during transfer VI ERROR INV SETUP Unable to start read operation because setup is invalid due to attributes being set to an inconsistent state VI ERROR NCIC The interface associated with the given vi is not currently the controller in charge VI ERROR NLISTENERS No Listeners condition is detected both NRFD and NDAC are deasserted VI ERROR ASRL PARITY A parity error occurred during transfer VI ERROR ASRL FRAMING A framing error occurred during transfer VI ERROR ASRL OVERRUN An overrun error occurred during transfer A character was not read from the hardware before the next character arrived VI ERROR IO An unknown I O error occurred during transfer VI ERROR FILE ACCI IET SS An error occurred while trying to open the specified file Possible reasons include an invalid path or lack of access rights 5 122 ni com Chapter 5 Operations Error Codes Description VI_ERROR_FILE_IO An error occurred while accessing the specified file VI ERROR CONN LOST The I O connection for the given session has been lost Description This read operation synchronously transfers data The file specified in fileName is opened in binary write only mode If the value of
204. e GV HE Ee ees 3 4 VEATIR ASRLCZBAUD eee nete eerte io 3 5 VICATTR ASRI BREAK LEEN oeste tee ERE CAUTE 3 6 VI ASRL BREAK STATE A E 3 7 VI ATTR ASRI CTIS STATE S 3 8 VI ASRL DATA 8 2 4222120 001 3 9 National Instruments Corporation V NI VISA Programmer Reference Manual Contents ASRLE DCD STATE ettet eet e de Reit et 3 10 VI ATIR ASRL DISCARD NULL tette ceterae tide 3 11 VI DSR STATE tetti RE reete dtd 3 12 VI ATIR ASRL DTR STATE et ert ci eren 3 13 END TIN iet rettet reel eee eee epe Ere tad 3 14 VI ATIR ASRL END OUT aiedeiece on ettet ere 3 15 VI ATIR ASRL FLOW i CNT RE a ios it ettet rte repre xt t e 3 16 VE ATIR ASRLE PARITY ete etre te dean 3 18 VI ASRL REPLACE 3 19 VI ATIR ASRL RISTATE 5 enne ROO Rete 3 20 VI ASRL RTS STATE nnt ettet eerte eel tert deed 3 21 VILATIR ASR STOP BITS eaten tede ett ia 3 22 VI ASRL WIRE 3 23 VI ATIR ASRLE 22540 3 24 VI ATIR XON CHAR iin
205. e Manual Chapter 5 Operations viMemAlloc Purpose Allocates memory from a device s memory region C Syntax ViStatus viMemAlloc ViSession vi ViBusSize size ViPBusAddress offset Visual Basic Syntax viMemAlloc amp ByVal vi amp ByVal size amp offset amp Resource Classes GPIB VXI INSTR PXI MEMACC VXI INSTR Parameters Name Direction Description vi IN Unique logical identifier to a session size IN Specifies the size of the allocation offset OUT Returns the offset of the allocated device memory Return Values Completion Codes Description SUCCESS Operation completed successfully Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR INV SIZE Invalid size specified NI VISA Programmer Reference Manual 5 64 ni com Chapter 5 Operations Error Codes Description VI ERROR ALLOC Unable to allocate shared memory block of the requested size VI ERROR MEM NSHARI The device does not export any memory Description The viMemAlloc operation returns an offset into a device s memory region that has been allocated for use by this session If the dev
206. e description of Appendix B Resources National Instruments Corporation 5 99 NI VISA Programmer Reference Manual Chapter 5 Operations viPeek8 viPeek16 viPeek32 Purpose Reads an 8 bit 16 bit or 32 bit value from the specified address C Syntax void viPeek8 ViSession vi ViAddr addr ViPUInt8 val8 void viPeek16 ViSession vi ViAddr addr ViPUInt16 116 void viPeek32 ViSession vi ViAddr addr ViPUInt32 132 Visual Basic Syntax viPeek8 ByVal vi amp ByVal addr amp val8 as Byte viPeek16 ByVal vi amp ByVal addr amp 116 viPeek32 ByVal vi amp ByVal addr amp val32 amp Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session addr IN Source address to read the value val8 val16 or OUT Data read from bus 8 bits for viPeek8 16 bits for val32 viPeek16 and 32 bits for viPeek32 Return Values None Description viPeekxx operations read an 8 bit 16 bit or 32 bit value respectively from the address location specified in addr The address must be a valid memory address in the current process mapped by a previous viMapAddress call Related Items Refer to the viMapAddress and viPoke8 16 2 description Also refer to the VI_LATTR_WIN_ACCESS description of Chapter 3 Attributes and the INST
207. e of a resource intfType OUT Interface type of the given resource string intfNum OUT Board number of the interface of the given resource string rsrcClass OUT Specifies the resource class for example INSTR of the given resource string expanded OUT This is the expanded version of the given resource string Unaliased The format should be similar to the VISA defined Name canonical resource name aliasIfExists OUT Specifies the user defined alias for the given resource string National Instruments Corporation 5 97 NI VISA Programmer Reference Manual Chapter 5 Operations Return Values Completion Codes Description VI_SUCC 55 Resource string is valid VI_WARN_EXT_FUNC_NIMPL The operation succeeded but a lower level driver did not implement the extended functionality Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given sesn does not support this operation For VISA this operation is supported only by the Default Resource Manager session VI ERROR INV RSRC NAM EJ Invalid resource reference specified Parsing error VI_ERROR_RSRC_NFOUND Insufficient location information or resource not present in the system VI ERROR ALLOC Insufficient system resources to parse the string VI ERROR LIBRARY NFOUND A code library required by VISA could not be located
208. e performed because the resource identified by vi has been locked for this kind of access VI ERROR BERR Bus error occurred during transfer VI ERROR INV SPACE Invalid address space specified VI ERROR INV OFFSET Invalid offset specified VI ERROR NSUP OFFSET Specified offset is not accessible from this hardware VI ERROR NSUP WIDTH Specified width is not supported by this hardware VI ERROR NSUP ALIGN OFFSET The specified offset is not properly aligned for the access width of the operation VI ERROR INV SETUP Unable to start operation because setup is invalid due to attributes being set to an inconsistent state Description The viinxx operations use the specified address space to read in 8 16 or 32 bits of data respectively from the specified offset These operations do not require viMapAddress to be called prior to their invocation The following table lists the valid entries for specifying address space National Instruments Corporation 5 51 NI VISA Programmer Reference Manual Chapter 5 Operations Value Description VXI VME and VI_A16_SPACE 1 GPIB VXI VI A24 SPACE 2 VI A32 SPACE 3 PXI INSTR VI PXI CFG SPACE 10 VI PXI BARO SPACE 11 toVI PXI BAR5 SPACE 16 PXI MEMACC VI PXI ALLOC SPACE 9 INSTR Specific Notice that offset specified in the viIn8 viIn16 and virn32 operations for
209. eFmt viSScanf vi buf readFmt viVPrintf vi writeFmt params viVQueryf vi writeFmt readFmt params vivScanf vi readFmt params viVSPrintf vi buf writeFmt params vivSScanf vi buf readFmt params viWrite vi buf count retCount viWriteAsync vi buf count jobId viWriteFromFile vi fileName count retCount RAW Resource This section lists the attributes events and operations for the RAW Resource The attributes events and operations in the VISA Resource Template are available to this resource in addition to the attributes and operations listed below Attributes VI_ATTR_FILE_APPEND_EN VI_ATTR_INTF_INST_NAME VI_ATTR_INTF_NUM VI_ATTR_INTF_TYPE VI_ATTR_IO_PROT VI ATTR MANF ID NI VISA Programmer Reference Manual B 12 ni com VI A VI 1 ny ny MAX QUEUE LENGTH VI A VI 1 VI A ny ny ny UR MODEL CODE MODEL NAME RD BUF OPER MODI Lj VI 1 VI 1 VI 1 ny ny ny TR_RD_BUF_SIZE U R RSRC CLASS RSRC IMPL VERSION VI A ny UR RSRC LOCK VI 1 ny VI_AT ny 5 RSRC I RSRC E xj VI 1 VI 1 ny ny RSRC NAME RSRC SPEC VERSION VI 1 VI 1 VI 1 VI 1 VI 1 ny ny ny ny ny R_SUPPRESS_END_EN TERMCHAR
210. ead from the same element essentially treating the source as a FIFO register Related Items Refer to the VI ATTR DEST INCREMENT VI ATTR SRC ACCESS PRIV and ORDER descriptions of this chapter Also refer to the INSTR Resource VI ATTR SRC BYTE and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 102 ni com ATTR STATUS Chapter 3 Attributes Resource Classes VI EVENT EXCEPTION VI EVENT IO COMPLETION VI EVENT USB INTR Attribute Information Access Privilege Data Type Range Default Read Only ViStatus N A N A Description VI ATTR STATUS contains the return code of the operation generating this event Related Items Refer to the VI ATTR BUFFER VI ATTR JOB I D VI ATTR OPER NAME and VI ATTR RET COUNT descriptions of this chapter and the EVENT EXCEPTION VI EVENT IO COMPLETION and VI Events Also see Appendix B Resources National Instruments Corporation 3 103 EVENT USI B INTR event descriptions of Chapter 4 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR SUPPRESS END EN Resource Classes Serial INSTR USB RAW VXI INSTR Attribute Information Description Access Privilege Data Type Range Default Read Write ViBoolean VI_TRUE 1 VI_FALSE Local VI_FALSE 0 VI ATTR SUPPRESS END EN specifies whether t
211. ecify a byte location in a given space In PXI systems the address space corresponds to 1 of 6 possible BAR locations BARO through BARS In VME VXI and PXI a given device may have addresses in one or more address spaces A string or other language construct that uniquely locates and identifies a resource VISA defines an ASCII based grammar that associates strings with particular physical devices and VISA resources National Instruments Corporation G 1 NI VISA Programmer Reference Manual Glossary alias ANSI API ASCII asynchronous attribute b B backplane Base Address Register bus error NI VISA Programmer Reference Manual G 2 User defined name for a VISA resource American National Standards Institute Application Programming Interface The direct interface that an end user sees when creating an application In VISA the API consists of the sum of all of the operations attributes and events of each of the VISA Resource Classes American Standard Code for Information Interchange An action or event that occurs at an unpredictable time with respect to the execution of a program A value within an object or resource that reflects a characteristic of its operational state Bit Byte In VXI VME systems an assembly typically a PCB with 96 pin connectors and signal paths that bus the connector pins A C size VXIbus system will have two sets of bused connectors called the J1 and J2 backplanes
212. ection of a carrier remote modem on the telephone line The DCD signal is also known as Receive Line Signal Detect RLSD Related Items Refertothe VI ATTR ASRL CTS STATE VI ATTR ASRL DSR STATE VI ATTR ASRL DTR STATE VI ATTR ASRL RI STATE and VI ATTR ASRL RTS STATE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 10 ni com If set to VI_TRUI Chapter 3 Attributes VI ATTR ASRL DISCARD NULL Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViBoolean VI_TRUE 1 VI_FALSE Global VI_FALSE 0 Description E NUL characters are discarded Otherwise they are treated as normal data characters For binary transfers you should set this attribute to VI FALSE Related Items Refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL DSR STATE Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Only Vilnt16 VI STATE ASSERTED 1 Global VI_STATE_UNASSERTED 0 VI_STATE_UNKNOWN 1 Description VI_ATTR_ASRL_DSR_STATE shows the current state of the Data Set Ready DSR input signal Related Items
213. efer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 44 ni com VI ATTR GPIB RECV CIC STATE Chapter 3 Attributes Resource Classes VI EVENT GPIB CIC Attribute Information Access Privilege Data Type Range Default Read Only ViBoolean VI TRUE 1 N A VI FALSE 0 Description This attribute specifies whether the local controller has gained or lost CIC status Related Items Refer to the VI ATTR GPIB STATI E description of this chapter Refer to the VI EVENT GPIB CIC description of Chapter 4 Events Also refer to the INTFC Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR GPIB REN STATE Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 VI STATE ASSERTED 1 N A Global VI STATE UNASSERTED 0 VI STATE UNKNOWN 1 Description VI ATTR GPIB REN STATE returns the current state of the GPIB REN Remote ENable interface line Related Items Refer to the ATTR B STATE VI ATTR GPIB STATE VI ATTR GPIB SRO STATE descriptions of this chapter and the viGpibControlREN description of Chapter 5 Operation
214. eference the mapped address as a pointer Related Items Refer to the VI ATTR WIN ACCESS PRIV VI ATTR WIN BASE ADDR VI ATTR WIN BYTE ORDER and VI ATTR WIN SIZE descriptions of this chapter and the viMapAddress viPeek8 viPeek16 viPeek32 and viPoke8 16 32 descriptions of Chapter 5 Operations Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources National Instruments Corporation 3 139 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR WIN ACCESS PRIV Resource Classes GPIB VXI INSTR GPIB VXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI DATA PRIV 0 VI DATA PRIV Local VI DATA NPRIV 1 VI PROG PRIV 2 VI PROG NPRIV 3 VI BLCK PRIV 4 VI BLCK NPRIV 5 Description VI ATTR WIN ACCESS PRIV specifies the address modifier to be used in low level access operations such as viMapAddress and viPokexx when accessing the mapped window This attribute is Read Write when the corresponding session is not mapped that is when VI ATTR WIN ACCESS is Read Only Related Items Refer to the VI ATTR DEST ACC VI ATTR WIN ACCESS VI ATTR WIN BASI ED When the session is mapped this attribute is ESS PRIV VI ATTR SRC ACCESS PRIV E ADDR VI ATTR
215. efined by the object VI ERROR ATTR READONLY The specified attribute is Read Only VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access Description The visetAttribute operation is used to modify the state of an attribute for the specified object Both VI WARN NSUP ATTR STATE and VI ERROR NSUP STATE indicate that the specified attribute state is not supported A resource normally returns the error code VI ERROR NSUP ATTR STATE when it cannot set a specified attribute state The completion code VI WARN NSUP ATTR STATE is intended to alert the application that although the specified optional attribute state is not supported the application should not fail One example is attempting to set an attribute value that would increase performance speeds This is different than attempting to set an attribute value that specifies required but nonexistent hardware such as specifying a VXI ECL trigger line when no hardware support exists or a value that would change assumptions a resource might make about the way data is stored or formatted such as byte order Some attributes documented as generally being Read Write may at times be Read Only This is usually the case when an attribute configures how the VISA driver receives events of a given type and the event type associated with that attribute is currently enabled Under these
216. efore operation completed VI ERROR RAW WR PROT VIOL Violation of raw write protocol occurred during transfer NI VISA Programmer Reference Manual 5 14 ni com Chapter 5 Operations Error Codes Description VI_ERROR_RAW_RD_PROT_VIOL Violation of raw read protocol occurred during transfer VI ERROR BERR Bus error occurred during transfer VI ERROR NCIC The interface associated with the given vi is not currently the controller in charge VI ERROR NLISTENERS No Listeners condition is detected both NRFD and NDAC are unasserted VI ERROR INV SETUP Unable to start operation because setup is invalid due to attributes being set to an inconsistent state VI ERROR CONN LOST The I O connection for the given session has been lost Description The viClear operation performs an IEEE 488 1 style clear of the device For VXI INSTR sessions VISA uses the Word Serial Clear command For GPIB INSTR sessions VISA uses the Selected Device Clear command For Serial INSTR sessions VISA flushes discards the I O buffers and sends a break For TCP IP SOCKET sessions VISA flushes discards the I O buffers For USB INSTR sessions VISA sends the INITIAT F _CLEAR and CHECK CLEAR STATUS commands on the control pipe Invoking viClear INSTR Resource will also discard the read and write buffers used by the formatted I O services for that s
217. el services for interface level accesses to all memory defined in the system NI VISA Programmer Reference Manual Glossary VISA Resource Manager This is the name given to the part of VISA that manages resources This VISA Resource Template visaconf VISAIC VME VXIbus management includes support for finding resources and opening sessions to them This is the name given to the part of VISA that defines the basic constraints and interface definition for the creation and use of a VISA resource All VISA resources must derive their interface from the definition of the VISA Resource Template This includes services for setting and retrieving attributes receiving events locking resources and closing objects VISA configuration utility for Solaris Linux and Mac OS X VISA Interacvtive Control utility Interactively controls VXI VME devices without using a conventional programming language LabVIEW or Measurement Studio Versa Module Eurocard or IEEE 1014 VMEbus Extensions for Instrumentation or IEEE 1155 NI VISA Programmer Reference Manual G 10 ni com Index Numerics 8 bit 16 bit and 32 bit operations viln8 viIn16 viIn32 operations 5 50 viMoveln8 viMoveIn16 viMoveIn32 operations 5 76 viMoveOut8 viMoveOut16 viMoveOut32 operations 5 80 viOut8 viOut16 viOut32 operations 5 92 viPeek8 viPeek16 viPeek32 operations 5 100 viPoke8 viPoke16 viPoke32 operations 5 101 A access me
218. endix B Resources National Instruments Corporation 4 7 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT ASRL TERMCHAR 3 Note This event is valid only on Windows and platforms on which National Instruments supports its ENET Serial products Resource Classes Serial INSTR Description Notification that the termination character has been received The actual termination character is specified by setting VI_ATTR_TERMCHAR prior to enabling this event For this event the setting of VI_ATTR_TERMCHAR_EN is ignored Event Attributes Symbolic Name Description VI_ATTR_EVENT_TYPE Unique logical identifier of the event Related Items Refer to the VI_ATTR_EVENT_TYPE VI_ATTR_ASRL_AVAIL_NUM and VI_ATTR_TERMCHAR descriptions of Chapter 3 Attributes Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 4 8 ni com Chapter 4 Events VI EVENT CLEAR Resource Classes GPIB INTFC GPIB SERVANT VXI SERVANT Description Notification that the local controller has been sent a device clear message Event Attributes Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event Related Items Refertothe ATTR EVENT TYPE description of Chapter 3 Attributes Also refer to the INTFC Resource and SERVANT Resource descriptions of Appendix B Resources
219. ent prevents future events from being raised on the given session When the method returns to the application it is possible that a callback may still be active such as on another thread It is valid for a user to call viDisableEvent from within a callback but this is not recommended Related Items Refer to the viEnableEvent and viUninstallHandler descriptions of this chapter Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 19 NI VISA Programmer Reference Manual Chapter 5 Operations viDiscardEvents Purpose Discards event occurrences for specified event types and mechanisms in a session C Syntax ViStatus viDiscardEvents ViSession vi ViEventType eventType ViUInt16 mechanism Visual Basic Syntax viDiscardEvents amp ByVal vi amp ByVal eventType amp ByVal mechanism Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session eventType IN Logical event identifier mechanism IN Specifies the mechanisms for which the events are to be discarded The vr QUEUE 1 value is specified for the queuing mechanism and the vi SUSPEND HNDLR
220. eous command to send response OUT The response retrieved from the device If the mode specifies to send a command rather than retrieve a response you can use NULL for this parameter Return Values Completion Codes Description VI SUCCESS The operation completed successfully NI VISA Programmer Reference Manual 5 170 ni com Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_NSUP_OPER The given vi does not support this operation VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI_ERROR_TMO Timeout expired before operation completed VI_ERROR_RAW_WR_PROT_VIOL Violation of raw write protocol occurred during transfer VI_ERROR_RAW_RD_PROT_VIOL Violation of raw read protocol occurred during transfer VI_ERROR_OUTP_PROT_VIOL Device reported an output protocol error during transfer VI_ERROR_INP_PROT_VIOL Device reported an input protocol error during transfer VI ERROR BERR Bus error occurred during transfer VI ERROR RESP PENDING previous response is still pending causing a multiple query error VI ERROR INV MODE The value specified by the mode parameter is invalid Description The vivxiCommandQuery operat
221. eously by specifying ALL MECH FFFFh Return Values Completion Codes Description VI SUCCESS Event disabled successfully VI SUCCESS E ENT DIS Specified event is already disabled for at least one of the specified mechanisms NI VISA Programmer Reference Manual 5 18 ni com Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_INV_EVENT Specified eventType is not supported by the resource VI_ERROR_INV_MECH Invalid mechanism specified Description The viDisableEvent operation disables servicing of an event identified by the eventType parameter for the mechanisms specified in the mechanism parameter This operation prevents new event occurrences from being added to the queue s However event occurrences already existing in the queue s are not flushed Use viDiscardEvents if you want to discard events remaining in the queue s Specifying VI ALL ENABLED EVENTS forth receiving all events The session can stop receiving queued events by specifying VI QUEUE Applications can stop receiving callback events by specifying either VI HNDLR or VI SUSPI e eventType parameter allows a session to stop END HNDLR Specifying VI ALL Mi mechanisms JS Calling vipisablei ECH disables both the queuing and callback Ev
222. er 5 4 viAssertUtilSignal 5 7 ni com Index viBufRead 5 9 viReadToFile 5 121 viBufWrite 5 12 VISA Access Mechanisms viClear 5 14 attributes 2 1 viClose 5 16 events 2 1 viDisableEvent 5 18 operations 2 2 viDiscardEvents 5 20 VISA API viEnableEvent 5 22 overview 2 1 viEventHandler 5 25 VISA Resource Manager viFindNext 5 27 attributes B 2 viFindRsrc 5 29 operations B 2 viFlush 5 34 viFindNext 5 27 viGetAttribute 5 37 viFindRsrc 5 29 viGpibCommand 5 39 viOpen 5 84 viGpibControlATN 5 41 viOpenDefaultRM 5 90 viGpibControlREN 5 44 viParseRsrc 5 95 viGpibPassControl 5 46 viParseRsrcEx 5 97 viGpibSendIFC 5 48 VISA Resource Template vilnstallHandler 5 53 attributes B 1 vilnx 5 50 VI_LATTR_MAX_QUEUE_ viLock 5 55 LENGTH 3 62 viMapAddress 5 58 VI ATTR RM SESSION 3 87 viMapTrigger 5 61 VI CLASS 3 88 viMemAlloc 5 64 VI ATTR RSRC IMPL viMemFree 5 66 VERSION 3 89 viMove 5 68 VI RSRC LOCK viMoveAsync 5 72 STATE 3 90 viMovelnx 5 76 VI RSRC ID 3 91 viMoveOutx 5 80 VI RSRC viOpen 5 84 NAME 3 92 viOpenDefaultRM 5 90 VI RSRC NAME 3 93 viOutx 5 92 VI ATTR RSRC SPEC VERSION 3 96 viParseRsrc 5 95 VI USER DATA 3 132 viParseRsrcEx 5 97 viPeekx 5 100 events B 1 viPokex 5 101 VI EVENT EXCEPTION 4 10 viPrintf 5 102 oper
223. er Reference Manual ni com Chapter 4 Events VI EVENT SERVICE REQ Resource Classes GPIB INSTR GPIB INTFC GPIB VXI INSTR TCPIP INSTR USB INSTR VXI INSTR Description This event notifies the application that a service request was received from the device or interface associated with the given session 5 Note When you receive VI_EVENT_SERVICE_REQ on INSTR session you must call viReadSTB to guarantee delivery of future service request events on the given session Event Attributes Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event This attribute always has the value of VI EVENT SERVICE REQ for this event type Related Items Refertothe vr ATTR EVENT TYPE description of Chapter 3 Attributes and the viReadSTB description of Chapter 5 Operations Also refer to the INSTR Resource and INTFC Resource descriptions of Appendix B Resources National Instruments Corporation 4 17 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT TRIG Resource Classes GPIB INTFC GPIB SERVANT VXI INSTR VXI BACKPLANE VXI SERVANT Description This event notifies the application that a trigger interrupt was received from the device This may be either a hardware or software trigger depending on the interface and the current session settings Event Attributes
224. er in charge VI ERROR NLISTENERS No Listeners condition is detected both NRFD and NDAC are unasserted VI ERROR INV SETUP Unable to start operation because setup is invalid due to attributes being set to an inconsistent state VI ERROR CONN LOST The I O connection for the given session has been lost National Instruments Corporation 5 5 NI VISA Programmer Reference Manual Chapter 5 Operations Description The viAssertTrigger operation will source a software or hardware trigger dependent on the interface type For a GPIB device the device is addressed to listen and then the GPIB command is sent For a VXI device if VI_ATTR_TRIG_ID is VI_TRIG_Sw then the device is sent the Word Serial Trigger command for any other values of the attribute a hardware trigger is sent on the line that corresponds to the value of that attribute For a session to a Serial device or Ethernet socket if VI ATTR IO is VI_PROT_4882_STRS the device is sent the string TRG n otherwise this operation is not valid For a session to a USB instrument this function sends the TRIGGER message ID on the Bulk OUT pipe For GPIB serial and VXI software triggers VI_TRIG_PROT_D protocol For VXI hardware triggers VI_TRIG_ VI_TRIG_PROT_SYNC For INSTR resources VI_TRIG_PROT_RES the only valid protocols Related Items Refer to the VI ATTR TRIG Il ERV E and VI_TRIG_PROT_UNRI
225. er to a session buf OUT Location of a buffer to receive data from device count IN Number of bytes to be read retCount OUT Number of bytes actually transferred National Instruments Corporation 5 9 NI VISA Programmer Reference Manual Chapter 5 Operations Return Values Completion Codes Description VI_SUCC Lj SS The operation completed successfully and the END indicator was received for interfaces that have END indicators This completion code is returned regardless of whether the termination character is received or the number of bytes read is equal to count VI SUCCESS TERM CHAR The specified termination character was read but no END indicator was received This completion code is returned regardless of whether the number of bytes read is equal to count VI SUCCESS MAX CNT The number of bytes read is equal to count No END indicator was received and no termination character was read Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR TMO Timeout expired before operation completed VI ERROR IO An unknown I O error occurred during transfer Description The viBufRead
226. erence Manual Chapter 5 Operations viVQueryf Purpose Performs a formatted write and read through a single call to an operation C Syntax ViStatus viVQueryf ViSession vi ViString writeFmt ViString readFmt ViVAList params Visual Basic Syntax viVQueryf amp ByVal vi amp ByVal writeFmt ByVal readFmt params as Any Resource Classes GPIB INSTR GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session writeFmt IN String describing the format of write arguments readFmt IN String describing the format of read arguments params IN OUT A list containing the variable number of write and read parameters The write parameters are formatted and written to the specified device The read parameters store the data read from the device after the format string is applied to the data Return Values Completion Codes Description VI_SUCCESS Successfully completed the query operation NI VISA Programmer Reference Manual 5 162 ni com Chapter 5 Operations Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR
227. ermination character was read but no END indicator was received This completion code is returned regardless of whether the number of bytes read is equal to count VI_SUCCESS_MAX_CNT The number of bytes read is equal to count No END indicator was received and no termination character was read Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation Ei VI_ERROR_RSRC_LOCK Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI_ERROR_TMO Timeout expired before operation completed VI_ERROR_RAW_WR_PROT_VIOL Violation of raw write protocol occurred during transfer VI_ERROR_RAW_RD_PROT_VIOL Violation of raw read protocol occurred during transfer VI_ERROR_OUTP_PROT_VIOL Device reported an output protocol error during transfer VI ERROR BERR Bus error occurred during transfer VI ERROR INV SETUP Unable to start read operation because setup is invalid due to attributes being set to an inconsistent state National Instruments Corporation 5 115 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI_ERROR_NCIC The interface associated with the given vi is not currently the controller in charge VI ERR
228. ers on which the format string is applied The formatted data is written to the specified device Return Values Completion Codes Description VI SUCCESS Parameters were successfully formatted NI VISA Programmer Reference Manual 5 160 ni com Chapter 5 Operations Error Codes Description VI ERROR_INV_OBJECT The given session reference is invalid VI ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI_ERROR_IO Could not perform write operation because of I O error VI_ERROR_TMO Timeout expired before write operation completed VI_ERROR_INV_FMT A format specifier in the writeFmt string is invalid VI_ERROR_NSUP_FMT A format specifier in the writeFmt string is not supported VI_ERROR_ALLOC The system could not allocate a formatted I O buffer because of insufficient resources Description This operation is similar to viPrintf except that the params parameters list provides the parameters rather than separate arg parameters Related Items Refer to the viPrintf viSPrintf viVSPrintf and vivSScanf descriptions of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 161 NI VISA Programmer Ref
229. esent read from the device until encountering an END indicator which causes the loss of data This action resynchronizes the next viScanf call to read a lt TERMINATED RESPONSE MESSAGE Refer to the IEEE 488 2 standard VI READ BUF DISCARD 4 Discard the read buffer contents does not perform any I O to the device VI WRITE BUF 2 Flush the write buffer by writing all buffered data to the device VI WRITE BUF DISCARD 8 Discard the write buffer contents does not perform any I O to the device VI IO IN BUF 16 Discard the receive buffer contents same as IO IN BUF DISCARD VI IO IN BUF DISCARD 64 Discard the receive buffer contents does not perform any I O to the device VI IO OUT BUF 32 Flush the transmit buffer by writing all buffered data to the device d VI IO OUT BUF DISCARD 128 Discard the transmit buffer contents does not perform any I O to the device Itis possible to combine any of these read flags and write flags for different buffers by ORing the flags However combining two flags for the same buffer in the same call to viFlush is illegal National Instruments Corporation 5 35 NI VISA Programmer Reference Manual Chapter 5 Operations Notice that when using formatted I O operations with a session to a Serial device or Ethernet socket a flush of the formatted I O buffers also causes the corresponding
230. esource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 139 NI VISA Programmer Reference Manual Chapter 5 Operations viSScanf Purpose Reads converts and formats data from a user specified buffer using the format specifier Stores the formatted data in the parameters designated by C Syntax ViStatus viSScanf ViSession vi ViBuf buf ViString readFmt Visual Basic Syntax N A Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session buf IN Buffer from which data is read and formatted readFmt IN String describing the format for arguments OUT Parameters into which the data is read and the format string is applied Return Values Completion Codes Description VI_SUCCESS Data was successfully read and formatted into parameter s NI VISA Programmer Reference Manual 5 140 ni com Chapter 5 Operations Error Codes Description VI ERROR_INV_OBJECT The given session reference is invalid VI ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI _ERROR_INV_FMT A format spe
231. ession Related Items Refer to the INSTR Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 15 NI VISA Programmer Reference Manual Chapter 5 Operations viClose Purpose Closes the specified session event or find list C Syntax ViStatus viClose ViObject vi Visual Basic Syntax viClose amp ByVal vi amp Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session event or find list Return Values Completion Codes Description VI SUCCESS Session closed successfully VI WARN NULL OBJECT The specified object reference is uninitialized Error Codes Description VI ERROR INV OBJECT The given object reference is invalid VI ERROR CLOSING FAILED Unable to deallocate the previously allocated data structures corresponding to this session or object reference NI VISA Programmer Reference Manual 5 16 ni com Chapter 5 Operations Description The viClose operation closes a session event or a find list In this process all the data structures that had been allocated for t
232. evision The format of the value has the upper 12 bits as the major number of the version the next lower 12 bits as the minor number of the version and the lowest 8 bits as the sub minor number of the version Related Items Refer to the VI RSRC SPI EC VERSION description of this chapter Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR RSRC LOCK STATE Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViAccessMode VI_NO_LOCK 0 VI_NO_LOCK Global VI_EXCLUSIVE_LOCK 1 VI_SHARED_LOCK 2 Description VI ATTR RSRC LOCK STATI E indicates the current locking state of the resource The resource can be unlocked locked with an exclusive lock or locked with a shared lock Related Items Refer to the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR RSRC MANF ID Chapter 3 Attributes Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLAN
233. ext viScanf operation When viScanf times out the next call to viScanf will read from an empty buffer and force a read from the device Notice that when an END indicator is received not all arguments in the format string may be consumed However the operation still returns a successful completion code The following two tables describe optional modifiers that can be used in a format specifier sequence ANSI C Standard Modifiers Supported with Modifier Format Code Description An integer Ss c It specifies the maximum field width that the representing format codes argument will take A may also appear instead the field width of the integer field width in which case the next arg is a reference to the field width This arg is a reference to an integer for c and s The field width is not allowed for d or f A length The argument length modifiers specify one of the modifier h following h d b format a The h modifier promotes the argument to be or Z z and codes reference to a short integer or unsigned short Z are no integer depending on the format code ANSI C standard 1 b format b The 1 modifier promotes the argument to point modifiers codes to a long integer or unsigned long integer L format code z b format code Z b format code c The modifier promotes the argument to point to a long double floats parameter d The z
234. f destSpace is any value other than LOCAL SPACE including VI OPAQUE SPAC E viMove honors VI ATTR DEST INCREMENT While VI OPAQUE SPACE uses a process local virtual address it is not necessarily pointing to system memory so it may be a FIFO Therefore VI ATTR SRC DEST INCREMENT do indeed apply INSTR Specific If srcSpace is neither VI LOCAL SPACE nor VI OPAQUE SPACE srcOffset is a relative address of the device associated with the given INSTR resource Similarly if destspace is neither LOCAL SPACE nor VI OPAQUE SPACE destOffset is a relative address of the device associated with the given INSTR resource NI VISA Programmer Reference Manual 5 74 ni com Chapter 5 Operations The primary intended use of this operation with an INSTR session is to asynchronously move data to or from the device Therefore either the srcSpace or destSpace parameter will usually be VI LOCAL SPACE MEMACC Specific The destOffset and srcOffset parameters specify absolute addresses Notice also that the length specified in the viMoveAsync operation is the number of elements of the size corresponding to the sreWidth parameter to transfer beginning at the specified offsets Therefore srcOffset length src Width cannot exceed the total amount of memory exported by the given srcSpace Similarly destOffset length src Width cannot exceed the total amount of memory
235. f multiple handlers were installed on the exception event the handlers that were not invoked prior to the current handler will not be invoked for the current exception e The exception context will not be deleted by the VISA system when a C exception is used In this case the application should delete the exception context as soon as the application has no more use for the context before terminating the session An application should use the viclose operation to delete the exception context One situation in which an exception event will not be generated is in the case of asynchronous operations If the error is detected after the operation is posted once the asynchronous portion has begun the status is returned normally via the I O completion event However if an error occurs before the asynchronous portion begins the error is returned from the asynchronous operation itself then the exception event will still be raised This deviation is due to the fact that asynchronous operations already raise an event when they complete and this I O completion event may occur in the context of a separate thread previously unknown to the application In summary a single application event handler can easily handle error conditions arising from both exception events and failed asynchronous operations NI VISA Programmer Reference Manual 4 10 ni com Chapter 4 Events Event Attributes Symbolic Name Description VI_ATTR_EVENT_TYPE Un
236. ffer buf receives data if a data stage is required for this transfer Only one USB control pipe transfer operation can occur at any one time National Instruments Corporation 5 155 NI VISA Programmer Reference Manual Chapter 5 Operations Related Items Refer to the viUsbControl0ut descriptions of this chapter and the INSTR Resource and RAW Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 156 ni com Chapter 5 Operations viUsbControlOut Purpose Performs a USB control pipe transfer to the device Note This operation is intended only for users familiar with the USB protocol C Syntax ViStatus viUsbControlOut ViSession vi Vilnt16 bmRequestType Vilnt16 bRequest ViUInt16 wValue ViUInt16 wIndex ViUInt16 wLength ViPBuf buf Visual Basic Syntax viUsbControlOut amp ByVal vi amp ByVal bmRequestType ByVal bRequest ByVal wValue ByVal wIndex ByVal wLength buf As Byte Resource Classes USB INSTR USB RAW Parameters Name Direction Description vi IN Unique logical identifier to a session bmRequest IN The bmRequestType parameter of the setup stage of a Type USB control transfer Refer to the USB specification for further details bRequest IN The bRequest parameter of the setup stage of a USB control transfer wValue IN The wValue parameter of the setup stage of a USB control transfer windex IN The wIndex parameter of the setup stage of a U
237. fiers Interpretation Default functionality Characters are read from the device until the first linefeed character n is received The linefeed character is included in the buffer field width This flag gives the maximum string size If a linefeed character is not received before field width number of characters additional characters are read and discarded until a linefeed character arrives field width has the same meaning as in s National Instruments Corporation 5 131 NI VISA Programmer Reference Manual Chapter 5 Operations y Argument type A location of a block of binary data Modifier Interpretation Default functionality The data block is read as raw binary data The format specifier sequence should have a flag describing the array size which will give a maximum count of the number of bytes or words or longwords depending on length modifiers to be read from the device If the array size contains a sign two arguments are used The first argument read is a pointer to a long integer that specifies the maximum number of elements that the array can hold The second argument should be a reference to an array Also the actual number of elements read is stored back in the first argument In absence of length modifiers the data is assumed to be byte size elements In some cases data might be read until an END indicator is read Length modifier h The data block is assumed to be a reference to an
238. finition register based as are devices for some other interfaces The definition for how to create a particular resource In general this is synonymous with the connotation of the word class in object oriented architectures For VISA Instrument Control resource classes this refers to the definition for how to create a resource which controls a particular capability or set of capabilities of a device In general this term is synonymous with the connotation of the word object in object oriented architectures For VISA resource more specifically refers to a particular implementation or instance in object oriented terms of a Resource Class National Instruments Corporation G 7 NI VISA Programmer Reference Manual Glossary servant session shared library or shared object shared memory socket SRQ status byte status ID Second A device controlled by a Commander A communication path between a software element and a resource Every communication channel in VISA is unique See also communication channel A file containing a collection of functions that can be used by multiple applications This term is usually used for libraries on UNIX platforms See also DLL A block of memory that is accessible to both a client and a server The memory block operates as a buffer for communication This is unique to register based interfaces such as VXI A bi directional communication endpoint An object through which a VI
239. hapter Also refer to the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 3 Attributes VI ATTR RSRC NAME Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViRsrc N A N A Global Description VI ATTR RSRC NAME is the unique identifier for a resource compliant with the address structure shown in the following table Optional string segments are shown in square brackets Interface Syntax GPIB INSTR GPIB board l primary address secondary address INSTR GPIB INTFC GPIB board INTFC GPIB SERVANT GPIB board SERVANT GPIB VXI INSTR GPIB VXI board VXI logical address INSTR GPIB VXI GPIB VXI board mainframe logical address BACKPLANE BACKPLANE GPIB VXI MEMACC GPIB VXI board MEMACC PXI INSTR PXI bus device function INSTR PXI INSTR PXI interface bus device function INSTR PXI MEMACC PXI interface MEMACC Serial INSTR ASRL board INSTR TCPIP INSTR TCPIP board host address LAN device name INSTR National Instruments Corporation 3 93 NI VISA Program
240. hapter 3 Attributes Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources National Instruments Corporation 5 101 NI VISA Programmer Reference Manual Chapter 5 Operations viPrintf Purpose Converts formats and sends the parameters designated by to the device as specified by the format string C Syntax ViStatus viPrintf ViSession vi ViString writeFmt Visual Basic Syntax N A Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session writeFmt IN String describing the format for arguments IN Parameters to which the format string is applied Return Values Completion Codes Description VI SUCCESS Parameters were successfully formatted Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access NI VISA Programmer Reference Manual 5 102 ni com Chapter 5 Operations Error Codes Description VI ERROR IO Could not perform write operation because of I O error VI ERROR TMO Timeout expired before write operation completed V
241. hapter 5 Operations viMapAddress Purpose Maps the specified memory space into the process s address space C Syntax ViStatus viMapAddress ViSession vi ViUInt16 mapSpace ViBusAddress mapBase ViBusSize mapSize ViBoolean access ViAddr suggested ViPAddr address Visual Basic Syntax viMapAddress amp ByVal vi amp ByVal mapSpace ByVal mapBase amp ByVal mapSize amp ByVal ByVal suggested amp address amp Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session mapSpace IN Specifies the address space to map Refer to the Description section for more information mapBase IN Offset in bytes of the memory to be mapped Refer to the Description section for more information mapSize IN Amount of memory to map in bytes access IN VI_FALSE 0 suggested IN If suggested parameter is not VI_NULL 0 the operating system attempts to map the memory to the address specified in suggested There is no guarantee however that the memory will be mapped to that address This operation may map the memory into an address region different from suggested address OUT Address in your process space where the memory was mapped NI VISA Programmer Reference Manual 5 58 ni com Return Values Chapter 5 Operations
242. he vilInstallHandler operation where each invocation adds to the previous list of handlers If more than one handler is installed for an eventType each of the handlers is invoked on every occurrence of the specified event s VISA specifies that the handlers are invoked in Last In First Out LIFO order Related Items Refer to the viEventHandler viEnableEvent and viUninstallHandler descriptions of this chapter Also refer to the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual 5 54 ni com Chapter 5 Operations viLock Purpose Establishes an access mode to the specified resource C Syntax ViStatus viLock ViSession vi ViAccessMode lockType ViUInt32 timeout ViKeyId requestedKey ViChar accesskey l Visual Basic Syntax viLock amp ByVal vi amp ByVal lockType amp ByVal timeout ByVal requestedKey ByVal accesskey Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session lockType IN Specifies the type of lock requested either VI EXCLUSIVE LOCK l or VI SHARED LOCK 2 timeout IN Absolute time period in milliseconds that a resource waits to get unlocked
243. he ASCII percent 76 character c Argument type A character to be sent Argument type An integer National Instruments Corporation 5 107 NI VISA Programmer Reference Manual Chapter 5 Operations Modifier Interpretation Default functionality Print an integer in NR1 format an integer without a decimal point 2 or 3 The integer is converted into a floating point number and output in the correct format field width Minimum field width of the output number Any of the six IEEE 488 2 modifiers can also be specified with field width Length modifier 1 arg is a long integer Length modifier h arg is a short integer array size arg points to an array of integers or long or short integers depending on the length modifier of size array size The elements of this array are separated by array size 1 commas and output in the specified format Argument type A floating point number Modifier Interpretation Default functionality Print a floating point number in NR2 format a number with at least one digit after the decimal point 81 Print an integer in format The number is truncated Print a floating point number NR3 format scientific notation Precision can also be specified field width Minimum field width of the output number Any of the six IEEE 488 2 modifiers can also be specified with field width Length modifier
244. he given object These attributes are accessed through the following operations viGetAttribute viSetAttribute An event is an asynchronous occurrence that is independent of the normal sequential execution of the process running in a system Depending on how you want to handle event occurrences you can use the vi EnableEvent operation with either the vimnstallHandler operation or the viWaitOnEvent operation Events respond to attributes in the same manner that resources do Once your application is done using a particular event received via viWaitOnEvent it should call viclose to destroy that event National Instruments Corporation 2 1 NI VISA Programmer Reference Manual Chapter 2 Overview of the VISA API Operations An operation is an action defined by a resource that can be performed on the given resource Each resource has the ability to define a series of operations In addition to those defined by each resource you can use the following template operations in any resource e viClose viGetAttribute viSetAttribute e viStatusDesc e viTerminate e viLock viUnlock viEnableEvent viDisableEvent viDiscardEvents viWaitOnEvent vilnstallHandler viUninstallHandler VISA Resource Types INSTR Currently there are several VISA resource types INSTR MEMACC INTFC BACKPLANE SERVANT SOCKET
245. he specified vi are freed Calling viclose ona VISA Resource Manager session will also close all I O sessions associated with that resource manager session Related Items Refer to the viOpen viOpenDefaultRM viFindRsrc and viWaitOnEvent descriptions of this chapter Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 17 NI VISA Programmer Reference Manual Chapter 5 Operations viDisableEvent Purpose Disables notification of the specified event type s via the specified mechanism s C Syntax ViStatus viDisablel ViUInt16 mechanism Visual Basic Syntax Event ViSession vi ViEventType eventType viDisableEvent amp ByVal vi amp ByVal eventType amp ByVal mechanism Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session eventType IN Logical event identifier mechanism IN Specifies event handling mechanisms to be disabled The queuing mechanism is disabled by specifying VI QUEUE 1 and the callback mechanism is disabled by specifying VI HNDLR 2 or VI SUSPEND HNDLR 4 It is possible to disable both mechanisms simultan
246. he vr ATTR PXI FUNC NUM description of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR PXI FUNC NUM Resource Classes PXI INSTR Attribute Information Description Access Privilege Data Type Range Default Read Only ViUInt16 0 to 7 0 Global This is the PXI function number devices have a function 0 Multifunction devices will also support other function numbers Related Items Refer to the vr ATTR PXI NUM description of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 3 Attributes VI ATTR PXI MEM BASE BARO VI ATTR PXI MEM BASE BAR1 VI PXI MEM BASE BAR2NI PXI MEM BASE BAR3 VI ATTR PXI MEM BASE BARANI ATTR PXI MEM BASE BARS Resource Classes PXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViUInt32 0 to FFFFFFFFh N A Global Description PXI memory base address assigned to the specified BAR If the value of the corresponding VI ATTR PXI M EM TYPE BARxis VI PXI ADDR NONI meaningless for the given PXI device Related Items Refer to the vr ATTR PXI MEM TYPE BARO VI ATTR PX I MEM TYPE E the value of this attrib
247. i eventType handler userHandle viLock vi lockType timeout requestedKey accessKey viSetAttribute vi attribute attrState viStatusDesc vi status desc National Instruments Corporation B 1 NI VISA Programmer Reference Manual Appendix Resources viTerminate vi degree jobId viUninstallHandler vi eventType handler userHandle viUnlock vi viWaitOnEvent vi inEventType timeout outEventType outContext VISA Resource Manager INSTR Resource This section lists the attributes events and operations for the VISA Resource Manager The attributes events and operations in the VISA Resource Template are available to this resource in addition to the operations listed below Attributes The attributes for the VISA Resource Template are available to this resource This resource has no defined attributes of its own Events None Operations viFindNext findList instrDesc viFindRsrc sesn expr findList retcnt instrDesc viOpen sesn rsrcName accessMode timeout vi viOpenDefaultRM sesn viParseRsrc sesn rsrcName intfType intfNum viParseRsrcEx sesn rsrcName intfType IntfNum rsrcClass unaliasedExpandedRsrcName aliasIfExists This section lists the attributes events and operations for the INSTR Resource The attributes events and operations in the VISA Resource Template are available to this resource in addition to the attributes and operations listed below Att
248. ice to which the given vi refers is located on the local interface card the memory can be allocated either on the device itself or on the computer s system memory The memory region referenced by the offset that is returned from this operation can be accessed with the high level operations viMoveInxx and viMoveOutXX or it can be mapped using viMapAddress Related Items Refer to the viMapAddress viMemFree viMoveIn8 viMoveIn16 viMoveIn32 and viMoveOut8 viMoveOut16 viMoveOut32 descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 5 65 NI VISA Programmer Reference Manual Chapter 5 Operations viMemFree Purpose Frees memory previously allocated using the viMemAlloc operation C Syntax ViStatus viMemFree ViSession vi ViBusAddress offset Visual Basic Syntax viMemFree amp ByVal vi amp ByVal offset amp Resource Classes GPIB VXI INSTR PXI MEMACC VXI INSTR Parameters Name Direction Description vi IN Unique logical identifier to a session offset IN Specifies the memory previously allocated with viMemAlloc Return Values Completion Codes Description VI_SUCCESS Operation completed successfully Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support
249. implementation specific configuration file is corrupt or does not exist VI ERROR LIBRARY NFOUND A code library required by VISA could not be located or loaded Description The viOpenDefaultRM function must be called before any VISA operations be invoked The first call to this function initializes the VISA system including the Default Resource Manager resource and also returns a session to that resource Subsequent calls to this function return unique sessions to the same Default Resource Manager resource When a Resource Manager session is passed to 1 not only is that session closed but also all find lists and device sessions which that Resource Manager session was used to create are closed Related Items Refer to viopen viClose and viFindRsrc descriptions of this chapter Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 91 NI VISA Programmer Reference Manual Chapter 5 Operations viOut8 viOutt6 viOut32 Purpose Writes C Syntax ViSta ViUIn ViSta ViUIn ViSta ViUIn an 8 bit 16 bit or 32 bit value to the specified memory space and offset tus viOut8 ViSession vi ViUInt16 space ViBusAddress offset t8 val8 tus viOuti16 ViSession vi ViUInt16 space ViBusAddress offset t16 vali16 tus viOut32 ViSession vi ViUInt16 space ViBusAddress offset t32 val32 Visual Basic Syntax viOut8 amp
250. ing address or register from which to read srcWidth IN Specifies the data width of the source destSpace IN Specifies the address space of the destination destOffset IN Offset of the starting address or register to which to write destWidth IN Specifies the data width of the destination length IN Number of elements to transfer where the data width of the elements to transfer is identical to the source data width NI VISA Programmer Reference Manual 5 68 ni com Return Values Chapter 5 Operations Completion Codes Description VI_SUCCESS Operation completed successfully Error Codes Description VI ERROR_INV_OBJECT The given session reference is invalid VI ERROR_NSUP_OPER The given vi does not support this operation VI ERROR LOCKI E s Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR BERR Bus error occurred during transfer VI ERROR INV SPACE Invalid source or destination space specified VI ERROR INV OFFSET Invalid source or destination offset specified VI ERROR INV WIDTH Invalid source or destination width specified VI ERROR NSUP OFFSET Specified source or destination offset is not accessible from this hardware VI ERROR NSUP VAR WIDTH Cannot support source and desti
251. integration services C 1 technical support C 1 worldwide offices C 1 NI VISA support table 1 2 ni com 0 online technical support 1 open operations viOpen 5 84 viOpenDefaultRM 5 90 operations access mechanism for VISA 2 2 BACKPLANE Resource B 9 definition 2 2 INSTR Resource B 5 INTFC Resource B 8 MEMACC Resource B 7 overview 2 2 RAW Resource B 14 SERVANT Resource B 10 SOCKET Resource B 12 viAssertIntrSignal 5 2 viAssertTrigger 5 4 viAssertUtilSignal 5 7 viBufRead 5 9 viBufWrite 5 12 viClear 5 14 viClose 5 16 viDisableEvent 5 18 viDiscardEvents 5 20 viEnableEvent 5 22 viEventHandler 5 25 viFindNext 5 27 viFindRsrc 5 29 viFlush 5 34 viGetAttribute 5 37 viGpibCommand 5 39 viGpibControlATN 5 41 viGpibControlREN 5 44 viGpibPassControl 5 46 viGpibSendIFC 5 48 vilnstallHandler 5 53 vilnx 5 50 viLock 5 55 viMapAddress 5 58 National Instruments Corporation 1 11 viMapTrigger 5 61 viMemAlloc 5 64 viMemFree 5 66 viMove 5 68 viMoveAsync 5 72 viMovelInx 5 76 viMoveOutx 5 80 viOpen 5 84 viOpenDefaultRM 5 90 viOutx 5 92 viParseRsrc 5 95 viParseRsrcEx 5 97 viPeekx 5 100 viPokex 5 101 viPrintf 5 102 viQueryf 5 112 viRead 5 114 viReadAsync 5 117 viReadSTB 5 119 viReadToFile 5 121 VISA Resource Manager B 2 VISA Resource Template 1 viScanf 5 124 viSetAttribute 5 134 viSetBuf 5 136 viSPrintf 5 138 viSScanf 5 140 viSt
252. ion can send a command or query or receive a response to a query previously sent to the device The mode parameter specifies whether to issue a command and or retrieve a response and indicates the type or size of command and or response to use The following table defines the values for the mode parameter Mode Action Description VI VXI CMD16 Send 16 bit Word Serial command VI VXI CMD16 RESP16 Send 16 bit Word Serial query get 16 bit response VI VXI Lj SP16 Get 16 bit response from previous query VI VXI CMD32 Send 32 bit Word Serial command VI VXI CMD32 RESP16 Send 32 bit Word Serial query get 16 bit response National Instruments Corporation 5 171 NI VISA Programmer Reference Manual Chapter 5 Operations Mode Action Description VI_VXI_CMD32_RESP32 Send 32 bit Word Serial query get 32 bit response VI_VXI_RESP32 Get 32 bit response from previous query Notice that the mode you specify can cause all or part of the cmd or response parameters to be ignored f mode specifies sending a 16 bit command the upper half of cmd is ignored f mode specifies retrieving a response only is ignored e f mode specifies sending a command only response is ignored You can use VI NULL for the value of response f mode specifies to retrieve a 16 bit value the upper half of response is set to 0 Related Items Refer t
253. ional Instruments Corporation 3 17 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR ASRL PARITY Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI_ASRL_PAR_NONE 0 VI_ASRL_PAR_NONE Global VI_ASRL_PAR_ODD 1 VI_ASRL_PAR_EVEN 2 VI ASRL PAR MARK 3 VI ASRL PAR SPACE 4 Description VI ATTR ASRL PARITY is the parity used with every frame transmitted and received VI ASRL PAR MARK means that the parity bit exists and is always 1 VI ASRL PAR SPACI Related Items Refer to the ASRI VI ATTR ASRL FLOW L BAUD VI ATTR ASRL DATA E means that the parity bit exists and is always 0 BITS URL and ATTR ASRL STOP BITS descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 18 ni com VI ATTR ASRL REPLACE CHAR Chapter 3 Attributes Resource Classes Serial INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViUInt8 0 to FFh 0 Local Description VI ATTR ASRL REPLACE CHAR specifies the character to be used to replace incoming characters that arrive with errors such as parity error Related Items Refer to the ATTR ASRL PARITY description of this chapter Refer to the INSTR Resource des
254. ique logical identifier of the event This attribute always has the value of VI_EVENT_EXCEPTION for this event type VI_ATTR_STATUS Contains the status code returned by the operation generating the error VI_ATTR_OPER_NAME Contains the name of the operation generating the event Related Items Refer to the VI_LATTR_EVENT_TYPE VI ATTR STATUS and VI ATTR OPER NAME descriptions of Chapter 3 Attributes and the viEnableEvent description of Chapter 5 Operations Also see Appendix B Resources National Instruments Corporation 4 11 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT GPIB CIC Resource Classes GPIB INTFC Description Notification that the GPIB controller has gained or lost CIC controller in charge status Event Attributes Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event VI ATTR GPIB RECV CIC STATE Specifies whether the CIC status was gained or lost Related Items Refer to the vr ATTR EVENT and VI ATTR GPIB STATE descriptions of Chapter 3 Attributes Also refer to the INTFC Resource description of Appendix B Resources NI VISA Programmer Reference Manual 4 12 ni com Chapter 4 Events VI EVENT GPIB LISTEN Resource Classes GPIB INTFC GPIB SERVANT Description Notification that the GPIB contr
255. ix Resources viVPrintf vi writeFmt params viVScanf vi readFmt params viVSPrintf vi buf writeFmt params viVSScanf vi buf readFmt params viWrite vi buf count retCount viWriteAsync vi buf count jobId viWriteFromFile vi fileName count retCount BACKPLANE Resource This section lists the attributes events and operations for the BACKPLANE Resource The attributes events and operations in the VISA Resource Template are available to this resource in addition to the attributes and operations listed below Attributes VI_ATTR_GPIB_PRIMARY_ADDR VI_ATTR_GPIB_SECONDARY_ADDR VI ATTR INTF INST NAMI VI ATTR INTF NUM VI ATTR INTF PARENT NUM VI ATTR INTF TYPE VI ATTR MAINFRAME LA VI ATTR TMO VALUE VI ATTR TRIG ID VI ATTR VXI TRIG STATUS VI ATTR VXI TRIG SUPPORT VI ATTR VXI VME INTR STATUS VI ATTR VXI VME SYSFAIL STATI Es VI EVENT TRIG VI EVENT VXI VME SYSFAIL VI EVENT VXI VME SYSRESET Operations viAssertIntrSignal vi mode statusID viAssertTrigger vi protocol viAssertUtilSignal vi line viMapTrigger vi trigSrc trigDest mode viUnmapTrigger vi trigSrc trigDest National Instruments Corporation 9 NI VISA Programmer Reference Manual Appendix Resources SERVANT Resource This section lists the attributes events and operations for the SERVANT Resource The attributes events and operati
256. l access services have operations for individual register accesses with a trade off between speed and complexity The high level access services also have operations for moving large blocks of data to and from devices When using an INSTR Resource all address parameters are relative to the device s assigned memory base in the given address space knowing a device s base address is neither required by nor relevant to the user Shared Memory services make it possible to allocate memory on a particular device that is to be used exclusively by a given session This is usually available only on devices that export shared memory specifically for such a purpose such as a VXIbus or VMEbus controller MEMACC A VISA Memory Access MEMACC Resource lets a controller interact with the interface associated with the given resource Advanced users who need to perform memory accesses directly between multiple devices typically use the MEMACC Resource This resource type gives the controller the following services to access arbitrary registers or memory addresses on memory mapped buses Memory I O or Register I O services allow register level access to interfaces that support direct memory access such as the VXIbus or VMEbus Both high level and low level access services have operations for individual register accesses with a trade off between speed and complexity The high level access services also have operations for moving large blocks of data to
257. lated Items Refertothe VI ATTR GPIB REN STATE VI ATTR GPIB NDAC STATE and VI ATTR GPIB STATE descriptions of this chapter Also refer to the INTFC Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR GPIB SYS CNTRL STATE Chapter 3 Resource Classes GPIB INTFC Attribute Information Access Privilege Data Type Range Default Read Only ViBoolean VI TRUE 1 N A Global VI FALSE 0 Description This attribute shows whether the specified GPIB interface is currently the system controller In some implementations this attribute may be modified only through a configuration utility On these systems this attribute is Read Only RO Related Items Refer to the VI ATTR GPIB CIC STATI Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual E description of this chapter Also refer to the INTFC Chapter 3 Attributes VI ATTR GPIB UNADDR EN Resource Classes GPIB INSTR GPIB VXI INSTR Attribute Information Description VI ATTR GPIB UNADDR after each read or write operation Related Items Refertothe VI ATTR GPIB RI Resource description of Appendix B Resources NI VISA Programmer Reference Manual Access Privilege Data Type Range Default Read Write ViBoolean VI_TRUE 1 VI_FALSE Local VI_FALSE 0
258. ler IN Interpreted as a valid reference to a handler to be installed by a client application userHandle IN A value specified by an application that can be used for identifying handlers uniquely for an event type Return Values Completion Codes Description VI SUCCESS Event handler installed successfully National Instruments Corporation 5 53 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_INV_EVENT Specified eventType is not supported by the resource VI ERROR INV HNDLR REF The given handler reference is invalid VI ERROR HNDLR NINSTALLED The handler was not installed This may be returned if an application attempts to install multiple handlers for the same event on the same session Description The virnstallHandler operation allows applications to install handlers on sessions The handler specified in the handler parameter is installed along with any previously installed handlers for the specified event Applications can specify a value in the userHandle parameter that is passed to the handler on its invocation VISA identifies handlers uniquely using the handler reference and this value VISA allows applications to install multiple handlers for an eventType on the same session You can install multiple handlers through multiple invocations of t
259. liance If you searched ni com and could not find the answers you need contact your local office or NI corporate headquarters Phone numbers for our worldwide offices are listed at the front of this manual You also can visit the Worldwide Offices section of ni com niglobal to access the branch office Web sites which provide up to date contact information support phone numbers email addresses and current events National Instruments Corporation C 1 NI VISA Programmer Reference Manual Glossary Symbol Prefix Value p pico 10 12 nano 10 9 u micro 10 6 milli 10 3 k kilo 10 M mega 106 G giga 109 t tera 1012 address A string or other language construct that uniquely locates and identifies address location address modifier address space address string resource VISA defines an ASCII based grammar that associates strings with particular physical devices and VISA resources Refers to the location of a specific register One of six signals in the VMEbus specifications used by VMEbus masters to indicate the address space and mode supervisory nonprivileged data program block in which a data transfer is to take place In VXI VME systems a set of 2 memory locations differentiated from other such sets in VXI VMEbus systems by six signal lines known as address modifiers where n either 16 24 or 32 is the number of address lines required to uniquely sp
260. llback mechanism with the new callback mechanism Specifying VI ALL ENABLED EVENTS for the eventType parameter refers to all events which have previously been enabled on this session making it easier to switch between the two callback mechanisms for multiple events NI VISA does not support enabling both the queue and the handler for the same event type on the same session If you need to use both mechanisms for the same event type you should open multiple sessions to the resource National Instruments Corporation 5 23 NI VISA Programmer Reference Manual Chapter 5 Operations Related Items Refer to the viDisableEvent viWaitOnEvent viEventHandler viiInstallHandler and viUninstallHandler descriptions of this chapter for information about installing and uninstalling event handlers Also refer to Chapter 4 Events for a list of events that you can enable and the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual 5 24 ni com viEventHandler Chapter 5 Operations Purpose Event service handler procedure prototype C Syntax ViStatus _VI_FUNCH viEventHandler ViSession vi ViEventType eventType Visual Basic Syntax N A Resource Classes ViEvent context ViAddr userHandle GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR T
261. llowing table lists the valid entries for specifying address space Value Description VI_A16_SPACE 1 Address the A16 address space of the VXI MXI bus VI A24 SPACE 2 Address the A24 address space of the VXI MXI bus A32 SPACE 3 Address the A32 address space of the VXI MXI bus VI LOCAL SPACI Ies 7 Address process local memory using virtual address VI_OPAQUE_SPACE FFFFh Addresses potentially volatile data using a virtual address The following table lists the valid entries for specifying widths Value Description VI_WIDTH_8 1 Performs 8 bit 008 transfers VI_WIDTH_16 2 Performs 16 bit D16 transfers VI_WIDTH_32 4 Performs 32 bit D32 transfers All VXI and PXI accesses performed by the viMove operation use either the same or successive offsets depending on the increment value specified by VI_ATTR_SRC_INCREMENT and VI_ATTR_DEST_INCREMENT If srcSpace is VI LOCAL SPACE viMove ignores VI SRC INCREMENT If destSpace is VI LOCAL SPACE viMove ignores DEST INCREMENT Local accesses always increment the offset for each index in a multi element transfer rather than using the increment specified by the attributes If srcSpace is any value other than VI LOCAL SPACE including VI OPAQUE SPACE viMove honors VI ATTR SRC INCREMENT I
262. lue Description VI GPIB REN DEASSERT Deassert REN line VI GPIB REN ASSERT Assert REN line VI GPIB REN DEASSERT GTL Send the Go To Local GTL command and deassert REN line VI GPIB REN ASSERT ADDRESS Assert REN line and address device VI GPIB REN ASSERT LLO Send LLO to any devices that are addressed to listen VI GPIB REN ASSERT ADDRESS LLO Address this device and send it LLO putting itin RWLS VI GPIB REN ADDRESS GTL Send the Go To Local command GTL to this device Related Items Refer to the viGpibControlATN description of this chapter Also refer to the INSTR Resource and INTFC Resource descriptions of Appendix B Resources National Instruments Corporation 5 45 NI VISA Programmer Reference Manual Chapter 5 Operations viGpibPassControl Purpose Tell the GPIB device at the specified address to become controller in charge CIC C Syntax ViStatus viGpibPassControl ViSession vi ViUInt16 primAddr ViUInt16 secAddr Visual Basic Syntax viGPIBPassControl amp ByVal vi amp ByVal primAddr ByValsec Addr Resource Classes GPIB INTFC Parameters Name Direction Description vi IN Unique logical identifier to a session primAddr IN Primary address of the GPIB device to which you want to pass control secAddr IN Secondary address of the targeted GPIB device If the targeted device
263. ly the controller in charge VI ERROR NLISTENERS No Listeners condition is detected both NRFD and NDAC are deasserted VI ERROR IO An unknown I O error occurred during transfer VI ERROR FILE ACCESS An error occurred while trying to open the specified file Possible reasons include an invalid path or lack of access rights VI ERROR FILE IO An error occurred while accessing the specified file VI ERROR CONN LOST The I O connection for the given session has been lost National Instruments Corporation 5 181 NI VISA Programmer Reference Manual Chapter 5 Operations Description This write operation synchronously transfers data The file specified in fileName is opened in binary Read Only mode and the data up to end of file or the number of bytes specified in count is read The data is then written to the device This operation returns only when the transfer terminates This operation is useful for sending data that was already processed and or formatted Special Values for retCount Parameter Value Action Description VI_NULL Do not return the number of bytes transferred If you pass VI NULL as the retCount parameter to the viwriteFromFile operation the number of bytes transferred will not be returned This may be useful if it is important to know only whether the operation succeeded or failed Related Items Refer to the viwrite and viReadToFile descriptions of this chapter Also
264. me Direction Description vi IN Unique logical identifier to a session degree IN VI NULL 0 jobId IN Specifies an operation identifier Return Values Completion Codes Description SUCCESS Request serviced successfully Error Codes Description VI ERROR INV OBJECT The given object reference is invalid VI ERROR INV JOB ID Specified job identifier is invalid VI ERROR INV DEGREE Specified degree is invalid NI VISA Programmer Reference Manual 5 144 ni com Chapter 5 Operations Description This operation is used to request a session to terminate normal execution of an operation as specified by the jobId parameter The jobId parameter is a unique value generated from each call to an asynchronous operation If a user passes VI_NULL as the jobId value to viTerminate VISA will abort any calls in the current process executing on the specified vi Any call that is terminated this way should return VI_ERROR_ABORT Due to the nature of multi threaded systems for example where operations in other threads may complete normally before the operation viTerminate has any effect the specified return value is not guaranteed Related Items Refer to the viReadAsync viWriteAsync viMoveAsync descriptions of this chapter Refer to the VI_EVENT_IO_COMPLETION description of Chapter 4 Events Also refer to the VISA Resource Template description of Appendix B
265. mentation send email to techpubs ni com 1996 2003 National Instruments Corporation All rights reserved Important Information 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 Return 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 document 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 I
266. mer Reference Manual Chapter 3 Attributes Interface Syntax TCPIP SOCKET TCPIP board host address port SOCKET USB INSTR USB board manufacturer ID model code serial number USB interface number INSTR USB RAW USB board manufacturer ID model code serial number USB interface number RAW VXI INSTR VXI board VXI logical address INSTR VXI BACKPLANE VXI board mainframe logical address BACKPLANE VXI MEMACC VXI board VXI SERVANT VXI board SERVANT The following table shows examples of address strings as defined in the previous table Address String Description VX1I0 1 INSTR A VXI device at logical address 1 in VXI interface V XIO GPIB VXI 9 INSTR A VXI device at logical address 9 in a GPIB VXI controlled system GPIB 1 0 INSTR A GPIB device at primary address and secondary address 0 in GPIB interface 0 ASRL1 INSTR A serial device located on port 1 VXI MEMACC Board level register access to the VXI interface GPIB VXI1 MEMACC Board level register access to GPIB VXI interface number 1 GPIB2 INTFC Interface or raw resource for GPIB interface 2 VXI 1 BACKPLANE Mainframe resource for chassis 1 on the default VXI system which is interface 0 GPIB VXI2 BACKPLANI Lj Mainframe resource for default chassis on GPIB VXI interface 2 GPIB1 SERVANT Servant de
267. mer Reference Manual Chapter 5 Operations Error Codes Description VI ERROR INV OBJECT The given object reference is invalid VI ERROR NSUP ATTR The specified attribute is not defined by the referenced object Description The viGetAttribute operation is used to retrieve the state of an attribute for the specified session event or find list The output parameter attrState is of the type of the attribute actually being retrieved For example when retrieving an attribute that is defined as a Vi Boolean your application should pass a reference to a variable of type ViBoolean Similarly if the attribute is defined as being ViUInt32 your application should pass a reference to a variable of type ViUInt32 Related Items Refer to viSetAttribute description of this chapter Also refer to the VISA Resource Template description of Appendix B Resources and the attribute descriptions of Chapter 3 Attributes NI VISA Programmer Reference Manual 5 38 ni com viGpibCommand Chapter 5 Operations Purpose Write GPIB command bytes on the bus C Syntax ViStatus viGpibCommand ViSession vi ViBuf buf ViUInt32 count ViPUInt32 retCount Visual Basic Syntax viGpibCommandk amp 1 Resource Classes ByVal vi amp ByVal buf ByVal count amp retCount amp GPIB INTFC Parameters Name Direction Description vi IN Unique logical identifier to a session
268. modifier promotes the argument to point to an array of floats e The z modifier promotes the argument to point to an array of double floats format codes An asterisk acts as the assignment suppression character The input is not assigned to any parameters and is discarded NI VISA Programmer Reference Manual 5 126 ni com Chapter 5 Enhanced Modifiers to ANSI C Standards Supported with Modifier Format Code Description comma plus The corresponding argument is interpreted as a followed by an variants and reference to the first element of an array of size n integer n only The first n elements of this list are printed in the where n format specified by the format code represents me A number sign may be present after the array size i comma modifier in which case an extra arg is used This arg must be an integer representing the array size of the given type 1 plus Converts to an IEEE 488 2 defined NR1 compatible variants and number which is an integer without any decimal only point for example 123 e2 plus Converts to an IEEE 488 2 defined NR2 compatible variants and number The NR2 number has at least one digit after only the decimal point for example 123 45 eH plus Converts to an IEEE 488 2 defined variants and lt HEXADECIMAL NUMERIC RESPONSE only DATA The number is repre
269. n VI ATTR USB BULK IN STATUS specifies whether the USB bulk in pipe used by the given session is stalled or ready This attribute can be set to only USB PIPE READY Related Items Refer to the RAW Resource description of Appendix B Resources National Instruments Corporation 3 117 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR USB BULK OUT PIPE Resource Classes USB RAW Attribute Information Description VI ATTR USB BULK OUT PIPI Access Privilege Data Type Range Default Read Write ViInt16 1 O1h to 81h to 8Fh N A Local E specifies the endpoint number of the USB bulk out pipe used by the given session An initial value of 1 signifies that this resource does not have any bulk out pipes Related Items Refer to the VI ATTR USB BULK IN PIPE VI ATTR USB NUM PIPES VI ATTR USB INTR PIPI description of Appendix B Resources NI VISA Programmer Reference Manual 3 118 E descriptions of this chapter and the RAW Resource ni com VI ATTR USB BULK OUT STATUS Chapter 3 Attributes Resource Classes USB RAW Attribute Information Access Privilege Data Type Range Default Read Write Vilnt16 VI USB PIPE STATE UNKNOWN 1 N A Local VI USB PIPE READY 0 VI USB PIPE STALLED 1 Description VI ATTR USB BULK OUT STATUS specifies whether the
270. n Values Completion Codes Description VI_SUCCESS Data was successfully read and formatted into parameter s Error Codes Description VI ERROR OBJECT The given session reference is invalid VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access NI VISA Programmer Reference Manual 5 124 ni com Chapter 5 Operations Error Codes Description VI ERROR IO Could not perform read operation because of I O error VI ERROR TMO Timeout expired before read operation completed VI ERROR INV FMT A format specifier in the readF mt string is invalid VI ERROR NSUP FMT A format specifier in the readF mt string is not supported VI ERROR ALLOC The system could not allocate a formatted I O buffer because of insufficient resources Description The viScanf operation receives data from a device formats it by using the format string and stores the resulting data in the arg parameter list The viRead operation is used for the actual low level read from the device As a result you should not use the viRead and viScanf operations in the same session 5 Note Because the prototype for this function cannot provide complete type checking remember that all output parameters must be passed by reference The format string can have format specifier sequences white characters
271. n does not support this operation This operation is supported only by a Resource Manager session VI_ERROR_INV_EXPR Invalid expression specified for search VI_ERROR_RSRC_NFOUND Specified expression does not match any devices Description The viFindRsrc operation matches the value specified in the expr parameter with the resources available for a particular interface A regular expression is a string consisting of ordinary characters as well as special characters You use a regular expression to specify patterns to match in a given string in other words itis a search criterion The viFindRsrc operation uses a case insensitive compare feature when matching resource names against the regular expression specified in expr For example calling viFindRsrc with VXI INSTR would return the same resources as invoking it with vxi instr On successful completion this function returns the first resource found instrDesc and returns a count retent to indicate if there were more resources found for the designated interface This function also returns in the findList parameter a handle to a find list This handle points to the list of resources and it must be used as an input to viFindNext When this handle is no longer needed it should be passed to viClose Notice that retent and findList are optional parameters This is useful if only the first match is important and the number of matches is not needed If you s
272. nation widths that are different VI ERROR INV SETUP Unable to start operation because setup is invalid due to attributes being set to an inconsistent state VI ERROR NSUP WIDTH Specified width is not supported by this hardware VI ERROR NSUP ALIGN OFFSET The specified offset is not properly aligned for the access width of the operation VI ERROR INV LENGTH Invalid length specified Description The viMove operation moves data from the specified source to the specified destination The source and the destination can either be local memory or the offset of the interface with which this MEMACC Resource is associated This operation uses the specified data width and address space In some systems such as VXI users can specify additional settings for the transfer such as byte order and access privilege by manipulating the appropriate attributes National Instruments Corporation 5 69 NI VISA Programmer Reference Manual Chapter 5 Operations The following table lists the valid entries for specifying address space Value Description VI_A16_SPACE 1 Address the A16 address space of the VXI MXI bus VI A24 SPACE 2 Address the A24 address space of the VXI MXI bus A32 SPACE 3 Address the A32 address space of the VXI MXI bus VI LOCAL SPACI Ies 7 Address process local memory using virtual address VI_OPAQUE_SPACE FFFFh Addresses potentially volatile data u
273. nd from devices The formatting capabilities include those specified by ANSI C with extensions for common protocols used by instrumentation systems Buffering improves system performance by making it possible to not only transfer large blocks of data but also send several commands at one time RAW A VISA USB Raw RAW Resource encapsulates the operations and properties of the capabilities of a raw USB device The RAW Resource exposes generic functionality of USB devices This resource type provides basic and formatted I O services National Instruments Corporation 2 5 NI VISA Programmer Reference Manual Chapter 2 Overview of the VISA API Basic I O services include the ability to send and receive blocks of data to and from the device The meaning of the data is device dependent and could be a message command or other binary encoded data If the device can communicate with 488 2 style strings the basic I O services also include software triggering querying a 488 style status byte and sending a device clear message Formatted I O services provide both formatted and buffered I O capabilities for data transfers to and from devices The formatting capabilities include those specified by ANSI C with extensions for common protocols used by instrumentation systems Buffering improves system performance by making it possible to not only transfer large blocks of data but also send several commands at one time Description of the API
274. nnection for the given session has been lost National Instruments Corporation A 7 NI VISA Programmer Reference Manual Appendix A Status Codes Table A 2 Error Codes Continued Error Codes Values Meaning VI_ERROR_MACHINE_NAVAIL BFFFOOA7h The remote machine does not exist or is not accepting any connections VI ERROR NPERMISSION BFFFOOA8h Access to the remote machine is denied NI VISA Programmer Reference Manual A 8 ni com Resources This appendix lists the attributes events and operations in each resource in VISA Refer to Chapter 3 Attributes Chapter 4 Events and Chapter 5 Operations for more details VISA Resource Template This section lists the attributes events and operations for the VISA Resource Template The attributes events and operations in the VISA Resource Template are available to all other resources Attributes VI ATTR MAX QUEUE LENGTH VI ATTR RM SESSION VI ATTR RSRC CLASS VI ATTR RSRC IMPL VERSION VI ATTR RSRC LOCK STATE VI ATTR RSRC MANF ID VI ATTR RSRC MANF NAME VI ATTR RSRC NAME VI ATTR RSRC SPEC VERSION VI ATTR USER DATA Events VI EVENT EXCEPTION Operations viClose vi viDisableEvent vi eventType mechanism viDiscardEvents vi eventType mechanism viEnableEvent vi eventType mechanism context viGetAttribute vi attribute attrState vilnstallHandler v
275. nstruments Corporation 3 131 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR USER DATA Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE Serial INSTR PXI INSTR PXI MEMACC TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViAddr Oh to FFFFFFFFh N A Local Description VI ATTR USER DATA is the data used privately by the application for a particular session This data is not used by VISA for any purpose It is provided to the application for its own use Related Items Refer to the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual 3 132 ni com Chapter 3 Attributes ATTR DEV CLASS Resource Classes GPIB VXI INSTR VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 VI VXI CLASS MEMORY 0 Global VI_VXI_CLASS_EXTENDED 1 VI_VXI_CLASS_MESSAGE 2 VI_VXI_CLASS_REGISTER 3 VI_VXI_CLASS_OTHER 4 Description This attribute represents the V XI defined device class to which the resource belongs either message based VI VXI CLASS MESSAGE register based VI VXI CLASS REGISTER extended VI VXI CLASS EXTENDED or memory VI VXI CLASS MEMO
276. nstruments 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 regardless 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
277. ntax N A Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR USB INSTR USB RAW TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session buf IN Location of a data block to be sent to a device count IN Number of bytes to be written jobId OUT Job ID of this asynchronous write operation Return Values Completion Codes Description SUCCESS Asynchronous write operation successfully queued SUCCESS SYNC Write operation performed synchronously NI VISA Programmer Reference Manual 5 178 ni com Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJE CT The given session reference is invalid VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI_ERROR_QUEUE_ERROR Unable to queue write operation VI_ERROR_IN_PROGRESS Unable to queue the asynchronous operation because there is already an operation in progress Description The viwriteAsync operation asynchronously transfers data The data to be written is in the buffer represented by buf This operation normally returns before the transfer terminates Before calling this operation you should enable the session for receiving I O completion events After
278. number is read The number read may be in either IEEE 488 2 formats lt DECIMAL NUMERIC PROGRAM DATA also known as flexible numeric representation NR1 NR2 NR3 or lt NON DECIMAL NUMERIC PROGRAM DATA tH 0 and 8 field width The input number will be stored in a field at least this wide Length modifier 1 arg is a reference to a long integer Length modifier h arg is a reference to a short integer Rounding is performed according to IEEE 488 2 rules 0 5 and up array size arg points to an array of integers or long or short integers depending on the length modifier of size array size The elements of this array should be separated by commas Elements will be read until either array size number of elements are consumed or they are no longer separated by commas If the array size contains a number sign two arguments are used The first arg read is a pointer to an integer specifying the maximum number of elements that the array can hold The second arg should be a reference to an array Also the actual number of elements read is stored back in the first argument NI VISA Programmer Reference Manual 5 128 ni com Chapter 5 Operations f Argument type A reference to a floating point number Flags or Modifiers Interpretation Default functionality Characters are read from the device until an entire number is read The number read may be in either IEEE 488
279. o suppress the END bit termination If this attribute is setto TRUE the END bit does not terminate read operations If this attribute is set to VI FALSE the END bit terminates read operations Related Items Refer to the viRead description of Chapter 5 Operations and the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 104 ni com VI ATTR TCPIP ADDR Chapter 3 Attributes Resource Classes TCPIP INSTR TCPIP SOCKET Attribute Information Access Privilege Data Type Range Default Read Only ViString N A N A Global Description This is the TCP IP address of the device to which the session is connected This string is formatted in dot notation Related Items Refer to the VI_ATTR_TCPIP_HOSTNAME description of this chapter Also refer to the INSTR Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 3 105 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR TCPIP DEVICE NAME Resource Classes TCPIP INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViString N A N A Global Description This specifies the LAN device name used by the VXI 11 protocol during connection Related Items Refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual 3 106 ni com A
280. o the INSTR Resource description of Appendix B Resources Also refer to the VXI Specification for defined Word Serial commands NI VISA Programmer Reference Manual 5 172 ni com viWaitOnEvent Chapter 5 Operations Purpose Waits for an occurrence of the specified event for a given session C Syntax ViStatus viWaitOnEvent ViSession vi ViEventType inEventType ViUInt32 timeout Visual Basic Syntax EventType outEventType ViPEvent outContext viWaitOnEvent amp ByVal vi amp ByVal inEventType amp ByVal timeout amp outEventType amp outContext amp Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session inEventType IN Logical identifier of the event s to wait for timeout IN Absolute time period in time units that the resource shall wait for a specified event to occur before returning the time elapsed error The time unit is in milliseconds outEventType OUT Logical identifier of the event actually received outContext OUT A handle specifying the unique occurrence of an event National Instruments Corporation 5 173 NI VISA Programmer Reference Manual Chapter 5 Operations Re
281. odes Error Codes Values Meaning VI ERROR SYSTEM ERROR BFFF0000h Unknown system error miscellaneous error VI ERROR INV OBJECT BFFFOO0Eh The given session or object reference is invalid NI VISA Programmer Reference Manual A 2 ni com Appendix A Status Codes Table A 2 Error Codes Continued Error Codes Values Meaning VI_ERROR_RSRC_LOCKED BFFFOOOFh Specified type of lock cannot be obtained or specified operation cannot be performed because the resource is locked VI_ERROR_INV_EXPR BFFF0010h Invalid expression specified for search VI ERROR RSRC NFOUND BFFFO0011h Insufficient location information or the device or resource is not present in the system VI ERROR INV RSRC NAME BFFF0012h Invalid resource reference specified Parsing error VI ERROR INV ACC MODE BFFF0013h Invalid access mode VI ERROR TMO 0015 Timeout expired before operation completed VI_ERROR_CLOSING_FAILED BFFF0016h Unable to deallocate the previously allocated data structures corresponding to this session or object reference VI ERROR DEGREE BFFF001Bh Specified degree is invalid ERROR INV JOB ID BFFF001Ch Specified job identifier is invalid VI ERROR NSUP ATTR BFFF001Dh The specified attribute is not defined or supported by the referenced session event or fin
282. ol this feature If an application requires a specific buffer size for performance reasons but a specific implementation of VISA cannot guarantee that size then it is recommended to use some form of handshaking to prevent overflow conditions In previous versions of VISA vr IO IN BUF was known as VI ASRL IN BUF and VI IO OUT BUF was known as ASRL OUT BUF Related Items Refer to the viFlush viPrintf viScant descriptions of this chapter and the VI ATTR RD BUF SIZE and VI ATTR WR BUF SIZE descriptions of Chapter 3 Attributes Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 137 NI VISA Programmer Reference Manual Chapter 5 Operations viSPrintf Purpose Converts formats and sends the parameters designated by to a user specified buffer as specified by the format string C Syntax ViStatus viSPrintf ViSession vi ViPBuf buf ViString writeFmt Visual Basic Syntax N A Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session buf OUT Buffer where data is to be written writeFmt IN The format string to apply to parameters in ViVAList IN Parameters to which the format string is applied The formatted
283. oller has been addressed to listen Event Attributes Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event Related Items Refertothe ATTR EVENT TYPE description of Chapter 3 Attributes Also refer to the INTFC Resource and SERVANT Resource descriptions of Appendix B Resources National Instruments Corporation 4 13 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT GPIB TALK Resource Classes GPIB INTFC GPIB SERVANT Description Notification that the GPIB controller has been addressed to talk Event Attribute Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event Related Items Refertothe vr ATTR EVENT TYPE description of Chapter 3 Attributes Also refer to the INTFC Resource and SERVANT Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual ni com VI EVENT 10 COMPLETION Chapter 4 Events Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI SERVANT Description This event notifies the application that an asynchronous operation has completed Event Attribute S Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the even
284. ols input flow by sending when the receive buffer is nearly full and it controls the output flow by suspending transmission when XOFF is received If this attribute is set to ASRL FLOW RTS CTS the transfer mechanism uses the RTS output signal and the CTS input signal to perform flow control The transfer mechanism controls input flow by unasserting the RTS signal when the receive buffer is nearly full and it controls output flow by suspending the transmission when the CTS signal is unasserted If this attribute is set to FLOW the transfer mechanism uses the DTR output signal and the DSR input signal to perform flow control The transfer mechanism controls input flow by unasserting the DTR signal when the receive buffer is nearly full and it controls output flow by suspending the transmission when the DSR signal is unasserted This attribute can specify multiple flow control mechanisms by bit ORing multiple values together However certain combinations may not be supported by all serial ports and or operating systems NI VISA Programmer Reference Manual 3 16 ni com Chapter 3 Attributes Related Items Refer to the VI ATTR ASRL BAUD VI ATTR ASRL DATA BITS VI ATTR ASRL PARITY VI ATTR ASRL STOP BITS ATTR ASRL CHAR and VI ATTR ASRL XOFF CHAR descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources Nat
285. on goes to standby VI GPIB ATN ASSERT IMM EDIATE Assert ATN line and take control asynchronously and immediately without regard for any data transfer currently in progress Generally this should be used only under error conditions It is generally not necessary to use viGpibControlATN operation in most applications Other operations such as viGpibCommand and viGpibPassControl modify the ATN and or CIC state automatically NI VISA Programmer Reference Manual 5 42 ni com Chapter 5 Operations Related Items Refer to the viGpibControlREN description of this chapter Also refer to the Resource description of Appendix B Resources National Instruments Corporation 5 43 NI VISA Programmer Reference Manual Chapter 5 Operations viGpibControlREN Purpose Controls the state of the GPIB Remote Enable REN interface line and optionally the remote local state of the device C Syntax ViStatus viGpibControlREN ViSession vi ViUInt16 mode Visual Basic Syntax viGpibControlREN amp ByVal vi amp ByVal mode Resource Classes GPIB INSTR GPIB INTFC USB INSTR Parameters Name Direction Description vi IN Unique logical identifier to a session mode IN Specifies the state of the REN line and optionally the device remote local state Refer to the Description section for actual values Return Values Completion Codes
286. on to a given device are reset whenever that device is cleared Invoking the viClear operation will flush the read buffer and discard the contents of the write buffers Related Items Refer to the viSetBuf description of this chapter Also refer to the INTFC Resource INSTR Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 36 ni com Chapter 5 Operations viGetAttribute Purpose Retrieves the state of an attribute C Syntax ViStatus viGetAttribute ViObject vi ViAttr attribute void attrState Visual Basic Syntax viGetAttribute amp ByVal vi amp ByVal attribute amp attrState as Any Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session event or find list attribute IN Resource attribute for which the state query is made attrState OUT The state of the queried attribute for a specified resource The interpretation of the returned value is defined by the individual object Return Values Completion Codes Description VI SUCCESS Attribute retrieved successfully National Instruments Corporation 5 37 NI VISA Program
287. onal Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR PXI SLOT LBUS LEFT Resource Classes PXI INSTR Attribute Information Description VI_ATTR_PXI_SLOT_LBUS_LI the local bus left lines of this device Related Items Access Privilege Data Type Range Default Read Only Vilnt16 N A N A Global EFT specifies the slot number or special feature connected to Refertothe vr ATTR PXI SLOT LBUS RIGHT and VI ATTR SLOT descriptions of this chapter and the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com VI ATTR PXI SLOT LBUS RIGHT Chapter 3 Attributes Resource Classes PXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only Vilnti16 N A N A Global Description VI ATTR PXI SLOT LBUS Right specifies the slot number or special feature connected to the local bus right lines of this device Related Items Refer to the VI ATTR PXI SLOT LBUS 11 EFT and VI ATTR SLOT descriptions of this chapter and the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI_ATTR_PXI_SLOTPATH Resource Classes PXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViString N A N A Global Des
288. ons in the VISA Resource Template are available to this resource in addition to the attributes and operations listed below Attributes VI_ATTR_CMDR_LA VI_ATTR_DEV_STATUS_BYT VI_ATTR_DMA_ALLOW_EN VI_ATTR_FILE_APPEND_EN VI_ATTR_GPIB_PRIMARY_ADDR VI_ATTR_GPIB_REN_STATE VI_ATTR_GPIB_SECONDARY_ADDR VI_ATTR_INTF_INST_NAME VI_ATTR_INTF_NUM VI_ATTR_INTF_TYPE VI_ATTR_IO_PROT VI_ATTR_RD_BUF_OPER_MODE VI_ATTR_SEND_END_EN VI_ATTR_TERMCHAR VI_ATTR_TERMCHAR_EN VI_ATTR_TMO_VALU VEI ATTR TRIG ID VI ATTR VXI LA VI ATTR VXI VME SYSFAIL STATE VI ATTR WR BUF OPER MODE jc Events VI_EVENT_CLEAR VI_EVENT_GPIB_LISTEN VI_EVENT_GPIB_TALK VI_EVENT_IO_COMPLETION VI_EVENT_TRIG VI_EVENT_VXI_VME_SYSRESET Operations viAssertIntrSignal vi mode statusID viAssertUtilSignal vi line viBufRead vi buf count retCount viBufWrite vi buf count retCount NI VISA Programmer Reference Manual B 10 ni com SOCKET Resource National Instruments Corporation Appendix B viFlush vi mask viPrintf vi writeFmt viRead vi buf count retCount viReadAsync vi buf count jobId viReadToFile vi fileName count retCount viScanf vi readFmt viSetBuf vi mask size viSPrintf vi buf writeFmt viSScanf vi buf readFmt viVPrintf vi writeFmt params vivScanf vi readFmt
289. or loaded VI ERROR INTF NUM NCONFIG The interface type is valid but the specified interface number is not configured Description This operation parses a resource string to verify its validity It should succeed for all strings returned by virindRsrc and recognized by viopen This operation is useful if you want to know what interface a given resource descriptor would use without actually opening a session to it The values returned in int Type and intfNum correspond to the attributes VI ATTR INTF TYPE and VI ATTR INTF NUM These values would be the same if a user opened that resource with viOpen and queried the attributes with viGetAttribute NI VISA Programmer Reference Manual ni com Chapter 5 Operations The value returned in unaliasedExpandedRsrcName should in most cases be identical to the VISA defined canonical resource name However there may be cases where the canonical name includes information that the driver may not know until the resource has actually been opened In these cases the value returned in this parameter must be semantically similar The value returned in aliasIfExists allows programmatic access to user defined aliases Calling viParseRsrc with VXI 1 INSTR will produce the same results as invoking it with vxi 1 instr Related Items Refer to the viFindRsrc viOpen and viParseRsrc descriptions of this chapter Also refer to the VISA Resource Templat
290. ormation Access Privilege Data Type Range Default Read Write ViUInt16 VI BIG ENDIAN 0 VI BIG ENDIAN Local VI LITTLE ENDIAN 1 Description VI ATTR SRC BYTE ORDER specifies the byte order to be used in high level access operations such as vimnxx and viMoveInXX when reading from the source Related Items Refer to the ATTR DI EST BYTE ORDI ATTR SRC INCREMENT and VI ATTR WIN ER VL ATTR SRC ACCESS PRIV BYTE ORDER descriptions of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources National Instruments Corporation 3 101 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR SRC INCREMENT Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Write Vilnt32 Otol 1 Local Description VI_ATTR_SRC_INCR many elements the sourc of this attribute is 1 that and the viMoveOut XX EMENT is used in the viMoveInXX operations to specify by how e offset is to be incremented after every transfer The default value 15 the source address will be incremented by 1 after each transfer operations move from consecutive elements If this attribute is set to 0 the viMoveInxx operations will always r
291. ources National Instruments Corporation 3 143 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR WR BUF OPER MODE Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI SERVANT Attribute Information Access Privilege Data Type Range Default Local Read Write ViUInt16 VI FLUSH ON ACCESS VI FLUSH WHEN FULL 1 2 VI FLUSH WHEN FULL Description VI ATTR WR BUF OPER MODI E specifies the operational mode of the formatted I O write buffer When the operational mode is setto FLUSH WHEN FULL default the buffer is flushed when an END indicator is written to the buffer or when the buffer fills up If the operational mode is set to FLUSH ON ACCI ESS the write buffer is flushed under the same conditions and also every time a viPrintf or related operation completes Related Items Refer to the ATTR RD BUF OPER MODE description of this chapter and the viPrintf and viFlush descriptions of Chapter 5 Operations Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 144 ni com VI WR BUF SIZE Chapter 3 Attributes Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INS
292. p ByVal trigSrc ByVal trigDest Resource Classes GPIB VXI BACKPLANE VXI BACKPLANE Parameters Name Direction Description vi IN Unique logical identifier to a session trigSrc IN Source line used in previous map Refer to the Description section for actual values trigDest IN Destination line used in previous map Refer to the Description section for actual values Return Values Completion Code Description VI SUCCESS Operation completed successfully National Instruments Corporation 5 151 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_NSUP_OPER The given vi does not support this operation VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR INV LINE One of the specified lines trigSrc or trigDest is invalid VI ERROR TRIG NMAPPI E The path from trigSrc trigDest is not currently mapped E VI ERROR NSUP LINI One of the specified lines trigSrc or trigDest is not supported by this VISA implementation Description This operation can be used to undo a previous mapping of one trigger line to another This operation is valid only on BACKPLANE mainframe sessions Special Values for trigSrc Parameters
293. pecify VI NULL in the findList parameter and the operation completes successfully VISA automatically invokes viClose on the find list handle rather than returning it to the application 5 Note size of the instrDesc parameter should be at least 256 bytes The search criteria specified in the expr parameter has two parts a regular expression over a resource string and an optional logical expression over attribute values The regular expression is matched against the resource strings of resources known to the VISA Resource Manager If the resource string matches the regular expression the attribute values of the NI VISA Programmer Reference Manual 5 30 ni com Chapter 5 Operations resource are then matched against the expression over attribute values If the match is successful the resource has met the search criteria and gets added to the list of resources found All resource strings returned by viFindRsrc will always be recognized by viOpen However viFindRsrc will not necessarily return all strings that you can pass to viParseRsrc or viOpen This is especially true for network and TCPIP resources Special Characters and Operators Meaning Matches any one character N Makes the character that follows it an ordinary character instead of special character For example when a question mark follows a backslash it matches the character instead of any one character list Matches any one characte
294. properly aligned for the access width of the operation VI ERROR INV SETUP Unable to start operation because setup is invalid due to attributes being set to an inconsistent state Description The viMoveInxx operations use the specified address space to read in 8 16 or 32 bits of data respectively from the specified offset These operations do not require viMapAddress to be called prior to their invocation National Instruments Corporation 5 77 NI VISA Programmer Reference Manual Chapter 5 Operations The following table lists the valid entries for specifying address space Value Description VXI VME and VI_A16_SPACE 1 GPIB VXI VI A24 SPACE 2 VI A32 SPACE 3 PXI INSTR VI_PXI_CFG_SPACE 10 VI PXI BARO SPACE 11 toVI PXI BAR5 SPACE 16 PXI MEMACC VI PXI ALLOC SPACE 9 For these operations VISA ignores the attribute VI ATTR DEST INCREMENT and increments the local buffer address for each element It is valid for the VISA driver to copy the data into the user buffer at any width it wants In other words even if the width is a byte 8 bit the VISA driver can perform 32 bit PCI burst accesses because it is just memory to improve throughput INSTR Specific Notice that offset specified in the viMoveIn8 viMoveIn16 and viMoveIn32 operations for an INSTR Resource is the offset address relative to the device s allocated address base for the corresponding addres
295. proves system performance by making it possible to not only transfer large blocks of data but also send several commands at one time A VISA VXI Mainframe Backplane BACKPLANE Resource encapsulates the operations and properties of each mainframe or chassis in a VXIbus system This resource type lets a controller query and manipulate specific lines on a specific mainframe in a given VXI system BACKPLANE services allow the user to map unmap assert and receive hardware triggers and also to assert and receive various utility and interrupt signals This includes advanced functionality that might not be available in all implementations or on all controllers A VISA Servant SERVANT Resource encapsulates the operations and properties of the capabilities of a device and a device s view of the system in which it exists The SERVANT Resource exposes the device side functionality of the device associated with the given resource The SERVANT Resource is a class for advanced users who want to write firmware code that exports message based device functionality across potentially multiple interfaces This resource type provides basic and formatted I O services NI VISA Programmer Reference Manual 2 4 ni com Chapter 2 Overview of the VISA API Basic I O services include the ability to receive blocks of data from a commander and respond with blocks of data in return The meaning of the data is device dependent and could be a message command or othe
296. r binary encoded data The basic I O services also include setting a 488 style status byte and receiving device clear and trigger events Formatted I O services provide both formatted and buffered I O capabilities for data transfers from and to the given device s commander The formatting capabilities include those specified by ANSI C with extensions for common protocols used by instrumentation systems Buffering improves system performance by making it possible to not only transfer large blocks of data but also send several commands at one time A VXI Servant Resource also provides services to assert and receive various utility and interrupt signals SOCKET A VISA Ethernet Socket SOCKET Resource encapsulates the operations and properties of the capabilities of a raw Ethernet connection using TCP IP The SOCKET Resource exposes the capability of a raw socket connection over TCP IP This resource type provides basic and formatted services Basic I O services include the ability to send and receive blocks of data to and from the device The meaning of the data is device dependent and could be a message command or other binary encoded data If the device is capable of communicating with 488 2 style strings the basic I O services also include software triggering querying a 488 style status byte and sending a device clear message Formatted I O services provide both formatted and buffered I O capabilities for data transfers to a
297. r 5 Operations Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR INV FMT A format specifier in the writeFmt string is invalid VI ERROR NSUP FMT A format specifier in the writeFmt string is not supported VI ERROR ALLOC The system could not allocate a formatted I O buffer because of insufficient resources Description This operation is similar to vivPrintf except that the output is not written to the device it is written to the user specified buffer This output buffer is NULL terminated If this operation outputs an END indicator before all the arguments are satisfied then the rest of the writeFmt string is ignored and the buffer string is still terminated by a NULL 5 Note size of the buf parameter should be large enough to hold the formatted contents plus the NULL termination character Related Items Refer to the viPrintf viSPrintf viVPrintf and vivSScanft descriptions of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 167 NI VISA Programmer Reference Manual Chapter 5 Operations viVSScanf Purpose Reads converts and formats d
298. r from the enclosed list You can use a hyphen to match a range of characters list Matches any character not in the enclosed 1ist You can use a hyphen to match a range of characters Matches 0 or more occurrences of the preceding character or expression Matches or more occurrences of the preceding character or expression exp exp Matches either the preceding or following expression The or operator matches the entire expression that precedes or follows it and not just the character that precedes or follows it For example vxr GPIB means VXI GPIB not VX I G PIB exp Grouping characters or expressions National Instruments Corporation 5 31 NI VISA Programmer Reference Manual Chapter 5 Operations Regular Expression Sample Matches GPIB INSTR Matches GPIBO 2 INSTR GPIB1 1 1 INSTR and GPIB VXI1 8 INSTR GPIB 0 9 INSTR Matches GPIBO 2 INSTR and GPIB1 1 1 INSTR but not GPIB VXI1 8 INSTR GPIB 0 INSTR Matches GPIB1 1 1 INSTR but not GPIBO 2 INSTR or GPIB12 8 INSTR VXI INSTR Matches VXI0 1 INSTR but not GPIB VXIO 1 INSTR GPIB VXI INSTR Matches GPIB VXIO 1 INSTR but not VXIO 1 INSTR VXI 0 9 INSTR Matches VXI0 1 INSTR and GPIB VXIO 1 INSTR ASRL 0 9 INSTR Matches ASRL1 INSTR but not VXIO 5 INSTR ASRL1 INSTR Matches ASRL1 I
299. r reads and writes Other forms include triggering or varying forms of asynchronous control A set of routines designed to control a specific instrument or family of instruments and any necessary related files for LabWindows CVI or LabVIEW A generic term that applies to the connection between devices and controllers It includes the communication media and the device controller hardware necessary for cross communication A condition that requires attention out of the normal flow of control of a program A state that prohibits sessions other than the session s owning the lock from accessing a resource An 8 bit number that uniquely identifies the location of each VXIbus device s configuration registers in a system The A16 register address of a device is CO00h Logical Address 40h An operation that returns a reference to a specified section of an address space and makes the specified range of addresses accessible to the requester This function is independent of memory allocation NI VISA Programmer Reference Manual Glossary MAX message based device multitasking NI Spy 0 operation P process Measurement amp Automation Explorer Provides access to all National Instruments DAQ GPIB IMAQ IVI Motion VISA and VXI devices With MAX you can configure National Instruments hardware and software add new channels interfaces and virtual instruments execute system diagnostics and view the devices and inst
300. r system that allows only a single program to execute at a given point in time NI VISA Programmer Reference Manual G 6 ni com programmed I O protocol PXI R register register based device Resource Class resource or resource instance Glossary Low speed data transfer between a board and memory in which the CPU moves each data value according to program instructions See also DMA Set of rules or conventions governing the exchange of information between computer systems PCI eXtensions for Instrumentation PXI leverages the electrical features defined by the Peripheral Component Interconnect PCI specification as well as the CompactPCI form factor which combines the PCI electrical specification with Eurocard VME mechanical packaging and high performance connectors This combination allows CompactPCI and PXI systems to have up to seven peripheral slots versus four in a desktop PCI system An address location that can be read from or written into or both It may contain a value that is a function of the state of hardware or can be written into to cause hardware to perform a particular action In other words an address location that controls and or monitors hardware In VXI VME systems a servant only device that supports only the four basic VXIbus configuration registers Register based devices are typically controlled by message based devices via device dependent register reads and writes All PXI devices are by de
301. refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 182 ni com Status Codes This appendix lists and describes the completion and error codes Table A 1 Completion Codes Completion Codes Values Meaning VI_SUCCESS 0 Operation completed successfully VI_SUCCESS_EVENT_EN 3FFF0002h Specified event is already enabled for at least one of the specified mechanisms VI SUCCESS EVENT DIS 3FFF0003h Specified event is already disabled for at least one of the specified mechanisms VI SUCCESS QUEUE EMPTY 3FFF0004h Operation completed successfully but queue was already empty VI SUCCESS TERM CHAR 3FFF0005h The specified termination character was read VI SUCCESS MAX CNT 3FFF0006h The number of bytes read is equal to the input count VI WARN QUEUE OVERFLOW 3FFF000Ch VISA received more event information of the specified type than the configured queue size could hold VI WARN CONFIG NLOADED 3FFF0077h The specified configuration either does not exist or could not be loaded using VIS A specified defaults VI SUCCESS DEV NPRESENT 3FFF007Dh Session opened successfully but the device at the specified address is not responding VI SUCCESS TRIG MAPPED 3FFF007Eh The path from trigSrc to trigDest is already mapped National Instr
302. requester the message based device For example on the IEEE 488 2 interface the message is read by polling devices for other types of interfaces a message is sent in response to a service request to retrieve status information For a session to a Serial device or Ethernet socket if VI_ATTR_IO_PROT is VI PROT 4882 STRS the device is sent the string STB n and then the device s status byte is read otherwise this operation is not valid For a session to a USB instrument this function sends the READ_STATUS_BYTE command on the control pipe If the status information is only one byte long the most significant byte is returned with the zero value If the service requester does not respond in the actual timeout period VI ERROR TMO is returned Related Items Refer to the ATTR IO PROT description of Chapter 3 Attributes and the VI EVENT SERVICE description of Chapter 4 Events Also refer to the INSTR Resource and SOCKET Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 5 120 ni com Chapter 5 Operations viReadToFile Purpose Read data synchronously and store the transferred data in a file C Syntax ViStatus viReadToFile ViSession vi ViString fileName ViUInt32 count ViPUInt32 retCount Visual Basic Syntax viReadToFile amp ByVal vi amp ByVal filename ByVal count amp retCount amp Resource Classes GPIB INSTR GPIB INTF
303. require viMapAddress to be called prior to their invocation National Instruments Corporation 5 81 NI VISA Programmer Reference Manual Chapter 5 Operations The following table lists the valid entries for specifying address space Interface Values VXI VME and VI_A16_SPACE 1 GPIB VXI VI A24 SPACE 2 VI A32 SPACE 3 PXI INSTR VI_PXI_CFG_SPACE 10 VI PXI BARO SPACE 11 toVI PXI BAR5 SPACE 16 PXI MEMACC VI PXI ALLOC SPACE 9 For these operations VISA ignores the attribute ATTR SRC INCREMENT and increments the local buffer address for each element It is valid for the VISA driver to copy the data out of the user buffer at any width it wants In other words even if the width is a byte 8 bit the VISA driver can perform 32 bit PCI burst accesses because it is just memory to improve throughput INSTR Specific Notice that offset specified in the viMoveOut8 viMoveOut16 and viMoveOut32 operations for an INSTR Resource is the offset address relative to the device s allocated address base for the corresponding address space that was specified For example if space specifies VI A16 SPACE then offset specifies the offset from the logical address base address of the specified VXI device If space specifies A24 SPACEOrVI A32 SPACE then offset specifies the offset from the base address of the VXI device s memory space allocated by the VXI Resource Manager within VXI A2
304. ributes VI ATTR ASRL ALLOW TRANSMIT VI ATTR ASRL AVAIL NUM VI ATTR ASRL BAUD VI ATTR ASRL BREAK LEN NI VISA Programmer Reference Manual 2 ni com VI A ASRL BREAK STATI Lj VI 1 PR ASRL CTS STATE VI 1 ASRL DATA BITS VI 1 l R ASRL DCD STATI B VI A VI 1 UTR ASRL DISCARD NULL UTR ASRL DSR STATE VI 1 ASRL STATI d VI 1 ASRL END IN VI A ASRL END OUT VI 1 ASRL FLOW CNTRL VI 1 VI 1 VI 1 l UR ASRL PARITY 5 REPLACE CHAR l UR ASRL RI STATE VI 1 l UR ASRL RTS STATE VI 1 ASRL STOP BITS ASRL WIRE MODI B ASRL XOFF CHAR ASRL CHAR CMDR LA l PR DEST ACCESS PRIV VI A DEST BYTE ORDER VI 1 DEST INCREMENT DMA ALLOW EN VI AJ VI A VI 1 UTR CHNL UTR MODE UTR FDC USE PAIR VI 1 FILE APPEND EN VI 1 VI 1 UTR GPIB PRIMARY ADDR UTR GPIB READDR EN VI AJ GPIB REN STATE VI 1 VI AJ GPIB UNADDR EN VI AJ VI AJ IMMEDIATE SERV INTF INST NAME VI 1 VI 1 NUM PARENT NUM VI_AT VI Aj VI 1 VI 1 VI A VI 1 VI 1 UT
305. ruments connected to your system Installs automatically with NI VISA version 2 5 or later or NI VXI version 3 0 or later Available only for Win32 based operating systems In VXI VME systems an intelligent device that implements the defined VXlIbus registers and communication protocols These devices able to use Word Serial Protocol to communicate with one another through communication registers All GPIB and Serial devices are by definition message based as are devices for some other interfaces Many modern message based devices support the IEEE 488 2 protocol The ability of a computer to perform two or more functions simultaneously without interference from one another In operating system terms it is the ability of the operating system to execute multiple applications processes by time sharing the available CPU resources A utility that monitors records and displays multiple National Instruments APIs such as NI 488 2 and NI VISA Useful for troubleshooting errors in your application and for verifying communication An action defined by a resource that can be performed on a resource In general this term is synonymous with the connotation of the word method in object oriented architectures An operating system element that shares a system s resources A multi process system is a computer system that allows multiple programs to execute simultaneously each in a separate process environment A single process system is a compute
306. ry C 1 drivers instrument C 1 software C 1 E enabling events with viEnableEvent operation 5 23 ni com END bit VI ATTR SEND END EN 3 97 VI SUPPRESS END EN 3 104 error codes table A 2 event operations viDiscardEvents 5 20 viEnableEvent 5 22 viEventHandler 5 25 viWaitOnEvent 5 173 events access mechanism for VISA 2 1 BACKPLANE Resource B 9 definition 2 1 INSTR Resource B 4 INTFC Resource B 8 MEMACC Resource B 6 overview 2 1 RAW Resource B 13 SERVANT Resource B 10 SOCKET Resource B 12 VI EVENT ASRL BREAK 4 2 VI EVENT ASRL CHAR 4 3 VI EVENT ASRL CTS 4 4 VI EVE ASRL DCD 4 5 VI EVENT ASRL DSR 4 6 VI EVE ASRL RI 4 7 VI EVENT ASRL TERMCHAR 4 8 VI EVENT CLEAR 4 9 VI EVENT EXCEPTION 4 10 VI EVENT GPIB CIC 4 12 VI EVENT GPIB LISTEN 4 13 VI EVENT GPIB TALK 4 14 VI EVENT IO COMPLETION 4 15 VI EVENT PXI INTR 4 16 VI EVENT SERVICE REQ 4 17 VI EVENT TRIG 4 18 VI EVENT VXI SIGP 4 20 VI EVENT VXI VME INTR 4 21 VI EVENT VXI VME SYSFAIL 4 22 Z Z Z 545353555 2 National Instruments Corporation l 5 Index VI EVENT VXI SYSRESET 4 23 VISA Resource Template B 1 example code C 1 exception handling with VI EVENT EXCEPTION 4 10 F Fast Data Channel FDC attributes VI FDC CHNL 3 34 VI FDC MODE 3 35 VI FDC USE PAIR 3 36 finding resource information viFindNext 5 27 viFindRsr
307. s National Instruments Corporation 5 79 NI VISA Programmer Reference Manual Chapter 5 Operations viMoveOut8 viMoveOut16 viMoveOut32 Purpose Moves a block of data from local memory to the specified address space and offset C Syntax ViStatus viMoveOut8 ViSession vi ViUInt16 space ViBusAddress offset ViBusSize length ViAUInt8 buf8 ViStatus viMoveOut16 ViSession vi ViUInt16 space ViBusAddress offset ViBusSize length ViAUInt16 buf16 ViStatus viMoveOut32 ViSession vi ViUInt16 space ViBusAddress offset ViBusSize length ViAUInt32 buf32 Visual Basic Syntax viMoveOut8 amp ByVal vi amp ByVal length amp buf8 as Byte viMoveOut16 amp ByVal vi amp ByVal length amp buf163 viMoveOut32 amp ByVal vi amp ByVal length amp buf32 amp Resource Classes ByVal space ByVal offset amp ByVal space ByVal offset ByVal space ByVal offset GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session space IN Specifies the address space Refer to the table included in the Description section offset IN Offset in bytes of the device to write to length IN Number of elements to transfer where the data width of the elements to transfer is identical to data width 8 16 or 32 bits buf8 buf16 IN Data to write bus 8 bits for viMoveOut8 1
308. s Resource Classes GPIB VXI INSTR VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 VI A16 SPACE 1 VI A16 SPACE Global A24 SPACE 2 VI A32 SPACE 3 Description VI ATTR MEM SPACE specifies the V XIbus address space used by the device The three types are A16 A24 or A32 memory address space A VXI device with memory in A24 or A32 space also has registers accessible in the configuration section of A16 space A VME device with memory in multiple address spaces requires one VISA resource for each address space used Related Items Refer to the ATTR MEM BASE and VI ATTR MI EM SIZE descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR MODEL CODE Resource Classes GPIB VXI INSTR PXI INSTR USB INSTR USB RAW VXI INSTR Attribute Information Description VI ATTR MODEL CODE specifies the model code for the device For VXI resources this refers to the VXI Model Code Access Privilege Data Type Range Default Read Only ViUInt16 Oh to FFFFh N A Global For PXI INSTR resources if the subsystem PCI Vendor ID is nonzero this refers to the subsystem Device ID Otherwise this refers to the Device ID For USB resources this refers to the Product ID
309. s Also refer to the INSTR Resource INTFC Resource and SERVANT Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 3 Attributes VI ATTR GPIB SECONDARY ADDR Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE Attribute Information Access Privilege Data Type Range Default INSTR MEMACC ViUInt16 0 to 30 N A BACKPLANE VI NO SEC ADDR FFFFh Read Only Global INTFC SERVANT Read Write Global Description VI_ATTR_GPIB_SECONDARY_ADDR specifies the secondary address of the GPIB device used by the given session For the GPIB INTFC and GPIB SERVANT Resources this attribute is Read Write Related Items Refer to the VI ATTR GPIB PRIMARY ADDR description of this chapter Also refer to the INSTR Resource INTFC Resource MEMACC Resource BACKPLANE Resource and SERVANT Resource descriptions of Appendix B Resources National Instruments Corporation 3 47 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR GPIB SRQ STATE Resource Classes GPIB INTFC Attribute Information Access Privilege Data Type Range Default Read Only VilInt16 VI STATE ASSERTED 1 N A Global VI STATE UNASSERTED 0 VI STATE UNKNOWN 1 Description This attribute shows the current state of the GPIB SRQ Service ReQuest interface line Re
310. s GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR USB INSTR USB RAW TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session fileName IN Name of file from which data will be read count IN Number of bytes to be written retCount OUT Number of bytes actually transferred Return Values Completion Code Description SUCCESS Transfer completed NI VISA Programmer Reference Manual 5 180 ni com Chapter 5 Operations Error Codes Description VI_ERROR_INV_OBJECT The given session or object reference is invalid both are the same value VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR TMO Timeout expired before operation completed VI ERROR RAW WR PROT VIOL Violation of raw write protocol occurred during transfer VI ERROR RAW RD PROT VIOL Violation of raw read protocol occurred during transfer VI ERROR INP PROT VIOL Device reported an input protocol error during transfer VI ERROR BERR Bus error occurred during transfer VI ERROR NCIC The interface associated with the given vi is not current
311. s operation returns only when the transfer terminates If you pass VI NULL as the retCount parameter to the viGpibCommand operation the number of bytes transferred will not be returned This may be useful if it is important to know only whether the operation succeeded or failed The command bytes contained in buf should be valid IEEE 488 defined Multiline Interface Messages Related Items Refer to the INTFC Resource description of Appendix B Resources NI VISA Programmer Reference Manual 5 40 ni com Chapter 5 Operations viGpibControlATN Purpose Specifies the state of the ATN line and the local active controller state C Syntax ViStatus viGpibControlATN ViSession vi ViUInt16 mode Visual Basic Syntax viGpibControlATN amp ByVal vi amp ByVal mode Resource Classes GPIB INTFC Parameters Name Direction Description vi IN Unique logical identifier to a session mode IN Specifies the state of the ATN line and optionally the local active controller state Refer to the Description section for actual values Return Values Completion Codes Description VI_SUCCESS Operation completed successfully Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi ha
312. s Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR DMA ALLOW EN Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR Serial INSTR TCPIP INSTR VXI INSTR VXI MEMACC VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViBoolean VI_TRUE 1 N A Local VI_FALSE 0 Description This attribute specifies whether I O accesses should use DMA VI_TRUE or Programmed I O VI_FALS E In some implementations this attribute may have global effects even though it is documented to be a local attribute Since this affects performance and not functionality that behavior is acceptable Related Items See MEMACC Resource INTFC Resource SERVANT Resource and INSTR Resource of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 3 Attributes VI ATTR EVENT TYPE Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViEventType Oh to FFFFFFFFh N A Description VI ATTR EVENT is the unique logical identifier for the event type of the specified event Rela
313. s and or revisions Related Items Refer to the vr ATTR VI ATTR MODEL NAME descriptions of this chapter Also refer to the INSTR Resource description from Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR MAX QUEUE LENGTH Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Write ViUInt32 1h to FFFFFFFFh 50 Local Description VI ATTR MAX QUEUE LENGTH specifies the maximum number of events that can be queued at any time on the given session Events that occur after the queue has become full will be discarded VI ATTR MAX QUEUE LENGTH is a Read Write attribute until the first time viEnableEvent is called on a session Thereafter this attribute is Read Only Related Items Refer to the vi Enable Event and viWaitOn Event descriptions of Chapter 5 Operations Also refer to the VISA Resource Template description of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 3 Attributes VI ATTR MEM BASE Resource Classes GPIB VXI INSTR
314. s been locked for this kind of access National Instruments Corporation 5 41 NI VISA Programmer Reference Manual Chapter 5 Operations Error Codes Description VI_ERROR_NCIC The interface associated with this session is not currently the controller in charge VI ERROR INV MODE The value specified by the mode parameter is invalid VI ERROR NSUP MOD B The specified mode is not supported by this VISA implementation Description This operation asserts or deasserts the GPIB ATN interface line according to the specified mode The mode can also specify whether the local interface should acquire or release Controller Active status This operation is valid only on GPIB INTFC interface sessions The following table lists valid values for the mode parameter Mode Action Description VI GPIB ATN DEASSERT Deassert ATN line The GPIB interface corresponding to the VISA session goes to standby 5 VI ASSE Assert line and take control synchronously without corrupting transferred data If a data handshake is in progress ATN is not asserted until the handshake is complete VI_GPIB_ATN_DEASSERT_HANDSHAKE Deassert ATN line and enter shadow handshake mode The local board participates in data handshakes as an Acceptor without actually reading the data The GPIB interface corresponding to the VISA sessi
315. s not a valid accessKey to the specified resource VI ERROR TMO Specified lockType could not be obtained within the specified timeout period Description This operation is used to obtain a lock on the specified resource The caller can specify the type of lock requested exclusive or shared lock and the length of time the operation will suspend while waiting to acquire the lock before timing out This operation can also be used for sharing and nesting locks The requestedKey and the accessKey parameters apply only to shared locks These parameters are not applicable when using the lock type VI EXCLUSIVE LOCK in this case requestedKey and accessKey should be set to vi NULL VISA allows user applications to specify a key to be used for lock sharing through the use of the requestedKey parameter Alternatively a user application can pass VI NULL for the requestedKey parameter when obtaining a shared lock in which case VISA will generate a unique access key and return it through the accessKey parameter If a user application does specify a requestedKey value VISA will try to use this value for the accessKey As long as the resource is not locked VISA NI VISA Programmer Reference Manual 5 56 ni com Chapter 5 Operations will use the requestedKey as the access key and grant the lock When the operation succeeds the requestedKey will be copied into the user buffer referred to by the accessKey parame
316. s space that was specified For example if space specifies VI A16 SPACE then offset specifies the offset from the logical address base address of the specified VXI device If space specifies A24 SPACEOr VI A32 SPACE then offset specifies the offset from the base address of the VXI device s memory space allocated by the VXI Resource Manager within VXI A24 or A32 space Notice also that the length specified in the vimovernxx operations for an INSTR Resource is the number of elements of the size corresponding to the operation to transfer beginning at the specified offset Therefore offset length size cannot exceed the amount of memory exported by the device in the given space MEMACC Specific For MEMACC Resource the offset parameter specifies an absolute address Notice also that the length specified in the viMoveInxx operations for a MEMACC Resource is the number of elements of the size corresponding to the operation to transfer beginning at the specified offset Therefore offset length size cannot exceed the total amount of memory available in the given space NI VISA Programmer Reference Manual 5 78 ni com Related Items Chapter 5 Operations Refer to the viMoveOut8 viMoveOut16 viMoveOut32 description of this chapter and the VI ATTR DEST INCR ENT description of Chapter 3 Attributes Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resource
317. sented in a base of sixteen form Only capital letters should represent numbers The number is of form where XXX 18 a hexadecimal number for example HAF3 5B plus Converts to an IEEE 488 2 defined lt OCTAL variants and NUMERIC RESPONSE DATA The number is only represented in a base of eight form The number is of the form QYYY where YYY is an octal number for example 071234 B plus Converts to an IEEE 488 2 defined lt BINARY variants and NUMERIC RESPONSE DATA The number is only represented in a base two form The number is of the form BZZZ where ZZZ is a binary number for example 48011101001 National Instruments Corporation 5 127 Operations NI VISA Programmer Reference Manual Chapter 5 Operations ANSI C Standard Format Codes c Argument type A reference to a character Flags or Modifiers Interpretation Default functionality A character is read from the device and stored in the parameter field width field width number of characters are read and stored at the reference location the default field width is 1 No NULL character is added at the end of the data block 3 Note This format code does not ignore white space in the device input stream d Argument type A reference to an integer Flags or Modifiers Interpretation Default functionality Characters are read from the device until an entire
318. sing a virtual address The following table lists the valid entries for specifying widths Value Description VI_WIDTH_8 1 Performs 8 bit 008 transfers VI_WIDTH_16 2 Performs 16 bit D16 transfers VI_WIDTH_32 4 Performs 32 bit D32 transfers All VXI and PXI accesses performed by the viMove operation use either the same or successive offsets depending on the increment value specified by VI_ATTR_SRC_INCREMENT and VI_ATTR_DEST_INCREMENT If srcSpace is VI LOCAL SPACE viMove ignores VI SRC INCREMENT If destSpace is VI LOCAL SPACE viMove ignores DEST INCREMENT Local accesses always increment the offset for each index in a multi element transfer rather than using the increment specified by the attributes If srcSpace is any value other than VI LOCAL SPACE including VI OPAQUE SPACE viMove honors VI ATTR SRC INCREMENT If destSpace is any value other than LOCAL SPACE including VI OPAQUE SPAC E viMove honors VI ATTR DEST INCREMENT While VI OPAQUE SPACE uses a process local virtual address it is not necessarily pointing to system memory so it may be a FIFO Therefore VI ATTR SRC DEST INCREMENT do indeed apply INSTR Specific If srcSpace is neither VI LOCAL SPACE nor VI OPAQUE SPACE srcOffset is a relative address of the device associate
319. sizes lines of code that are different from the other examples Italic text in this font denotes text that is a placeholder for a word or value that you must supply Related Documentation The following documents contain information that you may find helpful as you read this manual e ANSI IEEE 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 e ANSI IEEE Standard 1014 1987 IEEE Standard for a Versatile Backplane Bus VMEbus e ANSI IEEE Standard 1155 1992 VMEbus Extensions for Instrumentation VXIbus e ANSI ISO Standard 9899 1990 Programming Language e NI 488 2 Function Reference Manual for DOS Windows National Instruments Corporation NI 468 2 User Manual for Windows National Instruments Corporation e NI VXI Help National Instruments Corporation e PXI Specification PCI eXtensions for Instrumentation National Instruments Corporation e VPP 1 Charter Document e VPP2 System Frameworks Specification e VPP 3 1 Instrument Drivers Architecture and Design Specification e VPP 32 Instrument Driver Developers Specification e 3 3 Instrument Driver Function Panel Specification NI VISA Programmer Reference Manual xiv ni com National Instruments Corporation About This Manual VPP 4 3 The VISA Library VPP 4 3 2 VISA Implementation Specification for
320. source INTFC Resource and SERVANT Resource descriptions of Appendix B Resources National Instruments Corporation 3 85 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR RET COUNT Resource Classes VI EVENT IO COMPLETION Attribute Information Description Access Privilege Data Type Range Default Read Only ViUInt32 Oh to FFFFFFFFh N A VI ATTR RET COUNT contains the actual number of elements that were asynchronously transferred Related Items Refertothe VI ATTR STATUS VI ATTR JOB ID and VI ATTR BUFFER descriptions in this chapter Refer to the EVENT IO COMPI Events Also see Appendix B Resources NI VISA Programmer Reference Manual ETION event description of Chapter 4 ni com ATTR RM SESSION Chapter 3 Attributes Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViSession N A N A Local Description VI ATTR RM SESSION specifies the session of the Resource Manager that was used to open this session Related Items Refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual
321. source descriptions of Appendix B Resources NI VISA Programmer Reference Manual ni com VI INTF NUM Chapter 3 Attributes Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE PXI INSTR PXI MEMACC Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI MEMACC VXI BACKPLANE VXI SERVANT Attribute Information Access Privilege Data Type Range Default Read Only ViUInt16 Oh to FFFFh 0 Global Description VI ATTR INTF NUM specifies the board number for the given interface Related Items Refer to the vr ATTR INTF TYPE description of this chapter Also refer to the INSTR Resource MEMACC Resource INTFC Resource BACKPLANE Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR INTF PARENT NUM Resource Classes GPIB VXI INSTR GPIB VXI MEMACC GPIB VXI BACKPLANE Attribute Information Description Access Privilege Data Type Range Default Read Only ViUInt16 Oh to FFFFh 0 Global VI ATTR INTF PARENT NUM specifies the board number of the GPIB board to which the GPIB VXI is attached Related Items Refer to the vr ATTR INTF NUM and VI ATTR INTF TYPE descriptions of this chapter Also refer to the INTFC Resource MEMACC Resource and BACK
322. ssion vi ViUInt16 mask Visual Basic Syntax viFlush amp ByVal vi amp ByVal mask Resource Classes GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session mask IN Specifies the action to be taken with flushing the buffer Refer to the Description section for more information Return Values Completion Codes Description VI_SUCCESS Buffers flushed successfully Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI_ERROR_RSRC_LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR IO Could not perform Read Write operation because of I O error NI VISA Programmer Reference Manual 5 34 ni com Chapter 5 Operations Error Codes Description VI ERROR TMO The Read Write operation was aborted because timeout expired while operation was in progress VI ERROR INV MASK The specified mask does not specify a valid flush operation on Read Write resource Description The value of mask can be one of the following flags Flag Interpretation VI READ BUF 1 Discard the read buffer contents If data was present in the read buffer and no END indicator was pr
323. st be passed by reference Related Items Refer to the viPrintf viScanf and vivQueryf descriptions of this chapter Also refer to the INSTR Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 113 NI VISA Programmer Reference Manual Chapter 5 Operations viRead Purpose Reads data from device or interface synchronously C Syntax ViStatus viRead ViSession vi ViPBuf buf ViUInt32 count ViPUInt32 retCount Visual Basic Syntax viRead amp ByVal vi amp Resource Classes ByVal buf ByVal count amp retCount amp GPIB INSTR GPIB INTFC GPIB SERVANT GPIB VXI INSTR Serial INSTR USB INSTR USB RAW TCPIP INSTR TCPIP SOCKET VXI INSTR VXI SERVANT Parameters Name Direction Description vi IN Unique logical identifier to a session buf OUT Location of a buffer to receive data from device count IN Number of bytes to be read retCount OUT Number of bytes actually transferred NI VISA Programmer Reference Manual 5 114 ni com Return Values Chapter 5 Operations Completion Codes Description VI_SUCCESS The operation completed successfully and the END indicator was received for interfaces that have END indicators This completion code is returned regardless of whether the termination character is received or the number of bytes read is equal to count VI_SUCCESS_TERM_CHAR The specified t
324. t This attribute always has the value of EVENT IO COMPLETION for this event type VI ATTR STATUS Contains the return code of the asynchronous I O operation that has completed VI ATTR JOB ID Contains the job ID of the asynchronous operation that has completed VI ATTR BUFFER Contains the address of the buffer that was used in the asynchronous operation VI ATTR RET COUNT Contains the actual number of elements that were asynchronously transferred VI ATTR OPER NAME Contains the name of the operation generating the event Related Items Refer to the ATTR E V ENT TYPE VI ATTR STATUS VI ATTR JOB ID VI ATTR BUFFER VI ATTR RET COUNT and VI ATTR OPER NAME descriptions of Chapter 3 Attributes Also refer to the INSTR Resource MEMACC Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 4 15 NI VISA Programmer Reference Manual Chapter 4 Events VI EVENT PXI INTR Resource Classes PXI INSTR Description This event notifies that a PXI interrupt has occurred Event Attributes Symbolic Name Description VI ATTR EVENT TYPE Unique logical identifier of the event Related Items Refertothe vr ATTR EVENT TYPE description of Chapter 3 Attributes Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programm
325. tation included with your LabVIEW software Table 1 1 NI VISA Support Programming Language Operating System Environment Framework Windows Me 98 LabWindows CVI ANSI C WIN95 Visual Basic Windows Me 98 LabVIEW GWIN95 Windows 2000 NT XP LabWindows CVI ANSIC WINNT Visual Basic Windows 2000 NT XP LabVIEW GWINNT LabVIEW RT LabVIEW Solaris 2 x LabWindows CVI ANSIC SUN Solaris 2 x LabVIEW GSUN Mac OS X 9 8 ANSI C LabVIEW Linux x86 ANSI C LabVIEW VxWorks x86 ANSI C This framework is supported by NI VISA even though it is not defined by the VXIplug amp play Systems Alliance NI VISA Programmer Reference Manual 1 2 ni com Chapter 1 Introduction The VXIplug amp play Systems Alliance developed the concept of a framework to categorize operating systems programming languages and I O software libraries to bring the most useful products to the most end users A framework is a logical grouping of the choices that you face when designing a VXI system You must always choose an operating system and a programming language along with an application development environment ADE when building a system There are trade offs associated with each of these decisions many configurations are possible The VXIplug amp play Systems Alliance grouped the most popular operating systems programming languages and ADEs into distinct frameworks and defined in depth specifications
326. tatus vilIn8 ViSession vi ViUInt16 space ViBusAddress offset ViPUInt8 val8 ViStatus vilInl6 ViSession vi ViUInt16 space ViBusAddress offset ViPUInt16 116 ViStatus vilIn32 ViSession vi ViUInt16 space ViBusAddress offset ViPUInt32 132 Visual Basic Syntax viln8 amp ByVal vi amp ByVal space ByVal offset amp val8 as Byte viln16 amp ByVal vi amp ByVal space ByVal offset amp 116 viln32 amp ByVal vi amp ByVal space ByVal offset amp val32 amp Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session space IN Specifies the address space Refer to the table included in the Description section for more information offset IN Offset in bytes of the address or register from which to read val8 val16 OUT Data read from bus 8 bits for viIn8 16 bits for or val32 viln16 and 32 bits for virn32 NI VISA Programmer Reference Manual 5 50 ni com Return Values Chapter 5 Operations Completion Codes Description VI_SUCCESS Operation completed successfully Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR_NSUP_OPER The given vi does not support this operation VI ERROR RSRC LOCKI E s Specified operation could not b
327. ted Items Refer to Chapter 4 Events for a list of events National Instruments Corporation 3 33 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR FDC CHNL Resource Classes VXI INSTR Attribute Information Description Access Privilege Data Type Range Default Read Write ViUInt16 0 to 7 N A Local VI ATTR FDC CHNL determines which Fast Data Channel FDC will be used to transfer the buffer Related Items Refertothe vr ATTR FDC MODE and VI ATTR FDC USE PAIR descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com Chapter 3 Attributes VI ATTR FDC MODE Resource Classes VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 VI_FDC_NORMAL 1 VI_FDC_NORMAL Local VI_FDC_STREAM 2 Description VI ATTR FDC MODE specifies which Fast Data Channel FDC mode to use either normal or stream mode Related Items Refer to the ATTR FDC CHNL and VI FDC USE PAIR descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation 3 35 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR FDC USE PAIR Resource Classes VXI INSTR Attribute Information Description Setting VI ATTR FDC USI
328. ter 5 Note If requesting a VI_SHARED_LOCK the size of the accessKey parameter should be at least 256 bytes The session that gained a shared lock can pass the accessKey to other sessions for the purpose of sharing the lock The session wanting to join the group of sessions sharing the lock can use the key as an input value to the requestedKey parameter VISA will add the session to the list of sessions sharing the lock as long as the requestedKey value matches the accessKey value for the particular resource The session obtaining a shared lock in this manner will then have the same access privileges as the original session that obtained the lock It is also possible to obtain nested locks through this operation To acquire nested locks invoke the viLock operation with the same lock type as the previous invocation of this operation For each session viLock and viUnlock share a lock count which is initialized to 0 Each invocation of viLock for the same session and for the same lockType increases the lock count In the case of a shared lock it returns with the same accessKey every time When a session locks the resource a multiple number of times it is necessary to invoke the viUnlock operation an equal number of times in order to unlock the resource That is the lock count increments for each invocation of viLock and decrements for each invocation of viUnlock A resource is actually unlocked only when the lock count is 0
329. ter HHH Sends the ASCII character specified by the octal value xt Sends the ASCII character specified by the hexadecimal value National Instruments Corporation 5 103 NI VISA Programmer Reference Manual Chapter 5 Operations Formatting Character Character Sent to Device X Sends the ASCII double quote character NN Sends a backslash 1 character Format Specifiers The format specifiers convert the next parameter in the sequence according to the modifier and format code after which the formatted data is written to the specified device The format specifier takes the following syntax 7b modifiers format code where format code specifies which data type the argument is represented in Modifiers are optional codes that describe the target data In the following tables a format code refers to all conversion codes of type integer Ca i 0 u x X unless specified as 4 only Similarly an format code refers to all conversion codes of type float G unless specified as only Every conversion command starts with the character and ends with a conversion character format code Between the character and the format code the following modifiers can appear in the sequence NI VISA Programmer Reference Manual 5 104 ni com Chapter 5 Operations ANSI C Standard Modifiers Supported with
330. terrupt On certain bus types the statusID parameter may be ignored The following table lists the valid values for the mode parameter Mode Action Description Use whatever notification method that has been assigned to the local device VI ASSERT USE ASSIGNI E s VI ASSERT SIGNAL Send the notification via a VXI signal VI ASSERT 01 Send the interrupt via the specified VXI VME IRQ VI ASSERT IRQ7 line This uses the standard VXI VME ROAK Release On AcKnowledge interrupt mechanism rather than the older VME RORA Release On Register Access mechanism Related Items Refer to the viAssertUtilSignal description of this chapter and the BACKPLANE Resource and SERVANT Resource descriptions of Appendix B Resources National Instruments Corporation 5 8 NI VISA Programmer Reference Manual Chapter 5 Operations viAssertTrigger Purpose Asserts software or hardware trigger C Syntax ViStatus viAssertTrigger ViSession vi ViUInt16 protocol Visual Basic Syntax viAssertTrigger amp ByVal vi amp ByVal protocol Resource Classes GPIB INSTR GPIB INTFC GPIB VXI INSTR GPIB VXI BACKPLANE PXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR VXI BACKPLANE Parameters Name Direction Description vi IN Unique logical identifier to a session protocol IN Trigger protocol to use during assertion Valid values are
331. the remote machine it may have an incompatible version or may be listening on a different port VI ERROR NPERMISSION Access to the remote machine is denied Description The viOpen operation opens a session to the specified resource It returns a session identifier that can be used to call any other operations of that resource The address string passed to viopen must uniquely identify a resource The following table shows the grammar for the address string Optional string segments are shown in square brackets Interface Syntax VXI INSTR VXI board VXI logical address INSTR VXI MEMACC VXI board MEMACC VXI BACKPLANE VXI board mainframe logical address BACKPLANE VXI SERVANT VXI board SERVANT GPIB VXI INSTR GPIB VXI board VXI logical address INSTR GPIB VXI MEMACC GPIB VXI board MEMACC GPIB VXI GPIB VXI board mainframe logical address BACKPLANE BACKPLANE GPIB INSTR GPIB board l primary address secondary address INSTR GPIB INTFC GPIB board INTFC GPIB SERVANT GPIB board SERVANT PXI INSTR PXI bus device function INSTR PXI INSTR PXI interface l bus device function INSTR PXI MEMACC PXI interface MEMACC Serial INSTR ASRL board INSTR NI VISA Programmer Reference Manual 5 86 ni com Chapter 5 Operations Interface Syntax TC
332. the transfer has completed an I O completion event is posted The operation returns a job identifier that you can use with either viTerminate to abort the operation or with an I O completion event to identify which asynchronous write operation completed VISA will never return NULL for a valid jobId 5 Note If you have enabled VI EVENT IO COMPLETION for queueing VI QUEUE for each successful call to viwriteAsync you must call viwaitOnEvent to retrieve the I O completion event This is true even if the I O is done synchronously that is if the operation returns VI SUCCESS SYNC If you are using LabVIEW this is done for you automatically Related Items Refer to the viEnableEvent viWrite viTerminate viReadAsync and viWaitOnEvent descriptions of this chapter Also refer to the VI EVENT IO COMPLETION description of Chapter 4 Events and the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 179 NI VISA Programmer Reference Manual Chapter 5 Operations viWriteFromFile Purpose Take data from a file and write it out synchronously C Syntax viStatus viWriteFromFile ViSession vi ViString fileName ViUInt32 count ViPUInt32 retCount Visual Basic Syntax viWriteFrom File amp ByVal vi amp ByVal filename ByVal count amp retCount amp Resource Classe
333. this operation VI ERROR INV OFFSET Invalid offset specified VI ERROR WINDOW MAPPED The specified offset is currently in use by viMapAddress NI VISA Programmer Reference Manual 5 66 ni com Chapter 5 Operations Description The viMemFree operation frees the memory previously allocated using viMemAlloc If the specified offset has been mapped using viMapAddress it must be unmapped before it can be freed Related Items Refer to the viMapAddress viMemAlloc and viUnmapAddress descriptions of this chapter Also refer to the NSTR Resource description of Appendix Resources National Instruments Corporation 5 67 NI VISA Programmer Reference Manual Chapter 5 Operations viMove Purpose Moves a block of data C Syntax ViStatus viMove ViSession vi ViUInt16 srcSpace ViBusAddress srcOffset ViUInt16 srcWidth ViUInt16 destSpace ViBusAddress destOffset ViUInt16 destWidth ViBusSize length Visual Basic Syntax viMove amp ByVal vi amp ByVal srcSpace ByVal srcOffset amp ByVal srcWidth ByVal destSpace ByVal destOffset amp ByVal destWidth ByVal length amp Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR VXI INSTR VXI MEMACC Parameters Name Direction Description vi IN Unique logical identifier to a session srcSpace IN Specifies the address space of the source srcOffset IN Offset of the start
334. timeout value is IMMEDIATE the operation is not suspended therefore this value can be used to dequeue events from an event queue When the outContext handle returned from a successful invocation of viwaitOnEvent is no longer needed it should be passed to viclose If a session s event queue becomes full and a new event arrives the new event is discarded The default event queue size per session is 50 which is sufficiently large for most applications If an application expects more than 50 events to arrive without having been handled it can modify the value of the attribute VI ATTR MAX QUEUE LENGTR to the required size NI VISA Programmer Reference Manual 5 174 ni com Chapter 5 Operations The outEventType and outContext parameters are optional and can be VI_NULL This can be used if the event type is known from the inEventType parameter or if the outContext handle is not needed to retrieve additional information If VI_NULL is used for the outContext parameter VISA will automatically close the event context Related Items Refer to viEnableEvent and viClose descriptions of this chapter Refer to the VI ATTR MAX QUEUE LENGTH description of Chapter 3 Attributes See Chapter 4 Events for a list of events that you can wait for Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 175 NI VISA Programmer Referen
335. ting point numbers 64 bits The count corresponds to the number of double floats rather than bytes If the optional o1 modifier is present the data read is assumed to be in little endian format otherwise the data read is assumed to be in standard IEEE 488 2 format The data will be byte swapped and padded as appropriate to native computer format Byte order modifier ob The data being read is assumed to be in standard IEEE 488 2 big endian format This is the default behavior if neither ob nor o1 is present Byte order modifier o1 The data being read is assumed to be in little endian format Other ANSI C Format Specifiers For ANSI C compatibility VISA also supports the following format specifiers for input codes v Mat Sn Vt eto YE gG ers piyi Dx and el For further explanation of these conversion codes see the ANSI C Standard Related Items Refer to the viFlush viPrintf viSScanf viVScanf and vivSScanf descriptions of this chapter and the ATTR RD BUF OPER MODE description of Chapter 3 Attributes Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources and refer to your ANSI C documentation for information on the scanf function National Instruments Corporation 5 133 NI VISA Programmer Reference Manual Chapter 5 Operations viSetAttribute Purpose Sets the st
336. tion returns VI ERROR the write buffer for the specified session is cleared VI NULL is a special value for the retCount parameter If you pass NULL for retCount the number of bytes transferred is not returned You may find this useful if you need to know only whether the operation succeeded or failed Related Items Refer to the viwrite and viBufRead descriptions of this chapter Also refer to the INSTR Resource INTFC Resource SERVANT Resource and SOCKET Resource descriptions of Appendix B Resources National Instruments Corporation 5 13 NI VISA Programmer Reference Manual Chapter 5 Operations viClear Purpose Clears a device C Syntax ViStatus viClear ViSession vi Visual Basic Syntax viClear amp ByVal vi amp Resource Classes GPIB INSTR GPIB VXI INSTR Serial INSTR TCPIP INSTR TCPIP SOCKET USB INSTR USB RAW VXI INSTR Parameters Name Direction Description vi IN Unique logical identifier to a session Return Values Completion Codes Description VI_SUCCESS Operation completed successfully Error Codes Description VI_ERROR_INV_OBJECT The given session reference is invalid VI ERROR NSUP OPER The given vi does not support this operation VI ERROR RSRC LOCKED Specified operation could not be performed because the resource identified by vi has been locked for this kind of access VI ERROR TMO Timeout expired b
337. tions of Appendix Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR MANF ID Resource Classes GPIB VXI INSTR PXI INSTR USB INSTR USB RAW VXI INSTR Attribute Information Description VI ATTR MANF ID is the manufacturer identification number of the device For V XI resources this refers to the VXI Manufacturer ID Access Privilege Data Type Range Default Read Only ViUInt16 Oh to FFFFh N A Global For PXI INSTR resources if the subsystem PCI Vendor ID is nonzero this refers to the subsystem Vendor ID Otherwise this refers to the Vendor ID For USB resources this refers to the Vendor ID VID Related Items Refer to the VI ATTR MODI CODE VI ATTR NAME and VI ATTR PXI TRIG BUS descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources NI VISA Programmer Reference Manual ni com ATTR MANF NAME Chapter 3 Attributes Resource Classes GPIB VXI INSTR PXI INSTR USB INSTR USB RAW VXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViString N A N A Global Description This string attribute is the manufacturer name The value of this attribute should be used for display purposes only and not for programmatic decisions as the value can differ between VISA implementation
338. to 81h to 8Fh N A Local E specifies the endpoint number of the USB interrupt in pipe used by the given session An initial value of 1 signifies that this resource does not have any interrupt in pipes Related Items Refer to the VI ATTR USB BULK IN PIPE VI ATTR USB BULK OUT PIPE VI ATTR USB NUM of Appendix B Resources NI VISA Programmer Reference Manual 3 122 ES descriptions of this chapter and the RAW Resource description ni com Chapter 3 Attributes VI ATTR USB INTR IN STATUS Resource Classes USB RAW Attribute Information Access Privilege Data Type Range Default Read Write ViInti16 VI USB PIPE STATE UNKNOWN 1 N A Local VI USB PIPE READY 0 VI USB PIPE STALLED 1 Description VI ATTR USB INTR IN STATUS specifies whether the USB interrupt in pipe used by the given session is stalled or ready This attribute can be set to only VI USB PIPE READY Related Items Refer to the RAW Resource description of Appendix B Resources National Instruments Corporation 3 123 NI VISA Programmer Reference Manual Chapter 3 Attributes VI ATTR USB MAX INTR SIZE Resource Classes USB INSTR USB RAW Attribute Information Access Privilege Data Type Range Default Read Write ViUInt16 0 to FFFFh N A Local Description VI ATTR USB MAX INTR 5171 E specifies the maximum size of
339. to guarantee interoperability of the components within each framework To claim VXIplug amp play compliance a component must be compliant within a given framework With this version of NI VISA you can perform message based and register based communication with instruments assert triggers share memory and respond to interrupts and triggers For VXI you can also perform register accesses at the interface level and mainframe specific control and monitoring of utility lines For GPIB you also can perform board level commands and the control and monitoring of bus lines NI VISA provides all the I O functionality that you need for your test and measurement application National Instruments Corporation 1 8 NI VISA Programmer Reference Manual Overview of the VISA API This chapter contains an overview of the VISA Application Programming Interface API You can use this manual as a reference to the VISA API This API is partitioned into three distinct mechanisms that access information on a given resource attributes events and operations VISA Access Mechanisms Attributes Events The following sections summarize the most important characteristics of attributes events and operations Please refer to Chapter 3 VISA Overview of the NI VISA User Manual for a more detailed description of this subject An attribute describes a value within a session or resource that reflects a characteristic of the operational state of t
340. to map one trigger line to another This operation is valid only on BACKPLANE mainframe sessions Special Values for trigSrc and trigDest Parameters Value Action Description VI TRIG TTLO Map the specified VXI TTL trigger line VI TRIG TTL7 VI TRIG ECLO Map the specified VXI ECL trigger line VI TRIG ECL1 VI TRIG PANEL IN Map the controller s front panel trigger input line VI TRIG PANEL OUT Map the controller s front panel trigger output line If this operation is called multiple times on the same BACKPLANE Resource with the same source trigger line and different destination trigger lines the result will be that when the source trigger line is asserted all of the specified destination trigger lines will also be asserted If this operation is called multiple times on the same BACKPLANE Resource with different NI VISA Programmer Reference Manual 5 62 ni com Chapter 5 Operations source trigger lines and the same destination trigger line the result will be that when any of the specified source trigger lines are asserted the destination trigger line will also be asserted iyi Note Mapping a trigger line as either source or destination multiple times requires special hardware capabilities and is not guaranteed to be implemented Related Items Refer to the BACKPLANE Resource description of Appendix B Resources National Instruments Corporation 5 63 NI VISA Programmer Referenc
341. turn Values Completion Codes Description VI SUCCI Cy 55 Wait terminated successfully on receipt of an event occurrence The queue is empty VI SUCCESS QUEUE N EMPTY Wait terminated successfully on receipt of an event notification There is still at least one more event occurrence of the type specified by inEventType available for this session Error Codes Description VI ERROR INV OBJECT The given session reference is invalid VI ERROR INV EVENT Specified event type is not supported by the resource VI ERROR TMO Specified event did not occur within the specified time period VI ERROR NENABLI Ei s The session must be enabled for events of the specified type in order to receive them Description The viwaitOnEvent operation suspends the execution of a thread of an application and waits for an event of the type specified by inEventType for a time period specified by timeout You wait only for events that have been enabled with the viEnableEvent operation Refer to individual event descriptions for context definitions If the specified inEventTypeisVI ALL ENABL ED EV ENTS the operation waits for any event that is enabled for the given session If the specified timeout value is INFINITE the operation is suspended indefinitely If the specified
342. uf count jobId viReadSTB vi status viReadToFile vi fileName count retCount viScanf vi readFmt viSetBuf vi mask size viSPrintf vi buf writeFmt viSScanf vi buf readFmt viUnmapAddress vi viUsbControlIn viUsbControlOut viVPrintf vi writeFmt params National Instruments Corporation B 5 NI VISA Programmer Reference Manual Appendix Resources viVQueryf vi writeFmt readFmt params viVScanf vi readFmt params viVSPrintf vi buf writeFmt params vivSScanf vi buf readFmt params viVxiCommandQuery vi mode cmd response viWrite vi buf count retCount viWriteAsync vi buf count jobId viWriteFromFile vi fileName count retCount MEMACC Resource This section lists the attributes events and operations for the MEMACC Resource The attributes events and operations in the VISA Resource Template are available to this resource in addition to the attributes and operations listed below Attributes VI_ATTR_DEST_ACCESS_PRIV VI_ATTR_DEST_BYTE_ORDER VI_ATTR_DEST_INCREMENT VI_ATTR_DMA_ALLOW_EN VI_ATTR_GPIB_PRIMARY_ADDR VI_ATTR_GPIB_SECONDARY_ADDR VI_ATTR_INTF_INST_NAME VI_ATTR_INTF_NUM VI_ATTR_INTF_PARENT_NUM VI_ATTR_INTF_TYPE VI ATTR SRC ACCESS PRIV VI ATTR SRC BYTE ORDER VI ATTR SRC INCREMENT VI ATTR TMO VALUE VI ATTR VXI LA ATTR WIN ACCESS VI ATTR WIN ACCESS PRIV VI ATTR WIN BASE ADDR VI ATTR WIN BYTE ORDER VI ATTR WIN SIZE
343. uments Corporation A 1 NI VISA Programmer Reference Manual Appendix A Status Codes Table A 1 Completion Codes Continued Completion Codes Values Meaning VI_SUCCESS_QUEUE_NEMPTY 3FFFO080h Wait terminated successfully on receipt of an event notification There is still at least one more event occurrence of the requested type s available for this session VI_WARN_NULL_OBJECT 3FFF0082h The specified object reference is uninitialized VI WARN NSUP ATTR STATE 3FFFO084h Although the specified state of the attribute is valid it is not supported by this resource implementation VI WARN UNKNOWN STATUS 3FFF0085h The status code passed to the operation could not be interpreted VI WARN NSUP BUF 3FFF0088h The specified buffer is not supported SUCCESS NCHAIN 3FFF0098h Event handled successfully Do not invoke any other handlers on this session for this event VI SUCCESS NESTED SHARED 3FFF0099h Operation completed successfully and this session has nested shared locks VI SUCCESS NESTED EXCLUSIVE 3FFF009Ah Operation completed successfully and this session has nested exclusive locks VI SUCCESS SYNC 3FFF009Bh Asynchronous operation request was actually performed synchronously VI WARN EXT FUNC NIMPL 3FFF00A9h The operation succeeded but a lower level driver did not implement the extended functionality Table A 2 Error C
344. ute 1s BAR1 VI ATTR PXI MEM TYPE BAR2 VI VL ATTR MEM TYPE BARA VI VI ATTR PXI VI ATTR PXI MEM SIZE BARO VI MEM SIZE BAR2 VI VI ATTR PXI EM SIZE BARA VI M ATTR PXI MEM TYPE BAR3 ATTR PXI MEM BAR5 ATTR PXI MEM SIZ BAR1 A TTR PXI SIZ BAR3 ATTR PXI MEM 5171 Hw Bl E BAR5 descriptions of this chapter Also refer to the INSTR Resource description of Appendix B Resources National Instruments Corporation NI VISA Programmer Reference Manual Chapter 3 Attributes VI PXI MEM SIZE BARO VI PXI MEM SIZE BAR1 VI ATTR PXI MEM SIZE BAR2 VI ATTR PXI MEM SIZE BAR3 VI ATTR PXI MEM SIZE BARA VI PXI MEM SIZE BAR5 Resource Classes PXI INSTR Attribute Information Access Privilege Data Type Range Default Read Only ViUInt32 0 to FFFFFFFFh N A Global Description Memory size used by the device in the specified BAR If the value of the corresponding VI ATTR MEM TYPE BARxis VI PXI ADDR NONI meaningless for the given PXI device Related Items Refer to the VI ATTR PXI ATTR PXI MEM TYPE BARO VI ATTR PXI E the value of this attribute is MEM TYPE 1 MEM TYPE BAR2 VI VI ATTR PXI MEM TYPE BARA VI VI ATTR PXI VI ATTR PXI MEM BASE BAR2 VI VI ATTR
345. value or both does not match any installed handler VI_ERROR_HNDLR_NINSTALLED A handler is not currently installed for the specified event Description The viUninstallHandler operation allows applications to uninstall handlers for events on sessions Applications should also specify the value in the userHandle parameter that was passed while installing the handler VISA identifies handlers uniquely using the handler reference and this value the handlers for which the handler reference and the value matches are uninstalled Specifying vr ANY HNDLR as the value for the handler parameter causes the operation to uninstall all the handlers with the matching value in the userHandle parameter 3 Note Calling viUninstallHandler removes the specified handler from the list of active handlers on the given session If no handlers remain for the specified event type the VISA driver disables that event type on the given session It is not valid for a user to call this operation from within a callback because this may cause a deadlock condition within the VISA driver Related Items Refer to viInstallHandler and viDisableEvent descriptions of this chapter and viEventHandler description for its parameter description Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 5 147 NI VISA Programmer Reference Manual Chapter 5 Operations viUnlock
346. vel access operations such as viMapAddress viPeekXX and when accessing the mapped window This attribute is Read Write when the corresponding session is not mapped that is when VI ATTR WIN ACCESS is NMAPP Read Only Related Items Refer to the VI ATTR DEST ED When the session is mapped this attribute is E ORDER VI ATTR SRC BYTE ORDER VI ATTR WIN ACCESS VI ATTR WIN ACCI ESS PRIV VI ATTR WIN BASE ADDR and VI ATTR WIN SIZE descriptions of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Resources NI VISA Programmer Reference Manual 3 142 ni com VI ATTR WIN SIZE Chapter 3 Attributes Resource Classes GPIB VXI INSTR GPIB VXI MEMACC PXI INSTR PXI MEMACC VXI INSTR VXI MEMACC Attribute Information Access Privilege Data Type Range Default Read Only ViBusSize Oh to FFFFFFFFh N A Local Description VI ATTR WIN SIZI VI ATTR WIN ACCESS is NMAPPI Related Items E specifies the size of the region mapped to this window If the value of ED the value of this attribute is meaningless Refer to the ATTR WIN ACCESS VI ATTR WIN ACCESS PRIV VI ATTR WIN BASI E ADDR and VI ATTR WIN BYTE ORDER descriptions of this chapter Also refer to the INSTR Resource and MEMACC Resource descriptions of Appendix B Res
347. vice side resource for GPIB interface 1 VXIO SERVANT Servant device side resource for VXI interface 0 NI VISA Programmer Reference Manual 3 94 ni com Chapter 3 Attributes Address String Description PXI 15 INSTR PXI device number 15 on bus 0 with implied function 0 PXIO0 2 12 1 INSTR PXI bus number 2 device 12 with function 1 PXIO MEMACC PXI MEMACC session 0 1 2 3 4 999 SOCKET Raw access to port 999 at the specified IP address TCPIP dev company com INSTR A TCP IP device using VXI 11 located at the specified address This uses the default LAN Device Name of inst0 USB 0x1234 125 A22 5 INSTR A USB Test amp Measurement class device with manufacturer ID 0x 1234 model code 125 and serial number A22 5 This uses the device s first available USBTMC interface This is usually number 0 USB 0x5678 0x33 SN999 1 RAW A raw USB nonclass device with manufacturer ID 0x5678 model code 0x33 and serial number SN999 This uses the device s interface number 1 visa hostname ASRL1 INSTR The resource ASRL1 INSTR on the specified remote system Related Items Refer to the viFindRsrc viParseRsrc and viOpen descriptions of Chapter 5 Operations Also refer to the VISA Resource Template description of Appendix B Resources National Instruments Corporation 3 95 NI VI

Download Pdf Manuals

image

Related Search

Related Contents

  HandHeld Entertainment 4800p Scanner User Manual  code sante pubilq liv 3 titre 1-2-1 R4312-1 à R4312-32  Xerox WorkCentre 3045  Real-Time Graphics Tools for .Net Class Summary  MULTISTIX 10 SG SIEMENSiQ 200CLINITEK ATLAS Ok pdf  APart MA200 AV receiver    Témoignage par Hugues Granier, responsable de la  Bedienungsanleitung Klimalogger PCE  

Copyright © All rights reserved.
Failed to retrieve file