Loops in PC-DMIS 2018

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

  • Loops in PC-DMIS 2018

    I have recently 'upgraded' from PC-DMIS 2016.0 SP10 to 2018 R2 SP8. In 2016.0 I created a few dozen programs that use nested loops to run multiple parts (32-80) which allowed me to run the machine overnight. This has worked well, has allowed me to run about 45-50,000 parts over the past few years, and has removed the need to have an inspector chained to the machine for days at a time. I have created a pair of new programs (using 2018 R2 and the same blank template I have used prior) and the loop command seems to be broken now. Approximately 20-30% of the time that I click on Insert->Flow Control Command->End Loop PC-DMIS will just flat out crash. Having a loop that offsets with a negative value just seems to not work anymore. Is anyone else having issue with this? Should I just move back to PC-DMIS 2016.0? It has been nearly 2 weeks since I have opened a case with Hexagon without a reply.

  • #2
    Sometimes I find it better to write a program in an older version for certain types of functions and then just run it on the CMM in the latest and "greatest" version.

    If writing a looping program works better in 2016, then by all means write the program with 2016. Then if it runs fine with 2018, use that on the CMM to run it. If it doesn't run fine in 2018, you may need to keep running 2016 for now.

    It stinks, but it's a reality for PC-DMIS. Some things just work better in some versions. I know a lot of people who keep older versions on their computer, especially the one they program on, just for that reason.

    Good luck!
    PC-DMIS 2016.0 SP8

    Jeff

    Comment


    • #3
      Originally posted by Schrocknroll View Post
      Sometimes I find it better to write a program in an older version for certain types of functions and then just run it on the CMM in the latest and "greatest" version.

      If writing a looping program works better in 2016, then by all means write the program with 2016. Then if it runs fine with 2018, use that on the CMM to run it. If it doesn't run fine in 2018, you may need to keep running 2016 for now.

      It stinks, but it's a reality for PC-DMIS. Some things just work better in some versions. I know a lot of people who keep older versions on their computer, especially the one they program on, just for that reason.

      Good luck!
      Sorry for asking a question on somebody else's post - but some of our programs were written in PCDMIS 2017 and now i'm using 2019. When i make a change on the older ones it always asks if i want to save to an older version of PCDMIS, and i've always said No. Is that wrong? We still have both installed and using Inspect. Does Inspect use whichever version the program is written on?
      Again sorry i know this is not my post

      Comment


      • #4
        What exactly is making you say the loop commands are broken?
        do they run and just not loop?
        does an error appear?
        do you use or reference variables in the loop command? If you hover over the variables, do they accurately preview the value as intended?

        Have you tried to just replace the entire loop command? IE: cut entire loop contents, delete your loop/start and loop/end commands. Then insert new loop command and paste contents within the new loop/start and loop/end?
        Also, do you have grouping in your code?
        I've seen grouping do weird things, especially if a loop/start command is within one loop, and the loop/end command is either not grouped or embedded in a separate group.

        Other releases of the demon will "ghost" code, where it disappears from edit window, but remains visible within the summary mode of the edit window. Check if your loop commands are just hiding from view.
        One last input: I've seen MODE/DCC commands move up or down a line of code on me when saving to a newer version of pcdmis... are your loop commands possibly moving a bit on you?

        Post some code of the broken routine, and we could be more definitive.

        Comment


        • ctw00
          ctw00 commented
          Editing a comment
          I have 4 fixtures in a 2x2 pattern, the first fixture is in the front right of the machine and the first loop indexes -9 in the X direction, the second loop +14 in the Y. The other two loops index through the parts on each fixture. In the past this has worked fine without issue, on the two programs made on 2018 it will run the first two fixtures, but won't index to the next two (I forget the error, but it is an out of travel error).

          The other issue is when I insert the LOOP/END at the end I stand a good chance of PC-DMIS just crashing to desktop each time.

          There is one variable inside the loop to tell the operator which part the report is for, it appears to be fine. The two variables in the beginning of the loop show that V1 and V2 are equal to 2.

          I do not have groups in the programs.

          Code:
             
                      ASSIGN/V1=2
                      ASSIGN/V2=2
          V3         =LOOP/START,ID=YES,NUMBER=V1,START=1,SKIP=,
                        OFFSET:XAXIS=-9,YAXIS=0,ZAXIS=0,ANGLE=0
          V4           =LOOP/START,ID=YES,NUMBER=V2,START=1,SKIP=,
                          OFFSET:XAXIS=0,YAXIS=14,ZAXIS=0,ANGLE=0
          V5             =LOOP/START,ID=YES,NUMBER=2,START=1,SKIP=,
                            OFFSET:XAXIS=0,YAXIS=6.958,ZAXIS=0,ANGLE=0
          V6               =LOOP/START,ID=YES,NUMBER=4,START=1,SKIP=,
                              OFFSET:XAXIS=0,YAXIS=0,ZAXIS=6,ANGLE=0
          
          (There is a rough alignment with all 6 DOF here and then another part alignment with all 6 DOF, the part is measured and dimensioned.)
          
                              PRINT/REPORT,EXEC MODE=END,$
                                TO_FILE=OFF,AUTO=1,AUTO OPEN=ON,$
                                TO_PRINTER=ON,COPIES=1,$
                                TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                                REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                                TO_EXCEL=OFF,$
                                PREVIOUS_RUNS=DELETE_INSTANCES
                            LOOP/END
                          LOOP/END
                        LOOP/END
                      LOOP/END

      • #5
        If you are getting an out of travel error, you are telling the machine to move someplace outside of its travel limits.

        so your template file... is there a chance it was changed, or executed with loop counts >1 then saved after executing?

        Hear me out:
        If you execute a looped routine, then make changes within the loop, the last execution of the loop (including offset values) remains as the current alignment theo/meas values.
        When you make changes after executing a looped routine, the theo's of the new/changed features end up related to the coordinates of the LAST iteration of the loop, totally fubarring the routine. (because your first loop execution is now related to last loop coordinates).

        You need to either (depending on your situation)
        Open your template, change all loop counts to 1, execute and save... then use template.
        OR
        You need to recover an old version of the routine, change the loop counts to 1, execute and save... then make changes and save again.
        As a final step within the routine (or template), change your loop counts to the amounts you need. save routine as read-only.

        This should prevent the code from associating its coordinates to the alignment of the last loop iteration, and sending your code outside of travel limits.
        Last edited by louisd; 11-05-2019, 02:54 PM.

        Comment


        • ctw00
          ctw00 commented
          Editing a comment
          The template file doesn't have the Loop/End at the bottom of it, so I avoid that pitfall! I lost a bunch of time trying to solve that problem a few years ago.

          If and when I need to edit a proven program with a Loop in it (due to customer print changes/requirements/etc), I run the program until it is through the alignments on the first piece and stop it there, at that point, all of the loop counts are at 1, and the nominals in the program are then correct. Only then can I safely edit the program.

      • #6
        You can open the routine offline and manually change the loops to 1, and execute. it does the same.
        Doing it this way also makes your theo's and nominal's match, further simplifying the code if a layperson has to audit or compare it to prior revision.

        Your template has FIVE loop start commands with no closure to those commands, until you try to add them at the very end of the routine?
        Maybe that's the problem. PC-DMIS definitely doesn't like leaving other flow control commands open.
        IF's will be red until END_IF is present,
        DO's, need UNTIL, and will be red until present.
        IF & IF_GOTO statements will not even let you move the cursor until there's some type of output value populated...
        I've had issues any time I delete an End_IF command and try to re-create it (i typically end up typing new if statement and cutting/pasting the code between new if statement entirely).

        Try typing "LOOP" in edit window at end of routine, press tab (it will default to LOOP/START), then press F8 to toggle option to END (or type letter "E" and tab again).
        This is the same as using the "Insert->Flow Control Command->End Loop" dropdown, just input via keystroke... But maybe the crash is related to the method of input related to that insertion, as opposed to typing it manually within the edit window.
        See if that still crashes your demon.

        If no crash: There's your workaround.
        If still crashing, I suggest refraining from leaving flow controls open-ended for long periods of time. Demon expects that closure statement to be present and definitely might be a direct cause to your crashes.

        Comment


        • ctw00
          ctw00 commented
          Editing a comment
          The funny part is I recently started using "Insert->Flow Control Command->End Loop" because it seemed to make PC-DMIS crash less than LOOP-Tab-E!

        • ctw00
          ctw00 commented
          Editing a comment
          I will try closing all the loops, and then cutting and pasting.

      Related Topics

      Collapse

      Working...
      X