Data Sheet

Scripting Tab
Advanced Digital Motor Controller User Manual 383
FIGURE 20-30. Script compile error
Beware that not all programming errors are detected. Be especially careful with variable
names. Use the #option explicit directive to enforce variable declarations. Beware not to
mix setconfig() and setcommand() when changing a configuration or a command. A faulty
script can cause the controller to crash. Enable the scripting Auto Start configuration only
on known working scripts.
Executing Scripts
Scripts are not automatically executed after the transfer. To execute manually, you must
Run or Restart buttons that are in the Utility’s header. Alternatively, click on the Console
click on the Console tab and send the !r command via the console. Unless a script in-
cludes print statements, it will run silently with no visible signs in the console. Clicking on
!r 0 will stop a script, !r or !r 1 will resume a stopped script. !r 2 will clear all variables and
restart a script. The Runscript LED in the Run tab will be on when script is running.
Executing a script on a remote controller on a CANbus network using the RoboCAN
protocol s done using the @nn!r command, where nn is the remote node address in hex
format.