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

Call a program using SR and BG logic

  • Theo.g
  • May 4, 2021 at 2:32 PM
  • Thread is Resolved
  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • May 4, 2021 at 2:32 PM
    • #1

    Hello everyone,

    I have a CR-7ia/L fanuc robot with a R30-iB plus controller.

    So my problem is that I want to start a program with a value save in a SR by a barcode scanner pluged in an HMI and with the action of an operator send it to the SR.

    I found out on the forum that you can call an SR and start the program with the same name, but I wanted it to be automatic. I thought that I could use BG logic, but find out that I can't call a program in them.

    I also find on the forum people talking about macro, but I never used it and from what I understood I need to write in my BD logic :

    UI [4:Cycle stop] = on

    Wait DO [170] = on // action from the operator to send the value of the bar-code scanner to the SR

    DO [XXX] = ON

    and then use the DO to start a macro, but I don't know how. Is that right ?

    Is there something I'm missing or am I completely wrong ?

    Thanks for taking the time to read this and for anyone who can help.

  • jmd2777
    Reactions Received
    34
    Trophies
    4
    Posts
    193
    • May 4, 2021 at 3:40 PM
    • #2

    Theo,

    Can you clarify that this is the behavior that you want:

    An operator places a barcode in front of a scanner. The barcode is scanned and the robot starts running a motion program automatically.

    Is that correct?

    What is the other equipment in the workcell? Is there a PLC? What type of HMI?

  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • May 4, 2021 at 4:14 PM
    • #3

    Yes it's correct but after the barcode is scanned, the operator press a buton on the HMI to send it to the SR.

    I don't have a PLC, The HMI I'm using is a Proface SP5000 series communicating with the robot in ethernet/IP and using SNPX.

  • Fabian Munoz
    Reactions Received
    133
    Trophies
    9
    Articles
    1
    Posts
    1,517
    • May 4, 2021 at 6:10 PM
    • #4

    Theo.g

    Create a TP program. Something simple

    Program name is TEST

    IF R[5:trigger]= 3 THEN

    R[8:test]=17

    ENDIF

    Go to menu, setup and select test.tp to run back ground.

    While is running, display the Register values using DATA. Put a 3 on R5 and you will see a 7 on R8

    This is something simple to see how BG logic works

    I know what you are going to ask ? What about the MACRO part. Hold on, just try what I told you

    Retired but still helping

  • HawkME
    Reactions Received
    567
    Trophies
    10
    Posts
    3,268
    • May 4, 2021 at 7:40 PM
    • #5

    You could use a macro, but I would highly recommend using UOP production start instead.

    You cannot troubleshoot live running macros , but you can if you use UOP. Macros have their place but usually there is a better way.

  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • May 5, 2021 at 9:14 AM
    • #6

    Hello Fabian, thanks for your response. I did what you wrote it worked, but I don't understand why you wanted me to do this. I know it's somehow related, but I probably didn't explain enough how my program/robot work or I don't understand what you are implying.

    So to summarize my robot is bagging different parts, and these parts are linked to the barcode that the operator must scan, but we do not bag on just one type of part, but on several so we have several barcode all linked to a program and I just wanted to scan the barcode and that it choose the right program.

    Hello HawkME, thanks for your response. I'll try to see how I could do this.

  • Fabian Munoz
    Reactions Received
    133
    Trophies
    9
    Articles
    1
    Posts
    1,517
    • May 5, 2021 at 12:43 PM
    • #7

    I thought you didn't understand how you set up a program running BG. So, I did that.

    I showed how you can trigger an action, you wrote "and then use the DO to start a macro, but I don't know how. Is that right ?"

    Ok, write this

    IF DO[xx]=ON THEN

    your program here

    ENDIF

    To make a macro, go to DETAILS on any of your TP program, go to subtype and make it a macro

    Retired but still helping

  • Mastro_18
    Trophies
    3
    Posts
    19
    • May 5, 2021 at 12:51 PM
    • #8

    Theo is the robot running all the time or are you starting the robot from the HMI. You could start a main program using the Prog Select. Then scan your barcode and wait for a value in SR[1]. Once you have your value you can then start your robot program weather you have vision or its a pick and place.

  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • May 5, 2021 at 2:16 PM
    • #9

    Hi again Fabian, yes sorry I probably wrote what I mean badly, but thanks for your response about the macro I'll try it.

    Hi mastro, my robot will work continually after the barcode is scanned. What I mean is after the operator has scanned the barcode, the operator will write the number of kit that we need on the HMI that it's linked to a register and at the present select the program on the teach, get out of the robot space and start the program with a remote control and the robot will work until the last kit. Thanks for your response I'll try it too.

    Edited once, last by Theo.g (May 6, 2021 at 9:21 AM).

  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • July 2, 2021 at 10:41 AM
    • #10

    Hello everyone.

    I'm coming back to this thread, to say that I finally managed to make it work with the macro.

    To summarize, on my HMI I have a button that activate a DI that is assigned to a macro that I created. This macro, launch a program who simply as a CALL instruction (CALL SR[1]).

    However, while I was testing it, I step on a problem. Which is that I have different payload for my program and at the start of each program the payload change. But when the payload change my program stop and I need to press the start button to launch it.

    Is there a way to bypass this?

  • Mastro_18
    Trophies
    3
    Posts
    19
    • July 5, 2021 at 1:35 PM
    • #11

    How are you changing your payload in the program with the payload command?

  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • July 5, 2021 at 1:39 PM
    • #12

    Yes at the start of each program I have a payload instruction 'PAYLOAD[X:XXXX]'

  • Mastro_18
    Trophies
    3
    Posts
    19
    • July 5, 2021 at 2:16 PM
    • #13

    Are you modifying 1 payload in your program? What we do for example is we set payload 1 for just the weight of the tool. Then if the part we are picking is much heavier we would set the payload 2 which would be the weight of the tool plus the weight of the part we are picking. You will see the robot hesitate because you are changing the payload but if you robot is coming to a complete stop I would say you are faulting out and resting or something in your system config is wrong can you show us how you are setting the payload. A picture of you program would help a lot.

  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • July 5, 2021 at 2:29 PM
    • #14

    Thanks for your reply.

    Yes when the payload change my robot stop completely.

    And here is the start of one of my program, and I change the payload at the line 11.

    robot-forum.com/attachment/31031/

    Files

    ALM_IF basic.txt 747 Byte – 12 Downloads
  • Mastro_18
    Trophies
    3
    Posts
    19
    • July 5, 2021 at 3:00 PM
    • #15

    I can not view the image

  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • July 5, 2021 at 3:08 PM
    • #16

  • Mastro_18
    Trophies
    3
    Posts
    19
    • July 5, 2021 at 3:17 PM
    • #17

    Does the robot fault or it stays on line 11. The logic looks good there will have to see more of your program to help can I see your motion.

  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • July 5, 2021 at 4:19 PM
    • #18

    It's stop on the line 11 with the message 'Over payload change distance', but I just need to press the start button and it will continue the program.

  • Theo.g
    Reactions Received
    3
    Trophies
    2
    Posts
    27
    • July 5, 2021 at 4:20 PM
    • #19

  • Fabian Munoz
    Reactions Received
    133
    Trophies
    9
    Articles
    1
    Posts
    1,517
    • July 5, 2021 at 4:35 PM
    • #20

    On line 25

    J P[5] 100% CNT0 Personally I would never do something like this. Move as fast as I can I try yo stop suddenly on a dime

    Maybe this is the reason

    The robot reads ahead and right after a payload change is trying to run line 25

    Do me a favor, go slower or change the CNT or add a pre point

    Retired but still helping

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

  • Fanuc
  • bg logic
  • Call
  • CR-7iA/L
  • IHM
  • R30-iB plus
  • String register
  • Barcode scanner
  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