|
I have to do SerialPort communication that constantly needs to read data from a serial interface (for example COM1). and also identify the strating of first message and ending of that message and also starting of second message. please give me reply ASAP becuase I really stuck in that.
|
|
|
|
|
You had similar questions 3 months ago!?
now start by telling more:
1. is it text or binary data?
2. is it message oriented? what is the minimum and maximum message length?
3. is there a unique byte that indicates end-of-message and is guaranteed not to appear inside a message?
4. is it going to fill the bandwidth, or just a few messages a second?
5. what kind of data is it? is it real-time? can you afford to loose some (as in audio/video streaming)?
6. what is more important: latency (reaction to first data) or bandwidth (kilobytes per second)?
7. what is the other device? did you design it? can it be modified if need be?
etc
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
This is nice I agreed.
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
I know that I asked same question that before 3 months ago but I tried to implement for it but still facing problem and dont know the solution. let me explain from scratch so you will have some idea about it.
1) My allication has to intract with another device and this device cannot be modified. Its kind of embedded tech. means whaterver signal the device can send that computer has to recieve it and in some cases computer has to send some instruction to control the device.(in the case when the device generates signals and if it goes beyong some set points then computer has to control it. its kind of two way communication).
2) its in format of binary of ascii value.
3) there is no minimum or maximum length. its continous
4)probably its real-time.
I dont have enough background info about this and I am only in this project so cant get help from other and never work any this kind of project in past.so please give me a proper guidence for it.
thank you so much for intrest in this topic.
thanks.
|
|
|
|
|
that still is extremely vague.
what is the peripheral's function?
is the peripheral a commercial one, has it on-line documentation I could look at?
can you show say 100 bytes of the data, preferably in hex?
both continuous and real-time is something Windows cannot handle; maybe you're exagerating?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
means? I didnt understand what kind of details you want?
Actually I am going to use this programming for commericial use. In my project there is a need to develope this. the requirment is computer has to recieve signals from another device which is not computer but its a kind of detector. and whatever signals it sends computer has to recieve it.
still if you have confusion then let me know I'll explain you. If you are availabe for chat then we discuss about it more clearly.
but thanks a lot for help.
|
|
|
|
|
I don't chat.
I have read your several messages and still have no clue about your app, your amount of data, its timing, etc.
You'll be on your own.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi All!
I have a problem that I can't find the solution of:
In an application I'm using MaskedTextBox controls for dates (displaying current value and letting user change value). Default language for application is Swedish and mask is 0000-00-00 (for yyyy-MM-dd). This works fine.
The application is also to be run in Finnish and then I set the mask to 00.00.0000 (for dd.MM.yyyy), this does not work at all! The mask is correct but for a reason beyond my comprehension in the text-property of the control the "." (dot) is replaced with "," (comma). I have tried to replace the comma, to overwrite the text property and a number of other things but without success.
Is the problem that the control interpretes the date as a number and replaces the dot with the NumberGroupSeparator and NumberDecimalSeparator of the MaskedTextBox.Culture? If so how do I get the control so interprete the date as a date?
What can I do to make the MaskedTextBox to work with my Finnish dates???
Thanks!
Chris
|
|
|
|
|
I guess yes. It is picking things up from the current culture. I think you will need to override that through FormatProvider.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi,
Have you read the MSDN notes for the Mask property? To me they suggest that the date separator / will be interpreted according FormatProvider.
Alan.
|
|
|
|
|
Thank you Alan!
You've made the day for our whole project team!
/Chris
|
|
|
|
|
You have seen the user comments part of the forum of the codeproject site. It is like a treeview control.
I have managed to make something similar to it. As you see in the forum a line is put after a message and all its answers. Can anyone give me details of how it is done ? What are the algorithm ,the database structure and details ?
|
|
|
|
|
Well... This is Gr8. I think you can write an article and post it at codeproject.com on what you did.. so we can also get some idea on it..
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Huh??
Everything makes sense in someone's mind
|
|
|
|
|
|
I m using crystal report with data base mysql.
i m genrating report dynamic.
as we select column from check box report will be genrate.
all thing is done well but genrated data is not display in report.
my problem is i result is not display in report.
|
|
|
|
|
Why do people make posts like this with no code attached? Does Miss Cleo now frequent the CodeProject message boards?
|
|
|
|
|
I think you should post in detail.. your code snippets.. error you are facing ..etc so that everyone can get the actual scenario.
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Hello, I am having a small problem here and just cant figure it out.. I have an unbound datagridview object with 3 columns and am trying to simply pass the values added in the datagrid rows to a variable, messagebox, anything. The first two columns of the new row pass fine. But the last throws a NullReferenceException. (there is data typed in the cell). All cell background colors change BUT when I try to get the data entered in the cells, the last column throws the exception. Thank you!!!!
private void dataGridView1_RowLeave(object sender, DataGridViewCellEventArgs e)
{
DataClasses1DataContext dc = new DataClasses1DataContext();
Medication newMeds = new Medication();
for (int i = 0; i < dataGridView1.Rows[e.RowIndex].Cells.Count; i++)
{
dataGridView1[i, e.RowIndex].Style.BackColor = Color.Green; // works for all 3 rows
MessageBox.Show(dataGridView1[i, e.RowIndex].Value.ToString()); // Throws exception on 3rd row
}
}
|
|
|
|
|
This shows that it has the null value in it...
try with this code, this will tell you whenever you have the null value.
for (int i = 0; i < dataGridView1.Rows[e.RowIndex].Cells.Count; i++)
{
dataGridView1[i, e.RowIndex].Style.BackColor = Color.Green;
if(dataGridView1[i, e.RowIndex] == null)
MessageBox.Show("Somehow, I have the null value here...");
else
MessageBox.Show(dataGridView1[i, e.RowIndex].Value.ToString());
}
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I have already figured it is NULL by debugging and stepping through the code... For some reason, the last cell reports NULL and there is data enteted in the cell.
Manas Bhardwaj wrote: This shows that it has the null value in it...
try with this code, this will tell you whenever you have the null value.
for (int i = 0; i < dataGridView1.Rows[e.RowIndex].Cells.Count; i++){dataGridView1[i, e.RowIndex].Style.BackColor = Color.Green; // works for all 3 rowsif(dataGridView1[i, e.RowIndex] == null) MessageBox.Show("Somehow, I have the null value here...");else MessageBox.Show(dataGridView1[i, e.RowIndex].Value.ToString());}
|
|
|
|
|
After a bit more hair pulling, I decided it has to be something in the event type.. So, I changed it to the event type : RowLeave...
Now it works... Same code, different event...
|
|
|
|
|
IMO the probable cause is the data gets committed to the cell when you leave the cell, by moving focus to another cell or another Control.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi dont know How it is possible to get that error,
The same code you have given works fine ,
just i tried as bellow
DataTable dt = new DataTable();
dt.Columns.Add("1");
dt.Columns.Add("2");
dt.Rows.Add("100", "101");
dt.Rows.Add("102", "103");
dt.Rows.Add("103", "104");
dataGridView1.DataSource = dt;
private void dataGridView1_RowLeave(object sender, DataGridViewCellEventArgs e)
{
for (int i = 0; i < dataGridView1.Rows[e.RowIndex].Cells.Count; i++)
{
dataGridView1[i, e.RowIndex].Style.BackColor = Color.Green;
MessageBox.Show(dataGridView1[i, e.RowIndex].Value.ToString());
}
}
|
|
|
|
|
Not really sure either.. Only difference here is that I used VS2008 to configure the datagridview (columns, etc.)
|
|
|
|