LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble getting consistent voltage readings with LabVIEW using a 1102/B

Here's the situation:
I have an optical sensor with reflector that I'm using these to determine the velocity of a rotating wheel. (actually it's a spool of cable)

no beam reflection = 0 Vdc (actually it's floating from 0 - 2 volts)
beam reflection = 10Vdc

This is hooked up to an 1102/B channel configured for reading voltage in MAX

Now, everything is fine at slower speeds.  The trouble is when the velocity increases...
I'm using a DAQmx read VI in LV 7.1 to read the virtual channel I set.  It's in a while loop, outputting to a chart.

The reads are missing reflections at higher speeds, but only seems to happen in LabVIEW.  The cable needs to be letting out at 2 ft/sec.

Now, the sensor has an indicator light that says when it's seeing the reflected beam.  When I spin the wheel by hand (faster than the necessary speed) the sensor says it's picking up the reflectors (2 at 180 deg apart).  When I open MAX, and the test panel for that channel, I see that I have to increase the "sampes to read" to about 5k and the "rate" to 5kHz.   At that point, MAX  sees every beam reflection as well.

Within LV, it still misses...  even with the loop delay set to 5ms.   I'm hesitant to go much lower with the delay... 
The final destination for this reading function will be in a fairly large VI with a lot of serial communication to external instruments.

Anyone have any advice?

Thanks!
Chuck
0 Kudos
Message 1 of 4
(2,791 Views)
Hi Chuck,
Looks like you are configuring a DAQmx task/global channel
 
My suggestion would be why not use any continous voltage read examples you will find in the examples shipped with LabVIEW?
 
Go to examples>>Hardware input output>>DAQmx>>Analog measurements>>Voltage in this folder find and use the example VI cont-acq-volt-int-clk.VI ( named something like that Smiley Wink ) read its documentation to know how to use it
 
any doubts, do get back
 
0 Kudos
Message 2 of 4
(2,782 Views)
I opened the vi you mentioned.  I have essentially what is in the while loop.

Do I need to Use the sub-vi's to create the channel, set the timing, start and end task?

I mean, if I have already set that stuff up in MAX, do I need those extra sub-vi's?
0 Kudos
Message 3 of 4
(2,778 Views)
 

Even if you have set it up in MAX, it depends as what do you call it in your VI. Looks like you are using a DAQmx task

 

This is what i would advise:

Build a vi either using DAQ Assistant or use DAQmx functions to do continous acquisition as shown in that example VI and you will not much to bother Smiley Wink

 

Message 4 of 4
(2,775 Views)