Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Archiving Siemens S7 Tag's values in sqlite db #1341

Closed
gabrielbalincaaeg opened this issue Aug 29, 2024 · 9 comments
Closed

[BUG] Archiving Siemens S7 Tag's values in sqlite db #1341

gabrielbalincaaeg opened this issue Aug 29, 2024 · 9 comments
Labels
bug Something isn't working solved

Comments

@gabrielbalincaaeg
Copy link

gabrielbalincaaeg commented Aug 29, 2024

Describe the bug
Archiving Siemens S7 Tag's values in SQLite DB doesn't work and no the values aren't there, I used SQLite Studio to check if they are there. I installed FUXA 1.2.0-1832 on fresh windows 10 virtual machine and tested with Siemens S7 1500 PLC and Modbus Simulator (ModRSsim2) and KEPServerEX 6 (OPC UA driver). Values are refreshing (so I guess the driver works ) but I can't see them in the database. With Modbus simulator and KEPServerEX 6 everything works fine.

To Reproduce
Steps to reproduce the behavior:
Just add an Siemens S7 connection and activate the registration.

  1. Add Siemens S7 Connection
  2. Press Tag Options
  3. Activate Registration Enabled or/and Save if changed

Expected behavior
See the history values of Siemens S7 Tags in charts.

Environment

  • FUXA version: 1.2.0-1832
  • Node.js version: 18.20.4
  • npm version: 10.7.0
  • Platform/OS: Windows 10
  • Browser:-
@gabrielbalincaaeg
Copy link
Author

FIX :

server/runtime/devices/s7/index.js

this.polling = async function ()   // Line 99

and

// Line 110
          try {
               const result = await Promise.all(readVarsfnc);
                _checkWorking(false);
                if (result.length) {
                    let varsValueChanged = await _updateVarsValue(result);
                    lastTimestampValue = new Date().getTime();
                    _emitValues(varsValue);
                    if (this.addDaq && !utils.isEmptyObject(varsValueChanged)) {
                        this.addDaq(varsValueChanged, data.name, data.id);
                    }
                } else {
                    // console.error('not');
                }
                if (lastStatus !== 'connect-ok') {
                    _emitStatus('connect-ok');
                }
            }catch (reson) {
                if (reason && reason.stack) {
                    logger.error(`'${data.name}' _readVars error! ${reason.stack}`);
                } else {
                    logger.error(`'${data.name}' _readVars error! ${reason}`);
                }
                _checkWorking(false);
            };

@MatthewReed303
Copy link
Collaborator

@gabrielbalincaaeg create a PR for the Fix and @unocelli can review it

@martinjug
Copy link

Hi,

I'm experiencing the same issue the S7 driver is functioning and values are refreshing, but they are not being stored in the SQLite database, which means historical values can't be displayed in charts.

@unocelli unocelli added the bug Something isn't working label Sep 3, 2024
unocelli added a commit that referenced this issue Sep 3, 2024
@unocelli
Copy link
Member

unocelli commented Sep 3, 2024

Hi, @gabrielbalincaaeg Thanks a lot for the report and the fix.
I just commit in master branch

@unocelli unocelli added the solved label Sep 3, 2024
@zblack88
Copy link

Hi,

I'm experiencing the same issue the S7 driver, how to get the fix?
Thank you

@unocelli
Copy link
Member

unocelli commented Oct 1, 2024

@zblack88 Hi, please try the last version in master branch

@zblack88
Copy link

zblack88 commented Oct 2, 2024

I tried, but the last version in master branch does not have the plugin for the S7, so it does not work at all. Is required a special installation for the plugin?

@zblack88
Copy link

zblack88 commented Oct 2, 2024

Ok solved by installing the S7 plugin manually. Thanks

@unocelli
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working solved
Projects
None yet
Development

No branches or pull requests

5 participants