PCI-6602, How to convert Pulse Width to RPM and stop updating datalogging at 30 RPM

Hi all,
My objective is to stop updating data logging pulse width measurements at 30 RPM so I can record the time lenght it takes the RPMs to stop from 6000 to 30 RPM. When I turn off the tool. I have an encoder attached to an output shat of a 6000 RPM circular saw. I have created 3 program methods, but I was not able to stop at 30 RPM. The last pulse width value the data log updates is around 200 RPM. I don't know if I'm using the right method to read RPMs? 
System:
1)     NI-PCI 6602 Counter/Timer Card
2)     SBC-60 Connector Block
3)     TRD-S1000-VD Encoder. 1000 PPR
4)     LabVIEW 8.5.1
5)     PC Dell Precision T3400 (32-bit), Intel Core Quad 2.4GHz, Memory 2GB. Windows XP prof.
In method 1: I reading pulse width and converted to RPM with this formula. RPM = 60/(1000 PPR/ Pulse Width).
In method 2: I just measuring pulse width and try to stop while loop when pulse width value is greater than 0.002 mSec. by using this formula 60sec/30rpm = 2 sec/rev, 1 Rev = 1000 counts. Therefore,     2 Sec / 1000 Counts = 2 mSec/Cnt (0.002)
In method 3: I measuring pulse width using this formula,                                                                   Pulse Width (in Sec) = Count/Counter Timebase Rate (20MHz), One period is 1000 cnts X 0.002mSec = 2. Therefore, Pulse Width = 2 / 20MGz = 0.000000100  
All three methods stop recording pulses around 200 rpm. I wonder if the formulas I utilizing, are not using them properly. Or there is floating point number conversion???? Please See attached Picture.
  Any help is greatly appreciated. THANKS!!!
Carlos G.

Charles_DeJesus,
Could you check the output waveform of the encoder? Do you see spikes? Sometimes spikes might produce wrong counts. 
CarmenC

