Define the Driver’s Settings
By extending the PersistentRecord class, you can define any configurable properties your driver needs to present to the user, as well as a few pieces of metadata that are displayed in the Ignition Gateway when editing or creating a new device.
Define a Driver Type
The DriverType class is one of the base extension point type classes from which all drivers must extend. Defining a driver type will allow you to create new driver instances, as well as bridge the gap between the gateway and your driver’s settings.
Create a Gateway Module Hook
Creating a gateway module hook will allow you to register your driver with the Driver Manager, as well as enforce licensing and API version compatibility.
Registering Your Driver
Registering your DriverType is a three step procedure:
- Implement the ModuleServiceConsumer interface on your module's hook class. For more information about module hooks, see Scopes, Hooks, and Contexts.
During startup(), subscribe to DeviceManager.class.
In serviceRead(Class<?> serviceClass), do something like the following:
During shutdown() it's important to unsubscribe to the DeviceManager.class service as well as unregister any drivers you may have registered.
Implement the Driver Interface
All OPC-UA drivers must, at a minimum, implement the Driver interface. This interface defines the basic functionality any driver must provide - reading, writing, browsing, subscription management, and life cycle/state management.
A partially complete implementation of Driver is available by extending from AbstractDriver. Extending from this class is encouraged as the complexities derived from managing subscription state and the request life cycle of your subscriptions in a highly asynchronous environment are handled for you.