# DUTs

## E_BATTERY_STATUS

ENUM E_BATTERY_STATUS

  Attr: ‚qualified_only‘ , Attr: ‚strict‘ , Attr: ‚to_string‘

  ERROR → INT : 1
  OFF → INT : 2
  READY → INT : 3
  ACTIVE → INT : 4
  MAINTENANCE → INT : 5
  TESTING → INT : 6

## E_BMS_CONTROL_MODE

ENUM E_BMS_CONTROL_MODE

  Attr: ‚qualified_only‘ , Attr: ‚strict‘

  AUTO_REMOTE → INT : 1
  AUTO_LOCAL → INT : 2
  SAFETY_CHECK → INT : 3
  CAPACITY_TEST → INT : 4
  MANUAL → INT : 5
  BALANCING → INT : 6
  CYCLING → INT : 7
  PRECHARGE → INT : 8

## E_BMS_STATE

ENUM E_BMS_STATE

  Attr: ‚qualified_only‘ , Attr: ‚strict‘

  IDLE → INT : 0
  CHECK_POWER_COMMAND → INT : 1
  WAIT_FOR_STRING_TO_BE_READY → INT : 2
  WAIT_FOR_INVERTER → INT : 3
  ENABLED → INT : 4
  WAIT_FOR_SHUTDOWN_DISCHARGE_MODE → INT : 5
  SEGMENT_DISCHARGE_WITH_INVERTER_DONE → INT : 6
  SEGMENT_DISCHARGE_DONE → INT : 7
  ERROR → INT : 8
  WAIT_FOR_ERROR_RESET → INT : 9

## E_CHARGE_STATUS

ENUM E_CHARGE_STATUS

  Attr: ‚qualified_only‘ , Attr: ‚strict‘ , Attr: ‚to_string‘

  UNDEFINED → INT : 1
  EMPTY → INT : 2
  CHARGING → INT : 3
  DISCHARGING → INT : 4
  FULL → INT : 5

## E_CYCLE_STATUS

ENUM E_CYCLE_STATUS

  Attr: ‚qualified_only‘ , Attr: ‚strict‘ , Attr: ‚to_string‘

  OFF → INT : 0
  CHARGE_STARTED → INT : 1
  CHARGE_ENDED → INT : 2
  DISCHARGE_STARTED → INT : 3
  DISCHARGE_ENDED → INT : 4

## E_REACTIVE_POWER_TYPE

ENUM E_REACTIVE_POWER_TYPE

  Attr: ‚qualified_only‘ , Attr: ‚strict‘ , Attr: ‚to_string‘

  INDUCTIVE → INT : 1
  CAPACITIVE → INT : 2
  NONE → INT : 3

## E_COMPONENT_STATUS

ENUM E_COMPONENT_STATUS

  Attr: ‚qualified_only‘ , Attr: ‚strict‘ , Attr: ‚to_string‘

  OFF → INT : 0
  ON → INT : 1
  CHARGING → INT : 2
  DISCHARGING → INT : 3
  ERROR → INT : 4
  SHUTDOWN → INT : 5
  STARTING → INT : 6

## ST_AUTO_HMI_INTERFACE

STRUCT ST_AUTO_HMI_INTERFACE
  stStartAutoButton → ST_HMI_CONTROL_BUTTON
  stStopAutoButton → ST_HMI_CONTROL_BUTTON
  diSetpointAutomatic → DINT

## ST_MODULE_HMI_INTERFACE

STRUCT ST_MODULE_HMI_INTERFACE
  stHMIInterfaceUnit1 → ST_UNIT_HMI_INTERFACE
  stHMIInterfaceUnit2 → ST_UNIT_HMI_INTERFACE
  stHMIInterfaceUnit3 → ST_UNIT_HMI_INTERFACE
  stHMIInterfaceUnit4 → ST_UNIT_HMI_INTERFACE
  rVoltage → REAL

    > Current voltage for HMI ==============================

  rCurrent → REAL

    > Current current for HMI ==============================

  eStatus → E_COMPONENT_STATUS

    > Current status ====================================

## ST_MODULE_VOLT_CONFIG

STRUCT ST_MODULE_VOLT_CONFIG
  xUnit1Is1500V → BOOL
  xUnit2Is1500V → BOOL
  xUnit3Is1500V → BOOL
  xUnit4Is1500V → BOOL

## ST_STRING_HMI_INTERFACE

