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

Similar Messages

  • 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

  • Control loop times in swf file

    Hello:
    I have a sprite swf its framecount is 45.
    How can control for example a loop three times and after that
    stop the
    animation?t
    What parameter do I have to test?
    thank you very much

    Thank you.
    Can you tell me where do I put and call this behabiours?
    In the frame .There isn't "go to the frame"
    and in the sprite does not work.
    Thanks
    "Rob Dillon - Adobe Community Expert"
    <[email protected]> escribi�
    en el mensaje
    news:[email protected]..
    > You could probably test the _currentframe property of
    the flash sprite
    > and count how many times you see 45.
    >
    > Something like this might do the job:
    >
    > --------
    > property mycounter
    > property loopcount
    > property totalFrames
    > property thisSprite
    >
    > on getPropertyDescriptionList
    > myPropList = [:]
    > myProplist.addProp(#loopcount,[#comment:"number of times
    to
    >
    loop:",#format:#integer,#default:3,#range:[#min:1,#max:10]])
    > return myPropList
    > end
    >
    > on beginSprite me
    > thisSprite = me.spriteNum
    > totalFrames = sprite(thisSprite)._totalframes
    > mycounter = 0
    > end
    >
    > on exitFrame me
    > if sprite(thisSprite)._currentframe = totalFrames then
    > mycounter = mycounter + 1
    > end if
    > if mycounter = loopcount then -- you're done
    > sprite(thisSprite).stop() -- or
    sprite(thisSprite).gotoAndStop(1)
    > end if
    > end
    > ----------
    >
    > --
    > Rob
    > _______
    > Rob Dillon
    > Adobe Community Expert
    >
    http://www.ddg-designs.com
    > 412-243-9119
    >
    >
    http://www.macromedia.com/software/trial/

  • Adding a counter that keeps track of the total number of times a loop has run, even if LabVIEW has been restarted.

    Hi all,
    I am writing a VI for measuring data and inserting it into a database. The measurements are controlled by a loop that runs once every minute. I want to give each measurement a unique id number and store this too in the database.
    To do this, I want to add a counter to this loop so that I can count the number of times the loop has executed in total. This is, even if the VI, LabVIEW or even th PC is restarted, I want the counter to keep track of the number of executions. If say, the loope executes two times and then the VI is stopped and restarted, I want the following number on the counter to be three.
    Does anyone have an idea about how to do this? I am gratefule for any help!
    Clara
    Message Edited by Clara G on 05-11-2010 08:21 AM
    Solved!
    Go to Solution.

    Not allowed to give away code but I can describe one of my "Totalizers" used to keep track of how much stuff has passed through a fliter so we know when to change it.
    THe Total izer is implemented as an Action Engine.
    It has three actions (methods)
    1) Init - Opens an ini file and reads the last values read and cahces these in shift registers. It also inits a timer so we now how long since the last file I/O.
    2) Update - Uses the data passed by the caller to update the totals. It also checks how long since the last save and if more than one minute it writes to the ini file (forced write).
    3) Read - returns the totals for display and evealuating if a an alarm should be triggered to change the filter.
    Note:
    THe pre-LV 8.6 version of the ini file exposed methods to allow writing to the file. The new ini functions do not expose that functionality and require closing the file.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Timed Loop timing source - Control Loop From Task is too slow

    I'm trying to make a Timed Loop run at a period of 2 ms, with an analog input task running at 50 kHz as timing source. The input analog signal is scaled and fed into a synchronised analog output task on the same multifunction DAQ board. Using the built-in 1 kHz or 1 MHz clock as timing source for the Timed Loop works great, except for a slight time lag between the loop and my AI/AO tasks which over time becomes unacceptable because my task will be running for up to an hour. However, when I use the DAQmx Create Timing Source: Control Loop From Task vi to create a timing source, everything slows down and the fastest loop time I can get is around 20 ms. Any suggestions to get around this would be highly appreciated!
    System: LabVIEW RT 8.0 with DAQmx 8.0 running on an NI PXI-8186; NI PXI-6251 used for analog input.

    You're welcome!
    You can build an array, and if your data is not hugh (100's of MB) this may be the easiest solution. However, we aways suggest implementing the Producer/Consumer Architecture. Keep the PID in the Producer loop, but move the File IO to the Consumer. Also, it  appears that your instrument uses some form of serial communication, so that could cause lags in your system....
    What is your application about in general, what performance are you hoping for, etc?
    Joshua B.
    National Instruments
    NI Services
    NI Support Resources
    NI Training Resources

  • Integration Process - Time-Dependent Loop

    Hello All
    I made solution like :
    [Time-Dependent Loop|http://help.sap.com/saphelp_nw04/helpdata/en/c5/582541019fa52fe10000000a155106/frameset.htm]
    with second case "Time-Dependent Loop".
    But my exception is never raise and i don't know why. is there any special setting in PI where i have to configurate it ??
    Regards
    Maciej

    Hi
    What i have done is:
    define block with local correlation "Correlation" and exceptions "TimeOut"
    inside this block i create infinite loop with inside receive step tha use correlation and container operation.
    to block i added deadline block with following properties: creating the step 3 minutes and inside it control step with throw exception
    to block also added exception branch with exception handler
    after block i have some mapping and send step
    BR
    Maciej

  • How can I get the highest control loop speed?

    currently I am doing a nonlinear control.
    whose control loop speed is higher than 20k.
    My PXI is 8145 and 8175 , with DAQ card 6040E.
    Each time I need only one point in and then processing , then output a point.

    I would recommend configuring your program like the example program, Real-Time PID Control.vi, that ships with LabVIEW. You can find it in LabVIEW by going to Help->Find Examples and type "PID" on the search tab. The Real-Time PID Control.vi shows a good way to design your program for a single point in, single point out application.
    If you're aiming for a 20KHz loop speed, you may not be able to attain this with the PXI-8175, assuming you also have a normal priority loop running to handle the communication back to the host computer. To time your code, you can use the NI Timestamp Code Time.vit template that comes with LabVIEW 7 Express. The PXI-8176, benchmarked for sinlge point PID loop rates up to 40 KHz, may be a better solution for you application.
    It is
    also a good idea to disable the USB port and to install only the RT drivers you need. For information on how this is done, follow this link.
    Please let me know if you have further questions.
    Regards,
    Kristi Hummel
    Applications Engineer
    National Instruments

  • Temperature Control Loop

    I am new to Labview and am trying to do something that I think should be simple.  It is a control loop to perform a temperature control process.  Two setpoints are entered and the loop turns on the appropriate function to either heat or cool to that first setpoint.  Then it holds that temperature for a preset time and switches to the second setpoint (haven't gotten that far yet.)  It then turns on the heater or cooler to get to that next setpoint.  Once there it holds for a preset time.  My thought was to used the timed loop counter, feed the counter to an indicator while the it was not at temp, then once at temp store that counter value.  Once the difference between the stored value and the current counter was at a preset value switch the temperature set point.
    The attachment is under the heading testing case statements, that is kind of the way it turned out.
    I am currently learning on Labview 7.1.
    I have attached my current code: Be gentle.
    DrLarry
    Attachments:
    Testing Case Statements.vi ‏68 KB

    I cleaned up your code some, but i cant post it as 7.1, i'll post it as 2010 and a picture. You were close.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV
    Attachments:
    Testing Case Statements.vi ‏14 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

  • Usb-6009 high-speed continuous acquisition for slow control loop application

    Hi,
    After watching a few Youtube videos, I successfully built a control loop in LabVIEW using my USB-6009. Currently, this loop is limited by the speed my actuator can take and respond to commands, topping out at 200 Hz. This is completely sufficient for my application. My question is more regarding the wasted potential of the USB-6009 to acquire samples at a much higher rate than what would be obtained if I used a simple single sample-on-demand during every iteration of the loop.
    It seems to me that having the USB-6009 continuously acquire samples and having my control loop periodically check in for the latest data when it is ready to execute would have the advantage of allowing me to average groups of samples together to lower the overall noise associated with the measurement process (I am reading voltages from an amplified photodiode).
    1) Does anyone know how I would instruct the USB-6009 to continuously acquire at say 10 kHz, so that on each loop I will have 50 or so samples that can be averaged together for a more accurate measurement of my control variable? Unfortunately, I'm new to this and not too familiar with DAQmx Timing.vi.
    2) I've heard that reading into a buffer can increase latency for moving data into the computer. Given the low speed of my control loop, I don't foresee this as being a problem. Is this a correct assumption? I can probably live with an extra millisecond of latency.
    3) I goofed around briefly with DAQmx Timing and managed to see a buffer overflow error. Certain rare events will by necessity cause my control loop to take much longer to execute, so I cannot guarantee that occasionally during normal operation I will not overflow the buffer. Can I suppress this error so that the dialog box does not pop up and the program continues to run uninterrupted? If the buffer overflows and old data gets overwritten it isn't a big deal for me since the control loop is only concerned with the latest data anyway.
    Thanks for any info!

    Howdy Patrick!
    Here is a picture of the front panel:
    Here is the block diagram:
    And I've attached a copy of the VI saved for LabVIEW 7.1.
    Regards,
    Barron
    Applications Engineering
    National Instruments
    Attachments:
    most recent samples.vi ‏73 KB

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • 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

  • 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.

  • 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 |

Maybe you are looking for