Looping With Unique Serial Names

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

  • Looping With Unique Serial Names

    Hello there,
    I am writing a program that measures four identical parts at the same time with the functionality of loops. When the program is initiated, the user inputs four unique serial numbers composed of letters and numbers. The program then measures the four pieces and outputs four different files with the name of the unique serial number in the file names. I do not want the user to manually change each file name after the program is finished. The parts have two rows and columns so I have to use two loops to measure all four parts. I am having an issue in figuring out the logic to have the all the unique serial numbers output in the file names. I have looked on the forum for something similar which I have applied to my program, but nothing this specific.

    Code:
    C1_NSL =COMMENT/INPUT,NO,FULL SCREEN=NO,
    'SERIAL NUMBER' FOR NEAR SIDE LEFT
    C2_FSL =COMMENT/INPUT,NO,FULL SCREEN=NO,
    'SERIAL NUMBER'FOR FAR SIDE LEFT
    C3_NSR =COMMENT/INPUT,NO,FULL SCREEN=NO,
    'SERIAL NUMBER' FOR NEAR SIDE RIGHT
    C4_FSR =COMMENT/INPUT,NO,FULL SCREEN=NO,
    'SERIAL NUMBER' FOR FAR SIDE RIGHT
    ASSIGN/SN1=C1_NSL.INPUT
    ASSIGN/SN2=C2_FSL.INPUT
    ASSIGN/SN3=C3_NSR.INPUT
    ASSIGN/SN4=C4_FSR.INPUT
    ASSIGN/PATH1="F:\DOCS\CMM REPORTS TEST\G9944_"+SN1+".RTF"
    ASSIGN/PATH2="F:\DOCS\CMM REPORTS TEST\G9944_"+SN2+".RTF"
    ASSIGN/PATH3="F:\DOCS\CMM REPORTS TEST\G9944_"+SN3+".RTF"
    ASSIGN/PATH4="F:\DOCS\CMM REPORTS TEST\G9944_"+SN4+".RTF"
    $$ NO,
    **
    **
    V1 =LOOP/START,ID=YES,NUMBER=4,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=3,ZAXIS=0,ANGLE=0
    
    V2 =LOOP/START,ID=YES,NUMBER=4,START=1,SKIP=,
    OFFSET:XAXIS=5,YAXIS=0,ZAXIS=0,ANGLE=0
    
    **
    Measured Features
    **
    
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=PATH1,AUTO OPEN REPORT=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    TO_EXCEL_OUTPUT=OFF,
    PREVIOUS_RUNS=DELETE_INSTANCES
    $$ NO,
    **
    LOOP/END
    LOOP/END
    As of right now, the program only outputs one file. Is it possible to have the "To_file" overwrite change to the next directory or variable after every loop?

  • #2
    Something like this :
    (I'm not sure that NUM_PART=NUM_PART+1 is at the right place...)

    Code:
    [COLOR=#ff0000]ASSIGN/NUM_PART=1[/COLOR]
    V1 =LOOP/START,ID=YES,NUMBER=4,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=3,ZAXIS=0,ANGLE=0
    
    V2 =LOOP/START,ID=YES,NUMBER=4,START=1,SKIP=,
    OFFSET:XAXIS=5,YAXIS=0,ZAXIS=0,ANGLE=0
    
    **
    Measured Features
    **
    [COLOR=#ff0000]ASSIGN/NUM_PATH="PATH"+NUM_PART[/COLOR]
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=[COLOR=#ff0000]NUM_PATH[/COLOR],AUTO OPEN REPORT=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_OUTPUT=OFF,
    PREVIOUS_RUNS=DELETE_INSTANCES
    $$ NO,
    **
    [COLOR=#ff0000]ASSIGN/NUM_PART=NUM_PART+1[/COLOR]
    LOOP/END
    LOOP/END

    Comment


    • #3
      @Eclipsegc

      I do this with two loops, check out my post here:

      https://www.pcdmisforum.com/forum/pc...-macro-program

      Comment

      Related Topics

      Collapse

      Working...
      X