Fix a WebVisu file that will not send after compile

7 min read · Published November 2, 2026

The login message means the compile never created the file. A visualization named COM2 cannot produce COM2.xml, because COM2 with any extension is a reserved Windows device name, so the build writes nothing and login has nothing to send. Rename the visualization to COM_2, rebuild, and confirm the XML appears in the compile directory before you touch transfer settings.

When online login reports that the file COM2.xml could not be sent, the transfer is not the fault: the compile never wrote the file. The engineering tool runs on Windows, and there COM2 with any extension is a reserved device name, so the build cannot create COM2.xml in the compile directory and login has nothing to send. One reported case says it exactly: a visualization called COM2 produced no COM2.xml, and the rename to COM_2 let generation and login succeed. This page gives the checks in order, the names that fail, and the steps that close the fix.

Why does login say the COM2.xml file could not be sent?

Because the compile never created that file. The engineering PC runs Windows, COM2 with any extension is a reserved device name there, so the build cannot write COM2.xml, and the login step then reports it cannot send a file that was never on disk. Two stages produce a WebVisu. The compile turns each visualization into an XML file in the compile directory on the engineering PC. The login copies those files to the runtime. The message names the file and prints the full path where it expected to find it, and that path is your first diagnostic: open it. On a healthy build the directory holds one XML per visualization; with the name COM2 in the project, that one artifact is missing while every other screen built normally.

Is COM2 a reserved word in the visualization editor?

No. The editor accepts the name, the project saves, and the failure appears one layer down, when the build turns the visualization into a file on disk; no editor check catches it first. No list of reserved visualization names is published for the development tool; the list that decides this failure is the operating system's device-name reservation, which the editor never consults. A name that saves cleanly is still unsafe when its base name is a device identifier. That is why the fault reads like a communications problem: it appears at login, seconds after a clean compile, on a screen named after a port.

Is the failure in the compile or in the transfer?

Check the compile directory the message prints: when the named XML is missing, the build never wrote it and the name is the suspect; when the file is there, work the transfer side instead.

  • No COM2.xml in the compile directory, no build error. Generation wrote nothing for that one screen. Rename the visualization and rebuild; the compile finished clean, so the controller was never the problem.
  • The XML exists and login still refuses to send it. Generation is done; the transfer is the fault. Confirm you are logged in to the target you built for, then repeat the login after a clean build.
  • Login is clean and the browser shows the previous screen. The browser is serving a cached copy. Force a reload with Ctrl+F5 and confirm the XML in the compile directory changed with this build.
  • The screen loads and one image point stays blank. That is rendering, downstream of the file. See fix a dashboard image point that will not display.
  • The screen loads with a message that it will automatically restart. A runtime fault after the file arrived. Read the controller log and fix the fault it names; this wording appears after the file reached the runtime, so the download is done and the fault is on the controller side.

Which visualization names are unsafe to build?

Any name whose base name is a Windows device identifier: CON, PRN, AUX, NUL, COM1 through COM9, and LPT1 through LPT9, matched without regard to case, with or without a file extension.

Unsafe base name Why it fails Safe form that builds
COM2 Device name; COM2.xml resolves to the port COM_2
COM1 through COM9 Same reservation, all nine ports port_4, COM3_line
LPT1 through LPT9 Printer device names LPT_1
CON, PRN, AUX, NUL Console and device names con_screen, aux2

The safe form needs one character the reservation cannot swallow: an underscore or a letter inside the base name. COM_2.xml is 9 characters against 8 for COM2.xml, and that one character is the whole difference between a file that exists and one that cannot.

Recommendation: keep port identifiers out of visualization names from the start. If a screen configures COM2, call it COM_2 or scale_port, and add the device-name check to your naming convention, because the editor will accept the bad name and only the build will refuse it.

How do I rename the visualization and confirm the file sends?

