BASIC Moves Development Studio
06/2005
Danaher Motion
14 Rev
E
M-SS-005-03l
2.2.3.
Constants and Variables
All constant, variable and system element names must start with an
alphabetical character (a-z, A-Z) and may be followed with up to 31
alphabetical characters, numbers (0-9) and underscores (“_”). Keywords
may not be used as names. For detailed information on any of the constants
and variables (including examples), refer to the
SERVOSTAR
®
MC
Reference Manual
.
2.2.3.1. C
ONSTANTS
Constants are numbers, which are written as ordinary text characters; for
example, 161. Constants can be written in decimal or in hexadecimal (HEX).
To write a constant in hex, precede it by a 0x; for example, 0xF is the hex
representation of 15 decimal.
The MC provides numerous
literal constants
(reserved words with a fixed
value). You can use these constants anywhere in your program to make your
code more intuitive and easier to read. For example:
A1.Motion = ON
turns on the A1 property Motion. This is more intuitive to read than:
A1.Motion = 1
although the effect is identical.
2.2.3.1.1 Literal Constants Table
ABORT = 4
NEGATIVE = -1
ABOVE = 2
NEXTMOTION or NMOT = 2
BELOW = 1
NOFLIP = 1
CAM = 2
NOOVERLAP = 0
CAPTURING = 16
NOTELEVEL = 3
CLEARMOTION or CMOT = 3
OFF = 0
CLOSE = 0
ON = 1
CONTINUE or CONT = 1
ONPATH = 2
ENDMOTION or EMOT = 3
OPEN = 1
ERRORLEVEL = 2
OVERLAP = 1
EXTERNAL = 1
PI = 3.14159265359
FALL = 2
POSITIVE = 1
FALSE = 0
RESTART = 1
FAULTLEVEL = 1
RIGHTY = 2
FLIP = 2
RISE = 1
GEAR = 1
SILENTLEVEL = 0
GENERATORCOMPLETED or GCOM = 3
SUPERIMMEDIATE or SIMM = 5
HALT = 0
SYNC = 4
HOMING = 10
TASK_ERROR = 4
IDN_CAPTURE1ENABLE = 405
TASK_IGNORE = -1
IDN_CAPTURE1POSITIVELATCHED = 409
TASK_INCORRECT = 9
IDN_CAPTURE1NEGATIVELATCHED = 410
TASK_INTERRUPTED = 0x200
IMMEDIATE or IMMED = 1
TASK_KILLED = 10
INPOSITION or INPOS = 2
TASK_LOCKED = 0x100
LEFTY = 1
TASK_READY = 7
MAXDOUBLE = 1.797693134308
TASK_RUNNING = 1
MAXLONG = 2147483647
TASK_STOPPED = 2
MINDOUBLE = -1.797693134308
TRACK = 3
MINLONG = -2147483648
TRUE = 1
MULTIPLE = 1
2.2.3.2. V
ARIABLES
You must declare a variable in MC-BASIC before you can it. In the
declaration, you define variable name, scope and variable type. MC-BASIC
supports Long for integer values, Double for floating point values, and String
for ASCII character strings.