GetInfoFromResourceName

IVI Library

Ivi_GetInfoFromResourceName

Usage

ViStatus Ivi_GetInfoFromResourceName(ViRsrc resourceName, ViString optionString, ViChar newResourceName[ ], ViChar newOptionString[ ], ViBoolean* isLogicalName);

Purpose

This function returns the appropriate resource name and option string that Ivi_SpecificDriverNew function uses to create a new IVI session. The Resource Name can be an actual resource descriptor or a logical name or driver session name that the user configures with the IVI Configuration utility.

If the string that the user passes in the Resource Name parameter is an actual resource descriptor, this function returns the original resource descriptor and option string in the New Resource Name and New Option String parameters and returns VI_FALSE in the Is Logical Name parameter.

If the string that the user passes in the Resource Name parameter is a logical name or driver session name, this function returns strings in the New Resource Name and New Option String parameters based on the settings of the logical name or virtual instrument in the IVI Configuration utility. The function return VI_TRUE in the Is Logical Name parameter.

Example:

Ivi_GetInfoFromResourceName ("GPIB0::2::INSTR",

"Simulate=1",newRsrcString, newOptionString,
&isLogicalName);

newRsrcString and newOptionString contain the same values you pass to the function, and isLogicalName is VI_FALSE.

Ivi_GetInfoFromResourceName ("SampleDMM", "",

newRsrcString, newOptionString,
&isLogicalName);

newRsrcString and newOptionString now contain the resource descriptor from the IVI configuration and the option that tells the engine through the Ivi_SpecificDriverNew function that the initial session setup comes from the IVI configuration. isLogicalName is VI_TRUE.

Parameters

Name Type Description
resourceName ViRsrc

This parameter specifies the resource name of the specific instrument.

The user can either pass an actual resource descriptor, such as "GPIB0::2::INSTR", or a logical name or driver session name that they configure with the IVI Configuration utility, such as "SampleDMM" or "MyFluke45."

optionString ViString

This parameter is the option string that the user passes to the InitWithOptions function of the instrument driver.

newResourceName ViChar[ ]

If the string that the user passes for the Resource Name parameter is an actual resource descriptor, this function returns the original value of the Resource Name parameter in this parameter.

If the string that the user passes for the Resource Name parameter is a logical name or driver session name, then this parameter contains a resource descriptor that identifies the physical device based on the configuration of the logical name or virtual instrument in the IVI Configuration utility.

newOptionString ViChar[ ]

If the string that the user passes for the Resource Name parameter is an actual resource descriptor, this function returns the original value of the Option String parameter in this parameter.

If the string that the user passes for the Resource Name parameter is a logical name or driver session name, then this parameter returns a new option string. The new option string identifies the logical name or virtual instrument that the Ivi_SpecificDriverNew function uses to configure the initial configuration of the new IVI session.

isLogicalName ViBoolean*

Returns VI_FALSE if the user passes an actual resource name for the Resource Name parameter.

Returns VI_TRUE if the user passes a logical name or driver session name for the Resource Name parameter.

Return Value

Contains the status code that the function call returns. IVI engine functions can return error and warning values from several sets of status codes. Some status codes are unique to the IVI engine. Other status codes are the same codes that VISA Library functions return. Still others are error or warning values that functions in specific instrument drivers return. Each set of status codes has its own numeric range.

Regardless of the source of the status code, 0 always indicates success, a positive value indicates a warning, and a negative value indicates an error.

Related Topic

IVI Status Codes