niSwitch_Scan

NI-SWITCH Functions

niSwitch_Scan

Specific Function

C Function Prototype

ViStatus niSwitch_Scan (ViSession vi, ViConstString scanlist, ViInt16 initiation);

Purpose

Takes the scan list provided, programs the switching hardware and initiates the scan. Once initiation is complete, the operation will return. The scan list itself is comprised of a list of channel connections separated by semicolons. For example, the following scan list would scan the first three channels of a multiplexer. Example: com0->ch0; com0->ch1; com0->ch2;. Refer to scan lists for additional information. To see the status of the scan, you can call either niSwitch_IsScanning or niSwitch_WaitForScanComplete. Use the niSwitch_ConfigureScanTrigger function to configure the scan trigger. Use the niSwitch_AbortScan function to stop the scan if you are in continuous scan mode (Refer to niSwitch_SetContinuousScan); otherwise the scan halts automatically when the end of the scan list is reached. For reference, this operation is equivalent to calling niSwitch_ConfigureScanList and niSwitch_InitiateScan.

Parameters

Name Type Description
vi ViSession A particular NI-SWITCH session established with niSwitch_InitWithTopology, niSwitch_InitWithOptions, or niSwitch_init and used for all subsequent NI-SWITCH calls.

scanlist ViConstString Pass the scan list you want the instrument to use.
initiation ViInt16 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 NISWITCH_VAL_MEASUREMENT_DEVICE_INITIATED. This function 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 NISWITCH_VAL_SWITCH_INITIATED. 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 NISWITCH_VAL_SWITCH_INITIATED.
Value Description
NISWITCH_VAL_SWITCH_INITIATED Switch Initiated.
NISWITCH_VAL_MEASUREMENT_DEVICE_INITIATED (default) Measurement device initiated.