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

FOR-ENDFOR alternativ in sps.sub

  • Henry100
  • June 3, 2024 at 3:23 PM
  • Thread is Unresolved
  • Henry100
    Reactions Received
    6
    Trophies
    2
    Posts
    35
    • June 3, 2024 at 3:23 PM
    • #1

    Dear Kuka Community,


    I have a general question regarding the subroutines. In our KUKA (KRC 5 ), the robot is required to perform palletizing processes. I need to link the palletizing counter in each section with the gripper open/close signal. This means that when the robot opens the gripper in a particular section, the palletizing counter for that section will increment. However, due to the high number of sections where palletizing needs to be done, I need a solution similar to this one.

    Code
    DEF SPS()
    
    
    ;USER_PLC 
    
    IF (Gripper-Closed_Input_SIGNAL) And NOT (FlankIndicator )
    
    FOR Feed = 1 TO 23 STEP 1
             FOR Stapel = 1 TO 3 STEP 1
                IF (Mer_PickPlace_Feed[Feed,Stapel]) AND FlankIndicator THEN
                   iCounter_F[Feed,Stapel]=iCounter_F[Feed,Stapel]-1
                 ENDIF
             ENDFOR
          ENDFOR
    FlankIndicator =Gripper-Closed_Input_SIGNAL
    
    END
    Display More


    Actually, I want to avoid the FOR/ENDFOR loop in sps.sub. therefore Iam searching for anew ideas

    I am glad to hear yours

    BR
    HENRY

  • Online
    panic mode
    Reactions Received
    1,278
    Trophies
    11
    Posts
    13,079
    • June 3, 2024 at 3:56 PM
    • #2

    what is the purpose of this? status indication of what the palletizer/depalletizer did?

    why not do that in the robot program? then there is no need for looping. and the way the code is written, line 11 is almost never be executed due conflict with line 6

    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

  • Henry100
    Reactions Received
    6
    Trophies
    2
    Posts
    35
    • June 3, 2024 at 4:29 PM
    • #3

    The customer requests that the piece counter automatically increments whenever the robot opens the gripper in a specific section. Since the robot consistently places parts in these sections, each time the gripper is opened, a new part is added to that section. They aim to prevent any delays that could impact the accuracy of the parts count, such as pressing the initial state button or emergency stop button before the progress indicator reaches the counter increment.


    *thanx i already notice the failed negation in line 11

    Edited once, last by Henry100 (June 3, 2024 at 4:35 PM).

  • Online
    panic mode
    Reactions Received
    1,278
    Trophies
    11
    Posts
    13,079
    • June 3, 2024 at 4:33 PM
    • #4

    that is what robot program is supposed to do...

    Code
    ; ...
    PTP ApproachPos
    LIN DropPos
    Gripper(#Open)
    iCounter_F[Feed,Stapel]=iCounter_F[Feed,Stapel]-1
    LIN ApproachPos
    ; ...

    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

  • Henry100
    Reactions Received
    6
    Trophies
    2
    Posts
    35
    • June 3, 2024 at 4:42 PM
    • #5

    I'll take a step back and look at this with a fresh perspective.

    Thanks

  • Online
    SkyeFire
    Reactions Received
    1,051
    Trophies
    12
    Posts
    9,423
    • June 3, 2024 at 4:57 PM
    • #6

    Is there a particular reason you want to avoid the FOR loop in the SPS? These days, the processors run fast enough that the impact on the SPS execution time should be negligible.

    Since this is a KRC5, I assume it's running KSS 8.6 or higher. That should have multi-Submit by default. If your concern is the FOR loop slowing down something else in the SPS, creating one of the secondary SPSs dedicated to just this update loop should eliminate that concern.

    Alternatively, you could use the cyclic nature of the SPS, and have one element of the 2D iCounter array update every SPS loop. This would keep the SPS execution time constant, and leverge the SPS's raw speed to keep the iCounter update rate fast.

    Code
    IF Stapel > 3 THEN
      Stapel = 1
      Feed = Feed + 1
    ELSE
      Stapel = Stapel + 1
    ENDIF
    
    IF Feed > 23 THEN
      Feed = 1
      Stapel = 1
    ENDIF
    
     IF (Mer_PickPlace_Feed[Feed,Stapel]) AND FlankIndicator THEN
       iCounter_F[Feed,Stapel]=iCounter_F[Feed,Stapel]-1
     ENDIF
    Display More
  • Henry100
    Reactions Received
    6
    Trophies
    2
    Posts
    35
    • June 4, 2024 at 10:15 AM
    • #7

    that is right...

    Generally, I wanted to avoid any impact on SPS execution. so I created a secondary SPS but due to the reason I did not have the robot till now so I tried to test it with KUKA.SIM. But it was too much for KUKA.Sim. :grimacing_face:

    thank you both of you for your feedback

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
  • krc5
  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