:confused: Loop count display

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • :confused: Loop count display

    In programs that run in loops, is there a way to display on the screen which iteration of the loop is currently running?
    v2013 MR1, v2015.1
    B&S Global 544, 555
    Mitutoyo A504 w/PC-DMIS

    sigpic
    Since 1994

    Never force anything. Get a bigger hammer.
    (Advice from my dad.)

  • #2
    I know in v3.6 and higher you can insert a COMMENT/READOUT which inserts the comment text into the Probe Readout window during execution. So you could do something like this:

    ASSIGN/V7=1
    V6 =LOOP/START, ID = YES, NUMBER = 15, START = 1, SKIP = ,
    OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0
    COMMENT/READOUT,NO,"You have looped: " + V7 + " times."
    ASSIGN/V7 = V7 + 1
    LOOP/END

    In v3.2, I'm not sure... possibly there's something that could be done via VB automation.
    Jared Hess - PC-DMIS Documentation Team Lead @ HMI
    [View 2008 Reporting Tutorials Here]

    Comment


    • #3
      Thanks for the response, Jared. v3.2063 has no "COMMENT/READOUT" option.
      I wondered if VB might be the way to go with this, but as far as VB is concerned, I'm Sgt Schultz.
      v2013 MR1, v2015.1
      B&S Global 544, 555
      Mitutoyo A504 w/PC-DMIS

      sigpic
      Since 1994

      Never force anything. Get a bigger hammer.
      (Advice from my dad.)

      Comment


      • #4
        I'm using 3.7MR1 and you can add the Loop ID's, it will show you what loop u are on.
        I used to be high on life but I built up a tolerance.

        Brown & Sharpe Global Advantage
        PCDMIS CAD++ v2011mr2
        PH10MQ/SP600M


        sigpic

        Comment


        • #5
          Originally posted by Don Meredith
          Thanks for the response, Jared. v3.2063 has no "COMMENT/READOUT" option.
          I wondered if VB might be the way to go with this, but as far as VB is concerned, I'm Sgt Schultz.
          Here's an example of a BASIC program and some PC-DMIS code within v3.2 that displays a loop number and message on the statusbar. Granted, it's not as visible as sending a comment to the readout window, but you might find it useful. This example works for me in v3.207b.

          Step 1. Write the script.
          Open up the BASIC Script Editor that comes with PC-DMIS, and type or copy and paste this code in. Save it as UPDATESTATUSBAR.BAS:
          Sub Main (strText As String)
          Dim App As Object
          Set App = CreateObject ("PCDLRN.Application")

          App.StatusBar = strText

          End Sub


          When executed, this script expects a passed in text string. It assigns the text message to the variable strText and then displays strText in the Statusbar.

          Step 2. Pass the variable to display from the part program.
          Inside your loop command, insert a Basic Script command that calls the above script and passes in the string to display as a parameter. Your part program code should look something like this:
          ASSIGN/V7 = 1
          V1 =LOOP/START, ID = YES, NUMBER = 15, START = 1, SKIP = ,
          OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0
          ASSIGN/V2 = "The program is executing loop number " + V7
          CS1 =SCRIPT/FILENAME= D:\MYAUTOMATIONSCRIPTS\UPDATESTATUSBAR.BAS
          FUNCTION/Main,V2,,
          STARTSCRIPT/
          ENDSCRIPT/
          COMMENT/OPER,V7
          ASSIGN/V7 = V7 + 1
          LOOP/END
          In the above code, PC-DMIS loops 15 times and increments variable V7 each time. This loop count becomes part of variable V2 which says "The program is executing loop number X" where X is the current value of V7. V2 then gets passed into the UPDATESTATUSBAR.BAS script.

          Note that the COMMENT/OPER,V7 command is for testing purposes only to slow down the script so you can visually see what's being displayed on the status bar in this test program. In actual use in a real part program, you can remove it.
          Jared Hess - PC-DMIS Documentation Team Lead @ HMI
          [View 2008 Reporting Tutorials Here]

          Comment


          • #6
            Thanks, Jared. I'll try this and see how it works, then post my results.
            Last edited by Don Meredith; 06-27-2006, 01:09 PM.
            v2013 MR1, v2015.1
            B&S Global 544, 555
            Mitutoyo A504 w/PC-DMIS

            sigpic
            Since 1994

            Never force anything. Get a bigger hammer.
            (Advice from my dad.)

            Comment


            • #7
              Jared / Don,

              I was working on a capability study program when ya'll started this thread so I tried it and it worked. Below is the routine I'm using:

              ASSIGN/V7 = 1
              C1 =COMMENT/INPUT,How many parts are you running?
              V1 =LOOP/START, ID = YES, NUMBER = C1.INPUT, START = 1, SKIP = ,
              OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0
              ASSIGN/V2 = "The program is executing loop number" + V1
              CS1 =SCRIPT/FILENAME= C:\PCDMISW_MR3\PART PROGRAMS\UPDATESTATUSBAR.BAS
              FUNCTION/Main,V2,,
              STARTSCRIPT/
              ENDSCRIPT/
              ASSIGN/V7 = V7 + 1
              L1 =LABEL/
              C2 =COMMENT/YESNO,Have you changed parts?
              IF/C2.INPUT=="YES"
              GOTO/L2
              END_IF/
              IF/C2.INPUT=="NO"
              GOTO/L1
              END_IF/
              L2 =LABEL/

              The only thing I could not figure out was getting the ENDSCRIPT/ command in. After I ran the program once the ENDSCRIPT/ command appeared in the program. Jared, ignore the PM unless you can tell me how to insert it into the program.

              Thank guys,

              Perry
              Perry
              B&S Mistral
              3.207 Beta on XP

              Older'n dirt

              Comment


              • #8
                Originally posted by Perry Fisher
                ...The only thing I could not figure out was getting the ENDSCRIPT/ command in. After I ran the program once the ENDSCRIPT/ command appeared in the program.....
                Hi Perry,

                Correct. The ENDSCRIPT/ command only appears after execution. I'm not sure why it does that. I'll have to ask the programmers about that and see if that's intentional.

                Anyway, one other thing I figured out after looking at this more closely is that we don't need a separate variable to count the iterations in the loop. The LOOP/START command itself has it's own variable and puts the current iteration into that variable. So my example part program code above could be rewritten like this:
                V1 =LOOP/START, ID = YES, NUMBER = 15, START = 1, SKIP = ,
                OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0
                ASSIGN/V2 = "The program is executing loop number " + V1
                CS1 =SCRIPT/FILENAME= D:\MYAUTOMATIONSCRIPTS\UPDATESTATUSBAR.BAS
                FUNCTION/Main,V2,,
                STARTSCRIPT/
                ENDSCRIPT/
                COMMENT/OPER,V1
                LOOP/END
                Jared Hess - PC-DMIS Documentation Team Lead @ HMI
                [View 2008 Reporting Tutorials Here]

                Comment


                • #9
                  I just finished running a CAP study using this script. I'm never able to stay with the CMM from start to finish running CAPs. The way I have the program set up (dumb luck on my part) when the CMM is paused waiting for me to verify changing parts the status bar is telling me which part is next so I'm not trying to decide if I have run the current part yet.

                  Thanks Don & Jared
                  Perry
                  B&S Mistral
                  3.207 Beta on XP

                  Older'n dirt

                  Comment

                  Related Topics

                  Collapse

                  Working...
                  X
                  😀
                  🥰
                  🤢
                  😎
                  😡
                  👍
                  👎