Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i group different ports for "DAQmxCreateDIChan" for a single task?

greetings.

 

the thing is that for "DAQmxCreateDIChan" i do this:

 

DAQmxErrChk (DAQmxCreateDIChan(taskHandle3,"Dev2/port0","",DAQmx_Val_ChanForAllLines));

 

and i can even do this

 

DAQmxErrChk (DAQmxCreateDIChan(taskHandle4,"Dev2/port1/line0:1","",DAQmx_Val_ChanForAllLines));

 

ok, in the first case it means that for taskHandle3 i will read all 8 bits from port0 in "Dev2/port0", right?

 

in the second case it means that for taskHadle4 i will read only line0 and line1 from port1 in"Dev2/port1", right?

 

once this is explained: How can i read all 10 bits (i.e. line0 to line7 in port0 and line0 to line1 in port1) for a single task so that in the "DAQmxReadDigitalU32" that goes after "DAQmxCreateDIChan" i can have a single read instead of two in the example above?

 

by the way, my device is a pci6229 and i'm using vc++ 2008.

thank you for reading.

 

ZZ

 

sorry for double posting...

0 Kudos
Message 1 of 2
(6,702 Views)

Hi ZainZeus!

 

The answer lies on the creation of the channel, DAQmx allows you to include different ports on the same line, that should include both ports on the same task. It should be something like this:

 

 Dev1/port0/line0:7, Dev1/port1/line0:1

 

All of this must be on the same line under the " ". You can try this and check if it works.

 

Hope this helps.

 

Have a great day!

Message 2 of 2
(6,668 Views)