From the last code change, you will have to take it a step further and add a Property:
Public Property PortNumber As UShort = 9600
Then in the code where the port number is set (line 173), it will use the property value
DLL(MyDLLInstance).Port=PortNumber