Exemplo n.º 1
0
        public static void TagTest()
        {
            String[] tags = { @"\mjdc\DCS2\TE_32254D_PV", @"\mjdc\DCS2\TE_32254E_PV", @"\mjdc\DCS2\TE_32254F_PV" };
            Dictionary <String, TagValue> lttvs = new Dictionary <String, TagValue>();

            foreach (String tag in tags)
            {
                lttvs.Add(tag.ToUpper(), new TagValue(tag.ToUpper()));
            }
            String      strError     = "";
            RTInterface RTDataAccess = DBAccess.GetRealTime();

            RTDataAccess.SetPointList(lttvs, out strError);
            if (!String.IsNullOrEmpty(strError))
            {
                Console.WriteLine(strError);
                Console.ReadLine();
            }
            RTDataAccess.GetSnapshotListData(ref lttvs, out strError);
            if (!String.IsNullOrEmpty(strError))
            {
                Console.WriteLine(strError);
                return;
            }
            foreach (String tag in lttvs.Keys)
            {
                Console.WriteLine(tag + "=" + lttvs[tag].TagSnapshot);
            }
            Console.ReadLine();
        }