Data Sheet
MicroBasic Language Reference
Advanced Digital Motor Controller User Manual 213
SetConfig / GetConfig
These two functions are used to read or/and change one of the controller’s configuration
parameters at runtime. The changes are made in the controller’s RAM and take effect im-
mediately. Configuration changes are not stored in EEPROM.
SetCong Set a conguration parameter
GetCong Read a conguration parameter
Both commands require a Configuration Item, and an optional Index as parameters. The
Configuration Item can be one of the valid controller configuration commands listed in the
Command Reference Section. Refer to Set/Read Configuration Commands on page 210
for syntax. Simply add the underscore character “_” to read or write this configuration
from within a script. The Index is used to select one of the Configuration Item in multi
channel configurations. When accessing a configuration parameter that is not part of an
array, index can be omitted or an index value of 0 can be used. Details on the various con-
figurations items, their effects and acceptable values can be found in the Controller’s User
Manual.
Note that most but not all configuration parameters are accessible via the SetConfig or
GetConfig function. No check is performed that the value you store is valid so this func-
tion must be handled with care.
When setting a configuration parameter, the new value of the parameter must be given in
addition to the Configuration Item and Index.
GetConfig(ConfigurationItem, [Index], value)
SetConfig(ConfigurationItem, [Index])
Accel2 = GetCong(_MAC, 2) ‘ Read Acceleration parameter for Motor 2
PWMFreq = GetCong(_PWMF) ‘ Read Controller’s PWM frequency
SetCong(_MAC, 2, Accel2 * 2) ‘ Make Motor2 acceleration twice as slow
SetTimerCount/GetTimerCount
These two functions used to set/get timer count.
SetTimerCount(<index>, <milliseconds>)
GetTimerCount(<index>)
Where:
<index> : 0 - 4 for old controller models
0 - 7 for new controller models
<milliseconds> : number of milliseconds to count
SetTimerState/GetTimerState
These two functions used to set/get timer state (started or stopped).
SetTimerState(<index>, <state>)
GetTimerState(<index>)