NI-SWITCH 19.0 .NET Framework 4.0 API Reference

Table of Contents

Scan Method

  • Updated2023-02-21
  • 3 minute(s) read
Scan Method
Takes the SwitchScan.List provided, programs the switching hardware and initiates the scan. Once initiation is complete, the operation will return.

Namespace:  NationalInstruments.ModularInstruments.NISwitch
Assembly:  NationalInstruments.ModularInstruments.NISwitch.Fx40 (in NationalInstruments.ModularInstruments.NISwitch.Fx40.dll) Version: 19.0.0.49152 (19.0.0.49152)
Visual Basic (Declaration)
Public Sub Scan ( _
	scanList As String, _
	initiation As SwitchScanInitiation _
)
C#
public void Scan(
	string scanList,
	SwitchScanInitiation initiation
)

Parameters

scanList
Pass the SwitchScan.List you want the instrument to use.
initiation
Use the initiation parameter to specify whether the switch or the measurement device initiates the scan trigger handshake. This parameter determines whether to wait for the scan to reach a trigger point before completing. If the measurement device initiates the scan, set this parameter to SwitchScanInitiation.MeasurementDeviceInitiated. This method then waits until the switch is waiting for a trigger from the measurement device before completing. If the switch initiates the scan, set this parameter to SwitchScanInitiation.SwitchInitiated. This function then completes immediately after initiating the scan. You should have already set up your DMM to wait for a trigger before calling this function with Initiation set to SwitchScanInitiation.SwitchInitiated.

Exceptions

ExceptionCondition
Ivi.Driver.IviCDriverException When an underlying IVI-C driver was called to perform an action, the IVI-C driver action did not succeed.
Ivi.Swtch.ExplicitConnectionExistsException This exception is used when an attempt is made to connect two channels that are already explicitly connected.
Ivi.Swtch.InvalidScanListException This exception is used when the driver finds that the given scan list string does not have the correct syntax, or the scan list syntax cannot be implemented by the switch.
Ivi.Swtch.NoSuchPathException This exception is used when no explicit path exists between the two channels..
ObjectDisposedException The Scan method was accessed after the associated NISwitch.NISwitch object was disposed.

Remarks

The SwitchScan.List itself is comprised of a list of channel connections separated by semicolons. For example, the following SwitchScan.List would scan the first three channels of a multiplexer: com0->ch0; com0->ch1; com0->ch2;. Refer to SwitchScan.List for additional information.

To see the status of the scan, you can call either SwitchScan.IsScanning or SwitchScan.WaitForScanComplete. Use the SwitchScan.ConfigureTrigger method to configure the scan trigger. Use the SwitchScan.Abort method to stop the scan if you are in continuous scan mode (Refer to SwitchScan.Continuous otherwise the scan halts automatically when the end of the scan list is reached. For reference, this operation is equivalent to calling SwitchScan.ConfigureList and SwitchScan.Initiate.

See Also

Log in to get a better experience