From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using data from an encoder

Hi everyone !

 

I use Labview for tracking a rotating disk mounted on a shaft via a laser.

Here is my problem : I have two loops in a VI, one reads angle position from an encoder (mounted on the shaft); and the other one updates cosine and sine  of this angle (as mathematical functions) and sends these values to an "Analog 1D DBL / NChan 1 Samp" that are supposed to be used by the laser (for X and Y position).

The error that I get is that the buffer size is too small, which I find very strange...
I guess I need to use "waveforms" instead for sine and cosine, but in that case I can't update the position : I have to take the rotating velocity coming from the encoder, which makes the tracking less accurate.

Do you have any idea of what I could do ?
Thanks a lot !

Cirkow

0 Kudos
Message 1 of 2
(2,086 Views)

@Cirkow wrote:

Do you have any idea of what I could do ?


Yes.  Attach your VI so we can see what you are doing, and suggest where you might make a change.  You might also give us some idea of the timing you are trying to achieve, i.e. at what frequency are you reading the Encoder, and at what frequency do you hope to update the Laser drivers?

 

My guess (based on your vague description, rather than seeing your code) is that you have two independent loops and are having trouble getting the data from the Encoder Reader Loop into the Laser Analog Output Loop.  One way that takes advantage of LabVIEW's Data Flow paradigm is called the Producer/Consumer Design Pattern -- you can check this out by opening a New VI using the "New ..." (the dots are important!) choice from the File Menu and looking under "From Templates" for the Producer/Consumer Design Pattern example Templates.

 

Bob Schor

0 Kudos
Message 2 of 2
(2,052 Views)