Similar Messages

  • We have 3 locations coming up for our TV listings how do we make one the default and stop others?

    We have 3 locations coming up for our TV listings how do we make one the default and stop others?
    There is Bed Room, Living Room and Family how can we make ONLY FAMILY COME UP?
    When we check the listings or record from the TV Listing the LIVING ROOM comes up and only the Family has the controls to record.
    THANK YOU.
    Solved!
    Go to Solution.

    Please provide more details.
    What equipment do you have?
    Where do you see this listing? On STB? Online? Verizon App?
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.

  • In my iPhoto library i have photos of web pages i don't know how they got there there are hundreds of them ,how do i get rid of them and stop them please help me

    in my iPhoto library i have photos of web pages i don't know how they got there there are hundreds of them ,how do i get rid of them and stop them please help me as i have no idea many thanks

    im sorry to be a bit thick here i didnt know this was happening until i looked through all my photoes i use an sd card to put pictures on lap top and icloud from my phone but in library there are all web pages i have ever been to ie face book ebay etc i didnt know if there was any thing i should be turning off many thanks for ur last answer though

  • PCI 6602:How can I use the digital lines of the board and in the same time to generate pulse train using a counter?

    Hello!
    My problem appeared when I tried to update my code from Traditional NI-DAQ Legacy to DAQmx.
    I am using 2 counters (counter 5 and counter 7)  from PCI-6602, to generate pulse train, and also the Digital I/O lines of the port 0 (the lines form 0 to 7). What I do in my application is that I am starting to generate the pulse train on the output of the 2 counters, and after that I am playing with the state of the digital lines.
    In traditional there was no problem using the counters and the digital lines in the same time, everything was going perfectly, but in DAQmx this is not possible.
    What happens: I start to generate pulse train on the output of the counters,  no errors encountered, but when I try to modify the state of one line of the digital port the generation of the pulse train is stopped. This is happening when I start the task associated to the digital port.
    My question is: it is possible to create a channel on the digital lines without altered the channels created for the counters?
    Another thing what I manage to see using the  "Measurement & Automation Explorer" and Test panels for PCI-6602, basically is the same thing, I generate pulse train on the output of the counter 7 and try to start a task on the digital line, but I get one error :
    "Error -200022 occurred at Test Panel
    Possible Reason(s):
    Measurements: Resource requested by this task has already been reserved by a different task.
    Device: Dev4
    Terminal: PFI8"
    Instead if I use the counter 0 or counter 1 to generate pulse train I don't encounter the same problem.
    Which resources are used by the counters 2 to 7 from the PCI-6602 board and the counters 0 and 1 do not use?
    Thank in advance for any replies!
    Ciprian
    Solved!
    Go to Solution.

    Hello Jordan, thank you for your reply.
    I am sorry but I can not see or run your example, I don't use LabView, I use Visual C++ for developing.
    Here is the code for generating the pulse train:
    GeneratePulseTrain(unsigned long ulCount1, unsigned long ulCount2)
        short nStatus = 0;
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        nStatus = DAQmxCreateCOPulseChanTicks (m_taskHandle, "Dev4/count5", "", NULL, DAQmx_Val_Low, 0.0, ulCount1,ulCount2);
        if( bTriggerMode == true) // if hardware trigger is enabled
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Src,"Dev4/PFI17" );
        //set the internal timebase
        nStatus = DAQmxSetCOCtrTimebaseSrc(m_taskHandle,"Dev4/count5","20MHzTimeBase" );
        nStatus = DAQmxStartTask(m_taskHandle);
        return nStatus;
    And the code where I try to set the digital line:
    SetChannelState(short nState)
        short nStatus = 0;
        uInt8 wrtBuf0[1]={0};
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        // Configure line as output 
        nStatus = DAQmxCreateDOChan (m_taskHandle, "Dev4/port0/line0", "", DAQmx_Val_ChanPerLine);
        nStatus = DAQmxStartTask(m_taskHandle);
        wrtBuf0[0] = nState;
        nStatus =DAQmxWriteDigitalLines (m_taskHandle, 1, 0, 0, DAQmx_Val_GroupByScanNumber , wrtBuf0, NULL, NULL);
        nStatus = DAQmxWaitUntilTaskDone(m_taskHandle,10);
        nStatus = DAQmxStopTask(m_taskHandle);
        nStatus = DAQmxClearTask(m_taskHandle);
        m_taskHandle = 0;
        return nStatus;      

  • How to convert pulses into RPM

    I am using a counter to count the pulses given from a hall sensor to detect the speed of a motor. I can see the pulses on the graph and I have the operation running in a while loop but I am having issues with setting up a fixed time for the counter to run. I am using a USB 1208LS DAQ which requires Universal Library and I don't know how to convert the pulses that I get into a frequency or RPM's.  
    I just learned how to use Labview so this is getting pretty frustrating.
    Thanks! 

    I am not very familiar with the hardware you have or the Universal Library.  It seems from the spec page for the device however that it does not have any counters on it.  So is this being read in as a digital channel or an analog channel, because I did not see any specifications on the sampling rate of the digital channels?
    If this is coming in as an analog signal there are some signal processing VIs that you can use to determine frequency. Specifically Extract Single Tone Information.VI will find the frequency of your analog signal.
    Doug Farrell
    Product Manager - Condition Monitoring
    National Instruments
    National Instruments Condition Monitoring

  • PCI-6602: How do I ensure that it is functioning properly??

    Hi!
    I have installed a PCI-6602 into my system.
    I have ran a "Self-Test" on the board and it says it passed.
    We are trying to generate a pulse through PFI36 cntr0. For some reason, it is not generating the signal from the software we recieved from another company.
    Is it possible that a NI-DAQmx version difference could be driving this problem? We have a 8.8.0f2 and they have 8.7.1f3.
    Are there any other "Self-Tests" we can run on this board to ensure that the NI board is functioning properly?
    What other problems could we be looking at?
    Thanks for your time!

    Hello,
    You can do this:  Set up a slow pulse train for CTR0 (1Hz).  Set up a continuous digital channel read for Port 0 Line 0 on your card.  Hook up CTR0 output (pin 5) to P0.0 (pin 10).  Start your program to do the counter output pulse train and continuous read.  You should see your digital line transition from high to low over time.  The examples you can use to set this up are Gen Dig Pulse Train-Continuous.vi and Cont Read Dig Chan-Int Clk.vi.  For Cont Read Dig Chan-Int Clk.vi, remove the DAQmx Timing VI to make it software timed, and connect the task handle and error wires accordingly. They can be ran from separate VI's as they don't use the same resources. 
    To be exact on the verbage used, you can perform a self-test on the device by right clicking the device in Measurement and Automation Explorer (MAX) and select Self-Test.  As for testing the device manually, go with what I described above. 
    Kyle A.
    National Instruments
    High Speed Digital I/O Product Support Engineer - R&D

  • Wpf/webbrowser:-how to get height,width,scroll height and scroll width of render html/xhtml/xml pages.

    hi I am using to web browser control to get  height,width,scroll height and scroll width in wpf c#.
    Could You please tell me how to achive this information if .pages contain this css on body.
     style="-webkit-column-width:800px;  margin-right:800px; -moz-column-width: 800px; column-width: 800px; -webkit-column-gap: 0px; -moz-column-gap: 0px; column-gap: 0px; -webkit-column-rule: 0px solid #000;-moz-column-rule: 0px solid #000;column-rule:
    0px solid #000; height:800px; overflow:visible !important; ; margin:0px; -moz-margin:0px;-webkit-margin:0px;display:block;"
    I have to get height,width,scroll height and scroll width  on on complete event.
    this is MainWindow.xaml page
    <Window x:Class="WPFWebBrowserInvokeScript.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="820" Width="820" Loaded="Window_Loaded">
        <Grid>
            <WebBrowser HorizontalAlignment="Left"
       Height="800"
       Margin="10,10,0,0"
       VerticalAlignment="Top"
       Width="800"
       Name="MainBrowser"/>
            <!--<Grid x:Name="grid1"></Grid>-->
        </Grid>
    </Window>
    this  MainWindow.xaml.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using System.IO;
    namespace WPFWebBrowserInvokeScript
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
            public MainWindow()
                InitializeComponent();
            private void Window_Loaded(object sender, RoutedEventArgs e)
                string strHtml = "";
                using (StreamReader sr = new StreamReader("D:/epubunzip/ePub2_Sample03a_USgovernment_SE_Gr9-12_EN_U1/OPS/9780547451381_c01.html"))
                    strHtml = sr.ReadToEnd();
                    strHtml = strHtml.Replace("<body>", "<body  style=\"-webkit-column-width:800px; overflow:visible !important;  -moz-column-width: 800px; column-width: 800px; -webkit-column-gap:
    0px; -moz-column-gap: 0px; column-gap: 0px; -webkit-column-rule: 0px solid #000;-moz-column-rule: 0px solid #000;column-rule: 0px solid #000; height:800px; ; margin:0px; -moz-margin:0px;-webkit-margin:0px;display:block;\">");
                    string str = "<script> function execScript(){return document.body.scrollWidth;}</script></head>";
                    strHtml = strHtml.Replace("</head>", str);
                    byte[] bytes = Encoding.UTF8.GetBytes(strHtml);
                    MemoryStream ms = new MemoryStream();
                    ms.Write(bytes, 0, bytes.Length);
                    ms.Position = 0;
                    MainBrowser.NavigateToStream(ms);
                    //MainBrowser.NavigateToString(strHtml);
                    MainBrowser.LoadCompleted += new LoadCompletedEventHandler(MainBrowser_LoadCompleted);
            void MainBrowser_LoadCompleted(object sender, NavigationEventArgs e)
    //here I am trying to get  height,width,scroll height and scroll width
    //It's gtting wrong info
              WebBrowser webBrowser = (WebBrowser)sender;
                //mshtml.htmld webDocument = (mshtml.HTMLDDElement)webBrowser.Document;
                //mshtml.HTMLBody webBody = (mshtml.HTMLBody)webDocument;
                //    var dd = webDocument.InvokeScript("execScript");
                //    //  string script = "document.body.style.overflow ='hidden'";         
                //    // var dd = webDocument.InvokeScript("execScript", new Object[] { script, "JavaScript" });
                //    var elems = webBrowser.Document.GetElementsByTagName("body");
                //    System.Windows.Forms.HtmlElement webBody = (System.Windows.Forms.HtmlElement)webDocument.Body;
           

    >>if i am rendering html from MemoryStreamor string in webbrowser control in wpf It's not applying this css
    Yes it does. If you for example add background-color: yellow; to the stlyle you will see that the page turn yellow:
    strHtml = strHtml.Replace("<body>", "<body style=\"-webkit-column-width:800px; background-color: yellow; overflow:visible !important; -moz-column-width: 800px; column-width: 800px; -webkit-column-gap: 0px; -moz-column-gap: 0px; column-gap: 0px; -webkit-column-rule: 0px solid #000;-moz-column-rule: 0px solid #000;column-rule: 0px solid #000; height:800px; ; margin:0px; -moz-margin:0px;-webkit-margin:0px;display:block;\">");
    If the styles doen't get applied as expected it is a browser issue. The WebBrowser control emulates Internet Explorer in IE7 rendering mode by default.  You will have to change some registry settings to change this behaviour. Please refer to the following
    links for more information:
    http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/cf66e0cd-ab6f-45b8-b230-1d78f26670d2/opening-links-from-wpf-webbrowser-control-in-default-browser-instead-of-ie?forum=wpf
    -moz-column-width only works in FireFox for example.
    You may also navigate to an actual page and inject some javascript function that for example adds the styles to the body element dynamically or set the style properties of the body element directly:
    private void Window_Loaded(object sender, RoutedEventArgs e)
    MainBrowser.Navigate(@"E:/Epubs/ePub2_Sample05_Biology_SampleChapter_EN/OPS/ch01.xhtml");
    MainBrowser.LoadCompleted += new LoadCompletedEventHandler(webb_DocumentCompleted);
    private void webb_DocumentCompleted(object sender, NavigationEventArgs e)
    WebBrowser webBrowser = (WebBrowser)sender;
    dynamic doc = webBrowser.Document;
    //int _scrollWidth = (int)webBrowser.InvokeScript("execScript");
    //mshtml.HTMLDocument webDocument = (mshtml.HTMLDocument)webBrowser.Document;
    mshtml.HTMLScriptElement script = (mshtml.HTMLScriptElement)doc.createElement("script");
    script.setAttribute("type", "text/javascript");
    script.innerHTML = "function doSomething(){ /* do something here... */ }";
    //add script to the head
    dynamic head = doc.getElementsByTagName("head")[0];
    head.appendChild(script);
    mshtml.HTMLBody body = (mshtml.HTMLBody)doc.getElementsByTagName("body")[0];
    body.style.background = "yellow";
    //set any body.style property here...
    webBrowser.InvokeScript("doSomething");
    That's about it as far as WPF is concerned.
    Please remember to mark helpful posts as answer and/or helpful.

  • How to convert decimal numbers to Hours and minutes

    Hi,
    I am using SSRS 2005. I want to convert decimal numbers to Hours and minutes.
    Say suppose, I am adding daily work hours and minutes and the total is 208.63.
    Here 208 hrs and 63 minutes. How to convert this to 209 hrs 03 minutes in SSRS.
    Any In-built function is there? or how to do using custom code?
    Appreciate your help.
    Regards,
    Bala

    suppose if field name is TotalDailyHours you can do it as below
    =CStr(Cint(Floor(val(Fields!TotalDailyHours.Value)) + ((val(Fields!TotalDailyHours.Value)-Floor(val(Fields!TotalDailyHours.Value)))*100)/60)) + ":" +
    Right("00" +Cstr(Cint(((val(Fields!TotalDailyHours.Value)-Floor(val(Fields!TotalDailyHours.Value)))*100) Mod 60)),2)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to convert a file of emails and the attachments to pdf?

    In adobe pro XI, how do you convert a file of emails AND their attachments to pdf?

    Unfortunately, that did not work either. I am thinking this may not be possible (at least with 10.1.3.4). What I was hoping for was that I could audit the presentation catalog groups and users. I want to be able to get a list of all the users and the groups they are listed in. Again, this would be helpful so we do not need to keep an external record. If we are removing access to a user or updating the group, we want to make sure we remove them from all applicable groups (Settings>Administration>Manage Presentation Catalog Groups and Users)

  • How to convert days to years, months and remaining days

    Hi All,
    I have the number of days for example : 398 days how to
    convert 398 days to number of years and number of months and remaining days
    like 398 days 1 year , 1 month and 2 days
    Regards
    rkrao

    e.g.
    SQL> select sysdate, sysdate - 1234 from dual
      2  /
    SYSDATE   SYSDATE-1
    09-AUG-06 24-MAR-03
    SQL> select trunc(trunc(months_between (sysdate, sysdate - 1234))/12) yrs,
      2  mod(trunc(months_between(sysdate, sysdate - 1234)), 12) mnths,
      3  sysdate - add_months((sysdate - 1234), trunc(months_between(sysdate, sysdate - 1234))) dys
      4  from dual
      5  /
           YRS      MNTHS        DYS
             3          4         16
    SQL>

  • How to convert  Timestamp  into exact Date and Time(FM)

    Hi Gurus,
    could anyone tel me  ,
    e.g:20.11.2008:11:23:54am
    How to convert Time stamp  into exact Date and Time

    Hi,
    Following is one way of doing it
    Timestamp timeStamp = new Timestamp(Calendar.getInstance().getTimeInMillis());
              System.out.println(timeStamp);
              SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
              System.out.println(dateFormat.format(timeStamp));
              SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
              System.out.println(timeFormat.format(timeStamp));
    Output
    2008-11-20 11:59:35.693 -> Timestamp
    11/20/2008
    11:59:35
    Regards
    Ayyapparaj

  • How to convert XML doc to string and vice versa?

    Assume I have a XML doc and I want to convert it into a string (and put it into a string variable).
    How can I do this?
    How can I do the opposite: Convert a string content into a XML doc?
    Peter

    Use:
    ParseEscapedXML() and ora:getContentAsString()
    See
    http://www.codeguru.com/cpp/sample_chapter/article.php/c10789__7/
    Marc

  • How to convert excel data into OTF and FAX

    Hi All,
    We have a requirement where in we have a smartform output (OTF data) converted into PDF, and an excel sheet, both being sent as email attachments.
    Now, we need to send the content of both the attachments as FAX.
    Since smartform output was OTF convertible, FAX was being sent using 'CONVERT_OTF_AND_FAX' FM.
    Can you let me know, if there is a possible way for manipulating the data that is converted to EXCEL, as OTF, and then FAX it?
    Or else, please suggest me an alternative way to FAX normal data (other than using 'CONVERT_OTF_AND_FAX').
    Thanks in advance,
    RAVI

    Hi All,
    We have a requirement where in we have a smartform output (OTF data) converted into PDF, and an excel sheet, both being sent as email attachments.
    Now, we need to send the content of both the attachments as FAX.
    Since smartform output was OTF convertible, FAX was being sent using 'CONVERT_OTF_AND_FAX' FM.
    Can you let me know, if there is a possible way for manipulating the data that is converted to EXCEL, as OTF, and then FAX it?
    Or else, please suggest me an alternative way to FAX normal data (other than using 'CONVERT_OTF_AND_FAX').
    Thanks in advance,
    RAVI

  • How to convert Xstring to PDF format and send pdf to multiple user

    Hi to all
    can any one provide me saple code to convert Xstring to PDF format and send pdf to multiple user
    i have searched the SDN , but cant get any proper soulution.
    I shall be thankful to you for this.
    Regards
    Pavneet Rana

    Use function module 'SCMS_XSTRING_TO_BINARY' to convert from XString to a Binary table. Just like this:
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer          = lv_xstring_pdf
          append_to_table = ' '
        TABLES
          binary_tab      = lt_doc_content.
    To send the email in an OO way you should user class CA_SEND_REQUEST_BCS. Take a look to program BCS_EXAMPLE_6 or any of the test programs in package SBCOMS.

  • How to use counter as an start and stop trigger in 6009

    Hi ALL.
    I'm using USB 6009 as a subject of to acquire data.
    I would like to know on how to use the counter digital input as a start and stop trigger. 
    The acquisition will only start when the first pulse of the digital signal is received and it will stop when the desired number of pulse is received.
    I was trying to use the VI as attachment as my reference. However, after tried, the VI is not working for USB 6009 as the counter input cannot be used as a trigger.  
    I would be happy if anyone could suggest me some ideas on this matter.
    Thanks.
    Attachments:
    DigitalStartandStopTrigger.vi ‏32 KB

    Hi Kate. 
    Thanks for your response.
    For your information, I've design my VI using the counter method. However, it doesnt work well. Please see the figure below. The file also attached with this reply.
     At first, the first counter from Device 2 will start counting. If the counting equal 0, then the acquisition for Device 1/AIO also the counter of Device 1/ctr0 begin acquiring data and counting the edges respectively.
    However, when I did the test, it doesn't work as wanted. It is happened because when counter of device 2 in not equal to 0, the acquisition for Device 1 not happened as it will go to false state.
    Is there anything that someone could suggest on how to start the acquisition for device 1 only and if the counter of device 2 is equal to 1. I would like the acquisition of device 1 start only when the counter of device 2 is equal to 1. I cannot use the trigger as 6009 is not support for it. 
    -Fird- 
    Message Edited by Fird on 07-02-2009 04:28 AM
    Attachments:
    Acquire Data Test 4.vi ‏27 KB

Maybe you are looking for

  • Error 4280 for Matshita UJ-831Da - Burn no longer works w/  iTunes.

    23 Dec 07 MY SYSTEM: Sony laptop CD/DVD drv = Matshita UJ-831Da iTunes ver. 7.5.0.20 PROBLEM: 1. Burn quit working when iTunes upgraded to 7.2. 2. I now get Error 4280. 3. The only change was an upgrade to iTunes. 4. No other software, or OS, changed

  • Surround Mix with Logitech Z-5500 Digital

    Hello, I have a project for a 3D animation short movie, and I'll also make the score and sound effect for it, to make a DVD. I don't have Logic Pro yet; I have Logic Express. Is it possible to use a Logitech Z-5500 Digital set to do the surround mix

  • HP LP3065 - problems selecting input

    Dear people, Quite some time ago I purchased the LP3065 monitor, it has always worked perfectly well. Until recently II had only one PV with DVI output. No matter which of the inputs on the monitor I connected the cable to, it worked perfectly well.

  • Automator's Filter Finder Items behaves incorrectly

    Can anyone confirm the misbehaviour of the Filter Finder Items in Automator when set to filter items whose date created is not in the last 7 days?  I have a workflow being used as a folder action to keep my downloads folder tidy but never runs right

  • Mail opens and instantly crashes

    When I launch Mail, the app will open and I can see my inbox loading when suddenly, after just a few seconds, the program unexpectedly quits. I tried moving the .plist file for Mail and the program opens fine but then all of my accounts and messages