Click here to Skip to main content
15,913,055 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Separator in WPF's TreeView Pin
Aviad P.21-Dec-09 0:32
Aviad P.21-Dec-09 0:32 
GeneralRe: Separator in WPF's TreeView Pin
Mohammad Dayyan21-Dec-09 2:14
Mohammad Dayyan21-Dec-09 2:14 
GeneralRe: Separator in WPF's TreeView Pin
Aviad P.21-Dec-09 2:42
Aviad P.21-Dec-09 2:42 
QuestionHow can i Impliment WPF programing in C# Dialog? Pin
pallaka20-Dec-09 20:33
pallaka20-Dec-09 20:33 
QuestionWPF, Serial Port, MutliThreading Pin
cppwxwidgetsss18-Dec-09 18:37
cppwxwidgetsss18-Dec-09 18:37 
AnswerRe: WPF, Serial Port, MutliThreading Pin
Garth J Lancaster18-Dec-09 19:27
professionalGarth J Lancaster18-Dec-09 19:27 
GeneralRe: WPF, Serial Port, MutliThreading Pin
cppwxwidgetsss22-Dec-09 18:32
cppwxwidgetsss22-Dec-09 18:32 
GeneralRe: WPF, Serial Port, MutliThreading Pin
C_Johnson28-Mar-11 9:37
C_Johnson28-Mar-11 9:37 
Hi,

I think I understand your problem I take it you are using interrupts with your serial comms as in my article:Serial Communication using WPF, RS232 and PIC Communication[^] . I'm an electrical engineer so I do a lot of work with micro-controllers and programming on UI levels.

From my understanding at the moment the you can not determine which micro-controller has sent the data of which the interrupt loads and displays. There are a few solutions to you problem which depend on your ability to reprogram the micro-controllers.

1st I will assume this is not an option:

If you can ensure that the micro-controllers respond one after each other the you could try the older approach of creating another thread and reading all the data into a buffer this more common in C# applications. I can provide an example of this if required however it's not used that often any more. This will attempt to read the data in a let you deal with it a bit at a time however is less efficient than interrupts and your likely to to loose data.

The best option to ensure data integrity is simply to wait after polling each micro-controller until data is received however I understand this may not be possible if at time the micro-controller does not respond with data. If this is true you will have to introduce a timer to continue after if no data is received.

2nd If you can reprogram the micro-controllers:

This is far easier, 1st simply ensure each micro-controller sends and ID tag before sending any data this way you can determine the start of each package and the device.

An alternative which is the bus standard norm is a busy line. It requires an extra connection between your micro-controllers when a controller receives a request for data it will set this line high. Before any other micro-controller can send it's data it must wait for this line to go low. This method again relies on data always being sent on request and has inherent problems such as if one micro-controller takes a considerable time to transmit for example it has a long string of data to send you could find yourself polling for data from micro-controllers before they have had time to send there previous data. This timing issues are important to deal with and I would recommend the first option for ease as you could still end up with the same problem.


I hope this helps however I do have question if you haven't designed the micro-controllers yourself. If you have your micro-controllers configure on one comms line i.e. one TX and RX line in a bus configuration a busy line should have already been employed else there is nothing to stop your micro-controllers sending data over the top of each other. I would unfortunately expect that this is true in which you could still have the problem you described. Your easiest solution would be to wait to receive data from a micro controller before requesting more. This can still be done extremely fast.

Feel free to ask further questions
Cheers
Chris
QuestionHow to connect MySql DataBase with ODBC connectivity to WPF display Pin
pallaka18-Dec-09 3:10
pallaka18-Dec-09 3:10 
QuestionCreating TreeViewItem dynamically ? Pin
Mohammad Dayyan17-Dec-09 20:28
Mohammad Dayyan17-Dec-09 20:28 
AnswerRe: Creating TreeViewItem dynamically ? Pin
Aviad P.18-Dec-09 0:51
Aviad P.18-Dec-09 0:51 
GeneralRe: Creating TreeViewItem dynamically ? Pin
Mohammad Dayyan18-Dec-09 1:01
Mohammad Dayyan18-Dec-09 1:01 
GeneralRe: Creating TreeViewItem dynamically ? Pin
Pete O'Hanlon18-Dec-09 2:18
mvePete O'Hanlon18-Dec-09 2:18 
NewsFree Silverlight 4 Developer Training Now Available on Channel 9 Pin
brucedkyle17-Dec-09 11:10
brucedkyle17-Dec-09 11:10 
GeneralRe: Free Silverlight 4 Developer Training Now Available on Channel 9 Pin
Abhinav S17-Dec-09 16:55
Abhinav S17-Dec-09 16:55 
QuestionGetting WPF in VC++ Pin
Anu_Bala16-Dec-09 18:29
Anu_Bala16-Dec-09 18:29 
Questionunable to understand concurrencymode Pin
Mogamboo_Khush_Hua16-Dec-09 7:15
Mogamboo_Khush_Hua16-Dec-09 7:15 
AnswerRe: unable to understand concurrencymode Pin
Ian Shlasko16-Dec-09 7:26
Ian Shlasko16-Dec-09 7:26 
GeneralRe: unable to understand concurrencymode Pin
Mogamboo_Khush_Hua16-Dec-09 7:50
Mogamboo_Khush_Hua16-Dec-09 7:50 
GeneralWrite code in client to check concurrency Pin
Mogamboo_Khush_Hua16-Dec-09 9:01
Mogamboo_Khush_Hua16-Dec-09 9:01 
GeneralRe: Write code in client to check concurrency Pin
Ian Shlasko16-Dec-09 9:09
Ian Shlasko16-Dec-09 9:09 
GeneralRe: unable to understand concurrencymode Pin
Ian Shlasko16-Dec-09 9:08
Ian Shlasko16-Dec-09 9:08 
GeneralRe: unable to understand concurrencymode Pin
Mogamboo_Khush_Hua16-Dec-09 18:12
Mogamboo_Khush_Hua16-Dec-09 18:12 
GeneralRe: unable to understand concurrencymode Pin
Pete O'Hanlon16-Dec-09 22:02
mvePete O'Hanlon16-Dec-09 22:02 
GeneralRe: unable to understand concurrencymode Pin
Mogamboo_Khush_Hua16-Dec-09 22:51
Mogamboo_Khush_Hua16-Dec-09 22: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.