Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     myOPC.SetItemValue(PLCTagName.HPNum, HPNum.Value);
     myOPC.SetItemValue(PLCTagName.LedStat, OPCAPI.GetLedValue((int)LEDStart.Value, (int)LightNum.Value));
     string[] s = { PLCTagName.HPNum.ToString(), PLCTagName.LedStat.ToString() };
     myOPC.Write(s);
 }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var f       = new 设置();
            var setdata = new List <double>();

            setdata.Add(Convert.ToDouble(myOPC.Items[PLCTagName.TempSET1.ToString()].Value));
            setdata.Add(Convert.ToDouble(myOPC.Items[PLCTagName.TempSET2.ToString()].Value));
            setdata.Add(Convert.ToDouble(myOPC.Items[PLCTagName.HRSET1.ToString()].Value));
            setdata.Add(Convert.ToDouble(myOPC.Items[PLCTagName.HRSET2.ToString()].Value));
            setdata.Add(Convert.ToDouble(myOPC.Items[PLCTagName.CPSwapTime.ToString()].Value));
            f.setData       = setdata;
            f.StartPosition = FormStartPosition.CenterScreen;
            if (f.ShowDialog() == DialogResult.OK)
            {
                myOPC.SetItemValue(PLCTagName.TempSET1, setdata[0]);
                myOPC.SetItemValue(PLCTagName.TempSET2, setdata[1]);
                myOPC.SetItemValue(PLCTagName.HRSET1, setdata[2]);
                myOPC.SetItemValue(PLCTagName.HRSET2, setdata[3]);
                myOPC.SetItemValue(PLCTagName.CPSwapTime, setdata[4]);
                string[] s = { PLCTagName.TempSET1.ToString(),
                               PLCTagName.TempSET2.ToString(),
                               PLCTagName.HRSET1.ToString(),
                               PLCTagName.HRSET2.ToString(),
                               PLCTagName.CPSwapTime.ToString(), };
                myOPC.Write(s);
            }
        }