STRUCT ST_STRING_HMI_INTERFACE
  stHMIInterfaceModule1 → ST_MODULE_HMI_INTERFACE
  stHMIInterfaceModule2 → ST_MODULE_HMI_INTERFACE
  stHMIInterfaceModule3 → ST_MODULE_HMI_INTERFACE
  rVoltage → REAL

    > Current voltage for HMI ==============================

  rCurrent → REAL

    > Current current for HMI ==============================

  eStatus → E_COMPONENT_STATUS

    > Current status ====================================

  stInverterData → ST_SUNSPEC_CURRENT_VALUES

    > Current string current ============================== stStringCurrent : ST_HMI_ANALOG_VALUE; Current inverter data ==============================

## ST_STRING_VOLT_CONFIG

STRUCT ST_STRING_VOLT_CONFIG
  stModule1VoltConfig → ST_MODULE_VOLT_CONFIG
  stModule2VoltConfig → ST_MODULE_VOLT_CONFIG
  stModule3VoltConfig → ST_MODULE_VOLT_CONFIG

## ST_UNIT_HMI_INTERFACE

STRUCT ST_UNIT_HMI_INTERFACE
  stNS11 → ST_HMI_ANALOG_MOTOR_DATA

    > Pump posolyt ===================================

  stNS21 → ST_HMI_ANALOG_MOTOR_DATA

    > Pump negolyt ===================================

  stNS12 → ST_HMI_VALVE_DATA

    > Valve posolyt ===================================

  stNS22 → ST_HMI_VALVE_DATA

    > Valve negolyt ===================================

  stP11 → ST_HMI_ANALOG_VALUE

    > Drucksensoren Posolyt ====================================

  stP12 → ST_HMI_ANALOG_VALUE
  stP21 → ST_HMI_ANALOG_VALUE

    > Drucksensoren Negolyt ====================================

  stP22 → ST_HMI_ANALOG_VALUE
  stT11 → ST_HMI_ANALOG_VALUE

    > Temperature sensor posolyt tank inlet ====================================

  stT21 → ST_HMI_ANALOG_VALUE

    > Temperature sensor negolyt tank inlet ====================================

  stE31 → ST_HMI_ANALOG_VALUE

    > Voltage sensors ===================================

  rVoltage → REAL

    > Current voltage for HMI ==============================

  rCurrent → REAL

    > Current current for HMI ==============================

  eStatus → E_COMPONENT_STATUS

    > Current status ====================================

## ST_UNIT_CONFIG

STRUCT ST_UNIT_CONFIG
  stConfigPosolytPump → ST_MOTOR_ANALOG_CONFIG

    > Pump posolyt ===================================

  stConfigNegolytPump → ST_MOTOR_ANALOG_CONFIG

    > Pump negolyt ===================================

  stConfigPosolytValve → ST_ValveConfig

    > Valves posolyt ===================================

  stConfigNegolytValve → ST_ValveConfig

    > Valves negolyt ===================================

  stConfigPosolytPressureSegmentInlet → ST_ANALOG_IO_CONFIG

    > Pressure sensor posolyt segment inlet ====================================

  stEWLPosolytPressureSegmentInlet → ST_ANALOG_EW_LEVELS
  stEWDPosolytPressureSegmentInlet → ST_ANALOG_EW_DELAYS
  stConfigNegolytPressureSegmentInlet → ST_ANALOG_IO_CONFIG

    > Pressure sensor negolyt segment inlet ====================================

  stEWLNegolytPressureSegmentInlet → ST_ANALOG_EW_LEVELS
  stEWDNegolytPressureSegmentInlet → ST_ANALOG_EW_DELAYS
  stConfigPosolytPressureTankInlet → ST_ANALOG_IO_CONFIG

    > Pressure sensor posolyt tank inlet ====================================

  stEWLPosolytPressureTankInlet → ST_ANALOG_EW_LEVELS
  stEWDPosolytPressureTankInlet → ST_ANALOG_EW_DELAYS
  stConfigNegolytPressureTankInlet → ST_ANALOG_IO_CONFIG

    > Pressure sensor posolyt tank inlet ====================================

  stEWLNegolytPressureTankInlet → ST_ANALOG_EW_LEVELS
  stEWDNegolytPressureTankInlet → ST_ANALOG_EW_DELAYS
  stConfigPosolytTempTankInlet → ST_ANALOG_IO_CONFIG

    > Temperature sensor posolyt tank inlet ====================================

  stEWLPosolytTempTankInlet → ST_ANALOG_EW_LEVELS
  stEWDPosolytTempTankInlet → ST_ANALOG_EW_DELAYS
  stConfigNegolytTempTankInlet → ST_ANALOG_IO_CONFIG

    > Temperature sensor negolyt tank inlet ====================================

  stEWLNegolytTempTankInlet → ST_ANALOG_EW_LEVELS
  stEWDNegolytTempTankInlet → ST_ANALOG_EW_DELAYS
  stConfigVoltageSegment → ST_ANALOG_IO_CONFIG

    > Voltage segment ====================================

  stEWLVoltageSegment → ST_ANALOG_EW_LEVELS
  stEWDVoltageSegment → ST_ANALOG_EW_DELAYS
  rMaxDeltaPSegmentInlet → REAL

    > Max pressure difference between posolyt and negolyt segment inlet ====================================

