ISerial::Init

Description

Opens the resource. This is the first method on IVisaSession or any of its derived interfaces to be called. In general, you will not call this method because you will use the Resource Manager to create resources.

See VISA Resource Strings for more information on the format of the address string parameter and The Option String for more information on the format of the option string.

VB Prototype

Init(
  ResourceName As String,
  mode As AccessMode, ' Optional Parameter
  initTimeout As Long, ' Optional Parameter
  OptionString As String ' Optional Parameter
)

C++ Prototype

HRESULT Init(
  BSTR ResourceName,
  AccessMode mode,
  long initTimeout,
  BSTR OptionString
);

Parameters

ResourceName

The resource name string.  See VISA Resource Strings for more information on the format of the ResourceName parameter.

mode

[Optional in Visual Basic] The lock type to attempt.  The initTimeout property will be used to wait a maximum amount of time to retrieve the lock.

initTimeout

[Optional in Visual Basic] The lock timeout in milliseconds. This is different from the I/O Timeout property of the session. The lock timeout only affects how long the Init call will wait to get a lock on the I/O session if the mode parameter of Init indicates locking should be attempted.

OptionString

[Optional in Visual Basic] The option string to apply to the resource.  See The Option String for more information on the format of the option string parameter.

Return Value

Refer to the table of return codes.

See Also

ComponentVersion, SpecVersion, HardwareInterfaceName, HardwareInterfaceNumber, HardwareInterfaceType, LockState, OptionString, ProgID, ResourceName, SessionType, SoftwareManufacturerID, SoftwareManufacturerName, Timeout, LastStatus, BytesAvailable, BaudRate, DataBits, ClearToSendState, DataCarrierDetectState, DataSetReadyState, DataTerminalReadyState, EndIn, EndOut, FlowControl, Parity, RingIndicatorState, RequestToSendState, StopBits, ReplacementCharacter, XONCharacter, XOFFCharacter, GetAttribute, SetAttribute, LockRsrc, UnlockRsrc, Init, Close, SetBufferSize, Flush, ISerial Overview