Robot File Sync Extension for Visual Studio CodeOverviewThis Visual Studio Code extension allows you to interact with a Fanuc robot via FTP for uploading and downloading files. It provides several commands to upload files, download files, and update existing files from the robot, and shows I/O and register descriptions from per-robot CSV files next to the matching code in the editor. FeaturesDownload Files:
Upload Files:
I/O and Register Descriptions:
Sorted Backups:
Git Commits:
File Insertion:
CommandsVerify an LS fileRight-click an LS file and select MNAutomation → LS Checker → Verify LS File. Results appear in the Problems panel with clickable line locations. The verifier checks the current editor contents, including unsaved changes. It does not modify the program. Run verification again after editing; old diagnostics are cleared when the document changes. The initial rules check nonblank lines within Long Choose MNAutomation → LS Checker → Edit LS Verifier Rules to open your The JSON contains Severity levelsEach rule has a
Use When the defaults changeYour rules file is yours: installing a new version never overwrites it. New checks are added to it automatically. When a new version changes the default of an existing check (for example
Only rules that still have the old default are listed; a rule you changed yourself is never touched. Uncheck any change to keep your current setting, then press Enter. Press Esc to keep everything as it is. You are asked once per update. Reset the rules to the defaultsMNAutomation → LS Checker → Reset LS Verifier Rules to Defaults replaces your rules file with the built-in defaults. It asks first, and saves your current file as a backup ( The LS checker commands are in the MNAutomation → LS Checker submenu: Verify LS File (on LS files), Edit LS Verifier Rules, and Reset LS Verifier Rules to Defaults. Additional configurable checks:
Local calls are searched in the selected file's workspace folder, or its containing directory when outside a workspace. Indirect register-based calls, jumps, and positions cannot be resolved statically; Motion syntax reference: FANUC R-30iB basic operator's manual. Common LS errorsErrors the verifier often finds in real programs, what they mean, and what to do.
|
| Line | Description | Color | Comes from |
|---|---|---|---|
DO[18 Gripper Close]=OFF |
Gripper Close | Pink | shared.csv (every robot) |
DO[17 Gripper Open]=ON |
Gripper Open | Tan | RG.csv (only this robot) |
- If both files have the same key, the robot's file wins and the description shows in tan.
- Not sure where a description comes from? Hover over it. The tooltip names the file.
- These are the default colors with VS Code's standard dark theme. Tan is your theme's normal inlay hint color, so it can look different in other themes. Pink is set by this extension (a darker magenta in light themes).
To change the colors, add them to your VS Code settings:
"workbench.colorCustomizations": {
"robotFtp.robotDescriptionForeground": "#4EC9B0",
"robotFtp.sharedDescriptionForeground": "#C586C0"
}
A robot's file is named after the robot (<name>.csv). To use a different file, add "descriptions": "path/to/file.csv" (relative to the workspace folder) to that robot in .vscode/robot-ftp.json.
Run MNAutomation → Descriptions → Edit Descriptions to open or create the right file. Old descriptions.csv files next to LS files are no longer read; copy their rows into .vscode/descriptions/<robot>.csv or shared.csv.
Create descriptions from the robot
The robot already has comments for its I/O and registers. Copy them into a descriptions file instead of typing them. All description commands are in the MNAutomation → Descriptions menu:
| Command | Use it when |
|---|---|
| Get Descriptions from Robot | You can connect to the robot. Downloads only the five comment files, nothing else. |
| Create Descriptions from Backup | You already have a backup folder (for example from Get ALL Files from Robot). Right-click that folder. |
| Edit Descriptions | You want to open a descriptions file and edit it by hand. |
| Send Descriptions to Robot | You changed descriptions in VS Code and want the robot's I/O and register comments to match. |
Get Descriptions from Robot:
- Right-click the robot's folder (for example
Robots/ST02) and run MNAutomation → Descriptions → Get Descriptions from Robot. - Pick the robot in the IP picker. The robot that owns the folder is listed first.
- Pick the file to save to. Again, the robot that owns the folder is listed first; you can also pick another robot or
shared.csv. - If the file already has descriptions, choose:
- Merge: the robot's comments replace matching keys; rows you added that are not on the robot stay.
- Replace: the file holds only the robot's comments.
The downloaded files are deleted when it is done. The descriptions file opens, and the descriptions appear in your LS files right away.
Automatic prompt after a download: after Get ALL Files from Robot or Get All LS Files from Robot, the extension checks whether that robot has a descriptions file. The robot is the one whose folder holds the download, or the named robot with the IP you picked. If its file is missing or has no rows, you are asked:
- Create: saves the robot's comments to
.vscode/descriptions/<robot>.csvright away, with no second IP prompt. After an LS-only download, the five comment files are fetched in the same connection and deleted afterwards. - Not now: asks again after the next download.
- Don't ask again for <robot>: stops asking for that robot in this workspace. You can still use Get Descriptions from Robot at any time.
Downloads from an IP that is not a named robot are not checked, because descriptions belong to a named robot.
Create Descriptions from Backup works the same way, starting from step 3: right-click a backup folder such as 2026-11-16-ALL_01 and run MNAutomation → Descriptions → Create Descriptions from Backup.
| File on the robot / in the backup | Descriptions read |
|---|---|
ioconfig.dg |
DI, DO, GI, GO, UI, UO, AI, AO |
iostate.dg |
Adds RI, RO, and flags (F), plus any I/O missing from ioconfig.dg |
numreg.va |
R |
posreg.va |
PR (group 1) |
strreg.va |
SR |
Only items with a comment are added. Comments that are only spaces are skipped. If some of these files are missing from the folder, the command uses the ones it finds.
Update descriptions while writing a program
You do not have to open the CSV to change a description. In an LS file:
- Type the comment the Fanuc way, inside the brackets:
DO[5:Clamp Closed]=ON,R[10:Pick Number],DO[17: * :Gripper Open]. When the comment differs from the descriptions files, the LS Verifier'sdescriptionsrule marks it with a warning as you type. PressCtrl+.(or click the lightbulb) and choose Save "Clamp Closed" as the description of DO[5]. - Set a description from the key: put the cursor on any
DO[5]orR[10]and pressCtrl+.→ Set description of DO[5]…, or hover over a description and click Edit description. Type the new text. - Save all of a file's comments at once: right-click in the LS file → Update Descriptions from LS Comments. Every comment that differs is listed and checked; untick any you do not want.
The description is saved to the file it already comes from (the robot's file or shared.csv). A new key goes to the robot's file, or shared.csv when the folder has no named robot. Other rows in the CSV are not reordered. After saving, click Send to Robot to update the robot's comments too.
Why this matters: the robot does not read comments typed inside the brackets. When an LS file is loaded, the robot keeps its own I/O and register comments, and the next download shows those again. Save the comment as a description and send it to the robot, or it is lost.
Comments the robot cut short in a downloaded LS file (PR[15:Tool Offset Ro] for Tool Offset Rotate) are not marked. Only comments of 12 or more characters are treated as cut short, so shortening DO[15:newer] to DO[15:new] is still marked. Before an upload, differing comments are listed and you can save them as descriptions first (see Check before upload). To turn this off, set the descriptions rule's enabled to false in MNAutomation → LS Checker → Edit LS Verifier Rules (ls-verifier-rules.json).
Send descriptions to the robot
MNAutomation → Descriptions → Send Descriptions to Robot writes your descriptions back to the robot as I/O and register comments.
- Right-click the robot's folder and run the command. Pick the robot in the IP picker.
- The robot's current comments are read over FTP and compared with the robot's file plus
shared.csv(the robot's file wins for the same key). - A list shows only the rows that differ, for example
DI[2]: "Spare" → "Test Update". Choose Send. - Each comment is sent, then the comments are read back to check them. A comment that reads back differently was probably too long for the robot's comment field; the Output panel shows the details.
Comments on the robot that are not in your files are not changed, and an empty row does not clear a comment on the robot.
Reminder after sending LS files: after Send This LS File or Send Folder, the robot's comments are read in the same connection and compared with your descriptions (only when the project has descriptions). If some differ, a popup asks:
- Send Descriptions: runs Send Descriptions to Robot for the same robot, without asking for the IP again.
- Not This Session: does not ask again, for any robot, until VS Code restarts.
- Don't Ask Again: stops asking for every robot in this workspace. MNAutomation → Reset Reminders turns it back on.
A failed check never fails the upload; it is only noted in the Output panel.
How it works: the comments are sent through ComSet, a small KAREL program that comes installed on the controller and backs the robot's web Comment Tool. You do not need the KAREL software option. The robot must allow it:
- Setup → Host Comm → HTTP: set the KAREL entry to unlocked. If it is locked, the robot answers "Protected feature, cannot issue from here" and the command stops with that message.
- The robot's web server must be reachable from your PC on port 80. For RoboGuide or a robot behind port forwarding, set
httpPortfor the robot in Edit Robot List (RoboGuide shows its HTTP port in the cell's robot properties; for example9000).
Supported: DI, DO, RI, RO, GI, GO, AI, AO, R, PR (group 1), SR, F. UI and UO comments cannot be set this way; they are listed in the Output panel and skipped.
CSV format
Two columns, with a Key,Description header row:
Key,Description
DO[1],Clamp closed
DI[1],Part present
R[10],Part count
PR[3],"Pounce, above fixture"
- Key: one of
DI,DO,RI,RO,AI,AO,GI,GO,UI,UO,R,PR,SR,F, followed by[number]. Upper or lower case both work. - Description: the text to show. Put it in double quotes if it contains a comma.
Descriptions are not shown inside ! remarks, or on references that already carry a robot comment such as DO[1:Clamp].
Sorted downloads
A full backup has 200–400 files. Only about a quarter are programs you edit; the rest are system variables, configuration and diagnostics. Get ALL Files from Robot and Get All LS Files from Robot therefore sort the files into sub-folders:
2026-11-16-ALL_01/
Programs/ your TP programs and macros (.ls)
TP/ their .tp binaries
Registers/ NUMREG, POSREG, STRREG, PALREG (.va, .vr)
IO/ DIOCFGSV.IO/.VA, IOCONFIG.DG, IOSTATE.DG, IOSTATUS.CM
KAREL/ KAREL programs (.pc) and their variables
Vision/ iRVision (.vd, .vda, .cam)
Web/ iPendant web screens (.stm, .gif, PANELn.DT)
System/
Programs/ FANUC-supplied TP programs (-BCKED*-, SV_ADJST, …)
TP/
Variables/ system variables (.sv) and other .va/.vr
Config/ .df, .dt, .xml, .cm, .dat
Diagnostics/ .dg reports, .zip dumps, alarm and log listings (ERRALL, LOGBOOK, …)
The rules come from 45 real backups of 16 robots. Send Folder on Programs sends your programs and macros, without the FANUC system programs.
Settings:
| Setting | Default | What it does |
|---|---|---|
robotFtp.downloadSort |
sorted |
flat keeps every file in one folder, as on the robot |
robotFtp.downloadFolders |
see above | Folder name template. Rename any folder, e.g. "programs": "1 Programs" so it lists first. / makes nested folders; an empty name keeps those files at the top. tp is the sub-folder for .tp files inside the folder of their .ls. |
robotFtp.systemPrograms |
-BCKED*-, SV_ADJST, GETDATA, SENDDATA, SENDEVNT, SENDSYSV, REQMENU, CLSKP* |
FANUC-supplied program names (* and ? wildcards) that go to System/Programs. Add names for options your robots have. |
Example settings.json:
"robotFtp.downloadFolders": { "programs": "1 Programs", "diagnostics": "9 Diagnostics" },
"robotFtp.systemPrograms": ["-BCKED*-", "SV_ADJST", "GETDATA", "SENDDATA", "SENDEVNT", "SENDSYSV", "REQMENU", "CLSKP*", "MYOPTION*"]
Restoring a controller from a sorted backup
A FANUC controller restores from one folder with every file in it. Right-click a sorted backup folder and choose MNAutomation → Get from Robot → Make Restore Folder. It copies every file into a new folder next to it (2026-11-16-ALL_01-Restore), all at one level. Copy that folder's contents to a USB stick or memory card. The sorted backup is not changed.
Restore folders are copies, so git should not track them. New repositories created by the extension ignore them (*-Restore*/ in .gitignore). In an existing repository, add *-Restore*/ to its .gitignore yourself.
Git integration
Keep a history of every trip to the robot. After a robot transfer finishes without errors, the extension asks for a commit message and commits only the files from that transfer:
| Command | What gets committed |
|---|---|
| Get ALL Files / Get All LS Files | The downloaded files (plus the robot's descriptions file if you just created it) |
| Get Update LS Folder / Get Update For This LS File | The updated files that changed |
| Send This LS File / Send Folder | Uploaded files that had uncommitted edits. If they were already committed, nothing is recorded. |
- A message box opens with a suggested message, for example
Download LS files ST02 (192.168.1.12) 2026-11-16 09:05. Edit it if you like. - Press Enter to commit, or Esc to skip. Nothing is staged if you skip.
Details:
- It commits to the current branch of the repository that holds the files. Other changes in the repository are left alone. If other files were already staged, you choose Commit anyway or Only robot files.
- If the files are not in a git repository, it offers to create one, in the workspace folder or in the download folder. The new repository gets a
.gitignorewith the patterns fromrobotFtp.git.ignorePatterns, and it is included in the first commit. If the folder already had other files (earlier downloads,.vscodesettings and descriptions), you choose whether the first commit includes all files or only this transfer. After that, each commit includes only that transfer's files. - If the robot files match the last commit, it says so and does not commit.
- It uses VS Code's built-in Git, with your git name, email and credentials. Commits show up in the Source Control view right away.
Settings
| Setting | Default | Options |
|---|---|---|
robotFtp.git.onDownload |
prompt |
off to never commit after downloads and updates |
robotFtp.git.onUpload |
prompt |
off to never commit after uploads |
robotFtp.git.commitMode |
auto |
confirm: after the message, ask Commit or Open Source Control first |
robotFtp.git.messageTemplate |
${operation} ${robot} ${date} |
Variables: ${operation}, ${robot} (name and IP), ${name}, ${ip}, ${date}, ${count}, ${folder} |
robotFtp.git.push |
never |
ask or always push after committing. Repositories without a remote are never pushed. |
robotFtp.git.offerInit |
true |
false to never offer to create a repository |
robotFtp.git.ignorePatterns |
*.Sem, *.Wrk, *-Restore*/ |
Patterns written to .gitignore when the extension creates a repository. Add your own in Settings (search for ignorePatterns, then Add Item). |
robotFtp.downloadLayout |
dated |
fixed: see below |
All settings can be set per workspace, so one customer project can turn commits off without affecting others.
Without Git, or in SVN folders
Only the commit prompts need Git. Downloads, uploads, the LS checker, descriptions and snippets work the same without it.
- Git not installed, or VS Code's Git turned off (
git.enabled): transfers work normally and are not committed. The first transfer in each VS Code session shows a warning with a link to install Git. Choose OK to be reminded next session, or Don't Remind Me to stop the warning. Once Git is installed, commits start working without changing any setting. - SVN working copies (a
.svnfolder in the transfer folder or above it): the extension never offers to create a git repository there. If the folder is also inside a git repository, that repository is still used. - To stop all commit prompts in a workspace, set
robotFtp.git.onDownloadandrobotFtp.git.onUploadtooff.
Turning reminders back on: MNAutomation → Reset Robot FTP Reminders turns back on every "Don't Remind Me" / "Don't ask again" choice: the Git warning, the question to create descriptions for a robot, and the reminder to send changed descriptions after an upload (in the current workspace).
Files git should ignore
When the extension creates a repository, it writes .gitignore in the repository folder with the patterns from robotFtp.git.ignorePatterns. The defaults are *-Restore*/ (the flat copies made by Make Restore Folder, which duplicate a backup) and *.Sem and *.Wrk (PLC work files). If a .gitignore is already there, only patterns that are missing are added.
To change the list, open Settings, search for ignorePatterns, and use Add Item, or edit settings.json:
"robotFtp.git.ignorePatterns": ["*.Sem", "*.Wrk", "*-Restore*/", "*.bak", "Backup/"]
Patterns use the normal .gitignore syntax. Changing the setting does not edit .gitignore files in repositories that already exist; edit those files directly.
Dated or fixed download folders
By default each download goes into a new dated folder such as 2026-11-16-ALL_01. In git, every backup then shows up as hundreds of new files, which makes it hard to see what changed on the robot.
Set robotFtp.downloadLayout to fixed to download into one folder instead: ALL or LS inside the folder you choose (for example ST02/LS). Each download overwrites it, so git shows exactly which programs changed since the last visit, and git keeps the dated history. Files that were deleted on the robot are not deleted locally.
Setup Instructions
Install the Extension:
Install the extension directly from Visual Studio Code's Extensions Marketplace.
Configure FTP Settings:
The extension can be configured using VS Code settings. You can customize the FTP connection parameters:
robotFtp.port(number, default:21)- The FTP port used by your robot (standard FTP port is 21)
- Note: Fanuc R-30iB/RoboGuide uses non-standard port 9125 - set this if using RoboGuide
- Set in VS Code settings:
"robotFtp.port": 21(or9125for RoboGuide)
robotFtp.username(string, default:"Administrator")- The FTP username for your robot
- Set in VS Code settings:
"robotFtp.username": "Administrator"
robotFtp.password(string, default:"")- The FTP password for your robot (blank for RoboGuide)
- Set in VS Code settings:
"robotFtp.password": ""
Robots and IP addresses
Every robot command asks which robot to use. The list comes from .vscode/robot-ftp.json in the workspace folder, so it is shared by every folder in the project:
{
"robots": [
{ "name": "ST02", "ip": "192.168.1.12", "folder": "Robots/ST02", "port": null },
{ "name": "St04", "ip": "192.168.1.14", "folder": "Robots/St04", "port": 21 },
{ "name": "RoboGuide", "ip": "127.0.0.2", "folder": null, "port": 9125, "httpPort": 9000 }
],
"recent": ["192.168.1.14", "192.168.1.12"]
}
robots: named robots for the job. They are never removed automatically.folder(optional, relative to the workspace folder): when a command runs anywhere inside this folder, this robot is listed first and marked this folder. If several folders match, the deepest one wins.port(optional): the FTP port for this robot. Leave it out or set it tonullto use therobotFtp.portsetting.httpPort(optional): the robot's web server port, used by Send Descriptions to Robot. Leave it out for port 80.
recent: the last five IPs used in the project, newest first.
The picker lists, in order: the robot for the current folder, recent IPs (with the robot name when known), the other named robots, the built-in IPs (192.168.10.124, RoboGuide 127.0.0.2), and Other. Choosing Other lets you type an IP and then save it as a named robot, choosing its folder and port.
Use MNAutomation → Edit Robot List to open the file and rename robots, change IPs, or set folders and ports. Commit the file to the job's repository to share the robot list with your team.
The file is only written when you use an IP or save a robot. Outside an open workspace folder, recent IPs are kept in VS Code's own storage and named robots are not available. Old ip.txt and recent-ips.json files are no longer used and can be deleted.
Example Configuration (Standard Robot):
{
"robotFtp.port": 21,
"robotFtp.username": "Administrator",
"robotFtp.password": ""
}
Example Configuration (RoboGuide):
{
"robotFtp.port": 9125,
"robotFtp.username": "Administrator",
"robotFtp.password": ""
}
Or configure via Settings UI: Search for "robotFtp" in VS Code settings.
Descriptions:
See I/O and Register Descriptions.
Commands and Usage:
Use the commands available in the command palette or keybindings to interact with the robot, upload/download files, or insert descriptions into your code.
Snippet Triggers and Descriptions
The snippet commands are in the MNAutomation → Snippets submenu: Open User Fanuc Snippets, Create/Open Project Fanuc Snippets File, Load External Fanuc Snippets, and Clear External Fanuc Snippets.
Fanuc snippets are loaded in three additive levels:
- Built-in — Defaults supplied by the extension.
- User/global — An editable
fanuc-snippets.code-snippetsfile loaded in every workspace for the current VS Code profile. Run Open User Fanuc Snippets to edit it. The file is watched for saved changes and never overwritten during extension updates. - Project — A
.vscode/fanuc-snippets.code-snippetsfile loaded only in the selected workspace. Run Create/Open Project Fanuc Snippets File to create it with a starter framework or open the existing file without overwriting it. VS Code loads this file natively; use"scope": "fanuctp"on its snippet entries.
On standard Windows VS Code installations, the managed file is stored beneath %APPDATA%\Code\User\globalStorage\coreyapplegate.robot-ftp. Use the command instead of relying on that exact path because profiles, VS Code Insiders, and remote environments use different storage roots.
You can additionally run Load External Fanuc Snippets and select a .code-snippets or .json file from Documents, OneDrive, or a network location. The external file augments both the defaults and managed user snippets. Its absolute path is saved under robotFtp.externalSnippetsFile. Run Clear External Fanuc Snippets to stop loading only the external file.
External files use the standard VS Code snippet format:
{
"Pulse Output": {
"prefix": "PULSE",
"body": [
": PULSE DO[${1:1}] FOR ${2:0.5}sec ;"
],
"description": "Pulse a digital output"
}
}
For a project-only file, add the Fanuc language scope:
{
"Project Initialization": {
"scope": "fanuctp",
"prefix": "projinit",
"body": [
": UFRAME_NUM=${1:1} ;",
": UTOOL_NUM=${2:1} ;"
],
"description": "Project-specific initialization"
}
}
Using a snippet
- On an empty line, type the trigger, for example
frames. Don't type the leading:; the snippet adds it. - Pick the snippet from the suggestion list (it has a snippet icon) and press Tab or Enter. Press Ctrl+Space if the list does not open.
- Press Tab to move between the fields in the snippet.
Tip: press Ctrl+Space to show the snippets. If the suggestion list does not appear while you type, press Ctrl+Space to open it (also Ctrl+Space on Mac). This is most useful for triggers that contain a space, such as
set frames: the list closes when you type the space and only comes back once the whole trigger is typed. Pressing Ctrl+Space brings it back at any point.Use one-word triggers when you can. The one-word triggers below (
frames,todo,LBL,JMP,eg) show up as soon as you start typing. The same advice applies to snippets you add in your own files.Grey italic text is not a snippet. Text that appears in grey italics as you type comes from an AI inline-suggestion tool such as GitHub Copilot, not from this extension. Press Esc to dismiss it.
Built-in snippets
Set Frames
- Trigger:
framesorsetframes - Description: Set Up Frames
- Trigger:
If () THEN
- Trigger:
IF - Description: IF then, Endif
- Trigger:
If () THEN ELSE
- Trigger:
IF - Description: IF then, Else, Endif
- Trigger:
If (Chooser) THEN
- Trigger:
IF - Description: IF Chooser then, Endif
- Trigger:
If (Chooser) THEN ELSE
- Trigger:
IF - Description: IF Chooser then, Else, Endif
- Trigger:
Header
- Trigger:
Header - Description: Main Header
- Trigger:
Multi Line Text
- Trigger:
eg - Description: Multi Line Text
- Trigger:
To DO
- Trigger:
todo - Description: Must Return to Complete
- Trigger:
Label
- Trigger:
LBL - Description: Add label
- Trigger:
Jump Label
- Trigger:
JMPorjmplbl - Description: Add Jump label
- Trigger:
Jump Label With Label
- Trigger:
JMPorjmplbl - Description: Add Jump label
- Trigger:
Wait Sec
- Trigger:
WAIT - Description: Wait for a number of seconds
- Trigger:
CALL
- Trigger:
CALL - Description: Call Program
- Trigger:
Acknowledgments
This extension's syntax highlighting is based on the work from TPSyntaxHighlighter. We appreciate the contributions made by the original author.
Running the tests
npm test: lint, then every test inside a test copy of VS Code with the extension loaded. Unit tests are intest/*.test.js. Integration tests are intest/integration/. They run commands the way menus and the editor call them, in a fresh copy oftest/fixtures/workspace(robotTEST,Robot/MAIN.LS,TEST.csv). Prompts are replaced by stubs, and no robot connection is made.npm run test:unit: the unit tests only, with plain mocha. Faster, and needs no VS Code.
The test launcher fails when the repository path contains a space, so clone it to a path without one.
Publishing
Pushing a v* tag builds the .vsix and creates a GitHub Release; the .vsix is then uploaded to the Marketplace by hand. See Publishing a release.
