private static void StartEVCharging(ModbusTCPClient wallbox) { if (IsEVConnected(wallbox)) { // start charging wallbox.WriteCoil(WallbeWallboxModbusUnitID, WallbeWallboxEnableChargingFlagAddress, true); } }
private static void StartEVCharging(ModbusTCPClient wallbox) { if (IsEVConnected(wallbox)) { // check if we already set our charging enabled flag bool chargingEnabled = BitConverter.ToBoolean(wallbox.Read( WallbeWallboxModbusUnitID, ModbusTCPClient.FunctionCode.ReadCoilStatus, WallbeWallboxEnableChargingFlagAddress, 1)); if (!chargingEnabled) { // start charging wallbox.WriteCoil(WallbeWallboxModbusUnitID, WallbeWallboxEnableChargingFlagAddress, true); } } }
private static void StopEVCharging(ModbusTCPClient wallbox) { wallbox.WriteCoil(WallbeWallboxModbusUnitID, WallbeWallboxEnableChargingFlagAddress, false); }