In this tutorial, we will add the logging of data.
The diagram below shows what you will build in this tutorial. The red dots show tutorial steps.
Now - let's get started.
When you call "Log" in the register set-method, you log data. When you call "log" from other places than in the register set-method, the system will ignore the call. The value held in the register at the time of the call of the log-command is stored as a separate log-entry.
The system stores log entries in flash memory locally in a device, in a "ring buffer". Hence, the local lifetime of logs depends on the size of the ring buffer (device dependent) and on the number, frequency, and size of logs.
Normally, the system will transfer local logs to a remote database. You can use the register variable "Log_Lifetime" to set how long you want to keep logged data in the remote database.
For example "One month" means, that you want to keep the log in the remote database for 1 month.
"None" means, that you don't want to transfer the log to the remote database. But you still log data locally.
"Permanent" means that you never want to delete the log from the remote database.
"No_logging" means that you don't log data locally. As a consequence, you will not transfer data to the remote database either.
2. Go to the type XX-Temperature_regulator_simple.
This is what your code should look like:
Do the same for register "Actual_temperature".
Replace the input (a 4-20mA slider) with a temperature regulator simulator. Orange wire to terminal 01, red wire to terminal 10 and black wire to terminal 30(GND).
The temperature regulator simulator adjusts itself to the setpoint.