# daq_out_scan()

Outputs values synchronously to analog output channels and digital output ports. This function only works with boards that support synchronous output.

## Function Prototype

daq_out_scan(board_num, chan_list, chan_type_list, gain_list, chan_count, rate, count, memhandle, options)

## Parameters

board_num (int)

The number associated with the board when it was installed with InstaCal or created with create_daq_device().

chan_list (list of int or DigitalPortType)

List containing channel values. Valid channel values are analog output channels and digital ports.

chan_type_list (list ofChannelType)

Array containing channel types. Each element of this array defines the type of the corresponding element in the chan_list. Set to one of the constants in the chan_type_list parameter value section below.

gain_list (list of ULRange)

List containing A/D range codes. If the corresponding element in the chan_list is not an analog input channel, the range code for this channel is ignored.

chan_count (int)

Number of elements in each of the three lists - chan_list, chan_type_list, and gain_list.

rate (int)

Sample rate in scans per second. The actual sampling rate in some cases will vary a small amount from the requested rate. The actual rate is returned.

count (int)

Sets the total number of values to output.

memhandle (int)

Handle for the Windows buffer to store data. This buffer must have been previously allocated. For 16-bit data, create the buffer with win_buf_alloc(). For data that is > 16-bit and ≤ 32-bit, use win_buf_alloc_32(). For data that is > 32-bit and ≤ 64-bit, use win_buf_alloc_64(). When using scaled data, use scaled_win_buf_alloc() You can load the data values with win_array_to_buf() or scaled_win_array_to_buf() (for scaled data).

options

Flags that control various options. May contain any combination of non-contradictory choices in the options parameter values section below.

## Returns

- actual_rate (int) – The actual rate set, which may be different from the user specified rate due to pacer limitations.

### chan_type_list parameter values

ANALOG | Analog output channel.
DIGITAL16 | 16-bit digital output port. (FIRSTPORTA only)

### options parameter values

ADCCLOCK | When this option is used, the data output operation will be paced by the ADC clock.
ADCCLOCKTRIG | If this option is used, the data output operation will be triggered upon the start of the ADC clock.
BACKGROUND | When this option is used, the output operations will begin running in the background and control will immediately return to the next line of your program. Use get_status() with the DAQOFUNCTION option to check the status of background operation. Use stop_background() with the DAQOFUNCTION option to terminate background operations before they are completed. Execute stop_background() with DAQOFUNCTION after normal termination of all background functions in order to clear variables and flags.
CONTINUOUS | This option puts the function in an endless loop. Once it outputs the specified number (count) of output values, it resets to the start of the buffer and begins again. The only way to stop this operation is by calling stop_background() with DAQOFUNCTION. This option should only be used in combination with BACKGROUND so that your program can regain control.
EXTCLOCK | If this option is used, conversions will be paced by the signal on the external clock input rather than by the internal pacer clock. Each conversion will be triggered on the appropriate edge of the clock input signal. When this option is used, the rate parameter is ignored. The sampling rate is dependent on the clock signal. Options for the board will default to transfer types that allow the maximum conversion rate to be attained unless otherwise specified.
NONSTREAMEDIO | This option allows non-streamed data output to be generated to a specified output channel. In this mode, the aggregate size of data output buffer must be less than or equal to the size of the internal data output FIFO on the device. This allows the data output buffer to be loaded into the device's internal output FIFO. Once the sample updates are transferred (or downloaded) to the device, the device is responsible for outputting the data. While the size is limited, and the output buffer cannot be changed once the output is started, this mode has the advantage being able to continue data output without having to periodically feed output data through the program to the device.