Forum Home › Forums › Development and Integration › Grafana (backend) and Rapid SCADA
- This topic has 25 replies, 3 voices, and was last updated 2 years, 10 months ago by Mikhail.
-
AuthorPosts
-
October 21, 2020 at 7:41 pm #7453OtavioFParticipant
Hello!
Recently I’ve built a plugin that’s similar to the SimpleJson-database used on the GrafanaDataProvider app. The difference is the support for alarms and other notifications. Here’s the source code: https://github.com/HadesArchitect/simple-json-backend-datasource
However, I’m having trouble running it, because there is some kind of conflict with Rapid SCADA. Whenever I run it using the data source, the communication service stops working.
Here’s the ScadaCommSvc.log:
2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> ScadaCommService 5.2.0.1 is started 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Load device library: KpModbus.dll 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Connect to SCADA-Server "localhost" 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ERR> Incorrect SCADA-Server response to version request 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Disconnect from SCADA-Server 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ERR> Unable to start operation due to SCADA-Server communication error. Delay before trying again
When I run with the standard SimpleJson-database, everything runs smoothly.
Any ideas of what might be happening?
Thank you in advance
October 22, 2020 at 2:39 pm #7458MikhailModeratorHello,
Could you also post here a part of the SCADA-Server log file? Let’s check how the server behaves in this period of time.
October 22, 2020 at 3:38 pm #7459MikhailModeratorSCADA-Server uses TCP port 10000 for incoming connections. You should check that other software does not occupy it.
October 28, 2020 at 6:55 pm #7473OtavioFParticipantHello!
The SCADA-Server log at the same period of time is like this:
2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> ScadaServerService 5.1.2.1 is started 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Check the existence of the data directories is completed successfully 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Check the existence of the configuration database files is completed successfully 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Input channels are read from the configuration database. Active channel count: 81 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Ouput channels are read from the configuration database 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Users are read from the configuration database 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Formulas are read from the configuration database 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> The formulas source code has been compiled 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Connection listener is started 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Start server 2020-10-21 16:39:44 <ENGENHARIA-03><SISTEMA><ACT> Current data are loaded
It seems that there is nothing wrong with Server. When checking Instance Status, Server status its “Normal”, but Communicator appears “Error”.
October 29, 2020 at 12:39 pm #7475MikhailModeratorHello,
Could you explain how does your plugin work?
It may help to find out why it affects interaction between Server and Communicator.November 4, 2020 at 8:47 pm #7494OtavioFParticipantHi!
I’m not the author of this plugin. I believe the way it works should be close to the original Simple Json database used to develop the GrafanaDataProvider app. The difference is that this plugin has support for alerts and annotations, so it’s a “backend” database plugin.
I think I’ll have to analyze the source code of the plugin and try to identify what’s causing the conflict.
November 5, 2020 at 6:49 am #7497MikhailModeratorHi,
Simple Json makes a request to the GrafanaDataProvider app in a particular format. This JSON must have specified data fields. And Simple Json expects a response that have strictly specified JSON.
Another Grafana plugin likely make request in JSON, but having other data fields.
November 5, 2020 at 11:36 am #7499OtavioFParticipantHello.
I think I found the problem and its on the TCP port. The plugin after build generates an .exe file that, when its running, I ran the CurrPorts (software to monitor the TCP/UDP ports) and the plugin’s exe is using the TCP port 10000.
I’ll have a look at the source code to see if I can change it without messing with the RapidScada. If I can’t find it, I’ll change RapidScada’s settings and see if it works.
I’ll report back with news (let’s hope they’re good ones)
November 5, 2020 at 5:02 pm #7500OtavioFParticipantIndeed there was a conflict with the TCP ports. Now I’m able to access the Web application and there’s no error whatsoever on RapidScada.
Now I’m trying to display the values on Grafana. Maybe now it’s the problem that you mentioned before, about request’s format to GrafanaDataProvider.
I’ll send updates when there is any.
November 5, 2020 at 7:02 pm #7501OtavioFParticipantI hope flooding with updates on this matter is not against the rules of the forum. hehehe
After changing RapidScada’s port to 10001 (which includes ScadaWeb, GrafanaDataProvider and within Administrator), Grafana is finally receiving data!
However, it’s fetching the wrong minute .dat file.
2020-11-05 15:45:40 Receive input channel 298 trend from SCADA-Server. File: m010101.dat
The fetched file should be m201105.dat
November 6, 2020 at 8:06 am #7503MikhailModeratorHi,
Updates are useful here.
Do you use Visual Studio? If yes, you could debug GrafanaDataProvider and find why it gets the wrong date. I suppose, it is got from the JSON request.November 10, 2020 at 5:33 pm #7511OtavioFParticipantHi,
I don’t have Visual Studio on this PC yet. After I install it, I’ll try to debug and will get back with updates.Thank you for all your help, Mikhail
November 10, 2020 at 6:25 pm #7512OtavioFParticipantSomething to think about: I’ve tested the database with the Fake Simple Json Datasource and its working flawlessly.
December 14, 2020 at 1:56 pm #7724OtavioFParticipantHello!
Could you describe how to debug the GrafanaDataProvider on Visual Studio? I got it running on my PC, Google’d some how-to but no success.
December 15, 2020 at 12:32 pm #7729MikhailModeratorHi,
Compile the app in Debug configuration and copy DLL to the destination.
Then open Debug – Attach to process – w3wp.exe -
AuthorPosts
- You must be logged in to reply to this topic.