<< viGetDefinition VISA Integration Toolbox viOpenDefaultRM >>

VISA Integration Toolbox >> VISA Integration Toolbox > viOpen

viOpen

Opens a session to the specified resource

Calling Sequence

[status, vi] = viOpen(sesn, rsrcName, accessMode, openTimeout)

Arguments

status

contains the return code of the operation.

vi

will be the computer's identifier for other functions.

sesn

resource Manager session-should always be a session returned from viOpenDefaultRM().

rsrcName

unique symbolic name of a resource (please see the ViOpen() official help page for details)

accessMode

specifies the mode by which the resource is accessed, here the session uses VISA-supplied default values (please see the ViOpen() official help page for valid values).

openTimeout

specifies the maximum time period (in milliseconds) the operation waits before returning an error (this does not set the I/O timeout-to do that you must call viSetAttribute() with the attribute VI_ATTR_TMO_VALUE).

Description

The viOpen() operation opens a session to the specified resource.

Examples

[status, defaultRM] = viOpenDefaultRM();

// Connect to device located at TCPIP0::ftp.ni.com::21::SOCKET
[status, instr] = viOpen(defaultRM, "TCPIP0::ftp.ni.com::21::SOCKET", viGetDefinition("VI_NULL"), viGetDefinition("VI_NULL"));

viClose(instr);
viClose(defaultRM);

Report an issue
<< viGetDefinition VISA Integration Toolbox viOpenDefaultRM >>