Opc.Ua.Com.Server.ComNamespaceMapper.GetRemoteDataValue C# (CSharp) Méthode

GetRemoteDataValue() public méthode

Gets the remote data value.
Thrown if a conversion error occurs.
public GetRemoteDataValue ( DaValue localValue, TypeInfo remoteType ) : DataValue
localValue DaValue The local value.
remoteType TypeInfo The remote data type.
Résultat DataValue
        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;
        }