30.04.2021, 05:37
Errors are stored in a separate DB table. There's no direct way of placing these error into alerts.
You can show them in the visualization via .lp file placed into an iframe. This will show a table with the latest 50 Modbus error logs:
You can show them in the visualization via .lp file placed into an iframe. This will show a table with the latest 50 Modbus error logs:
Code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="/apps/css/bootstrap.css">
</head>
<body>
<table class="table table-striped">
<tr>
<th>Date/time</th>
<th>Error</th>
</tr>
<?
require('apps')
items = db:getall([[
SELECT * FROM modbus_errors
ORDER BY errortime DESC
LIMIT 50
]])
for _, item in ipairs(items) do
datetime = os.date('%Y.%m.%d %H:%M:%S', item.errortime)
?>
<tr>
<td><?=datetime?></td>
<td><?=escape(item.errortext)?></td>
</tr>
<? end ?>
</table>
</body>
</html>