User unit in mappView

I am trying to show var with my unit on mappView (Numeric output widget). But I don’t find any way, how to show unit from another namespace then OPC-UA. I am already using my units on side of PLC (it’s for dividing) and on HMI I show unit from OPC-UA namespace. But now I need to show unit price per kWh (CZK/kWh) and when I asign this unit, it’s ignoring on panel.

I attach the definition unit in unit system.

Screenshot 08-15-2024 17.56.35

Hi Jan,

You’re on the right track, but there are a few extra steps to make your custom unit display on a mappView visualization.

  1. Define your unit in the User Units file (as you’ve done)
  2. Add a “Translation formulas” configuration to the UnitSystem package in the Configuration View. This is where you will define the conversion from kWh to CZK/kWh
  3. Configure a unit for your process variable in the OpcUa Default View file. This is the unit that is used within your program for all calculations, which sounds like kWh in your case. You can do this by selecting the “Engineering Unit” section of the Properties, then adding a unit from the Toolbox
  4. Bind the process variable to the HMI widget using a node binding. This is important as the OpcUa value itself doesn’t have any unit data so you need to include the entire node
    image
  5. Add your unit to the widget using the Unit property. Use the Namespace dropdown to select the custom units namespace. Then you can select your custom unit and the correct translation formula
    image
3 Likes

I think if @NovotnyJ doesn’t need any unit translation he has only to set the unit in widget as Marcus described in step 5.

It’s also possible to set user units to opc ua nodes:

@Simon_Stoll

I do all steps allready, but the unit doesn’t show :frowning: But I try to add textconfig and Project.language, rebuild project and now it show unit. Thanks for help :slight_smile:

2 Likes