FANUC
Arguments AR []
What Are Arguments?
Arguments allow you to pass data (numbers or strings)
from one program to another.
These are particularly useful when you need to pass
information like counts or values to a subprogram, for
example, when you need a subprogram to stop or continue
based on the argument passed from the main program.
How Arguments Work
You can pass arguments directly (e.g., using a constant
number) or indirectly (e.g., using a register value).
A subprogram can read the passed argument and use it in
its operations (e.g., saving it into a register for further use).
Limitations and Challenges
If an argument is not passed to the subprogram, the
program will throw an error. This can cause the robot to
stop if the expected argument is missing.
A workaround is to create a "check" program that ensures
an argument is passed before proceeding.
Arguments are passed one level at a time, meaning if
you want an argument to be used in multiple subprograms,
you need to pass it explicitly from one to the next.
Passing Multiple Arguments
You can pass multiple arguments by specifying different
values for each argument when calling the subprogram.
You can pass constant values or values stored in
registers.
Common Mistakes
Running a subprogram without passing an argument will
result in an error because the argument doesn't exist.
Arguments are only available in the subprogram level
they were passed to. If you want to use the same
argument in another subprogram, you need to explicitly
pass it to the next subprogram.
Practical Example
The presenter demonstrates how to pass an argument
(e.g., value 5) into a subprogram and then store it in a
register.
He also shows how passing arguments through multiple
subprograms works by carrying the argument from one
subprogram to another.
Checking Argument Values
To check the value of an argument, a "check program"
can be created that will display the value of the argument
being passed.
There’s no straightforward way to inspect the argument
value during program execution unless you create a
custom program to report it.
Conclusion
Arguments are essential for passing values between
programs, and they can be used for various tasks, such as
controlling grippers or making decisions within a program.
However, it’s important to always ensure arguments are
passed correctly to avoid errors in the program flow.
RESOURCE \\ Passing Arguments AR[x] between programs in
FANUC robots. - YouTube
TIMERS
Introduction
The video discusses the use of timers in programming,
particularly in robotic control, and introduces functions that may
be unfamiliar to some users.
Timer Basics
Timers are used to measure time in various ways, such
as measuring how long a clamp takes to open, how long a
spot weld lasts, or the duration of a robot’s cycle.
Timers can count up or down: You can measure time
from 0 upwards or use timers to act as a timeout instead
of a jump label.
Types of Timers: Local vs. Global
Local timers are tied to the robot’s operation and stop
when the robot is not running (e.g., during a pause or
hold). These timers are useful for measuring actual
process time.
Global timers, on the other hand, run continuously and do
not stop until manually told to do so, making them useful
for tracking long durations that should not be interrupted.
Timer Functions and Features
Timer Tracking: In newer robot controllers, you can track
when a timer starts and finishes.
I/O Assignment: Timers can be tied to I/O (input/output)
signals, activating a specific I/O if the timer exceeds a
certain value.
The program timer can be found in the robot’s menu
under “Status,” where users can see how long the robot
has been on and operational.
Timer Control
You can start, stop, reset, and create custom functions
with timers.
Resetting timers: It's crucial to reset timers before starting
them to ensure proper time measurement.
Starting and stopping timers properly is key. If the timer
is running and reset without stopping, it will continue
running from its last position.
Practical Example: Local vs. Global Timer Behavior
Local timer behavior: The timer will only count while the
robot is running.
Global timer behavior: The timer will continue to count
even when the robot is paused.
Advanced Timer Use
Countdown timers: Instead of using a timeout command,
you can use a timer to count down from a negative value
and wait for a specific condition.
Wait instruction with timer: You can wait for a digital
input or timer to exceed a certain value before continuing.
Storing Timer Values
You can store a timer's value in a register (a memory
location). This is useful for tracking cycle times, or
performing further math or analysis on the timer’s data.
Conclusion
Understanding how to properly use local vs global timers,
and how to store timer values in registers, is crucial for
accurate time measurement in robotic programming.
Proper timer management can prevent errors and allow for
precise control in robotic applications.
Ressources \\ TIMERS in FANUC, how do they work ? YouTube
FLAGS:
What are flags?
Flags are used to store information, similar to memory bits, without needing additional
I/O or registers. They can be employed to track states or conditions within a program.
Applications of Flags:
o They are ideal for saving memory when I/O resources are limited.
o Flags can be used to represent conditions (e.g., whether an object has been
picked correctly, if a robot missed a step, etc.).
o They simplify complex systems by reducing the need for multiple I/O inputs.
Practical Uses:
o Flags can control actions based on different conditions. For example, when a
flag is set (e.g., flag 1), it can trigger specific actions in a robot's program.
o Flags can also be mapped to digital inputs/outputs for better memory
management and more complex logic.
Flags and Memory:
o Flags can act as a memory bit to retain information during the program
execution, even if the inputs/outputs change.
o Unlike registers, flags provide clearer data retention and are a good way to
store state information.
Using Flags in Programs:
o Flags can be manipulated in programming environments by setting them on or
off.
o Flags can be linked with other components like inputs or outputs to store states
or create more intricate logic.
Conclusion:
Flags are a powerful and underused tool for managing memory and conditions in programs,
especially when resources are limited or when complex logic is needed. They're highly
recommended for enhancing automation tasks, ensuring more efficient use of memory and I/O
resources.