Click here to Skip to main content
16,020,669 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i use serial data handler but it not fire never
Posted
Comments
[no name] 20-Jan-15 5:38am    
Can you post a small amount of your code - enough to see how you set up handler.

First, use the SerialPort class[^] - the link includes an example.
Second, check your com port connection to the device: if it's a "real" COM port rather than a USB connection then some devices require control signals such as RTS/CTS and DTR before they can start to talk.

You also need to check the speed, bits per character, stop bits, and parity are correct, and that the device doesn't need to you "talk first" before it sends any data.

I'd recommend checking the connection first using hyperterminal or similar before moving direct to code with all the possibilities for other mistakes that adds.
 
Share this answer
 
C#
port = new SerialPort("POrt Name");
                     port.Open();
                     string message = port.ReadExisting();
                     txtMsg.Text = message;


This works for me.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900