using Mesnac.Action.Base; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using Timer = System.Windows.Forms.Timer; namespace Mesnac.Action.ChemicalWeighing.LjDeliverControlBoard { public class InitAction : ChemicalWeighingAction, IAction { Timer timer; public void Run(RuntimeParameter runtime) { RunIni(runtime); timer = new Timer(); timer.Interval = 1000; timer.Enabled = true; timer.Tick += GetPlcValue;//添加事件 } private void GetPlcValue(object sender, EventArgs e) { } } }