# GVLs

## GVL_CONFIG

GVL GVL_CONFIG()
  VAR_GLOBAL CONSTANT:

    - uiNumberOfStrings (`UINT`) – =========================== Number of active strings ===========================

    - uiNumberOfUnits (`UINT`) –

  VAR_GLOBAL PERSISTENT:

    - axStringEnabled (`ARRAY[0..uiNumberOfStrings-1] OF BOOL`) –

    - stUnitConfig (`ST_UNIT_CONFIG`) – =========================== Unit hardware config ===========================

    - stConfigSCSCurrent (`ST_ANALOG_IO_CONFIG`) – =========================== SCS Current measurement settings ===========================

    - stEWLSCSCurrent (`ST_ANALOG_EW_LEVELS`) –

    - stEWDSCSCurrent (`ST_ANALOG_EW_DELAYS`) –

    - rPumpPosolytOnPower (`REAL`) – =========================== General settings =========================== Pump posolyt on power in %

    - rPumpNegolytOnPower (`REAL`) – Pump negolyt on power in %

    - rPumpPosolytDisChrgPower (`REAL`) – Pump posolyt discharge segment without inverter power in %

    - rPumpNegolytDisChrgPower (`REAL`) – Pump posolyt discharge segment without inverter power in %

    - rPumpshutoffThreshold (`REAL`) – Unit voltage pumps shutoff threshold (Volt)

    - rMinimumUnitVoltage (`REAL`) – Minimum unit voltage required for inverter startup (Volt)

    - rMaximumUnitVoltage (`REAL`) – Maximum unit voltage for fully charged (Volt)

    - rDeltaUnitVoltageShutdownDischarge (`REAL`) – Delta value to minimum unit voltage for shutdown discharge (Volt)

    - rMaxAbsDiffVoltageUnitsOnModule (`REAL`) – Maximum absolute voltage difference between units in the same module

    - rMaxAbsDiffVoltageModulesInString (`REAL`) – Maximum absolute voltage difference between Modules (Volt)

    - diMinimumAbsPowerForEnable (`DINT`) – Minimum absolute power command to enable battery (Watt)

    - diMaxStringChargingPower (`DINT`) – Maximum allowed charging power (Watt) per String 24.000 W -> 2.000 W per Unit

    - diMaxStringDischargePower (`DINT`) – Maximum allowed discharging power (Watt) per String 24.000 W -> 2.000 W per Unit

    - sInverterIpString1 (`STRING`) – Inverter ip address for string 1

    - sInverterIpString2 (`STRING`) – Inverter ip address for string 2

    - rAbsShutdownDischargePower (`REAL`) – Absolute shutdown discharge power (Watt) 12.000 W -> 1.000 W per unit

    - xShutdownDischargeWithInverter (`BOOL`) – Allow inverter fast shutdown discharge

    - rStringFullyChargedVoltage (`REAL`) – String fully charged voltage (Volt) 960 V -> 80 V per Unit

    - rStringEmptyVoltage (`REAL`) – String empty voltage (Volt) (617V is needed for the inverter to start up -> 55.0V per Segment)

    - timUnitStartupTime (`TIME`) – Unit wait startup time

    - timUnitBalancingStartupTime (`TIME`) – Unit balancing wait startup time

    - timStringReadyTimeout (`TIME`) – All modules in string not ready timeout

    - timIsoErrorTimeout (`TIME`) – Timeout for isolation error

    - rBalancingFactor (`REAL`) – Balancing factor

    - xDummy (`BOOL`) – Attr: analysis := ‚-33‘, Dummy to deactivate functions

## GVL_MODBUS

GVL GVL_MODBUS()
  VAR_GLOBAL:

    - stModbusEMSComm (`ST_EMS_MODBUS_INTERFACE`) – Modbus interface to customer EMS

    - stBMSErrorReg (`ST_MODBUS_REG_13`) – Addr: 13.000

    - awWarningsUnitsActive (`ARRAY[0..(GVL_CONFIG.uiNumberOfUnits-1)] OF U_UNIT_WARNING_REGISTER`) – Addr: 14.000 -> 14.047 Index 0 -> Unit 1, Index 1 -> Unit 2 etc.

    - awErrorsUnitsActive (`ARRAY[0..(GVL_CONFIG.uiNumberOfUnits-1)] OF U_UNIT_ERROR_REGISTER`) – Addr: 15.000 -> 15.047 Index 0 -> Unit 1, Index 1 -> Unit 2 etc.

## GVL_SCADA

GVL GVL_SCADA()
  VAR_GLOBAL:

    - stHMIInterface (`ARRAY[0..1] OF ST_STRING_HMI_INTERFACE`) – Array for string HMI

    - stAckAlarmsButton (`ST_HMI_CONTROL_BUTTON`) – Acknowledge alarm button

    - stAutomaticModeHMI (`ST_AUTO_HMI_INTERFACE`) – HMI interface to control the battery throught the HMI

    - eRequestedControlMode (`E_BMS_CONTROL_MODE`) – Requested control mode by HMI

    - eCurrentControlMode (`E_BMS_CONTROL_MODE`) – Current control mode

    - xCanChangeControlMode (`BOOL`) – Can change current control mode

    - diCurrentBatteryPower (`DINT`) – Current battery power

    - lrChargedPowerValueWH (`LREAL`) – Last power charged value

    - lrDischargedPowerValueWH (`LREAL`) – Last power discharged value

    - lrLastCycleUtilityPowerValueWh (`LREAL`) – Last discharged utility power value

    - eCycleStatus (`E_CYCLE_STATUS`) – Cycle status

    - xDummy (`BOOL`) –