LazyMe,
You are correct. I'm getting my ports mixed up...
Newf69,
Now that I have been straightened out, the voltage you will need outputted from your comparitor will need to be 12VDC, not 5VDC as I said before.
On to the code.
I don't think the SER_Send DLL that you show is necessary. Is it just supposed to open and close a port, and send data? You do that with the MSComm control, so you don't need an extra DLL for that.
You need to add a reference to the MSCOMM control in your project, then place one of them on your form. Then you can open the port that you want and read / transmit data.
You have to open the port before it will send anything out.
Please look through the MSDN help and look up the MScomm control, and read up on it.
You are sending the output of the Mscomm control as the variable "message", but you don't set that variable until after you are doing the output. You have to set the variable *before* you send it.
Plus, you are setting the variable "message" but outputting "message2" at one point.
What is the line "Delay 1" for?
Also, you have:
Do Until MSComm1.DSRHolding = True Or intEnd = 1
As a check for your loop. If you think that pressing the exit key will set that intEnd variable when your loop is running, it will not, because you will not get the event for the button click until after the loop ends. You could use DoEvents in the loop to get the button click though, but you should avoid that if possible. I would use a timer to check the state of the DSR line, and not put the code in a loop.
The other problem is that the next line of code in your exit click event is "END". The program will stop right there.
Incidentally, you should practically never use END to stop a program. Use "Unload" instead.
If you still have questions, then please ask us.
Robert