viParseRsrcEx

NI-VISA

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[]);

Visual Basic Syntax

viParseRsrcEx& (ByVal sesn&, ByVal desc$, intfType%, intfNum%, ByVal rsrcClass$, ByVal expandedUnaliasedName$, ByVal aliasIfExists$)

Resource Classes

VISA Resource Manager

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

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
UnaliasedName

OUT

This is the expanded version of the given resource string. The format should be similar to the VISA-defined canonical resource name.

AliasIfExists

OUT

Specifies the user-defined alias for the given resource string.

Return Values

Completion Codes Description

VI_SUCCESS

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_NAME

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 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. Refer to VISA Resource Syntax and Examples for the syntax of resource strings and examples.

The values returned in intfType 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().

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 Topics

VI_ATTR_INTF_NUM

VI_ATTR_INTF_TYPE

viFindRsrc

viOpen

viParseRsrc

VISA Resource Template