Click here to Skip to main content
15,921,622 members
Home / Discussions / C#
   

C#

 
GeneralRe: COM port send/receive Pin
PIEBALDconsult8-Apr-10 17:13
mvePIEBALDconsult8-Apr-10 17:13 
GeneralRe: COM port send/receive Pin
mprice2149-Apr-10 2:25
mprice2149-Apr-10 2:25 
GeneralRe: COM port send/receive Pin
PIEBALDconsult9-Apr-10 3:22
mvePIEBALDconsult9-Apr-10 3:22 
GeneralRe: COM port send/receive Pin
mprice2149-Apr-10 3:46
mprice2149-Apr-10 3:46 
GeneralRe: COM port send/receive Pin
PIEBALDconsult9-Apr-10 4:09
mvePIEBALDconsult9-Apr-10 4:09 
AnswerRe: COM port send/receive Pin
Rajesh Anuhya9-Apr-10 2:36
professionalRajesh Anuhya9-Apr-10 2:36 
GeneralRe: COM port send/receive Pin
mprice21412-Apr-10 4:42
mprice21412-Apr-10 4:42 
GeneralRe: COM port send/receive Pin
mprice21412-Apr-10 7:51
mprice21412-Apr-10 7:51 
Here is what I have:

private void DisplayText(object sender, EventArgs e)
{

    textBox1.Text = RxString;
    serialPort1.DiscardInBuffer();
    while (serialPort1.BytesToRead == 0)

        serialPort1.WriteLine("*X01\r");


}

private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
    RxString = "";


    try
    {
        RxString = serialPort1.ReadTo("\r");

    }
    catch (Exception Exception)
    {
        return;
    }

    this.Invoke(new EventHandler(DisplayText));
}

private void textBox1_TextChanged(object sender, EventArgs e)
{

}

private void timer1_Tick(object sender, EventArgs e)
{
    //timer1.Interval = 50;
    //if (!serialPort1.IsOpen) return;
    //serialPort1.WriteLine("*X01\r");
}


I want to get rid of the timer and have a while loop that writes the ("*X01\r") once the buffer is empty. Then I won't need the timer. However, I can't get a while loop to work.
QuestionC# : Dispaly data in paragraph format Pin
Member 34895988-Apr-10 2:55
Member 34895988-Apr-10 2:55 
AnswerRe: C# : Dispaly data in paragraph format Pin
Abhinav S8-Apr-10 3:29
Abhinav S8-Apr-10 3:29 
QuestionGetting strings and ints of another class Pin
BuggingMe8-Apr-10 2:15
BuggingMe8-Apr-10 2:15 
AnswerRe: Getting strings and ints of another class Pin
Sunil Scaria8-Apr-10 2:43
Sunil Scaria8-Apr-10 2:43 
AnswerRe: Getting strings and ints of another class Pin
Arun Jacob8-Apr-10 2:48
Arun Jacob8-Apr-10 2:48 
GeneralRe: Getting strings and ints of another class Pin
BuggingMe8-Apr-10 2:52
BuggingMe8-Apr-10 2:52 
GeneralRe: Getting strings and ints of another class Pin
Sunil Scaria8-Apr-10 2:58
Sunil Scaria8-Apr-10 2:58 
AnswerRe: Getting strings and ints of another class Pin
Arun Jacob8-Apr-10 3:12
Arun Jacob8-Apr-10 3:12 
GeneralRe: Getting strings and ints of another class Pin
BuggingMe8-Apr-10 3:30
BuggingMe8-Apr-10 3:30 
QuestionSafe handle has been closed appears on program exit Pin
yeah10008-Apr-10 2:00
yeah10008-Apr-10 2:00 
AnswerRe: Safe handle has been closed appears on program exit Pin
Alan N8-Apr-10 4:35
Alan N8-Apr-10 4:35 
AnswerRe: Safe handle has been closed appears on program exit Pin
supercat98-Apr-10 9:30
supercat98-Apr-10 9:30 
GeneralVirus removal tool (Team Project). Pin
MS-EULA8-Apr-10 1:31
MS-EULA8-Apr-10 1:31 
GeneralTo Up Pin
MS-EULA9-Apr-10 2:01
MS-EULA9-Apr-10 2:01 
Questionopen an exe file in panel Pin
MarziehA8-Apr-10 0:34
MarziehA8-Apr-10 0:34 
AnswerRe: open an exe file in panel Pin
Eddy Vluggen8-Apr-10 6:14
professionalEddy Vluggen8-Apr-10 6:14 
QuestionLimitations of windows forms Pin
QuinsUK8-Apr-10 0:17
QuinsUK8-Apr-10 0:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.