Skip to content

Commit

Permalink
Improve Tag creation
Browse files Browse the repository at this point in the history
  • Loading branch information
franklupo committed Jan 22, 2019
1 parent 404f27c commit 8e03a7c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 13 deletions.
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The client is wapper of LibTagPLC library.

- Open source
- Controller implementation
- Native Tag type INT8, UINT8, INT16, UINT16, INT32, UINT32, FLOAT32, STRING
- Native Tag type INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT32, FLOAT64, STRING
- Custom class definition structure
- Manupulation local value variable
- Read and Write with advanced result
Expand All @@ -63,6 +63,8 @@ The client is wapper of LibTagPLC library.
- Enable "Fail Operation Raise Exception"
- Value Manager directry modify
- Bit manipulation
- Debug level
- Auto Read/Write when using value (default: false)

## Usage

Expand Down Expand Up @@ -117,6 +119,7 @@ static void TagChanged(ResultOperation result)
{
PrintChange("TagChanged", result);
}

static void GroupChanged(IEnumerable<ResultOperation> results)
{
foreach (var result in results) PrintChange("GroupTagChanged", result);
Expand All @@ -127,17 +130,20 @@ static void GroupChanged(IEnumerable<ResultOperation> results)

Are possible to create any tag:

- [CreateTagInt32](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L81)
- [CreateTagUInt32](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L89)
- [CreateTagInt16](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L97)
- [CreateTagUInt16](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L105)
- [CreateTagInt8](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L113)
- [CreateTagUInt8](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L121)
- [CreateTagString](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L129)
- [CreateTagFloat32](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L137)
- [CreateTagType specify type and name only, and automatcly calculated size from property or array](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L146)
- [CreateTagType specify name,size,length for array](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L163)
- [CreateTagArray](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs#L178)
- CreateTagInt64
- CreateTagUInt64
- CreateTagInt32
- CreateTagUInt32
- CreateTagInt16
- CreateTagUInt16
- CreateTagInt8
- CreateTagUInt8
- CreateTagString
- CreateTagFloat32
- CreateTagFloat64
- CreateTagType specify type and name only, and automatcly calculated size from property or array
- CreateTagType specify name,size,length for array
- CreateTagArray

Size are specified in [TagSize](https://github.com/Corsinvest/cv4ab-api-dotnet/blob/master/src/Corsinvest.AllenBradley.PLC.Api/TagSize.cs).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>0.1.0</Version>
<Version>0.1.1</Version>
<Company>Corsinvest Srl</Company>
<Authors>Daniele Corsini</Authors>
<Copyright>Corsinvest Srl</Copyright>
Expand Down
24 changes: 24 additions & 0 deletions src/Corsinvest.AllenBradley.PLC.Api/TagGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ public void RemoveTag(ITag tag)
#endregion

#region Create Tags
/// <summary>
/// Create Tag Int64
/// </summary>
/// <param name="name">The textual name of the tag to access. The name is anything allowed by the protocol.
/// E.g. myDataStruct.rotationTimer.ACC, myDINTArray[42] etc.</param>
/// <returns></returns>
public Tag<long> CreateTagInt64(string name) { return CreateTagType<long>(name); }

/// <summary>
/// Create Tag UInt64
/// </summary>
/// <param name="name">The textual name of the tag to access. The name is anything allowed by the protocol.
/// E.g. myDataStruct.rotationTimer.ACC, myDINTArray[42] etc.</param>
/// <returns></returns>
public Tag<ulong> CreateTagUInt64(string name) { return CreateTagType<ulong>(name); }

/// <summary>
/// Create Tag Int32
/// </summary>
Expand Down Expand Up @@ -136,6 +152,14 @@ public void RemoveTag(ITag tag)
/// <returns></returns>
public Tag<float> CreateTagFloat32(string name) { return CreateTagType<float>(name); }

/// <summary>
/// Create Tag Float64
/// </summary>
/// <param name="name">The textual name of the tag to access. The name is anything allowed by the protocol.
/// E.g. myDataStruct.rotationTimer.ACC, myDINTArray[42] etc.</param>
/// <returns></returns>
public Tag<double> CreateTagFloat64(string name) { return CreateTagType<double>(name); }

/// <summary>
/// Create Tag custom Type Class
/// </summary>
Expand Down

0 comments on commit 8e03a7c

Please sign in to comment.