August 23 2022

Scripting

Introduction

****** THIS DOCUMENT IS UNDER CONSTRUCTION, THIS IS FOR THE NEW RELEASE 4.x ******

From 4.x, Ultimate CNC has a built-in scripting engine based on Javascript (abbreviated JS) not include any input/output, such as graphics facilities or networking.

Overview:

  • Control your CNC machine.
    • Common functions: goHome, ...
    • Current status the machine: isAlarm, isConnected, ...
    • Feedrate, spindle rotation, etc...
  • GCodeProgram.
    • Load programs from files.
    • Load G-code programs from coordinates x,y (2D Vectors).
    • Load programs from G-code list.
  • Dialog.
    • Information box.
    • Alert box.
    • Get coordinates from user.
    • Wait box.
    • Confirmation box.
    • Customize dialog.
  • SimpleCAD
    • Drill function
    • Common shapes functions included: rectangle, circle, triangle and square.
    • Polygon function.
  • GUI integration.
    • Assign buttons to script.
    • Assign events to script.
    • Assign M-Codes to script.

Ultimate CNC doesn't have any built-in JS editor, so you have to use your preferred editor.

Important notes:

  • One script can be executed at a time.
  • Scripts are running on GUI thread.
  • Javascript is not Java.