Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
Sample project(s) available on GitHub
Syntax
public class Y4000 : PollingSensorBase<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>, IObservable<IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>>, ISamplingSensor<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>, ISensor<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>, IDisposable
Constructors
Y4000(IMeadowDevice, SerialPortName, byte, IPin?)
Creates a new Y4000 object
Declaration
public Y4000(IMeadowDevice device, SerialPortName serialPortName, byte modbusAddress = 1, IPin? enablePin = null)
Parameters
Type | Name | Description |
---|---|---|
IMeadowDevice | device | |
SerialPortName | serialPortName | |
byte | modbusAddress | |
IPin | enablePin |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
Y4000(IModbusBusClient, byte)
Creates a new Y4000 object
Declaration
public Y4000(IModbusBusClient modbusClient, byte modbusAddress = 1)
Parameters
Type | Name | Description |
---|---|---|
IModbusBusClient | modbusClient | |
byte | modbusAddress |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
Properties
BlueGreenAlgae
The current Blue Green Algae concentration
Declaration
public ConcentrationInWater? BlueGreenAlgae { get; }
Property Value
Type | Description |
---|---|
ConcentrationInWater? |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
Chlorophyl
The current Chlorophyll concentration
Declaration
public ConcentrationInWater? Chlorophyl { get; }
Property Value
Type | Description |
---|---|
ConcentrationInWater? |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
DissolvedOxygen
The current Dissolved Oxygen concentration
Declaration
public ConcentrationInWater? DissolvedOxygen { get; }
Property Value
Type | Description |
---|---|
ConcentrationInWater? |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
ElectricalConductivity
The current Electrical Conductivity
Declaration
public Conductivity? ElectricalConductivity { get; }
Property Value
Type | Description |
---|---|
Conductivity? |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
IsDisposed
Is the object disposed
Declaration
public bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
ModbusAddress
The current modbus address
Declaration
public byte ModbusAddress { get; }
Property Value
Type | Description |
---|---|
byte |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
OxidationReductionPotential
The current Oxidation Reduction Potential (redux)
Declaration
public Voltage? OxidationReductionPotential { get; }
Property Value
Type | Description |
---|---|
Voltage? |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
PH
The current Potential Hydrogen (pH)
Declaration
public PotentialHydrogen? PH { get; }
Property Value
Type | Description |
---|---|
PotentialHydrogen? |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
Turbidity
The current Turbidity
Declaration
public Turbidity? Turbidity { get; }
Property Value
Type | Description |
---|---|
Turbidity? |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
Dispose(bool)
Dispose of the object
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | Is disposing |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
GetBrushInterval()
Get the brush or wiper interval
Declaration
public Task<TimeSpan> GetBrushInterval()
Returns
Type | Description |
---|---|
Task<TimeSpan> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
GetErrorFlag()
Read the error flag from the sensor
Declaration
public Task<ushort> GetErrorFlag()
Returns
Type | Description |
---|---|
Task<ushort> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
GetISDN()
Get the device ISDN (address) of the sensor Note this is a broadcast event so all Y4000 devices on the bus will respond
Declaration
public Task<byte> GetISDN()
Returns
Type | Description |
---|---|
Task<byte> | The address as a byte |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
GetSerialNumber()
Get the device serial number
Declaration
public Task<ushort[]> GetSerialNumber()
Returns
Type | Description |
---|---|
Task<ushort[]> | The serial number as a ushort array |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
GetSupplyVoltage()
Get the current supply voltage
Declaration
public Task<Voltage> GetSupplyVoltage()
Returns
Type | Description |
---|---|
Task<Voltage> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
GetVersion()
Get the device version
Declaration
public Task<ushort[]> GetVersion()
Returns
Type | Description |
---|---|
Task<ushort[]> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
Initialize()
Initialize sensor
Declaration
public Task Initialize()
Returns
Type | Description |
---|---|
Task |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
RaiseEventsAndNotify(IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)>)
Raise events for subscribers and notify of value changes
Declaration
protected override void RaiseEventsAndNotify(IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> changeResult)
Parameters
Type | Name | Description |
---|---|---|
IChangeResult<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> | changeResult | The updated sensor data |
Overrides
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
ReadSensor()
Reads data from the sensor
Declaration
protected override Task<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> ReadSensor()
Returns
Type | Description |
---|---|
Task<(ConcentrationInWater? DissolvedOxygen, ConcentrationInWater? Chlorophyl, ConcentrationInWater? BlueGreenAlgae, Conductivity? ElectricalConductivity, PotentialHydrogen? PH, Turbidity? Turbidity, Temperature? Temperature, Voltage? OxidationReductionPotential)> | The latest sensor reading |
Overrides
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
SetBrushInterval(TimeSpan)
Set the brush or wiper interval (normalized to minutes)
Declaration
public Task SetBrushInterval(TimeSpan interval)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | interval |
Returns
Type | Description |
---|---|
Task |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
SetISDN(byte)
Set the ISDN (address) of the sensor
Declaration
public Task SetISDN(byte modbusAddress)
Parameters
Type | Name | Description |
---|---|---|
byte | modbusAddress | The address |
Returns
Type | Description |
---|---|
Task |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
StartBrush()
Start the brush or wiper
Declaration
public Task StartBrush()
Returns
Type | Description |
---|---|
Task |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
Events
BlueGreenAlgaeUpdated
Raised when the BlueGreenAlgae value changes
Declaration
public event EventHandler<IChangeResult<ConcentrationInWater>> BlueGreenAlgaeUpdated
Event Type
Type | Description |
---|---|
EventHandler<IChangeResult<ConcentrationInWater>> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
ChlorophylUpdated
Raised when the Chlorophyll value changes
Declaration
public event EventHandler<IChangeResult<ConcentrationInWater>> ChlorophylUpdated
Event Type
Type | Description |
---|---|
EventHandler<IChangeResult<ConcentrationInWater>> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
DissolvedOxygenUpdated
Raised when the DissolvedOxygen value changes
Declaration
public event EventHandler<IChangeResult<ConcentrationInWater>> DissolvedOxygenUpdated
Event Type
Type | Description |
---|---|
EventHandler<IChangeResult<ConcentrationInWater>> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
ElectricalConductivityUpdated
Raised when the ElectricalConductivity value changes
Declaration
public event EventHandler<IChangeResult<Conductivity>> ElectricalConductivityUpdated
Event Type
Type | Description |
---|---|
EventHandler<IChangeResult<Conductivity>> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
OxidationReductionPotentialUpdated
Raised when the OxidationReductionPotential (redux) value changes
Declaration
public event EventHandler<IChangeResult<Voltage>> OxidationReductionPotentialUpdated
Event Type
Type | Description |
---|---|
EventHandler<IChangeResult<Voltage>> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
PHUpdated
Raised when the PotentialHydrogen (pH) value changes
Declaration
public event EventHandler<IChangeResult<PotentialHydrogen>> PHUpdated
Event Type
Type | Description |
---|---|
EventHandler<IChangeResult<PotentialHydrogen>> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
TemperatureUpdated
Raised when the Temperature value changes
Declaration
public event EventHandler<IChangeResult<Temperature>> TemperatureUpdated
Event Type
Type | Description |
---|---|
EventHandler<IChangeResult<Temperature>> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}
TurbidityUpdated
Raised when the Turbidity value changes
Declaration
public event EventHandler<IChangeResult<Turbidity>> TurbidityUpdated
Event Type
Type | Description |
---|---|
EventHandler<IChangeResult<Turbidity>> |
Remarks
Y4000 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
Y4000 sensor;
public async override Task Initialize()
{
Resolver.Log.Info("Initialize...");
await Task.Delay(2000);
sensor = new Y4000(Device, Device.PlatformOS.GetSerialPortName("COM4"), 0x01, Device.Pins.D09);
await sensor.Initialize();
await Task.Delay(2000);
}
public override async Task Run()
{
Resolver.Log.Info("Run...");
var isdn = await sensor.GetISDN();
Resolver.Log.Info($"Address: {isdn}");
var supplyVoltage = await sensor.GetSupplyVoltage();
Resolver.Log.Info($"Supply voltage: {supplyVoltage}");
var measurements = await sensor.Read();
Resolver.Log.Info($"Sensor data: {measurements}");
}