LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6211 Encoder

Hello, 

 

I am using a incremental encoder (1024 Counter Per Revolution) to measure the angular position of the shaft, and generate TTL signal when shaft is at certain degree. I am using USB 6211 DAQ, and LabView. I am using the Analog Input as external clock source with the setting of contiuous sampling at 10,000 Hz Sampling Rate, and 1 Sample to Read (i.e. Buffer size). At low rpm I am getting correct output but at high speed I am getting the error cited below. 

 

Some or all of the samples requested have not yet been acquired.

To wait for the samples to become available use a longer read 

timeout or read later in your program. To make the samples 

available sooner, increase the sample rate. If your task uses a 

start trigger,  make sure that your start trigger is configured 

correctly. It is also possible that you configured the task for 

external timing, and no clock was supplied. If this is the case, 

supply an external clock.

Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<55AB>

 

 

I wanted to know 1. How to choose buffer size?, and 2. possible cause of the error. 

 

0 Kudos
Message 1 of 14
(4,936 Views)
I don't understand. What is the relationship between the encoder and the analog input. Is the encoder output the external clock?

One thing to be careful about is that clock inputs expect VERY clean signals. Overshoot, undershoot, noise, ringing -- they will all kill you. If you can lay your hands on an analog scope, look at the clock and make sure it doesn't degrade at speed.

Mike...

Ps: if all you have is a digital scope you can try using it, but don't be surprised when you can't see the trouble.

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 14
(4,927 Views)

I use analog input as an external clock for continuous sampling via digital counter. I hope that states my problem clearly. 

0 Kudos
Message 3 of 14
(4,906 Views)

Could you go in to more detail as to how you are generating this external clock?

--------------------------------------
0 Kudos
Message 4 of 14
(4,893 Views)

So the picture below shows how I am adding external clock. 

 

DAQ_Encoder

0 Kudos
Message 5 of 14
(4,887 Views)

How are you generating the clock signal itself?

--------------------------------------
0 Kudos
Message 6 of 14
(4,872 Views)

I dont have any clock signal generator attached at all. I thought NI uses the DAQ board clock to generate clock. 

0 Kudos
Message 7 of 14
(4,868 Views)

I always like to go through the following link to set up an encoder.

 

http://www.ni.com/getting-started/set-up-hardware/data-acquisition/quadrature-encoders

 

As far as the error is concerned, this part of the error message seems the most relevant.  From your last post it sounds like you are not supplying an external clock.

 

It is also possible that you configured the task for 

external timing, and no clock was supplied. If this is the case, 

supply an external clock.
Matt J | National Instruments | CLA
0 Kudos
Message 8 of 14
(4,821 Views)

I think Matt's link is a good starting point. I'd try using a counter as detailed there.

--------------------------------------
0 Kudos
Message 9 of 14
(4,773 Views)

Hello, I follow the same procedure as outlined in that link and this video (https://www.youtube.com/watch?v=YGRKAxjYDes). So here is the problem in detail. What I am trying to do is to generate a TTL signal whenever the encoder reaches 0,90,180, and 270 degree. 

 

Here is the snapshot of my VI, and what I am trying to do. I can run the VI at Continuous Sampling setting (buffer size of 1, and sampling rate of 12000 Hz) if I am only displaying the angle, but when I want to trigger the camera it gives me the error 200279. 

 

VI.JPG

0 Kudos
Message 10 of 14
(4,759 Views)