07-03-2013 07:19 AM - edited 07-03-2013 07:21 AM
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
07-03-2013 08:38 AM
You can't have a counter and an AI be in the same task. You need to create a separate task for each one.