RobotStudio event

Signals in Rapid

Hello,
I'm a student who currently works his way into Robotstudio. After many problems I have finally found one which I was not able to solve through research. So I beg for help :P

I tried to use a custom signal which I created on the Virtual Flex Pendant to check in my Rapid Code if the robot nears a Collision Set. On the Virtual Flex Pendant I created a new Unit for the signal and defined it as output and to start with low. Then I used the Event Manager to define the output of the signal as high, if a Collision Set is neared.

If I used the following piece of code after a move-instruction (doMotSupOn is the name of the custom signal) it sometimes worked after a while, but some other times it did nothing:

[code]
IF Doutput(doMotSupOn) = 1 THEN
  TPWrite "Works";
ENDIF
[/code]

When i did it with interrupts, nothing happened. I tried it similar to the code example that got posted here:

[code]
VAR intnum testint;


TRAP CollisionTrap
    !Reset doMotSupOn;
    TPWrite "Interrupt";
    IDelete testint;
    !ExitCycle;
ENDTRAP

PROC InitCollision()
    !Reset doMotSupOn;
    IDelete testint;
    CONNECT testint WITH CollisionTrap;
    ISignalDO doMotSupOn, 1, testint;
ENDPROC

[/code]

I don't understand where my mistake is. The signal must have been set to high sometimes or else it wouldn't have entered the if-clause in the first example, right? Or is my approach just totally wrong it doesn't work without the option Collision Detection installed on the robot?

Regards,
Tim


Comments

  • not sure which version of robotstudio you are using, I think this changed in 5.14.something.
     

    but to have robotstudio change an IO  signal whilst the program is running you need to set the signals access to "all". I would also suggest a digital input rather than an output might work better (although in theory it should work with either).

     

    also set your graphics/ rendering detail level to fine

     

     I have used collision sets and a digital input to simulate touch sensing with welding gas cup in robotstudio before and its pretty inconsistent unless you set the graphics render to fine. The torch would sometimes go as far as 10mm past the collision before it stopped and this was at v10 speed. On fine it is much more accurate although much much slower unless you have a powerful machine.
  • Thanks Smile
    It works now. Setting the signal access to "all" did the trick for me.
    I use Robotstudio 5.13 School Edition btw.