示例#1
0
文件: Monitor.cs 项目: tcjcq/MyGitHub
 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);
 }
示例#2
0
 public void Set料斗和指示灯(byte 料斗号, int LedStart, int LedCount)
 {
     SetItemValue(PLCTagName.HPNum, 料斗号);
     SetItemValue(PLCTagName.LedStat, OPCAPI.GetLedValue(LedStart, LedCount));
     string[] s = { PLCTagName.HPNum.ToString(), PLCTagName.LedStat.ToString() };
     Write(s);
 }
示例#3
0
文件: Monitor.cs 项目: tcjcq/MyGitHub
 private void Monitor_Load(object sender, EventArgs e)
 {
     myOPC                = new OPCAPI();
     myOPC.UpdateRate     = 1000;
     myOPC.ReadCompleted += MyOPC_ReadCompleted;
     if (ItemIDs != null)
     {
         myOPC.SetItemIDs(ItemIDs);
     }
     try {
         myOPC.InitOPC();
     } catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
     DrawLed(0);
     Panel.CheckForIllegalCrossThreadCalls         = false;
     NumericUpDown.CheckForIllegalCrossThreadCalls = false;
     button1.Select();
 }