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

Using DAQmxWriteDigitalScalarU32 to write channels sharing same port(s)?

$
0
0

Hello,

I have a USB-6509 and NI-DAQmx 15.5.1 installed. Using the ansi c api.

 

Is it possible to create several independent channels that use different lines from the same port?

 

DAQmxCreateTask("",&th1)

DAQmxCreateDOChan(th1,"Dev1/line0:4","",DAQmx_Val_ChanForAllLines)

DAQmxStartTask(th1)

DAQmxCreateTask("",&th2)

DAQmxCreateDOChan(th2,"Dev1/line5:9","",DAQmx_Val_ChanForAllLines)

DAQmxStartTask(th2)

....

and repeat for the following channels:

Dev1/line0:4
Dev1/line5:9
Dev1/line10:14
Dev1/line15:19
Dev1/line24:28
Dev1/line29:33

 

So I can use DAQmxWriteDigitalScalarU32 to write to each task independently?

 

for example:

DAQmxWriteDigitalScalarU32(th1,1,10,0x1,NULL)

DAQmxWriteDigitalScalarU32(th2,1,10,0x2,NULL)

DAQmxWriteDigitalScalarU32(th3,1,10,0x3,NULL)

...

DAQmxWriteDigitalScalarU32(th6,1,10,0x6,NULL)

 

Will these tasks interfere with each other since they use the same port, but are assigned different lines?

If not, do I need to bit shift the data if the task/channel doesn't start at line Px.0?

 

Thanks!


Viewing all articles
Browse latest Browse all 2147

Trending Articles



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