Pulling loop count as a variable

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pulling loop count as a variable

    I've been working on a program off n on that runs with a variable part loop (can run 1 through 8 parts). How can I extract the loop count and assign it as a variable?

    TIA
    Duane
    Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
    Contura Calypso 5.4

    Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

  • #2
    Is there an operator input as to how many parts are being ran?
    Jesse Krook

    Comment


    • #3
      Sounds do-able, please show us the code you're working with
      Beep beep beep..

      Comment


      • #4
        Before your loop put this:
        Code:
        ASSIGN/COUNTER=0
        After your initial loop line put this
        Code:
        ASSIGN/COUNTER=COUNTER+1
        Use counter as your loop counter for reporting, logic, etc...
        PcDmis 2015.1 SP10 CAD++
        Global 7-10-7 DC800S

        Comment


        • #5
          Using the actually loop function:

          Code:
          LOOP1 =LOOP/START,ID=YES,NUMBER=FORM4,START=1,SKIP=,
          OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
          
          ASSIGN/LOOP_COUNT=LOOP1
          
          LOOP/END

          Comment


          • dwade
            dwade commented
            Editing a comment
            We have a winner!! WOOHOO!

            Thank you for the input. Code is posted below

          • KIRBSTER269
            KIRBSTER269 commented
            Editing a comment
            He's kinda like a generic hero

          • Kp61dude!
            Kp61dude! commented
            Editing a comment
            meh, tomayto tomahto! [wink!]

        • #6
          What bfire85 said !

          Comment


          • #7
            This is what runs like the wind, lets me set up and run multiple parts from 1 up to 8 (fixture holds up to 8 parts) so this can be modified to run any number of parts and this only offsets in the X axis but could easily be modified. Thank you bfire85 for the loop count

            Operator inputs

            Code:
            JOBNO =COMMENT/INPUT,NO,'
            ,
            ,Job Number
            ,
            ,'
            OPID =COMMENT/INPUT,NO,'
            ,
            ,Operator I.D.
            ,
            ,'
            RUN_NUM =COMMENT/INPUT,NO,'
            ,
            ,How many stations are loaded?
            ,
            ,Enter 1 through 8
            ,'
            SER_NUM1 =COMMENT/INPUT,NO,'
            ,Part number in Station 1
            ,'
            IF/RUN_NUM.INPUT==1
            GOTO/MENU
            END_IF/
            SER_NUM2 =COMMENT/INPUT,NO,'
            ,Part number in Station 2
            ,'
            IF/RUN_NUM.INPUT==2
            GOTO/MENU
            END_IF/
            SER_NUM3 =COMMENT/INPUT,NO,'
            ,Part number in Station 3
            ,'
            IF/RUN_NUM.INPUT==3
            GOTO/MENU
            END_IF/
            SER_NUM4 =COMMENT/INPUT,NO,'
            ,Part number in Station 4
            ,'
            IF/RUN_NUM.INPUT==4
            GOTO/MENU
            END_IF/
            SER_NUM5 =COMMENT/INPUT,NO,'
            ,Part number in Station 5
            ,'
            IF/RUN_NUM.INPUT==5
            GOTO/MENU
            END_IF/
            SER_NUM6 =COMMENT/INPUT,NO,'
            ,Part number in Station 6
            ,'
            IF/RUN_NUM.INPUT==6
            GOTO/MENU
            END_IF/
            SER_NUM7 =COMMENT/INPUT,NO,'
            ,Part number in Station 7
            ,'
            IF/RUN_NUM.INPUT==7
            GOTO/MENU
            END_IF/
            SER_NUM8 =COMMENT/INPUT,NO,'
            ,Part number in Station 8
            ,'
            IF/RUN_NUM.INPUT==8
            GOTO/MENU
            END_IF/
            Loop and assignments
            Code:
            LOOP_RUN =LOOP/START,ID=YES,NUMBER=RUN_NUM.INPUT,START=1,SKIP=,
            OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
            ASSIGN/COUNTER=LOOP_RUN
            IF/COUNTER==1
            ASSIGN/SERNUM=SER_NUM1.INPUT
            ASSIGN/OFFSET_VAL=0
            END_IF/
            IF/COUNTER==2
            ASSIGN/SERNUM=SER_NUM2.INPUT
            ASSIGN/OFFSET_VAL=27
            END_IF/
            IF/COUNTER==3
            ASSIGN/SERNUM=SER_NUM3.INPUT
            ASSIGN/OFFSET_VAL=54
            END_IF/
            IF/COUNTER==4
            ASSIGN/SERNUM=SER_NUM4.INPUT
            ASSIGN/OFFSET_VAL=81
            END_IF/
            IF/COUNTER==5
            ASSIGN/SERNUM=SER_NUM5.INPUT
            ASSIGN/OFFSET_VAL=108
            END_IF/
            IF/COUNTER==6
            ASSIGN/SERNUM=SER_NUM6.INPUT
            ASSIGN/OFFSET_VAL=135
            END_IF/
            IF/COUNTER==7
            ASSIGN/SERNUM=SER_NUM7.INPUT
            ASSIGN/OFFSET_VAL=162
            END_IF/
            IF/COUNTER==8
            ASSIGN/SERNUM=SER_NUM8.INPUT
            ASSIGN/OFFSET_VAL=189
            END_IF/
            RECALL/ALIGNMENT,INTERNAL,MAN_AL
            FIXTURE_OFFSET=GENERIC/POINT,DEPENDENT,CARTESIAN,$
            NOM/XYZ,<0+0,0+0,0+0>,$
            MEAS/XYZ,<OFFSET_VAL,0+0,0+0>,$
            NOM/IJK,<0+0,0+0,1+0>,$
            MEAS/IJK,<0+0,0+0,1+0>
            MAN_AL_RECALL=ALIGNMENT/START,RECALL:MAN_AL,LIST=YES
            ALIGNMENT/TRANS,XAXIS,FIXTURE_OFFSET
            ALIGNMENT/END
            Reporting code
            Code:
            ASSIGN/PATH="N:\63 - Metrology\CMM Reports\\"+PARTNUM+" Job"+JOBNO.INPUT+"_"+SERNUM+"_.PDF"
            PRINT/REPORT,EXEC MODE=END,$
            TO_FILE=ON,OVERWRITE=PATH,$
            TO_PRINTER=ON,$
            TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
            REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
            PREVIOUS_RUNS=DELETE_INSTANCES
            LOOP/END
            Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
            Contura Calypso 5.4

            Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

            Comment

            Related Topics

            Collapse

            Working...
            X