Data Sheet
Advanced Digital Motor Controllers User Manual 11
Saving and Loading Scripts in Hex Format ............................................. 191
Executing MicroBasic Scripts ................................................................ 191
Debugging Microbasic Scripts ............................................................... 192
Script Command Priorities ..................................................................... 192
MicroBasic Scripting Techniques ............................................................ 193
Single Execution Scripts ........................................................................ 193
Continuous Scripts ................................................................................. 193
Optimizing Scripts for Integer Math ....................................................... 194
Script Examples ..................................................................................... 195
MicroBasic Language Reference ........................................................... 195
Introduction ............................................................................................ 195
Comments ............................................................................................. 196
Boolean .................................................................................................. 196
Numbers ................................................................................................ 196
Strings .................................................................................................... 196
Blocks and Labels .................................................................................. 197
Variables ................................................................................................. 198
Arrays ..................................................................................................... 198
Terminology ........................................................................................... 198
Keywords ............................................................................................... 199
Operators ............................................................................................... 199
Micro Basic Functions ............................................................................ 199
Controller Configuration and Commands ............................................... 200
Timers Commands ................................................................................ 200
Pre-Processor Directives (#define) ......................................................... 200
Option (Compilation Options) ................................................................ 200
Dim (Variable Declaration) ...................................................................... 200
If...Then Statement ................................................................................ 201
For...Next Statement .............................................................................. 202
While/Do Statements ............................................................................ 203
Terminate Statement ............................................................................. 204
Exit Statement ....................................................................................... 204
Continue Statement ............................................................................... 204
GoTo Statement ..................................................................................... 205
GoSub/Return Statements ..................................................................... 205
ToBool Statement .................................................................................. 206
Print Statement ...................................................................................... 206
+ Operator ............................................................................................. 206
- Operator ............................................................................................... 206
* Operator .............................................................................................. 206
/ Operator ............................................................................................... 206
Mod Operator ........................................................................................ 207
And Operator ......................................................................................... 207
Or Operator ............................................................................................ 207
XOr Operator .......................................................................................... 207
Not Operator .......................................................................................... 207