02-09-2009 10:12 AM - edited 02-09-2009 10:14 AM
Hi tbob,
i need to count the number of cycles from a controller (it controls a valve). i'm getting sinwave which runs only in +ve direction.
i need to count the number of cycles it produce.
in this case the signal is always +ve and so no zero crossing. how can i do this?
many thanks in advance
Renn
02-10-2009 02:55 PM
Finding the number of cycles does not have to depend on zero crossing. It uses the midpoint crossing. If you read my last post you will see this. If your signal goes from 1v to 5v, the midpoint is 3v. Count the number of times the signal crosses 3v in one direction. Or count the number of times it crosses 3v in both directions and divide that number by 2. This will give you the number of cycles in a signal.
02-11-2009 03:07 PM
Hi RENN,
What kind of DAQ card are you using? Let's just assume you have an M series DAQ board, in which case you support analog triggering. If you set up an analog level trigger and set the level to whatever your midpoint voltage is (like our friend below mentioned), then the analog triggering circuitry in your board will create a pulse in hardware that occurs every time your input sine wave crosses that voltage level. This internal pulse signal is called the "AnalogComparisonEvent." You can find more information about this signal here. We can use this signal as the source of a Counter Input pulse tick count task. I've attached a quick VI that I wrote to do this. I tested this with success on my PCI-6251. I hope this helps.
Chris W
12-09-2013 01:04 PM - edited 12-09-2013 01:13 PM
Dear Tbob
I would like to thank you for your efforts with other LabVIEW users. I am also a new user and I would like to ask a question which is kind off similar. I am using this VI (which is attached) and I would like to control the number of cycles of the generated wave (sine, sawtooth, square, Triangle).
How can I modify the VI to do this task?
Best Regards
Fasial
12-10-2013 11:30 AM
Hi FaisalF,
This is a pretty old thread. Can you please create a new thread? You are more likely to get more traffic and responses on a new thread.
Thank you,