RobotStudio event

ROBOT AND PLC COMMUNICATION

Options
Hello!
I wonder if anyone can help me with a problem. I made a programin the PLC to control a Conveyor, buttons, lights, and send a signal to a robot where the robot must perform a task.

A little briefly how it should look like:
PLC runs its program so far that it gets to the point that it willsend a signal to the robot. The robot receives the signal andperforms "Routine_A" after done this to give a signal back to the PLC when the PLC program continues with the program.

I have come so far with programming when the PLC will talk tothe robot. I have in the PLC program was a signal to = 1 toexplain that the robot will start to drive their progam. The software robot (Robot Studio), I have programmed the following:


PROC main() 
UtsprungslA?ge;
WHILE DI1_from_PLC=1 Do Routine_A;
ENDWHILE
ENDPROC

PROC Rountine_A()
point 1;
point 2;
point  3;
point  4;
point  5;
SET D01_to_PLC;
ENDPROC

When the PLC program reaches the point where it should send a signal to the robot. The robot takes the signal and reads its program when DI1_from_PLC = 1, it will perform the program Routine_A where the robot goes to point 1 to 5. But after running the point 1-5 it starts to run the point again in 1-5 again in Routine_A. It should send signal back to the PLC to say that it is complete with the robot program  so the PLC program can proceed. How should I do it to understand?

Should I have a command in "Rountine_A" or should it be one in the "main" that sends when the robot are finnseh with it's task, and what does the command look like?

Does anyone know how to do or some tips it would be nice!

Comments

  • Thomas J
    Options

    PROC main() 
    UtsprungslA?ge;

    WHILE DI1_from_PLC=1 Do

      Routine_A;
    ENDWHILE
    ENDPROC

    PROC Rountine_A()
    point 1;
    point 2;
    point  3;
    point  4;
    point  5;
    SET D01_to_PLC;

    WaitDI DI1_from_PLC,0; <- Wait Here until PLC turns off the input to the robot

    ENDPROC
    Thomas J2012-01-26 19:44:39
    Thomas H. Johnston
    PACs Application Engineer