Operator Comment in a Loop

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

  • Operator Comment in a Loop

    I have a looped a program to run 2 parts at a time. I've inserted an operator comment towards the end of the loop to tell me how many dimensions measured out of tolerance. It works but it keeps a running tally instead of giving me the results one part at a time.

    Code:
    ASSIGN/NM=GETPROGRAMINFO("NUMMEAS")
    ASSIGN/OT=GETPROGRAMINFO("NUMOOT")
    COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
    "TOTAL MEASURED = "+NM
    "OUT OF TOLERANCE = "+OT
    "OK" TO CONTINUE.
    Attached Files

  • #2
    At the very end of the loop (but still inside it), put your operator comment.

    Immediately following that (still inside of the loop) create a new assignment for NM and a new assignment for OT to make them both equal 0 (to reset them). When it re-executes the loop, those variables will be now be "fresh"/zeroed out for the second part.

    PC DMIS is very finicky about naming conventions..but..it WILL let you re-use variable names in your program. As long as you're careful and watch what you're doing (and remember to redefine them when need be like I am showing you in this example).
    Last edited by DAN_M; 10-16-2020, 10:09 AM.
    Beep beep beep..

    Comment


    • #3
      Pcdmis keeps track of the current running total for NUMMEAS and NUMOOT. You will need to calculate the difference between loops.

      I think this will work but try it to make sure. I tried to give somewhat meaningful names to indicate what I am doing.


      ASSIGN/PRIORLOOPEDMEAS = 0
      ASSIGN/PRIORLOOPEDOOT = 0

      LOOP start area


      near the bottom of the loop calculate your loop information

      ASSIGN/NM=GETPROGRAMINFO("NUMMEAS")
      ASSIGN/OT=GETPROGRAMINFO("NUMOOT")

      ASSIGN/CURRENTLOOPMEAS = NM - PRIORLOOPEDMEAS
      ASSIGN/CURRENTLOOPOOT = OT - PRIORLOOPEDOOT

      ASSIGN/PRIORLOOPEDMEAS = NM
      ASSIGN/PRIORLOOPEDOOT = OT

      CURRENTLOOPMEAS, CURRENTLOOPOOT should contain your current loop information

      End of Loop

      Comment


      • #4
        Is this right? It's still doubling the total measured.

        Code:
        ASSIGN/NM=GETPROGRAMINFO("NUMMEAS")
        ASSIGN/OT=GETPROGRAMINFO("NUMOOT")
        COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
        "TOTAL MEASURED = "+NM
        "OUT OF TOLERANCE = "+OT
        "OK" TO CONTINUE.
        ASSIGN/NM=0
        ASSIGN/OT=0
        LOOP/END

        Comment


        • DAN_M
          DAN_M commented
          Editing a comment
          I'm sorry, I accidentally gave you some bad advise. I didn't realize that PC DMIS keeps track of "GETPROGRAMINFO" information. Please see @SABarber's comment #3

      • #5
        Awesome! It worked! Thank you guys!

        Comment

        Related Topics

        Collapse

        Working...
        X