🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8789

Re: Comm Port

#8789
From: McKool
Date: Wed, 15 Sep 2004 13:37
78 lines
4637 bytes
How can i make the port work sinchronous? which api function exist f�r send 
a byte and get a return when the byte was received?
I made my class Port and i have to use TransmitCommChar in Windows XP, NT 
and 2000 but for ME, 98 and 95 don't work with tha function but with 
WriteFile.  I know only those two functions and i don't use both at time (at 
least i don't know how).

What if i wait until this event

EV_TXEMPTY = The last character in the output buffer was sent

Can i take the time before send a byte, wait for that signal EV_TCEMPTY, 
calculate how many millis are gone between send and receive the signal, wait 
for the rest of millis what i need (minus 1/360 which is the time to send 
other byte) and send the new byte???

Sorry if what i say sounds  crazy but i have no more ideas....

thanks for all your help

"McKool" <kenethw@peak-system.com> schrieb im Newsbeitrag 
news:41483adc@newsgroups.borland.com...
> Thanks for the answers.
>
> I could see with an osciloscope that the Low-Hight state which i want, i 
> can make ik sending a 0x0 using as baudrate of 360. That is something ;-) 
> . When i send the 0x0 i get a Low signal for exact 25 ml.  The problem is 
> to calculate the time after that happens.
>
> The duration of send a 0x0 is (if i understud well)      (1/360)*1000 = 
> 2,7777 ml . so, in order to send something in the next 25 ml shall the 
> program wait theoretic
>
> This hardware is a standard device to communicate to a Car.  The name is 
> K-Line and in order to start a comunication must be sent a 25 ml low, 25 
> ml hight and some start bytes after that.  But it must be just 25ml, if it 
> is not exact (+/- 1 ml) don't work.  I find a sample program mad in Delphi 
> (only the Exe file) and i see in the osciloscope that it make just that 
> what i want, so must to be a simple way.
>
> "Bob Gonder" <notbg@notmindspring.invalid> schrieb im Newsbeitrag 
> news:jf9ek095ohfqfgl304ncsf62mhc340nu88@4ax.com...
>> Eelke Klein wrote:
>>
>>>Notice that these signals will never be completely low or completely
>>>high they will allways be a series of pulses zero bits are short pulses
>>>and 1 bits are long pulses. The start and stop bits have fixed lengths.
>>
>> No pulses.
>> You're probably thinking modem signals where the frequency shifts
>> according to bit state.
>> The RS232 voltage goes high or low for the duration of the bit time.
>> The reader is supposed to wait for the middle of the bit time to read
>> the value. This gives the signal the maximum anount of time to
>> overcome line capacitance, and achieve a non-ambigous signal state.
>>
>>>> Can i maybe at 10472 in someway make the same low-hight behavior?
>>
>> No, then it really would look like pulses.
>> The start and stop bits are both high. So a 0 looks like goal posts.
>>
>> Doesn't the OEM have windows drivers for this?
>>
>> I get the feeling this is ancient hardware and MS isn't going to allow
>> very nice support for it.
>>
>> You could also try sending a "break" signal.
>> It's been too many decades, and I never used them, but perhaps this is
>> the signal the OEM contemplated being sent.
>> I no longer have my hardware manual for the UART, but a communications
>> library says that a Break is  spacing (0) for more than a character's
>> time.  It doesn't say how much more, or if it spaces for wall-clock
>> time, or just a bit more than a char time. In any case, I don't think
>> it would have any start/stop (high) bits.
>>
>>
>
> 
Technical Details
Message-ID: <414844ac$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4145a779$1@newsgroups.borland.com> <88fbk0d602p65ajvc5lk89tc2bc5qv93dg@4ax.com> <41469b86$1@newsgroups.borland.com> <4146b149$1@newsgroups.borland.com> <jf9ek095ohfqfgl304ncsf62mhc340nu88@4ax.com> <41483adc@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c3fce443b4c5c053
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII
From: "McKool" <kenethw@peak-system.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4145a779$1@newsgroups.borland.com> <88fbk0d602p65ajvc5lk89tc2bc5qv93dg@4ax.com> <41469b86$1@newsgroups.borland.com> <4146b149$1@newsgroups.borland.com> <jf9ek095ohfqfgl304ncsf62mhc340nu88@4ax.com> <41483adc@newsgroups.borland.com>
Subject: Re: Comm Port
Date: Wed, 15 Sep 2004 15:37:24 +0200
Lines: 80
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 213.157.13.214
Message-ID: <414844ac$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1095255212 213.157.13.214 (15 Sep 2004 06:33:32 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail