using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Windows.Forms; namespace M423project { public partial class FormPlcOperation : Form { private OPC _opc; public FormPlcOperation(OPC opc) { InitializeComponent(); _opc = opc; object result = new object(); _opc.ReadOneItem_Wrapper(OPCOutputTag.PingbiGuangShan, ref result); cbPingbiGuangshan.Checked = result != null && (bool)result ? true : false; _opc.ReadOneItem_Wrapper(OPCOutputTag.PingbiSafeGuard, ref result); cbPingbiSafeGuard.Checked = result != null && (bool)result ? true : false; } private void cbLoadRbtAlarm_CheckedChanged(object sender, EventArgs e) { _opc.Write(OPCOutputTag.LoadRbtAlarm, cbLoadRbtAlarm.Checked); cbLoadRbtAlarm.Checked = false; } private void cbUnloadRbtAlarm_CheckedChanged(object sender, EventArgs e) { _opc.Write(OPCOutputTag.UnloadRbtAlarm, cbUnloadRbtAlarm.Checked); cbUnloadRbtAlarm.Checked = false; } private void btnCloseAlarm_Click(object sender, EventArgs e) { _opc.Write(OPCOutputTag.CloseAlarm, true); } private void btnTailingEmpty_Click(object sender, EventArgs e) { _opc.Write(OPCOutputTag.TailingEmpty, true); Thread.Sleep(500); _opc.Write(OPCOutputTag.TailingEmpty, false); Thread.Sleep(10); } private void cbPingbiGuangshan_CheckedChanged(object sender, EventArgs e) { _opc.Write(OPCOutputTag.PingbiGuangShan, cbPingbiGuangshan.Checked); } private void cbPingbiSafeGuard_CheckedChanged(object sender, EventArgs e) { _opc.Write(OPCOutputTag.PingbiSafeGuard, cbPingbiSafeGuard.Checked); } } }