Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

USU 6009 counter error: DAQmxBase Error -200428

I want to use USB 6009  as an edge counter. I got this ouput :

create task
createCounterChan
start task
DAQmxBase Error -200428: Value passed to the Task/Channels In control is invalid.

with following code:


 // Channel parameters
   const char  counter[] = "Dev3/ctr0";

   // Read parameters
   
   uInt32 readArray[1];
   uInt32 arraySizeInSamps=1;
   uInt32 initialCount=0;
   int32 numSampsPerChan=1;
   int32 sampsPerChanRead;
   float64 timeout=100;
   
   DAQmxErrChk (DAQmxBaseCreateTask ("", &taskHandle));
   printf("create task\n");
   DAQmxErrChk (DAQmxBaseCreateCICountEdgesChan (taskHandle, counter, NULL, DAQmx_Val_Falling, initialCount, DAQmx_Val_CountUp));
   printf("createCounterChan\n");
   // Start Task (configure port)
   DAQmxErrChk (DAQmxBaseStartTask (taskHandle));
   printf("start task\n");
   DAQmxErrChk (DAQmxBaseReadCounterU32 (taskHandle, numSampsPerChan, timeout, readArray, arraySizeInSamps, &sampsPerChanRead, NULL));
   printf("Data read: 0x%X\n",readArray[0]);


Please help

0 Kudos
Message 1 of 3
(3,989 Views)
Hello nguyendyhung,

Thank you for posting to the discussion forum. Here is a KnowledgeBase that explains this error.

NI-DAQmx Base Error -200428
http://digital.ni.com/public.nsf/websearch/7705D38D59EF562886256F79007E4B5A?OpenDocument


This document is going to reference LabVIEW, but the theory is still going to be applicable with your code. You can get this error message if the task is not configured correctly.

Also take a look at some of the shipping examples that come with DAQmx Base. You can find them in the following folder:

C:\Program Files\National Instruments\NI-DAQmx Base\Examples


Please take a look at these resources and let us know it resolves your issue.


Regards,
  Sandra T.

Applications Engineer | National Instruments




0 Kudos
Message 2 of 3
(3,973 Views)
Yes I can run those sample programs and solve my problem

Thank
0 Kudos
Message 3 of 3
(3,968 Views)