Duration of a zero crossing

Hi all,
I m a newbie to LabVIEW and I really need some help with some zero
crossing issues.
I have a wave generated from the values output by a pressure sensor. I
differentiated this wave to obtain a wave with peaks, valleys and zero-
crossings. Then I used the sign generating vi to generate another
square wave depending on if the value is positive negative or zero.
What I need to do now is to find the time duration between each zero
crossing.i.e. How much time elapses before the next zero crossing
occurs. Any ideas how to do this ?
Thanks and regards.

Here's a small VI which does part of that
Have a nice day!!!
LabVIEW | LabWindows/CVI | TestStand
Certified LabVIEW Architect
Attachments:
Duration between peaks.vi ‏18 KB

Similar Messages

  • How to measure time difference between zero crossing of a sine wave and rise time of a pulse on a same graph?

    I have a 50Hz sine wave and a pulse signal on a same graph. The phase difference between two is between 0-90 degrees.
    Now I need to calculate the time difference between (when the sine wave crosses zero volts) and (when the pulse rises). The frequency will stay approximately same for both signals.
    The application is for a three phase generator. In simple words, when the time difference between the zero-crossing of sine wave and the pulse rises increases, that means that the load on the generator has increases.
    I am a beginner user of LabView (version 9, 2009), maybe it is a very simple problem but I've been pulling my hair out for the last few days and coudln't figure anything out. Any help would be greatly appreciated. I am using DAQ USB-6008 to measure these voltages and pulse from the generator and a sensor
    I have attached a jpg (a graph that i just made with excel to explain). The time 't' is what I am trying to measure
    Cheers
    Awais 
    Message Edited by awais.h on 03-30-2010 11:20 PM
    Message Edited by awais.h on 03-30-2010 11:21 PM
    Solved!
    Go to Solution.

    Hi
    Thanks for the code but I'm afraid it won't work. Like you said the probability of choosing a value that is on both graphs may not happen. This is something that I would like the code to do automatically.
    But I did use the previous code posted and made some modifications to it and it seems to work perfectly. Now the next thing is to be able to get just that one value that tells you the first time difference.
    Here is what I get using that code.
    As you can see from the t Values. I only need the one that is highlighted. If there is a way to filter out the rest it would be great.
    I was thinking of a while loop and as soon as the value is higher than 3E-5 it would store the number and stop the loop, but I'm not too familiar with arrays in labview.
    Here is the the code modified.
    As you can see, it wasn't that big of a modification and it still is your code.
    I will keep trying.
    Thanks for the help
    Attachments:
    FinalShockSpeed.vi ‏55 KB

  • Zero crossing, "Triggering" and XY-Graphs

    I'm trying to measure the electrical hysteresis of a sample.  The way in which I do this is by measuring two voltages within a circuit, sending them to my DAQ, and then plotting them in an XY-Graph to view the shape of the curve.  I can somewhat see the hysteresis, but II need to measure the "zero-crossings"; that is to say, the value of one function, when the other is 0, and vice versa.  So when V1 = 0, I want to know what V2 is, and when V2 = 0, I want to know what V1 is.  Seems simple enough, and I have included my VI.
    First I tried the ZeroCrossingPtbyPt, along witha Relay, which never seemed to trigger properly.
    Second, I tried using Trigger and Gate, but that seems to give inflated values.
    This VI can be tested by removing the DAQ assitant and replacing it with two "Generate Signal"(s),  with the same frequency, different amplitudes, and a small phase difference, and this will produce a similar effect without the real signals.
    Next, I am sending the raw voltage signals into a Waveform Graph.  However, it is impossible to get the traces to stay "still" on the graph.  In other words, if this were a real oscilloscope, there would be a "triggering" problem, and if the trigger were set to the proper value, the oscilloscope would be able to track the waveform without it jittering left to right in time.  Any ideas on this?  I've tried to change just about everything in the Waveform Graph with no difference.  Do I need to send in some other signal to get the graph to follow the waveform properly?  This is really important because it will tell me if my sample rate is good enough to capture the signal (a sine wave at 1 kHz).
     Finally, the hysteresis curve on the XY Graph seems to cover many cycles (periods) of the waveform, but I want it to cover only 1 cycle at a time, so it isn't so sketchy-looking.  It's very boxy as well.  So in short, the number of points it is plotting is fine, but it is not plotting them quickly enough, since I'd like all of the points it plots to be over a single period of the waveform.
    Please help!  Thanks in advance.
    Attachments:
    hysteresis.vi ‏176 KB

    As it turns out, the issue was that I was not collecting enough samples at a high enough sample rate from the DAQ.  This is why it worked with "Generate Signals" and did not work with the DAQ Assistant.  Because there were not enough samples, the apparent zero crossing was occuring either too early or too late, leading to an incorrect value.  Therefore, the best solution when it comes to finding zero crossings is make sure your # of samples, and sample rate are high enough to get an accurate measurement.
    As a result, this is why my XY Graph was showing blocky hysteresis loops, rather than nice smooth curve hysteresis loops.  The data being sent to it was not quick enough, and therefore the XY- Graph connected the dots between the points that it was sent, yielding a truncated loop, which appeared blocky or sketchy.
    On the issue of triggering, this can apparently be set within the DAQ Assistant in the "Triggering" tab; the key is chosing the correct channel to trigger from, and a reasonable trigger level.  This was my problem, and this is why my Graph appeared to jitter.  It was not the graph itself, but the DAQ Assistant that did not tell it the proper triggering timing.
    So, in short, I solved my own problems, but I leave this as a record for those who encounter similar problems in the future.
    Thanks.

  • Record time of zero crossing

    I am trying to record the time for zero crossing in order to get the phase angle and inevitably get the power facto . soi was trying out a few ideas to  see if this is achievable and i came up with this . can someone tell me where i am wrong . or what to do  get the right values .. 
    Solved!
    Go to Solution.
    Attachments:
    zero crossing in waveform.vi ‏17 KB
    Zero Crossing.PNG ‏21 KB

    1. You need to pass the waveform into the Get Waveform Time Array.
    2. No need to wire up the N on the FOR loop since you are using Autoindexing tunnels.
    3. The Conditional Indexing tunnel is your friend here.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    zero crossing in waveform_BD.png ‏20 KB

  • Zero crossing and syncronizing

    I use 2 programs.I have atachetted them below.
     In "Line zero cross sync" I detect the crossings through zero of a sine and then for every crossing I try to write on a analog output an impulse.
     The second program "sincronizare cu reteaua subvi" measures the frequency of the signal and calculates a delay time.
     How can I delay the moment between detecting a zero crossing and writing the impuls, with the value calculated with the second program.
     The second problem: If I use a loop to delay the time how can I make sure that the two operations will be syncronized (if I modify the frequncy of the signal during the measurement I want the second program to modify the delay time simultaneously,not with a delay).
    I am using LabVIEW 8.0. 
    Thank you
    Attachments:
    Line zero cross sync.vi ‏85 KB
    sincronizare cu reteaua subvi.vi ‏32 KB

    I solved the problem.Thank you anyway

  • Looking for zero crossing point

    Hello,
    I have Amplitude vs. time data (wave).    
    I need to find the zero crossing time. Now I am using "For loop"  to search the Amplitude array for the index of the neighbor to zero through point by point, and then by linear inerpolating to get the zero crossing time.  When the point number is large, say 60kpts, it gets slow because the for loop "point by point" searching method, I think.
    I am wondering if there is any quick way to do that.
    Thanks,
    Wei Tong

    Try something like this, maybe? See if it makes sense.
    (It currently fails if a value is exactly zero and the function does not switch sign afterward. It just needs a bit more code to fix that. Modify as needed.)
    Message Edited by altenbach on 04-13-2008 12:52 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ZeroCrossings.png ‏33 KB
    ZeroCrossings.vi ‏57 KB

  • I wanted a zero crossing detector for a a acquired wave form.

    it shoul detect the zero crossing of a wave

    The technique for finding a zero crossing is basically to detect a change in sign between two consecutive numbers. You need to evaluate the previous number sign with the current number.
    A common way to do so is by multiplying the previous number and the current number. If the product is positive, both has the same sign and thus there was no zero crossing. If the product is negative, there was a zero crossing.
    Make sure you are sampling you signal fast enough to accurately detect when the zero crossing occur. If you know your signal, you may easily calculate the exact moment based on your aqcuired information.
    Best regards;
    Enrique Vargas
    www.vartortech.com

  • Phase angle measurement using zero crossing

    I am using  zero crossing to measure the phase angle between (voltage and current) which is represented as  two input in my vi  to  eventually get the power factor. But however the reading i got for the power factor remain at 1 all through no changes. I am using an SCT- 013 -000 current transformer for the current and a power transformer for the voltage 240 - 6V . below is my vi . Can anyone help me troubleshoot why my result is showing 1 for different loads  including resistive , capacitive and inductive loads . 
    Attachments:
    Phase Angle Measurement.vi ‏39 KB

    Are you working with Nigel91 who posted a similar question in the Electrical Power Suite board?
    You have the same problem that he has. For dt = 0.02 (equivalent to a 50 Hz sampling rate) you cannot measure anything about a signal with a frequency higher than 25 Hz. And you could not get meaningful phase information at frequencies above a few hertz.
    To get good phase information at typical power line frequencies sampling rates of 1000-1200 Hz or higher should be used.
    Lynn

  • Zero-cross​ing function

    Hi,
    I found this zero-crossing function in one of the old forums and I'm trying to understand how it works. In my case I have two sine waves, instead of one square pulse but I can't really figure out how this function works. I know that first, the waves are generated then you get their attributes, the data values go into the zero-crossing detector that controls the case statement but I don't know how the trigger time and time interaval are used to build the array, I think the timestamp outside the 'for' loop is for storing the previous itteration of the zero-crossings but I'm not really sure.I have no clue what happens in the final step before the zero-crossing times are subtarcted, as in the threshold array and so on. I've read how each function individually but I can't add the blocks together.
    So I was wondering if someone could please explain how this works?
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Zerocros.png ‏131 KB

    Adding to what crossrulz said, it helps to understand what the code you're looking at is.
    It would appear you don't quite understand what t0 and dt are.  t0 is the time at the initial point in the waveform.  This can be a wide variety of times rather than simply 0.  dt is the amount of time between samples.  If we multiply the iteration by dt, we know how much time has passed since the first sample.  After 0, 0dt is the same as 0s.  From there, 1dt, 2dt, 3dt, etc can all be calculated to a value measuring time.  But, it's only measuring "time since the first sample."  If it's only measuring that, the timestamp could be meaningless.  If you want to convert the time since first sample to an actual time, you need to add the initial time to it.  As an example, if dt is 1s and t0 is 4:00:00pm, after 3 samples we are at 2dt so 2 seconds.  Do we care about 2 seconds or 4:00:02?
    The "big timestamp array" is being fed into what is called a shift-register.  You can use this register to pass values between iterations of a loop.  Before the loop, we feed an uninitialized array into the shift register.  The first time the build array is used, it's fed an empty array and the first timestamp to save.  This is then output to the shift register on the right side of the loop.  This value is passed to the next iteration.  It will persist until we reach the build array for the second time.  Now, the 1 element array is fed into the top input of the build array and a new timestamp is added to the end of the array.  This will continue with the n-sized array being fed to the top input and the newest timestamp being added to the end to make an array of size n+1.  If we want to maintain all of the timestamps, we need logic similar to this.  You could plug it into the bottom and the new timestamp to the top.  This would put the newest timestamps in the first element of the array.  You just want to include the old array so you keep all of the timestamps instead of just the most recent.

  • Splitting up plots on XY Graphs depending on zero crossing

    Hi,
    I posted this question earlier and thought I got a solution. Please read the old thread: http://forums.ni.com/ni/board/message?message.uid=1098899#U1098899
    Basically, my problem now is that the way its being done now, whenever it crosses the zero axis with a negative slope, it temporarily creates another plot and as soon as it crosses it with a positive slope, it merges those 2 graphs together. So somewhere between the slope going from -'ve to +'ve and crossing the zero, I have an extra plot, and it distorts the colors of my plots, which seems like a bug to the user and may confuse them. I have attached a VI below where you can see this behavior in the 2D array indicator.
    Attachments:
    XY Example VI.vi ‏18 KB

    I don't know what your intentions are with this VI, or what you mean by "temporarily creates another plot".
    You've got a lot of array manipulation going on inside those loops.  You are just going to have to sit down, figure out how those loops are currently working, and how to change them if they aren't doing what you want.

  • CRM to BW extract - All Duration amounts are zero using 0CRM_SALES_ACT_1

    Hello,
    We are implementing the "CRM 4.0 Interaction Center with Winclient" and are using BW 3.1 for reporting.  The problem we are encountering is we are getting "DURATION" and "Face to Face Duration" amounts that are ZERO when extracting call center activity data using the data source 0CRM_SALES_ACT_1.  This data source feeds into the ODS 0SAL_DS01.  We are expecting the "Duration" amounts to be non-zero and represent the time the call center agent worked on a particular activity.  The data we are testing with has been entered manually and we are not yet connected using telephony server (so we cannot use the CTI data yet). 
    Any help regarding how I might solve this problem would greatly be appreciated.  Possibly this is a CRM configuration issue but don't know.
    Thanks and Regards,
    David Schroeder
    John Deere
    (309)748-1724

    Hi Silvio,
    I've experienced a similar problem with this extractor.  I attempted to Initialize Delta with Data Transfer to no avail.  The job ran for 12+ hours and stayed in "yellow" status (0 records extracted).  The following steps worked for me:
    1.  Initialize Delta without Data Transfer
    2.  Run Delta Update
    3.  Run Full Update and Indicate Request as Repair Request
    Worked like a champ, data load finished in less than 2 minutes.
    Hopefully this will help.
    Regards.
    Jason

  • "THE GAP...MUST HAVE A DURATION OF EITHER ZERO, OR AT LEAST 0.4 SECONDS.

    IN ENCORE CS3 - I get this "Problem" message when I check my project. It refers to "gaps" in my main timeline where all my video is set end to end. There are no visually perceivable gaps, and when I burn the disk, everything is fine. What does this message mean?

    I always create a separate Timeline for each and all Assets. I do not gang them on a single Timeline. When one does this, there are often gaps in the Video, because the Audio is longer, maybe just an Audio unit, or two. Also, depending on the Audio file type, there can be Duration differences, just because of encoding schemes. Cannot recall the numbers for the blocks, but Neil Wilkes has offered that up in several replies to similar posts. One way around this is to make sure to have a bit of Black Video on the Timeline in PrPro, and let the Audio end maybe 1 - 2 secs. earlier. Note too, that if one is doing DD 5.1 SS AC3's, many players, especially higher-end ones, need 02 sec. to "lock onto" the AC3, so 02 sec. of silent Audio is a good idea, or the music might not be heard until a few sec. into it. Neil refers to this a "Black Audio," but it's really silence.
    I just use Playlists to get the navigation that I require from the multiple Timelines.
    Good luck,
    Hunt

  • Extract First Zero Crossing After Peak

    I have a signal that approximates a noisy sine wave which I want to broadly break down into segments of negative and positive slope. As peak detection on the original trace is messy and the section of positive slope is complex, I plan to extract these features by working with the differential (the maximum velocity of the principle waveform is largely invariant and can be easily thresholded from the lower amplitude waveforms). I can easily detect the MIN peaks in the differential and now want to walk forward in the dataset to the first transition across the zero line and extract this timepoint to a new dataset. Does anyone have a script that I can modify for this purpose? Essentially, I want to trigger with an existing timepoint, iterate to the first timepoint where ti times ti+1 is negative and then write ti+1 to a new waveform.  I also want to walk backwards to the the first transition across the zero line and extract this timepoint to a new dataset but this is secondary.
    Thanks!
    Matt
    Solved!
    Go to Solution.

    Sorry for not responding earlier about my progess.
    I was able to extract the timepoints using your advice but now want to go back to the original data and extract the y-values. For some reason, my for loop below completes but only writes no-values? Extracting the x and y values in parallel won't work because I generated by x-value subset using the differential of the original dataset.
    The general question is as follows:
    Given a common timepoint, find the y-value associated with that timepoint in another channel.
    FOR i=1 TO InitContrLength
       ChDx(i, InitContrY) = ChDx(ChDx(i,InitContr)/Interval, Filtered)
       Next
    InitContr is an array of discontinuous time values which represent a subset of the original time series. My for loop is designed to iterate through the InitContr, converting them to an integer representing the appropriate row in my original dataset (Filtered) by dividing the time value by the step interval, and then writing the value from Filtered (which is an array of y-values) that corresponds to that row to InitContrY.
    Definitions in case the above is confusing
    InitContr = Channel containing a subset of time values
    Filtered = Channel containing all y-values from the original waveform
    Interval = step width of the original waveform
    InitContrY = New Channel that I want to write y-values to that correspond to InitContr x-Values
    Any ideas or links to a debugging primer would be greatly appreciated. If I could iterate through my for loop and visualize the variables in real time, I think I could figure this out myself.
    Matt

  • Clips and Pips - But it's not a zero crossing problem

    Hi there,
    I've been using a few drum loops in the arrange page, and at the start or end of each loop (can't work out which), I'm getting a pip. as though it hasn't been topped n tailed to the zero crossings properly.
    However this is just in the arrange page, if I loop it in sample editor, it's fine. I've tried fading in and out either end a split second either end, but it still happens. I've also ensured the regions in the arrange page are full length so it's not a case of them cutting off early or something.
    I can't work out what it is, I am 99.9% positive the sample itself is fine.
    Powermac G5 Dual 2ghz   Mac OS X (10.4.2)  

    Check your audio hardware sync settings. Sometimes they revert or change based on the order of devices you turned on in your rig or a crash in the audio engine part of the program.
    Running audio/midi setup can sometimes clear it up.

  • Problems with Zero Duration .flv files

    I've recently had to troubleshoot issues with over 1200 .flv files that have an incorrect duration of 0 (zero).  I know that the keyframe data has information on the duration in these files, but I'm wanting to access this data programatically at run time and update the player so the seekbar works as expected.  After a frustrating series of searches, I've not come up with a solution and would like to know if anyone knows how to solve this issue.
    I know it's possible, since the same file loaded into the Akamai utility shows the duration as Zero, but the seek bar has the correct time.
    Thanks,
    D

    That's why you can't convert...you are converting the supported frame rates.
    yes, EditReady is TONS better. They are always on top of the latest AVCHD formats (every camera uses a different variant of AVCHD).  It used to be that they had two apps...EditReady for QT formats and  ClipWrap2 for AVCHD...but they have now rolled all of those features into EditReady...one app for everything. They have a free demo so you can try it and see for yourself.

