public DataValue GetRemoteDataValue(DaValue localValue, TypeInfo remoteType)
{
DataValue remoteValue = new DataValue();
remoteValue.SourceTimestamp = localValue.Timestamp;
if (localValue.Error < 0)
{
throw ComUtils.CreateComException(localValue.Error);
}
remoteValue.StatusCode = ComUtils.GetHdaQualityCode(localValue.HdaQuality);
try
{
remoteValue.WrappedValue = GetRemoteValue(new Variant(localValue.Value), remoteType);
}
catch (Exception e)
{
throw ComUtils.CreateComException(e, ResultIds.E_BADTYPE);
}
return remoteValue;
}