Interrupts not more active after 'PP to routine'
Simotion
✭
In the beginning of my main routine I setup interrupts from digital intputs and I connect the interrupts to trap routines.
Like : CONNECT intdoorop WITH trapDoorOp;
ISignalDI diDem_Porte,1,intdoorop;
After that I have my endless loop with code.
The interrupts work fine. But if for testing I select 'PP to routine' on the teachpendant (I select f.i. the first line in the endless loop of the main routine), the interrupts are not generated anymore.
I did not do a 'PP to main', only a PP to routine.
I know that 'PP to routine' cleans the execution stack, but does it also erases the interupt connections?
I also saw that 'Call routine' does not erase the interrupt connections, but that also does not clean the execution stack : after executing the called routine, the PP returns to the position before calling the routine.
Or are there ways to maintain the interrupt connections?
Like : CONNECT intdoorop WITH trapDoorOp;
ISignalDI diDem_Porte,1,intdoorop;
After that I have my endless loop with code.
The interrupts work fine. But if for testing I select 'PP to routine' on the teachpendant (I select f.i. the first line in the endless loop of the main routine), the interrupts are not generated anymore.
I did not do a 'PP to main', only a PP to routine.
I know that 'PP to routine' cleans the execution stack, but does it also erases the interupt connections?
I also saw that 'Call routine' does not erase the interrupt connections, but that also does not clean the execution stack : after executing the called routine, the PP returns to the position before calling the routine.
Or are there ways to maintain the interrupt connections?
2
Comments
-
Hello,
You can add the activation of the interrupts in a eventroutine.
This event is executed when the robot is started\restarted.
Defenition of the eventroutine is done in the sys.cfg.
gr,
1 -
Suppose the activation of the interrupts in the main task and in an event routine, could it cause any problems that the interrupts are defined multiple times, maybe even cycle after cycle if they are in a program part that is within the continuous program loop?
0 -
Program execution will stop if you try to define the same interrupt variable a second time without deleting the interrupt first with IDelete
You may use a VAR bool bInit:=FALSE; that is set to TRUE after you have executed your init procedure and check this bool in the beginning.
Setting the PP to Routine will reset bInit to its declarationa value and delete the interrupt declaration...
regards
Christian0 -
You can do it without the bool also. I use an init procedure where I have IDelete just before definition of the interrupt. I found this idea from an example at RAPID development guidelines. Works well and interrupt is never defined multiple times."PROC Init()...IDelete irCycleStop;CONNECT irCycleStop WITH T_CycleStop;...ENDPROC"0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 801 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings