Standalone Programming Commands
The Commander core supports standalone programming, which allows the controller to execute a user-defined program that is stored in its internal memory. The standalone program can be run independently of USB and serial communication, or while communication is active.
Commander core utilizes A-Script, a BASIC-like language that helps the programmer quickly write programs for motion control projects, including conditional statements, subroutines, and mathematical expressions. The programming syntax uses a series of standalone commands that allows the programmer to build single and multi-thread programs that can be compiled and run in the controller. By writing lines of code using the set of commands that make up the A-Script language, set-up, control of motion, management of inputs and outputs, and error handling can all be addressed. A basic program consists of a start line (PRGxx) and an end line (END). All code is written between the PRG and END lines. Use the Utility software to write, compile, download, upload, and execute programs.
For more information on A-Script, how the programs are formatted and to see example code, see the Commander Manual Section 2.7 Standalone program Specification and Section 5.0 Standalone Language Specification.
Command |
Description |
Available with: |
Link |
|||||
ASCII |
Standalone |
CMD-4CR |
PMX-4EX |
PMX-4ET |
PMX-2ED |
PMX-2EX |
||
-- |
; |
Use in-line with code to add comments |
● |
● |
● |
● |
● |
|
-- |
DELAY |
Wait a prescribed amount of time before next command is executed |
● |
● |
● |
● |
● |
|
GS |
GOSUB |
Go to sub routine |
● |
● |
● |
● |
● |
|
-- |
IF, ELSEIF, ELSE, ENDIF |
Conditional loop IF, ELSEIF, ELSE/ENDIF |
● |
● |
● |
● |
● |
|
-- |
PRG, END |
Program begin and end lines |
● |
● |
● |
● |
● |
|
SA |
-- |
Compiled program line |
|
● |
● |
● |
● |
|
SACTRL |
SR |
Standalone program control |
● |
|
|
|
|
|
SAMAX |
-- |
Maximum number of standalone program lines |
|
|
|
|
|
|
SAP |
-- |
Error handling setting |
● |
● |
● |
|
|
|
SASTAT |
-- |
Standalone program status |
● |
● |
● |
● |
● |
|
SLOAD |
-- |
Activation of program on power-up |
● |
● |
● |
● |
● |
|
SPC |
-- |
Current program counter |
● |
● |
● |
● |
● |
|
-- |
SUB, ENDSUB |
Subroutine begin and end lines |
● |
● |
● |
● |
● |
|
V |
V |
Standalone variable |
● |
● |
● |
● |
● |
|
-- |
WAIT |
Delay next command until current command is complete |
● |
● |
● |
● |
● |
|
-- |
WHILE, ENDWHILE |
Conditional loop WHILE/ENWHILE |
● |
● |
● |
● |
● |
|
-- |
+, -, *, /, |
Mathematical operands and conditionals |
● |
● |
● |
● |
● |
|