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&(ByVal sesn&, ByVal rsrcName$, intfType%, intfNum%)
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. |
Return Values
Completion Codes | Description |
---|---|
VI_SUCCESS |
Resource string is valid. |
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().
Calling viParseRsrc() with "VXI::1::INSTR" will produce the same results as invoking it with "vxi::1::instr".
Related Topics