Ejemplo n.º 1
0
        private void ButAlpha_Click(object sender, EventArgs e)
        {
            var r = new SourceReader();

            r.RunSource("AlphaRegulSource", "Source", "DataSource=PostgreSQL35W;SERVER=localhost;PORT=5432;DATABASE=postgres;UID=postgres;PWD=1");
            r.ClearSignals();
            r.AddSignal("NR_T4.AI1.AI01.OUT.VALUE", "действ", "nodeid=130");
            r.ReadValues(new DateTime(2020, 7, 3, 18, 30, 0));
            r.ReadValues(new DateTime(2020, 7, 3, 18, 50, 0));
            r.Close();
        }
Ejemplo n.º 2
0
        private void ButSourceReader_Click(object sender, EventArgs e)
        {
            var r = new SourceReader();

            r.RunSource("KosmotronikaRetroSource", "Source", "RetroServerName=RetroServerM");
            MessageBox.Show(r.SourceBegin.ToString() + " - " + r.SourceEnd.ToString());
            r.ClearSignals();
            r.AddSignal("K1HHG01CP003XQ01.1_Пар", "действ", "NumType=1;NumOut=1;Appartment=0;SysNum=10028;");
            //r.ReadValues(r.SourceBegin.AddHours(5));
            string s = "";

            for (int i = 0; i < 100; i++)
            {
                r.ReadValues(DateTime.Now);
                s += r.RealValue("K1HHG01CP003XQ01.1_Пар") + "  ";
                Thread.Sleep(10);
            }
            MessageBox.Show(s);
            r.Close();
        }