From abd2d24e6ce4e183114e22cc26b63cebbf8fd242 Mon Sep 17 00:00:00 2001 From: atef Date: Tue, 26 Nov 2024 11:36:48 +0100 Subject: [PATCH] Update Adam6360D and Relay class --- .../SaliMax/src/SaliMaxRelays/RelaysRecord.cs | 25 +++++++++++++++---- .../Devices/Adam6360D/Adam6360DRegisters.cs | 9 ++++++- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/csharp/App/SaliMax/src/SaliMaxRelays/RelaysRecord.cs b/csharp/App/SaliMax/src/SaliMaxRelays/RelaysRecord.cs index fbc558c35..488df207c 100644 --- a/csharp/App/SaliMax/src/SaliMaxRelays/RelaysRecord.cs +++ b/csharp/App/SaliMax/src/SaliMaxRelays/RelaysRecord.cs @@ -11,6 +11,11 @@ public interface IRelaysRecord Boolean FiWarning { get; } Boolean FiError { get; } Boolean K2ConnectIslandBusToGridBus { get; set; } + Boolean Wago1Status { get; } //need to assign names to the Wago 1,2 ... + Boolean Wago2Status { get; } //need to assign names to the Wago 1,2 ... + Boolean Wago3Status { get; } //need to assign names to the Wago 1,2 ... + Boolean Wago4Status { get; } //need to assign names to the Wago 1,2 ... + } public class RelaysRecord : IRelaysRecord @@ -22,6 +27,11 @@ public class RelaysRecord : IRelaysRecord public Boolean K1GridBusIsConnectedToGrid => _Regs.DigitalInput6; public Boolean K2IslandBusIsConnectedToGridBus => !_Regs.DigitalInput4; + public Boolean Wago1Status => _Regs.DigitalInput8; + public Boolean Wago2Status => _Regs.DigitalInput9; + public Boolean Wago3Status => _Regs.DigitalInput10; + public Boolean Wago4Status => _Regs.DigitalInput11; + public IEnumerable K3InverterIsConnectedToIslandBus { get @@ -32,11 +42,11 @@ public class RelaysRecord : IRelaysRecord yield return K3Inverter4IsConnectedToIslandBus; } } - - public Boolean K3Inverter1IsConnectedToIslandBus => !_Regs.DigitalInput0; - public Boolean K3Inverter2IsConnectedToIslandBus => !_Regs.DigitalInput1; - public Boolean K3Inverter3IsConnectedToIslandBus => !_Regs.DigitalInput2; - public Boolean K3Inverter4IsConnectedToIslandBus => !_Regs.DigitalInput3; + + private Boolean K3Inverter1IsConnectedToIslandBus => !_Regs.DigitalInput0; // change it to private should be ok + private Boolean K3Inverter2IsConnectedToIslandBus => !_Regs.DigitalInput1; + private Boolean K3Inverter3IsConnectedToIslandBus => !_Regs.DigitalInput2; + private Boolean K3Inverter4IsConnectedToIslandBus => !_Regs.DigitalInput3; public Boolean FiWarning => !_Regs.DigitalInput5; public Boolean FiError => !_Regs.DigitalInput7; @@ -58,6 +68,11 @@ public class RelaysRecordAmax : IRelaysRecord public Boolean K1GridBusIsConnectedToGrid => _Regs.DigitalInput22; public Boolean K2IslandBusIsConnectedToGridBus => !_Regs.DigitalInput20; + public Boolean Wago1Status => _Regs.DigitalInput0; + public Boolean Wago2Status => _Regs.DigitalInput1; + public Boolean Wago3Status => _Regs.DigitalInput2; + public Boolean Wago4Status => _Regs.DigitalInput3; + public IEnumerable K3InverterIsConnectedToIslandBus { get diff --git a/csharp/Lib/Devices/Adam6360D/Adam6360DRegisters.cs b/csharp/Lib/Devices/Adam6360D/Adam6360DRegisters.cs index 9717e5b48..89bb353e4 100644 --- a/csharp/Lib/Devices/Adam6360D/Adam6360DRegisters.cs +++ b/csharp/Lib/Devices/Adam6360D/Adam6360DRegisters.cs @@ -30,5 +30,12 @@ public class Adam6360DRegisters [Coil(37)] public Boolean Relay4 { get; set; } [Coil(38)] public Boolean Relay5 { get; set; } [Coil(39)] public Boolean Relay6 { get; set; } - [Coil(40)] public Boolean Relay7 { get; set; } + [Coil(40)] public Boolean Relay7 { get; set; } + + [Coil(41)] public Boolean DigitalOutput0 { get; set; } + [Coil(42)] public Boolean DigitalOutput1 { get; set; } + [Coil(43)] public Boolean DigitalOutput2 { get; set; } + [Coil(44)] public Boolean DigitalOutput3 { get; set; } + [Coil(45)] public Boolean DigitalOutput4 { get; set; } + [Coil(46)] public Boolean DigitalOutput5 { get; set; } } \ No newline at end of file