"Unit database not found" problem

Hello,
a long-time working unit system has started to show error -1070584246 (after a routine SW update, not related to visualization or the unit system).
obrázok
As a result, all affected numeric values are distorted (‘XX’ is shown).

The unit and formula objects are on the target system, and the unit texts are part of the text configuration file. The defined units are part of a custom unit catalog.

Can anyone help with how to handle the unit database?
Thank you
Regards
Michal Malek

If your claim is right, clean the configuration, rebuild all, and transfer.

Hi Jaroslav,
that was my first action, but it didn’t produce any results. Here, however, I don’t understand some basic terms. What is the “unit database”? Is it the init system file of the “.units” type? And what about the namespace related to that database? The ASCII data contains its ID, but -1 doesn’t seem to be correct.
Michal Malek

The picture you have attached is very small. I cannot read it. Please attach a larger picture as well as a printscreen from the logger. I’m sure there are also some errors or warnings.

Hi Jaroslav,
you are right—there are warnings related to broken unit conversion (from visu). These are the logs from all objects from the very top of the table:

.
But maybe the clue is in the following picture:

Here, the “unit database already exists” log appears just after the project installation, but I have no idea where the duplication comes from.
Thank you.
Regards,.
Thank you
Regards
Michal Malek

I think we are close:


Error -2144326067: Unit database already exists

This is a Warning from the Automation Runtime Unit system.

Description: The unit database for a namespace exists more than once (duplicate namespace detected).

Runtime Reaction: The existing unit database with the same namespace is overwritten.

Cause & Fix: Two or more unit databases are using the same namespace. Assign a unique namespace to each unit database to resolve the conflict.

:open_book: Official Documentation

1 Like

I’ve read that description. I understand that there are:

Do you have user unit configuration files? I understand it like that..but this is something what must be checked in your project.


AI generated:

Resolution steps:

  1. Open the .units file in Configuration View (UnitSystem object in AS)

  2. Check the Namespace attribute — if it’s http://www.br-automation.com/units, that’s the conflict (it matches the B&R built-in)

  3. Assign a unique namespace, e.g. http://yourcompany.com/units/custom

  4. Update the TMX file — in the Logical View, open the corresponding Unit Texts .tmx file and update the <header><ns ...> namespace to match the new one

  5. Clean + Rebuild All + Transfer

Hello,
of course, I have — just like in all my projects. I checked it, and everywhere I’ve used the default namespace successfully. This project has been running at the customer’s site for about two years.
obrázok
(I know, the names are confusing :-)).
Michal Malek

So you are using the same namespace inside these two files? And when you rename one of them, is it fixed? I do not believe in miracles that something was working and, without changes, after two years it suddenly stops working :slight_smile: There must be something behind—a small change or update.

Hi @Michal_Malek , please try changing the namespace of the Custom Unit to something other than “http://www.br-automation.com/units”, such as e.g.: “http://www.br-automation.com/CustomUnits”, in the .units configuration file.

  • Note that you will now need to delete and re-add the custom unit to any OPC UA nodes you have it attributed to. Check and make sure that the namespace matches the new one you have defined.

  • You also should check if you are using the variable with the unit attached in any places in your Visualization (e.g. mapp View). If so, you need to update the Namespace to the new unit space.

The reason is that the default unit namespace for custom units (http://www.br-automation.com/units) is used by certain internal processes, and that in some cases, especially with custom unit translations, there can be some conflicts with those processed. For this reason, it is recommended to use a separate unique namespace.

1 Like

Me neither. I’m just trying to understand something I used automatically, without thinking about it.

A direct switch of namespaces caused a “total crash”: C80 fell into N/A mode (something I had never seen before), as did the simulation.

So I decided to remove both unit system files and start again, gradually adding files and elements, all within the simulation.

Findings:

  • User units can be added and used (in translation formulas (TF), visualization, etc.).
  • However, when used in translation formulas, there are some restrictions, and only two user units actually took effect (I know, it sounds strange).
  • Changes (in TF or user units) only took effect after a clean configuration.
  • After all this work, I tried these changes on the real C80, but the same “Unit database not found” error as before occurred—not four times, but dozens—so all the work was useless.
  • This appears to be the result of a single translation formula with no unit file defined (namespace http://www.opcfoundation.org/UA/units/un/cefact is used).

obrázok

So I have completely abandoned the unit system in this project as no namespace is allowed
Michal Malek

Hi Michal, I am sorry you are having these issues. if you send us your project, we can have a look to see what may be causing this problem. For more in-depth support, I would recommend reaching out to your local B&R Support office and opening a CASE to continue the investigation.

This sounds really strange. We have tried to help as much as we could. Now we are in situation that we can not help you without the project and deeper investigation. Please get in touch with the local support office and, if possible, inform us what was the real cause of your issue.

1 Like

Hi,
I appreciate your support, but the project is already running on the customer’s side and there is no room for deeper investigation. I removed the unit system completely and replaced the translation formulas with expressions on the mappview side.

Thank you.
Regards
Michal Malek

This is also solution and even if I do not like it I understand it :slight_smile: