Program the OMAX 160X
Waterjet Cutter in C

The OMAX 160X is a large industrial waterjet cutting machine. This guide shows you how to write a C program that generates a G-code cutting file — then load it into the machine to cut a perfect square.

60,000 PSI water pressure
±0.001″ accuracy
Up to 46′×13′ cutting envelope
350 in/min max speed
Cuts steel · glass · stone · composites
⚠️ Safety First — Read Before Anything Else
1

What is the OMAX 160X?

The machine you are programming

The OMAX 160X is a Precision JetMachining Center — a large industrial machine that cuts materials using a thin stream of water mixed with fine garnet sand (called the abrasive), blasted at 60,000 PSI through a nozzle smaller than a pencil tip.

Because it uses water instead of heat, it leaves no heat-affected zones or warping. It can cut metal, stone, glass, carbon fiber, plastics, and composites — making it popular in robotics prototyping, aerospace, and manufacturing.

C Programming Connection
You do not write C code that runs on the OMAX directly. Instead, you write a C program that runs on your computer and generates a G-code file. That file is then loaded into the OMAX's IntelliMAX software, which translates it into machine motion. Think of it like printing: your C code writes the instructions, the machine reads them.

The OMAX's X and Y axes move the cutting nozzle across the material. Your C program will output coordinate pairs that tell those axes exactly where to go — tracing out the four sides of a square.

2

The Programming Workflow

From C code on your laptop to cut part on the machine

There are five steps between writing your C program and cutting a square:

1

Write the C program on your computer

Your program calculates the X/Y coordinates needed to trace a square and writes them as G-code commands to a .nc file.

2

Compile and run the C program

Use GCC to compile your code. Running the program creates square.nc — a plain text file full of machine instructions.

3

Transfer the file to the OMAX controller PC

Copy square.nc to the Windows PC connected to the OMAX (via USB drive or network share).

4

Preview in IntelliMAX Make

Open the file in OMAX's IntelliMAX Make software. It will display the toolpath on screen. Verify the square looks correct before any machine motion.

5

Run the program (with a trained operator)

With a certified operator present, set the material on the cutting table, zero the machine, and execute the program.

3

G-code: The Language of CNC Machines

The commands your C program will write into the file

G-code is the standard language that CNC machines (including waterjet cutters) understand. Your C program will use fprintf() to write these commands into a text file, one command per line.

CommandMeaningWhen to use it
% Program start / end marker First and last line of every G-code file
G21 Set units to millimetres Put near the top — use G20 for inches instead
G90 Absolute positioning mode Coordinates are measured from machine origin (0,0)
G0 X# Y# Rapid (fast) move — no cutting Moving to start position before turning water on
G1 X# Y# F# Linear cutting move at feedrate F This is the command that actually cuts the material
M7 Coolant / waterjet ON Opens the waterjet nozzle — starts cutting
M9 Coolant / waterjet OFF Closes the nozzle — stops cutting
M30 End of program Tells the controller the program is finished
Feedrate (F value)
Feedrate is the cutting speed in mm/min. Slower = higher quality cut, faster = rougher edge. For a first test cut in 6mm aluminium, 150 mm/min is a safe starting point. Your OMAX operator will advise the right feedrate for your specific material and thickness.
4

C Code: Writing the Square Cutting Program

A complete program you can compile and run right now

Create a new file called square_cut.c. The program below defines the square's size and position as constants at the top, then writes a G-code file that cuts the four sides.

square_cut.c
#include <stdio.h>
#include <stdlib.h>

/* ── Square parameters — change these to resize or reposition ── */
#define SIDE_MM    100.0   /* side length in millimetres           */
#define FEEDRATE   150     /* cutting speed in mm/min              */
#define START_X     50.0   /* bottom-left corner X position (mm)  */
#define START_Y     50.0   /* bottom-left corner Y position (mm)  */
#define OUTPUT_FILE "square.nc"

/* Write the G-code header — units and positioning mode */
void write_header(FILE *fp)
{
    fprintf(fp, "%%\n");
    fprintf(fp, "G21\n");   /* millimetres           */
    fprintf(fp, "G90\n");   /* absolute positioning  */
}

/* Rapid move — fast travel with waterjet OFF */
void rapid_to(FILE *fp, double x, double y)
{
    fprintf(fp, "G0 X%.3f Y%.3f\n", x, y);
}

/* Cutting move — slow travel with waterjet ON */
void cut_to(FILE *fp, double x, double y, int feedrate)
{
    fprintf(fp, "G1 X%.3f Y%.3f F%d\n", x, y, feedrate);
}

