static void Main(string[] args) { while (true) { var ip = Discovery.FindMonitor(); var monitor = new Monitor(ip); monitor.ValueReceived += Monitor_ValueReceived; monitor.Error += Monitor_Error; monitor.Read(); monitor.ValueReceived -= Monitor_ValueReceived; monitor.Error -= Monitor_Error; } }
private void WatchData() { Start = DateTime.Now.Millisecond; while (IsOpen) { var ip = Discovery.FindMonitor(); var monitor = new WSMonitor.Monitor(ip); monitor.ValueReceived += Monitor_ValueReceived; monitor.Error += Monitor_Error; monitor.Read(); monitor.ValueReceived -= Monitor_ValueReceived; monitor.Error -= Monitor_Error; } }