Click here to Skip to main content
15,791,496 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:

i want do send/receive with serial port in pc104 . i use vs2005 with frw compact 2.0 and win ce on pc104 that i generated with vs2005.

i write this sample code with vs2005 for send/receive in pc104

say me where in my program is wrong?

There is my sample code :[^]
Sergey Alexandrovich Kryukov 12-Sep-13 1:14am    
This is not a valid question. The code could be wrong or correct only if you explain what you wanted to achieve, what do you observer instead and why do you think it's wrong. Besides, when it comes to serial port communications, who knows what's on the other end of the RS-232 cable? How do you know if the other side behave correctly? And you need to know its specs.

1 solution

you`re right .
on pc104 i can`t send/receive data from/to pc104 by my generated application in vs2005 whit frw 2.0 compact.
these code are in my application :
this button set value for com port:
private void set_Click(object sender, EventArgs e)

    serialPort1=new SerialPort();
    serialPort1.PortName = comboBox1.Text;
    serialPort1.DtrEnable = checkBox4.Checked;
    serialPort1.RtsEnable = checkBox5.Checked;
    serialPort1.StopBits= StopBits.One;
    serialPort1.Parity= Parity.None;

    serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived);
    button1.Enabled = false;


this code open com port :

this code receive data from com port :
private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)


this code send data from comport :
private void button3_Click(object sender, EventArgs e)
Share this answer

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