Home Programming

Discussion

Left ArrowBack to discussions page
veryandy1veryandy1 Posts: 7 Apprentice
Our UR 10 has a programme that controls  4 different welding Jigs. When a jig is loaded with a product it triggers a Digital input. If a Jig is not loaded and the input stays low, is there a command I can use so the programme can skip or jump further down the programme missing this Jig out. If so how can it be programmed ?

Best Answer

Comments

  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,267 Handy
    Put your code inside and if statement, then if the of statement is not made it will skip to the next section. 

    If(digital-in-0 == True):
      do sometbing
    end
    if (digital-in-1 == True):
      do something
    end
    .... you can also write the if statement like this 
    
    if (digital-in-2):
      do something else
    end

  • veryandy1veryandy1 Posts: 7 Apprentice
    edited October 2020



    Mathew, I tried it today on my programme and I could not get it to work. 
    This is a programme I have found online, similar to ours, what I would want to input into the programme  before the first Move J, basically if DI 0 is high continue the programme as normal, but if DI 0 is low go straight to "Pick sequence" and skip waypoint 1 + 13

    How would the code look for this please, and where would it be inserted ? 


  • veryandy1veryandy1 Posts: 7 Apprentice


    further to my last image, this is the actual programme we run, Start 2 is connected to a proximity switch that goes high when a part is loaded. What I am trying to do is skip Jig 1 if no part is loaded and go straight to Jig 2. 
    I have made the "If" statement 4th line down, " If start 2  is False "  but do not know what to put into the next line if the criteria is met, to skip straight to Jig 2 in the programme.
    What function or what to input to make it happen ? 
    Anybody able to help ? 
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,267 Handy
    edited October 2020
    Put your entire Jig_1 folder under the if statement. Then if that sensor is high it will execute Jig_1 code. Then put another if statement for Jig_2 and place it under that if statement. 

    I’m not near a robot at the moment but basically this

    If (DI0):
      Jig_1
        movej
          weld_1_start
          ....
    if (DI1)
      Jig_2
       Movej
         Pre_weld_3
         .....
    
    etc

  • veryandy1veryandy1 Posts: 7 Apprentice
    Yes Matt, running perfectly now, just cut and pasted the folder with each jig under the IF command and set the IF D!1 = true then Jig 1. and so on. thank you very much. I was going to post it later on to let you know. 

    The next step in the programme is to set a counter so after every  50 or so cycles the programme then moves the TCP to a point where the welding nozzle can be cleaned and a pop up appears on the screen to execute then restarts the programme and re sets the counter. I dont suppose you can give me any pointers on this please ? 
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,267 Handy
    Create an installation variable on the installation tab and set the initial value to 0. You can then use the set command, at the bottom you can increment an installation variable. Do this at the bottom of your program. Then after you increment it use an if statement and check to see if it’s whatever you want to move to the cleaning station. Once you do that use an assignment and select that variable from the list and set it to 0. 

    The reason to use an installation variable is so that the value is persisted across programs starts and stops as well as powering the robot off and on. 
Sign In or Register to comment.
Left ArrowBack to discussions page