This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus error handling
#2
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:
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>
Reply


Messages In This Thread
Modbus error handling - by JRP - 29.04.2021, 17:43
RE: Modbus error handling - by admin - 30.04.2021, 05:37
RE: Modbus error handling - by JRP - 30.04.2021, 08:24
RE: Modbus error handling - by admin - 30.04.2021, 08:26
RE: Modbus error handling - by JRP - 30.04.2021, 08:47
RE: Modbus error handling - by Daniel - 30.04.2021, 12:12
RE: Modbus error handling - by JRP - 30.04.2021, 15:01
RE: Modbus error handling - by Daniel - 30.04.2021, 15:04
RE: Modbus error handling - by JRP - 30.04.2021, 15:21
RE: Modbus error handling - by Daniel - 30.04.2021, 15:25
RE: Modbus error handling - by JRP - 30.04.2021, 15:26
RE: Modbus error handling - by Daniel - 30.04.2021, 15:37
RE: Modbus error handling - by JRP - 30.04.2021, 15:44
RE: Modbus error handling - by Daniel - 30.04.2021, 15:46
RE: Modbus error handling - by JRP - 30.04.2021, 15:47
RE: Modbus error handling - by Daniel - 30.04.2021, 15:49
RE: Modbus error handling - by JRP - 30.04.2021, 15:57
RE: Modbus error handling - by Daniel - 30.04.2021, 16:14
RE: Modbus error handling - by JRP - 03.05.2021, 16:16

Forum Jump: