Add your own Java code
TapBUS modules are programmed with generic 'Duetware' firmware. It's Java code added that makes them operational as acquisition modules. The sources are available in the Iotize Studio installation. You can find them in the directory: {Programs}\IoTize\IoTize Studio\JVM\com\iotize\jvm\tapbus
Why change these codes?
There are several reasons why you might want to change these codes:
-
Detection of alarms on particular conditions (combinations of inputs, etc.).
-
Need for special formatting of the datalog, or alarms.
-
Perform an automation system (control outputs according to inputs or instructions).
How to proceed?
You can edit all files, but the easiest way is to act only on the main file. Thus, the overall architecture will remain functional and usable from TapBUS Manager. To do this, copy the main java file of the module you want to reprogram and the reconfiguration file outside of {Program Files}. These files are not located in the directory shown above, but in the sample directories: {Programs}\IoTize\IoTize Studio\Examples\TapBus
A directory is dedicated to each module, and copy the entire subdirectory concerned into your working directory, i.e. outside of {Program Files}. You can then edit (add variables,...) the configuration file as well as the Java file.
An example of customization is given for the LI12O4 module. In this directory, you will find a second project 'TrafficLight' that implements the management of a traffic light. You'll see that the changes mainly affect the local function TrafficLight.periodicCall().