1.1 AScript Motion Control Command Set
Ascript motion control commands are similar to the Commander ASCII command set. There can be small differences in the syntax of AScript commands and ASCII commands (a command name may be slightly different or parameters treated differently).
Note: AScript motion control is only a subset of the entire ASCII command set, however, the AScript motion control command set does provide a feature set to handle most requirements.
Some motion control commands can also be used as functions to return a value, and can be used in IF THEN statements. IF statements can be nested to an unlimited depth.
Controllers in the Commander Ecosystem support four threads of AScript programs, which are labeled from 0 to 3. Each program supports up to 32 subroutines.
Note: Subroutines are not named but are referenced by an ID number from 0 to 31.
Comments are any characters after a semicolon ; character or a single quote ‘ character.
Programs support up to 100 variables, and indicated by the letter V followed by the variable ID, 1 to 100. They only hold 32-bit integer values. There is no floating point in AScript at this time.
NPBuilder provides a compiler which converts AScript to PCode that can be downloaded to the controller. One line of AScript may generate up to four or five lines of PCode, so the PCode line limit of the Commander is not the same as lines of AScript. If a script is to big to download, NPBuilder informs you. The compiler also has some error reporting features and indicates which line of code an error was found on.
Each motion control command is Write only, Read only, or both Read and Write.
- The Write syntax of a motion control command means it is a statement where you pass parameters with it to tell the Commander to do something. Ascript recognizes a write command by the command being the first word on a line, and the Commander expects the correct parametrs after reading the Write syntax.
- If a motion control command is used in Read syntax, then the command is acting like a function in BASIC. This syntax could be in the context of an IF statement, WHILE statement or after an = character in an assignment statement. When a motion control command is used as if it is a function, it always returns a value to the BASIC statement it is in.
Details about motion control commands can be found in the Commander reference document: