F l a g s
Flags show the status of an event or condition. A flag will only have one of two possible states: either 1 or 0. Unlike variables, there are only factory defined flags.
F a c t o r y D e f i n e d F l a g s
Factory defined flags are predefined at the factory and cannot be deleted. When a FD (Factory Defaults) instruction is given, these flags will be returned to their factory default state. There are two types of factory defined flags:
.Read/Writable: This type of flag is user alterable. They are typically used to set a condition or mode of operation for the MDrive Motion Control. For example: EE = 1 would enable encoder operation, or EE = 0 would disable the encoder functions.
.Read Only: Read Only flags cannot be modified by the user. They only give an indication of an event or condition. Typically this type of flag would be used in a program in conjunction with the BR (Branch Instruction) to generate an if/then event based upon a condition. For Example: the following line of code in a program BR SP, MV = 0 would cause a program to branch to a subroutine named “SP” when the MV, the read only moving flag, is false.
K e y w o r d s
Keywords are used in conjunction with the PR and IP instructions to indicate or control variables and flags. For instance, PR UV would print the state of all the
M o s t C o m m o n l y U s e d Va r i a b l e s a n d C o m m a n d s
V a r i a b l e s
P
P indicates the position in either steps or encoder counts depending upon the enable/disable state of encoder functions.
.P takes its reading from C1 (Counter 1) when encoder functions are disabled. The reading is taken from C2 (Counter 2) when encoder functions are enabled.
.To read the position, type PR P or PR C1/C2 then hit enter
.To zero the position, type P=0 then hit enter
V I
Initial velocity in steps per second.
.To read the initial velocity, type PR VI then hit enter
.To write to the Initial velocity, type VI=500 then hit enter
V M
Maximum or final velocity in steps per second.
.To read the final velocity,
.To write to the final velocity,
A
Acceleration in steps per second2.
.To read the acceleration,
.To write to the acceleration,
D
Deceleration in steps per second2.
.To read the deceleration,
.To write to the deceleration,
30