Computing.Net > Forums > General Hardware > Testing Serial program using same port

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.

Testing Serial program using same port

Reply to Message Icon

Name: BigDaddy
Date: August 26, 2009 at 06:00:32 Pacific
OS: Linux Fedora 6
CPU/Ram: 686/2gb
Product: Rs-232 / Serial port
Subcategory: General
Comment:

I have a colleague trying to use a program to write/read data to/from the same serial port on the same machine.

I've never attempted such a thing (I've done different ports/same machine, different machines,etc.)

Is this behavior defined? It appears to write correctly, but when the time comes to read it, it appears to be able to read the same information multiple times.



Sponsored Link
Ads by Google

Response Number 1
Name: wizard-fred
Date: August 26, 2009 at 15:11:17 Pacific
Reply:

There is no reason you can't read and write from the same
serial port. That's what it does normally. If doing your own
software make sure that the port is initialized properly and
proper handshaking is installed.


0

Response Number 2
Name: SkipCox
Date: August 26, 2009 at 15:40:09 Pacific
Reply:

You can check the hardware with a loopback tester.

http://zone.ni.com/devzone/cda/tut/...

Skip


0

Response Number 3
Name: StuartS
Date: August 26, 2009 at 17:00:29 Pacific
Reply:

Depends exactly you what you mean by send and recieve at the same time. RS232 serial ports don't do full duplex. They will only do half duplex.

This means that they will recieve then switch to transmit mode and transmit and then back into recive mode.

All this is controlled by the DTR (Data Terminal Ready - the computer) and DRS (Data Set Ready - the modem or whatever is plugged into the serial port) along with the RTS (Request to Send) and CTS (Clear to Send) lines. DTR and DSR are usualy initialsied as the start of a session and RTS and CTS are constantly changing during the session. It is up to the software to control them.

Stuart


0

Response Number 4
Name: jefro
Date: August 26, 2009 at 18:05:19 Pacific
Reply:

Oddly enough there really is two data lines on a comm port . I have never heard of anyone or any application using the second set.

Playing to the angels
Les Paul (1915-2009)


0

Response Number 5
Name: StuartS
Date: August 26, 2009 at 18:32:35 Pacific
Reply:

The second set of data lines were used with synchronous communications. Most RS232 communications were asychnchrounous.

Synchronouse communications needed all 25 pins of the RS232 standard; you couldn't do it with just nine pins. I never came across any applications that used synchrounouse communications either but I imagine there were some out there. I think it was only ever used with dumb terminals communicating with a mainframe.

Stuart


0

Related Posts

See More



Response Number 6
Name: BigDaddy
Date: August 26, 2009 at 21:20:12 Pacific
Reply:

By send and receive at the same time, I mean write to the file descriptor and have a sigio handler assigned to read. He's not using either S/W or H/W flow control.


0

Sponsored Link
Ads by Google
Reply to Message Icon





Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Testing Serial program using same port

Used USB port wanted www.computing.net/answers/hardware/used-usb-port-wanted/20285.html

serial port programming www.computing.net/answers/hardware/serial-port-programming/60740.html

Com Port Help www.computing.net/answers/hardware/com-port-help/47805.html