I added a serial port com1 to my vb.net form. I created a new class and wrote a method to open the com1 and created its object in the main form and called the method and its opening.
THen i created another class wrote a method to write data to the com and same way created an object and called it but i am getting the error as port is closed. What am i doing wrong.
To open the port
public class openport public sub opencom mainform.com1.open end sub end class
//in the mian form
dim cc as openport
cc.opencom
'The above stuff works
But when i do same thing in another class for writing using
mainform.com1.write(data)
i am getting an error as port closed.