Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2147

Can create DAQmxCreateDIChan and DAQmxCreateDOChan in the same task.

$
0
0

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.

 


Viewing all articles
Browse latest Browse all 2147

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>