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

Set a specific digital output from a function given a numeric ID

  • robotecnik
  • April 19, 2022 at 2:24 PM
  • Thread is Unresolved
  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • April 19, 2022 at 2:24 PM
    • #1

    Hi all,

    I need to activate a digital output every time I call a function, when I am doing the first point, I want to activate the doPoint1, when I am doing the second point the function should activate the doPoint2 and so on.

    Late binding only work with procedures, it would be super easy with an array, but I don't know of any way to make an array to share the same memory space than a list of outputs.

    AliasIO does not seem the way to go either... as I would have to define an alias for each signal...

    A group output could be the way, setting it to the same address than all the DO bits, but I would have to calculate the right bit and make an bitwise OR with that,,,

    Something like this pseudocode:

    Code
    InitialValue = GOutput(groupOutuput);
    bitActiveValue = calculateValueWithOnlyOneBitActive(5);
    setGO groupOutuput, calculatedValue OR InitialValue; // BitOr seems only to work with BYTES not bigger groups.

    But as said in the comment, BitOR seems only to work with 8 bits at once...

    Apart of doing something like (PseudoCode again):

    Code
    CASE i:
      1: setDO doPoint1,1;
      2: setDO doPoint2,1:
    ...
    ENDCASE

    Not a big deal doing this... it would work and I have to do it only for 32 signals, but it's super ugly... :nauseated_face:

    How would you solve this small issue?

    Thank you all in advance.

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • Go to Best Answer
  • Lemster68
    Reactions Received
    299
    Trophies
    9
    Posts
    2,466
    Blog Articles
    7
    • April 19, 2022 at 3:03 PM
    • #2
    Quote from Joan Murt

    when I am doing the first point, I want to activate the doPoint1, when I am doing the second point

    What do you mean when you say that? Do you mean moving to or arriving at a taught point?

  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • April 19, 2022 at 3:13 PM
    • #3

    When robot arrives at a taught point it calls a function and inside that function, it activates the right output related to that point...

    After the robot reached point 1, that function will have to activate the bit do1, after the robot reached point 2, that function will have to activate do2 and like this for all 32 points.

    :smiling_face:

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • Lemster68
    Reactions Received
    299
    Trophies
    9
    Posts
    2,466
    Blog Articles
    7
    • April 19, 2022 at 4:10 PM
    • #4

    It sounds like you are overcomplicating things. There is already MoveL/J DO and GO. There is also TriggL/J available also.

  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • April 19, 2022 at 4:34 PM
    • #5

    That would not be enough, there is a full function that does several things before the do must be activated or not at the end.

    In any case, given it's a matter of only 64 signals, I can do it easily in Excel using a couple of concat formulas... ugly as @#$%, but it will work.

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • Lemster68
    Reactions Received
    299
    Trophies
    9
    Posts
    2,466
    Blog Articles
    7
    • April 19, 2022 at 4:41 PM
    • #6

    There is also MoveLSync then.

  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • April 19, 2022 at 5:22 PM
    • #7

    Yes, but then the problem is the same than at the beginning, I need to activate do1, or do2, or do3 and I know only the number 1, 2 or 3 when I call the function.

    I'd like to know how to do something like setDO(%do%3,1); to activate the 3rd do.

    That's my problem, in fact MoveLDo would be great if I could activate the output directly, but I can't as the programmer could just add the right output to the movement, but in my case, I need to activate a bit from a auxiliar function that is called when I stop in all the different work points. Then that function is a general one and I want, from that general function to activate the right output.

    Code
    TEST nID
      CASE 1: SetDO do1 , 1;
      CASE 2: SetDO do2 , 1;
      CASE 3: SetDO do3 , 1;
      ...

    BitOr would be wonderful with a GO signal linked to the same address than the normal digital outputs are, but it does not work with more than 8 bits.

    And, if I need to do a special process 4 times, I prefer to do a simple assignment 32 times and keep it easier to understand, with a comment explaining there is an Excel file that makes the job.

    As always, thank you very much for your time Lemster!

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • Lemster68
    Reactions Received
    299
    Trophies
    9
    Posts
    2,466
    Blog Articles
    7
    • April 19, 2022 at 5:50 PM
    • #8

    Please clarify if it is really a function call or a procedure call.

  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • April 19, 2022 at 6:36 PM
    • #9

    Hi again,

    It's a procedure call.

    It's called after some movements.

    Its a general procedure which receives some parameters, but the important one now it's a num variable which is the point identifier (a simple numeric ID).

    With that identifier, let's say 3, I must activate a digital output do3.

    Those outputs are defined correlative:

    do1, do2, do3, do4 .. do32.

    If the ID is 31 I need to activate the do31 if some conditions are met during the execution of the procedure. If the ID is 4 I will have to activate the do4 if those conditions are met.

    I don't know of any good method to go from ID 5 to setDO do5, 1;

    Again, thanks for your time.

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • Lemster68
    Reactions Received
    299
    Trophies
    9
    Posts
    2,466
    Blog Articles
    7
    • April 19, 2022 at 6:40 PM
    • Best Answer
    • #10

    A parameter for a procedure call can be of type signaldo. See an example here:

    Thread

    Code to share

    Hi all devoted ABB programmers,

    Here is some code I wrote some years ago, posting it here for you to use, learn some programming. There are no warranties express or implied, user assumes all risks. Here goes:

    MODULE LEERULZ

    ! This module contains two routines, rEnter and rExit which are
    ! intended to be universal handshake routines for requesting
    ! entry from the cell controller to enter an area, fixture or
    ! robot interference zone. When called, the user must pass in
    ! the parameters and…
    Lemster68
    June 4, 2019 at 8:12 PM
  • robotecnik
    Reactions Received
    19
    Trophies
    4
    Posts
    568
    • April 19, 2022 at 7:56 PM
    • #11

    Yes, that would do it... wanted to avoid it because I have to check one input (di3) and activate an output (do3) but that would work without jumping to other functions to convert from an ID to a signal.

    Will take a look at it and check if it would suit all my cases.

    Thanks! :thumbs_up:

    http://www.robotecnik.com | Robots, CNC and PLC programming.

  • Lemster68
    Reactions Received
    299
    Trophies
    9
    Posts
    2,466
    Blog Articles
    7
    • April 19, 2022 at 8:01 PM
    • #12

    You are welcome. You could just use parts of that to modify your current procedure, as well.

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

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