Program not reading IF/GOTO statements correctly

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

  • Program not reading IF/GOTO statements correctly

    Hi all,

    so i have the same exact program on two different machines, using the same probe tips, same angles, identical fixtures, basically everything is the same. I have IF/GOTO statements that pull up the machine and station of where the part was made. One machine is telling me the correct info, the other one doesn't. I am so confused. I deleted the program on the machine that doesn't give me the correct info and copied the program from the other machine to this one, still the same problem. I am lost. They are just IF commands. The parts have a little step to identify the machine and station. So the commands just say If there is a step in this particular spot then it's Mach#1, station#1,etc. This machine will go through all the steps and then on the report it always says Station2 no matter what station it is.
    Has anyone had this problem before?

    Using PCDMIS 2019 R1
    Last edited by Disal; 07-21-2020, 01:23 PM.

  • #2
    Place some "debug" statements in the flow of the routine . . . for example

    COMMENT/OPER
    value_1
    IF/GOTO, Value_1

    this will display the value of the VALUE_1 variable just before it is used in the IF statement during execution That part is IMPORTANT. Do NOT try to read the value while in Learn mode or edit mode. Execute the routine and see what is reported for the value

    Comment


    • #3
      Originally posted by Don Ruggieri View Post
      Place some "debug" statements in the flow of the routine . . . for example

      COMMENT/OPER
      value_1
      IF/GOTO, Value_1

      this will display the value of the VALUE_1 variable just before it is used in the IF statement during execution That part is IMPORTANT. Do NOT try to read the value while in Learn mode or edit mode. Execute the routine and see what is reported for the value
      I will try and let you know how it works out. Thank you

      Comment


      • neil.challinor
        neil.challinor commented
        Editing a comment
        Under F5, check if you have the same "reset global settings when branching" setting on both machines.
        Last edited by neil.challinor; 07-22-2020, 04:06 AM.

    • #4
      neil.challinor should it be checked on both?

      Comment


      • neil.challinor
        neil.challinor commented
        Editing a comment
        Whichever machine is working how you want it to, set the setting on the other machine to be the same.

    • #5
      Originally posted by Disal View Post
      Hi all,

      so i have the same exact program on two different machines, using the same probe tips, same angles, identical fixtures, basically everything is the same. I have IF/GOTO statements that pull up the machine and station of where the part was made. One machine is telling me the correct info, the other one doesn't. I am so confused. I deleted the program on the machine that doesn't give me the correct info and copied the program from the other machine to this one, still the same problem. I am lost. They are just IF commands. The parts have a little step to identify the machine and station. So the commands just say If there is a step in this particular spot then it's Mach#1, station#1,etc. This machine will go through all the steps and then on the report it always says Station2 no matter what station it is.
      Has anyone had this problem before?

      Using PCDMIS 2019 R1

      Quite often this is just faulty logic.

      Like if you were testing a z value and it measures 2.5

      If z>2 then assign v1 = machine 1

      If z >1 then assign v1 = machine 2

      Now as the code executes it reads z as being greater than 2, so it sets v1 to machine 1.

      Next it tests z to see if it's bigger than 1 (which it is) so it sets v1 to machine 2.

      Revers the order of the if statements and it works fine however.


      Post your code so we can see the logic statements.

      Automettech - Automated Metrology Technology

      Comment


      • #6
        neil.challinor they're both unchecked
        I still haven't tried Don R suggestion-the machine is busy

        NinjaBadger

        this is what i have (written by another programmer, not me):

        \CODE\
        L64 =LABEL/
        IF_GOTO/PNT1.Z-STEP1.Z>.003,GOTO = L65
        ASSIGN/V24=0
        GOTO/L66
        L65 =LABEL/
        ASSIGN/V24=2
        L66 =LABEL/
        IF_GOTO/PNT1.Z-STEP2.Z>.003,GOTO = L67
        ASSIGN/V25=0
        GOTO/L68
        L67 =LABEL/
        ASSIGN/V25=4
        L68 =LABEL/
        IF_GOTO/PNT1.Z-STEP3.Z>.003,GOTO = L69
        ASSIGN/V26=0
        GOTO/L70
        L69 =LABEL/
        ASSIGN/V26=2
        L70 =LABEL/
        IF_GOTO/PNT1.Z-STEP4.Z>.003,GOTO = L71
        ASSIGN/V27=0
        GOTO/L72
        L71 =LABEL/
        ASSIGN/V27=1
        L72 =LABEL/
        ASSIGN/V28=V24+V25+V26+V27
        IF_GOTO/V28==1,GOTO = L75
        IF_GOTO/V28==2,GOTO = L76
        IF_GOTO/V28==3,GOTO = L77
        IF_GOTO/V28==4,GOTO = L78
        IF_GOTO/V28==5,GOTO = L79
        IF_GOTO/V28==6,GOTO = L80
        IF_GOTO/V28==7,GOTO = L82
        IF_GOTO/V28==8,GOTO = L83
        $$ NO,
        NO THIS FIXTURE
        GOTO/L81
        L83 =LABEL/
        $$ NO,
        STATION 8
        GOTO/L81
        L82 =LABEL/
        $$ NO,
        STATION 7
        GOTO/L81
        L79 =LABEL/
        $$ NO,
        STATION 5
        GOTO/L81
        L78 =LABEL/
        $$ NO,
        STATION 4
        GOTO/L81
        L77 =LABEL/
        $$ NO,
        STATION 3
        GOTO/L81
        L76 =LABEL/
        $$ NO,
        STATION 2
        GOTO/L81
        L75 =LABEL/
        $$ NO,
        STATION 1
        GOTO/L81
        L80 =LABEL/
        $$ NO,
        STATION 6
        L81 =LABEL/
        \CODE\

        Comment


        • Douglas
          Douglas commented
          Editing a comment
          I don't know if you posted code like that to make me feel better for doing so earlier... but it worked lol

      • #7
        This is the exact same on the other machine, so how can it read it on one but not the other one?

        Comment


        • neil.challinor
          neil.challinor commented
          Editing a comment
          Like Don Ruggieri says, you need to step through everything and test. Your code appears to be looking at the height difference (in Z) between PNT1 and STEP1 / STEP2 etc. put some comments into the program to verify what these values are as the program is executing. It may just be that the step is machined to the wrong height.

        • neil.challinor
          neil.challinor commented
          Editing a comment
          Also try running the same part through the same program on both machines and see if they behave the same.

      • #8
        neil.challinor I will try soon as i can work on the machine. working offline right now

        Comment


        • #9
          SOLVED:

          it seems that the steps weren't deep enough as neil.challinor suggested. I changed the code to:
          L64 =LABEL/
          IF_GOTO/PNT1.Z-STEP1.Z>.002,GOTO = L65
          ASSIGN/V24=0
          GOTO/L66


          instead of .003 and now it's finding it and reporting the correct station.

          Thank you all!

          Comment


          • #10
            Also assuming that somewhere at the start of execution all the variables are set to some default value (such as 0)?

            Comment

            Related Topics

            Collapse

            Working...
            X