The last step of building a driver is to create a web interface.
All in all, we need two of them - one to set up a connection to the data source itself (ie. the address of the server, login details etc) and one to bind a single ARDI property to data from that source (ie. choosing a column from a database, tag from a historian etc.).
At its simplest, it will require a little working knowledge of HTML.
Firstly, copy one of the existing drivers user interfaces by copying /opt/ardi/web/data/live/text to /opt/ardi/web/data/live/text2 (the folder name must match the name of the driver folder & file).
There are several PHP files in this folder. Click on them for examples and documentation on what they do.
| File | Purpose |
|---|---|
| info.inc | Provides details on the driver |
| configure-source.php | The user interface for setting up the data source |
| saveconfig-source.php | Convert the properties set in configure-source.php to a machine-readable address string |
| friendlyname.php | Convert the address from saveconfig-source.php to a human-readable text string |
| link.php | The user interface for setting up a data link between the source and an asset property |
| encode.php | Convert the properties set in link.php to a machine-readable address string |
| decode.php | Convert the address from encode.php to a human-readable description |
Edit these individual files to provide user interfaces, and save the content of those interfaces.
It's perfectly acceptable to have a simple, straight-forward interface with minimal features.
But if you'd like to make your users work-flows faster, you may also want to consider making your UI work with your data source.
If you need to handle files or very long connection strings/security identifiers, see the section on working with large addresses.