Exemplo 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 3
0
 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();
 }