Directory.OpenVariable Method

This method opens a variable.

Namespace:  IntervalZero.MaxRT.Libraries.VariableDatabase
Assembly:  IntervalZero.MaxRT.Libraries (in IntervalZero.MaxRT.Libraries.dll) Version: 1.0.0.0 (File version: 1.0.1)

Syntax

Copy
public Variable OpenVariable(
    VariableDescription variable
)

Parameters

variable

Type: VariableDescription
The variable description to open.

Return Value

Type: Variable
The class that controls the variable.

InvalidOperationException is thrown when the directory is not open.

ArgumentNullException is thrown when parameter variable is null.

MaxRTNativeException is thrown when these errors occur:

Error code Meaning

ERROR_INVALID_PARAMETER

variable.Name is empty or exceeds 63 characters in length.

ERROR_NOT_FOUND

There is no variable with this name in the parent directory.

ERROR_ABANDONED_WAIT_0

Failed to acquire the synchronization lock.

ERROR_NOT_ENOUGH_MEMORY

Failed to allocate memory.

ERROR_UNSUPPORTED_TYPE

One of the following conditions occurred:

  • variable.Type is below VarBuffer or above VarDouble.
  • variable.Type does not match the type given to the variable when it was created.

See Also: