static void Start_Reading(LookupTable Lookup, ComPort Reader1) { List<Tag> Tags; ConsoleKeyInfo key; Distancing Dist = new Distancing(LookupTable.DistanceType.DFT,Lookup); int iter = 0; while (true) { iter++; List<Tag> ListRead = new List<Tag>(); int read = 0; while(ListRead.Count < Iterations) { //Seach for tags with RSSI Tags = Inventory.StartTagInventory(Reader1); //if more then 1 tag found and does not contain SHIT //Then we read the tag and increment Read if (Tags.Count > 0) if (!Tags[0].ID.Contains("SHIT")) { ListRead.Add(Tags[0]); Console.WriteLine("I:{0}, Q:{1}", Tags[0].I, Tags[0].Q); } //Sleep thread to get accurate measurements each time //Has to be adjusted so we do not overflow the reader // Console.WriteLine("Attempt:{0}",iter); //System.Threading.Thread.Sleep(SleepTimer); } //Calc Distances Console.WriteLine("Start Distancing:"); List<int> Distances = Dist.Find_Distance(ListRead); //If Count is greater then 0 then it knows where to be if (Distances.Count > 0) //If only one distance comes back then we know where we should be if (Distances.Count == 1) Console.WriteLine("Tag is at Distance of: {0}", Distances[0]); else { //We have multiple places we could be. Console.WriteLine("Multiple Distances:"); foreach (int Dis in Distances) Console.WriteLine("Distance of: {0}", Dis); } else Console.WriteLine("Cannot Determine what the Distance is."); Console.WriteLine("Exit press 'x' Key"); key = Console.ReadKey(true); if (key.KeyChar == 'x') { //Initialization.PowerOFF(Reader1); Reader1.Close(); Console.WriteLine("Antenna Powered OFF"); Console.ReadLine(); return; } else { //continue; Console.WriteLine("Start Reading:"); } } }