Loop serial number adding a -1,-2, -3 at the end of serial numbers

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

  • Loop serial number adding a -1,-2, -3 at the end of serial numbers

    I have a program that loops 4 times and want to change the serial number to xxxx-1 xxxx-2 for part one to part 4

  • #2
    Where in the program? Are you talking about the reports?

    Comment


    • #3
      that and csv data storage COM_SN =COMMENT/INPUT,NO,FULL SCREEN=NO,
      Scan/Enter Part Serial Number

      ASSIGN/H006=COM_SN.INPUT
      ASSIGN/OI_SN=COM_SN.INPUT

      Comment


      • #4
        Run an assignment within the loop when you have the File I/O and print commands that change based on the loop number.

        Code:
        ASSIGN/DATA="C:\AAA\BBB\CCC\CMM_DATA_"+LOOP1+".csv"
        LOOP1 being the loop variable name when you create the loop command. It can be anything you call it. I call my loops by what they are, not the generic V1 PC-DMIS gives me. You can do the same with the CSV and File I/O command as with the PDF in the print command.

        Comment


        • #5
          I have that I just want the serial number add a -1 then on the second part in the loop a -2 to the main serial number example xxxxx-1 xxxx-2

          Comment


          • #6
            Originally posted by MikeF View Post
            I have that I just want the serial number add a -1 then on the second part in the loop a -2 to the main serial number example xxxxx-1 xxxx-2
            Use the serial number variable +"-"+the loop variable.
            PC-DMIS 2016.0 SP8

            Jeff

            Comment


            • #7
              thanks it's almost what I am looking for, I tried it and now it shows serial number xxxxx-1-2-3-4 what I want is xxx-1 xxx-2 xxx-3 xxx-4 on each report
              LOOP1 =LOOP/START,ID=YES,NUMBER=4,START=1,SKIP=,
              OFFSET:XAXIS=0,YAXIS=3,ZAXIS=0,ANGLE=0
              ASSIGN/H006=H006+"-"+LOOP1

              Comment


              • #8
                I would give the initial variable and the variable with the loop number added a different name. Then it won't keep adding to the end.

                ASSIGN/H007=H006+"-"+LOOP1

                or something like that. Otherwise you need to assign the original text to H006 at the beginning of the loop.
                PC-DMIS 2016.0 SP8

                Jeff

                Comment


                • #9
                  or ASSIGN/H006=COM_SN.INPUT + "-" + LOOP1

                  as long as you maintain the serial number assignment unaltered and append the +"-"+ LOOP1 variable to the end, it should work.

                  Comment


                  • #10
                    Thanks that worked

                    Comment

                    Related Topics

                    Collapse

                    Working...
                    X