Menu

#4 problem with modem status signals

closed
nobody
None
5
2008-07-02
2008-06-25
No

Hello,
I have a strange behavior when using com0com port pair, setting modem status lines via EscapeCommFunction() and reading status via GetCommModemStatus() (standard "pin connection" is set for modem pair):

DTR not set:
CTS follows RTS.

DTR set
DCD set, DSR and CTS off, regardless of state of RTS

RTS set, toggling DTR:
RTS and DTR on -> DCD on (rest off)
DTR off, RTS on -> CTS on (rest off)

Did I do something wrong or is this failure reproducable?

best regards,
Gunter Heuckeroth

Discussion

  • Vyacheslav Frolov

    Logged In: YES
    user_id=918965
    Originator: NO

    Did you test return value of EscapeCommFunction() for error?

     
  • Vyacheslav Frolov

    • status: open --> pending
     
  • Gunter Heuckeroth

    Logged In: YES
    user_id=2128180
    Originator: YES

    Yes.

    I wrote a small delphi program to test this. Should I attach program (and source)?

     
  • Gunter Heuckeroth

    • status: pending --> open
     
  • Vyacheslav Frolov

    Logged In: YES
    user_id=918965
    Originator: NO

    Yes, attach program and source.

     
  • Vyacheslav Frolov

    • status: open --> pending
     
  • Gunter Heuckeroth

    exe of test program

     
  • Gunter Heuckeroth

    • status: pending --> open
     
  • Gunter Heuckeroth

    Logged In: YES
    user_id=2128180
    Originator: YES

    attached exe of test program
    File Added: test_bin.zip

     
  • Gunter Heuckeroth

    Logged In: YES
    user_id=2128180
    Originator: YES

    attached source
    File Added: test_src.zip

     
  • Gunter Heuckeroth

    delphi sourcee of test program

     
  • Vyacheslav Frolov

    • status: open --> pending
     
  • Vyacheslav Frolov

    Logged In: YES
    user_id=918965
    Originator: NO

    rbDSR: TRadioButton;
    ...
    rbCTS: TRadioButton;
    rbDCD: TRadioButton;
    ...
    rbCTS.Checked := (ldw_Stat and $10) <> 0;
    rbDSR.Checked := (ldw_Stat and $20) <> 0;
    rbDCD.Checked := (ldw_Stat and $80) <> 0;

    Only one radio button can be in the checked state at the moment.
    You always see the last one. So if DCD is in the checked state
    then DSR and CTS are in not checked state.

     
  • Gunter Heuckeroth

    Logged In: YES
    user_id=2128180
    Originator: YES

    Hello Vyacheslav,

    thanks for this advise.
    Working for such a long time with delphi, and then trapped this way is bitter....
    I've packed each radiobutton in a separate panel, and now it works as expected.

    Gunter

     
  • Gunter Heuckeroth

    • status: pending --> open
     
  • Vyacheslav Frolov

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB