Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Different channel types in one task

Hello world,

 

I use the NI-DAQmx driver with LabWindows and I have some difficulties with the creation of task. In fact, I would like to configure a task which realizes an acquisition of an input analogic signal on a channel and which can, in the same time, makes the count of an input pulse on another channel.

 

Exemple :


DAQmxErrChk (DAQmxCreateTask("Task", &handle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(handle, "Dev1/ai0", "Analogic signal", DAQmx_Val_RSE, -1.00, 6.00, DAQmx_Val_Volts,NULL));

DAQmxErrChk (DAQmxCreateCIPulseChanTicks(handle, "Dev1/ctr0", "Pulse", "OnboardClock", 0, 255));

 

 

The problem is I can't do this apparently because the both doesn't have the same channel type.

 

Error :

 

Function DAQmxCreateCIPulseChanTicks: (return value == -200559 [0xfffcf091]). Task cannot contain a channel with the specified channel type, because the task already contains channels with a different channel type.  Create one task for each channel type. Virtual Channel Name: Dev1/ai0 I/O Type Required for Virtual Channel: DAQmx_Val_AI Physical Channel Name: Dev1/ctr0 I/O Type Required for Virtual Channel: DAQmx_Val_CI  Task Name: Read_all_channels  Status Code: -200559

 

After some search on the NI's website, I found this page : http://digital.ni.com/public.nsf/allkb/3296BA2AEF586B7386256D6D00528E3D.

This is exactly what I want to do but with LabWindows and not with LabView.

 

Qdgjl

 

 

 

 

 

 

0 Kudos
Message 1 of 2
(3,809 Views)

You can't have a counter and an AI be in the same task.  You need to create a separate task for each one.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(3,801 Views)