I have an HW input UINT that represents tenths of mm. This means for example the input is 115 (UINT) and physical value in NumericOutput should be 11,5 mm. The unit system in mappView knows mm as MMT from http://www.opcfoundation.org/UA/units/un/cefact. I defined according AS help my own user unit called 1/10 millimetre.
UserUnitTest.zip (99.3 KB) sample project in AS4.12.8 and using MV5.24. Tested wtih MV5.21.0 as well and no problem. Hoping my sample will help, otherwise share with me your code (only user unit and simple task please).
Hello!
I don’t want to question your approach, but wouldn’t it be better to use micrometers, or write decimal numbers using the REAL data type? I think that would look better!
the mappView system offers OPC UA. This technology can carry units information. It can save to spend new REAL variable in PLC. Why I should to create new variable, if there is system posibility to display the number in correct way? I did it as a temporary solution. But I would like to know, how to use this future.
Agree with you. There is no need to use REAL. Have you reviewed my sample? Is it working for you now? If not, please share with me your reduced project (only variable and unit configuration) and I will check it for you. I’m sure it is something small. Using units in AS is quite simple.