viParseRsrc

Agilent VISA.NET

viParseRsrc

Syntax

viParseRsrc(ViSession sesn, ViRsrc rsrcName, VIPUInt16 intfType, VIPUInt16 intfNum);

Description

Parse a resource string to get the interface information. 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.

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.

If a VISA implementation recognizes aliases in viOpen, it also recognizes those same aliases in viParseRsrc. Agilent VISA recognizes aliases created with the Agilent Connection Expert utility.

Calling viParseRsrc with "VXI::1::INSTR" will produce the same results as invoking it with "vxi::1::instr".

Note: A VISA implementation should not perform any I/O to the specified resource during this operation. The recommended implementation of viParseRsrc will return information determined solely from the resource string and any static configuration information (e.g., .INI files or the Registry).

Parameters

Name

Dir

Type

Description

sesn

IN

ViSession

Resource Manager session (should always be the Default Resource Manager for VISA returned from viOpenDefaultRM).

rsrcName

IN

ViRsrc

Unique symbolic name  (VISA address or VISA alias) of a resource.

intfType

OUT

VIPUInt16

Interface type of the given resource string.

intfNum

OUT

VIPUInt16

Board number of the interface of the given resource string.

Return Values

Type ViStatus

This is the function return status. It returns either a completion code or an error code as follows.

Completion Code

Description

VI_SUCCESS

Resource string is valid.

Error Codes

Description

VI_ERROR_ALLOC

Insufficient system resources to parse the string.

VI_ERROR_INTF_NUM_NCONFIG

The interface type is valid but the specified interface number is not configured.

VI_ERROR_INV_RSRC_NAME

Invalid resource reference specified. Parsing error.

VI_ERROR_INV_SESSION
VI_ERROR_INV_OBJECT

The given session or object reference is invalid (both are the same value).

VI_ERROR_LIBRARY_NFOUND

A code library required by VISA could not be located or loaded.

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_RSRC_NFOUND

Insufficient location information or resource not present in the system.

See Also

viFindRsrc, viOpen, viParseRsrcEx