rs232 serial comms problem

  • Thread starter Thread starter Brett Miller
  • Start date Start date
B

Brett Miller

Hi,

Part of the current project that I'm working on requires me to write to a
printer, I have ported the routines from an old project and have implemented
them using the OpenNETCF.IO.Serial Namespace, and everything works fine
except...

To toggle the printer on and off in my old software, (rs232) The DTR line is
high by default, I pull the line low for 1,2 seconds and then release it
high again, to toggle the printer on/off (if the printer is on this turns it
off, and vice versa)

I'm am required to turn the printer on and off using the DTR line states.
Now the line state is set to high (.DTREnable = true) on startup, when I am
required to turn the printer on, I toggle the lines as explained before
(i.e. .DTREnable = false ) and sleep the thread for 1,2 secs.

This only works if the printer is on. (so it only turns it off)

I have measured the voltage on the DTR line with an oscilloscope, and when
the printer is OFF or unplugged, and I change the line states (DTR)
(.DTREnable = True / False). There is no movement on the line at all, this
property does nothing, no voltage movement at all.

Am I missing something???

Please any Comment, Suggestions or Help is very much appreciated.

Thanks in Advance
Best Regards
Bm
 
Hi,

If you are using an internal serial port, you probably are SOL. Most device
manufacturers do not connect DTR to the serial port, instead they hard-wire
it "high". This is to make ActiveSync a little more "plug and play" with
the serial connection.

You option might be to wire a special cable adapter that connects RTS
instead of DTR for this function.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 
Could it be that the serial port is powered down when no valid RS232 signal is present on the input pins?

Try to set a voltage larger than 3.0V or less than -3.0V on any input pin with the printer disconnected and see if DTR
toggles then.

Perhaps it is the DSR line that activates the serial port.

Ruben
 
Back
Top