//UDP_Host networkHost; public IO_Manager(MainWindow form) { //use parent variable to change Main Form parent = form; //setup host //networkHost = new UDP_Host(); //networkHost.RegisterID(SampleMessage, "POST"); //networkHost.StartServer(); //Create Thread to get data ThreadStart thr = new ThreadStart(this.Process); oThread = new Thread(thr); try { Arduino = new SerialPort("COM5", 9600); Arduino.DataReceived += Arduino_DataReceived; Arduino.Open(); } catch { } //send function to lidar constructor to assign function to delegate l = new Lidar("COM6", 115200, this.DisplayLidarData); if (l.isOpen()) { parent.setLidarStatus("Close", "COM5", 115200); } else { parent.setLidarStatus("Open", "COM5", 115200); } //Create GPS object //gpsUnit = new GPS("COM7", 9600); controller = new Manual(); oThread.Start(); }