UniLogic Begin Is Missing Error Clears After Save and Reopen

Claire Rousseau7 min read
HMI ProgrammingOther ManufacturerTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

On UniLogic 1.34.192, the compile error Error in Rung ID ###, Message = "Begin" is missing reproduces with one sequence: delete a rung, restore it with Ctrl+Z, then disable it. To clear the error and keep the rung disabled, save the project, close it, reopen it, and compile again. Re-enabling the rung also clears the error, but the rung then runs, which may not be what you want. The same release also has a C editor that can mis-parse function code and a Save-As to USB that can end early without writing the file. Check the save path first, because both compile fixes depend on a save that actually reaches disk.

Symptom triage for UniLogic compile and save failures

Match what you see to a branch before you change anything in the project.

Symptom Observed trigger Go to
Save-As animation runs for about 25% of its normal duration; no file appears on the USB stick Save-As to a 16 GB FAT32 USB stick that is known to work Save integrity check (run first in every case)
"Begin" is missing on compile A rung was deleted, restored with Ctrl+Z, then disabled. The error was also seen after disabling rung 1 in Region 1 of a function. Begin-missing branch
A C function throws compile errors on code that should compile; after you reopen the tab, the code looks parsed incorrectly A variable was added to the C function, then the project was compiled C function branch

Save integrity before any close-and-reopen

Closing the project throws away everything held in memory. If the last save did not reach disk, the reopen that fixes the compile error will also erase your work. In one reported case, a Save-As to USB aborted, then Ctrl+S and a restart, and the project reopened with none of the session's changes.

  1. Read the path of the open project. Before you press Ctrl+S, look at where UniLogic says the project lives. After a Save-As attempt, the session can end up pointing at the Save-As target instead of the original file. In that case Ctrl+S writes to the new target, or writes nothing, while the original file keeps its old revision. Confirmed when: you know which file Ctrl+S will write to.
  2. Save to a local drive. Use Save-As to a local folder with a new file name. Do not save directly to removable media. Confirmed when: the file shows in Explorer with a modified time equal to the save time and a size close to the previous revision.
  3. Treat a short save animation as a failed save. If the progress animation ends well before its usual length, keep UniLogic open. Save again to a local path and repeat step 2.
  4. Copy to USB only after the local file checks out. Copy it in Explorer, then compare the file size on the stick with the local file.
  5. If changes are already lost: UniLogic makes a backup before each save. Look for the backup copy in the project's folder. Copy it to another location before you open it, then open the copy. If you open the backup in place and save, you overwrite the only good revision.

Move on to a compile branch only once step 2 passes.

Begin-missing branch: rung state after undo and disable

The ladder compiler treats each rung as a bounded block. A disabled rung still has to be emitted with matching begin and end boundaries so the compiler can skip it. When you undo a rung delete, the editor rebuilds that rung in memory from its undo history, not from the project file. If you then disable that restored rung, the block it produces can be missing its opening boundary, and the compiler reports "Begin" is missing against that rung ID. Saving writes the rung to the file. Reopening rebuilds the rung from the file, which removes the stale in-memory state. That is why the error clears after a save and reopen, while recompiling in the same session does not clear it.

Decision path:

  1. Read the edit history for the flagged rung ID. If the rung was deleted and restored with Ctrl+Z, or restored by any other undo, before you disabled it, go to the resolving procedure below.
  2. No undo in the history (for example, you only disabled rung 1 of Region 1 in a function): use the same resolving procedure. That case could not be reproduced afterward, and it clears the same way.
  3. Error still present after save, reopen, and compile: the rung stored in the file is malformed. Delete the rung and rebuild it by hand, without undo. Save, reopen, and compile. Send the exact keystroke sequence to Unitronics support so they can reproduce it.

C function branch: editor buffer mis-parse

Unitronics has acknowledged issues in the UniLogic C editor, with fixes planned for later releases. Diagnose it this way: close the C function tab and open it again. If the code on screen differs from what you typed (tokens moved, lines merged or split), the editor's buffer is corrupted. Your source code is fine.

Do not fix the errors one at a time. Each hand correction followed by a compile produced a new set of parse errors. The cycle below compiled cleanly:

  1. Copy the entire function body to an external text editor and keep that copy as the reference.
  2. Delete all code in the C function.
  3. Save the project and confirm the save using the save integrity check.
  4. Close the C function tab.
  5. Open the C function again. Confirmed when: the body is empty.
  6. Paste the code back from the external copy.
  7. Save the project.
  8. Compile. Confirmed when: the C function reports no errors.
  9. Close and reopen the tab once more, and compare the code on screen with the external copy. Confirmed when: they match line for line.

Resolving procedure and controller verification

Prerequisite: the save integrity check passed, and you know the path of the open project.

  1. Leave the flagged rung disabled. Re-enable it only if you actually want it to execute. Confirmed when: the rung shows as disabled in the editor.
  2. Save with Ctrl+S. Confirmed when: the file's modified time in Explorer matches the time you saved.
  3. Close the project.
  4. Reopen the project from the local path. Confirmed when: the rung you disabled is still disabled and your recent edits are there.
  5. Compile. Confirmed when: the build finishes without "Begin" is missing.
  6. Avoid the trigger from now on. After using Ctrl+Z to restore a rung, save and reopen before you disable it. If you are restructuring several regions, save and reopen after each undo-heavy stretch of editing, not just once at the end.
  7. Download and go online. Download the project to the controller and monitor the function that contains the disabled rung.
  8. Verify the disabled rung does nothing. Make the disabled rung's input conditions true. Confirmed when: the rung's outputs and destination tags keep their previous values, and the enabled rungs on either side run normally.

FAQ

Does the UniLogic "Begin" is missing error mean my ladder logic is corrupted?

Usually not. It comes from the rung's in-memory state after you undo a delete and then disable the rung. Save, close, reopen, and compile to clear it. Rebuild the rung by hand only if the error comes back after a reopen.

Can I keep the rung disabled after fixing the Begin missing error?

Yes. Save the project with the rung disabled, close it, reopen it, and compile. The rung stays disabled and the build completes without the error.

Does UniLogic keep a backup when I save a project?

Yes. UniLogic makes a backup before each save. If a failed save loses your changes, find the backup in the project folder, copy it elsewhere, and open the copy.

Can I save a UniLogic project directly to a USB stick?

Save to a local drive first, check the file's modified time and size, then copy it to USB in Explorer. A Save-As straight to a 16 GB FAT32 stick has ended early without writing the file.

Can I fix UniLogic C function parse errors by editing the flagged lines?

Usually not, because editing the flagged lines just produces new parse errors. Copy the code out, clear the function, save, close and reopen the tab, paste the code back, save, and compile. Then reopen the tab and confirm the code matches your external copy.

Back to blog