01-25-2017 11:56 AM
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
Solved! Go to Solution.
01-25-2017 12:59 PM
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
01-27-2017 03:55 AM
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.
01-27-2017 06:37 AM
The syntax in LabVIEW for the lower 3 bits of port 0 would look like:
"MyDAQ/port0/line0:2"
-Kevin P