SwitchScan Class
- Updated2026-01-20
- 5 minute(s) read
Defines the properties used to configure a switch device using a scan list string.
Derives from
- SwitchSubObject
- IIviSwtchScan
Syntax
Namespace: NationalInstruments.ModularInstruments.NISwitch
public class SwitchScan : SwitchSubObject, IIviSwtchScan
Remarks
For more information, refer to NI Switches Help.
Thread Safety
All members of this type are safe for multithreaded operations.
Properties
| Name | Description |
|---|---|
| AdvancedOutput | Gets or sets a value which specifies the method you want to use to notify another instrument that all signals going through the switch have settled following the processing of one entry in the List. |
| AdvancedPolarity | Gets or sets the advance polarity for the scan. |
| Continuous | Gets or sets a value that indicates whether a switch device stops scanning at the end of the scan, or continues scanning from the top of the scan list. Notice that if you set the scan to continuous true, the WaitForScanComplete method will always time out and you must call Abort to stop the scan. |
| Delay | Gets or sets a value which indicates the minimum amount of time, in seconds, the Switch device waits before it asserts the AdvancedOutput trigger after opening or closing the switch. The switch always WaitForDebounce before asserting the trigger. |
| DigitalFilterEnable | Gets or sets a value which indicates whether to apply the pulse width to the TriggerInput. Set the property to true to prevent the switch module from being triggered by pulses that are less than 150 ns on PXI trigger lines 0-7. When this property is set to false, noise on the PXI trigger lines might trigger the switch module. If the device triggering the switch module can send pulses greater than 150 ns, do not disable this property. |
| HandshakingInitiation | Gets or sets a value which specifies how to start handshaking with a measurement device. |
| IsScanning | Gets or sets a value which indicates whether the switch has completed the scan operation. The value true indicates that the scan is complete. |
| IsWaitingForTrigger | In a List, a semicolon (;) is used to indicate that at that point in the List, the scan engine should pause until a trigger is received from the TriggerInput. If that trigger is user generated through either a hardware pulse or the SendSoftwareTrigger method, it is necessary for the user to know when the scan engine has reached such a state. |
| List | This property contains a List, which is a string that specifies channel connections and trigger conditions. The Initiate function makes or breaks connections and waits for triggers according to the instructions in the List. The List is comprised of channel names that you separate with special characters. These special characters determine the operations the scanner performs on the channels when it executes this scan list.
|
| Mode | Specifies what happens to existing connections that conflict with the connections you make in a List. For example, if CH1 is already connected to CH2 and the List instructs the switch to connect CH1 to CH3, this attribute specifies what happens to the connection between CH1 and CH2. If the value of this attribute is None, the switch takes no action on existing paths. If the value is BreakBeforeMake, the switch breaks conflicting paths before making new ones. If the value is BreakBeforeMake, the switch breaks conflicting paths after making new ones. Most switches support only one of the possible values. In such cases, this attribute serves as an indicator of the device's behavior. |
| TriggerInput | Gets or sets a value which specifies the source of the trigger for which the switch can wait when processing a List. The switch waits for a trigger when it encounters a semicolon in a List. When the trigger occurs, the switch advances to the next entry in the List. |
| TriggerInputPolarity | Gets or sets a value which determines the behavior of the trigger input. |
Methods
| Name | Description |
|---|---|
| Abort() | Aborts the scan in progress. Initiate a scan with Initiate. If the switch module is not scanning, Ivi.Swtch.NoScanInProgressException exception is returned. |
| Commit() | Downloads the configured List and trigger settings to hardware. |
| ConfigureList(string, SwitchScanMode) | Configures the List and Mode used for scanning. Refer to Switch Device Help to determine if the switch module supports scanning. The List is comprised of a list of channel connections separated by semicolons. For example, the following scan list will scan the first three channels of a multiplexer: com0->ch0; com0->ch1; com0->ch2; Refer to List for more information on scan list syntax. To see the status of the scan, call either IsScanning or WaitForScanComplete. Use the ConfigureTrigger method to configure the scan trigger. Use the Initiate method to start the scan. |
| ConfigureTrigger(PrecisionTimeSpan, string, string) | Configures the scan triggers for the scan list established with ConfigureList. Refer to Device Help to determine if the switch module supports scanning. ConfigureTrigger sets the location that the switch expects to receive an input trigger to advance through the List. This method also sets the location where it outputs a scan advanced signal after it completes an entry in the scan list. |
| Initiate() | Commits the configured List and trigger settings to hardware and initiates the scan. If Commit was called earlier, Initiate only initiates the scan and returns immediately. Once the scanning operation begins, you cannot perform any other operation other than GetAttribute, Abort, or SendSoftwareTrigger. All other functions return the Ivi.Swtch.ScanInProgressException Exception. To stop the scanning operation, call Abort. |
| RouteScanAdvancedOutput(string, string, bool) | Routes the AdvancedOutput from a trigger bus line (TTLx) to the front or rear connector. |
| RouteTriggerInput(string, string, bool) | Routes the TriggerInput from the front or rear connector to a trigger bus line (TTLx). To disconnect the route, call this function again and specify None for trigger bus line parameter. |
| Scan(string, SwitchScanInitiation) | Takes the List provided, programs the switching hardware and initiates the scan. Once initiation is complete, the operation will return. |
| SendSoftwareTrigger() | Sends a software trigger to the switch specified in the NI-SWITCH session. When the TriggerInput is set to SoftwareTrigger through either the ConfigureTrigger function or the TriggerInput attribute, the scan does not proceed from a semicolon (wait for trigger) until SendSoftwareTrigger is called. |
| WaitForScanComplete(PrecisionTimeSpan) | Pauses until the switch stops scanning or until the maximum time has elapsed, when NI-SWITCH returns a timeout error. |