LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6008 Counter offset

Hi,

I am using a linear pot to monitor the motion of a test rig I am instrumenting.  I would also like to increment a counter each time a cycle of the rig is complete.  I tried to use the counter integrated into the USB-6008 board, but it only counts each time the voltage goes to zero and more than likely the linear pot will not be compressed that far (leaves little in the way of margin of safety).  Is there a way to offset or bias the counter so it looks for 1v or 2v instead of the voltage falling to zero?

Thanks in advance for the help...

Ben
0 Kudos
Message 1 of 13
(3,973 Views)
Otherwise, is what would be the best way to implement a counter for the signal coming out of the DAQmx VI?
0 Kudos
Message 2 of 13
(3,970 Views)
So either my question is too easy to comment on or was bypassed because of all the new questions on the forum.  Someone please throw a new user a bone here...
Message 3 of 13
(3,947 Views)
Please wait patiently,
 
somebody will surely solve ur problems and guide u well.....
0 Kudos
Message 4 of 13
(3,944 Views)

bjohnson,

You cannot change the offset of a counter using the 6008.  External circuitry can be utilized to send a suitable signal to 6008 but you would need to design this.  Please let me know if there is another question concerning your data acquisition.

0 Kudos
Message 5 of 13
(3,925 Views)
I'm generally an advocate *for* the use of counters, but in this case I'd actually suggest that you do some software processing
on the analog voltage from your linear pot.  My guess is that the range of travel will not be utterly consistent in your test rig.  Every
time you break out your tools to adjust your brackets and sensor placements, you'll see the range shift.  Maybe an offset, maybe 
a scale factor, maybe both.  So the problem with an external circuit is selecting the correct threshold voltage used to delineate
logical low from high.
 
In this case, you may want to consider doing some simple software processing on the analog linear pot signal.  There will be some
nominal expected shape, and you can design your processing around detecting the "end of cycle" signature.  This may be fairly
easy, but it will depend on the expected shape and the nature of your motion cycles (continuous or discrete).
 
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 13
(3,902 Views)
Exactly what I was looking to do.  I have tried a couple of different attempts at software based counters, but with little luck.  The output shape will be sinusoidal as the rig is being controlled by LV to follow a sine wave.  I want to stay away from derivatives as they get really messy with dynamic data.  Any suggestions on another way to do this?

Thanks for the help guys... 

0 Kudos
Message 7 of 13
(3,899 Views)
Ben,

Set a threshold at about the midpoint of the sinewave and use the zero crossings. The midpoint is east to find (assuming your signal is not too noisy). Use the Array Min and Max function, add Min to Max and divide by 2.

Lynn
0 Kudos
Message 8 of 13
(3,891 Views)
Lynn,

I was having some trouble implementing the counter that you suggested so I ended up with what is below.  The limits on the range function will depend on user inputs, and because of the low frequency nature of the test rig, I believe this set-up will work.  The elapsed time function is there so the counter doesn't read more than one sample per cycle.  It worked well doing a little bench test here at my desk, but if you see any glaring errors, let please speak up.

Thanks again...




Message Edited by bjohnson on 07-24-2008 01:33 PM
0 Kudos
Message 9 of 13
(3,884 Views)
Ben,

Why are you adding an element to an array (always a 1) and then summing the array? The array will keep growing and eventually cause memory allocation problems. Just use a numeric and increment inside the true case. Also initialize the shift register unless you need to keep the old value from the previous run.

Is it possible to get more than one value x such that 4 <= x < 6 in any cycle? If so, you would get multiple counts in that cycle.

The image shows one way of finding and counting zero crossings.

Lynn
0 Kudos
Message 10 of 13
(3,873 Views)