Solution
If you are using only one channel, you can use DAQmx Create Virtual Channel. It will create a DAQmx Task in the background, and you will not need to worry about creating one.
However, if you are using multiple channels, then you would need to create a Task and add the channels to it.