Click here to Skip to main content
15,914,444 members
Home / Discussions / C#
   

C#

 
GeneralRe: adjust my machine's utc? Pin
PIEBALDconsult4-Feb-09 8:00
mvePIEBALDconsult4-Feb-09 8:00 
GeneralRe: adjust my machine's utc? Pin
mirko864-Feb-09 8:05
mirko864-Feb-09 8:05 
GeneralRe: adjust my machine's utc? Pin
PIEBALDconsult4-Feb-09 8:10
mvePIEBALDconsult4-Feb-09 8:10 
QuestionHow do I change the value in the Title column for a document or folder in a doc lib using c#? Pin
eval994-Feb-09 4:00
eval994-Feb-09 4:00 
QuestionSerialPort output problem Pin
Admin8874-Feb-09 3:45
Admin8874-Feb-09 3:45 
AnswerRe: SerialPort output problem Pin
Luc Pattyn4-Feb-09 5:09
sitebuilderLuc Pattyn4-Feb-09 5:09 
GeneralRe: SerialPort output problem Pin
Admin8874-Feb-09 5:51
Admin8874-Feb-09 5:51 
AnswerRe: SerialPort output problem [modified] Pin
Luc Pattyn4-Feb-09 6:13
sitebuilderLuc Pattyn4-Feb-09 6:13 
Hi,


Admin887 wrote:
[SP] (space in ASCII)= means that there is space in line
[CR] (New row in ASCII)= means that there is a new row


That's what I assumed, but I needed to be sure.
If you are saying text is coming through correctly except for those two characters, then I admit
I know of no reason why spaces would not work as intended.

There are a few things you should be aware of:
1. serial ports transmit bytes, not characters.
2. .NET strings consist of characters, and Unicode characters at that (16-bit wide).
3. The SerialPort class translates characters to/from bytes using an Encoding; it has an Encoding
property for that purpose, it is said it defaults to ASCII, but IIRC it works better when you set
it explicitly, don't know why that is. And you might want to use code page 1252 so you get
8-bit ANSI characters (including some accented characters, trademark, copyright, euro, etc)
rather than just the 7-bit ASCII set
4. SerialPort.ReadLine() waits for an end-of-line, which is defined through the NewLine property.
AFAIK that is set to [CR][LF] by default (actually to Environment.NewLine). So as long as that
exact sequence of characters isn't seen, there is no new line starting.
5. Your sending program isn't really sending any NewLine sequences, is it? it is rather difficult
to enter them manually in a textbox. What you could do is transmit textbox.Text+Environment.NewLine
though.

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


modified on Friday, June 10, 2011 11:37 AM

GeneralRe: SerialPort output problem Pin
Alan N4-Feb-09 7:06
Alan N4-Feb-09 7:06 
AnswerRe: SerialPort output problem [modified] Pin
Luc Pattyn4-Feb-09 7:23
sitebuilderLuc Pattyn4-Feb-09 7:23 
QuestionSql Database LookUp Pin
boiDev4-Feb-09 3:04
boiDev4-Feb-09 3:04 
AnswerRe: Sql Database LookUp Pin
musefan4-Feb-09 3:29
musefan4-Feb-09 3:29 
AnswerRe: Sql Database LookUp Pin
J4amieC4-Feb-09 4:25
J4amieC4-Feb-09 4:25 
JokeRe: Sql Database LookUp Pin
musefan4-Feb-09 4:29
musefan4-Feb-09 4:29 
QuestionInstalling a COM+ interoperable C# dll on machine without .Net Framework Pin
dan!sh 4-Feb-09 2:23
professional dan!sh 4-Feb-09 2:23 
AnswerRe: Installing a COM+ interoperable C# dll on machine without dll Pin
musefan4-Feb-09 2:35
musefan4-Feb-09 2:35 
GeneralRe: Installing a COM+ interoperable C# dll on machine without dll Pin
dan!sh 4-Feb-09 3:43
professional dan!sh 4-Feb-09 3:43 
GeneralRe: Installing a COM+ interoperable C# dll on machine without dll Pin
musefan4-Feb-09 3:50
musefan4-Feb-09 3:50 
GeneralRe: Installing a COM+ interoperable C# dll on machine without dll Pin
dan!sh 4-Feb-09 4:08
professional dan!sh 4-Feb-09 4:08 
GeneralRe: Installing a COM+ interoperable C# dll on machine without dll Pin
musefan4-Feb-09 4:23
musefan4-Feb-09 4:23 
AnswerRe: Installing a COM+ interoperable C# dll on machine without .Net Framework Pin
SeMartens4-Feb-09 3:56
SeMartens4-Feb-09 3:56 
GeneralRe: Installing a COM+ interoperable C# dll on machine without .Net Framework Pin
dan!sh 4-Feb-09 4:07
professional dan!sh 4-Feb-09 4:07 
Questionregular expressions Pin
lawrenceinba4-Feb-09 1:45
lawrenceinba4-Feb-09 1:45 
AnswerRe: regular expressions Pin
Not Active4-Feb-09 2:49
mentorNot Active4-Feb-09 2:49 
AnswerRe: regular expressions Pin
PIEBALDconsult4-Feb-09 4:01
mvePIEBALDconsult4-Feb-09 4:01 

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.