Maybe you are looking for

  • Macbook pro mouse and keyboard don't work after installing drivers.  Help!

    I just installed windows XP SP2 on a macbook pro 2.66 i7 running 10.6.4. I installed the boot camp drivers from my OSX install disk and now neither keyboard, trackpad, nor usb mouse work. Not sure what to do other than delete the partition and start

  • Script to create grants and synonyms for objects in database

    Hello, We are building a patch to be applied to the production environment. I want to create a script/sql query that builds a list of grants and synonyms for all the objects created after august 09. for ex: create or replace synonym abc for schema_na

  • Stand-alone JNDI lookup of an EJB in an Enterprise Application (EAR) build

    Hi All, I am having some difficulty doing JNDI look up an EJB 3.0 Bean that is part of an Enterprise Application (EAR) build. Below are all the related codes: package ejb; import javax.ejb.Local; @Local public interface Hello1Local {     public Strin

  • Updating value of af:inputText.

    Hi! I'm trying to modify the value of af:inputText using backing-bean, and I have the problem that the JSP Page doesn't update the values. The code is the following: JSP: <af:inputText readOnly="false" columns="30" binding="#{BckAltaATecnicas.zona}">

  • Screen sharing - difficult to show the dock

    I've had this problem in Mavericks and now again in Yosemite. When screen sharing with another computer whose dock "Automatically" hides and shows the dock, I have a very difficult time positioning the cursor so that a hidden dock will reveal itself.