Introduce Lib for Adam6360D
This commit is contained in:
parent
1745d2cb06
commit
43e628502c
|
@ -1,14 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="../../InnovEnergy.lib.props" />
|
||||
<!-- <Import Project="../../InnovEnergy.Lib.props" />-->
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyName>InnovEnergy.Lib.Devices.Adam6060</AssemblyName>
|
||||
<RootNamespace>InnovEnergy.Lib.Devices.Adam6060</RootNamespace>
|
||||
<!-- <OutputType>Exe</OutputType> -->
|
||||
</PropertyGroup>
|
||||
<Import Project="../../../App/InnovEnergy.App.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../Protocols/Modbus/Modbus.csproj" />
|
||||
<ProjectReference Include="../../Units/Units.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -2,7 +2,7 @@ using InnovEnergy.Lib.Protocols.Modbus.Channels;
|
|||
using InnovEnergy.Lib.Protocols.Modbus.Clients;
|
||||
using InnovEnergy.Lib.Protocols.Modbus.Slaves;
|
||||
|
||||
namespace InnovEnergy.Lib.Devices.Adam6060;
|
||||
namespace InnovEnergy.Lib.Devices.Adam6360D;
|
||||
|
||||
public class Adam6360DDevice : ModbusDevice<Adam6360DRegisters>
|
||||
{
|
||||
|
@ -12,6 +12,7 @@ public class Adam6360DDevice : ModbusDevice<Adam6360DRegisters>
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
public Adam6360DDevice(Channel channel, Byte slaveId) : base(new ModbusTcpClient(channel, slaveId))
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using InnovEnergy.Lib.Protocols.Modbus.Reflection.Attributes;
|
||||
|
||||
namespace InnovEnergy.Lib.Devices.Adam6060;
|
||||
namespace InnovEnergy.Lib.Devices.Adam6360D;
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Local")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[AddressOffset(-1)]
|
||||
public class Adam6360DRegisters
|
||||
{
|
||||
[DiscreteInput(1)] public Boolean DigitalInput0 { get; private set; }
|
||||
|
@ -20,6 +21,7 @@ public class Adam6360DRegisters
|
|||
[DiscreteInput(11)] public Boolean DigitalInput10 { get; private set; }
|
||||
[DiscreteInput(12)] public Boolean DigitalInput11 { get; private set; }
|
||||
[DiscreteInput(13)] public Boolean DigitalInput12 { get; private set; }
|
||||
[DiscreteInput(14)] public Boolean DigitalInput13 { get; private set; }
|
||||
|
||||
[Coil(33)] public Boolean Relay0 { get; set; }
|
||||
[Coil(34)] public Boolean Relay1 { get; set; }
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
using InnovEnergy.Lib.Units;
|
||||
using InnovEnergy.Lib.Utils;
|
||||
|
||||
namespace InnovEnergy.Lib.Devices.Adam6360D;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
public static Task Main(String[] args)
|
||||
{
|
||||
var d = new Adam6360DDevice("localhost", 2, 5006);
|
||||
|
||||
while (true)
|
||||
{
|
||||
var x = d.Read();
|
||||
x.ToCsv().WriteLine();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue