DirectDataLink 1.0.0

CaseTunisia.Tools.DirectDataLink

This tool aim to ease sending telegram to MES using TCP IP protocol, to use it is pretty simple all you need to do is

  • Initialize service configuration:
    services.AddDirectDataLinkProxy(configuration);

and for sure don't forget to add DDLProxyConfiguration to your appsettings.json file, and here is an example of that:

    "DDLProxyConfiguration": {
    "TimeOut": 5000,
    "IpAddress": "172.21.176.1",
    "Port": "55075",
    "LocationSettings": {
      "LineNo": "88",
      "StatNo": "603",
      "StatIdx": "1",
      "FuNo": "1",
      "WorkPos": "1",
      "ToolPos": "1",
      "ProcessNo": "299"
    },
    "MethodFactorySettings": {
      "CodeDomProviderName": "CSharp",
      "CodeSuffix": "{#",
      "CodePrefix": "#}",
      "VariableSuffix": "{@",
      "VariablePrefix": "@}",
      "XPathSeparator": "@"
    },
    "Operations": [
      {
        "Name": "Login",
        "RequestVariables": [
          { "Name": "lineNo" },
          { "Name": "statNo" },
          { "Name": "statIdx" },
          { "Name": "fuNo" },
          { "Name": "workPos" },
          { "Name": "toolPos" },
          { "Name": "processNo" },
          { "Name": "user" },
          { "Name": "pwd" }
        ],
        "ResponseVariables": [
          {
            "Name": "roles",
            "Type": "Array",
            "AttributeName": "name",
            "XPath": "//root/body/structArrays/array/values"
          }
        ],
        "XMLTemplate": "<root><header eventId=\"21\" version=\"2.0\" eventName=\"plcLogIn\" eventSwitch=\"-1\" contentType=\"3\"><location lineNo=\"{@lineNo@}\" statNo=\"{@statNo@}\" statIdx=\"{@statIdx@}\" fuNo=\"{@fuNo@}\" workPos=\"{@workPos@}\" toolPos=\"{@toolPos@}\"\n    processNo=\"{@processNo@}\" processName=\"Packaging BSH\" application=\"PLC\" /><\/header><event><plcLogIn user=\"{@user@}\" pwd=\"{@pwd@}\"/><\/event><body/><\/root>"
      }
    ],
     },

  • Add a singleton middleware to your app service like:
    services.AddSingleton<IDirectDataLinkProxy, DirectDataLinkProxy>();
  • Initialize your DirectDataLink interface and you are right to go:
using CaseTunisia.Tools.DirectDataLink;
...
    private readonly  IDirectDataLinkProxy _directDataLinkProxy;
    
    public AccountController(..., IDirectDataLinkProxy directDataLinkProxy, ...)
    {
        ...
        _directDataLinkProxy = directDataLinkProxy;
        ...
    }

this is just an example of use.

No packages depend on DirectDataLink.

Version Downloads Last updated
1.0.0 484 01/19/2023