Click here to Skip to main content
15,901,505 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help with C# Pin
OriginalGriff12-Mar-10 0:59
mveOriginalGriff12-Mar-10 0:59 
GeneralRe: Help with C# Pin
riced12-Mar-10 4:42
riced12-Mar-10 4:42 
GeneralRe: Help with C# Pin
OriginalGriff12-Mar-10 4:53
mveOriginalGriff12-Mar-10 4:53 
GeneralUnivoter strikes! Pin
OriginalGriff12-Mar-10 5:35
mveOriginalGriff12-Mar-10 5:35 
GeneralRe: Univoter strikes! Pin
harold aptroot12-Mar-10 8:11
harold aptroot12-Mar-10 8:11 
GeneralRe: Univoter strikes! Pin
riced12-Mar-10 13:31
riced12-Mar-10 13:31 
GeneralRe: Univoter strikes! Pin
OriginalGriff12-Mar-10 21:59
mveOriginalGriff12-Mar-10 21:59 
AnswerRe: Help with C# Pin
The Man from U.N.C.L.E.12-Mar-10 8:21
The Man from U.N.C.L.E.12-Mar-10 8:21 
GeneralMessage Removed Pin
13-Mar-10 4:03
Janded13-Mar-10 4:03 
GeneralRe: Help with C# Pin
The Man from U.N.C.L.E.14-Mar-10 23:40
The Man from U.N.C.L.E.14-Mar-10 23:40 
GeneralRe: Help with C# Pin
Janded19-Mar-10 1:42
Janded19-Mar-10 1:42 
GeneralRe: Help with C# Pin
Janded19-Mar-10 2:04
Janded19-Mar-10 2:04 
GeneralRe: Help with C# Pin
The Man from U.N.C.L.E.19-Mar-10 2:20
The Man from U.N.C.L.E.19-Mar-10 2:20 
GeneralRe: Help with C# Pin
Janded20-Mar-10 2:42
Janded20-Mar-10 2:42 
GeneralRe: Help with C# Pin
Janded20-Mar-10 2:57
Janded20-Mar-10 2:57 
Questionwrite to app.config through c# Pin
prasadbuddhika11-Mar-10 22:47
prasadbuddhika11-Mar-10 22:47 
AnswerRe: write to app.config through c# Pin
Estys11-Mar-10 23:36
Estys11-Mar-10 23:36 
QuestionSerial Port Pin
Deepak.Prahlad11-Mar-10 22:14
Deepak.Prahlad11-Mar-10 22:14 
AnswerMessage Closed Pin
11-Mar-10 22:37
stancrm11-Mar-10 22:37 
GeneralRe: Serial Port Pin
Deepak.Prahlad11-Mar-10 22:50
Deepak.Prahlad11-Mar-10 22:50 
Yes. I have set the port name, baudrate, parity, stopbit and databit. and my timeout is 100mS

stancrm wrote:

at this line will be hold for 2000ms.
If in 2000ms no data received, then TimeoutException.


Does this mean that the received data can be less than 100 bytes? That is if a single byte is received within the timeout period (in my case it is 100mS) there will be no timeout exception right?

One more thing is that I jump to this code only when System generates a DataRecieved event as in
void comPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
     {
         try
         {
             SetTimeOuts(true);
             byte[] buffer = new byte[101];
             int iReadBufSize = comPort.Read(buffer, 0, 100);
             string strData = String.Empty;
             for (int i = 0; i < iReadBufSize; i++)
             {
                 strData = strData + buffer[i].ToString() + " ";
             }
             DisplayRecievedData(buffer);
             strData = "Rcd <<--: " + strData;
             UpdateDisplayArea(strData);
             //comPort.DiscardOutBuffer();
             SetTimeOuts(true);
         }
         catch (Exception exp)
         {
             MessageBox.Show("Exception in comPort_DataReceived()" + Environment.NewLine + exp.Message);
         }
     }

this event was registered like this when the serial port was created as
comPort.DataReceived += new SerialDataReceivedEventHandler(comPort_DataReceived);


I observed that some times the byte[] buffer was null when I put break points there? Is it normal?
GeneralMessage Closed Pin
12-Mar-10 0:06
stancrm12-Mar-10 0:06 
GeneralRe: Serial Port Pin
Deepak.Prahlad12-Mar-10 0:25
Deepak.Prahlad12-Mar-10 0:25 
GeneralRe: Serial Port Pin
OriginalGriff12-Mar-10 1:46
mveOriginalGriff12-Mar-10 1:46 
AnswerRe: Serial Port Pin
DotNetCoderJunior12-Mar-10 2:08
DotNetCoderJunior12-Mar-10 2:08 
AnswerRe: Serial Port Pin
Luc Pattyn12-Mar-10 2:51
sitebuilderLuc Pattyn12-Mar-10 2:51 

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.