frangoteam / FUXA

Web-based Process Visualization (SCADA/HMI/Dashboard) software
https://frangoteam.org
MIT License
2.76k stars 812 forks source link

[BUG] ScaleRead Script Return Null when value is Zero (0) #1435

Open henjoe opened 2 hours ago

henjoe commented 2 hours ago

Describe the bug When the return value from the script is Zero, the value will be

Script OK: null

To Reproduce Steps to reproduce the behavior:

  1. Add any Tag on any device
  2. Create script that will always return Zero value for example:
    return value * 0
  3. See the return value in the Device list page.

Expected behavior It should return Zero value.

Screenshots image

Environment

henjoe commented 2 hours ago

Under the Server\runtime\scripts\index.js Simply edit the line 84 from

resolve(result || `Script OK: ${script.name}`);

to this, solve the problem.

resolve(result);

Just simply remove the

 || `Script OK: ${script.name}

solves the problem. I don't what is this for, but yeah.