Connection Extension / BaseModule
If you plan to write a general communication protocol integration then this is the correct page for you.
The sp.BaseModule supports events as well as actions.
- Receive commands and/or data within Grid.
- Send commands and/or data from Grid.
- Supports user data
If you plan to develop a device/endpoint specific implementation, please see sp.BaseDevice
Sample
This are the minimum requirements to register a plugin:
import sp
class IO_Plugin(sp.BaseModule):
pluginInfo = {}
def __init__(self):
sp.BaseModule.__init__(self)
if __name__ == "__main__":
sp.registerPlugin(IO_Plugin)

Main Class
The class name IO_Plugin can be customized and should be unique.
class IO_Plugin(sp.BaseModule):While sp.BaseModule can´t be renamed.
When a class name is already been use, you will get a notification within the log like this:
BaseObject IO_Plugin already existing, overwriting with new one.
You need to have Project loading logging enabled to see this kind of messages.
Plugin Info
Each plugin needs a pluginInfo parameter.
Within this you can define Icons, search Keywords, custom object names and much more.
For more information see here.
Initialization
Within your Main Class it´s necessary to define a function for the initialization:
def __init__(self):
sp.BaseModule.__init__(self)Register
To register the plugin you need the following lines of code outside of your Main Class:
if __name__ == "__main__":
sp.registerPlugin(IO_Plugin)Last updated