Robot File Sync Extension for Visual Studio Code
Overview
This 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, as well as manage descriptions from a CSV file. The extension also integrates inlay hints into the editor for quick reference of descriptions related to certain keywords.
Features
Download Files:
- Download all files from the robot.
- Download
.ls
files from the robot.
- Update files from the robot into a selected folder.
Upload Files:
- Upload individual files or folders to the robot.
CSV Descriptions:
- Select and load a CSV file that contains descriptions for robot programs.
- Automatically reload the descriptions when the CSV file changes.
Inlay Hints:
- The extension provides inlay hints for specific keywords (e.g.,
DO[x]
or DI[x]
) based on descriptions from the CSV file.
File Insertion:
- Insert
.ls
file names into the current document by selecting from a list.
Commands
extension.downloadAllFiles
- Downloads all files from the robot to a user-selected folder.
extension.downloadLsFiles
- Downloads all
.ls
files from the robot to a user-selected folder.
extension.updateFilesFromRobotLsFiles
- Updates
.ls
files from the robot into a selected folder.
extension.uploadFileToRobot
- Uploads a single file to the robot.
extension.uploadFolderToRobot
- Uploads an entire folder to the robot.
extension.selectCSVFile
- Prompts the user to select a CSV file containing descriptions. Automatically loads the descriptions and watches for changes.
extension.listLsFilesAndInsert
- Lists
.ls
files in the current directory and allows the user to insert the file name into the active editor.
File Descriptions
The CSV file used for descriptions should have two columns:
- Key: A unique identifier (e.g.,
DO[1]
or DI[1]
).
- Description: A textual description corresponding to the key.
Key,Description
DO[1],Digital output 1
DI[1],Digital input 1
Setup Instructions
Install the Extension:
Install the extension directly from Visual Studio Code's Extensions Marketplace.
The extension will prompt for an IP address of the robot. The default IP is 192.168.10.124, but you can also enter a custom IP.
CSV File:
The extension expects a CSV file with descriptions. You can either use the default descriptions.csv or select a custom CSV file using the extension.selectCSVFile command.
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
Set Frames
- Trigger:
set frames
- Description: Set Up Frames
If () THEN
- Trigger:
IF
- Description: IF then, Endif
If () THEN ELSE
- Trigger:
IF
- Description: IF then, Else, Endif
If (Chooser) THEN
- Trigger:
IF
- Description: IF Chooser then, Endif
If (Chooser) THEN ELSE
- Trigger:
IF
- Description: IF Chooser then, Else, Endif
Header
- Trigger:
Header
- Description: Main Header
Multi Line Text
- Trigger:
--eg:
- Description: Multi Line Text
To DO
- Trigger:
To do
- Description: Must Return to Complete
Label
- Trigger:
LBL[]
- Description: Add label
Jump Label
- Trigger:
JMP LBL[]
- Description: Add Jump label
Jump Label With Label
- Trigger:
JMP LBL[]
- Description: Add Jump label
Wait Sec
- Trigger:
WAIT
- Description: Add Jump label
CALL
- Trigger:
CALL
- Description: Call Program
Acknowledgments
This extension's syntax highlighting is based on the work from TPSyntaxHighlighter. We appreciate the contributions made by the original author.