Hi
is there a method to get the UIValue based on the actual
value read in the meter?
for example, I have a GXDLMSData that has a custom
attributesettings that defines GXObisValueItem like
for example:
GXObisValue Value is 1 and UIValue is Reset
right now I am manually matching them
GXDLMSAttributeSettings atbr = dataobj.Attributes[1];
if (atbr.Values.Count > 0)
{
foreach (GXObisValueItem val in atbr.Values)
{
if (dataobj.Value != null &&
int.TryParse(dataobj.Value.ToString(), out int parsedValue) &&
val.Value == parsedValue)
{
Value = val.UIValue; break;
}
}
}
else
{
Value = dataobj.Value?.ToString();
}
the issue is when there are alot more attributes with
custom ui value and if the object with custom UI value
is captured by a ProfileGeneric object
How can I update the buffer to show the UI values
instead of the value from the meter
Forums
Hi, Set the UI data type…
Hi,
Set the UI data type like this:
dataobj.SetUIDataType(2, DataType.DateTime);
Then the data type is correct when you ask for the value like this;
dataobj.Value.ToString();
BR,
Mikko
Hi Mikko I tried …
Hi Mikko
I tried
dataobj.SetUIDataType(2, DataType.None);
Value = dataobj.Value.ToString(); // for debugging
I also tried setting the datatype to uint16
but the value is still the value read from the meter
this is the xml
<GXObisCode>
<LogicalName>0.0.96.11.0.255</LogicalName>
<Description>Meter Event</Description>
<Interface>Data</Interface>
<ObjectType>1</ObjectType>
<Attributes>
<GXDLMSAttributeSettings>
<Name>Event code</Name>
<Index>2</Index>
<Type>UInt16</Type>
<Access>1</Access>
<Access3>0</Access3>
<Values>
<GXObisValueItem>
<Value>1</Value>
<UIValue>Reset</UIValue>
</GXObisValueItem>
<GXObisValueItem>
<Value>2</Value>
<UIValue>Power Up</UIValue>
</GXObisValueItem>
<GXObisValueItem>
<Value>4</Value>
<UIValue>DST</UIValue>
</GXObisValueItem>
<GXObisValueItem>
<Value>8</Value>
<UIValue>Push</UIValue>
</GXObisValueItem>
<GXObisValueItem>
<Value>16</Value>
<UIValue>Auto Connect</UIValue>
</GXObisValueItem>
<GXObisValueItem>
<Value>32</Value>
<UIValue>Password changed</UIValue>
</GXObisValueItem>
<GXObisValueItem>
<Value>64</Value>
<UIValue>Wrong password</UIValue>
</GXObisValueItem>
<GXObisValueItem>
<Value>128</Value>
<UIValue>Output relay state</UIValue>
</GXObisValueItem>
<GXObisValueItem>
<Value>256</Value>
<UIValue>Global meter reset</UIValue>
</GXObisValueItem>
</Values>
<UIValueType>3</UIValueType>
<AccessSelector>0</AccessSelector>
</GXDLMSAttributeSettings>
</Attributes>
</GXObisCode>
Is it possible to get the UIvalue directly from the dataObject? This object is a CaptureObject of a profile generic and the buffer shows the integers instead of the UI value
GXDirector shows the uivalue properly both in the dataobject and in the profilegeneric buffer
Edit:
Also now for some reason instead of Meter Event, the attribute name is just the default which is Value T.T
Hi, With some objects, like…
Hi,
With some objects, like clock, it's possible to get the UI data type from the object.
If you want to show value as double and not integer, you need to read or set the scaler for the register object.
BR,
Mikko