hexagon logo

Coordinate System Control for Loops.

I am looking for guidance on how coordinate systems interact with loops. I can get stuff to work but often when I make a change inside the loop my Theoretical positions don't work correctly. As well as looking at Theoretical positions that are not correct for the current zero position but the loop works fine.
At end of each loop I recall starting coordinate system. Not sure if this is correct.
  • It will complicate your loop syntax a LOT, but I always have an input comment for the quantity of parts to measure...
    That way once you create the routine, someone can load a partial shot or single position for a remeasure, and use the exact same code without having to load dummy parts.
    Here's my qty input syntax (ID10T-proofed validation added Smiley).

    QTYQUESTION=LABEL/
    QTY =COMMENT/INPUT,NO,FULL SCREEN=YES,
    How many parts will you
    load onto the fixture?
    (Hint: input 16 if you are
    running two 8cav shots!)
    IF/QTY.INPUT-INT(QTY.INPUT)<>0 OR !(QTY.INPUT>=1 AND QTY.INPUT<=16)
    COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
    Invalid input! Please input
    a value between 1 and 16.
    GOTO/QTYQUESTION
    END_IF/

    The IF validation makes sure the input is an integer first so alpha or alphanumeric combinations will fail. Then it makes sure that integer is appropriate to what the setup can handle. You don't want someone inputting a value of 90 if you've only got room & designed for for 6 parts, lol.
  • i just handled it by setting a goto bypass if it doesn't find a part in that nest.
  • Don, I have tried using While instead, and it still is changing the theocraticals unless I put 0+ in front of them. Could this be a carry over from when I removed the loops and switched to While. I can provide code example if it would help. Any additional thoughts would be appreciated. Really is frustrating. Thank you for any help.