How to measure time difference between two continous encoder pulse (PULSE A & PULSE B)

im trying to figure out the time difference between two square
wave pulse (PULSE A and PULSE B) from an encoder. I tried to modify many code but fail to capture thephase difference  for each pulse. the
pulse only rise to 5V and fall to 0V like normal square wave pulse
can you and all of experts here help me out with this?
my problem
1) Encoder pulse are continous (pulse A and pulse B)
2) Square wave pulse have "0V" and "5V" please rapidly
if possible someone show me correct method , Im using LABVIEW 7.1 and Hardware NI SCOPE (PCI 5102)
your advice are highly appreciated
among my idea as in attachment , but I failed to get it
Attachments:
Need to Get this wave.JPG ‏34 KB

Hi Amirul,
Check the attached JPG file. i think this will be use full to you
Regards,
Santhosh M

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

  • How to get percentage difference between two matrices?

    Good day everyone, I just want to ask how to get the percentage difference between two binary matrices. This is for comparing two images converted to matrices in LabView. Thank you. 
    Solved!
    Go to Solution.

    pinkman wrote:
    Good day everyone, I just want to ask how to get the percentage difference between two binary matrices. This is for comparing two images converted to matrices in LabView. Thank you. 
    You probably converted it to a 2D array (A matrix in LabVIEW has a special meaning).
    "Binary" is not very well defined (unless you are looking for the number of bits that are different). What is the datatype? Was it a color image or a greyscale image? Are both arrays the same size?
    How do you define "percentage difference"? Which one of the two is the 100% reference?
    Do you want a new 2D array where each element is the difference of the second array compared to the first (or vice versa), expressed in percentages?
    Do you want to know what percentage of array elements are different between the two arrays?
    Do you want to know the average difference between all array elements?
    All possible interpretations can be easily solved with very little code, but you need to explain in more detail what you actually want?
    Here is a simple solution for case #2, for example (assuming the array have the same size, and we only want a rought estimate, rounded down to the nearest integer percent):
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    PCT-Difference.png ‏16 KB

  • How to get the difference between two columns in a column group

    Hi All,
    My first time here and really new to programming. I would like to get the difference between 2 columns that are inside 
    a column group.
    Here is my sample table below: The Column Group is PeriodNumber and can only choose 2. like 1 and 2.. I would like to have a third row which will simply calculate the difference between the amounts in PeriodNumber 1 and 2.
                                PeriodNumber          
    Account                    1                            2     
    1) Cash                10,000                15,000
    2) Receivables      12,000                11,500
    3) Equipment          5,000                  5,500
    Total Assets          27,000                32,000

    Hi yabgestopa,
    From your description, you want to get the difference between two columns in a column group. After testing it in my environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
    Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
    Dim Shared Num1 As Integer
    Dim shared Num2 As Integer
    Public Function GetAmount(Amount as Integer, Type as String)
    If Type = "1" Then
    Num1=Amount
    Else
    Num2=Amount
    End If
    Return Amount
    End Function
    Public Function GetDif()
    Return Num1-Num2
    End function
    Right-click the second column to insert a third column with Outside Group-Right.
    Then use the expressions below in the matrix.
    =Code.GetAmount(Fields!Amount.Value,Fields!PeriodNumber.Value)
    =code.GetAmount(Sum(Fields!Amount.Value),Fields!PeriodNumber.Value)
    =Code.GetDif()
    The report looks like below.
    If you have any questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to get the difference between two date

    Hello,
    I want to know how to write a code the tell me the difference between two date, I am using
    oracle.jbo.domain.Date
    i have a rent date and return date so my code is
    Date rent=(Date)nr.getAttrbute("RentDate"),ret=(Date)nr.getAttrbute("ReturnDate");
    is there a way to know the difference in days between those two dates ?
    Thanks

    hi,
    try this.....
    DateFormat formatter = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy");
    Date date = (Date)formatter.parse(dateStr); //// dateStr <- from date value (that is string value)
    Date dateto = (Date)formatter.parse(datetostr); //// datetostr <- to date value (to date getting from as a string)
    Calendar cal = Calendar.getInstance();
    cal.setTime(date);
    Calendar calto = Calendar.getInstance();
    calto.setTime(dateto);
    fromDate = cal.get(Calendar.DATE) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.YEAR);
    toDate = calto.get(Calendar.DATE) + "/" + (calto.get(Calendar.MONTH) + 1) + "/" + calto.get(Calendar.YEAR);
    // System.out.println("from Date : " + fromDate);
    if ((fromDate != null && toDate != null) && (date.compareTo(dateto) > -1) ) {                  
    fc.addMessage("VacationQueryComponent", new FacesMessage(FacesMessage.SEVERITY_ERROR, "From Date cannot be lower than To Date", "From Date cannot be lower than To Date"));
    fc.renderResponse();
    thks.

  • How to get the difference between two HashMaps

    i have two HashMaps
    HashMap first = new HashMap<Integer,Object>();
    HashMap second = new HashMap<Integer,Object>();
    How to get the difference between one and two and put the result in the third
    HashMap third = new HashMap<Integer,Object>();

    My bad, difference of course means removeAll():Map<Integer,Object> first = new HashMap<Integer,Object>();
    Map<Integer,Object> second = new HashMap<Integer,Object>();
    Map<Integer,Object> third = new HashMap<Integer, Object>(first);
    third.keySet().removeAll(second.keySet());No loops needed.

  • How to get the difference between two BufferedImages?

    All the BufferedImage which is grabbed from AWT may be same each other,
    i only want to get the different part of two continuous BufferedImages and send ti over internet.
    I have compared two BufferedImages by RGB (int[]), but this process wastes 400~500ms,it's terrible,:)
    who has any good idea about this?
    thanks
    Best Wishes
    mauvespan

    thanks ! cary ,
    I have a list contained some BufferedImages gotten from AWT component,and then these images
    will be transfered to client and displayed in Internet explore ,actually there are only some difference
    between two continuous BufferedImages,i don't want to transfer the WHOLE image to client,SO i
    want to handler every image before sending to client , at last, the different part will only be sent to client.
    All these ideas will be contained this method:
    * Compare the specified two BufferedImages and return the different part between them.
    * @param ref the specified first image
    * @param gen the specified sencond image
    * @return the different part between the specified two images.
    public static void BufferedImage compareBufferedImage(BufferedImage ref,BufferedImage gen){
    to finish this method ,do you have any good ideas?or sample code?
    thanks
    Best wishes
    mauvespan

  • How to write a VI to measure the difference between two analog inputs (voltage)

    I'd like to measure the difference voltage between two analog inputs.
    Could someone write me a VI for it, please?
    I'm new with Labview....
    Thanks a lot!!!

    On the numeric palette, there is a function called subtract. As the
    help for it says, it 'Computes the difference of the inputs.'.
     Since
    this is such a simple process, you need to provide some details on why
    you can't do this. You can wire just about any data type into the
    inputs. Post your code if you need further help.
    Message Edited by Dennis Knutson on 04-05-2009 08:23 AM
    Attachments:
    Subtract.PNG ‏1 KB

  • How to improve time interval between two measurments

    Hi All..
    I have 3 Vi each of one measures from different devices. And i set the execution order by error cluster. I wonder what is duration between of each of execution? if you look at the VI that i attach, u see that 3 (one of which is seen as question mark)  are  connected serially, but the problem is that there is a delay between measurements that i can distinguish just looking data values acquisation(then should be really high). How can i improve time interval between measurements? I need to measure 3 output when the conditions are the same for all, but when there s delay the condition of device 1 and 3 could be different and effecting my project.
    Attachments:
    measurement.vi ‏91 KB

    Hello,
    >> I wonder what is duration between of each of execution?
    You can use the tick count function and a sequence structure (not usually recommended, but ok for debug purposes like this).
    >> How can i improve time interval between measurements?
    It sounds like you want your 3 measurements to be relatively independent, but to all be triggered by the same event.  How about setting up a loop for each measurement -  using an event structure in those acquisition loops - and then monitoring your "trigger condition" in a 4th independent loop, which will trigger a user event to cause the other loops to execute accordingly.
    If you are eventually going to scale things further, you may explore other architectures instead of simply creating more loops.
    If you can clarify what you're trying to do here, we can probably help you further!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • How to measure the shift between two resembling images using LabVIEW?

    I am running an experiment in which I use a microscope to map the surface of a laboratory sample and due to some small drift consecutive image appear displaced. In order to correct for the drift I need to first measure it, which I can do by recording two images and finding the shift between. Because of some small random noise which adds to each image, the features in two consecutive images are not completely identical, but they do resemble each other very well. Do you have any suggestions on how to measure this image shift (in both x and y) using LabVIEW (I have version 8.20)?

    Hi, thanks for the answer, I´ll try to see if a 2D cross-correlation will work. I also attached two typical images with a small shift between them (there is also some change in background between them, but I belive the shift should still be measurable).
    Attachments:
    Image1.png ‏285 KB
    Image2.png ‏267 KB

  • How to find the difference between two date?

    Hi,
    I currently writing a date comparision program. Below is the idea analogy,
    Currently i need to find how many day differences between 30 July 2003 and 22 June 2004. How can i use java to code it?
    Thanks.

    there doesn't seem to be a direct way but try this:int daysBetween = 0;
    Calendar c = new GregorianCalendar(2004, Calendar.JULY, 30);
    Calendar d = new GregorianCalendar(2003, Calendar.JUNE, 22);
    while (c.get(Calendar.YEAR) != d.get(Calendar.YEAR)) {
        daysBetween += 360;
        d.add(Calendar.DAY_OF_YEAR, 360);
    daysBetween += c.get(Calendar.DAY_OF_YEAR) - d.get(Calendar.DAY_OF_YEAR);This gives the correct result of 404 (= 8 days from June 22 to June 30 + 366 days between July 1 of 2003 and 2004 + 30 days from July 1 to July 30)

  • How  to get  time diff between two rows ???

    I need to calculate the time difference of rows based on a column's value how do i do that ??
    say i have a table statistics
    id timing
    100 10-JAN-07 09.52.10.000000 AM
    200 10-JAN-07 09.59.10.000000 AM
    300 10-JAN-07 09.59.30.000000 AM
    I want to get the time taken by 200 ie timing of 200 - timing of 100
    how do i get that .
    similarly for id 300 and so on .
    regards
    Shub

    SQL> create table mytable
      2  as
      3  select 100 id, to_timestamp('10-JAN-07 09.52.10.000000 AM','DD-MON-RR HH:MI:SS:FF AM') timing from dual union all
      4  select 200 , to_timestamp('10-JAN-07 09.59.10.000000 AM','DD-MON-RR HH:MI:SS:FF AM') from dual union all
      5  select 300 , to_timestamp('10-JAN-07 09.59.30.000000 AM','DD-MON-RR HH:MI:SS:FF AM') from dual
      6  /
    Tabel is aangemaakt.
    SQL> select id
      2       , timing
      3       , timing - lag(timing) over (order by timing) diff
      4    from mytable
      5  /
       ID TIMING                         DIFF
      100 10-01-07 09:52:10,000000000
      200 10-01-07 09:59:10,000000000    +000000000 00:07:00.000000000
      300 10-01-07 09:59:30,000000000    +000000000 00:00:20.000000000
    3 rijen zijn geselecteerd.Regards,
    Rob.

  • How to get the difference between two dates???

    HI I have two dates and I want to test if there is an hour between them.
    Is there a way to compare two dates like mySQL can with dateDiff(date1,date2);
    Thanks alot.
    Graham

    This link is now out of date as they have revamped the structure. Yep. Here it is again: http://forum.java.sun.com/thread.jsp?forum=31&thread=502686
    I've also noticed that my comment regarding daylight saving was misleading. The demonstrated method for calculating difference between Dates is reliable. However, one needs to be careful when interpreting Dates in a daylight saving timezone.

  • How to calculate the difference between two dates?

    Hello,
    I would like to write some code which figures out how many days are between the Date_of_change (which is of datatype DATE, length 7 and of format DD-MON-YY) and the current date today. Then if the difference between Date_of_change and the current date is greater that 30 days for example then I would like to delete that record from the database.
    Thanks
    Doug

    Something like this should work:
    SQL> select * from emp order by hiredate ;
         EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO
          7934 MILLER     CLERK           7782 21-OCT-2005       1300                    10
          7902 FORD       ANALYST         7566 22-OCT-2005       3000                    20
          7900 JAMES      CLERK           7698 23-OCT-2005        950                    30
          7876 ADAMS      CLERK           7788 24-OCT-2005       1100                    20
          7844 TURNER     SALESMAN        7698 25-OCT-2005       1500          0         30
          7839 KING       PRESIDENT            26-OCT-2005       5000                    10
          7788 SCOTT      ANALYST         7566 27-OCT-2005       3000                    20
          7782 CLARK      MANAGER         7839 28-OCT-2005       2450                    10
          7698 BLAKE      MANAGER         7839 29-OCT-2005       2850                    30
          7654 MARTIN     SALESMAN        7698 30-OCT-2005       1250       1400         30
          7566 JONES      MANAGER         7839 31-OCT-2005       2975                    20
          7521 WARD       SALESMAN        7698 01-NOV-2005       1250        500         30
          7499 ALLEN      SALESMAN        7698 02-NOV-2005       1600        300         30
          7369 SMITH      CLERK           7902 03-NOV-2005        800                    20
    14 rows selected.
    SQL> delete from emp where hiredate < sysdate - 30 ;
    10 rows deleted.
    SQL> select * from emp order by hiredate ;
         EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO
          7566 JONES      MANAGER         7839 31-OCT-2005       2975                    20
          7521 WARD       SALESMAN        7698 01-NOV-2005       1250        500         30
          7499 ALLEN      SALESMAN        7698 02-NOV-2005       1600        300         30
          7369 SMITH      CLERK           7902 03-NOV-2005        800                    20
    4 rows selected.
    SQL>

  • How to find structural differences between two tables?

    I want to find the difference in structure between objects in two 11g databases:
    Here I want to identify:
    tables/ Views with same columns, same datatype, precision and constraints
    Identify if the same indexes and triggers are present.
    I do not want to compare the data.
    can someone give suggestions on this please?

    my first resource for SQL Developer questions is (That) Jeff Smith: http://www.thatjeffsmith.com/archive/2012/09/sql-developer-database-diff-compare-objects-from-multiple-schemas/.

Maybe you are looking for

  • Running Shell Commands (not Executable) in Unix from Java

    What are my options to run shell commands from Java? My goal is to change my existing shell environment variables to some new ones provided by .anotherProfile. Using an executable from Java is not an option because it does not work i.e. ( exec(". /ho

  • Why Will Facetime not let me sign in?

    I got my iPod Touch 4 in San Francisco Apple Store, December 2010. Apple Store Rep helped me set it all up. Everything has been working fine, until a week or so ago when, out of the blue, my FaceTime just stopped working. When I click on the FaceTime

  • HP LaserJet 4700dn - Does Not Init.

    I have an HP LaserJet 4700dn that has suddenly decided that it doesn't want to start up. Printer powers on, 3 lights on the front (Ready, Data, Attention) are all solid lit and do not turn off. Screen backlight comes on, but the screen never displays

  • Hp stream running out of space due to windows updates.

    So having had my stream 14 for a few months now it was in need of a clean up and so I decided to factory reset it and discovered a serious issue regarding lost drive space caused by windows updates. In factory shipped condition, the system uses some

  • Problems with adobe in Vista

    I keep getting an error message "site advisor has crashed" each time I try to download adobe acrobat to my Windows Vista Premium systerm. Can't read any PDF files, though i could until a couple of weeks ago.