Re: simple serial string display help



It sounds ( from your urging) that invalidating the display is the way
to go. Could you perhaps point me in the direction of how to do that?

I figured that my I/O thread would just constantly update an averaged
array ( averaged over the last few readings) , and then when the
display invalidation comes along, it just takes the averaged value. I
figured if I do that, then I will have to worry less about spiking
values.

thanks!


Paul G. Tobey [eMVP] wrote:
Ok, I had the serial string stuff already from various examples I had
found across the net. So I am glad to see you have the same stuff here,
it reasures me that I am on the right track.
The CreateThread() is for creating the thread to check the serial port
I assume, yes?

Yes, your UI loop won't be running to receive that serial data, so it makes
no sense to read it there.

I figure that I could induce a screen re-draw if the
WaitCommEvent thread for receiving data was running simultaneously with
the WinMain thread . ( I am assuming that this wait event acts like an
interrupt and jumps to a portion of pre-defined code once the interupt
condition is met).
If thats the case, why couldn't I just put in all the screen redraw
stuff under the "subroutiene" of getting the serial data?

Since you're going to have to have a thread to call WaitCommEvent(), anyway
(you can't put that in the UI thread!), you might as well just do the I/O
there, too. You're going to have major flicker on the display updating with
every character, as it is. You're not going to like the result, I can
almost guarantee, but, if it's just a test program to make sure that serial
I/O is working, then I guess you may be able to live with it.

Let me add that this is going to go onto a Pencentra handheld tablet
and is ultimately going to end up in my old Bronco. I hopefully will
get it to communicate with an Atmel microcontroller and get the ADC
data from it(the Atmel). There are 8 ADC's each having 8bit usable
resolution, for vaious sensors that are on the vehicle such as
temperature, pressure, oxygen(in the exhaust), etc.... Basically I want
to display the 8 sensors, their digitized values on the Handheld, and I
would like to do it as the data comes in. Later in life, I want to use
one of the parallel ports on the Atmel to Bitbang a GPS signal into the
serial stream going to the handheld, but that is a much later project.

Anyhow, I hope this helps you understand where I am going with all
these crazy questions...

What you'll want to do is use a separate thread to get the data and
interpret it. Once a second or thereabouts, you can invalidate the display
and update your gauges, dials, etc. You're going to have to do some kind of
double-buffering, though, with the display, I think, to avoid flickering
like crazy.

Paul T.

.



Relevant Pages

  • Re: simple serial string display help
    ... I figured that my I/O thread would just constantly update an averaged ... display invalidation comes along, it just takes the averaged value. ... Paul G. Tobey wrote: ... , you might as well just do the I/O ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: 8051 floating pt routines
    ... > for display. ... For i/o I scaled to an integer in 6554..65535 and a power of ten, ... the broken "Reply" link at the bottom of the article. ...
    (comp.arch.embedded)
  • Re: A nice enhancement to SHOW SYSTEM
    ... The I/O figure is too big to fit in the current display! ... inconceivable that anybody would do a gig of I/O without rebooting the ... easy job to change this? ...
    (comp.os.vms)
  • Re: Any Windows CE devices that can replace PLCs?
    ... wouldn't support that, even if it ran CE 4 or 5), but we are working on more ... Since you only want a little bit of a display, you might also look at adding ... that via serial I/O. ... >> powerful solution that goes beyond typical ladder logic programming. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: simple serial string display help
    ... get it to communicate with an Atmel microcontroller and get the ADC ... to display the 8 sensors, their digitized values on the Handheld, and I ... these crazy questions... ...
    (microsoft.public.windowsce.embedded.vc)