In CNC manufacturing, the difference between two versions of a program is rarely obvious from looking at the files side by side in a text editor.
A modified feedrate buried on line 847. A depth value that changed by 0.005 inches. A canned cycle parameter that someone adjusted at the machine control and never documented.
These are the kinds of changes that cause quality incidents, failed first articles, and scrapped parts, and they are exactly the kind of changes that are invisible unless you are specifically looking for them with the right tool.
CIMCO Edit File Compare is that tool.
It is a side-by-side diff engine built directly into the editor that understands NC code well enough to filter out the noise: block number differences, whitespace variations, comment formatting, leading zeros.
What remains after filtering is the signal, the changes which actually affect how the machine moves.
File Compare surfaces those changes instantly. It lets you step through them one by one, sync changes selectively in either direction, and save a record of the differences to a file.
Beyond its use as a standalone programmer tool, File Compare is embedded in the Import Queue workflows of both CIMCO NC-Base and CIMCO MDM. This is where it serves as the mechanism which lets a reviewer see exactly what changed between an approved program and the version that just came back from the floor.
This connection makes File Compare one of the most consequential features in the CIMCO ecosystem for shops where program integrity matters.
This article covers how File Compare works, how to configure it for the way your shop’s code is written, and how it functions inside NC-Base and MDM’s quality control workflows. If you would like to know more about CIMCO Edit as a whole, our CIMCO Edit product page covers the full feature set.
How File Compare Works
File Compare is accessed through the File Compare tab in the CIMCO Edit ribbon. There are three ways to initiate a comparison, each suited to a different situation.
1. Compare with Window compares the file in the currently active editor window against another file that is already open in the editor. When more than two files are open, CIMCO Edit prompts you to select which one to compare against. This is the fastest path when you already have both files open and want to compare them without navigating to the file system.
Once a comparison is initiated, CIMCO Edit splits the editor into two panes: the original file on the left and the comparison file on the right. Lines that differ between the two files are highlighted in both panes simultaneously, with the changed content marked at the character level. A line that is identical in both files displays normally. A line that exists in one file but not the other is shown with a placeholder in the pane where it is absent, keeping the visual alignment between corresponding sections of both files intact.
Navigation through differences uses Next Difference and Previous Difference in the Go To menu, or their keyboard shortcuts: Ctrl+Down and Ctrl+Up respectively. Go to First Difference and Go to Last Difference jump to the extremes of the comparison. These navigation tools are what make File Compare practical on large programs with hundreds or thousands of lines: finding the 12 changed lines in a 2,000-line program takes seconds rather than requiring a manual scroll through the entire file.
Syncing Changes Between Files
File Compare is not read-only. The Sync menu provides two commands that copy differences from one pane to the other: Sync Left copies the current difference from the right pane to the left and Sync Right copies from the left pane to the right. The keyboard shortcuts are Ctrl+Left and Ctrl+Right. Once a difference is synchronized, it is no longer highlighted because the content in both panes is now identical at that location.
The Jump to next difference after sync option in the File Compare Setup (covered in the next section) makes the sync workflow faster by automatically advancing to the next difference immediately after a sync operation. This lets a reviewer step through an entire comparison, accepting or rejecting each change, without manually navigating between each one.
The Single Step Through Differences option in the Other menu changes the granularity of the sync operation. By default, CIMCO Edit treats a block of consecutive changed lines as a single difference, which means syncing it copies all of them in one operation. With Single Step enabled, only the line where the cursor is positioned is synced, giving finer control over which specific changes are accepted when a block contains both wanted and unwanted modifications.
The Save Compare File option in the Other menu writes all lines containing differences to a plain text file. This is useful for documentation purposes: a record of what changed between two program versions can be saved alongside the job record, included in a quality audit trail, or sent to engineering for review.
Configuring File Compare for NC Code
The File Compare configuration settings are accessed through Editor Setup > File Type > File Compare. These settings are per file type, which means the comparison behavior for Fanuc G-code can be configured differently than for Heidenhain conversational or for plain text files. Before making any changes in this section, verify that the correct file type is selected at the top of the Editor Setup dialog.
Ignore Options
The Ignore options are where File Compare becomes genuinely useful for NC code rather than just a generic text comparison tool. Each setting filters out a category of difference that is present in the text of two files but does not represent a meaningful change to the program’s behavior.
- Ignore Block Numbers filters out N-word differences. This is the most commonly used ignore option in NC shops, because block numbers are frequently renumbered between versions without any change to the actual program content. With this option enabled, two programs that are identical except for their block numbering will show no differences in File Compare. Without it, every line would appear to differ.
- Ignore White Spaces filters out space and tab character differences. Some controls or post processors add trailing spaces; some do not. Some editors insert tabs; others use spaces. These differences are invisible when viewing a program but show up in a character-level diff. With this option enabled, they are filtered out.
- Ignore Comments filters out the content inside comment blocks, where the comment delimiters are defined in the Machine settings for the selected file type. This is the setting that prevents cosmetic comment changes, like an operator adding a note at the machine, from appearing as meaningful differences when the underlying code has not changed. For shops that embed metadata like dates or programmer names in comments, this option prevents that metadata from generating false positive differences.
- Ignore Case filters out differences between uppercase and lowercase characters. This matters for shops where programs are posted in uppercase and then modified at the control in a way that produces mixed case output.
- Ignore Numeric Format is the subtlest and often the most useful of the ignore options. It treats leading and trailing zeros as equivalent and ignores the presence or absence of a leading plus sign, so X+14.10 and X14.1 are treated as identical. This is essential for comparing programs from different sources, different post processors, or different control generations that handle numeric formatting differently. Without this option, two programs with functionally identical coordinate values can appear to differ on every coordinate line because of formatting conventions.
Display Options
- Show all differences (No editing) displays every line containing at least one difference simultaneously, with all differences highlighted at once. This is the right mode for a high-level review of the scope of changes before stepping through them individually. When this option is off, only the current difference is highlighted at a time.
- Mark Changes only limits the highlight to the specific characters that differ rather than the entire changed line. This makes individual character-level changes easier to spot in lines that are mostly identical except for one value.
- Use smart marking extends the highlight to cover the complete word or command that contains a change, rather than just the differing characters. This is useful when the difference is a single digit in the middle of a coordinate value: smart marking highlights the entire coordinate rather than just the changed digit, making the nature of the change immediately clear.
File Compare in the NC-Base Import Queue
When NC-Base is configured with DNC-Max auto receive, programs that come back from CNC machines are placed on the Import Queue rather than immediately overwriting the approved database version.
The Import Queue is the control point where a reviewer decides what happens to a returned program. File Compare is the tool that makes that decision informed rather than blind.
From the Import Queue view in the NC-Base Explorer, selecting a queued program and choosing Compare with Imported File opens CIMCO Edit’s File Compare directly, with the approved database version in one pane and the received file from the machine in the other. The same configuration settings apply: block numbers are ignored, numeric formatting is normalized, comments can be filtered.
What the reviewer sees is the functional difference between what was approved and what came back. This integration is significant because it closes the most dangerous information gap in the receive workflow.Â
Without File Compare, a reviewer accepting a file from the queue is making a binary decision based on the file name and the timestamp: this program came back from machine 6 at 2:47 PM, do I accept it?
With File Compare, the reviewer sees exactly what changed: the feedrate on line 412 was increased from F200 to F280, and nothing else differs. This is a meaningful data point. The reviewer can make a documented, informed decision rather than a hopeful one.
The comparison is also available outside the Import Queue context.
In the NC-Base Explorer’s Program menu, the Compare option opens File Compare for any two programs selected in the search results. This is how a programmer compares a current program against a prior version in the version history or compares two similar programs across machine groups when checking whether they have diverged from a common baseline.
If you would like to know more about NC-Base and how its Import Queue and version history work together, our CIMCO NC-Base product page covers the full picture.
File Compare in the CIMCO MDM Import Queue
MDM’s Import Queue serves the same fundamental purpose as NC-Base’s, but the review process is more deeply integrated into MDM’s status and workflow system.
When a program is received from a machine and placed on the Import Queue in MDM, reviewing it before acceptance involves opening the file in CIMCO Edit from within the MDM client.
File Compare is the natural tool for that review, and it operates exactly as it does in any other CIMCO Edit context. The received file and the current approved version are loaded side by side and the diff is run with whatever settings are configured for that file type.
The key difference from NC-Base is what happens after the review.
In NC-Base, accepting from the Import Queue is a single action. In MDM, accepting from the Import Queue can trigger a configured status change, update database fields based on prompts configured per level, and fire a workflow that notifies the engineering team, updates an ERP record, or executes an SQL query against an external system.
The File Compare review is the human step in an automated chain. The reviewer uses CIMCO Edit to see what changed, makes a judgment, and that judgment sets a larger automated process in motion.
MDM’s version system also supports comparison between historical revisions of a file.
Because MDM maintains every revision of every file at configured levels, a programmer can open any two revisions of an NC program in CIMCO Edit and run a File Compare between them. These could be a current and prior version, two versions separated by several months, or a version that predates a specific process change.
The combination of MDM’s revision storage and CIMCO Edit’s File Compare creates a complete, inspectable change history for every program in the database.
If you would like to know more about how MDM manages revisions, workflows, and the Import Queue, our CIMCO MDM product page goes into the full detail.
Practical Application: What to Compare and When
The most impactful use of File Compare in day-to-day shop operations falls into three categories.
The first is Import Queue review, covered above, where File Compare is the mechanism that makes the receive workflow a genuine quality control step rather than a formality.
The second is revision comparison during problem investigation. When a part that has been running cleanly starts producing out-of-tolerance results, the first question is what changed in the program. With CIMCO Edit’s File Compare, comparing the version currently approved in NC-Base or MDM against the prior revision takes seconds. The diff shows exactly what changed, when, and if log prompts are configured in NC-Base, the comment the programmer entered at the time of the change. Problems that would otherwise require a time-consuming code audit become immediately traceable.
The third is cross-machine program validation. Shops that run the same part on multiple machines often maintain separate program variants for each machine, adapted for different offsets, different tooling, or different work coordinates. Over time these variants drift. Using File Compare to compare the Fanuc VMC version against the Okuma VMC version of the same part program identifies exactly where the intentional differences are and whether any unintentional ones have crept in.
Getting the Most Out of File Compare
The single most impactful configuration step for most shops is enabling Ignore Block Numbers and Ignore Numeric Format simultaneously.
These two settings eliminate the most common sources of false positives in NC code comparison. The ones that make reviewers tune out because they are seeing dozens of flagged differences which do not represent real changes.
With these two settings enabled, the differences which remain in a comparison are overwhelmingly the ones that actually matter.
The file type configuration is worth revisiting if your shop runs programs from multiple control types.
Because File Compare settings are per file type, the comparison behavior for a Fanuc file type can be tuned independently of a Heidenhain file type. This is important because the comment delimiters, block number formats, and numeric conventions differ significantly between control families.
Configuring Ignore Comments requires the correct comment delimiters to be set in the Machine settings for each file type. So verify those are correct before relying on comment filtering in a comparison.
One honest limitation worth stating is File Compare operates on the text content of NC files.
It does not interpret the semantic meaning of G-code. A change from G01 to G00 on a cutting move is flagged as a difference, but File Compare does not know that one is a cutting feed and the other is a rapid.
The reviewer has to understand the code well enough to know whether a flagged difference is significant. File Compare finds the changes. It takes a programmer to evaluate them.
Just Ask Us
If you have questions about configuring File Compare for specific file types in your installation, or want to discuss how the Import Queue workflows in NC-Base or MDM are configured to make best use of it, contact us.