This highly configurable Haas machine monitoring driver enables to acquire machine-, process- and quality data from machines with Haas Next (NGC) or Standard Generation Controls (SGC) via Ethernet. Acquired data can be output in near real time to various SQL Databases, MTConnect or OPC UA.
For bidirectional communication between machines with Haas controllers connected to CNCnetPDM and your applications you can use our free Open Source Client (C-Sharp)
You can dynamically define your own set of items (up to 35) that can be enabled and disabled on a per machine basis by an INI file that is automatically created with reasonable default values for each machine configured. This INI file also allows to define individual names for every tag.
Note: Newer Haas NGC controls (build year > 2016) may be equipped with an MTConnect Adapter. In this case you can alternatively use our MTConnect Agent program to test access to the device and our MTConnect device driver for monitoring.
Download the Haas driver and extract haas.dll into the folder where you have CNCnetPDM installed.
Edit CNCnetPDM.ini and add a new device as described in the quick start guide point 7. If you already have an entry in section [RS232] for a device you can simply copy and paste this line and change its content. Change the line as follows:
FIG 1: Configure Haas device driver in CNCnetPDM.ini
For machines with Haas controllers the following 2 parameters are important
Right to the IP Address of the controller (here 192.168.1.152) enter the TCP port number (1) used for communication, default 5051.
Change the driver name to haas.dll (2)
Start CNCnetPDM, foreground program is sufficient (Start thread)
CNCnetPDM automatically copies the original haas.dll and appends the machine number as configured in the INI file, e.g. haas_1000.dll for machine number 1000.
In addition an INI file with the same name is automatically created by the device driver, e.g. haas_1000.ini for machine number 1000.
Double click CNCnetControl, if your device number is 1000 and the device name is HAAS VF-2 #1 the output should be similar to the one below:
FIG 2: CNCnetControl (Haas)
Here the machine (1) shows up as connected (2) which is good. On the right side (3) you see the acquired data. With a free license you just get E = OEE machine state output, see Licensing for details.
For example the line starting with O contains items defined in the INI file of the device that should be output to section 1. If you didn’t change the INI file you get something like the following:
1000 10/01/2022 11:36:09 AM 10000000268 O STATN| 5| STATT| Error| MODEN| 2| MODET| JOG| PRGSN| 2| PRGST| FAULT| TOOLN| 29|
All acquired items have a tag name followed by its tag value. Names and values are delimited by pipe ‘|’ symbols. This allows CNCnetPDM to create a database record, MTConnect or OPC UA output for every item.
With an unmodified Haas INI file the initial configured and activated tags are:
OEE Device state (numeric)
OEE Device state (text)
Device mode (number)
Device mode (text)
Program state (number)
Program state (text)
Name of the active program (if any)
Part counter value
M30 part counter #1
M30 part counter #2)
Tool number in use
Tool changes (total)
Motion time (total)
Last cycle time
Previous cycle time
Spindle speed RPM
Actual cycle time
Cycle start time
FIG 3: Ids, names, description and initial activation state of acquired items
This device driver enables to dynamically add, group, enable or disable items and change their names. The INI file automatically created by the device driver for every machine contains sections that allow you to control its behavior.
Commands defines the number of commands you’d like to use for reading, maximum value = 35, default 18
Items for reading are organized in numeric sections e.g. . Every section contains entries where you can define names and parameters for a specific item.
Description of the numeric sections:
Section identifier, numbers from 1 to 35 are queried when reading
If you set this to 0 the command is not executed to read data from the control.
A short tag name (max 5 characters) to describe the item e.g. STATN for status number
A comment that describes the command (optional)
Command to be executed e.g. cnc_oeestatus for the command group that contains running status. To change a command you can select an available command, copy it and paste it into the INI file section
Input parameter 1
For reading System and Macro Variables this parameter has to be set to the number of the variable. For command Q500 this parameter has to be set to 1,2 or 3
Input parameter 2
Optional, not used by the current driver (default = -1)
Some commands have sub-commands that allow to define a specific item to be output by the driver e.g. statenumber from cnc_oeestate outputs the device state
You can output data to 3 sections that may contain up to 256 characters. 1 goes to section ‘O’, 2 to ‘A’ and 3 to ‘F’. If data in one section exceeds the maximum length you can send items to a different section. Make sure you have entries CollectOrders, CollectFeeder and CollectQuality enabled (=1) in CNCnetPDM.ini
FIG 4: Description of a device INI file section
Note: To change commands, switch items on or off or alter its name while CNCnetPDM is running open the device INI file with a text editor, make the desired changes and save the file. To apply the changes immediately you can click on the machine in CNCnetControl on the left side followed by clicking buttons ‘Close’ and ‘Open’ above the section ‘Devices’.
Below you can find commands that require an output item:
Numeric OEE state of the machine (2 = producing, 3 = manual, 4 = interrupted, 5 = error)
State of the device as text (producing, manual, interrupted, error)
Numeric running mode of the controller (0 = MDI, 1 = MEM, 2 = JOG, 3 = LIST PROG, 4 = DNC, 5 = ZERO, 6 = UNDEFINED)
FIG 5: Description of available commands that require an output item
Commands that do not require an output item:
Machine Serial Number
Control Software Version
Machine Model Number
Machine Mode (LIST PROG, MDI, etc.)
Tool Changes (total)
Tool Number in use
Power-on Time (total)
Motion Time (total)
Last Cycle Time
Previous Cycle Time
M30 Parts Counter #1
M30 Parts Counter #2
NC Program, input parameter 1 = 1
Q500 requires input parameter 1 to be set to 1,2 or 3 otherwise the command is not executed and you get an error output!
Machine State, input parameter 1 = 2
Parts Count, input parameter 1 = 3
System or Macro Variable value
Q600 requires input parameter 1 to be set to the variable number to be queried. Valid numbers are 1 to 9031 (SGC) or 1 to 52800 (NGC). For details see Haas System and Macro Variables
FIG 6: Description of Haas Q commands
If you want to add additional items (up to 35 in total) first adjust the number of commands in section [GENERAL]. Then, copy and paste a complete INI file section and adjust the section number and its content.
This device driver requires the most recent version of CNCnetPDM and also works with a free license. However, in this mode output is limited to the OEE machine state of your device. With a valid license you are able to output the result of up to 35 queries per reading cycle, see licensing for details.
The device driver writes a log file entry for any communication issue to the log file of the device. The file can be found in subdirectory \log of your CNCnetPDM program folder. The file format for the log file is log_ + device number + _ + date.txt. Please check this file first if you observe an issue. Deactivate commands with issues by setting them to ‘Active = 0’.
If the machine shows a red icon, state disconnected and you get just output E = 0 the machine is not reachable at all. This has nothing to do with CNCnetPDM, it’s a network issue, DNS Hostname or IP Address is wrong.
If the machine shows a green icon, state connected but you just get output E = 1 the machine is reachable (can be ‘pinged’) but the controller does not respond to commands, check your controller setup and the parameters used in CNCnetPDM.ini (esp. port number).Please use the tool HaasData to check if the machine replies to commands.
If you get numeric device states but not any of the preconfigured items please make sure that entries CollectOrders, CollectQuality and CollectFeeder are set to 1 in section [General] of CNCnetPDM.ini.
If specific items are not acquired check first with HaasData that you get output. Also make sure that the numeric section of the item in the device drivers INI file is activated and has an entry for ‘Name’, inactive or items with empty names are not acquired. Also check that you didn’t misspell entries for command and output item in your device driver INI file.
If you already have a previous version of the driver installed and would like to upgrade to the most recent version proceed as follows:
Stop any CNCnetPDM background service or foreground program that uses the device driver.
Extract haas.dll from haas_dll.zip into the folder where you have CNCnetPDM installed, overwrite the existing file.
Delete ALL haas_XXXX.dll (NNNN = machine number) files.
If you already have created adapted INI files for specific devices do NOT delete the haas_NNNN.ini files.
After restarting CNCnetPDM upgraded device driver versions for all machines are automatically created.