viOpenDefaultRM

Syntax

viOpenDefaultRM(ViPSession sesn);

Description

This function returns a session to the Default Resource Manager resource. This function must be called before any VISA functions can be invoked. The first call to this function initializes the VISA system, including the Default Resource Manager resource, and also returns a session to that resource. Subsequent calls to this function return unique sessions to the same Default Resource Manager resource.

Parameters

Name

Dir

Type

Description

sesn

OUT

ViPSession

Unique logical identifier to a Default Resource Manager session.

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

Session to the Default Resource Manager resource created successfully.

Error Code

Description

VI_ERROR_ALLOC

Insufficient system resources to create a session to the Default Resource Manager resource.

VI_ERROR_INV_SETUP

Some implementation-specific configuration file is corrupt or does not exist.

VI_ERROR_SYSTEM_ERROR

The VISA system failed to initialize.

C# Example

public int OpenRM() { int resourceManager, viError; viError = visa32.viOpenDefaultRM(out resourceManager); if (viError < visa32.VI_SUCCESS) throw new ApplicationException( "Failed to open Resource Manager"); return resourceManager; }

VB .NET Example

Public Function OpenRM() As Integer    Dim resourceManager As Integer = 0, viError As Integer    viError = visa32.viOpenDefaultRM(resourceManager)    If viError < visa32.VI_SUCCESS Then        Throw New ApplicationException("Failed to open Resource Manager")    End If    Return resourceManager End Function

 

See Also

viOpen, viFindRsrc, viClose