EasyManuals Logo

Moog SmartMotor User Manual

Moog SmartMotor
909 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #187 background imageLoading...
Page #187 background image
Part 1: Programming
Moog Animatics SmartMotor Developer's Guide,Rev. L
Page 187 of 909
Just as a rotary switch directs electricity, the SWITCH structure directs the flow of the
program. The BREAK statement then jumps the code execution to the code following the
associated ENDS command. The DEFAULT command covers every condition other than those
listed. Its use is optional.
TWAIT
Wait for Trajectory to Finish
The TWAIT command pauses program execution while the motor is moving. The pause is
terminated by either the controlled end of a trajectory or the abrupt end of a trajectory due to
an error. If there are a succession of move commands without this command or similar
waiting code between them, the commands will overtake each other because the program
advances even while moves are taking place.
The following program has the same effect as the TWAIT command, but it allows other things
to be programmed during the wait instead of just waiting such things would be inserted
between the two commands.
WHILE Bt 'While trajectory
...
LOOP 'Loop back
WAIT=formula
Wait, Pause Program Execution for Time in Milliseconds
There will probably be circumstances where the program execution needs to be paused for a
specific period of time. The WAIT command pauses the program for the specified number of
milliseconds. WAIT=1000, for example, would wait one second. The following code would be
the same as WAIT=1000, only it would allow code to execute during the wait if it were placed
between the WHILE and the LOOP.
CLK=0 'Reset CLK to 0
WHILE CLK<1000 'CLK will grow
...
LOOP 'Loop back
STACK
Reset the GOSUB Return Stack
Information about the nesting of subroutines is held in the STACK ("nesting" is when one or
more subroutines exist within others). In the event program flow is directed out of one or
more nested subroutines without executing the included RETURN commands, the stack will be
corrupted. The STACK command resets the stack with zero recorded nesting. Use it with care
and try to build the program without requiring the STACK command.
One possible use of the STACK command might be if the program used one or more nested
subroutines and an emergency occurred. In this case, the program or operator could issue the
STACK command and then a GOTO command, which would send the program back to a label
at the beginning. Using this method instead of the RESET command would retain the states of
the variables and allow further specific action to resolve the emergency.
Part 1: Programming: TWAIT

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Moog SmartMotor and is the answer not in the manual?

Moog SmartMotor Specifications

General IconGeneral
BrandMoog
ModelSmartMotor
CategoryServo Drives
LanguageEnglish

Related product manuals