An M18 sensor is marked 7 mm. The flag passes about 5 mm from its face. It switches with an iron test plate, but misses the aluminum flag. Replacing it with a 14 mm sensor may sound like the quickest fix. The longer-range model also changes how much metal you can leave around the sensing face.
Selection takes three checks: the target material and dimensions, the largest actual face-to-target gap, and the clearance around the sensor itself. The Omron E2E family gives a useful comparison because it includes both shielded and unshielded M18 models with the same thread size.1
Compare the setting distance before comparing the thread
Omron lists the pre-wired E2E-X7D1-N as a shielded M18 DC two-wire sensor and the E2E-X14MD1 as an unshielded M18 DC two-wire sensor. The drawings show the different shapes of the sensing ends. Both have an M18 × 1 thread.1

| Model | Rated sensing distance | Omron setting distance | Standard iron target |
|---|---|---|---|
| E2E-X7D1-N, shielded M18 | 7 mm ±10% | 0–5.6 mm | 18 × 18 × 1 mm |
| E2E-X14MD1, unshielded M18 | 14 mm ±10% | 0–11.2 mm | 30 × 30 × 1 mm |
The rated distance describes switching with the specified reference target under the catalog test conditions. Use the setting distance for the installed starting point, then check whether the real target supports that distance. The two rows use different iron plates. Neither row gives an assured installation distance for aluminum.1
Read the curve for the actual target
Omron plots the effect of both target material and side length. On each chart, the horizontal axis is the side length of a square target, the vertical axis is distance from the sensing face, and the target is 1 mm thick. The two plots use different vertical scales. Follow the axis values when comparing them.1

For a 30 × 30 × 1 mm aluminum flag, the E2E-X7D curve is a little above 3 mm. The E2E-X14MD curve is around 5 mm. These are approximate readings from the plots. A machine that needs to detect that flag at a 5 mm gap already exceeds the first reading and sits close to the second. That leaves little room for bracket variation or motion. Before selecting either, reduce the gap, change the flag, or evaluate a model with documented performance for that target.1
For a flag that sweeps sideways across the face, also check where the output changes along the travel path. A static axial check can miss a short detection window caused by limited overlap. Use the manufacturer's sensing-area plots and confirm the actual approach on the machine.1
Check where the bracket ends relative to the sensing face
A shielded sensor controls the field around the side of its head so it can be mounted flush in a suitable metal bracket under the manufacturer's conditions. The field of a conventional unshielded sensor extends further sideways. A steel bracket close to that face can affect switching before the target even arrives. Flush and non-flush describe the allowed placement of surrounding metal relative to the active end.2

Use the sketch that matches the fixture. In Omron's M18 two-wire table, the shielded row lists l = 0 mm and d = 18 mm. The unshielded row lists l = 22 mm and d = 70 mm. The first sketch shows l from the front of the mounting metal to the sensor face. The second shows d as the diameter around the sensing end for the inset arrangement. If the fixture has a recess or opposing metal, read its relevant dimensions in the accompanying sketches as well. The 70 mm clearance dimension is separate from the ordinary mounting hole for the M18 threaded body.1
Measure the target gap from the actual sensing face after the bracket position is set. Moving the sensor forward to clear its bracket changes that gap. Check the smallest gap for mechanical contact and the largest gap for missed detection, including movement, vibration or play in the mechanism. Verify the output clears again when the flag leaves. A reliable ON point and a reliable release point both matter.
For a replacement, record the full part number, target material and size, minimum and maximum gap, and how the head sits relative to nearby metal. Once the mechanical check passes, verify the electrical connection with the proximity switch wiring guide. For an existing machine where the sensor and controller disagree, follow the target-to-input test sequence.
