RobotStudio event

RAPID program stop

Hello, I do that RAPID program start executing when Digital input = 1, but I don't know how do that RAPID immediately stop executing when Digital input = 0. Please help me :neutral: 

Comments

  • The way to solve this is to work with system inputs/outputs read about it in the system parameters manual
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering
  • J.C.M.Castillo
    edited February 2016
    You can use two tasks as I show you here:

    I don't know if it's the best way to do but it works well.

  • Peter: I try find it
    J.C.M. Castillo: My code look similiar. but in simulation RAPID code don't stop executing so Robot continue in cycle.


  • My example does it in two tasks so two programs execute in parallel and there are two program pointers.

    I think in your code only executes a task y the reading the input is only possible when the program pointer is in his code line and it must until wait to the movement instructions have finished.

    When you set up the system you need to choose Multitasking function. If you don't do it, it is not possible to create the second task.


  • Other way to do It is using interruptions. I don't sure how it is, but I am going to try it. If I get it I will put it here.
  • Oh thanks, so if you try it and it doesn't work, will you please explain me how to do multitask ? because I never did it. Thanks
  • 1-First that you have to do it's to create a system with "Multitasking" function. If you don't do this, you won't be able to use Multitasking.

    2- You chose "Configuration Editor">Controller

    3- In the new tab, you chose "Task". To create a new Task, you have to click on window with right botton mouse.

    4- Create your new Task:

    5- You should restart de System:

  • Thank you ! I read something onInternet but it doesn't work, but then I download RS 6.02 and with yours steps it works ! If I will have any questions can I write you a message ? 
  • Yes, no problem.

  • Hello,

    Using two tasks to solve this problem is complicate the problem itself.

    I think it can be solved in two ways. the first one could be easier, the second one is more right.

    - using interrupts.
           you can find more information in the CONNECT and TRAP instructions help
    - using system inputs/outputs.
           you can find more information in the System Parameters help, Topic I/O 

    best regards,
     Daniel M.
  • Thanks for reply medinadan, I solved my problem with two task, but I read more about CONNECT and then I try use it.
  • soup
    soup ✭✭✭
    Both multiple tasks and interrupts are a hassle -- PerSvensson's suggestion to use System Inputs/Outputs is best.
  • St4rk
    St4rk
    edited March 2016
    I think that I find somethink, but I absolutely don't know how I apply that, and how physically connect output from PLC to this input ?


  • soup
    soup ✭✭✭
    Yep -- you found it. Go to your controller > Configuration > I/O > System Input and connect your signal from the PLC to the System Input action of your choice.
  • St4rk
    St4rk
    edited March 2016
    Thanks for yours reply, I understand it and it working. I make 2 signals: DI_Start - Start At Main - reset PP to main and automaticaly start
                                                                                                                     DI_Stop - Stop - Stop execution
    I find something like ''Reset PP''. Maybe I can't find it. I imagine that when DI_Stop (execution stop),then  i press Reset - DI_Reset and robot move only on one position (MoveL Home), reset all user outputs and then stop, after DI_Start program start execution from main. 

    Thank
  • soup
    soup ✭✭✭
    I'm not sure what you're asking -- DI_Start connected to "Start" action (not "Start At Main") and DI_Stop connected to "Stop" action would start and stop execution.
    http://developercenter.robotstudio.com/BlobProxy/manuals/SysParametersTechRefManual/doc208.html
  • No, DI_Start is only name of system input, action is a Start At Main
  • soup
    soup ✭✭✭
    Okay. Question?
  • As I write:

    I find something like ''Reset PP''. Maybe I can't find it. I imagine that when DI_Stop (execution stop),then  i press Reset - DI_Reset and robot move only on one position (MoveL Home), reset all user outputs and then stop, after DI_Start program start execution from main. 
  • soup
    soup ✭✭✭
    See if I understand:
    • Question 1: How to start and stop robot execution with a digital signal? ===> answer: use system inputs and outputs
    • Question 2: Start signal to always start at main & stop signal should reset some outputs and send the robot to the home position.
    Correct?

  • St4rk
    St4rk
    edited March 2016
    Question 1 = I solve start and stop, I only write my DI and action, STOP and START AT MAIN
    Question 2 = I want another DI: for exmample(DI_Reset), which when program is stoped, DI_Reset is connected, then robot move on one ''Home'' position, reset user DO and its all = robot stop moving, program not execution. But then if DI_Start connect program Start at main...

    I hope you understand it. If not, You can write a message.


  • If I understand you correctly you want the robot to move to a home position when you set DI_Reset but only if the program has been stopped? if so you have a problem because you have stopped the robot program so the robot can't move. 
    So I guess you wan't to go to a home position if some one have set DI_Reset when the robot program was stopped, if not you want to skip the movement to the home position.

    Correct?
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering
  • Yes you got it ! 
    So is there any other way to make something similiary ?
    Thank you.
  • I would probably have a background task which keep track of signal changes(background tasks can run even if main program is stopped) and then have a event routine "start" where you  move the robot to home if the condition is fulfilled. Beware of that this solution will move the robot to home after the program has been started again.
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering
  • soup
    soup ✭✭✭
    You could also disconnect the di_stop signal from the stop system input and connect it to a trap routine. Inside the trap routine, if the di_reset is high reset some outputs and do some movements to a home and stop, else just stop.
  • St4rk
    St4rk
    edited March 2016
    I looked manual, and I find this:
    There is something call ''service position'' In my case what if be Home position ? and then program not resume but start at main ? What do you think about it ?

    I try to applied it but I don' know how :neutral: 

  • Think, I solved my problem ! I attach link with simulation video, so you can see what I thought. This is just test station. Next week in school I upload program to controller and try it in real station. Maybe I again write, but I hope it will works. Thanks everybody for response ! :blush:  :smile: 

    http://uloz.to/xfng3atR/robotstudio-3-3-wmv