Schematic

MicroBasic Scripting
190 Advanced Digital Motor Controller User Manual V1.8, August 28, 2017
Editing, Building, Simulating and Executing Scripts
Editing Scripts
An editor is available for scripting in the RoborunPlus PC utility. See Scripting Tab on page
368 (Roborun scripting) for details on how to launch and operate the editor.
The edit window resembles this of a typical IDE editor with, most noticeably, changes in
the fonts and colors depending on the type of entry that is recognized as it is entered. This
capability makes code easier to read and provides a first level of error checking.
Code is entered as free-form text with no restriction in term of length, indents use, or
other.
Building Scripts
Building is the process of converting the Basic source code in the intermediate Bytecode
language that is understood by the controller. This step is nearly instantaneous and nor-
mally transparent to the user, unless errors are detected in the program.
Build is called automatically when clicking on the “Download to Device” or “Simulate
buttons.
Building can be called independently by clicking on the “Build” button. This step is normal-
ly not necessary but it can be useful in order to compare the memory usage efficiency of
one script compared to another.
Simulating Scripts
Scripts can be ran directly on the PC in simulation mode. Clicking on the Simulate button
will cause the script to be built and launch a simulator in which the code is executed. This
feature is useful for writing, testing and debugging scripts. The simulator works exactly
the same way as the controller with the following exceptions.
Execution speed is different.
Controller configurations and operating parameters are not accessible from the
simulator
Controller commands cannot be sent from the simulator
The four Timers operate differently in the simulator
RoboCAN commands and queries have no effect
In the simulator, any attempt to read a Controller configuration (example Amps limit) or a
Controller Runtime parameter (e.g. Volts, Temperature) will cause a prompt to be displayed
for the user to enter a value. Entering no value and hitting Enter, will cause the same value
that was entered last for the same parameter to be used. If this is the first time the user
is prompted for a given parameter, 0 will be entered if hitting Enter with no data.
When a function in the simulator attempts to write a configuration or a command, then
the console displays the parameter name and parameter value in the console.
Script execution in the simulator starts immediately after clicking on the Simulate button
and the console window opens.
Simulated scripts are stopped when closing the simulator console.