Hi,
Can we create DI and DO channel in the same task? Below is my coding but if used the same task it show error message.
Error Msg =
Task cannot contain a channel with the specified channel type, because the task already contains channels with a different channel type.
Create one task for each channel type.
Code =
' Create the DAQmx task.
DAQmxErrChk DAQmxCreateTask("", vTaskHwnd)
' Add a digital input channel to the task.
DAQmxErrChk DAQmxCreateDIChan(vTaskHwnd, DIPortAddress, "", DAQmx_Val_ChanForAllLines)
DAQmxErrChk DAQmxCreateDOChan(vTaskHwnd, DOPortAddress, "", DAQmx_Val_ChanForAllLines)
'Start the task running, and read from the digital lines.
DAQmxErrChk DAQmxStartTask(vTaskHwnd)
vTaskIsRunning = True
Thank you very much.