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:

The way to solve this is to work with system inputs/outputs read about it in the system parameters manual

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.

Both multiple tasks and interrupts are a hassle – PerSvensson’s suggestion to use System Inputs/Outputs is best.

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 ?

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.

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

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

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.