// Read serial port
        public static void Read()
        {
            byte   MsgByte;
            string MsgByteString = null;

            byte[] MsgPacketBuffer = new byte[65536];  // Reserve an array to store the max number of bytes possible in a frame


            while (ConsoleContinue)  // Loop until user wants to stop the program.
            {
                try
                {
                    MsgByte = (byte)SPort.ReadByte(); // Read a byte

                    MsgByteString += MsgByte.ToString("X");


                    // Save the packet to a text file.
                    using (System.IO.StreamWriter file = new System.IO.StreamWriter(@MsgFileName, true))
                    {
                        // Write the messsages to file, on hex or deciaml or both
                        // file.Write(SalDecPacketString);
                        file.Write(MsgByteString);
                    }
                    Console.WriteLine(MsgByteString);  // Display the raw message to the console
                }  //try
                catch (TimeoutException) { }
            }
        }