## Modbus

### ST_EMS_MODBUS_INTERFACE

STRUCT ST_EMS_MODBUS_INTERFACE

  Attr: ‚pack_mode‘ := ‚1‘ Speicherbereiche, welche über einen kontinuierlichen Registerbereich gelesen werden sollen, müssen in einer Struktur mit dem attribut {attribute ‚pack_mode‘ := ‚1‘} angelegt werden. Der Grund ist, dass der TwinCAT Modbus Server beim zugriff über den ADS Server nur die Symbolische erste Adresse anfragt und dann davon ausgeht, dass die anderen Register im Speicherbereich hintereinander liegen. Bei rein symbolisch angelegten Variablen müss dies nicht der Fall sein und es kommt zu einem Fehler beim lesen über die symbolischen grenzen der variablen hinaus.

  stModbusReg10 → ST_MODBUS_REG_10

    > Modbus Registers 10.000 to 10.999

  stModbusReg11 → ST_MODBUS_REG_11

    > Modbus Registers 11.000 to 11.999

  stModbusReg12 → ST_MODBUS_REG_12

    > Modbus Registers 12.000 to 12.999

### ErrorWarningRegisters

#### ST_DWORD_UNIT_ERROR_BITMAP

STRUCT ST_DWORD_UNIT_ERROR_BITMAP
  bTNegLow → BIT

    > Bit 0

  bTNegHigh → BIT

    > Bit 1

  bTNegError → BIT

    > Bit 2

  bTPosLow → BIT

    > Bit 3

  bTPosHigh → BIT

    > Bit 4

  bTPosError → BIT

    > Bit 5

  bPInNegLow → BIT

    > Bit 6

  bPInNegHigh → BIT

    > Bit 7

  bPInNegError → BIT

    > Bit 8

  bPInPosLow → BIT

    > Bit 9

  bPInPosHigh → BIT

    > Bit 10

  bPInPosError → BIT

    > Bit 11

  bPTankNegLow → BIT

    > Bit 12

  bPTankNegHigh → BIT

    > Bit 13

  bPTankNegError → BIT

    > Bit 14

  bPTankPosLow → BIT

    > Bit 15

  bPTankPosHigh → BIT

    > Bit 16

  bPTankPosError → BIT

    > Bit 17

  bVLow → BIT

    > Bit 18

  bVHigh → BIT

    > Bit 19

  bVError → BIT

    > Bit 20

  bValveNeg → BIT

    > Bit 21

  bValvePos → BIT

    > Bit 22

  bPumpNeg → BIT

    > Bit 23

  bPumpPos → BIT

    > Bit 24

  bLeack → BIT

    > Bit 25

  bSafetyIntlk → BIT

    > Bit 26

#### ST_DWORD_UNIT_WARNING_BITMAP

STRUCT ST_DWORD_UNIT_WARNING_BITMAP
  bTNegLow → BIT

    > Bit 0

  bTNegHigh → BIT

    > Bit 1

  bTPosLow → BIT

    > Bit 2

  bTPosHigh → BIT

    > Bit 3

  bPInNegLow → BIT

    > Bit 4

  bPInNegHigh → BIT

    > Bit 5

  bPInPosLow → BIT

    > Bit 6

  bPInPosHigh → BIT

    > Bit 7

  bPTankNegLow → BIT

    > Bit 8

  bPTankNegHigh → BIT

    > Bit 9

  bPTankPosLow → BIT

    > Bit 10

  bPTankPosHigh → BIT

    > Bit 11

  bVLow → BIT

    > Bit 12

  bVHigh → BIT

    > Bit 13

#### ST_WORD_BMS_ERROR_BITMAP

STRUCT ST_WORD_BMS_ERROR_BITMAP
  bEStop → BIT

    > Bit 0

  bEthercat → BIT

    > Bit 1

  bDCSwitchS1 → BIT

    > Bit 2

  bDCSwitchS2 → BIT

    > Bit 3

  bError → BIT

    > Bit 4

#### ST_WORD_BMS_WARNING_BITMAP

