EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-03-16 01:50 PM . Last Modified: 2023-05-02 11:57 PM
Hello,
I just developed a .Net Application that queried the GeoSCADA database via an Advanced Connection and published to a remote MySQL Database and it was successful.
I am replicating that project, except it will publish to a database via an API call. The only difference is the first app was GeoSCADA 2020 and this project is ClearSCADA 2017 R3.
I have confirmed that 127.0.0.1 connects to the server on the local machine and that the port is 5481 so i don't think the ServerNode object is the issue.
The only glaring difference I see is that in the first project the line:
AdvConnection = node.Connect("Utility"); was AdvConnection = node.Connect("Utility", false);
For some reason in this project, it will only allow me to provide the clientName. Trying to add the False gives an error.
So the program is not erroring, but is instead not connecting the Database. ie, the Try...Catch... Code at the bottom.
PROJECT CODE BELOW: (Only to the Catch that is throwing the "Cannot Connect...."
using System;
using System.IO;
using System.Data;
using System.Threading.Tasks;
using ClearScada.Client;
using ClearScada.Client.Advanced;
namespace SCADA_API_Console_App
{
static class Program
{
// Global node and Geo SCADA server connection -- using ClearScada.Client.Advanced;
private static ServerNode node;
private static IServer AdvConnection;
/// <summary>
/// Program to query and publish data from the GeoSCADA database via API Call
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
async static Task Main(string[] args)
{
//Create
StreamWriter LogFiler = new StreamWriter(@"C:\SCADA_VS_Apps\SCADA_API_Console_Logfile.txt", append: true);
LogFiler.WriteLine(DateTime.Now + ": Logger Initiated.");
// Geo SCADA Connection
node = new ServerNode(ClearScada.Client.ConnectionType.Standard, "127.0.0.1", 5481);
try
{
AdvConnection = node.Connect("Utility");
}
catch
{
LogFiler.WriteLine(DateTime.Now + ": Cannot connect to Geo SCADA - Advanced Connection Failure");
LogFiler.WriteLine("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
LogFiler.WriteLine(" ");
LogFiler.Close();
Console.WriteLine("Cannot connect to Geo SCADA");
return;
}
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-03-16 02:07 PM
I should also note that it appears, i am using .Net 5.0 on the new project where the old project used .Net 4.7.2.
These are two different servers/clients.
@sbeadle I see you're quite active on here and have used your github for reference in the past, maybe you have seen this before. I am very confused why the node won't allow the false when every example contains it.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-03-16 02:48 PM . Last Modified: 2022-10-19 01:01 AM
There's going to be a few things in play.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-03-17 02:53 AM
Firstly - what Bevan wrote.
Plus:
* Very occasionally the API changes, which explains the change of arguments to Connect
* Your code did not print the exception message which can be useful to understand the problem. (catch (exception e) ... writeline( e.message ...
Steve
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.