LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i initiate a timer when the graph amplitude drops below 0?

I have two signals on my graph, the first signal drops below zero, then the second signal drops (caused by a tennis ball passing infront of a photodiode causing a drop in voltage), how do I record the length of time between the first and second signals dropping below zero? How do I change the accuracy of the reading? (from milliseconds to nanoseconds etc.)
0 Kudos
Message 1 of 7
(3,062 Views)

We are going to need more information to help you.  How are you reading in the data, is it from an instrument or a file?  Can you attach a sample of the code you are using.

The main reasons I ask are that the answer is not in the graph at all.  All a graph does is show you data, if you want to do things with it then we have to look at the data arrays themselves.  There are some functions to find the roots or zeros that we can use, but it will depend on your code.  As far as milli versus nanoseconds that totally depends on the hardware you are using.

0 Kudos
Message 2 of 7
(3,060 Views)

Hi

Thanks for getting back to me so quicklySmiley Happy I am reading the information from voltmeter through a data acquisition board - but i need to write the program first before hooking it up, so i've synthesised a signal input for the time being (im starting out by just concentrating on starting a timer when one signal from one graph drops to 0v, see attached!)

I have some code but im a bit of a beginner and its not working for me..... Im using the Get Y Value function, and want the output of this to trigger a timer when the value drops to 0. (thats as far as I've got with the code...)

Really appreciate your help

Thanks

Annette

0 Kudos
Message 3 of 7
(3,056 Views)
Before I modify it to do what you want let me ask you one more ?.  Are you going to be measureing the points in a single point way, ie point by point.  Or is the hardware going to return you an array of data.  Its not a huge difference, but in your example you have the simulate set to output a single point at a time.  So everytime you run that example you will only get 1 point and then it will hit the loop and be done.
 
So I know we need to move it in the loop, but I would rather show you how to do what you need then try to write the different options.
 
Also what specific device are you going to be using? 
0 Kudos
Message 4 of 7
(3,045 Views)
I will have a recorded signal saved from the memory of the data acquisition unit and I will analyse this is LabView. Thank you for your help, I cant accept a written program from you as this is an assignment. I would appreciate though if you could advise me whether or not what I have written would work if I was to feed the voltage output into an array and analyse this in a loop timer like I have written?
Thank you!
Annette
0 Kudos
Message 5 of 7
(3,040 Views)
You can most likely just brute force through this.  You should have an array of data, in your example you where only getting 1 point out.  Open the express block you used and change it to give you the whole waveform.
Then you can use a bunch of the array functions to find the crossings.  I now there is a better function but I can't remeber where it is.
 
Anyway, you can in a loop index the array and look at any two values and see if they have a different sign.  An easy test would be to use the >0 VI to return an array of booleans letting you know the sign.  You can then use the search 1-D array to find out when it first becomes false therefore negative.
 
You can do that on both arrays of data and then compare the indexes that you found to find the time difference.  The original data most likely was a waveform so you can use the dt to caluclate how much time past.
0 Kudos
Message 6 of 7
(3,034 Views)

Evan

Thanks for all your help, really appreciate it

Annette

0 Kudos
Message 7 of 7
(3,015 Views)