Corsinvest.AllenBradley.PLC.Api 0.0.4

Comunication for Allen-Bradley PLC in .NET Core

There is a newer version of this package available.
See the version list below for details.
Install-Package Corsinvest.AllenBradley.PLC.Api -Version 0.0.4
dotnet add package Corsinvest.AllenBradley.PLC.Api --version 0.0.4
<PackageReference Include="Corsinvest.AllenBradley.PLC.Api" Version="0.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Corsinvest.AllenBradley.PLC.Api --version 0.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Corsinvest.AllenBradley.PLC.Api

License

Comunication for Allen-Bradley PLC in .NET Core

LibTagPLC library C++ Api

Based on libplctag-csharp

Nuget

Special tanks for testing Mavert

Corsinvest Srl

AppVeyor branch

   ______                _                      __
  / ____/___  __________(_)___ _   _____  _____/ /_
 / /   / __ \/ ___/ ___/ / __ \ | / / _ \/ ___/ __/
/ /___/ /_/ / /  (__  ) / / / / |/ /  __(__  ) /_
\____/\____/_/  /____/_/_/ /_/|___/\___/____/\__/

Client Api Allen-Bradley PLC          (Made in Italy)

General

The client is wapper of LibTagPLC library.

Main features

  • Open source
  • Controller implementation
  • Native Tag type INT8, UINT8, INT16, UINT16, INT32, UINT32, FLOAT32, STRING
  • Custom class definition structure
  • Manupulation local value variable
  • Read and Write with advanced result
    • Time execution
    • Status code
    • Timestamp
    • Tag
  • Value property decode value natively
  • Lock/Unlock for thread operation
  • Decode Error
  • Group interval read/write
  • Event result Tag and TagGroup with result changed value

Usage

[Serializable]
public class Test12
{
    public int AA1 { get; set; }
    public int AA2 { get; set; }
    public int AA3 { get; set; }
    public int AA4 { get; set; }
    public int AA5 { get; set; }
    public int AA6 { get; set; }
    public int AA7 { get; set; }
    public int AA8 { get; set; }
}

public static void Main(string[] args)
{
    //initialize controller
    using (var controller = new Controller("10.155.128.192", "1, 0", CPUType.LGX))
    {
        //ping controller
        Console.Out.WriteLine("Ping " + controller.Ping(true));

        //create group tag
        var grp = controller.CreateGroup();

        //add tag
        var tag = grp.CreateTagType<string[]>("Track", TagSize.STRING, 300);
        tag.Changed += TagChanged;
        var value = tag.Read();

        //add tag from Class
        var tag1 = grp.CreateTagType<Test12>("Test");
        tag.Changed += TagChanged;

        var tag2 = grp.CreateTagFloat32("Fl32");

        grp.Changed += GroupChanged;
        grp.Read();

    }
}

private static void PrintChange(string @event, ResultOperation result)
{
  Console.Out.WriteLine($"{@event} {result.Timestamp} Changed: {result.Tag.Name}");
}

static void TagChanged(ResultOperation result)
{
  PrintChange("TagChanged", result);
}
static void GroupChanged(IEnumerable<ResultOperation> results)
{
  foreach (var result in results) PrintChange("GroupTagChanged", result);
}

Create Tag

Are possible to create any tag:

Size are specified in TagSize.

For array specify size in definition.

Example:

public class TestArray
{
  public int InTest { get; set; }
  public int[] InTestArray { get; set; } = new int[5];
  public string[] StringTestArray { get; set; } = new string[300];
}

Custom type are class. The properties are read sequentially.

Corsinvest.AllenBradley.PLC.Api

License

Comunication for Allen-Bradley PLC in .NET Core

LibTagPLC library C++ Api

Based on libplctag-csharp

Nuget

Special tanks for testing Mavert

Corsinvest Srl

AppVeyor branch

   ______                _                      __
  / ____/___  __________(_)___ _   _____  _____/ /_
 / /   / __ \/ ___/ ___/ / __ \ | / / _ \/ ___/ __/
/ /___/ /_/ / /  (__  ) / / / / |/ /  __(__  ) /_
\____/\____/_/  /____/_/_/ /_/|___/\___/____/\__/

Client Api Allen-Bradley PLC          (Made in Italy)

General

The client is wapper of LibTagPLC library.

Main features

  • Open source
  • Controller implementation
  • Native Tag type INT8, UINT8, INT16, UINT16, INT32, UINT32, FLOAT32, STRING
  • Custom class definition structure
  • Manupulation local value variable
  • Read and Write with advanced result
    • Time execution
    • Status code
    • Timestamp
    • Tag
  • Value property decode value natively
  • Lock/Unlock for thread operation
  • Decode Error
  • Group interval read/write
  • Event result Tag and TagGroup with result changed value

Usage

[Serializable]
public class Test12
{
    public int AA1 { get; set; }
    public int AA2 { get; set; }
    public int AA3 { get; set; }
    public int AA4 { get; set; }
    public int AA5 { get; set; }
    public int AA6 { get; set; }
    public int AA7 { get; set; }
    public int AA8 { get; set; }
}

public static void Main(string[] args)
{
    //initialize controller
    using (var controller = new Controller("10.155.128.192", "1, 0", CPUType.LGX))
    {
        //ping controller
        Console.Out.WriteLine("Ping " + controller.Ping(true));

        //create group tag
        var grp = controller.CreateGroup();

        //add tag
        var tag = grp.CreateTagType<string[]>("Track", TagSize.STRING, 300);
        tag.Changed += TagChanged;
        var value = tag.Read();

        //add tag from Class
        var tag1 = grp.CreateTagType<Test12>("Test");
        tag.Changed += TagChanged;

        var tag2 = grp.CreateTagFloat32("Fl32");

        grp.Changed += GroupChanged;
        grp.Read();

    }
}

private static void PrintChange(string @event, ResultOperation result)
{
  Console.Out.WriteLine($"{@event} {result.Timestamp} Changed: {result.Tag.Name}");
}

static void TagChanged(ResultOperation result)
{
  PrintChange("TagChanged", result);
}
static void GroupChanged(IEnumerable<ResultOperation> results)
{
  foreach (var result in results) PrintChange("GroupTagChanged", result);
}

Create Tag

Are possible to create any tag:

Size are specified in TagSize.

For array specify size in definition.

Example:

public class TestArray
{
  public int InTest { get; set; }
  public int[] InTestArray { get; set; } = new int[5];
  public string[] StringTestArray { get; set; } = new string[300];
}

Custom type are class. The properties are read sequentially.

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.1.7 78 10/4/2019
0.1.6 123 7/10/2019
0.1.5 191 2/24/2019
0.1.4 116 1/25/2019
0.1.3 124 1/22/2019
0.1.2 101 1/22/2019
0.1.1 100 1/22/2019
0.1.0 108 1/22/2019
0.0.7 226 10/3/2018
0.0.6 144 9/26/2018
0.0.5 151 9/25/2018
0.0.4 152 9/25/2018
0.0.3 151 9/24/2018
Show less