int main(void)
{
    FILE *fp = fopen(OUTPUT_FILE, "w");
    if (!fp) {
        fprintf(stderr, "Error: cannot create %s\n", OUTPUT_FILE);
        return 1;
    }

    /* Calculate the four corner coordinates */
    double x0 = START_X;
    double y0 = START_Y;
    double x1 = START_X + SIDE_MM;
    double y1 = START_Y + SIDE_MM;

    write_header(fp);

    /* Rapid to start corner — waterjet is still OFF */
    rapid_to(fp, x0, y0);

    fprintf(fp, "M7\n");   /* waterjet ON — starts cutting */

    /* Trace the four sides of the square */
    cut_to(fp, x1, y0, FEEDRATE);   /* → right side   */
    cut_to(fp, x1, y1, FEEDRATE);   /* ↑ top side     */
    cut_to(fp, x0, y1, FEEDRATE);   /* ← left side    */
    cut_to(fp, x0, y0, FEEDRATE);   /* ↓ close square */

    fprintf(fp, "M9\n");   /* waterjet OFF */

    rapid_to(fp, 0.0, 0.0);       /* return head to home position */
    fprintf(fp, "M30\n");  /* end of program */
    fprintf(fp, "%%\n");

    fclose(fp);

    printf("Written: %s\n", OUTPUT_FILE);
    printf("Square: %.0f x %.0f mm  start (%.0f, %.0f)  feedrate %d mm/min\n",
           SIDE_MM, SIDE_MM, START_X, START_Y, FEEDRATE);
    return 0;
}
What the coordinates mean

The square starts at (50, 50) mm from the machine origin. x1 = 50 + 100 = 150, so the four corners are (50,50) → (150,50) → (150,150) → (50,150) → (50,50). Changing SIDE_MM resizes the square; changing START_X / START_Y moves it to a different position on the material.

The G-code file this program generates looks like this:

square.nc — generated output
%
G21                         ; millimetres
G90                         ; absolute positioning
G0  X50.000  Y50.000        ; rapid to start corner
M7                          ; waterjet ON
G1  X150.000 Y50.000  F150  ; → cut right side
G1  X150.000 Y150.000 F150  ; ↑ cut top side
G1  X50.000  Y150.000 F150  ; ← cut left side
G1  X50.000  Y50.000  F150  ; ↓ close square
M9                          ; waterjet OFF
G0  X0.000   Y0.000         ; return to home
M30                         ; end of program
%
5

Compile and Run Your Program

Turn the C source code into a running program

Open a terminal in the same folder as square_cut.c and run:

Terminal
# Compile
gcc square_cut.c -o square_cut -lm

# Run it
./square_cut

You should see this printed to the screen:

Output
Written: square.nc
Square: 100 x 100 mm  start (50, 50)  feedrate 150 mm/min

A file called square.nc now exists in the same folder. You can open it in any text editor to inspect the G-code before loading it onto the machine.

Try It First
Paste the contents of square.nc into a free online G-code simulator such as ncviewer.com — it will draw the toolpath on screen so you can visually confirm the square looks right before touching any real machine.
6

Loading the Program onto the OMAX

Using IntelliMAX Make to run your G-code file

The OMAX 160X is controlled by a dedicated Windows PC running IntelliMAX Make software. Here is how to load and run your file:

  1. Copy square.nc to the OMAX controller PC (USB drive or network share).
  2. Open IntelliMAX Make.
  3. Go to File → Open and select your square.nc file.
  4. The software will display a preview of the cutting path. Confirm that the square shape and its position on screen match your expectations and fits within the material you have loaded.
  5. Set the material origin (X0, Y0) on the machine — this is where the (0,0) corner of your G-code will be. Your square starts at (50,50), so make sure there is at least 150mm of material from that point in both X and Y.
  6. With a trained operator present, press Run. The machine will execute the program.
Pierce Point
When the waterjet first turns on (M7), it drills a small lead-in hole in the material before moving. This is called the pierce point. For a clean square edge, some operators add a short lead-in line so the pierce happens just outside the finished square. Ask your OMAX operator about this for your specific material.
7

What to Try Next

Extend your C program to cut more complex shapes

Now that you can cut a square, here are natural next steps using the C skills from the main tutorial:

  • Cut a different size — change the SIDE_MM constant and recompile.
  • Cut a rectangle — add separate WIDTH_MM and HEIGHT_MM constants.
  • Cut multiple squares — use a for loop to call your cut_to() function in a pattern.
  • Cut a circle — use <math.h> with cos() and sin() to generate dozens of small G1 line segments that approximate a circle.
  • Accept input — use scanf() or command-line arguments (argc, argv) so the user can specify the size without editing the source code.
  • Cut a robot frame bracket — combine rectangles, holes, and mounting slots into one program.
C Concept Review
This project used: #define constants, FILE pointers and fopen/fprintf/fclose, functions with parameters, and arithmetic on double variables. All of these are covered in detail in the main C tutorial.