Hi Everybody,
I have the Microsoft Visual Studio 2005 for Visual Basic and would like
to send out ASCII text to the serial port and then the BasicX microcontroller
reading the string of text and responding to it. Does anybody know how to
do this or better yet have sample codes?
Thanks,
Andy
[Non-text portions of this message have been removed]

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
--- In b...@yahoogroups.com, andycamach@... wrote:
> I have the Microsoft Visual Studio 2005 for Visual Basic and
would like
> to send out ASCII text to the serial port and then the BasicX
microcontroller
> reading the string of text and responding to it.
>
On the PC side it's built-in as of the 2005 version:
http://msdn2.microsoft.com/en-us/library/system.io.ports.serialport.aspx
I advise against using the events on the PC. I'd watch for input in a
loop, possibly test for it in the ApplicationIdle event of a WinForms
app, as opposed to the serial port event. Google will find you a lot
of sample code for the SerialPort class.
Jan Axelson may also have sample code on her site. She wrote a good
book on serial port programming.
The HAL in WinXP buffers the serial port events and drags down the
response time. I'd steer clear of serial port events. You don't need
them because you can peek to see if input is available, and only read
if you know input is available. If you read without a peek, it will
freeze your application until the read times out when no data is
available.
The device side shouldn't be difficult but I don't have one of these
now to give you assitance with that. I'd make an infinite loop program
that watches the serial port and responds accordingly.
Eric

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )