Data Sheet
MicroBasic Scripting
212 Advanced Digital Motor Controller User Manual V1.8, August 28, 2017
Abs(<expression>)
Example:
value = Cos(0) ‘1000
[title] Sin Function
Returns the sine of the specied angle.
The return value is multiplied by 1000.
Sin(<expression>)
Example:
value = Sin(90) ‘1000
Sqrt Function
Returns the square root of a specied number.
The return value is multiplied by 1000.
Sqrt(<expression>)
Example:
value = Sqrt(2) ‘1414
GetValue
This function is used to read operating parameters from the controller at runtime. The
function requires an Operating Item, and an optional Index as parameters. The Operating
Item can be any one from the table below. The Index is used to select one of the Value
Items in multi channel configurations. When accessing a unique Operating Parameter that
is not part of an array, the index may be omitted, or an index value of 0 can be used.
Details on the various operating parameters that can be read can be found in the Control-
ler’s User Manual. (See “Serial (RS232/USB) Operation” on page 141)
GetValue(OperatingItem, [Index])
Current2 = GetValue(_BATAMPS, 2) ‘ Read Battery Amps for Motor 2
Sensor = GetValue(_ANAIN, 6) ‘ Read voltage present at Analog Input 1
Counter = GetValue(_BLCOUNTER) ‘ Read Brushless counter
SetCommand
This function is used to send operating commands to the controller at runtime. The func-
tion requires a Command Item, an optional Index and a Value as parameters. The Com-
mand Item can be any one from the table below. Details on the various commands, their
effects and acceptable ranges can be found in the Controller’s User Manual (See “Serial
(RS232/USB) Operation” on page 141).
SetCommand(CommandItem, Value)
SetCommand(_GO, 1, 500) ‘ Set Motor 1 command level at 500
SetCommand(_DSET, 2) ‘ Activate Digital Output 2