XNET Clear.vi

NI-XNET Hardware and Software Help

Edition Date: November 2018

Part Number: 372841U-01

»View Product Info
Download Help (Windows Only)

Purpose

Clears (closes) the XNET session.

Format

Inputs

session in is the session to clear. This session is selected from the LabVIEW project or returned from the XNET Create Session VI.
error in is the error cluster input (refer to Error Handling).

Outputs

error out is the error cluster output (refer to Error Handling).

Description

This VI stops communication for the session and releases all resources the session uses. The XNET Clear VI internally calls the XNET Stop VI with normal scope, so if this is the last session using the interface, communication stops.

When your application is finished (the top-level VI is idle), LabVIEW automatically clears all XNET sessions within that VI and its subVIs. Therefore, the XNET Clear VI is rarely needed in your application.

You typically use the XNET Clear VI when you need to clear the existing session to create a new session that uses the same objects. For example, if you create a session for a frame named frameA using Frame Output Single-Point mode, then you create a second session for frameA using Frame Output Queued mode, the second call to the XNET Create Session VI returns an error, because frameA can be accessed using only one output mode. If you call the XNET Clear VI before the second XNET Create Session VI call, you can close the previous use of frameA to create the new session.

This VI disconnects terminals that you connected using the XNET Connect Terminals VI.

WAS THIS ARTICLE HELPFUL?

Not Helpful