LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6008 Counter offset

Lynn,

It most likely extends from my inexperience with LV, but am having a bunch of trouble getting your zero crossing idea to work.  I tried a couple of different ways, but am running into problems with the counter inside of the while loop. 

Also, I changed my VI to use a numeric instead of my inefficient array.  I don't think I will get more than one value because of the time delay that I put in there, but I would like to get some more advice as to what I am missing when looking at your method. 

I attached both my overall VI with my original counter that works the way I want, but may be unstable and a simple test VI that I made to test the counter you described.  I know they are messy, things have gotten a bit out of hand with all the self teaching.

Thanks...




Message Edited by bjohnson on 07-24-2008 04:38 PM
Download All
0 Kudos
Message 11 of 13
(630 Views)
Ben,

I think I may see part of your problem. In Test Rig you have the counting shift register (uninitialized)on the outer while loop. In Untitled the shift register (initialized) is on the for loop. So the counter in Untitled starts over for each iteration of the outer while loop. To fix this add a shift register on the while loop, initialize it and connect the inner (for loop) shift register to the outer one. The attached image shows a cleaned up version of your vi with this addition.

Lynn
0 Kudos
Message 12 of 13
(616 Views)

Not to distract from what appears to be a working solution, but it seems like you could still use the counter. The counter's low value is at 0.8 V, and the high value is at 2 V. This should not be hard to do, either by stringing the pot between 2 different power sources (a negative and a positive), or by setting the pot as the lower leg of a voltage divider to get the offset you want. Or by a combination of the two if your power sources are not variable, like with a couple batteries. 🙂 Batteries would not be ideal, but if you do use them, just use high resistances.

With a sufficient delay in your VI loop, you don't really have to worry about debouncing.



Message Edited by morgol on 07-25-2008 06:56 AM
____
Ryan R.
R&D
0 Kudos
Message 13 of 13
(607 Views)