But you are creating an analog input task from your snippet.
If you are using a sample clock-timed digital output task, yes you should write some data before starting the task. You can refer to the shipping examples.
------------------------------------------------------- Applications Engineer | TME Systems https://tmesystems.net/ ------------------------------------------------------- https://github.com/ZhiYang-Ong