CNC Program Manager

A single-window WPF shop-floor app that sits next to a CNC machine and pulls up the right NC program (G-code), setup sheet, tool list, and clamp/part images for a given part number, then uploads the program to that machine. One instance runs per machine, pinned to a specific controller (Haas Mill, Haas Lathe, Mazak, or Waterjet).


Overview

PropertyValue
ProjectPSI.CNCProgramManager
Type.NET Framework 4.8 / WPF, single window (ShopFloor)
UI stackTelerik UI for WPF, MVVM Light Messenger, shared PSIToolBar
Primary data sourceCNC file shares (not AFTEC)
AFTEC usePeripheral only — employee list + saved window/broadcast settings via PSI Local Service (WCF)
SourceC:\GIT\PSI.All\PSI.CNCProgramManager\

Unlike most ProApps, CNC Program Manager’s core data lives on the MFG/CNC network shares, not in the AFTEC database. It only touches the WCF service to load employees and to persist per-user window layout and broadcast toggles.


The controller concept

Each installation is bound to one machine controller, read at startup from C:\Apps\CNCProgramManager.config:

Config valueController
HMHaas Mill
HLHaas Lathe
MZMazak
WJWaterjet

The controller drives nearly every branch in the app — which folders/extensions are searched, how setup and tools are parsed, whether HAAS tool-ID conversion runs, and where the program is uploaded. A missing or invalid config value warns the operator and closes the app.


Workflow: part → program → machine

  1. Part arrives — typed into the Part box, or received over the broadcast bus from Work Order Manager.
  2. Search — a background worker globs the CNC program shares for files matching the part number, filtered by controller, and lists them in the Program grid.
  3. Select — picking a program loads its:
    • G-code lines (editable),
    • Setup steps,
    • Tools (Tool ID, HAAS ID, description, length),
    • Clamp Locations and Part Rendering images (extracted from the part’s Excel report).
  4. Edit (optional) — the program and tool cells are editable in the grid.
  5. Upload To <controller> — for Haas the app first remaps standard tool IDs to HAAS tool numbers and rewrites subroutine/D-codes, then writes the program to the machine’s upload location.

File locations

PurposePath
CNC program files\\ad.ptihome.com\DFS\Data\Dept\MFG\CNC\Program Files\ (+ Haas\)
Excel setup/tool/image reports\\ad.ptihome.com\DFS\Data\Dept\MFG\CNC\XLS Reports\
CAM/CimCAD source\\ad.ptihome.com\DFS\CAD\CimCAD\cncfiles\cnc\, ...\camfiles\
HAAS tool-ID map\\ad.ptihome.com\DFS\Data\Dept\MFG\Haas\CNCTools-HAAS.csv
Local stagingC:\download\
Upload targetHaas/Mazak → E:\<file>; Waterjet → \\ad.ptihome.com\DFS\Data\UnixShare\cnc2\mstealth\<file>

Haas/Mazak uploads assume the machine’s E: drive is mapped to the controller.


Connection to Work Order Manager

There is no direct call between the two apps. They are coupled loosely, through the shared PSI broadcast bus (PSI.Common.Broadcast.BroadcastClient), exchanging a single part-number string.

Work Order Manager (Dispatch List / Shop Floor)
   operator selects a routing row
   → broadcasts BroadcastMessageType.ePartNo = part number
                       │
              (shared broadcast bus)
                       ▼
CNC Program Manager  (when its "Broadcast Receive" toggle is on)
   → sets the Part box → auto-loads that part's CNC programs
  • Work Order Manager emits ePartNo (along with eWONo, eProjectNo, etc.) whenever an operator selects a row in the Dispatch List or its Shop Floor view.
  • CNC Program Manager listens for ePartNo, ignores its own echoes (by message GUID), and runs the part lookup — but only when the toolbar “Broadcast Receive” toggle is enabled (default on, persisted per user).
  • The link is bidirectional: CNC Program Manager also broadcasts ePartNo on its own lookups (when “Broadcast Send” is on), so other listening apps follow along.

In practice: an operator clicks a work order in the Dispatch List and the CNC machine’s Program Manager instantly pulls up that part’s program — no re-typing. The two toolbar toggles let a station opt in or out of this auto-follow.

Limitation: the bridge carries only the part number — not the work order, operation, or routing line. CNC Program Manager has no knowledge of which WO/operation the operator is on, and does not validate that the received part is the one actually routed to this machine. The WO↔program association is the operator’s responsibility, not enforced by the system.


Notes / known rough edges

  • Hard-coded absolute paths — every share, the config path, E:\, and C:\download\ are string constants in ShopFloor.xaml.cs; a share move or unmapped E: breaks per-branch.
  • All logic in code-behindShopFloor.xaml.cs is ~3,250 lines with no view model; controller-specific branches are duplicated across search/load/upload.
  • HAAS tool map dependency — tool IDs missing from CNCTools-HAAS.csv are surfaced rather than silently dropped.


Last updated: June 2026