0 Members and 1 Guest are viewing this topic.
I can say that it looks like you are redefining the serial port which was already defined when the script ran on the VC.Loaded event. As soon as you redefine the Serial port you have created a new instance of it and have lost the handle to the original object which means you can no longer close it! (I think).Since your script is defining a gloabal variable for the serial port, make sure that you only run that script once, and all your other scripts can continue to use it.