Time control in loops

Hello!
I try to make a real-time program run with a more or less constant speed in an iteration.
Lets say at beginning of the loop "A", there should be "X" milliseconds when loop reach "B".
The execution time of the code between A and B, may vary.
I want the time to be quite constant.
Any sugestions how to handle that?

Hello!
I try to make a real-time program run with a more or
less constant speed in an iteration.
Lets say at beginning of the loop "A", there should be
"X" milliseconds when loop reach "B".
The execution time of the code between A and B, may
vary.
I want the time to be quite constant.
Any sugestions how to handle that?Use abbot -- A better bot. (google search, downloadable from sourceforge)
import abbot.tester.Robot;
Robot r = new Robot();
r.delay(8000);

Similar Messages

  • Using timer/counter with PCI-6221/USB-6210 to control timed-loop VI

    Dear all,
    I need to ask about two devices and one of their functionalities, PCI-6221 and USB-6210. For our NI-based system, we need to control some timings in a Timed-Loop vi, for that currently we are using PCI-6221 and we give external TTL signal (at 1 kHz) to it,
    recenntly we need to make some changes and for that we found USB 6210 DAQ to be more suitable, but we need to clear ourselves on some specific things.
    Can the counter/timers functions available in the either PCI 6221 or USB 6210 can be used to control the Timed-loop VI by giving external clock or by using their own internal clock source?
    Although we are using external clock with the PCI 6221 but we want to know about the usage of their internal clock, also are controlling timed-loop also possible for USB-6210
    Also... What if we use the RTOS, are they still able to control the timed-loop VI  without giving any 'EXTERNAL CLOCK' and using the internal clock sources of the DAQs
    Waiting for reply,
    Bests,
    RaJaf
    Solved!
    Go to Solution.

    Ben,
    I having read previous email which I send earlier with general overview, we discussed in more detail within our team and I am giviing the specific answers.
    Please check in RED the most recent answers. Blue are the questions/suggestions by your side.
    1.    Using Internal hardware clock of PCI-6221 would enable us get rid of external clock, but how to divert the internal hardware clock to the current settings. Any idea  (can you provide us with some reference manul for otherwise). I mean is there some flag-bit etc. or VI
    2.       Is it also meant that with the installation of RTOS the timed-loop can directly get the timing source from the internal hardware clock PCI-6221? --- How???
    3.       In order to make desktop to work as RT system, what is the hardware (motherboard, processor, etc..) requirement? What are the LabVIEW modules (specific name) that needed to be installed? Our platform is LabVIEW 8.6. (Currently we have windows-7 with i7 core processor)
    What kind of application are you intending for this system? ---- high-speed laser scanning system.
    Are you most concerned about accuracy, speed, or responsiveness? To control the laser mirror scanner to move at 1 kHz or 2 kHz speed. On the other hands, using PCI-5105 (128 MB memory) as a DAQ for real-time/on-the-fly data processing.
    Bests,
    RAJAF

  • Time controlled Loop faster than 1ms

    HI
    I work with Labview 8.2.1.
    I need a time controlled loop who is faster than 1ms. I tried to use the 1MHZ time source (see picture) but the loop does not work with this.
    Please help
    Message Edited by SteffenGrab on 11-30-2007 01:13 PM
    Message Edited by SteffenGrab on 11-30-2007 01:17 PM
    Attachments:
    Time loop.JPG ‏66 KB

    There is no picture to see...
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Time Controlled Loop?

    I am building an application that scrolls through an panoraminc photo to make it appear as if its rotating 360 degrees.
    So far i can get the image to scroll left and right continously by having a left and right button to click on
    what i am after is some ideas/direction on how i could automate the process, as in when you click the left button the image will scroll at a certain speed.
    I was thinking that i would need a time controlled loop where the the method for scrolling the image to the left occurs every few seconds.
    Thanks in advanced

    Use a inner class that extends Thread as follow:
    class MyTimer extends Thread{
    boolean continue=true;
    public void stopScroll(){
    continue=false;
    public void run(){
    while(continue){
    try{
    xpos=pictureScroll(img, xpos, "right");
    sleep(100);
    }catch(InterrupdedException e){
    }use
    Thread t=new MyTimer ();
    t.start();to start scroll, and to stop
    t.stopScroll();in button's ActionPerformed

  • Control & Simulation Loop failed to compile

    Dear Forum Members,
    I have a problem with a Control & Simulation Loop program (attached) that just doesn't compile & run.  I believe that the problem is associated with the 'Feedback Node' at the bottom of this Control & Simulation Frame since if this is taken out the program will run ok.
    Can anyone please advise me if this 'Feedback Node' is incorrectly used or in violation of anything.  I have tried various ways to overcome the problem i.e. initialising it at the start but nothing works.  The error message that I received just says "VI failed to compile".
    Appreciate any help with this.

    Hello bunnykins, 
    The Feedback node really isn't a supported function in control design and simulation. The behavior you're reporting, and the work around are both documented in the know issues of the module here: 
    201449
    Return
    A Feedback Node on a Simulation Diagram causes the VI to fail to compile
    The Feedback Node does not make sense semantically within a Simulation Diagram, due to the fact that most ODE Solvers will execute the diagram multiple times per iteration and may need to reject steps and try again, filling the Feedback Node with bad data.
    Workaround: Use the Memory block from the Simulation Utility palette. If a delay of greater than 1 is desired you can chain multiple memory blocks in sequence.
    Reported Version: 8.5
    Resolved Version: N/A
    Added: 07/31/2010
    Applications Engineer
    National Instruments
    CLD Certified

  • Extract Signal Tone Information in Control & Simulation Loop

    Hi,
    I have a simple Block Diagram to try Control & Simulation Loop. I added a Sine Wave signal and a Waveform Chart connected to it. They work just fine.
    I tried to add a Extract Single Tone Information , from Signal Processing, and connect it to the output of the Sine Wave generator but I do not know how to create a proper Time Signal.
    I thought of storing the output of the Sine Wave in an array but I was unsuccessful since I could not add any shift register to this type of control loops.
    Any help or suggestions?
    Thanks
    Attachments:
    Control_n_Sim_Test.PNG ‏9 KB

    Hi Siamak,
    Thanks for your reply mate.
    However, when I built a same BD as you posted on, it somehow didn't work. I also attached a photo of my BD here.  I used the gauge to measure when I run the programme. The gauge shows there is no signal output after the "collector"VI (gauge no.13). would you please check it for me? Many thanks!
    BR
    Floyd
    Attachments:
    tone info extraction.png ‏134 KB

  • Using timer control

    I want to schedule my web service to run it from Monday to friday and each day it should run from 10:00 am till 3:00 pm

    Add a timer control to your screen and set its Repeat property to true so it will keep looping and trigger refresh of your label. Now add a label control and set its Text property to: Text(Now(),"hh:mm:ss am/pm") & Text(Timer1!Value-Timer1!Value,"#").
    The Text formatted call to Now() causes the label to display the current time. The second expression displays blank--subtracting the timer's value from itself returns 0, and the formatting returns blank. You need this second expression to make the label's
    output be dependent on the timer so it keeps refreshing with each tick. I hope that helps.
    Thanks
    Robin

  • How can I design a time controlled applicatio​n

    I want to build a time controlled VI which can provide chemical actions e.g. to open or close valves etc. The duration of the actions, the steps are written down in a spreadsheet e.g. from 0...1 min open valve A, from 1...10 min open valve B etc. The user should have the possibility to pause the run and resume at the same point. Can someone help me to find the most effective way to solve this problem? Thanks Ruediger (I use LV 6.0 on NT4)

    I have a simple example that I had been working on. I made a couple modifications based on what you described. Check this out and see if it helps.
    Attachments:
    tank_fill.zip ‏20 KB

  • Program times out while looping at internal table with huge records - Needs fine tuning suggestions

    Hi,
    I am trying to execute a report. It times out while looping at vbap internal table. This internal table has 140000  records and does the validation within this loop and geenrates data for the output. Due to this huge volume, the program times out when executed foreground.
    There are no nested loops, so I cannot apply 'Parallel Cursor' here.
    Is there any way I can fine tune the program so that it doesn't timeout? Is it possible to apply 'Parallel Processing' . If yes, how?
    Thanks,
    Pavan

    Hi Pavan ,
                  ->sort your internal table by all primary key for vbap.
                  ->Read a Record from the table (use your condition here)
                  ->if record satisfys your where condition ,get that record index .
                  ->loop the table from the index (without condition) .
                  its like parallel cursor only but for single loop .;-)
                  ->use field symbols ,wherever possible .
               if still dump is coming ,contact your basis team .
    regards,
    Krishna.

  • How to make users to select the date from calendar control my making the date field read only in date time control in external list in sharepoint 2010

    How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
    be done through sharepoint desginer / out of the box.
    thanks.

    Congratulate you got the solution by yourself. I am new to a
    WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
    calendar date selection did me a great favor. Cheers.

  • It is possible to print any name 200 times without using loops?

    How to print any name 200 times without using loops and recurssive function and that to in java?

    String name = "incognito10";
    System.out.println(name.replaceAll("\\w+",
        "$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n"+
        "$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n"+
        "$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n"+
        "$0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0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n"+
        "$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n"+
        "$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n"+
        "$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0\n$0"
    );

  • Time controlled processing

    Hello All.
    My process consists in creating a text file contaning information of many idoc generated on R3 side.
    I know SAP R3 can send idoc in packs but I don't want my messages to be too big => Thus, Idoc Pack size won't be higher than 100.
    Every day, I will send my packs of idoc to XI in order to create the outbound file.
    With one pack of Idoc no pb but how can I do to create only one file when I would have more than one pack
    I want to know if it is possible without using BPM to build one file at a determined,scheduled moment with all received and not already processed idocs and how ?
    I found in documentations the possibility to maintain filters for time controlled processing (SXMB_ADM).
    Do someone have links about it or explain me the global steps to do what I want.
    Thanks very much

    hi,
    I'm not sure if you understood it correctly
    IDOC packects from R3 are not received as packets in XI
    they are received as one by one...
    so you need a BPM to collect them (to any number you want) anyway
    and BPM gives you many possibilities of telling
    when to stop and then when to create the file...
    Regards,
    michal

  • SharePoint 2013 RSS Viewer not loading when other Custom web part using Update Panel or Ajax Timer control

    Hi,
    SharePoint 2013 RSS
    Viewer web part failing to complete loading when the page loads.
    This happens when having RSS Viewer and then adding a Custom webpart with an updatepanel and timer control.
    I  had used Ajax update panel and timer control to load the web part asynchronously after the main page is fully loaded.
    The RSS-Viewer web part hangs in loading state while the custom webpart loads just fine.
    The issue occurs when an like button click or Timer Tick event fires after the page
    is loaded.
    Haven't been able to track the issue.
    Couple of workaround I tried to call a server side button click event from the custom web part after the page gets fully loaded using JQuery shown below did not work out either.
     $(document).ready(function () {
                $('#<%= netButton2.ClientID %>').click();
    And 
    document.onreadystatechange = function () {
                if (document.readyState == "complete") {
                    $('#<%= netButton2.ClientID %>').click();
    Please let me know how to resolve this issue.
    Thanks,
    Franklin

    Hi Johan,
    The assignment of this user on the given task might be corrupted. Try to remove the resource from the task, publish the project, assign the resource again and publish again the project. If it is not working, try to unpublish the task (column "publish")
    and publih it again.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Error in sql query as "loop has run more times than expected (Loop Counter went negative)"

    Hello,
    When I run the query as below
    DECLARE @LoopCount int
    SET @LoopCount = (SELECT Count(*) FROM KC_PaymentTransactionIDConversion with (nolock) Where KC_Transaction_ID is NULL and TransactionYear is NOT NULL)
    WHILE (
        SELECT Count(*)
        FROM KC_PaymentTransactionIDConversion with (nolock)
        Where KC_Transaction_ID is NULL
        and TransactionYear is NOT NULL
    ) > 0
    BEGIN
        IF @LoopCount < 0
            RAISERROR ('Issue with data in KC_PaymentTransactionIDConversion, loop has run more times than expected (Loop Counter went negative).', -- Message text.
                   16, -- Severity.
                   1 -- State.
    SET @LoopCount = @LoopCount - 1
    end
    I am getting error as "loop has run more times than expected (Loop Counter went negative)"
    Could any one help on this issue ASAP.
    Thanks ,
    Vinay

    Hi Vinay,
    According to your code above, the error message make sense. Because once the value returned by “SELECT Count(*)  FROM KC_PaymentTransactionIDConversion with (nolock) Where KC_Transaction_ID is NULL and TransactionYear is NOT NULL” is bigger than 0,
    then decrease @LoopCount. Without changing the table data, the returned value always bigger than 0, always decrease @LoopCount until it's negative and raise the error.
    To fix this issue with the current information, we should make the following modification:
    Change the code
    WHILE (
    SELECT Count(*)
    FROM KC_PaymentTransactionIDConversion with (nolock)
    Where KC_Transaction_ID is NULL
    and TransactionYear is NOT NULL
    ) > 0
    To
    WHILE @LoopCount > 0
    Besides, since the current query is senseless, please modify the query based on your requirement.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Date and time control panel crashing

    why is date and time control panel crashing?

    I haven't noticed that in iCal. I don't normally use a 24 hour clock.
    Glad to help on the other, though.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

Maybe you are looking for

  • Duplex printing by default on Macs

    Is there any way to make adobe reader 10.1.1 print duplex by default on my Mac?  At present each time I print something I need to go through the printing options, select printer, and then modify the option to duplex.  This is annoying, and only happe

  • Field with 0 in dynpro

    Hello,     i developed a dynpro with a field in which user insert a cuantity. If the user inserts 0, the dynpro delete the field and a blank space is showed. How can i do to show the 0? What data type must i set to the field? Thanks!

  • BAPI with RFC enables creation and mapping required settings

    Dear Experts, My client is having their old legacy system in .Net . Now their requirement is whenever they will create Vendor in their system that created vendor entry should be created automatically in SAP. I dont know about BAPI and RFC and how it

  • Creating Links with PDF documents

    I am creating PDF documents based on SAP Scripts.  I want to hyperlink within these PDF documents but I don't know the command.  Help! I can use html tags to bold and other fuctions, but <a href..> anchor tags do not work within the PDF.  Any informa

  • Difference in the MM functionalities between 4.6C and ECC 6.0.

    Hi gurus, What is the difference in the MM functionalities between 4.6C and ECC 6.0. I already went through several links, which was moslty related with technical aspects. But I need functionalitywise. (Note: In ECC 6.0 using MIGO, transfer posting c