IMS MicroLYNX Quick Manual page 59

Hide thumbs Also See for MicroLYNX:
Table of Contents

Advertisement

Global Flags and Variables are
declared outside of a program!
Local Flags and Variables are
declared within a program and
erased and re-declared with
program execution!
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
FLG MY_FLG=1 'declare flag MY_FLG, set to 1
This example shows a global flag being declared. To view the state of
this flag, and any other user-defined flags enter:
PRINT UFLGS
The response from the terminal would be:
MY_FLG = G TRUE
The "G" would indicate that it is a global flag at a logic TRUE state.
If this were a local flag, the "G" would be replaced with an "L".
V A R
[ D e f i n e U s e r V a r i a b l e ]
This instruction allows the user to declare a variable and set it to some value.
The naming conventions for a user-defined variables are the same as for user-
defined flags declared with the FLG instruction. These variables can be either
global (declared in immediate mode) or local (declared within a program). Local
variables are erased and re-declared when a program executed.
The following example is a short program that will declare a local variable
named "LENGTH", request an input from the user, then perform a relative
index the distance specified. It will then loop back to the beginning and request
input until the escape key is pressed.
PGM 200
LBL VAR_TEST
VAR LENGTH=0
PRINT "How far do I go?";
INPUT LENGTH
MOVR LENGTH
HOLD 2
PRINT "Went this far:", LENGTH
BR 200
END
PGM
I N P U T
[ U s e r I n p u t R e q u e s t ]
This instruction allows for data to be entered into a variable from an external
device such as a terminal or an HMI through the serial port(s).
See VAR example above for usage example.
D E L A Y
[ D e l a y P r o g r a m E x e c u t i o n ]
Delays program execution for a specified number of milliseconds.
For Example:
DELAY 1000
H O L D
[ H o l d P r o g r a m E x e c u t i o n ]
The HOLD instruction differs from DELAY in that it suspends program
execution until a specified motion, velocity change, or position change com-
pletes. Typically, a "HOLD 2" will be issued following a MOVA or MOVR.
This instructs the MicroLYNX to suspend the program until the previously
instructed motion is complete.
'start program at address 200
'name the program VAR_TEST
'declare local variable LENGTH, set to 0
'request input length in munits
'index relative distanc defined by LENGTH
'suspend program until motion completes
'loop to beginning of program
'delay program execution for 1 second.
57

Advertisement

Table of Contents
loading

Table of Contents