Coder Social home page Coder Social logo

siemens / simatic-s7-webserver-api Goto Github PK

View Code? Open in Web Editor NEW
93.0 13.0 23.0 1.33 MB

A .NET API Client Library for the SIMATIC S7 PLC Webserver API

Home Page: https://www.nuget.org/packages/Siemens.Simatic.S7.Webserver.API/

License: MIT License

C# 100.00%
dotnet simatic siemens api json-api jsonrpc2 embedded embedded-systems factory-automation plc s7-plc sps controller plcsim client-library siemens-s7 siemens-s7-1200 siemens-s7-plcs

simatic-s7-webserver-api's Introduction

1518F

WebserverApi Client Library for .NET

This package targeting .NET Framework: 4.8, 6.0, 7.0 and .NET Standard 2.0 and above provides the user with Method calls to the PLC Webserver Api using the HttpClient to make the usage of Api functionalities easier.

  • Package name: Siemens.Simatic.S7.Webserver.API

Table of contents

Introduction

Overview

This package provides an easy way to use the functionalities of the S7 Webserver API without taking care of the HTTP requests.

In the area of the requesthandling following comfort is in place:

  • GUIDGenerator: Create IDs (with a parameterizable length) for the requests
  • ApiRequestFactory: Create ApiRequests comfortably by providing the parameters for the according request
  • ApiRequestParameterChecker: Check the parameters on their validity before sending them to the plc (reduce traffic, enhance testability)
  • ApiResponseChecker: Pre-checking of Responses by the plc, throw exceptions that tell the user about the origin of an issue.
  • ApiHttpClientRequestHandler: Send the requests provided by an ApiRequestFactory to the plc and return the result inside a class

So generally all available methods of the S7 Web API can be called easily without taking care of RequestHandling, Id generation, result parsing, etc. Furthermore some comfort functionality is implemented:

  • WebApps
    • ApiResourceHandler: Upload/Download of Web-resources (html files, js files,...)
    • ApiWebAppDataSaver: Saving the configuration of an ApiWebAppData comfortably in a json file that can be parsed by the ApiWebAppConfigParser
    • ApiWebAppDeployer: Deploy/Update of an ApiWebAppData to the plc
    • ApiWebAppResourceBuilder: Create an ApiWebAppResource from a file (html, js, ...)
  • PlcProgram
    • ApiPlcProgramHandler: Implementation to comfortably read/write all children of a struct via Bulk requests (under construction)
  • Files and Directories
    • ApiFileResourceBuilder: Build an ApiFileResource from the path to a local resource (e.g. windows file)
    • ApiDirectoryBuilder: Build a directory containing multiple files from a given ApiDirectoryBuilderConfiguration
    • ApiFileHandler: Take care of Upload/Download of a file
    • ApiDirectoryHandler: Take care of Upload/Update/download of a local directory (todo: download + deltadownload)
  • Backups
    • ApiBackupHandler: Download/Restore a backup

Functionality

The Functionalities come together in the ApiHttpClientRequestHandler that implements the IAsyncApiRequesthandler (and also in any implementation of the IApiRequestHandler - not given by example).

Further examples of usage are also provided in the UnitTests of the component.

Dependencies

Package Name Nuget Package URL Project URL(s)
NETStandard.Library https://www.nuget.org/packages/NETStandard.Library/ https://dot.net/, https://github.com/dotnet/runtime
Microsoft.SourceLink.GitHub https://www.nuget.org/packages/Microsoft.SourceLink.GitHub/ https://github.com/dotnet/sourcelink
System.Net.Http https://www.nuget.org/packages/system.net.http/ https://dot.net/, https://github.com/microsoft/referencesource/tree/master/System/net/System/Net/Http
Newtonsoft.Json https://www.nuget.org/packages/Newtonsoft.Json/ https://www.newtonsoft.com/json, https://github.com/JamesNK/Newtonsoft.Json
GitVersioning https://www.nuget.org/packages/Nerdbank.GitVersioning/ https://github.com/dotnet/Nerdbank.GitVersioning
MimeMapping https://www.nuget.org/packages/MimeMapping/ https://github.com/zone117x/MimeMapping

Engineering

Hardwaresetup

Depending on the plc you are having a different number of sessions can co-exist during operation. For details please check the manual.

Configuration

See ApiHttpClientRequestHandler.

Operation

