Shop OBEX P1 Docs P2 Docs Learn Events
problem repeating — Parallax Forums

problem repeating

Graham StablerGraham Stabler Posts: 2,510
edited 2008-05-09 12:22 in Propeller 1
I have a piece of spin code that works perfectly, the idea was to make it run five times in a row, adding repeat 5 and indenting carefully (checked with ctrl-i) and it doesn't work as expected even on the first run through the code, repeat 1 works fine.

How can this be?

Graham

Comments

  • hippyhippy Posts: 1,981
    edited 2008-05-08 14:10
    Something within the code prematurely aborting the repeat, something locking it up, something corrupting the memory which contains the bytecode, something stopping the Cog running the interpreter. It could be a simple Abort somewhere deep in the code you're calling which doesn't get trapped anywhere.

    Anything else you can give which helps the diagnosis ? Does it exit the repeat ? Have you tried using TV_Text or something similar to try and diagnose or watch the progress of the code, have you tried commenting out lines of code and adding them back in to see what screws things up ?
  • Paul Sr.Paul Sr. Posts: 435
    edited 2008-05-08 14:44
    You aren't doing this on an uOLED-96-Prop, are you?
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-05-08 15:11
    Is your "perfectly working" SPIN code something you cannot post?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2008-05-09 12:08
    Problem solved.

    Sorry for my rather desperate post, I wouldn't normally have bothered you all but this code is running a PIV experiment (Particle image velocimetry) and we have to be all done by the 12th as the room is being stripped out for renovations.

    The code uses some of my own motion control routines, I have two versions of a move, one starts the move then returns once complete, the other starts the move and returns straight away. I was using the latter so that I could monitor its progress by counting step pulses before firing the laser at the correct point.

    When I added the repeat it looped to the start of the code interrupting the move with the homing code, it all happens rather quickly so was difficult to spot, I was just wondering if there might have been a common error I was missing related to looping.

    Thanks

    Graham
  • simonlsimonl Posts: 866
    edited 2008-05-09 12:22
    I can feel your pressure from here Graham - that post was quite out of character!

    Glad to hear you got to the bottom of it smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon
    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif
Sign In or Register to comment.