problem with modem status signals
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
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
Logged In: YES
user_id=918965
Originator: NO
Did you test return value of EscapeCommFunction() for error?
Logged In: YES
user_id=2128180
Originator: YES
Yes.
I wrote a small delphi program to test this. Should I attach program (and source)?
Logged In: YES
user_id=918965
Originator: NO
Yes, attach program and source.
exe of test program
Logged In: YES
user_id=2128180
Originator: YES
attached exe of test program
File Added: test_bin.zip
Logged In: YES
user_id=2128180
Originator: YES
attached source
File Added: test_src.zip
delphi sourcee of test program
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.
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