1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Stop program when position is reached

  • EiBru
  • May 9, 2023 at 9:44 AM
  • Thread is Unresolved
  • EiBru
    Trophies
    2
    Posts
    6
    • May 9, 2023 at 9:44 AM
    • #1

    Hello.

    I have a main.src program that calls another program AxisScan.src

    In main.src i have declared a global interrupt that should detect errors:

    Code
    GLOBAL INTERRUPT DECL 4 WHEN RuntimeError==TRUE DO OnError()
    INTERRUPT ON 4

    The RuntimeError variable is declared in main.dat

    Code
    GLOBAL BOOL RuntimeError=TRUE; 

    The OnError subprogram should stop movement, cancel programs and wait for signal from PLC before continuing execution of main.src.

    Code
    def OnError()
       BRAKE;
       wait for I_ResetRuntimeError;
       RuntimeError = false;
       O_RuntimeError = false;
       CONTINUE;
    end

    The AxisScan program is executed from a subprogram in main.src

    Code
    def ScanVertical()
       BAS(#BASE, DefaultBaseNo);
       BAS(#TOOL, SensorToolNo);
       AxisScan(V_S_Start, V_S_End);
    end

    The AxisScan program scans a part with a sensor mounted on the tool. The scanning process is stopped as soon as the robot gets a signal from the sensor.

    AxisScan program:

    Code
    DEF AxisScan (startpos:IN, endpos:IN)
       e6pos startpos; Start position
       e6pos endpos; End position
       interrupt decl 10 when I_SensorSignal == TRUE do StopScan();
       interrupt decl 11 when I_SensorSignal == FALSE do StopSlowScan();
       $advance = 0;
    
       $OV_PRO = ScanVelocity;
      
       interrupt on 10;
       DoScan(endpos);
       interrupt off 10;
      
       $OV_PRO = SlowScanVelocity;
       
       interrupt on 11;
       DoScan(startpos);
       interrupt off 11;
    
       $OV_PRO = NormalVelocity;
    END
    Display More

    StopScan looks like this and works. This cancels the DoScan subprogram and stops robot motion.

    Code
    def StopScan()
       brake F; Stop robot motion
       resume; Cancel all subprograms
    end

    The subprogram that executes the scanning movement looks like this

    Code
    def DoScan(target:IN)
       e6pos target;
       LIN target;
       RuntimeError = true; This should stop the AxisScan program
    end

    When RuntimeError is set to true i expect the robot to stop until a signal is detected from PLC and AxisScan to stop execution, but AxisScan continues execution and robot is never stopped.

    Can anyone help me on this?

    Edited 2 times, last by EiBru: Code blocks (May 9, 2023 at 2:16 PM).

  • Go to Best Answer
  • MOM May 9, 2023 at 11:07 AM

    Approved the thread.
  • Roland Keller
    Reactions Received
    13
    Trophies
    5
    Posts
    66
    • May 9, 2023 at 12:06 PM
    • #2
    Code
    INTERRUPT ON 4
  • EiBru
    Trophies
    2
    Posts
    6
    • May 9, 2023 at 12:51 PM
    • #3

    I forgot to mention that the interrupt is activated in def main(). I edited my question to clearify.

  • Mentat
    Reactions Received
    61
    Trophies
    5
    Posts
    243
    • May 9, 2023 at 3:27 PM
    • Best Answer
    • #4

    First, in StopScan(), make sure you actually want

    Code
    brake F; Stop robot motion

    instead of simple brake.

    The reason why interrupt 4 never gets activated- interrupts are triggered by rising edge and you already have

    Code
    GLOBAL BOOL RuntimeError=TRUE;

    that I suspect is not set to false anywhere outside the interrupt routine.

  • EiBru
    Trophies
    2
    Posts
    6
    • May 9, 2023 at 3:52 PM
    • #5

    Thanks Mentat. I don't know how i missed that..

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Similar Threads

  • Interrupt Example

    • SkyeFire
    • March 18, 2021 at 8:25 PM
    • Manuals, Software and Tools for KUKA Robots
  • Robot Pointer

    • verove
    • April 20, 2023 at 3:12 PM
    • ABB Robot Forum
  • Bringing robot safely to home position

    • jinesh8888
    • February 4, 2023 at 2:11 PM
    • KUKA Robot Forum
  • How to work with Linear cooperative motion

    • arun_AR
    • May 5, 2022 at 4:42 PM
    • Kawasaki Robot Forum
  • Dynamic control of FANUC Robot in Run-Time

    • Gokul N A
    • July 3, 2019 at 10:39 AM
    • Fanuc Robot Forum
  • Collision detection problem

    • jamesand6
    • January 15, 2019 at 4:15 PM
    • KUKA Robot Forum
  • Homing filosophy with Fanuc

    • PetrBroza
    • November 25, 2020 at 10:00 AM
    • Fanuc Robot Forum
  • Different brake reactions when searching for one part

    • robotecnik
    • September 23, 2020 at 10:12 AM
    • KUKA Robot Forum
  • Motion Interlock FANUC

    • a00948630
    • June 19, 2019 at 7:59 PM
    • Fanuc Robot Forum

Tags

  • interrupt
  • exception
  • errorhandling
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download