frangoteam / FUXA

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

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

Closed henjoe closed 3 weeks ago

henjoe commented 1 month 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 1 month 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.

unocelli commented 1 month ago

Hi, this issue is already be fixed (Script OK is used when you test)

unocelli commented 3 weeks ago

I’m going to close this as resolved. let me know if you have any issues.