Ascript is an embedded, BASIC-like scripting language. It combines a subset of BASIC-style statements with motion-control commands modeled on a subset of the Commander ASCII command set. 

About Ascript 

Some motion-control commands can also function as value-returning expressions and can be used in IF...THEN statements. IF and WHILE statements support unlimited nesting. NPBuilder’s two-pass compiler removes the nesting limits imposed by the older GUI control application’s compiler.

AScript supports four execution threads (programs) numbered 0 through 3. It also supports up to 32 subroutines. Subroutines do not have names; each is referenced by an ID from 0 through 31.

Comments begin with a semicolon (;) or a single quotation mark ('). Characters that follow the marker on that line are treated as a comment.

AScript supports up to 100 variables, named V1 through V100. Each variable stores a 32-bit integer; AScript does not currently support floating-point values.

NPBuilder compiles Ascript into PCode, which the Commander can process more efficiently, then downloads the compiled code to the controller. A single line of AScript may generate four or five lines of PCode, so the Commander’s PCode line limit does not correspond directly to the number of AScript lines. NPBuilder indicates if a script is too large to download and identifies the associated source line with a compilation error.

About BScript

BScript is a hybrid scripting language for external control, such as a PC sending commands to the Commander over USB. It supports the full Commander ASCII command set and includes BScript only instructions, such as REPEAT and UNTIL. The commands are processed by the BScript interpreter instead of sent to the Commander. These instructions provide limited control logic for ASCII command scripts executed in real time from NPBuilder for testing. Because BScript is interpreted rather than compiled, it has defined limits; for example, REPEAT...UNTIL loops can be nested only three levels deep. The editor uses syntax coloring to distinguish BScript commands, ASCII commands, and comments. In BScript, comments begin with a single quotation mark ('). BScript does not support semicolons as comment markers.

BScript supports nine parameter macros, referenced as @1 through @9. Macros use simple text replacement: if @1 is defined as JX+, every instance of @1 in the script is replaced with JX+ before the script is passed to the BScript interpreter.

The pane on the right functions like the Commander Terminal Program: you can enter ASCII commands directly and review script-execution results in the terminal window.

About Code Block Builder

The Code Block Builder is a project-level editor for assembling complex projects from smaller BScripts. The user-interface engine supports development and prototyping rather than production user interfaces. Projects are built with logic blocks, including BScripts for running a script with unique parameters, SUB for defining a subroutine, CALLSUB for calling an existing subroutine and performing comparisons, and ACTIONCMD for non-motion-control tasks such as user-interface definition, device selection, and keyboard input.

Projects can run in real time through the Play/Run button for development, prototyping, or demonstration machines. For production use, convert the project into source code for the target programming language. Code-generation plugins support this conversion. NPBuilder includes plugins for selected languages, and its open API enables developers to create custom code-generation tools for other programming languages.