Exemple #1
0
    public static void ThreadReadProcess()
    {
        COMPort cp = new COMPort("COM2");

        cp.Open();
        while (true)
        {
            Thread.Sleep(100);
            if (cp.Read() > 0)
            {
                Console.WriteLine(System.Text.Encoding.ASCII.GetString(cp.getBuffer()));
            }
        }
    }