This is an old revision of the document!


Development Tools and Code

This describes the recommended toolset for development. Other editors and IDEs may work as well (including Atom, which we recommend until it was discontinued), but this is probably the best way to get up and running.

  • Download the Blocks scripting github repo as a ZIP file and unpack it into the script directory. This is located inside PIXILAB-Blocks-root in your home directory (assuming the Blocks server program has been used on this computer, thus creating the script folder).

:!: If you already have some of the files or directories matching those obtained from github on your computer, you need to merge the files with the existing ones, replacing any conflicting files as appropriate.

Once this is done, your PIXILAB-Blocks-root/script directory should contain at least the following items

driver
system
system_lib
LICENSE
README.md
tsconfig.json

The first three items shown above are directories, containing the files obtained from github. They may contain additional files, if you had driver or other scripts installed before.

  • Open the PIXILAB-Blocks-root/script directory in Visual Studio Code using File > Open Folder…
  • Open a new terminal in Visual Studio Code using Terminal > New Terminal. Install the TypeScript compiler by typing npm install -g typescript in the terminal, followed by Enter.
  • Install driver development dependencies by typing npm install in the terminal, followed by Enter.
  • Select Terminal > Run Build Task > tsc: watch to automatically compile TypeScript files as they are saved. IMPORTANT: This last step must be repeated after restarting VS Code to re-activate the typescript compiler.

:!: On Windows systems, an error message similar to "[…] cannot be loaded because running scripts is disabled on this system." may appear following any of the commands above. This can be resolved by changing the Execution Policy: Run Windows PowerShell as administrator and type Set-ExecutionPolicy RemoteSigned, followed by Enter. Type "a" to select "Yes to all". Restart Visual Studio Code, close the terminal and open it again using Terminal > New Terminal.

Once you have those pieces in place, restart your local Blocks server and open the Blocks Editor using your web browser. You should now find the drivers on the Driver menu of a TCP Device added on the Manage page. If you don't see the drivers listed there, they're not installed in the proper location (see above).

Proceed with learning about basic concepts.