Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Serial communications problem

45 views
Skip to first unread message

Me

unread,
Aug 4, 2015, 11:06:44 AM8/4/15
to
I am using VC++ 2012 and serial transfer using Writefile & Readfile.
Serial params set to 115200baud, 8bits, no parity, 1 stop, no handshake.
Does anyone know why when I send data out to a virtual serial port there is
sometimes a delay up to 10 seconds before it actually goes out the port?
Sometimes it sends right away.
This is verified by activity led's on receiving board.
Receiving side is using FT230X USB/Serial chip.
Thanks in advance.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Victor Bazarov

unread,
Aug 4, 2015, 11:44:28 AM8/4/15
to
On 8/4/2015 11:06 AM, Me wrote:
> I am using VC++ 2012 and serial transfer using Writefile & Readfile.
> Serial params set to 115200baud, 8bits, no parity, 1 stop, no handshake.
> Does anyone know why when I send data out to a virtual serial port there is
> sometimes a delay up to 10 seconds before it actually goes out the port?

Sorry to break it to you, but your question has nothing to do with C++
language (the subject of this newsgroup). Perhaps you can find a better
place to ask your OS- and hardware-specific question. So, to answer
your question, somebody in the newsgroup dedicated to serial
communication in Windows (if such exists) would likely know and be able
to help with your problem, or maybe in the general Windows programming
forum...

> Sometimes it sends right away.
> This is verified by activity led's on receiving board.
> Receiving side is using FT230X USB/Serial chip.
> Thanks in advance.
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>

V
--
I do not respond to top-posted replies, please don't ask

Öö Tiib

unread,
Aug 4, 2015, 11:47:43 AM8/4/15
to
On Tuesday, 4 August 2015 18:06:44 UTC+3, Me wrote:
> I am using VC++ 2012 and serial transfer using Writefile & Readfile.

There are no such things in C++. Did you write those yourself?
If so post your code. Did you mean 'WriteFile' and 'ReadFile' of Windows API?
There is whole MSDN for discussing that thing where you might get better
answers.

> Serial params set to 115200baud, 8bits, no parity, 1 stop, no handshake.
> Does anyone know why when I send data out to a virtual serial port there is
> sometimes a delay up to 10 seconds before it actually goes out the port?
> Sometimes it sends right away.

Perhaps you need to write 'Flushfilebuffers' function as well or to use
'FlushFileBuffers' of Windows API.

> This is verified by activity led's on receiving board.
> Receiving side is using FT230X USB/Serial chip.
> Thanks in advance.

Your receiving board has Windows that just blinks leds? Winner of most
uncomfortable development setup I have heard of.


seeplus

unread,
Aug 5, 2015, 1:59:54 AM8/5/15
to
On Wednesday, August 5, 2015 at 1:06:44 AM UTC+10, Me wrote:
> Does anyone know why when I send data out to a virtual serial port there is
> sometimes a delay up to 10 seconds before it actually goes out the port?

What platform is this, is it GUI?
Are you sending to an Arduino type thing?
Might get some help from that area.
If Windows, is the OS loaded down doing other stuff at times?

I have found when running non Win type threads, that you have to fit in with the Win message/slicing scheme to get attention.
You need to use an API/MFC setup for GUI operations.

Me

unread,
Aug 5, 2015, 1:11:53 PM8/5/15
to
On Tue, 4 Aug 2015 11:06:12 -0400, Me wrote:

> Path: buffer2.nntp.dca1.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
> NNTP-Posting-Date: Tue, 04 Aug 2015 10:06:27 -0500
> From: Me <m...@right.her>
> Subject: Serial communications problem
> Newsgroups: comp.lang.c++
> User-Agent: 40tude_Dialog/2.0.15.1
> MIME-Version: 1.0
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: 7bit
> Date: Tue, 4 Aug 2015 11:06:12 -0400
> Message-ID: <9ute11n5qcui.j207p1oxg5yh$.d...@40tude.net>
> X-Antivirus: avast! (VPS 150803-1, 08/03/2015), Outbound message
> X-Antivirus-Status: Clean
> Lines: 13
> X-Usenet-Provider: http://www.giganews.com
> X-Trace: sv3-U9taUM2t3C7dDlXOdibYjLEVM9ryJ16gdDoAy1WdBfgFNWwBYCQygsAPTwh/6i+mKP1eKlSMhR+XUqN!P2zRPvB44Po6qr30OGsFUxngaviCmTPNTu4vUQ37u+QnqTYFEDt5RkSVSCWASYeno/gOeQ==
> X-Complaints-To: ab...@giganews.com
> X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
> X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
> X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
> X-Postfilter: 1.3.40
> Bytes: 1606
> Xref: number.nntp.giganews.com comp.lang.c++:1031422
> X-Antivirus: avast! (VPS 150805-1, 08/05/2015), Inbound message
> X-Antivirus-Status: Clean
Just to give a little more info:
I am using Visual Studio C++ 2012 with a MFC aplication.
I tried asking in a group for MFC but the group seems dead and cannot find
another so I thought I'd give it a shot here.
The receiving board uses a LPC1768 MCU and has a usb to serial chip which
has activity indicator outputs. this board receives data from the PC to
control a custom scanner.

Paavo Helde

unread,
Aug 5, 2015, 2:01:35 PM8/5/15
to
Me <m...@right.her> wrote in
news:cs4udk2114l3.b...@40tude.net:

> Just to give a little more info:
> I am using Visual Studio C++ 2012 with a MFC aplication.
> I tried asking in a group for MFC but the group seems dead

This is probably because MFC has been out of fashion for at least 15 years.
Also beware that it contains some seriously ill-defined classes like
CSocket, hopefully you are not using something like this.

Cheers
Paavo

Cholo Lennon

unread,
Aug 5, 2015, 2:27:22 PM8/5/15
to
On 08/05/2015 02:11 PM, Me wrote:
> On Tue, 4 Aug 2015 11:06:12 -0400, Me wrote:
>
>>
>> I am using VC++ 2012 and serial transfer using Writefile & Readfile.
>> Serial params set to 115200baud, 8bits, no parity, 1 stop, no handshake.
>> Does anyone know why when I send data out to a virtual serial port there is
>> sometimes a delay up to 10 seconds before it actually goes out the port?
>> Sometimes it sends right away.
>> This is verified by activity led's on receiving board.
>> Receiving side is using FT230X USB/Serial chip.
>> Thanks in advance.
>>
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>
> Just to give a little more info:
> I am using Visual Studio C++ 2012 with a MFC aplication.
> I tried asking in a group for MFC but the group seems dead and cannot find
> another

Microsoft replaced its newsgroups with web forums in 2010. You should
ask here:

https://social.msdn.microsoft.com/Forums/en-US/home?forum=vcgeneral

Regards


> so I thought I'd give it a shot here.
> The receiving board uses a LPC1768 MCU and has a usb to serial chip which
> has activity indicator outputs. this board receives data from the PC to
> control a custom scanner.
>


--
Cholo Lennon
Bs.As.
ARG

red floyd

unread,
Aug 5, 2015, 4:21:10 PM8/5/15
to
On 8/5/2015 10:11 AM, Me wrote:
> I tried asking in a group for MFC but the group seems dead and cannot find
> another so I thought I'd give it a shot here.

I wanted to buy some meat, but the butcher was closed, so I tried to buy
some at the greengrocer's instead.

Osmium

unread,
Aug 6, 2015, 11:23:53 AM8/6/15
to
He followed the most obvious alternative he could think of. And it worked
for him, didn't it? I wasn't paying attention, nevertheless I saw at least
three useful answers.

I'm happy for him and wish him well.

0 new messages