示例#1
0
 // Token: 0x0600067D RID: 1661 RVA: 0x00010EB2 File Offset: 0x0000FEB2
 public ItemValueResult(ItemValueResult item) : base(item)
 {
     if (item != null)
     {
         this.ResultID       = item.ResultID;
         this.DiagnosticInfo = item.DiagnosticInfo;
     }
 }
示例#2
0
        /// <summary>
        /// Assitant function to translate the "result" into "Quality" string, "Good" or "Bad"
        /// </summary>
        /// <param name="result"></param>
        /// <returns></returns>
        public static string ResultToString(Opc.Da.ItemValueResult result)
        {
            var qb = qualityBits.bad;

            if (result.QualitySpecified && result.Quality == Quality.Good)
            {
                qb = result.Quality.QualityBits;
            }
            return(Opc.Convert.ToString(qb));
        }
        /// <summary>
        /// 자기 자신에게 쓰이는 데이터 교환
        /// </summary>
        public void SelfDataExchange()
        {
            OPCSubscription selfRead = null;

            for (int subi = 0; subi < this.ReadSubscriptions.Count; subi++)
            {
                if (this.ReadSubscriptions[subi].Type == 2)
                {
                    selfRead = this.ReadSubscriptions[subi];
                    break;
                }
            }

            OPCSubscription selfWrite = null;

            for (int subi = 0; subi < this.WriteSubscriptions.Count; subi++)
            {
                if (this.WriteSubscriptions[subi].Type == 2)
                {
                    selfWrite = this.WriteSubscriptions[subi];
                    break;
                }
            }

            //올바른 데이터 그룹이라면.
            if (selfRead != null && selfWrite != null)
            {
                //읽기
                selfRead.ItemValues = selfRead.Subscription.Read(selfRead.Subscription.Items);

                List <Opc.Da.ItemValue> values = new List <ItemValue>();

                for (int i = 0; i < selfRead.ItemValues.Length; i++)
                {
                    Opc.Da.Item            item = selfWrite.Subscription.Items[i];
                    Opc.Da.ItemValueResult ivr  = selfRead.ItemValues[i];

                    System.Type wt = selfWrite.ItemTypes[i];
                    System.Type rt = selfRead.ItemTypes[i];

                    object value = ivr.Value;
                    if (wt != rt)
                    {
                        value = Activator.CreateInstance(wt);
                    }

                    values.Add(new ItemValue(item)
                    {
                        Value = value
                    });
                }
                selfWrite.ItemValues = selfRead.ItemValues;
                selfWrite.Subscription.Write(values.ToArray());
            }
        }
示例#4
0
        private void MonitorData(MonitoredMeasurement measurement, OpcDa.ItemValueResult p)
        {
            OpcMetric metric = new OpcMetric()
            {
                Timestamp   = p.Timestamp,
                OpcValue    = p.Value,
                Opcstatus   = p.ResultID.ToString(),
                Measurement = (MeasurementDto)measurement
            };

            l_metricCollection.Add(metric);
        }
示例#5
0
        public void HandleRTU1data(Opc.Da.ItemValueResult value)
        {
            switch (value.ItemName.Substring(6, 2))
            {
            case "PM":
                UpdatePMResourceData(value, RTU1.powermeterdata);
                break;

            case "DP":
                UpdateDPResourceData(value, RTU1.dprdata);
                break;

            case "ND":
                UpdateNDResourceData(value, RTU1.networkdata);
                break;

            case "CD":
                UpdateCDResourceData(value, RTU1.cpudata);
                break;

            case "MD":
                UpdateMDResourceData(value, RTU1.moduleInfo);
                break;

            case "MM":
                UpdateMMResourceData(value, RTU1.modbusmoduleinfo);
                break;

            case "CS":
                UpdateCSResourceData(value, RTU1.ccrstatus, RTU1.textout);
                break;

            case "AS":
                UpdateASResourceData(value, RTU1.alarmsummary);
                break;

            case "AH":
                UpdateAHResourceData(value, RTU1.alarmhistory);
                break;

            case "CF":
                UpdateCFResourceData(value, RTU1.configuration);
                break;

            default:
                OPCObjList.Insert(8, value);
                break;
            }
        }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemValueArgs"/> class.
 /// </summary>
 /// <param name="value">The value of the process data to be be provided to all subscribers of the <see cref="I4UAServer.OnValueChanged"/>.</param>
 public ItemValueArgs(Opc.Da.ItemValueResult value)
 {
     Value = value;
 }