LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Syncronization of two counters triggering

I am trying to synchronize two counters to collect data from a rotational and linear encoder. I have followed several examples on how to do this however I am having trouble triggering the counters. I am using a dummy voltage input to set the clock source and I set the source of the sample clock to ai/sampleclock. When I run the vi it collects no data and gives me a 200284 error. I assume it is due to the external clock not being routed to the counter sample clocks. I can not figure out how to make the route beyond changing the timing engine to ai.I change the sample timing engine to ai (option 2) by setting the DAQmx timing property.

 

I also have a random 201133 error stating that one of the counters can not be configured for I/o because it is being used by another task. I have reset the tasks at the beginning of the code and I still get the error. I assume it is because the task is not cleared after a foult but the reset device vi should fix this.

 

I am using Labview 2013 with a cdaq-9174 with a Ni-9401, NI-9263 and b-9201.

 

Thank you,

 

Chris

0 Kudos
Message 1 of 4
(2,819 Views)

Hi Chris, I see 2 things:

 

  • You have a task for cDAQ1Mod1/ctr0 and cDAQ1Mod1/ctr1, I believe these should be in the same task, and you'll read back an array of 2 elements. Maybe cDAQ is different, but when I use PXIe modules all inputs on the same card used the same task.
  • Also, I'm not sure if your sample clock name is correct. I assume cDAQ1 is the chassis name, and I would assume you need an actual module name, like cDAQ1Mod3.
0 Kudos
Message 2 of 4
(2,797 Views)

gregoryj,

 

Thank you for the reply. I did try that with the hope to eliminate the sample clock issues however I got an error stating that multiple counters can not be on the same task for input operations. I had to add a separate task for the other counter.

Chris

 

0 Kudos
Message 3 of 4
(2,792 Views)

Ok, just checking! I haven't worked with counters before

0 Kudos
Message 4 of 4
(2,789 Views)