示例#1
0
 private static void StartEVCharging(ModbusTCPClient wallbox)
 {
     if (IsEVConnected(wallbox))
     {
         // start charging
         wallbox.WriteCoil(WallbeWallboxModbusUnitID, WallbeWallboxEnableChargingFlagAddress, true);
     }
 }
示例#2
0
        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);
                }
            }
        }
示例#3
0
 private static void StopEVCharging(ModbusTCPClient wallbox)
 {
     wallbox.WriteCoil(WallbeWallboxModbusUnitID, WallbeWallboxEnableChargingFlagAddress, false);
 }