Re: Serial Port and Power Down

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dick Grier (dick_grierNOSPAM_at_msn.com)
Date: 06/28/04


Date: Mon, 28 Jun 2004 08:45:45 -0600

Hi,

>>
I am using an HP2215 with the CFSerial class. It is using the standard
drivers - I have not copied any over. I'm not sure how to find exactly which
serial driver I am using but I can tell you if you tell me how to find it.
<<

What serial port hardware are you using? The built-in serial port, or an
add-on? OK, I see in a later reply that you are using the built-in port.

>>
I have not tried to close and re-open the port. This is because I'm not sure
how to tell when the device powers down. Does this generate an event? I keep
the port open all the time because my hardware sends data based on user
input so data could be sent at any time. The port needs to be open to get
the data.
<<

I understand your situation. If I understand the way that the power-down
mode works, your program will be suspended during power down. Thus, it
won't receive any data during that time. So, you either have to keep the
PPC from powering-down, or you have to restore normal operation when you
receive the message from CERunAppAtEvent. As I said, I haven't used this
API, so I cannot help with its function.

Another thing that you can do is to build in a "watchdog timer" function.
This timer would be reset by receive data. If the timer times out without
having been reset (probably) the app has been asleep, and you then can
simply close and reopen the port. No (additional) data will be lost,
because you already have lost whatever was there anyway.

So, my question about closing and reopening the port was an attempt to find
out if that solves the receive problem. If it does, then you can implement
it in code. But, before going to that effort, it makes sense to find out if
it is solution, or if you have to tackle it in some other way -- and I don't
have a suggestion about another work-around.

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.


Relevant Pages

  • Re: interthread communication
    ... Since this is a writer thread, typically you will PostThreadMessage to it for each packet ... Note that if you have a serial port you must open it for asynchronous I/O. ... of the buffer in via a PostThreadMessage, so using a single variable cannot make sense. ...
    (microsoft.public.vc.mfc)
  • Re: roZetta Status
    ... roZetta firmware is written in ZBasic and uses the ZX-40 from Elba, ... There is one main highspeed RS232 level serial port which interfaces ... with the TW523 as the ZX-40's interrupts are sluggish about 3% of the time. ...
    (comp.home.automation)
  • Re: Multiple serial consoles via null modem cable
    ... /etc/ttys is for configuring a machine to tie getty (think login prompt) ... assuming you attach to the serial port there. ... On box1, you'd have something like this in /etc/ttys: ...
    (freebsd-stable)
  • Re: BSOD
    ... Then the program can't find a serial port, ... find old drivers, and update them. ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: How to Disable Ethernet
    ... you can use the serial port as an alternative method of getting debug. ... can disable KITL debugging and just read all of the messages that come out. ...
    (microsoft.public.windowsce.platbuilder)