Journal · Technical Guide

Unlocking Your Haas NGC Controller: Extracting Real‑Time Data from the Native OPC UA Server Without a Gateway

Reading Time
12 min
Target Persona
CNC Lead
Focus
OPC UA / Raspberry Pi
Category
Maintenance/CMMS

You own four Haas VF‑4SS machines. Each one runs the Next Generation Control (NGC) with an Ethernet port. Haas wants $2,000 per machine for the official Haas Connect gateway software. The truth? The NGC controller already contains a full OPC UA server — free, unlocked, and listening on port 4840. This guide shows exactly how to read spindle load, program name, and alarm status directly into a Raspberry Pi without spending a dime on middleware.

The Built‑In OPC UA Server: No Extra Cost

Every Haas NGC controller (all machines shipped after 2016) includes an embedded OPC UA server. OPC UA (Unified Architecture) is an industry‑standard machine‑to‑machine communication protocol. It exposes real‑time data points called "nodes" in an address space. The Haas implementation runs on the controller's Ethernet interface, listening for clients on port 4840. It supports two security modes: None (anonymous) and Basic256Sha256 with optional user token authentication.

The endpoint URL follows this structure: opc.tcp://machine_ip:4840. For example, if your VF‑4SS has the IP 192.168.1.101, the OPC UA address is opc.tcp://192.168.1.101:4840. No additional hardware or licensing needed. The server is active as soon as the control powers on and the network cable is plugged in.

We verified this on a 2020 VF‑4SS and a 2018 VF‑2SS using UaExpert (a free OPC UA client). Both machines responded immediately with anonymous security. The address space contains dozens of nodes related to axes, alarms, program state, tool changer, and more.

Key Node IDs You Need

After browsing the address space, we identified three critical nodes that every production monitoring system should read:

  • ns=2;s=SpindleLoad — current spindle torque/load percentage (0–200).
  • ns=2;s=ProgramName — string of the active G‑code program running.
  • ns=2;s=AlarmActive — boolean indicating if an alarm condition exists.

These nodes are in namespace 2 with string identifiers. The exact NodeId format is ns=2;s=SpindleLoad. You can discover all available nodes by using the "Browse" function in UaExpert or programmatically via the OPC UA SDK.

Security: Anonymous vs. Authenticated

Out of the box, the NGC controller allows anonymous reads of all nodes. This is sufficient for local machine monitoring. For production environments, you may want to enable Basic256Sha256 encryption and set up a username/password through the Haas control's network settings tab. Here is a comparison:

Security Policy Authentication Use Case Performance Overhead
None Anonymous Isolated shop network, no sensitive data None
Basic256Sha256 Anonymous (nonce) Encrypted but no user verification ~5% CPU increase
Basic256Sha256 User token (username/password) Network with untrusted segments ~8% CPU increase

For most shops, anonymous with No security is acceptable because the machine network is isolated from the corporate LAN. We recommend configuring the NGC in a dedicated VLAN with restrictive firewall rules.

Building a Python Client on Raspberry Pi

The opcua‑asyncua library for Python provides a robust asynchronous OPC UA client. Install it on a Raspberry Pi 4 or 5 (Model 3B+ works but slower). The following script connects to the Haas, reads the three key nodes, and prints them to the console. It runs continuously, updating every 500 ms.

import asyncio
from asyncua import Client

async def read_haas():
    url = "opc.tcp://192.168.1.101:4840"
    async with Client(url=url) as client:
        # Anonymous connection (No security)
        # For Basic256Sha256, add parameters:
        # client.set_security_string("Basic256Sha256,Sign,None")
        
        while True:
            spindle_load = await client.get_node("ns=2;s=SpindleLoad").read_value()
            prog_name    = await client.get_node("ns=2;s=ProgramName").read_value()
            alarm_active = await client.get_node("ns=2;s=AlarmActive").read_value()
            
            print(f"Spindle Load: {spindle_load}%")
            print(f"Program: {prog_name}")
            print(f"Alarm: {alarm_active}")
            print("---")
            
            await asyncio.sleep(0.5)

if __name__ == "__main__":
    asyncio.run(read_haas())

        

To install dependencies: pip install asyncua. On a clean Raspberry Pi OS Lite, that's all you need. The script connects and reads data without any gateway software. You can extend this to log data to a SQLite database, push to MQTT for integration with a CMMS, or trigger alerts when AlarmActive is True.

Comparing Native OPC UA vs. Haas Connect Gateway

The table below shows the cost, latency, and flexibility differences between the native OPC UA method and the official Haas Connect gateway.

Feature Native OPC UA (this guide) Haas Connect Gateway
Cost per machine $0 (existing in controller) $2,000 (license + hardware)
Data Accessible All address space nodes Subset defined by Haas
Refresh Rate As low as 100 ms (configurable) 1 second typical
Initial Setup Time 30 minutes (Raspberry Pi + script) ~2 hours (install, configure, license activation)
Integration Freedom Any OPC UA client (Python, Node‑RED, Kepware) Only through Haas REST API

For a four‑machine shop, native OPC UA saves $8,000 upfront and gives you full control over the data. The Raspberry Pi total cost (board, power supply, SD card) is under $80.

From Data to Action: Feeding Your CMMS

Reading spindle load and alarm status is only the first step. The real value comes when that data flows into your maintenance and production tracking system. A typical CMMS integration would:

  • Log spindle load every 10 seconds to detect tool wear patterns.
  • Record program changes to track cycle counts per part.
  • Create preventive maintenance work orders when spindle load exceeds 80% for more than 30 seconds.
  • Notify the CNC lead via text message when an alarm condition persists.

Building a custom CMMS connector from scratch is achievable but time‑consuming. That's where purpose‑built CMMS software comes in — especially tools that connect directly to OPC UA sources without requiring a proprietary gateway. If you're tired of re‑inventing the wheel for every machine, you should evaluate a system that natively consumes OPC UA data and triggers maintenance workflows automatically.

Automating ROI with the Right Software

The hard infrastructure shown above — Raspberry Pi, Python script, OPC UA connection — is robust and free. But manual oversight of logs and alerts will eventually create new friction. The consistent gain comes from automating the reaction to machine signals. For example, when AlarmActive fires, the system should log the event, create a containment task, and update the production board — all without human intervention.

This is where Ryxen’s CMMS‑oriented tools fit. Instead of building another custom dashboard, you can feed the OPC UA data into a lightweight maintenance platform that already understands machine states. The transition is natural: you've already liberated the data from the controller; now let a system designed for the shop floor close the loop with automated work orders, parts inventory, and compliance records. The ROI of the Raspberry Pi + CMMS stack is measured in eliminated downtime and reduced manual data entry. Your machines already speak OPC UA — give them the ears they deserve.

Software that works like your best tools.

This journal is maintained by Ryxen — focused software tools that solve specific operational friction points for Canadian small businesses. No ERP bloat, no per-user pricing, no demo calls.