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

DELAY

GS

GOSUB

Go to sub routine

GS

--

IF, ELSEIF, ELSE, ENDIF

Conditional loop IF, ELSEIF, ELSE/ENDIF

IF

--

PRG, END

Program begin and end lines

PRG/END

SA

--

Compiled program line


SA

SACTRL

SR

Standalone program control





SACTRL

SAMAX

--

Maximum number of standalone program lines






SAMAX

SAP

--

Error handling setting



SAP

SASTAT

--

Standalone program status

SASTAT

SLOAD

--

Activation of program on power-up

SLOAD

SPC

--

Current program counter

SPC

--

SUB, ENDSUB

Subroutine begin and end lines

SUB

V

V

Standalone variable

V

--

WAIT

Delay next command until current command is complete

WAIT

--

WHILE, ENDWHILE

Conditional loop WHILE/ENWHILE

WHILE

--

+, -, *, /, 
<, >, =, !=

Mathematical operands and conditionals