Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
Joke[Message Deleted] Pin
Muammar©3-Oct-09 1:56
Muammar©3-Oct-09 1:56 
GeneralRe: Big chief, no fart! Pin
Luc Pattyn3-Oct-09 2:03
sitebuilderLuc Pattyn3-Oct-09 2:03 
GeneralRe: Big chief, no fart! Pin
Muammar©3-Oct-09 2:19
Muammar©3-Oct-09 2:19 
GeneralRe: Big chief, no fart! Pin
Xmen Real 3-Oct-09 2:13
professional Xmen Real 3-Oct-09 2:13 
GeneralRe: Big chief, no fart! Pin
Muammar©3-Oct-09 2:18
Muammar©3-Oct-09 2:18 
Questionhow to store OnComm values in a single string variable Pin
Mads1153-Oct-09 1:12
Mads1153-Oct-09 1:12 
AnswerRe: how to store OnComm values in a single string variable Pin
freakyit3-Oct-09 1:46
freakyit3-Oct-09 1:46 
AnswerRe: how to store OnComm values in a single string variable Pin
Luc Pattyn3-Oct-09 2:02
sitebuilderLuc Pattyn3-Oct-09 2:02 
Mads115 wrote:
string res= new string[];


that does not compile. You declare a single value and instantiate an array.


Mads115 wrote:
res=A0109000000000000i000B0109000000000000i000C0109000000000000i000


whereas this suggests a single string, not an array.

There are several ways to get your data, all assuming you use SerialPort class:
1.
with DataReceived event: read the available data and add it to a List<string>
when three elements are available, remove them from the list and join them together, possibly using string.Join

2.
with DataReceived event: if you're sure about the delays, then include a Thread.Sleep(2500) and read all available data, it will hold the three values (as the next two came in during the sleep).

3.
without DataReceived event: issue a blocking read for the right amount of data.

I would go for (1) as that is the cleanest approach.

Smile | :)

Luc Pattyn

Local announcement (Antwerp region): Lange Wapper? Neen!


AnswerRe: how to store OnComm values in a single string variable Pin
dan!sh 3-Oct-09 2:10
professional dan!sh 3-Oct-09 2:10 
AnswerRe: how to store OnComm values in a single string variable Pin
PIEBALDconsult3-Oct-09 6:34
mvePIEBALDconsult3-Oct-09 6:34 
QuestionDataGridViewCombo Pin
jacobsan43-Oct-09 0:35
jacobsan43-Oct-09 0:35 
AnswerRe: DataGridViewCombo Pin
Xmen Real 3-Oct-09 1:42
professional Xmen Real 3-Oct-09 1:42 
AnswerRe: DataGridViewCombo Pin
dan!sh 3-Oct-09 2:07
professional dan!sh 3-Oct-09 2:07 
QuestionRe: DataGridViewCombo Pin
jacobsan43-Oct-09 2:44
jacobsan43-Oct-09 2:44 
QuestionImplementing MVC architecture in Windows Form Pin
srikrishnakrishna murthy2-Oct-09 23:46
srikrishnakrishna murthy2-Oct-09 23:46 
AnswerRe: Implementing MVC architecture in Windows Form Pin
Christian Graus2-Oct-09 23:51
protectorChristian Graus2-Oct-09 23:51 
GeneralRe: Implementing MVC architecture in Windows Form Pin
srikrishnakrishna murthy3-Oct-09 0:17
srikrishnakrishna murthy3-Oct-09 0:17 
GeneralRe: Implementing MVC architecture in Windows Form Pin
Christian Graus3-Oct-09 10:54
protectorChristian Graus3-Oct-09 10:54 
QuestionC# Programming ? Pin
Dossa2-Oct-09 23:11
Dossa2-Oct-09 23:11 
AnswerRe: C# Programming ? Pin
nagendrathecoder2-Oct-09 23:13
nagendrathecoder2-Oct-09 23:13 
AnswerRe: C# Programming ? Pin
Christian Graus2-Oct-09 23:13
protectorChristian Graus2-Oct-09 23:13 
QuestionException....PLSSSS HELPPPP :(( Pin
linto_112-Oct-09 22:54
linto_112-Oct-09 22:54 
AnswerRe: Exception....PLSSSS HELPPPP :(( Pin
Christian Graus2-Oct-09 22:58
protectorChristian Graus2-Oct-09 22:58 
GeneralRe: Exception....PLSSSS HELPPPP :(( Pin
nagendrathecoder2-Oct-09 23:09
nagendrathecoder2-Oct-09 23:09 
GeneralRe: Exception....PLSSSS HELPPPP :(( Pin
linto_112-Oct-09 23:13
linto_112-Oct-09 23:13 

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.