See ApiHttpClientRequestHandler, if you are able to successfully send the ApiBrowse request and log the responses the setup is fine.

Errorhandling

Depending on the requests sent and the plc state there might be errors occurring. As an example there can only be 1 ApiTicket which needs to be closed after use. Therefore when calling e.g. WebApp.CreateResource the result might look like the following:
{"error":{"code":4,"message":"No Resources"},"id":"81dcdb3c-0704-454f-94a3-364a75b7eb4d","jsonRpc":"2.0"}
In this case the ApiHttpClientRequestHandler will throw an ApiNoResourcesException containing different scenarios when this exception might occur.

Topics (Web API methods)

ApiHttpClientRequestHandler

In the following example code you'll have to adjust the IpAddress ("192.168.1.1") and the login for your system - the Login "Everybody" with the password "" is a default user that is downloaded to the plc for the webserver once the webserver is activated in TIA portal. The used functions would fail for the default case that he doesn't have the permissions call the method (that he tried to call). It is not good practice to give a lot of rights to the user "Everybody" therefore please adjust the connectionconfiguration to your configured user with a safe password that should be able to call the methods.

To use e.g. the Api Method "Api.Browse" to get all the Methods supported by the PLC Api do the following

var serviceFactory = new ApiStandardServiceFactory();
var reqHandler = await serviceFactory.GetApiHttpClientRequestHandlerAsync("192.168.1.1", "Everybody", "");
var apiBrowseResponse = await reqHandler.ApiBrowseAsync();
foreach(var method in apiBrowseResponse.Result)
{
    Console.WriteLine(method.Name);
}

Hint: The PLC Certificate is by default not accepted by your PC - therefor you have to either download and store the certificate in the trusted root ca certificates (preferably!) or implement the validation callback for your system - a "plain" check for => true is not good practice but it will get you started in case you dont want to download and install the certificate.

...
using System.Net;
...
// For .net48
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
// For .net6.0 and greater
Siemens.Simatic.S7.Webserver.API.Services.ServerCertificateCallback.CertificateCallback = (sender, cert, chain, sslPolicyErrors) => true;

Of course you can also implement a check for the sender and so on.

WebApps

Gif_WebApp For the PLC WebApps Further Comfort can be accomplished by using the ApiWebAppData and ApiWebAppResource implementations: Generally you are free to configure everything on your own:

public static DirectoryInfo CurrentExeDir
{
    get
    {
        string dllPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
        return (new FileInfo(dllPath)).Directory;
    }
}
...
var app = new ApiWebAppData() { Name = "customerExample", State = ApiWebAppState.Enabled };
await requestHandler.WebAppCreateAsync(app);
app = (await requestHandler.WebAppBrowseAsync(app)).Result.Applications.First();
var ticketForCreation = await requestHandler.WebAppCreateResourceAsync(app, "index.html", "text/html", "2020-07-29T14:52:22Z");
await requestHandler.UploadTicketAsync(ticketForCreation.Result, Path.Combine(CurrentExeDir.FullName, "_WebApps", "customerExample", "index.html"));
// (optional) check for the Ticket state
var ticket = (await requestHandler.ApiBrowseTicketsAsync(ticketForCreation.Result)).Result.Tickets.First();
// close the ticket again!
await requestHandler.ApiCloseTicketAsync(ticket.Id);
if (ticket.State != ApiTicketState.Completed)
{
    throw new ApiTicketNotInCompletedStateException(ticket);
}
await requestHandler.WebAppSetDefaultPageAsync(app, "index.html");
// do this in a loop for all resources and perform management yourself OR            

but further comfort can be accomplished with:

AsyncWebAppDeployer, WebAppConfigParser

You can use Implementations to comfortably deploy the apps to the plc with a Deployer and FileParser for your WebAppDirectory:

var parser = new WebAppConfigParser(Path.Combine(CurrentExeDir.FullName, "_WebApps", "customerExample"), "WebAppConfig.json");
app = parser.Parse();
var deployer = serviceFactory.GetApiWebAppDeployer(reqHandler);
await deployer.DeployOrUpdateAsync(app);
var apiWebAppBroseResourcesResponse = await requestHandler.WebAppBrowseResourcesAsync("customerExample");
foreach(var resource in apiWebAppBroseResourcesResponse.Result.Resources)
{
    Console.WriteLine(JsonConvert.SerializeObject(resource, new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver(), NullValueHandling = NullValueHandling.Ignore }));
}

