viParseRsrcEx
Syntax
viParseRsrcEx(ViSession sesn, ViRsrc rsrcName, VIPUInt16 intfType, VIPUInt16 intfNum, ViString rsrcClass, ViString unaliasedExpandedRsrcName, ViString aliasIfExists)
Description
This function parses a resource string to get extended interface information. 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 VISA address (resource descriptor) would use without actually opening a session to it.
The values returned in intfType, intfNum, and rsrcClass correspond to the attributes VI_ATTR_INTF_TYPE, VI_ATTR_INTF_NUM, and VI_ATTR_RSRC_CLASS. 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 are, in most cases, 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. If a VISA implementation does not implement aliases, the return value must be an empty string. If a VISA implementation allows multiple aliases for a single resource, then the implementation must pick one alias (in an implementation-defined manner) and return it in this parameter. Keysight VISA recognizes aliases defined in the Keysight Connection Expert utility; if you define multiple aliases for a single resource, aliasIfExists will return the first alias found in the Windows registry. (This ordering is not deterministic; you should write your code to expect aliasIfExists to return any alias in this situation.)
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 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. |
rsrcClass |
OUT |
ViString |
Specifies the resource class (for example, “INSTR”) of the given resource string, as defined in VISA Resource Classes. |
unaliasedExpandedRsrcName |
OUT |
ViString |
This is the expanded version of the given resource string. The format should be similar to the VISA-defined canonical resource name. |
aliasIfExists |
OUT |
ViString |
Specifies the user-defined alias for the given resource string, if a VISA implementation allows aliases and an alias exists for the given resource string. |
Special Value for aliasIfExists Parameter |
|||
Value |
|
|
Action Description |
VI_NULL |
|
|
Do not return the alias. |
Special Value for unaliasedExpandedRsrcName Parameter |
|||
VI_NULL |
|
|
Do not return the full resource name. |
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. |
VI_WARN_EXT_FUNC_NIMPL |
The operation succeeded, but a lower level driver did not implement the extended functionality. |
Error Code |
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 |
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. |