473,804 Members | 3,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read/ write string to com port

7 New Member
Hi friends,

I have written code in asp.net to read or write string in com port(COM1).But when i run the program i am not getting any output .Below is my code .How can i check the string which i have send in com port is available in com port for read.

private SerialPort port = new SerialPort("COM 1", 9600, Parity.None, 8, StopBits.One);
port.Open();



// port.Write("He" );

port.Close();
port.Open();
port.ReadTo("e" );
Console.WriteLi ne(port.ReadLin e());


please reply as soon as possible....... ............... ...Thanx in advance for reply...
Oct 16 '08
14 3079
Plater
7,872 Recognized Expert Expert
What is attached on the COM port of the server computer? Are you using the corrrect baud rate? Are you using the correct COM port?

I am confused, your original post says you are doing this in ASP.NET, but you say you are in a console window?
Oct 16 '08 #11
ravimishra11
7 New Member
What is attached on the COM port of the server computer? Are you using the corrrect baud rate? Are you using the correct COM port?

I am confused, your original post says you are doing this in ASP.NET, but you say you are in a console window?


yes i am doing in console application .
Oct 17 '08 #12
ravimishra11
7 New Member
It is in Asp.net Console application.
Oct 17 '08 #13
joedeene
583 Contributor
It is in Asp.net Console application.
An Asp.Net Console Application?! I've never heard of such, even googled it and nothing comes up relevant, how did you come about creating such, like what is some code from your asp.net console app? because it could just be a console app. Can you see it in your browser? Or just in a black standard console window...?

joedeene
Oct 17 '08 #14
Curtis Rutland
3,256 Recognized Expert Specialist
It is in Asp.net Console application.

ASP.NET is for website programming. ASP stands for Active Server Pages. I think you might mean .NET Console Application.

ASP.NET Console makes no sense.
Oct 17 '08 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

8
14778
by: collinm | last post by:
hi we use linux and c language under bash i do echo -e \\000\\000\\000\\000\000\\001Z00\\002AA LINUX \\004 >/dev/ttyS2 that send command to a led display (alpha sign communication)
3
5056
by: collinm | last post by:
hi i send a command to a led display, the led display is suppose to return me some character i write a string on a serial port void ledDisplayExist() { char msg={'\0', '\0', '\0', '\0', '\0', '\1', 'Z', '0', '0',
4
1579
by: Dakkar | last post by:
I write a program for connecting to mysql database and read the values that i want from the database so i wrote my code like this RegistryKey uo = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Origin Worlds Online\\Ultima Online\\1.0"); String folder = uo.GetValue("ExePath").ToString();
1
5363
by: vkrasner | last post by:
It works with VS2003 and does not in VS2005: in VS2003 : string sMyvalue = ConfigurationSettings.AppSettings; in VS2005 (does not work!!) string sMyvalue = ConfigurationManager.AppSettings; Anybody able to give me idea how-to read by C# element which I add to the machine.config into the new single section?
5
2636
by: Jens | last post by:
Hello, I have been looking for some C-code which listens on a user-defined port for incoming data traffic. When data is received, the data is written to a file. I found some C-code (server) that almost does the job. It listens on a user-defined port and responds to incoming data by writing how many times somebody has tried to connect to the server.
0
1543
by: daikeechi | last post by:
hello guys .. i want to perform pc to pc chatting via null modem cable.. i managed to write and sent data to serial port but how to write loops to read data from serial port ? i'm using visual c++ 2005 express editon .. below is my code .. #pragma endregion public: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { String^ msg;
4
11810
by: rowan | last post by:
I'm writing a driver in Python for an old fashioned piece of serial equipment. Currently I'm using the USPP serial module. From what I can see all the serial modules seem to set the timeout when you open a serial port. This is not what I want to do. I need to change the timeout each time I do a "read" on the serial port, depending on which part of the protocol I've got to. Sometimes a return character is expected within half a second,...
0
1461
by: darkking | last post by:
Ok, I'm trying to read data from the serial port. Problem is, that i always have to query the port for new data, and in 99.9% of acses my query doesn't return the result cause of the fact it's done when the modems is seding the answers. I've tried using a timer, but still i get errors. Same while using DTR enable/false. How i can safely send the query without getting over the momdem response ? I'm using DataRecived event, to read the...
3
9712
by: madsornomads | last post by:
Hi all, I have a problem with reading from a Java server after I have written to it - it just hangs. It works fine if I just write to the server and not try to write. I have read the HOWTO on sockets - and it states that there is a problem (something about flushing), but not what the solutions is. Nor do google. Can somebody please help? A few lines down you can see the example code that sums up the problem. Just change the name of...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.