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

Issues with using global interrupt properly in Auto External mode

  • emerald_geni
  • June 27, 2022 at 7:57 AM
  • Thread is Unresolved
  • emerald_geni
    Trophies
    2
    Posts
    25
    • June 27, 2022 at 7:57 AM
    • #1

    Hi guys,

    I am using KSS 8.6 END V6


    I am trying to create a global interrupt that will initiate a recovery.src in my cell( interrupt 20). it should be always running.

    i have a few questions regarding it.

    Code
    &ACCESS RVO
    &COMMENT HANDLER on external automatic
    DEF  CELL ( )
    ;FOLD EXT DECL
    ;ENDFOLD 
      ;FOLD INIT
      DECL CHAR DMY[3]
      DMY[]="---"
      ;ENDFOLD (INIT)
      ;FOLD BASISTECH INI
         
      GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS == TRUE DO IR_STOPM ( )
      INTERRUPT ON 3 
        
      BAS (#INITMOV,0 )
      ;ENDFOLD (BASISTECH INI)
      ;FOLD CHECK HOME
      $H_POS=XHOME
      IF CHECK_HOME==TRUE THEN
        P00 (#CHK_HOME,#PGNO_GET,DMY[],0 ) ;Testing Home-Position
      ENDIF
      ;ENDFOLD (CHECK HOME)
      ;FOLD PTP HOME  Vel= 100 % DEFAULT;%{PE}%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:100, 7:DEFAULT
      PDAT_ACT=PDEFAULT
      FDAT_ACT=FHOME
      BAS (#PTP_PARAMS,100 )
      $H_POS=XHOME
      PTP  XHOME
      ;ENDFOLD
      ;FOLD AUTOEXT INI
      P00 (#INIT_EXT,#PGNO_GET,DMY[],0 ) ; Initialize extern mode
      ;ENDFOLD (AUTOEXT INI)
    GLOBAL INTERRUPT DECL 20 WHEN $IN[18] == TRUE DO Recovery ( )   
      LOOP
        P00 (#EXT_PGNO,#PGNO_GET,DMY[],0 )
        INTERRUPT ON 20
    Display More

    1) I am trying to replicate and have placed my own interrupt below it, at first.

    :: GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS == TRUE DO IR_STOPM ( )

    INTERRUPT ON 3

    but my global interrupt does not seem to work,

    2) if it is global interrupt, why is this line declared, being written in every .src file that is created.

    3) would a .sub be better suited for this?

    if so, i tried calling the file but get $ACC-AXIS variable write-protected in module BAS, line 411.

    I tried searching in the forum to find a solution but i do not understand it fully.

    Thanks for your help.

  • hermann
    Reactions Received
    407
    Trophies
    9
    Posts
    2,612
    • June 27, 2022 at 8:04 AM
    • #2

    Don't use Global, just use normal interrupt.

  • emerald_geni
    Trophies
    2
    Posts
    25
    • June 27, 2022 at 11:12 AM
    • #3
    Quote from hermann

    Don't use Global, just use normal interrupt.

    If it is a NORMAL INTERRUPT i wont be able to initiate the interrupt in any SRC file being called from the CELL right?

    Edited once, last by emerald_geni (June 27, 2022 at 11:26 AM).

  • hermann
    Reactions Received
    407
    Trophies
    9
    Posts
    2,612
    • June 27, 2022 at 12:32 PM
    • #4

    Try it. We use it for decades, and it works.

  • SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,427
    • June 27, 2022 at 3:15 PM
    • #5

    If the Interrupt is DECL'd in CELL.SRC, it gets "inherited" by every routine that CELL calls, and every routine those routines call. GLOBAL is not required for that.

    The reason that Interrupt 3 is DECL'd in the INI Fold of every module created using the default template, is because KUKA was trying to make a simple template that would work for all use cases. And re-DECLing an Interrupt doesn't do any harm.

    Quote from emerald_geni

    3) would a .sub be better suited for this?

    if so, i tried calling the file but get $ACC-AXIS variable write-protected in module BAS, line 411.

    I tried searching in the forum to find a solution but i do not understand it fully.

    It would help if we had any idea what you're trying to do with $ACC_AXIS. As a general rule, motion-controlling variables cannot be modified from inside the SPS, as those variables are "owned" by the Level 1 Interpreter (the Interpreter that the robot motion programs are executed in).

  • emerald_geni
    Trophies
    2
    Posts
    25
    • June 28, 2022 at 3:29 AM
    • #6
    Quote from SkyeFire

    If the Interrupt is DECL'd in CELL.SRC, it gets "inherited" by every routine that CELL calls, and every routine those routines call. GLOBAL is not required for that.

    The reason that Interrupt 3 is DECL'd in the INI Fold of every module created using the default template, is because KUKA was trying to make a simple template that would work for all use cases. And re-DECLing an Interrupt doesn't do any harm.

    It would help if we had any idea what you're trying to do with $ACC_AXIS. As a general rule, motion-controlling variables cannot be modified from inside the SPS, as those variables are "owned" by the Level 1 Interpreter (the Interpreter that the robot motion programs are executed in).

    Hi Skyefire,

    I made positioning monitoring (SPS) that will record the robots positions to text file.

    I am trying to get the INTERRUPT to initiate the recovery.SRC to get it back home after IN[18] is true.

    my recovery.SRC has following:

    $AXIS_ACT: to PTP to itself before homing(to prevent BCO to home)

    SPTP P[i] WITH $VEL_AXIS[1] = SVEL_JOINT(10.0) C_Spl

  • emerald_geni
    Trophies
    2
    Posts
    25
    • June 28, 2022 at 3:51 AM
    • #7
    Quote from SkyeFire

    If the Interrupt is DECL'd in CELL.SRC, it gets "inherited" by every routine that CELL calls, and every routine those routines call. GLOBAL is not required for that.

    The reason that Interrupt 3 is DECL'd in the INI Fold of every module created using the default template, is because KUKA was trying to make a simple template that would work for all use cases. And re-DECLing an Interrupt doesn't do any harm.

    It would help if we had any idea what you're trying to do with $ACC_AXIS. As a general rule, motion-controlling variables cannot be modified from inside the SPS, as those variables are "owned" by the Level 1 Interpreter (the Interpreter that the robot motion programs are executed in).

    Below is my declaration of interrupt 20 in my CELL. i checked in my INPUT/OUTPUTS -> DIGITAL OUTPUTS and my di_bInitRecoveryfrmPLC is being switched ON correctly.

    Code
    &ACCESS RVO
    &COMMENT HANDLER on external automatic
    DEF  CELL ( )
    ;FOLD EXT DECL
    ;ENDFOLD 
      ;FOLD INIT
      DECL CHAR DMY[3]
      DMY[]="---"
      ;ENDFOLD (INIT)
      ;FOLD BASISTECH INI
         
      GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS == TRUE DO IR_STOPM ( )
      INTERRUPT ON 3 
      
      INTERRUPT DECL 20 WHEN di_bInitRecoveryfrmPLC == TRUE DO Interrupt_test ( )
      INTERRUPT ON 20 
    
    
      BAS (#INITMOV,0 )
      ;ENDFOLD (BASISTECH INI)
      ;FOLD CHECK HOME
      $H_POS=XHOME
      IF CHECK_HOME==TRUE THEN
        P00 (#CHK_HOME,#PGNO_GET,DMY[],0 ) ;Testing Home-Position
      ENDIF
      ;ENDFOLD (CHECK HOME)
      ;FOLD PTP HOME  Vel= 100 % DEFAULT;%{PE}%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:100, 7:DEFAULT
      PDAT_ACT=PDEFAULT
      FDAT_ACT=FHOME
      BAS (#PTP_PARAMS,100 )
      $H_POS=XHOME
      PTP  XHOME
      ;ENDFOLD
      ;FOLD AUTOEXT INI
      P00 (#INIT_EXT,#PGNO_GET,DMY[],0 ) ; Initialize extern mode
      ;ENDFOLD (AUTOEXT INI)
       ;GLOBAL INTERRUPT DECL 20 WHEN $IN[18] == TRUE DO Recovery ( )  
      ;INTERRUPT ON 20
      LOOP
        P00 (#EXT_PGNO,#PGNO_GET,DMY[],0 )
    Display More

    Interrupt_test ( ) just has the following:

    Code
    &ACCESS RV
    DEF  Interrupt_test ( )
    ;FOLD INI;%{PE}
      ;FOLD BASISTECH INI
        GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
        INTERRUPT ON 3 
        BAS (#INITMOV,0 )
      ;ENDFOLD (BASISTECH INI)
      ;FOLD USER INI
        ;Make your modifications here
    
      ;ENDFOLD (USER INI)
    ;ENDFOLD (INI)
    
    MsgNotify("In read_CSV file",,)
    END
    Display More
  • Online
    panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,083
    • June 28, 2022 at 4:37 AM
    • #8

    you cannot do that... it is not how interrupts work. there are limitations.

    your ISR routine cannot contain things like INI fold. so you need to remove lines 2-13 from Interrupt_Test()

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • emerald_geni
    Trophies
    2
    Posts
    25
    • June 28, 2022 at 5:18 AM
    • #9
    Quote from panic mode

    you cannot do that... it is not how interrupts work. there are limitations.

    your ISR routine cannot contain things like INI fold. so you need to remove lines 2-13 from Interrupt_Test()

    have deleted as you said and tried again

    Code
    &ACCESS RV
    DEF  Interrupt_test ( )
    
    MsgNotify("In read_CSV file",,)
    END

    I still am not able to see MsgNotify turn up.

    Could my interrupt is triggered by IN[18] which is ON when i press ESTOP and then Press RESET in my PLC. Could ESTOP interfere with the interrupt?

  • emerald_geni
    Trophies
    2
    Posts
    25
    • June 28, 2022 at 10:50 AM
    • #10

    Got interrupt to work. Thanks guys

  • Online
    panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,083
    • June 28, 2022 at 8:04 PM
    • #11

    interrupts are not level sensitive, they are edge sensitive. so if condition is already true, interrupt will not be triggered.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

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
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • 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
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • KUKA
  • interrupt
  • global
  • auto ext

Users Viewing This Thread

  • 2 Guests
  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