MNEMONIC | FUNCTION | TYPE |
R1 - R4 | User Registers | User Variable |
DESCRIPTION
The MDrive Motion Control has four 32 bit user registers to contain numerical data. These registers may contain up to 11 digits including the sign and may be used to store and retrieve data to set variables, perform math functions, store and retrieve moves and set conditions for branches and subroutine calls.
USAGE | RANGE | DEFAULT |
R<x>=<data> | 0 | |
|
|
|
EXAMPLES: |
|
|
R1=50000 | ‘Set Register 1 to 50000 |
|
‘Subroutine using a register value to perform a math function that will display axis position in revolutions rather than motor steps | ||
‘****variable setup***** |
| |
MS=256 | ‘set resolution to 256 microsteps/step |
|
P=0 | ‘set position counter to 0 |
|
R1=51200/1 | ‘51200 steps = 1 rev |
|
*****Program Content******* |
| |
MR R1 | ‘move relative 102400 steps |
|
H | ‘Hold execution until motion stops |
|
CL 348 | ‘call subroutine at address 348 |
|
‘******Sub at address 348****** |
| |
R2=P | ‘set Register 2 equal to the position counter |
|
R3=R2/R1 | ‘set Register 3 equal to R2/R1 |
|
PR “Position = “, R3, “Revolutions”; |
| |
H 60000 | ‘hold for 1 minute |
|
RT | ‘return to prog |
|
RELATED COMMANDS: —
MNEMONIC | FUNCTION |
| TYPE |
RC | Run Current |
| Setup Variable |
DESCRIPTION |
|
|
|
This variable defines the motor run current in percent. |
|
| |
|
|
|
|
USAGE | UNITS | RANGE | DEFAULT |
RC=<percent> | Percent | 1to 100 | 25 |
|
|
|
|
EXAMPLE: |
|
|
|
RC=75 | ‘Set motor run current to 75% |
|
|
RELATED COMMAND: HC
56