The Parser and Deployer also use a set of comfort functions - in case you want to know or take a look they are using:

namespace Siemens.Simatic.S7.Webserver.API.Services.WebApp {
public class ApiResourceHandler {}
public class ApiWebAppResourceBuilder {}
}

Hint: It is possible to add another parameter to the new WebAppConfigParser(,,bool ignoreBOMDifference = false): This is the case because uploading files using javascript on a webpage has shown that the BOM (Byte Order Mark) is not transmitted! Therefor if you upload a file using javascript and then make the deployer do the comparison between the file locally (windows explorer) and the one on the server(plc) the files would be different since the size is different by three bytes. To get rid of this "false positive" on a difference you can set the ignoreBOMDifference to true - but keep in mind that a change of 3 bytes would then also be accepted as no difference. The deployer would still reupload the file since the last_modified dates would not match!

PlcProgram Browse Read and Write

The PlcProgram Methods can be used to Browse available variables and to read or write their value.

...
using Siemens.Simatic.S7.Webserver.API.Models;
using Siemens.Simatic.S7.Webserver.API.RequestHandler;
using Siemens.Simatic.S7.Webserver.API.Responses;
using Siemens.Simatic.S7.Webserver.API.Models.ApiPlcProgramDataTypes;
...
// PlcProgramRead example: object will work for any plcdatatype that is implemented by the api, you could also provide "bool" here
var boolReadResult = await requestHandler.PlcProgramReadAsync<object>("\"DataTypes\".\"Bool\"");
Console.WriteLine(boolReadResult.Result);
// Tia Data Type "Date_And_Time" and "S5Time" are returned as objects - therefore an Implementation is done as the "ApiDateAndTime" and "ApiS5Time"
ApiResultResponse<ApiDateAndTime> dateAndTimeReadResult = 
    await requestHandler.PlcProgramReadAsync<ApiDateAndTime>("\"DataTypes\".\"TIA_Dates\".\"Date_And_Time\"");
DateTime myDt = dateAndTimeReadResult.Result.GetDateTime();
myDt = (new DateTime(2021, 04, 26, 16, 53, 22).AddMilliseconds(13));
await requestHandler.PlcProgramWriteAsync("\"DataTypes\".\"TIA_Dates\".\"Date_And_Time\"", new ApiDateAndTime(myDt));
dateAndTimeReadResult = 
    await requestHandler.PlcProgramReadAsync<ApiDateAndTime>("\"DataTypes\".\"TIA_Dates\".\"Date_And_Time\"");
Console.WriteLine(dateAndTimeReadResult.Result.GetDateTime().ToString("dd/MM/yyyy hh:mm:ss.fff tt"));
ApiResultResponse<ApiS5Time> s5TimeReadResult = 
    await requestHandler.PlcProgramReadAsync<ApiS5Time>("\"DataTypes\".\"TIA_Dates\".\"S5Time\"");
Console.WriteLine(s5TimeReadResult.Result.GetTimeSpan());
// TIA Data types like "Date", "Time", "LTime", "Time_Of_Day", "LTime_Of_Day" are returned as int/uint values when using
// the "simple" mode for PlcProgram.Read => it makes sense to know how to get those into a DateTime/TimeSpan:
// Example for "Date" (you'll have to adjust this for "Time","LTime",...)
var dateReadResult = await requestHandler.PlcProgramReadAsync<uint>("\"DataTypes\".\"TIA_Dates\".\"Date\"");
DateTime date = new DateTime(1990, 1, 1) + TimeSpan.FromDays(dateReadResult.Result);
date = new DateTime(2021, 04, 26);
// for writing: determine the amount of days that is between 1/1/1990 and the time you want to write => write the value as a uint
// or int or long, ... a number that is no double/float => (2 not 2.0) - thats what the plc expects
TimeSpan ts = date - new DateTime(1990, 1, 1);
await requestHandler.PlcProgramWriteAsync("\"DataTypes\".\"TIA_Dates\".\"Date\"", (uint)ts.TotalDays);

Also for these PlcProgram methods there is an Implementation for an ApiPlcProgramData object that can be used for the Api methods:

