pyscada / PyScada

PyScada is a open source scada system that uses the Django framework as backend
http://pyscada.rtfd.io/
GNU Affero General Public License v3.0
537 stars 165 forks source link

Encode value for device write fails for int values #147

Closed trombastic closed 1 week ago

trombastic commented 6 months ago
[26/May/2024 17:39:37] ERROR [pyscada.utils.scheduler:923] pyscada.modbus-5-
192.168.xx.xx:502-0, unhandled exception
Traceback (most recent call last):
 File "/home/pyscada/.venv/lib/python3.9/site-
packages/pyscada/utils/scheduler.py", line 822, in run
   status, data = self.loop()
 File "/home/pyscada/.venv/lib/python3.9/site-
packages/pyscada/utils/scheduler.py", line 1711, in loop
   tmp_data = device.write_data(var_id, task.value, task)
 File "/home/pyscada/.venv/lib/python3.9/site-
packages/pyscada/modbus/device.py", line 421, in write_data
   list(self.variables[variable_id].encode_value(value)),
 File "/home/pyscada/.venv/lib/python3.9/site-packages/pyscada/models.py", line
2164, in encode_value
   output = unpack(target_format, pack(source_format, value))
struct.error: required argument is not an integer