STRUCT ST_WORD_BMS_WARNING_BITMAP
  bNotAllInAuto → BIT
  bSafetyIntlkString1 → BIT
  bSafetyIntlkString2 → BIT

#### U_BMS_ERROR_REGISTER

#### U_BMS_WARNING_REGISTER

#### U_UNIT_ERROR_REGISTER

#### U_UNIT_WARNING_REGISTER

### HoldingRegisters

#### ST_MODBUS_REG_10

STRUCT ST_MODBUS_REG_10

  Attr: ‚analysis‘ := ‚-33‘, Attr: ‚pack_mode‘ := ‚1‘

  sManufacturer → STRING(32)

    > 1 char = 1 byte

  sModelname → STRING(32)

    > Addr: 10.016

  sSerialnumber → STRING(32)

    > Addr: 10.032

  sBMSVersion → STRING(64)

    > Addr: 10.048

  uiTotalParallelMembers → UINT

    > uint 16bit = 1 Word

  uiActiveParallelMembers → UINT

    > Addr: 10.081

#### ST_MODBUS_REG_11

STRUCT ST_MODBUS_REG_11

  Attr: ‚analysis‘ := ‚-33‘, Attr: ‚pack_mode‘ := ‚1‘

  eBatteryStatus → E_BATTERY_STATUS

    > Addr: 11.000

  eChargeStatus → E_CHARGE_STATUS

    > Addr: 11.001

  uiSelfDischargeRate → UINT

    > 16 bit

  uiMaxAllowedSOC → UINT

    > Addr: 11.003 Unit: %

  uiMinAllowedSOC → UINT

    > Addr: 11.004 Unit: %

  uiCurrentSOC → UINT

    > Addr: 11.005 Unit: %

  uiCurrentDOD → UINT

    > Addr: 11.006 Unit: %

  uiCurrentSOH → UINT

    > Addr: 11.007 Unit: %

  udiChargeCapacity → UDINT

    > 32bit

  udiEnergyCapacity → UDINT

    > Addr: 11.010 Unit: Wh

  udiMaxChargingActivePower → UDINT

    > Addr: 11.012 Unit: W

  udiMaxDischargingActivePower → UDINT

    > Addr: 11.014 Unit: W

  udiMaxAvailableInductiveReactivePower → UDINT

    > Addr: 11.016 Unit: var

  udiMaxAvailableCapacitiveReactivePower → UDINT

    > Addr: 11.018 Unit: var

  udiChargedEnergy → UDINT

    > Addr: 11.020 Unit: Wh

  udiAvailableEnergy → UDINT

    > Addr: 11.022 Unit: Wh

  diTotalACCurrentPhase1 → DINT

    > Addr: 11.024 Unit: A

  diTotalACCurrentPhase2 → DINT

    > Addr: 11.026 Unit: A

  diTotalACCurrentPhase3 → DINT

    > Addr: 11.028 Unit: A

  diSetpointActivePowerMirror → DINT

    > Addr: 11.030 Unit: W

  rSetpointCosPhiMirror → REAL

    > 32 bit

  diCurrentActivePower → DINT

    > Addr: 11.034 Unit: W

  diCurrentReactivePower → DINT

    > Addr: 11.036 Unit: var

  udiLifeMessage → UDINT

    > Addr: 11.038

  lwWarningBitmap → LWORD

    > Addr: 11.040

  lwErrorBitmap → LWORD

    > Addr: 11.044

#### ST_MODBUS_REG_12

STRUCT ST_MODBUS_REG_12

  Attr: ‚analysis‘ := ‚-33‘, Attr: ‚pack_mode‘ := ‚1‘

  diSetpointActivePower → DINT

    > Unit: W

  rSetpointCosPhi → REAL

    > Addr: 12.002

  eReactivePowerType → E_REACTIVE_POWER_TYPE

    > Addr: 12.004 Can be removed if cosphi can be written in pos and neg range

#### ST_MODBUS_REG_13

STRUCT ST_MODBUS_REG_13

  Attr: ‚pack_mode‘ := ‚1‘

  wBMSWarningActive → U_BMS_WARNING_REGISTER

    > String warning active flags Addr: 13.000

  wBMSErrorActive → U_BMS_ERROR_REGISTER

    > String error active Addr: 13.001

  wStringWarningActive → WORD

    > String warning active flags (Bit 0 -> Warning in string 1 active, Bit 1 -> String 2, etc.) Addr: 13.002

  wStringErrorActive → WORD

    > String error active (Bit 0 -> Error in string 1 active, Bit 1 -> String 2, etc.) Addr: 13.003

  wConfirmAlarms → WORD

    > Confirm alarms through modbus Addr: 13.004