...
using System.Collections.Generic;
...
// Do not provide any variable when browsing to browse the "root" "directory" of the plc program data:
List<ApiPlcProgramData> allMyPlcProgramBlocks = (await requestHandler.PlcProgramBrowseAsync(ApiPlcProgramBrowseMode.Children)).Result;
// A DB called "DataTypes" has the variables we care about:
var myPlcProgramDataBlock = allMyPlcProgramBlocks.First(el => el.Name == "DataTypes");
var myPlcProgramDataBlockChildren = (await requestHandler.PlcProgramBrowseAsync(ApiPlcProgramBrowseMode.Children, myPlcProgramDataBlock)).Result;
myPlcProgramDataBlock.Children = myPlcProgramDataBlockChildren;
// It is important to set the Parent list correctly so the variable name will be provided correctly to read/write the value of the variable
foreach(var child in myPlcProgramDataBlock.Children)
{
    child.Parents = new List<ApiPlcProgramData>() { myPlcProgramDataBlock };
}
// now we want to read the value of a variable called "Bool":
var myBool = myPlcProgramDataBlock.Children.First(el => el.Name == "Bool");
myBool.Value = (await requestHandler.PlcProgramReadAsync<bool>(myBool)).Result;
Console.WriteLine(myBool.Value);
// write the "Bool" variable
await requestHandler.PlcProgramWriteAsync(myBool, true);
// and read the value again:
myBool.Value = (await requestHandler.PlcProgramReadAsync<bool>(myBool)).Result;
Console.WriteLine(myBool.Value);

Compatibility

Use the following table to find the correct client version for each Plc version (server)

SIMATIC S7-1500:

Plc Version Client Library Version
2.9.x 1.0.x
2.9.x 2.0.x
3.0.x 2.1.x
3.1.x 2.2.x

SIMATIC S7-1200:

Plc Version Client Library Version
4.5.x 1.0.x
4.5.x 2.0.x
4.6.x 2.1.x

Hint: This Library supports more API calls than the current S7-1200 does - the S7-1200 will likely(!) support the API calls of last version of the s7-1500 but this does NOT necessarily have to be the case - for details please always check the manual for the according version.

Limitations

Currently some Features are not implemented yet. Check out the Issues to get further information about open issues.

OPC UA or Web API?

To be honest, I'm not sure that a hard comparison between OPC UA and the Web API is that useful.

Both flavors of open interoperability to other systems are fully supported and continuously developed by Siemens. Some features are supported by either one or the other, and for the features that are supported by both, it's ultimately up to your preferences.

OPC UA is a widely known and supported industry standard developed and maintained by the OPC Foundation that was created for a variety of Plug&Play communication use cases. Quite in the sense of a strategic orientation of a cross vendor interoperability. The focus here is set on data exchange in the most interoperable and efficient way (subscriptions, companion specifications, โ€ฆ). This also includes plc-to-plc-communication via OPC Client and Server.

The focus of the Web API rather is maintenance, problem finding and offering the possibility to implement small and medium-sized Web Applications. This API is based on standardized JSON-RPC via HTTPS communication with a Simatic-specific data model.

Unfortunately a general performance expectation is hard to calculate as this is highly dependent on use cases, requirements, the given environment and the used system.

For feature-specific details and evaluation of what best suits your use case, please also take a look into the manuals of OPC UA or the Webserver.

Further Information about PLC (Webserver)

See Also:

SIMATIC S7-1500:

SIMATIC S7-1200:

simatic-s7-webserver-api's People

Contributors

bobobass84 avatar dependabot[bot] avatar kircmax avatar ptku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simatic-s7-webserver-api's Issues

Write struct by Children containing Array

Prior to implementing support for arrays in structs the following feature must be implemented:
#1
afterwards the Extension PlcProgramReadStructByChildValues/ ApiPlcProgramHandler shall be checked to support writing by writing children also for the arrays

Problem with PlcProgramBrowseAsync with Struct[]

Discussed in #74

Originally posted by micheleBridi March 19, 2024
I'm trying to make the browser of a datablock 42, its structure is this:
image

But when I try to browse AlarmsTime of type struct[] I get this error:
The dimensions and edges of the array-indexes do not match the typeinformation of the plc. Did you provide a (correct) index?

the code I'm using is this:

