Question to Jan:
Hi!
First of all, i'm a hardware guy, just starting out with software.
I'm working on a project which involves PC communicating with PLC
through serial port. I'm using your article(Access Serial Ports with
Visual Basic .Net
http://www.janaxelson.com/serial_ports_dotnet.htm)
as a starting point to develop the VB.NET app.
Now i'm the point where i need to write a test applicaion which kind
of emulates the PLC. Just a simple form with a textbox. The goal is
that every time data is received the DataReceived event executes, it
reads the data to a string and sends it back to the sender and also
writes the received data to the textbox. You provide a good example
code for DataReceived routine (and adding event handler), but you say
in the article that it is running in a different program thread so
"you need to define a delegate to pass the data to the form" if i want
to write the data to the form's textbox. What is the simplest way to
do it? The example is in the ComPortTerminal demo, also found on the site, but it is way too
complicated to read for me right now(like i said im just starting with
software). I'm trying to keep everything as simple as possible at this
point.
Lauri