LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Read pin/encoder

i dont quite understand labview yet, but i got the basics down. im trying to figure out the number of steps per revolution of an encoder i came across. so i typed up an labivew vi to use the arduino as a o-scope but it seems to be skipping some values from my encoder, i only get the zero pulse once every 5 or so rotations, and the other pulses are erratic.

The arduino is wired to the encoder directly with no resisters.

comming out of the encoder i have 8 wires: +5v, Gnd, Ch A+, Ch A-, Ch B+, Ch B-, Ch Zr+, Ch Zr-.

i have all the channels directly linked to the analog inputs(0-5).

how fast is the analog read pin?

i see that there is a sampling rate VI, how do i use it?

is there a more efficent way to do this?

Did i wire it up right?

0 Kudos
Message 1 of 4
(5,876 Views)

Hey jchalo99,

A single analog read with the LIFA toolkit is pretty slow (I usually get around 50HZ when benchmarked).  This is probably why you are missing pulses. We are going to have a faster acquisition mode in the 2.0 release which should make it easier to do what you want.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 4
(2,885 Views)

Thank you Kevin_F,

wow that compounded to six pins, with pwm write pin aswell must make it pretty slow. thank you for the quick reply so i dont continue to waist my time.

I cant wait till LIFA 2.0.

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

If you want to be able to use the Arduino as a scope you could consider making a piece of code yourself which just reads the analog input as fast as you can and write those values out to the serial port.  You would then just need to read the serial port two bytes at a time in LabVIEW and output the data.  This is essentially what we will be doing for LIFA 2.0

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 4 of 4
(2,885 Views)