Update Adam6360D and Relay class

This commit is contained in:
atef 2024-11-26 11:36:48 +01:00
parent 1b26427e52
commit abd2d24e6c
2 changed files with 28 additions and 6 deletions

View File

@ -11,6 +11,11 @@ public interface IRelaysRecord
Boolean FiWarning { get; } Boolean FiWarning { get; }
Boolean FiError { get; } Boolean FiError { get; }
Boolean K2ConnectIslandBusToGridBus { get; set; } 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 public class RelaysRecord : IRelaysRecord
@ -22,6 +27,11 @@ public class RelaysRecord : IRelaysRecord
public Boolean K1GridBusIsConnectedToGrid => _Regs.DigitalInput6; public Boolean K1GridBusIsConnectedToGrid => _Regs.DigitalInput6;
public Boolean K2IslandBusIsConnectedToGridBus => !_Regs.DigitalInput4; 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<Boolean> K3InverterIsConnectedToIslandBus public IEnumerable<Boolean> K3InverterIsConnectedToIslandBus
{ {
get get
@ -33,10 +43,10 @@ public class RelaysRecord : IRelaysRecord
} }
} }
public Boolean K3Inverter1IsConnectedToIslandBus => !_Regs.DigitalInput0; private Boolean K3Inverter1IsConnectedToIslandBus => !_Regs.DigitalInput0; // change it to private should be ok
public Boolean K3Inverter2IsConnectedToIslandBus => !_Regs.DigitalInput1; private Boolean K3Inverter2IsConnectedToIslandBus => !_Regs.DigitalInput1;
public Boolean K3Inverter3IsConnectedToIslandBus => !_Regs.DigitalInput2; private Boolean K3Inverter3IsConnectedToIslandBus => !_Regs.DigitalInput2;
public Boolean K3Inverter4IsConnectedToIslandBus => !_Regs.DigitalInput3; private Boolean K3Inverter4IsConnectedToIslandBus => !_Regs.DigitalInput3;
public Boolean FiWarning => !_Regs.DigitalInput5; public Boolean FiWarning => !_Regs.DigitalInput5;
public Boolean FiError => !_Regs.DigitalInput7; public Boolean FiError => !_Regs.DigitalInput7;
@ -58,6 +68,11 @@ public class RelaysRecordAmax : IRelaysRecord
public Boolean K1GridBusIsConnectedToGrid => _Regs.DigitalInput22; public Boolean K1GridBusIsConnectedToGrid => _Regs.DigitalInput22;
public Boolean K2IslandBusIsConnectedToGridBus => !_Regs.DigitalInput20; 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<Boolean> K3InverterIsConnectedToIslandBus public IEnumerable<Boolean> K3InverterIsConnectedToIslandBus
{ {
get get

View File

@ -31,4 +31,11 @@ public class Adam6360DRegisters
[Coil(38)] public Boolean Relay5 { get; set; } [Coil(38)] public Boolean Relay5 { get; set; }
[Coil(39)] public Boolean Relay6 { 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; }
} }