`
public async Task PlcProgramBrowse()
{
try
{
var allMyPlcProgramBlocks = (await requestHandler.PlcProgramBrowseAsync(ApiPlcProgramBrowseMode.Children)).Result;

     foreach (var block in allMyPlcProgramBlocks.Where(f => f.Db_number is 42))
         await RetrieveInfo(block);
 }
 catch (Exception e)
 {
     Console.WriteLine(e.Message);
 }

}

public async Task RetrieveInfo(ApiPlcProgramData block)
{
try
{
if (block.Has_children ?? false)
{
var items = (await requestHandler.PlcProgramBrowseAsync(ApiPlcProgramBrowseMode.Children, block)).Result;

         block.Children = items;

         foreach (var child in block.Children)
             child.Parents = GetFather(block);

         foreach (var item in items)
         {
             try
             {
                 switch (item.Datatype)
                 {
                     case ApiPlcProgramDataType.Struct:
                     case ApiPlcProgramDataType.DataBlock:
                         await RetrieveInfo(item);
                         break;
                     default:                          
                             Symbolics.Add(item);

break;
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}

public List GetFather(ApiPlcProgramData myPlcProgramDataBlock)
{
var result = new List();

 if (myPlcProgramDataBlock.Parents != null && myPlcProgramDataBlock.Parents.Count != 0)
     result.AddRange(myPlcProgramDataBlock.Parents);

 result.Add(myPlcProgramDataBlock);

 return result;

}
`

PlcProgram.Browse solution is not the most user-friendly right now

In development we have had the little conflict that we didn't want to do stuff the user wouldn't expect a function to do.
BUT not setting the Parent (and the parents parents) in the PlcProgram.Browse makes the browsed resources "not browsable" therefore maybe this should be changed... Maybe this also is rather something we should have a Discussion about.

S7-1500 Firmware Version V3.0 Library Update

As a Library user I want to be able to use the new API methods introduced with the S7-1500 PLC Firmware version V3.0.
A list of the method follows, also a little list of comfort methods we want to provide.

Why should I use the webserver-api?

First of all, I would like to thank siemens for finally realising that open source is the way forward.

I would like to know what the added value of this interface is compared to the OPC interface? Or why should I use this interface at all? Do I have a better performance compared to OPC?

As a small side note. Maybe you(siemens) will manage to make your TIA projects compatible with git as well. Unfortunately, your sales people advertise ignorance and the fact that git is not worth mentioning in order to integrate it. ๐Ÿคฆโ€โ™‚๏ธ

Readme about new Methods of V3.1

As a library user I would like to get a general understanding of the new features of the s7-1500 WebApi of firmware version V3.1 by just taking a quick look at the Readme of this project.
Therefore I'd like the readme to be extended accordingly.

ApiDirectoryHandler does not support Downloading

Currently the ApiDirectoryHandler does not support downloading an "online" ApiFileResource (from the plc) - which might also be a directory. I as a library user would like to have that support and - even better - have an option to update my local files based on a comparison of the plcs files with my local files.

Implement IProgress<int> in ApiWebAppDeployer

As a GUI creator I would like to be able to

  • know how many items the ApiWebAppDeployer will have to take care of (appExceptBrowsed.Count)
  • show the progress of the ApiWebAppDeployer deployment => after each DeployResourceAsync(webApp, r); 1 more is done
  • Use a method GetDifferenceAsync(ApiWebAppData webApp) that will determine the appExceptBrowsed.Count => will return all items of the webApp in case it is not yet present on the plc

Consider also implementing an Event OnDeployFinished or something alike (then the deploy step itself might also just be performed "fully" in the background and not awaited in the GUI)

Chore: Remove unused package reference

Not required at the moment:

  • Moq -> 4.20.70
  • System.Web.Http.Common -> 4.0.20126.16343

System.Web.Http.Common leads additionally to strange behavior, due to the incompatibility >= net481

Capture

Only framework specific (net48) required:

  • System.Net.Http -> 4.3.4
<PackageReference Include="System.Net.Http" Version="4.3.4" Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'" />

.NET 8 support

As a .NET developer I always want to use the latest and greatest.
Therefore I'd like this library to be built for .NET8 aswell.

ApiFileResource stores same information multiple times

Since the ApiFileResource stores the Information of the FilePath just like the parent - the ApiFileResource being a directory - the filepath shall be determined using it's parents and only the necessary information shall be stored ==> only the "root" parent shall contain the info to the according directory, the sub-directories paths and then the filepath shall be determined via the parents array

