From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,754 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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 2 of 4
(2,729 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,703 Views)

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

"MyDAQ/port0/line0:2"

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 4
(2,699 Views)