Rename the object, rebuild, and check the compile directory for the new XML before you log in: five steps, and the send error disappears as soon as the file exists on disk.

  1. Rename the visualization object from COM2 to COM_2. Nothing else in the project changes.
  2. Rebuild. The compile writes one XML per visualization again.
  3. Open the compile directory printed in the old login message and confirm COM_2.xml is present.
  4. Log in online. The message about a file that could not be sent is gone.
  5. Open the WebVisu in the browser, force one reload with Ctrl+F5, and read one live value against its PLC variable to confirm the screen is bound, not just drawn.

If operators run the line from this screen, do the rename and the download between cycles: a view that fails halfway through a cycle is worse than the error you are chasing.

What does the worked example look like start to finish?

A station with 14 screens, one named COM2 for a scale port, builds 14 XML files where it should build 15; after one rename and one rebuild the count is 15 and login sends cleanly.

The station PC runs the development tool on Windows. The build finishes with no error. The compile directory holds 14 XML files, one per visualization, and COM2.xml is absent. Online login answers: "The file COM2.xml could not be sent".

The rename: COM2 becomes COM_2. The object name grows from 4 characters to 5, and the artifact name from 8 characters to 9. Rebuild: the compile directory now holds 15 XML files, COM_2.xml among them. Login sends it. The browser, reloaded with Ctrl+F5, draws the screen, and the scale weight in the corner tracks its variable.

Then the floor check: the screen hangs 10 ft from the operator walkway. Fast reading wants 20 ft of distance per inch of capital height, so 10 ft / 20 ft per inch = 0.5 in capitals on alarm text, with line spacing at 1.7 x 0.5 in = 0.85 in. The station sets its alarm lines to 0.5 in caps on that pitch and the fix is closed.

The file sends now. Why does the browser still misbehave?

Because the remaining faults sit after the download: a cached copy keeps the old screen, an embedded browser can render black, and a file-transfer button has its own switch; each has its own fix.

  • Old screen after a rebuild. Confirm the XML in the compile directory changed with this build, then force the browser to drop its copy with Ctrl+F5.
  • Black screen in the embedded browser. See fix an embedded browser editor black screen.
  • A file-transfer button reports the file is not available. That is the file-transfer dialog, which is not possible by default in a WebVisu and has to be activated in the visualization input configuration; move the file another way if you cannot switch it on.
  • The screen draws but values are blank. The binding between element and variable, downstream of everything above. Check the variable name on the element and that the variable holds a value at runtime.
  • The serial port behind the screen then faults. See fix CODESYS COM.Open error 5004 on a serial port.

How big should the text be for the operator's distance?

Plan 30 ft of viewing distance per inch of capital height (the FHWA planning figure) and use 20 ft per inch where an operator must read fast; set line spacing at 1.7 times the capital height.

Distance Cap height at 30 ft per inch Cap height at 20 ft per inch, fast reading
6 ft 0.2 in 0.3 in
10 ft 0.33 in 0.5 in
20 ft 0.67 in 1.0 in

A WebVisu screen usually sits at machine distance, 6 to 10 ft, so its alarm text wants 0.3 to 0.5 in capitals. When you also want shift messages that live through a network outage, put them on a separate offline board that plays from a microSD card, with the player software included and no subscription; live factory data display: signage or dashboard walks that choice, and the shop-floor screens pages cover what those boards handle on the floor.

Questions

Can the PLC variable behind the screen still be called COM2?

Yes. The collision is in the generated file name, so only objects that become a file with that base name fail to build. Keep the variable, the port configuration and the electrical documentation as they are, and change only the visualization object name.

Does anything besides the visualization name have to change?

No. Rename, rebuild, and let the compiler list anything that still references the old name; fix what it reports. Transfer settings, target configuration and PLC code stay untouched, and the visualization opens by its new name wherever it was opened before.

The browser keeps showing the old screen after the rebuild. What clears it?

A forced reload. Press Ctrl+F5 so the browser drops the cached XML and asks the runtime for the new file. If the old screen survives even that, the login sent an earlier build: repeat the login and read the messages it prints before you change anything else.

Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.

Keep reading

Build your signAsk for a quote