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

Writing software limits from sps

  • DavidBrown
  • October 26, 2022 at 11:28 PM
  • Thread is Unresolved
  • DavidBrown
    Trophies
    2
    Posts
    1
    • October 26, 2022 at 11:28 PM
    • #1


    Can softwarelimits of axis, in this specific case axis 7 or external axis 1 (from linear track) be written from sps, or are they write protected from the code?
    f.i. $SOFTP_END[7]=180.0

    System is KRC4 8.5.8

  • Fubini
    Reactions Received
    272
    Trophies
    9
    Posts
    1,871
    • October 27, 2022 at 5:06 AM
    • #2

    They can be written from Ccode. But I would not recommend to do so. Use workspaces instead.

    Fubini

  • Plc_User
    Reactions Received
    2
    Trophies
    4
    Posts
    297
    • December 17, 2022 at 9:10 PM
    • #3

    In the application, in the sps the software limits of axis E1 are now written in the submit program :
    f.i. $SOFTP_END[7]=180.0, $SOFTN_END[7]=180.0.
    The writing is always done (no if statement).
    We got reply of custommer that sps is sometimes stopped since we did last changes to the robot.
    The changes were not just the software limits but also other code.
    We did not get the ability yet to inspect the logs of the robot for diagnosis.
    Does anyone know if writing the software limits of an axis constantly in the sps is no problem for the controller, or if it could be the cause for the sps stopping?
    Until we get access to the controller it would be good to know if this is allowed.

  • the leg
    Reactions Received
    4
    Trophies
    4
    Posts
    643
    • December 18, 2022 at 11:50 AM
    • #4

    Why dont you condition it so it only writes if they are not at the set value .

    or set them on first poer up then condition them

  • DannyDJ
    Reactions Received
    62
    Trophies
    6
    Posts
    493
    • December 18, 2022 at 12:05 PM
    • #5
    Quote from Plc_User

    In the application, in the sps the software limits of axis E1 are now written in the submit program :
    f.i. $SOFTP_END[7]=180.0, $SOFTN_END[7]=180.0.
    The writing is always done (no if statement).
    We got reply of custommer that sps is sometimes stopped since we did last changes to the robot.
    The changes were not just the software limits but also other code.
    We did not get the ability yet to inspect the logs of the robot for diagnosis.
    Does anyone know if writing the software limits of an axis constantly in the sps is no problem for the controller, or if it could be the cause for the sps stopping?
    Until we get access to the controller it would be good to know if this is allowed.

    Display More

    Hello, if in the sps is used $POS_ACT, $TOOL or $BASE they in some cases can stop sps from executing. For example when robot is turned on, those variables at boot have undefined values(you can see that by ? mark in tool and base window). Software limit switch you can also write at the start of the robot program, if you don't need to constantly overwriting the same value over and over again.

  • Hes
    Reactions Received
    39
    Trophies
    2
    Posts
    235
    • December 18, 2022 at 10:23 PM
    • #6

    if this is safety related use workspaces in safeoperation. I am assuming to some degree it is as you want to modify them on the fly. Modifying soft limits is not a good practice if this is at all safety related. Even if you choose to do it with soft limits you will have to handle what to do if the axis is over the limit and how to get out of it. And it will not fulfill requirements of any safety function as they can be modified with ease. If this is not safety related workspaces as suggested by fubini is a far superior solution

  • Online
    SkyeFire
    Reactions Received
    1,039
    Trophies
    12
    Posts
    9,375
    • December 19, 2022 at 4:11 PM
    • #7
    Quote from Plc_User

    Does anyone know if writing the software limits of an axis constantly in the sps is no problem for the controller, or if it could be the cause for the sps stopping?

    It would help if you actually posted the code you are using. However, writing to $SOFTx_END should not cause the SPS to stop.

    However, it is not a good practice to always write to system variables. This should only be done when it is necessary.

    Quote from the leg

    Why dont you condition it so it only writes if they are not at the set value .

    As Leg said, the better way would be something like:

    Code
    IF (($SOFTP_END[7]<>1000) OR ($SOFTN_END[7]<>-1000)) THEN
      $SOFTP_END[7]=1000
      $SOFTN_END[7]=-1000
    ENDIF

    This way, the system variable is only written to if it is out of bounds.

  • panic mode
    Reactions Received
    1,266
    Trophies
    11
    Posts
    13,032
    • December 19, 2022 at 4:30 PM
    • #8

    not sure how would that make any difference... the way i see it that may takes more resources than just writing the value continuously.

    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

  • Online
    SkyeFire
    Reactions Received
    1,039
    Trophies
    12
    Posts
    9,375
    • December 19, 2022 at 5:12 PM
    • #9
    Quote from panic mode

    not sure how would that make any difference... the way i see it that may takes more resources than just writing the value continuously.

    Just as a "general practice" thing. You're right that it probably doesn't make any difference with $SOFT, but for $OV_PRO, for example, it would matter.

    I just dislike writing to system variables when it's not necessary. And keeping a standard "style" across all the SPS-writes-to-system-variables lines just seems like a good idea to me.

    I'm not sure it takes more system resources, aside from two extra lines of code for the IF and ENDIF. At runtime, it'll probably take slightly less execution time (although the difference is probably in microseconds, if not nanoseconds, so it's not significant there).

  • panic mode
    Reactions Received
    1,266
    Trophies
    11
    Posts
    13,032
    • December 19, 2022 at 6:03 PM
    • #10

    the effects are hardly measurable on a short piece of code (couple of lines).

    but on a longer code that would become not just easily measurable but obvious. even on short snippet, if one really wants to dive in and analyze differences can be found.

    for example every character in a file takes space and space is one of resources. wrapping code into IF statement make program longer. compound expression in the IF statement makes it even longer and increased length does not make it easier to process or read.

    beside sheer size there is execution. in this case one instruction is used to assign value but even if that instruction is not executed due to check, comparison still takes place and if i recall correctly that takes longer than just doing the assignment directly.

    actually, variable is of type REAL while compared value is an integer so additional implicit conversion takes place and this is done on every scan.

    not sure if KRL does short circuit evaluation but if that is not the case, it would make something like that IF statement more taxing because that would include two conversions, two comparisons, and additional OR operation.

    also the thing is that exact comparisons to REAL are a pitfall since many values cannot be represented exactly using REAL and compare without window may result in code inside IF block being processed anyway.

    so number of operations per iterations for that code can be in best case two assignments (if assigned values are real) and up to several times that because of use of IF statement, assignment and comparison values are integers and added comparisons. adding to that difference in code length, it seem to be less than ideal.

    simply writing limit continuously could be both shorter and computationally more efficient.

    and there could be more to that since modern processors are struggling with clock limitations. so to get better performance different techniques are used (parallelism, deeper pipe, branch prediction, etc.). the goal is to do more than one operation per clock per core. but things like branch prediction exist for a reason - because performance tends to get messed up with comparisons and prediction is trying to salvage what can be salvaged.

    fortunately writing code in KRL does not require same considerations as programming videogame or or some scientific application.

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