I am trying to implement metric to imperial unit conversion in my MappView HMI application. When operator selects Imperial from MeasurementSystemSelector widget, all length values should convert from mm to inch with correct converted values (e.g. 100mm should display as 3.937 inch, not 100 inch).
What I Have Configured
1. OPC UA Engineering Unit
- Variable:
::HSVis:strVisSetVal.strFormat.rLengthMM - Engineering Unit: millimetre, Unit ID: 5066068
2. UnitSystem Translation formula
- Input: millimetre (5066068)
- Output: inch (4804168)
- Formula: m × Input + n, m=0.03937, n=0.0
3. Config_11.mpcomunit (MpLink: gGroup)
- Datapoint 1 → variable mapped
- Metric → MMT, Translation: empty
- Imperial → INH, Translation: UnitTranslation
- ImperialUS → INH, Translation: UnitTranslation
4. MappView NumericInput widget
value : opcUa()::HSVis:strVisSetVal.strFormat.rLengthMM
unit : {'metric':'MMT','imperial':'INH','imperial-us':'INH'}
5. MeasurementSystemSelector widget
selectedValue binding: opcUa()::AsGlobalPV:gMeasurementSystem
The Problem
When I search for MpComUnit FB and MpComUnitConfig data type in my project, they do not exist in my MpCom library.
My MpCom.fun only contains:
MpComConfigManagerMpComLoggerUIMpComLinkMpComLinkToParentMpComDumpMpComGetLink
MpComUnit and MpComUnitConfig are completely missing.
What I Need to Know
- Whether
MpComUnitFB call is mandatory or optional - Which mapp version to update to get
MpComUnit - Whether widget-level unit property works standalone without
MpComUnit - Correct binding path for
MeasurementSystemSelector