Scan(string, SwitchScanInitiation)
- Updated2026-01-20
- 2 minute(s) read
Takes the List provided, programs the switching hardware and initiates the scan. Once initiation is complete, the operation will return.
Syntax
Namespace: NationalInstruments.ModularInstruments.NISwitch
public void Scan(string scanList, SwitchScanInitiation initiation)
Remarks
To see the status of the scan, you can call either IsScanning or WaitForScanComplete. Use the ConfigureTrigger method to configure the scan trigger. Use the Abort method to stop the scan if you are in continuous scan mode (Refer to Continuous otherwise the scan halts automatically when the end of the scan list is reached. For reference, this operation is equivalent to calling ConfigureList and Initiate.
Parameters
| Name | Type | Description |
|---|---|---|
| scanList | string | Pass the List you want the instrument to use. |
| initiation | SwitchScanInitiation | 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 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 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 SwitchInitiated. |
Exceptions
| Type | Description |
|---|---|
| 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.. |
| Ivi.Swtch.ExplicitConnectionExistsException | This exception is used when an attempt is made to connect two channels that are already explicitly connected. |
| Ivi.Driver.IviCDriverException | When an underlying IVI-C driver was called to perform an action, the IVI-C driver action did not succeed. |
| System.ObjectDisposedException | The Scan method was accessed after the associated NISwitch object was disposed. |