Fishtank (6)

Article no. 6 about the fishtank, November, 2020.

Remark: source lines (no libraries) fishtank, total of 13,500

Previous publications:

Fishtank (5), system architecture and event logging
Fishtank (4)
, the instrumentation, Nov 2019
Fishtank (3), level simulation, Oct 2019
Fishtank (2), the motor valves, Sep 2019
Fishtank (1), starting a control for a sea fishtank, Aug 2019

What about the introduction of parameters? Sometimes it can be very useful to influence the control; e.g. changing setpoints for water levels or temperatures. So i have made a new screen and a new database. 

The screen:

The screen contains 26 parameters to influence the tankcontrol.

The parameters are stored in a database at the HMI side. It is a simple database with just one table. Base idea of the control, is still the phylosophy for the control to function autonomous; so the board must also have a copy of the parameters stored ...and there started the challenge...

It is possible to store data in non-volatile memory on the DUE board. Unfortunately there is one problem; each time a new control is uploaded to the board, the flash memory -the memory space for the non-volatile data- is erased! It is for that reason, not possible to use the DUE board to store the data. It is possible to install a shield or some kind of SD card storage, but why not use the already installed GSM sim800L? The sim800L is capable of saving phonenumbers; why not parameters? I've implemented this option as the databuffer for saving the control parameters. I've used the "AT+CPBW=" command to write the data to the sim800L, using the phonenumber entries for the parameters and the name entries for the parameter names and used the "AT+CPBR=" command to read the data out of the sim800L memory. 

Start of the control

At the start of the DUE board a default set of parameters (hard coded) are set as control parameters. Then -when the loop is started-, all parameters stored on the sim800L overwrite the default parameter set. When HMI is active, the parameters are logged onto the alarmlist (but not stored in the max 100 lines of alarm items). 

Change of parameters

When HMI is started, go to the parameterscreen by  selecting "parameters" from the main menu. With the new parameter screen -coupled on a MS Access database- you can easily send new values to the control. The columns "current", "previous", "default" and "description" are editable. A changed value in column "current" will be send to the board and processed after pressing the button "write to board". By default, an updated parameter value is uploaded to the sim800L memory. When the button is pressed, a message with the new information is send to the board. It will be processed by the board and a message is send back to HMI. The changed parameter lines on the paramaterscreen, will now be painted light green, to signal a succesful update of the parameter on the board. There is also a "get all from board" button on the parameterscreen. With that button the board is triggered to send all parameters back to HMI and update the parameterscreen.