DAQmxCreateDOChan

NI-DAQmx C Functions

DAQmxCreateDOChan

int32 DAQmxCreateDOChan (TaskHandle taskHandle, const char lines[], const char nameToAssignToLines[], int32 lineGrouping);

Purpose

Creates channel(s) to generate digital signals and adds the channel(s) to the task you specify with taskHandle. You can group digital lines into one digital channel or separate them into multiple digital channels. If you specify one or more entire ports in lines by using port physical channel names, you cannot separate the ports into multiple channels. To separate ports into multiple channels, use this function multiple times with a different port each time.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task to which to add the channels that this function creates.
lines const char [] The names of the digital lines used to create a virtual channel. You can specify a list or range of lines.
nameToAssignToLines const char [] The name of the created virtual channel(s). If you create multiple virtual channels with one call to this function, you can specify a list of names separated by commas. If you do not specify a name, NI-DAQmx uses the physical channel name as the virtual channel name. If you specify your own names for nameToAssignToLines, you must use the names when you refer to these channels in other NI-DAQmx functions.
lineGrouping int32 Specifies whether to group digital lines into one or more virtual channels. If you specify one or more entire ports in lines, you must set lineGrouping to DAQmx_Val_ChanForAllLines.
Value Description
DAQmx_Val_ChanPerLine One channel for each line
DAQmx_Val_ChanForAllLines One channel for all lines

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.