In a VISA system, a vi that receives the viClose() operation SHALL attempt to close the given vi and free all related data structures. RULE 3.3.2 IF the value VI_NULL is passed to the viClose() operation, THEN a VISA system SHALL return the completion code VI_WARN_NULL_OBJECT.
Description The viGetAttribute() operation is used to retrieve the state of an attribute for the specified session, event, or find list. Related Items See viSetAttribute(). Implementation Requirements RULE 3.4.1 IF attribute is a string attribute, THEN viGetAttribute SHALL write no more than 256 characters into attrState, including the null character. OBSERVATION 3.4.1 RULE 3.4.1 states the maximum length of a VISA string attribute to be 255 characters. 3.4.1.2 viSetAttribute(vi, attribute, attrState) Purpose Set the state of an attribute. Parameters Name Direction Type Description vi IN ViSession ViEvent ViFindList Unique logical identifier to a session, event, or find list. attribute IN ViAttr Session, event, or find list attribute for which the state is modified. attrState IN ViAttrState The state of the attribute to be set for the specified resource. The interpretation of the individual attribute value is defined by the resource. Return Values Type ViStatus This is the operational return status. It returns either a completion code or an error code as follows. 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. Error Codes Description VI_ERROR_INV_SESSION VI_ERROR_INV_OBJECT The given session or object reference is invalid (both are the same value).
Error Codes Description VI_ERROR_INV_SESSION VI_ERROR_INV_OBJECT The given session or object reference is invalid (both are the same value). VI_ERROR_INV_JOB_ID Specified job identifier is invalid. VI_ERROR_INV_DEGREE Specified degree is invalid. Description This operation requests 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(), a VISA implementation should 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 viReadAsync(), viWriteAsync(), viMoveAsync(). Implementation Requirements There are no additional implementation requirements other than those specified above.
Special Characters and Operators Meaning ? Matches any one character. \ Makes the character that follows it an ordinary character instead of special character. For example, when a question mark follows a backslash (i.e. '\?'), it matches the '?' character instead of any one character. [list] Matches any one character from the enclosed list. A hyphen can be used to match a range of characters. [^list] Matches any character not in the enclosed list. A hyphen can be used to match a range of characters. * Matches 0 or more occurrences of the preceding character or expression. + Matches 1 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, VXI|GPIB means (VXI)|(GPIB), not VXI(I|G)PIB. (exp) Grouping characters or expressions. RULE 4.4.1 The grouping operator () in a regular expression SHALL have the highest precedence. RULE 4.4.2 The + and * operators in a regular expression SHALL have the next highest precedence after the grouping operator. RULE 4.4.3 The or operator | in a regular expression SHALL have the lowest precedence. Table 4.4.4 Examples Regular Expression Sample Matches GPIB?*INSTR Matches GPIB0::2::INSTR, GPIB1::1::1::INSTR, and GPIB-VXI1::8::INSTR. GPIB[0-9]*::?*INSTR Matches GPIB0::2::INSTR and GPIB1::1::1::INSTR but not GPIB-VXI1::8::INSTR. GPIB[0-9]::?*INSTR Matches GPIB0::2::INSTR and GPIB1::1::1::INSTR but not GPIB12::8::INSTR. Table 4.4.4 Examples (continued) Regular Expression Sample Matches
5.2.3 MEMACC Resource Events This resource defines the following event for communication with applications. VI_EVENT_IO_COMPLETION Description Notification that an asynchronous operation has completed. Event Attributes Symbolic Name Access Privilege Data Type Range VI_ATTR_EVENT_TYPE RO ViEventType VI_EVENT_IO_COMPLETION VI_ATTR_STATUS RO ViStatus N/A VI_ATTR_JOB_ID RO ViJobId N/A VI_ATTR_BUFFER RO ViBuf N/A VI_ATTR_RET_COUNT RO ViBusSize * VI_ATTR_OPER_NAME RO ViString N/A VI_ATTR_RET_COUNT_32 RO ViUInt32 0 to FFFFFFFFh VI_ATTR_RET_COUNT_64** RO ViUInt64 0 to FFFFFFFFFFFFFFFFh * The data type is defined in the appropriate VPP 4.3.x framework specification. ** Defined only for frameworks that are 64-bit native. Event Attribute Descriptions VI_ATTR_EVENT_TYPE Unique logical identifier of the event. VI_ATTR_STATUS This field contains the return code of the asynchronous I/O operation that has completed. VI_ATTR_JOB_ID This field contains the job ID of the asynchronous operation that has completed. VI_ATTR_BUFFER This field contains the address of a buffer that was used in an asynchronous operation. VI_ATTR_RET_COUNT This field contains the actual number of elements that were VI_ATTR_RET_COUNT_32 asynchronously transferred. VI_ATTR_RET_COUNT_64 VI_ATTR_OPER_NAME The name of the operation generating the event. For more information on VI_ATTR_OPER_NAME, see its definition in Section 3.7.2.3, VI_EVENT_EXCEPTION. RULE 5.2.6 All MEMACC resource implementations SHALL support the generation of the events VI_EVENT_IO_COMPLETION and VI_EVENT_EXCEPTION.
RULE 5.2.8 A MEMACC resource implementation for a PXI system SHALL support the operations viMemAlloc(), viMemFree(), viMemAllocEx(), and viMemFreeEx().
Event Attribute Symbolic Name Access Privilege Data Type Range VI_ATTR_EVENT_TYPE RO ViEventType VI_EVENT_CLEAR Event Attribute Description VI_ATTR_EVENT_TYPE Unique logical identifier of the event. VI_EVENT_TRIG Description Notification that a trigger interrupt was received from the interface. Event Attributes Symbolic Name Access Privilege Data Type Range VI_ATTR_EVENT_TYPE RO ViEventType VI_EVENT_TRIG VI_ATTR_RECV_TRIG_ID RO ViInt16 VI_TRIG_SW Event Attribute Descriptions VI_ATTR_EVENT_TYPE Unique logical identifier of the event. VI_ATTR_RECV_TRIG_ID The identifier of the triggering mechanism on which the specified trigger event was received. VI_EVENT_IO_COMPLETION Description Notification that an asynchronous operation has completed. Event Attributes Symbolic Name Access Privilege Data Type Range VI_ATTR_EVENT_TYPE RO ViEventType VI_EVENT_IO_COMPLETION VI_ATTR_STATUS RO ViStatus N/A VI_ATTR_JOB_ID RO ViJobId N/A VI_ATTR_BUFFER RO ViBuf N/A VI_ATTR_RET_COUNT RO ViBusSize * VI_ATTR_OPER_NAME RO ViString N/A VI_ATTR_RET_COUNT_32 RO ViUInt32 0 to FFFFFFFFh VI_ATTR_RET_COUNT_64** RO ViUInt64 0 to FFFFFFFFFFFFFFFFh * The data type is defined in the appropriate VPP 4.3.x framework specification. ** Defined only for frameworks that are 64-bit native.
VI_EVENT_VXI_VME_SYSRESET Description Notification that the VXI/VME SYSRESET* line has been asserted. Event Attribute Symbolic Name Access Privilege Data Type Range VI_ATTR_EVENT_TYPE RO ViEventType VI_EVENT_VXI_VME_SYSRESET Event Attribute Description VI_ATTR_EVENT_TYPE Unique logical identifier of the event. VI_EVENT_TCPIP_CONNECT Description Notification that a TCP/IP connection has been made. Event Attribute Symbolic Name Access Privilege Data Type Range VI_ATTR_EVENT_TYPE RO ViEventType VI_EVENT_TCPIP_CONNECT VI_ATTR_RECV_TCPIP_ADDR RO ViString N/A Event Attribute Description VI_ATTR_EVENT_TYPE Unique logical identifier of the event. VI_ATTR_RECV_TCPIP_ADDR This is the TCP/IP address of the device from which the session received a connection. RULE 5.5.5 All SERVANT resource implementations SHALL support the events VI_EVENT_IO_COMPLETION, VI_EVENT_TRIG, and VI_EVENT_CLEAR. RULE 5.5.6 A SERVANT resource implementation for a GPIB system SHALL support the events VI_EVENT_GPIB_TALK and VI_EVENT_GPIB_LISTEN. RULE 5.5.7 A SERVANT resource implementation for a VXI system SHALL support the event VI_EVENT_VXI_VME_SYSRESET. RULE 5.5.8 A SERVANT resource implementation for a TCPIP system SHALL support the event VI_EVENT_TCPIP_CONNECT.
Read data from device asynchronously. Parameters Name Direction Type Description vi IN ViSession Unique logical identifier to a session. buf OUT ViBuf Represents the location of a buffer to receive data from device. count IN ViUInt32 Number of bytes to be read. jobId OUT ViJobId Represents the location of a variable that will be set to the job identifier of this asynchronous read operation. Return Values Type ViStatus This is the operational return status. It returns either a completion code or an error code as follows. Completion Codes Description VI_SUCCESS Asynchronous read operation successfully queued. VI_SUCCESS_SYNC Read operation performed synchronously. Error Codes Description VI_ERROR_INV_SESSION VI_ERROR_INV_OBJECT The given session or object reference is invalid (both are the same value). 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 start a new asynchronous operation while another asynchronous operation is in progress. Description The asynchronous read 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. An I/O Completion event will be posted when the transfer is actually completed. The operation returns jobId, which you can use with either viTerminate() to abort the operation or with an I/O Completion event to identify which asynchronous read operation completed. Table 6.1.2 Special Values for jobId Parameter Value Action Description VI_NULL Do not return a job identifier. Related Items
jobId OUT ViJobId Represents the location of a variable that will be set to the job identifier of this asynchronous write operation. Return Values Type ViStatus This is the operational return status. It returns either a completion code or an error code as follows. Completion Codes Description VI_SUCCESS Asynchronous write operation successfully queued. VI_SUCCESS_SYNC Write operation performed synchronously. Error Codes Description VI_ERROR_INV_SESSION VI_ERROR_INV_OBJECT The given session or object reference is invalid (both are the same value). 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 start a new asynchronous operation while another asynchronous operation is in progress. Description The write operation asynchronously transfers data. The data to be written is in the buffer represented by buf. This operation normally returns before the transfer terminates. An I/O Completion event will be posted when the transfer is actually completed. The operation returns jobId, which you can use with either viTerminate() to abort the operation or with an I/O Completion event to identify which asynchronous write operation completed. Table 6.1.5 Special Values for jobId Parameter Value Action Description VI_NULL Do not return a job identifier. Related Items See the INSTR resource description. Also see viRead(), viTerminate(), viReadAsync(), and viWrite(). Implementation Requirements RULE 6.1.16 IF the output parameter jobId is not VI_NULL, THEN the value in jobId SHALL be valid before viWriteAsync() begins the data transfer. OBSERVATION 6.1.14
For GPIB, ASRL, USB, and VXI software triggers, VI_TRIG_PROT_DEFAULT is the only valid protocol. For VXI hardware triggers, VI_TRIG_PROT_DEFAULT is equivalent to VI_TRIG_PROT_SYNC. For a PXI resource, viAssertTrigger() will reserve a trigger line for assertion, or release such a reservation. Instrument drivers should use viAssertTrigger() to ensure that they have ownership of a trigger line before performing any operation that could drive a signal onto that trigger line. The protocol parameter can be either VI_TRIG_PROT_RESERVE or VI_TRIG_PROT_UNRESERVE, which reserve a trigger line and release the reservation, respectively. Related Items See the INSTR resource description. Implementation Requirements RULE 6.1.23 For compatibility with earlier versions of this specification, VI_TRIG_PROT_DEFAULT SHALL be equal to VI_NULL. RULE 6.1.24 IF the attribute VI_ATTR_IO_PROT is set to VI_PROT_NORMAL for a session to an ASRL INSTR or TCPIP SOCKET resource, THEN the operation viAssertTrigger() SHALL return VI_ERROR_INV_SETUP. RULE 6.1.25 An INSTR resource implementation of viAssertTrigger() for a USB System SHALL return the error VI_ERROR_INV_SETUP for a USBTMC base-class (non-488) device. RULE 6.1.26 An INSTR resource implementation of viAssertTrigger() for a USB System SHALL return the error VI_ERROR_INV_SETUP for a USBTMC 488-class device that does not implement the optional trigger message ID. 6.1.8 viReadSTB(vi, status) Purpose Read a status byte of the service request. Parameters Name Direction Type Description vi IN ViSession Unique logical identifier to the session. status OUT ViUInt16 Service request status byte. Return Values Type ViStatus This is the operational return status. It returns either a completion code or an error code as follows. Completion Code Description VI_SUCCESS Operation completed successfully. Error Codes Description
IF the offset parameter specifies a valid address that was previously allocated using the viMemAlloc() or viMemAllocEx() operation, AND it has not already been freed, THEN the viMemFree() or viMemFreeEx() operation SHALL return the corresponding buffer to the device’s memory pool. OBSERVATION 6.4.3 No device is required to have memory that can be shared or managed by the local controller. In this case, a VISA implementation may always return VI_ERROR_NSUP_OPER. RULE 6.4.3 IF the offset is currently mapped through the viMapAddress() or viMapAddressEx() operation on the given vi, THEN the viMemFree() or viMemFreeEx() operation SHALL return VI_ERROR_WINDOW_MAPPED.
VI_ATTR_PXI_SLOTPATH N/A N/A VI_ATTR_PXI_SLOT_LBUS_LEFT 0 to 32767 VI_UNKNOWN_SLOT N/A VI_ATTR_PXI_SLOT_LBUS_RIGHT 0 to 32767 VI_UNKNOWN_SLOT N/A VI_ATTR_PXI_TRIG_BUS 0 to 32767 VI_UNKNOWN_TRIG N/A VI_ATTR_PXI_STAR_TRIG_BUS 0 to 32767 VI_UNKNOWN_TRIG N/A VI_ATTR_PXI_STAR_TRIG_LINE 0 to 32767 VI_UNKNOWN_TRIG N/A VI_ATTR_PXI_MEM_TYPE_BARn (where n is 0,1,2,3,4,5) VI_PXI_ADDR_MEM, VI_PXI_ADDR_IO, VI_PXI_ADDR_NONE N/A VI_ATTR_PXI_MEM_BASE_BARn _32 VI_ATTR_PXI_MEM_BASE_BARn _64 (where n is 0,1,2,3,4,5) N/A N/A VI_ATTR_PXI_MEM_SIZE_BARn _32 VI_ATTR_PXI_MEM_SIZE_BARn _64 (where n is 0,1,2,3,4,5) N/A N/A MEMACC Resource Attributes (Generic) Symbolic Name Range Default VI_ATTR_INTF_NUM 0 to FFFFh 0 VI_ATTR_INTF_TYPE VI_INTF_VXI VI_INTF_GPIB_VXI N/A VI_ATTR_INTF_INST_NAME N/A N/A VI_ATTR_TMO_VALUE VI_TMO_IMMEDIATE 1 to FFFFFFFEh VI_TMO_INFINITE 2000 VI_ATTR_DMA_ALLOW_EN VI_TRUE VI_FALSE N/A MEMACC Resource Attributes (VXI, GPIB-VXI, and PXI Specific)
VI_ATTR_GPIB_CIC_STATE VI_TRUE VI_FALSE N/A VI_ATTR_GPIB_SYS_CNTRL_STATE VI_TRUE VI_FALSE N/A VI_ATTR_GPIB_HS488_CBL_LEN 1 to 15 VI_GPIB_HS488_DISABLED VI_GPIB_HS488_NIMPL N/A BACKPLANE Resource Attributes (Generic) Symbolic Name Range Default VI_ATTR_INTF_NUM 0 to FFFFh 0 VI_ATTR_INTF_TYPE VI_INTF_VXI VI_INTF_GPIB_VXI N/A VI_ATTR_INTF_INST_NAME N/A N/A VI_ATTR_TMO_VALUE VI_TMO_IMMEDIATE 1 to FFFFFFFEh VI_TMO_INFINITE 2000 BACKPLANE Resource Attributes (VXI and GPIB-VXI Specific) Symbolic Name Range Default VI_ATTR_TRIG_ID VI_TRIG_SW; VI_TRIG_TTL0 to VI_TRIG_TTL7; VI_TRIG_ECL0 to VI_TRIG_ECL5; VI_TRIG_STAR_SLOT1 to VI_TRIG_STAR_SLOT12; VI_TRIG_STAR_VXI0 to VI_TRIG_STAR_VXI2; VI_TRIG_PANEL_IN; VI_TRIG_PANEL_OUT N/A VI_ATTR_MAINFRAME_LA 0 to 255 VI_UNKNOWN_LA N/A VI_ATTR_VXI_VME_SYSFAIL_STATE VI_STATE_ASSERTED VI_STATE_UNASSERTED VI_STATE_UNKNOWN N/A VI_ATTR_VXI_VME_INTR_STATUS N/A N/A VI_ATTR_VXI_TRIG_STATUS N/A N/A VI_ATTR_VXI_TRIG_SUPPORT N/A N/A SERVANT Resource Attributes (Generic) Symbolic Name Range Default VI_ATTR_INTF_NUM 0 to FFFFh 0