Ejemplo n.º 1
0
        private void btnReadParameters_Click(object sender, EventArgs e)//读取设备参数
        {
            if (btnStart.Enabled)
            {
                MessageBox.Show("服务未启动");
                return;
            }
            List <int> ids = new List <int>();

            string[] idArray = txtParamIds.Text.Split(',');
            foreach (string str in idArray)
            {
                try
                {
                    ids.Add(Convert.ToInt32(str));
                }
                catch
                { }
            }
            if (ids.Count >= 115)
            {
                MessageBox.Show("一次读取参数数量不能超过115个");
                return;
            }
            rsServer.CallParam(Convert.ToInt32(txtDeviceID.Text), ids);//读取设备参数
        }