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

IO strings and conditions!!!

  • Braxtonc001
  • May 29, 2022 at 7:21 PM
  • Thread is Unresolved
  • Braxtonc001
    Trophies
    3
    Posts
    25
    • May 29, 2022 at 7:21 PM
    • #1

    Okay all, either I am insane or ABB wont do the simple things. Am I doing this right? I want to watch conditions of an input but I want that input to change based on a string

    Can I do this......


    sIOname := "PLC_DI80_OrderReq_Cnv"+NumToStr(nCnvNum,0)+"Chute"+NumToStr(nMagNum,0)+"_"+NumToStr(nChuteNum,0);

    IF DInput(sioname)=1 THEN

    ENDIF


    OR....

    If dinput ("PLC_DI80_OrderReq_Cnv"+NumToStr(nCnvNum,0)+"Chute"+NumToStr(nMagNum,0)+"_"+NumToStr(nChuteNum,0))=1 then

    Endif

  • Go to Best Answer
  • Lemster68
    Reactions Received
    296
    Trophies
    9
    Posts
    2,460
    Blog Articles
    7
    • May 31, 2022 at 2:03 PM
    • #2

    What? Why?

  • SomeTekk
    Reactions Received
    16
    Trophies
    4
    Posts
    201
    • May 31, 2022 at 2:38 PM
    • #3

    If you would like to evaluate strings for program flow based on the text the TEST instruction is a possible option.

  • SkyeFire
    Reactions Received
    1,044
    Trophies
    12
    Posts
    9,391
    • May 31, 2022 at 2:52 PM
    • #4
    Quote from Lemster68

    What? Why?

    I'm guessing they want to do something like late binding, but for I/O names instead of PROC names.

  • Loipe
    Reactions Received
    7
    Trophies
    3
    Posts
    38
    • June 1, 2022 at 8:34 AM
    • #5

    You can build an io name and connect it to an Aliasio then use the alias

  • Braxtonc001
    Trophies
    3
    Posts
    25
    • June 2, 2022 at 9:31 PM
    • #6

    The WHY is because I have over 60 of the inputs and outputs to do. and I hate rewriting and copy and paste. 60 because thats what the PLC guy wanted.

    The thought was. If I could dynamically read I/O and uses a loop or counters. it would be 4 or 5 lines vs 60.. and much easier to make changes if needed.

  • Lemster68
    Reactions Received
    296
    Trophies
    9
    Posts
    2,460
    Blog Articles
    7
    • June 2, 2022 at 9:37 PM
    • #7

    60 signals to define or writing a routine/routines that evaluates the state of those signals?

  • Braxtonc001
    Trophies
    3
    Posts
    25
    • June 3, 2022 at 4:02 AM
    • #8

    I already wrote a routine to simplify. So the work is already done unfortunately.

    But I was hoping there was an easy way. Still ended up being 120 lines unfortunately. there was more I.O. then I thought.

    The more I read the manual. the more I see its not possible.

  • Loipe
    Reactions Received
    7
    Trophies
    3
    Posts
    38
    • June 3, 2022 at 10:14 AM
    • Best Answer
    • #9

    i wrote this in 10 minutes You have to try and give it better names but it should work like this

    Code
       PROC VARtest()
    
    
            If dinput(diVar("PLC_DI80_OrderReq_Cnv"+NumToStr(nCnvNum,0)+"Chute"+NumToStr(nMagNum,0)+"_"+NumToStr(nChuteNum,0)))=1 then
                SetDoVar("PLC_Do80_OrderAck_Cnv"+NumToStr(nCnvNum,0)+"Chute"+NumToStr(nMagNum,0)+"_"+NumToStr(nChuteNum,0)),high;
            endif
    
            If bdiVar("PLC_DI80_OrderReq_Cnv"+NumToStr(nCnvNum,0)+"Chute"+NumToStr(nMagNum,0)+"_"+NumToStr(nChuteNum,0)) then
                SetDoVar("PLC_Do80_OrderAck_Cnv"+NumToStr(nCnvNum,0)+"Chute"+NumToStr(nMagNum,0)+"_"+NumToStr(nChuteNum,0)),high;
            endif
    
        ENDPROC
    
        FUNC dionum diVar(string SignalName)
            VAR signaldi TmpDiVar;
            AliasIO SignalName,TmpDiVar;
            RETURN TmpDiVar;
        ENDFUNC
    
        FUNC bool bdiVar(string SignalName)
            VAR signaldi TmpDiVar;
            AliasIO SignalName,TmpDiVar;
            RETURN TmpDiVar=high;
        ENDFUNC
    
    
        PROC SetDoVar(string SignalName,dionum Value)
            VAR signaldo TmpDoVar;
            AliasIO SignalName,TmpDoVar;
            SetDO TmpDoVar,Value;
        ENDPROC
    Display More

    im working with kuka atm and i wished i would be back at an abb. so much possibillities

  • Braxtonc001
    Trophies
    3
    Posts
    25
    • June 7, 2022 at 4:36 PM
    • #10

    I cant wait to try this.... Ill get you an update when I can. I think it will work though!

    Definitely headed down the right path Loipe

  • blueicaro
    Reactions Received
    3
    Trophies
    3
    Posts
    31
    • June 13, 2022 at 1:01 PM
    • #11

    Take a look of AliasIO instrucction:

    Var signaldo myDo

    Var string stTemp

    stTemp := "PLC_DI80_OrderReq_CNV"+ValToStr(nCnvnum)

    AIiasIo stTemp,myDo

    If MyDo = 1 Then

    (...)

  • Loipe
    Reactions Received
    7
    Trophies
    3
    Posts
    38
    • June 13, 2022 at 3:53 PM
    • #12

    what is with it? Doesn't work? Little more information what to look at :winking_face:

    Did the functions work i prepared for u?

  • Loipe
    Reactions Received
    7
    Trophies
    3
    Posts
    38
    • June 13, 2022 at 3:56 PM
    • #13

    NumToStr(nCnvnum,0) only thing i see

    Edited once, last by Loipe (June 13, 2022 at 4:31 PM).

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

Similar Threads

  • Questions about AS features by KRL programmer

    • Mentat
    • November 25, 2020 at 9:24 PM
    • Kawasaki Robot Forum

Tags

  • IO
  • string
  • IF
  • num
  • strtonum
  • If statement
  • Check IO string based
  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