コード例 #1
0
        public OPCItemState GetValue()
        {
            int[] handler = new int[1] {
                this.HandleServer
            };
            OPC.Data.OPCItemState[] itemValues = this.Group.Read(handler);

            if (itemValues == null || itemValues.Length == 0)
            {
                return(null);
            }

            OPC.Data.OPCItemState s = itemValues[0];
            if (HRESULTS.Succeeded(s.Error))
            {
                return(s);
            }
            else
            {
                throw (new Exception("ERROR 0x" + s.Error.ToString("X")));
            }
        }
コード例 #2
0
ファイル: ItemValue.cs プロジェクト: simpleway2016/SunRiz
 public ItemValue(string id, OPC.Data.OPCItemState value)
 {
     this.id    = id;
     this.value = value;
 }