Set variable if feature is marked

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

  • Set variable if feature is marked

    Is there a way to assign a value to a variable based on whether or not a specific feature is marked? This way I can avoid asking another question to set the variable

  • #2
    Specifics are nice, but you can avoid the marked/unmarked situation with a variable and create a label to skip over certain features otherwise.

    Comment


    • #3
      Could probably do something with an "ON ERROR" command. Test to see if the feature is present or not; skip the measurement if the feature isn't there, measure it if it is. Probably want some kind of report comment by the dimension for the feature saying the the feature was skipped. Otherwise the dimension would report the previously run dimension and no one would be the wiser.

      Comment


      • #4
        Use ASSIGN variables with your Mark and Clear Mark to control the variable values.

        Example Code

        ASSIGN/V1=0 is Clear Mark
        ASSIGN/V1=1 is Mark. IF/V1==1 is True
        COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
        ""+V1

        Code:
        [COLOR=#0000cc]ASSIGN/V1=0[/COLOR]
        [COLOR=#3498db]ASSIGN/V1=1[/COLOR]
        [COLOR=#9b59b6]IF/V1==0[/COLOR]
        [COLOR=#3498db]ASSIGN/V1=2[/COLOR]
        COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
        ""+V1
        [COLOR=#9b59b6]END_IF/
        ELSE_IF/V1==1[/COLOR]
        [COLOR=#3498db]ASSIGN/V1=3[/COLOR]
        COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
        ""+V1
        [COLOR=#9b59b6]END_ELSEIF/[/COLOR]
        Now ASSIGN/V1=3

        ASSIGN/V1=1 is Clear Mark
        ASSIGN/V1=0 is Marked. IF/V1==0 is True
        COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
        ""+V1

        Code:
        [COLOR=#3498db]ASSIGN/V1=0[/COLOR]
        [COLOR=#0000cc]ASSIGN/V1=1[/COLOR]
        [COLOR=#9b59b6]IF/V1==0[/COLOR]
        [COLOR=#3498db]ASSIGN/V1=2[/COLOR]
        COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
        ""+V1
        [COLOR=#9b59b6]END_IF/
        ELSE_IF/V1==1[/COLOR]
        [COLOR=#3498db]ASSIGN/V1=3[/COLOR]
        COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
        ""+V1
        [COLOR=#9b59b6]END_ELSEIF/[/COLOR]
        Now ASSIGN/V1=2
        Last edited by davehocum; 02-02-2021, 04:09 PM.

        Comment


        • #5
          So I may not be going about this the best way. I have several programs for very similar parts that use the same external alignment. These programs all start in DCC and stay in DCC the whole time. I currently have a seperate program that does nothing except set the external alignment with a manual and DCC alignment, then save the DCC aln as external and that's it (this gets ran maybe 2x a year when someone accidentally knocks the fixture loose). I don't really like this method though, so I'm trying to put the same manual alignment in each program. My goal is to have it set up so that if the manual alignment is not needed, it will skip over it, NOT save the manual alignment externally, recall the external alignment, then go into DCC. If the manual alignment is needed, I want it to run manual features, save this externally, recall it, then go into DCC. This way if the fixture gets moved, the alignment only needs to be ran once on any program.

          This is what I tried yesterday:

          Code:
          C1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
          Is the fixture in a different location than it was the last time this program was ran?
          
          If you are not sure, answer "YES".
          FASTPROBEMODE/ON
          IF_GOTO/C1.INPUT=="NO",GOTO = SKIP_MAN
          
          manual alignment features here
          
          MAN_ALN
          
          SAVE/ALIGNMENT,MAN_ALN.aln,MACHINETOPA RTS
          SKIP_MAN =LABEL/
          RECALL/ALIGNMENT,EXTERNAL,MAN_ALN
          MODE/DCC
          This works alright except for one situation. If you do not mark manual alignment features, and you answer YES to the comment, it will skip the manual features (since they are unmarked, but the manual alignment is still marked), but still overwrite the external alignment with the manual alignment. This could potentially cause a crash, so I need help improving my logic or I'll just go back to the manual alignment program, and start all the programs in DCC like I had it. I was hoping to essentially get rid of the comment, and have it driven off of whether or not one of the manual features was marked

          Comment


          • #6
            Originally posted by Mike Ruff View Post
            So I may not be going about this the best way. I have several programs for very similar parts that use the same external alignment. These programs all start in DCC and stay in DCC the whole time. I currently have a seperate program that does nothing except set the external alignment with a manual and DCC alignment, then save the DCC aln as external and that's it (this gets ran maybe 2x a year when someone accidentally knocks the fixture loose). I don't really like this method though, so I'm trying to put the same manual alignment in each program. My goal is to have it set up so that if the manual alignment is not needed, it will skip over it, NOT save the manual alignment externally, recall the external alignment, then go into DCC. If the manual alignment is needed, I want it to run manual features, save this externally, recall it, then go into DCC. This way if the fixture gets moved, the alignment only needs to be ran once on any program.

            This is what I tried yesterday:

            Code:
            C1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
            Is the fixture in a different location than it was the last time this program was ran?
            
            If you are not sure, answer "YES".
            FASTPROBEMODE/ON
            IF_GOTO/C1.INPUT=="NO",GOTO = SKIP_MAN
            
            manual alignment features here
            
            MAN_ALN
            
            SAVE/ALIGNMENT,MAN_ALN.aln,MACHINETOPA RTS
            SKIP_MAN =LABEL/
            RECALL/ALIGNMENT,EXTERNAL,MAN_ALN
            MODE/DCC
            This works alright except for one situation. If you do not mark manual alignment features, and you answer YES to the comment, it will skip the manual features (since they are unmarked, but the manual alignment is still marked), but still overwrite the external alignment with the manual alignment. This could potentially cause a crash, so I need help improving my logic or I'll just go back to the manual alignment program, and start all the programs in DCC like I had it. I was hoping to essentially get rid of the comment, and have it driven off of whether or not one of the manual features was marked
            Mike, sounds like you need to make a subroutine for your manual alignment. You'll never have problems with marking/unmarking because the manual align is outside of the prg they'll be running.

            Put at top of code
            Code:
            GROUP_SUBROUTINE_EXTERNAL_ALIGNMENT=GROUP/SHOWALLPARAMS=YES
            QUES_SUB_EXTALIGN =COMMENT/YESNO,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
            Do you need to reset the fixture alignment?
            
            
            YES--> If this is first time running prg for the day
            NO--> You're running with no issues
            CANCEL--> Cancel, I need help
            IF_GOTO/QUES_SUB_EXTALIGN.INPUT=="NO",GOTO = LABEL_SKIP_SUBROUTINE
            CS1 =CALLSUB/AG0XXXX_XXX_EXT_ALIGN,:,
            LABEL_SKIP_SUBROUTINE =LABEL/
            ENDGROUP/ID=GROUP_SUBROUTINE_EXTERNAL_ALIGNMENT
            SF7107(PCD), SF454(PCD), 152614(Quindos), 9159(Quindos), 7107(Quindos), B&S Manual, M&M Gear Checker

            Comment


            • #7
              Originally posted by DAN_M View Post

              Mike, sounds like you need to make a subroutine for your manual alignment. You'll never have problems with marking/unmarking because the manual align is outside of the prg they'll be running.

              Put at top of code
              Code:
              GROUP_SUBROUTINE_EXTERNAL_ALIGNMENT=GROUP/SHOWALLPARAMS=YES
              QUES_SUB_EXTALIGN =COMMENT/YESNO,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
              Do you need to reset the fixture alignment?
              
              
              YES--> If this is first time running prg for the day
              NO--> You're running with no issues
              CANCEL--> Cancel, I need help
              IF_GOTO/QUES_SUB_EXTALIGN.INPUT=="NO",GOTO = LABEL_SKIP_SUBROUTINE
              CS1 =CALLSUB/AG0XXXX_XXX_EXT_ALIGN,:,
              LABEL_SKIP_SUBROUTINE =LABEL/
              ENDGROUP/ID=GROUP_SUBROUTINE_EXTERNAL_ALIGNMENT
              I decided to go with this idea and it is working like a charm! Thanks for the help and suggestions DAN_M and everyone else!

              Comment


              • #8
                Originally posted by Mike Ruff View Post

                I decided to go with this idea and it is working like a charm! Thanks for the help and suggestions DAN_M and everyone else!
                Happy to help!
                SF7107(PCD), SF454(PCD), 152614(Quindos), 9159(Quindos), 7107(Quindos), B&S Manual, M&M Gear Checker

                Comment

                Related Topics

                Collapse

                Working...
                X