Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple channels on PCIe-6320 using C API

Solved!
Go to solution

I am using a PCIe-6320 DAQ with the C API on Windows 7.

 

I need to generate a regular pulse output on myDAQ/ctr0 and then at random intervals read the DI ports myDAQ/port0:2.

 

As I understand it I can only run a single task on this card, so I have been trying to create multiple channels on the same task. However I am getting DAQmxErrorMultiChanTypesInTask. In pseudo code I call

 

CreateTask()

DAQmxCreateCOPulseChanTime("Daq1/ctr0")

DAQmxCreateDIChan("Daq1/port0:2")          <-- this gives DAQmxErrorMultiChanTypesInTask

 

What am I doing wrong? Is there a better way to accomplish this?

 

Any and all advice gratefully received.

 

Thanks

 

Patrick

 

0 Kudos
Message 1 of 4
(2,932 Views)
Solution
Accepted by topic author _patrick_

You can run multiple tasks on that card.  The main real restriction is that you can have only 1 hardware-timed task running at a time for each of the following major subsystems: AI, AO, DI, DO.  But you can indeed have 1 each running simultaneously for a total of 4.  You can also have a number of software-timed "on-demand" type tasks for each subsystem.  And you can have several additional counter tasks as well.

 

So you just need 2 separate tasks, 1 for counter output and 1 for digital input.  Your DI task can probably be software-timed, given your comment about "random intervals." 

 

As a LabVIEW-only guy, I really can't help with any specific syntax though.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
Message 2 of 4
(2,907 Views)

Thanks very much for the reply. Following your suggestions I set the DI to on demand timing and everything seems to be doing what I want.

 

I also had to read the whole channel, myDAQ/port0, rather than the lines I originally wanted, myDAQ/port0:2, as the latter would not work. But all is looking good. Thanks again.

0 Kudos
Message 3 of 4
(2,881 Views)

The syntax in LabVIEW for the lower 3 bits of port 0 would look like:

"MyDAQ/port0/line0:2"

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 4 of 4
(2,877 Views)