Re: using serial port using APIs



What baud rate are you using? How many bytes in the response?

It takes 7 ms to send a byte at 1428 baud. Usually, it takes 10 bits total
to send a byte(the byte itself+start and stop bits). So if you are sending
at 38400 Bits/Sec, that is 3840 Bytes/Sec. Each byte takes 260 us, for 7 ms,
the response can be no more than 26 bytes.

For an API approach, check newsgroups for "vb SetCommConfig"

> I would also like help on making the programme multi threaded so that the
> comm portion can be started as a separate thread so that the main
> programme
> can get on with other things while waiting for a poll.

VB6 is not multi-threaded except for ActiveX EXE's, but even that may not be
suitable(global variables are not shared between threads). I recommend that
you design your software in such away that it returns quickly from the
OnComm event. You can't show a MsgBox in OnComm event. If you have to, defer
it to a Timer.


"JamesT" <JamesT@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A6FC7773-0B28-4302-A777-F89D7DE0E397@xxxxxxxxxxxxxxxx
>I would like to use the Windows APIs to communicate with a Device connected
> to the serial port. Can any one suggest good reading material that uses
> VB6.
> Most of what I have found gives examples in C++.
>
> The Programme is polled every 20ms by the device and the PC has to build
> the
> response ( about 7 ms) and reply very quickly. Using the MSComm control is
> too slow as the reply seems to take about 20ms to get to the device after
> the
> MSComm write command.
>
> I would also like help on making the programme multi threaded so that the
> comm portion can be started as a separate thread so that the main
> programme
> can get on with other things while waiting for a poll.
>
> Please help
>
> --
> JamesT


.



Relevant Pages

  • Re: New poll shows americans feel race was a factor
    ... This poll shows the american people are actually pretty smart. ... FIFTY-SEVEN PERCENT OF AMERICANS HAVE LOST CONFIDENCE IN GOVERNMENT TO DEAL WITH ANOTHER NATURAL DISASTER; 52% DO NOT TRUST PRESIDENT TO MAKE RIGHT DECISIONS IN A CRISIS ... In addition, 57 percent of Americans say the slow response in New Orleans has caused them to lose confidence in the government to deal with another major natural disaster, 41 percent say it has not; 47 percent say it has made them lose confidence in government to prevent another 9/11-type attack; half say it has not, the poll shows. ...
    (rec.music.dylan)
  • Re: implementing a time bound wait on the socket (TCP)
    ... Poll() method isn't reliable (the Socket may become unreasonable between   ... The ongoing design on the client side is not in ... a response in a byte buffer (there are no intentional delays on the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Bush vs. Clinton in the polls: (was OT: 43 at 29
    ... Bush's poll numbers started to deteriorate after Hurricane Katrina, ... I am not saying that I think the primary fault for the Katrina response ... disaster lies with the Feds or the Bush Administration in particular (I ...
    (rec.music.classical.recordings)
  • Re: Bush vs. Clinton in the polls: (was OT: 43 at 29
    ... Bush's poll numbers started to deteriorate after Hurricane Katrina, ... I am not saying that I think the primary fault for the Katrina response ... disaster lies with the Feds or the Bush Administration in particular (I ...
    (rec.music.classical.recordings)
  • Re: No One Thought The Levees Would Be Breached?
    ... >> It will be interesting to see the results of the next approval poll. ... >the media is generally savaging the response to the disaster. ... Someone from the Army Corps of Engineers, lying for the Bush ... to repair the dikes. ...
    (talk.origins)