report serial number with looping program 4 times

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

  • report serial number with looping program 4 times

    I am writing a new program to loop 1-4 times for production,
    We save the reports with the serial number n the file name for tractability.

    Start of program****************


    SN1 =COMMENT/INPUT,YES,FULL SCREEN=NO,
    "Serial No1."
    ASSIGN/V6=SN1.INPUT


    end of program********************************


    ASSIGN/V10=SYSTIME()
    COMMENT/REPT,
    V10
    COMMENT/REPT,
    END TIME
    COMMENT/REPT,
    "TIME ="+SYSTEMTIME("HH:mm")
    ASSIGN/V2=ELAPSEDEXECUTIONTIME()
    COMMENT/REPT,
    ********************
    "RUN TIME= "+V2
    ********************
    ASSIGN/SVAR="\\\10.99.155.181\usbcifs01\Q\CMM\4062AS105\R EPORTS\SN_"
    ASSIGN/V99=SVAR
    ASSIGN/SVAR=".CSV"
    ASSIGN/V100=SVAR
    ASSIGN/SVAR=".PDF"
    ASSIGN/V101=SVAR
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME= ,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=ON,AUTO=30,FILENAME=V99+V1+V100,AUTO OPEN=OFF,$
    PREVIOUS_RUNS=KEEP_INSTANCES
    ******************************************
    END OF PROGRAM
    ******************************************

    This works great for 1 pcs.
    Any ideas on how to do four separate serial numbers and reports.

    Thank you for any help

  • #2
    Instead of placing that code at the end of the routine, place it before loop/end command.

    Comment


    • Thomas.Davis
      Thomas.Davis commented
      Editing a comment
      The loop end is after the code

  • #3
    This is what I use for a nested loop...it puts a serialized comment at the top of the report.... Maybe you'll find something useful...

    Code:
     C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    <<< Please Enter Beginning Serial Number >>>
    ASSIGN/PARTCOMM=C2.INPUT
    ASSIGN/LOOPPART=PARTCOMM
    C3 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    How Many Parts Are In Each Row? >>>
    ASSIGN/V1=C3.INPUT
    C4 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    <<< How Many Rows? >>>
    ASSIGN/V2=C4.INPUT
    V3 =LOOP/START,ID=YES,NUMBER=V2,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=4,ZAXIS=0,ANGLE=0
    V4 =LOOP/START,ID=YES,NUMBER=V1,START=1,SKIP=,
    OFFSET:XAXIS=4,YAXIS=0,ZAXIS=0,ANGLE=0
    COMMENT/REPT,
    "PART #_"+LOOPPART
    Sheffield Endeavor3 9.20.8, Tesastar-SM, Leitz LSP-X1s & LSP-X1M, PCDMIS 2011 MR1

    Comment


    • #4
      I would assign de serial numbers to measure before the loop with a comment or from, so the program don't have to stop.

      ASSIGN/SERIAL_NUMBER1=SN1.INPUT
      ASSIGN/SERIAL_NUMBER2=SN2.INPUT
      ASSIGN/SERIAL_NUMBER3=SN3.INPUT
      ASSIGN/SERIAL_NUMBER4=SN4.INPUT

      depending on the form of the loop you can use the loop counter or use a teller.


      ASSIGN/TELLER1=1

      V2 =LOOP/START,ID=YES,NUMBER=2,START=1,SKIP=,
      OFFSET:XAXIS=0,YAXIS=875,ZAXIS=0,ANGLE=0
      V1 =LOOP/START,ID=YES,NUMBER=2,START=1,SKIP=,
      OFFSET:XAXIS=350,YAXIS=0,ZAXIS=0,ANGLE=0
      IF/TELLER1==1
      ASSIGN/SERIAL_NUMBER=SERIAL_NUMBER1
      END_IF/
      IF/TELLER1==2
      ASSIGN/SERIAL_NUMBER=SERIAL_NUMBER2
      END_IF/
      IF/TELLER1==3
      ASSIGN/SERIAL_NUMBER=SERIAL_NUMBER3
      END_IF/
      IF/TELLER1==4
      ASSIGN/SERIAL_NUMBER=SERIAL_NUMBER4
      END_IF/

      create the variabele were and with witch name and serial number you want to save the file

      ASSIGN/DOC_NUMMER="C:\\Reports\\1070066081 - MATRIXPLATE_SN_"
      ASSIGN/FILENAME= DOC_NUMMER + SERIAL_NUMBER
      ASSIGN/FILENAME_PDF=FILENAME + ".pdf"
      ASSIGN/FILENAME_EXCEL=FILENAME + ".csv"

      in the first loop the header is placed automaticly, for the other you have to place it.

      IF/TELLER1>1
      REPORT/LABEL, FILENAME= FILE_HEADER.LBL
      END_IF/

      before the loop end you place the print command. Put the variable were and with witch name in the good place.
      Make sure you select DELETE_INSTANCES and use OVERWRITE

      PRINT/REPORT,EXEC MODE=END,$
      TO_FILE=ON,OVERWRITE=FILENAME_PDF,AUTO OPEN=OFF,$
      TO_PRINTER=OFF,COPIES=1,$
      TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
      REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
      TO_EXCEL=ON,OVERWRITE,FILENAME=FILENAME_EXCEL,AUTO OPEN=OFF,$
      PREVIOUS_RUNS=DELETE_INSTANCES
      ASSIGN/TELLER1=TELLER1 + 1
      LOOP/END
      LOOP/END

      Comment

      Related Topics

      Collapse

      Working...
      X