CALL: Difference between revisions

From Industrial Robotics & Automation - Fanuc Teach Pendant Programming
Content added Content deleted
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[File:Inst-call orig.gif|thumb|How to add a CALL instruction to a program.]]

=== CALL [Program] ===
CALL is a non-motion instruction that causes the robot to halt progression of its current running program, throw all of the currently-in-use data about that program into the processor's stack, and start another program.
CALL is a non-motion instruction that causes the robot to halt progression of its current running program, throw all of the currently-in-use data about that program into the processor's stack, and start another program.


Line 17: Line 20:


For situations where certain instructions are repetitive or may be seen in many programs, small operation programs may be made for the purpose of being called in larger programs.
For situations where certain instructions are repetitive or may be seen in many programs, small operation programs may be made for the purpose of being called in larger programs.


When placing a CALL instruction, you are given a list of all available programs to choose from.


==== Example: ====
==== Example: ====
Line 29: Line 35:
==== Note: ====
==== Note: ====
The called program must eventually reach "END" and not simply CALL the original, as the processor's stack will simply continue filling up and a STACK OVERFLOW error may result.
The called program must eventually reach "END" and not simply CALL the original, as the processor's stack will simply continue filling up and a STACK OVERFLOW error may result.

=== END ===
The END instruction is included at the bottom of teach pendant programs, but additional instances can be added through the [INST] - CALL - END option.
<br />

Latest revision as of 18:22, 6 June 2019

How to add a CALL instruction to a program.

CALL [Program]

CALL is a non-motion instruction that causes the robot to halt progression of its current running program, throw all of the currently-in-use data about that program into the processor's stack, and start another program.

CALL PROGRAM NAME
CALL OPEN_GRIPPER
CALL GOHOME


Call instructions are special in that they're intended to return once they have been completed. Once the END instruction is reached within the called program, the program will end, all the stored information in the stack will be pulled back out, and the original program will continue with the line immediately following the CALL instruction.

For situations where certain instructions are repetitive or may be seen in many programs, small operation programs may be made for the purpose of being called in larger programs.


When placing a CALL instruction, you are given a list of all available programs to choose from.

Example:

RO[4:Vacuum] = OFF

WAIT 1seconds

RO[4:Vacuum] = ON

In this example the program has three lines. The first line turns the vacuum system off to let go of a part on the robot's tool. Since there may be a delay in response, a wait instruction is added to ensure the vacuum tool has had a chance to let go of the object. The third line returns the vacuum to its prior state, ready to pick up a new object.

Note:

The called program must eventually reach "END" and not simply CALL the original, as the processor's stack will simply continue filling up and a STACK OVERFLOW error may result.

END

The END instruction is included at the bottom of teach pendant programs, but additional instances can be added through the [INST] - CALL - END option.