

What is ACSPL+ Programming Language?
ACS motion controllers run on ACSPL+, a real-time motion programming language whose unique level of flexibility enables machine developers to quickly realize rich functionality.
Who is This Extension For?
This Visual Studio Code extension is designed specifically for developers and engineers who work with ACSPL+—the programming language used in ACS Motion Control systems. While ACSPL+ is a powerful tool for controlling motion systems, writing code directly within the MMI program can sometimes be cumbersome and prone to challenges.
One of the common issues developers face when coding directly in MMI is the risk of disconnection from the controllers. This can happen due to network instability, hardware issues, or other unforeseen circumstances, leading to lost progress or interruptions in your workflow. Additionally, it can be easy to forget to save your work to the controller or simulator, especially when you're focused on debugging or making quick adjustments. These situations not only slow down the development process but can also lead to errors and inefficiencies.
This extension aims to enhance your coding experience by providing syntax highlighting for ACSPL+ within Visual Studio Code, making your code more readable and easier to manage. By allowing you to work in a stable, feature-rich environment like VS Code, this extension helps avoid the risks of losing your work due to disconnections or unsaved changes, ensuring that your coding sessions are smoother and more productive.
Why Use This Extension?
- Focused Tool for ACSPL+: If you frequently write ACSPL+ code and want a another codding environment beside the MMI, this extension is for you. It enhances your productivity by making your code more readable and easier to write.
- Ideal for Motion Control Engineers: Whether you're developing new motion control routines or maintaining existing ACSPL+ programs, this extension provides the clarity and efficiency you need.
Note
If you're having trouble with the packages, please email me at barp@acsmotioncontrol.com
Key Features and Advantages
- Syntax highlighting for ACSPL+
- Function reference
- User-defined functions and variables
- Rich multi-axis motion command set
- High-level program flow commands:
IF-ELSE, WHILE, LOOP, GOTO
- Object-oriented structures:
STRUCT
- User-defined functions, subroutines, and autoroutines
- Supports G-Code
- 💥New Color Theme 💥
- 💥A Monty AI Assistance for ACSPL+ And other matters. 💥
- 💥Connect to a controller or simulator and run your programs — the connection stays open 💥
Example Code for ACSPL+
Note
Beyond editing, the extension can connect to a real controller or to the ACS Simulator and load, compile and run your .prg files — see Running Programs on a Controller. It is not a source-level debugger: there are no breakpoints or stepping. Program output arrives through DISP.
Real Controller & Simulator Example Snippets:
! Function Declarations
void concat(String REF s1, String REF s2, String REF s3);
String(50) concat_return(String REF s1, String REF s2);
! Code Usage Example
String st1(20) = "WELCOME TO ";
String st2(10) = "ACSPL+";
String st3(50);
concat(st1, st2, st3);
disp(st3);
STOP;
! Function Implementations
void concat(String REF s1, String REF s2, String REF s3)
{
s3 = s1 + s2;
ret
}
String(50) concat_return(String REF s1, String REF s2)
{
ret s1 + s2;
}
Real Controller Example Snippets:
!--THE NEXT CODE VALUES IS DEPENDS ON YOUR STAGE !
int x = 0;
ENABLE(x);
COMMUT(x);
VEL(x) = 3000;
SET FPOS(x) = 0;
sctrigger 2;
PTP/r x, 25;
wait 500;
PTP/r x, 25;
PTP/vr x, 0, 25;
STOP;
Simulator Example Snippets:
!--THE NEXT CODE VALUES IS DEPENDS ON YOUR STAGE !
int x = 0;
ENABLE(x);
VEL(x) = 3000;
SET FPOS(x) = 0;
sctrigger 2;
PTP/r x, 25;
wait 500;
PTP/r x, 25;
PTP/vr x, 0, 25;
STOP;
Running Programs on a Controller
Requirements
|
|
| SPiiPlus ADK Suite |
Provides ACS.SPiiPlusNET.dll, which the extension loads. Detected automatically under C:\Program Files (x86)\ACS Motion Control — the newest installed suite wins. |
| ACS User Mode Driver |
ACS.Service.exe must be running. If it isn't, the status bar says so and offers to start it. |
Connecting
Run ACSPL+: Connect to ACS Controller and pick a target — a saved controller, a new IP (port 701), or the ACS Simulator. On success the extension asks which program you want to run and offers every .prg in your workspace, with the file you have open listed first.
The connection stays open. Earlier versions opened a channel per action and closed it immediately, so every command ended with [ACS] Disconnected. and nothing carried over. Now a single channel is held for the whole VS Code session: connect once, then compile, run, stop and send transactions against it. The status bar shows the live target, and the channel closes only when you run ACSPL+: Disconnect from ACS Controller or close the window.
The controller IP you connect to is saved to acs.settings.json in your workspace root.
How a .prg is loaded
A .prg file is a container for several controller buffers, not a single program:
#/ Controller version = 4.00 <- file header, ignored
[#0](https://github.com/BarPupko/ACSPL-vscode-Extenstion/issues/0) <- program buffer 0
INT INDEX
...
#A <- D-BUFFER: globals and shared functions
global int I(100), I0, I1, ...
!axisdef X=0, Y=1, Z=2
The extension splits the file on those markers and loads each section into its own buffer:
#0–#63 go to the matching program buffer.
#A–#H and #D go to the D-buffer — this is where global declarations and shared functions live. Its index comes from GetDBufferIndex(), falling back to 64.
#/ headers and !PNAME= / !PDESC= MMI metadata are stripped, so buffers match what the MMI downloads and line-number-sensitive programs still line up.
- A line like
# N06 G01 X123 is treated as G-Code, not a section marker, so G-Code programs load intact.
The D-buffer is always accounted for. It is loaded and compiled before the program buffer that references it — otherwise any call into something declared under #A fails to compile with err=2026 "Undefined variable name". If your file has no #A/#D section, the controller's resident D-buffer is left untouched rather than wiped.
Buffers are cleared before loading, and the D-buffer is cleared last: the controller refuses to modify it while any other buffer is still compiled. If something outside the normal range is holding a compiled program, the extension finds it via ?PST and clears it rather than failing.
Compilation is verified with ?PERR — a non-zero result is reported as a failure instead of being announced as success.
Commands
| Command |
Keybinding |
What it does |
| Connect to ACS Controller |
|
Connects, stays connected, then asks which program to run |
| Disconnect from ACS Controller |
|
Closes the channel |
| Run Program on ACS Controller |
F5 |
Runs the focused .prg |
| Run Program (choose .prg)… |
|
Asks which .prg to run |
| Compile ACSPL+ Program |
Ctrl+F5 |
Loads and compiles without running |
| Stop ACS Program |
Shift+F5 |
Stops the buffer that last ran |
| Send Transaction to Controller |
|
Command terminal (?SN, ?VR, #SI, testing=5) on the open channel |
All output goes to the ACS Compiler output channel, including DISP messages while a program runs.
Note
Running a program executes real motion on a real controller. Verify your target before pressing F5.
Interaction between VSCODE(ACSPL+ Extention) and MMI

@Bar Popko