CPB Mailing List

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Serial port: dcb.fErrorChar problem



I'm creating an application that use the serial port to communicate with

an external device, but i´m geting strange results in all computers that

i have tested it.

The first time i open the serial port and try to read data, i receive
the correct input and close the serial port. Then, i reopen the port and

repeat the reads. This time i receive garbled characters mixed with the
expected input. I already have made another version of the program (OWL
16-bits) that work without problems.

If i clear fErrorChar from DCB, i get no garbled characters, but i have
missing ones.
I have tryed to enlarge the input buffer, speeding up the timer (1 ms)
that do the reads, but both without results.

I'm opening the port at 4800,e,7,1.

In a terminal application created with a simmilar code i get the
following result when i write 4 times at&v to a port connected to a
modem. (DCB.fErrorChar = true; DCB.ErrorChar = (char) '#';) :

***************************************************************************************

Opening COM3:19200,n,8,1

at&v

ACTIVE PROFILE:
B1 E1 L1 M1 N1 Q0 T V1 W2 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T4 &X0
&Y0
S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:050 S08:002
S09:006
S10:014 S11:070 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020
S44:020
S46:138 S48:007 S95:047

STORED PROFILE 0:
B1 E1 L1 M1 N1 Q0 T V1 W2 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T4 &X0
S00:000 S02:043 S06:002 S07:050 S08:002 S09:006 S10:014 S11:070 S12:050
S18:000
S36:007 S37:000 S40:105 S41:195 S46:138 S95:047

STORED PROFILE 1:
B1 E1 L1 M1 N1 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S1 &T4 &X0
S00:000 S02:043 S06:012 S07:050 S08:002 S09:006 S10:001 S11:050 S12:050
S18:000
S36:007 S37:000 S40:105 S41:192 S46:136 S95:255

TELEPHONE NUMBERS:
0=                                     1=
2=                                     3=

OK
at&v

ACTIVE PROFILE:
B1 E1 L1 M1 N1 Q0 T V1 W2 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T4 &X0
&Y0
S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:050
S08:####S#############1#############:#############2#############
#############0#############:#############S#############7#####S#############

#############M#############W#############D#############
#############T#############0#############:#############0#############
#############7#############:#############S#############5#############1#############

#S############# #############M#############W#############D#############
#############T#############0#############:#############0#############
#############5#############:#############S#############5#############1#############

#############M############# ############# ############# #############
############# ############# #############
#at&v

#############L#############M#############W#############D#############
#############T#############0#############S#############3#############0#############7#############S#############1#############:#############2#############

#############0#############:#############S#############7#####S#############

#############M#############W#### Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T4
&X0
S00:000 S02:043 S06:002 S07:050 S08:002 S09:006 S10:014 S11:070 S12:050
S18:000
S36:007 S37:000 S40:105 S41:195 S46:138 S95:047

STORED PROFILE 1:
B1 E1 L1 M1 N1 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S1 &T4 &X0
S00:000 S02:043 S06:012 S07:050 S08:002 S09:006 S10:001 S11:050 S12:050
S18:000
S36:007 S37:000 S40:105 S41:192 S46:136 S95:255

TELEPHONE NUMBERS:
0=                                     1=
2=                                     3=

OK
at&v

ACTIVE PROFILE:
B1 E1 L1 M1 N1 Q0 T V1 W2 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T4 &X0
&Y0
S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:050 S08:002
S09:006
S10:014 S11:070 S12:050 S18:000 S25:005 S26:001 S36:007 S37:000 S38:020
S44:020
S46:138 S48:007 S95:047

STORED PROFILE 0:
B1 E1 L1 M1 N1 Q0 T V1 W2 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T4 &X0
S00:000 S02:043 S06:002 S07:050 S08:002 S09:006 S10:014 S11:070 S12:050
S18:000
S36:007 S37:000 S40:105 S41:195 S46:138 S9########
#S############# #############M#############W#############D#############
#############T#############0#############:#############0#############
#############5#############:#############S#############5#############1#############

#############M############# ############# ############# #############
############# ############# #############
#

Closing port.
***************************************************************************************

Does any one have any clue???

Apreciate any help and sorry for the length of the message.

--
Carlos Ladeira, Portugal
caladeira@mail.telepac.pt
www.terravista.pt/ilhadomel/1442/
icq: 4984288




W Komornicki's Home Page | Main Index | Thread Index