Ok, another Serial Port question.
This might start a debate but it’s a general programming practice question…
Is it ok or acceptable to have more than one event in different parts/threads of the program to send UART/Serial Port data.
I have a Main .Net Forms application I am getting together (thanks Chris for the joystick example again), which receives a Temperature reading from the Panda and displays it on the Form.
Well on the Panda side I have just a Temp thread that sends that data.
I guess I would like to send other commands back to the Main Computer form, but maybe in a different thread.
For example, I have a thread now that sends the Temperature data, I would also like to send an update every so many seconds or maybe on demand from the computer that the Panda is still “OK”, basically a ping event saying the Panda is still reading.
So basically I would like to have a different thread that says, “Everything is OK” as desired.
I realize, from code it shouldn’t matter, but I was just wondering what others my think having multiple “Send” Serial Port events throughout a program.
I do realize that I should only have one “Receive” event and just parse and push the data around as needed.
Any feedback would be great.
Mike in MN
FYI, the “Are you OK” or “Ping” to the Panda is part of the bigger picture for the Underwater ROV project I am building. In the event that a receive command isn’t trigger so or something of that nature I plan on having an automatic surface method trigger. The “Computer” asking if everything is “OK” would be something of a status field on the form. Just in case I lose connection, or there is a communication break down.