public void readPortManagerBuffer(PortManager portManager, int counter, string[] hexaOutputString, string[] decimalOutputString, string[] binaryOutputString, string[] statusOutputString) { while (true) { string[] portManagerResponse = portManager.ReadPort(); if (portManagerResponse[0] != "" && portManagerResponse[1] != "" && portManagerResponse[2] != "" && portManagerResponse[3] != "") { hexaOutputString[counter] = portManagerResponse[0]; decimalOutputString[counter] = portManagerResponse[1]; binaryOutputString[counter] = portManagerResponse[2]; statusOutputString[counter] = portManagerResponse[3]; if (counter == 0 || (counter > 0 && hexaOutputString[counter - 1] != hexaOutputString[counter])) break; } Thread.Sleep(200); } }
private void readPortBuffer(PortManager portManager, int counter) { while (true) { string[] portManagerResponse = portManager.ReadPort(); if (portManagerResponse[0] != "" && portManagerResponse[1] != "" && portManagerResponse[2] != "" && portManagerResponse[3] != "") { string header = "\nResponse " + Convert.ToString(counter) + " -- "; hexaOutputString[counter] = header + portManagerResponse[0]; decimalOutputString[counter] = header + portManagerResponse[1]; binaryOutputString[counter] = header + portManagerResponse[2]; string status = "Response " + Convert.ToString(counter) + " -- "; statusOutputString[counter] = header + portManagerResponse[3] + ". "; break; } Thread.Sleep(200); } }