dear,
i use picocom2 module and i want to create a first application in c# but i need to use RS232 to communicate with an other device, have you an example of communication RS232 in C# because i found no document about it
thanks in advance
dear,
i use picocom2 module and i want to create a first application in c# but i need to use RS232 to communicate with an other device, have you an example of communication RS232 in C# because i found no document about it
thanks in advance
You will find samples by search for class "System.IO.Ports.SerialPort" in the www.
Thanks for your answer but i find why my application didn't because i used COM1 instead of COM2.
I didn't succed to open COM1 so i thought that it was my code but not.
I think by default COM1 is used as serial debug line or for run <ndcucfg.exe>. Switch off these programs makes COM1 available.
dear,
i use COM2 but i have a problem with the reception.... i read nothing. i try all i found with google read, readline, existing receive event or not but nothing, aybody have an idea. It's strange because an other application wrote in C++ works perfectly!!!! so it's not an hardware problem maybe f&s driver problem?
thanks in advance
Hello,
how do you test it by using c++?
Can you post your C# code?
I don't think that it is a driver poblem becaus it works in c++.
i write a simple application on vs2005 with just a text box and a button
As soon as receive anything on com 2 i send the data on the textbox and when i click on the button i send a message to the pc.
I write the application for windows it's works well.
I write the same (same code) for smart device application and picocom.... and just the TX message works (with the button)
this is the code
[EDIT from admin: repaired the code section]
Wath's about your initialisation?
Did you try following with your special setting (http://msdn.microsoft.com/de-d…ialport.datareceived.aspx)?
If it not works, can you read without using an event?
in visual studio 2005 when you add a serial port in the designer the initialisation is by default 9600 8 1 N.
i use COM2 not COM1 because COM1 is already used by netdcu.
I tried without event and it's the same. I change the dtr state, rts cts it's the same
Strange! But i can't believe that there is a bug in .NET! But if it works in c++ ... .
Can you check it with VS2008 and .NET3.5?
Did you try following work around by ddl import?
sorry but i don't know how to use dll import with serial port, i'm a beginner.
Don't you have just an exemple written in c# for rs232 that you test before with your module like picocom2 ?!!!!! nobody tests it ????
Sorry, i have no complete source code sample.
Just use dll imports i attached in my previous post and call "Open()", "Read()", "Close()" from your code.
Does this work?