maybe also the parents array shall only be a parent reference since there are not actually multiple but instead the parent has its parent... (cleaner recursion aswell I guess)

Support for Arrays in ApiPlcProgramData

The ApiPlcProgramData should create the Children when ArrayDimensions are set (that's why the order is of value 1 => last information).
Either the Children Array should be filled (should the "Has_children" be set (prob. not)) or another List "ArrayChildren" or maybe "ArrayElements" should be filled (since its different to the "normal" children (it's not (necessarrily) a struct - it's an array!)...

RequestFactory: Enhance consistency and provide more services

GetPlcProgramHandler => GetApiPlcProgramHandler

Also provide GetService method for services that do not need parameters currently
=> GetApiWebAppResourceBuilder
=> GetApiWebAppDataSaver

Maybe also:
=> GetApiWebAppConfigParser(parameters)
=> GetGuidGenerator(parameters)
=> GetCharSetIdGenerator(parameters)
=> GetResponsechecker...
=> GetRequestFactory()?
...

.netcore support

Having tried the RequestHandler in a .netcore app has shown that the requests haven't been sent (and responses received) as expected - we currently don't know why this is an issue.

Support for ApiBulkRequestHandler

As a library user I'd like the library to take care of requests growing >64kb therefore I'd like to use an ApiBulkRequestHandler that'll take care of the seperation (splitting) the Bulk Request containing many many ApiRequests into multiple Sub-Bulk-Requests and then returning either an Array of the ApiBulkRequestResponse or one ApiBulkRequestResponse that contains ALL the Responses

Read struct by children containing array

Prior to implementing support for arrays in structs the following feature must be implemented:
#1
afterwards the Extension PlcProgramReadStructByChildValues shall be checked to support reading by children also for the arrays

Support in Requesthandler to AutoExtendSession

Currently if no further requests are sent the session will be closed after the timeout - the requesthandler could have a setting and in case it is set the requesthandler could send an Api.Ping every INTERVAL (maybe configurable/30seconds/...)

Feature: configuring dependabot security updates

That little robot takes care of updates concerning github-actions and the nuget package ecosystem.

Add dependabot.yml with this:

version: 2
updates:
  - package-ecosystem: "nuget"
    directory: "/"
    schedule:
      interval: "daily"
      
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "daily"

Should take care of it.

CancellationToken on ServiceFactory, RequestHandler

As a GUI/application developer I would like to be able to

  • Cancel Pending Requests
  • Provide a Cancellation token to requetss
  • Provide a Cancellation token to the servicefactory when retrieving the ApiHttpClientRequestHandler

Classes ToString() overriding

As a library user I'd like to see the content of the classes int he debugger without opening up every single entry. Therefore I'd like the classes to 'nicely' override the ToString() method in a manner that I can use the data I will see by it.

Support Api Methods with Firmware V3.1.0

As a Library user I would like to be able to use all the newest methods available with S7-1500 Firmware Version V3.1.0:

  • Api.GetQuantityStructures
  • Api.ChangePassword
  • Api.GetPasswordPolicy
  • Api.GetAuthenticationMode
  • WebServer.SetDefaultPage
  • WebServer.ReadDefaultPage
  • PlcProgram.DownloadProfilingData
  • PlcProgram.Browse with CodeBlocks support
  • Plc.ReadModeSelectorState
  • Plc.SetSystemTime
  • Plc.SetTimeSettings
  • Alarms.Browse
  • Alarms.Acknowledge
  • Syslog.Browse
  • DiagnosticBuffer.Browse
  • Modules.DownloadServiceData
  • Project.ReadLanguages

Implement a Logger

Currently there is no implementation for the library to log method calls/etc. to retrace what was going on in case of issues.

Refactor structure (new version will be necessary): Don't double Implement Features "on top" of the "basic" client -> Server functionality

Refactor structure (new major version will be necessary): Don't double Implement Features "on top" of the "basic" client -> Server functionality => Unify IApiRequestHandler and IAsyncApiRequestHandler to IApiRequestHandler containing async and awaited functionality...
=> Pack "Extensions" of AsyncApiRequestHandler into Own Handlers => ResourceHandler and PlcProgramHandler

Refactor ThreadSleepTime => Don't sleep in functions either sleep right at the RequestGenerator or maybe use another IdGenerator that implements the wanted features without waiting as long.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.