Main Site Documentation

Global serial


#1

Hi, I am wondering how to declare or create a serial port so that it can be used by all classes and methods. Can this be done, and how?
Thanks


#2

Public static SerialPort myser
or
public SerialPort myser

If it’s public, everything can see it :slight_smile:


#3

Can you expand on exactly where to put this and how to define the port.


#4

When you declare the property, you will declare it right after the class

class something
{
public SerialPort theserialport;
}

Please read the free ebook in the downloads section.


#5

Eureka! I figured it out. Your pointer helped immensely.
Thanks


#6

No problem!