Computing.Net > Forums > Programming > Serial Port Help in C++

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Serial Port Help in C++

Reply to Message Icon

Name: megadith
Date: July 2, 2002 at 13:11:42 Pacific
Comment:

I'm creating this code that will operate a scale. I'm using a 9pin serial cable and operating at 7-O-1 at a baudrate of 1200. I want to receive and send information using inp and outp. I was using ProComm, a terminal progrom for DOS, to send commands to the scale by using the keyboard but used a shell to go back to DOS. We using Borland C++ in DOS through this shell my program works fine, it receives and sends perfectly, but when I'm not in this ProComm DOS shell, it will send all right but nothing will be recieved. Any Ideas on why? I think something has to be with the fact that the COM port is not open but I don't know why. Any help will be great.



Sponsored Link
Ads by Google

Response Number 1
Name: cup
Date: July 2, 2002 at 13:49:16 Pacific
Reply:

Do you know what the Procomm port settings are? eg RTS/CTS or Xon/Xoff, DSR/DTR etc.

I'm just guessing here. It is possible that Procomm changes the settings when it is communicating with your keyboard but it reverts on exit from procomm. If you make sure those signals are the same, it might magically start working.

It may also be that you are getting an overrun because the data is not taken off the input port fast enough.

Check the settings first and make sure your program is doing the same.


0

Response Number 2
Name: borelli33
Date: July 6, 2002 at 06:37:14 Pacific
Reply:

Just another thought guys....

Does the COMM app for DOS call the port by resource name or address? i.e. COM1 or 3F8?


0

Response Number 3
Name: megadith
Date: July 8, 2002 at 07:12:39 Pacific
Reply:

I call the port by using 3f8. I talk directly to the UART I check the data recieved port (com_port+5)and it says that there is nothing there when I see a signal coming back to the computer. Thanks for all your help.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Serial Port Help in C++

C code for serial port in linux www.computing.net/answers/programming/c-code-for-serial-port-in-linux/19045.html

Win NT Serial port interrupt prog. C++ www.computing.net/answers/programming/win-nt-serial-port-interrupt-prog-c/274.html

help me in port communication in c++ www.computing.net/answers/programming/help-me-in-port-communication-in-c/777.html