Skip to content

Comments and tags

There are two types of comments available in ESL specifications. Regular comments and attached comments. As a comment sign we use the pound sign (#).

Regular comment

For instance, you can add a regular comment at the top of the file just like:

world.esl
# Specification of a drive-mechanism driving a pump.
world.esl
# ---8<--- [start:regular-comment]
# Specification of a drive-mechanism driving a pump.
# ---8<--- [end:regular-comment]
define type
  MechanicalEnergyFlow is a real with unit Nm
  ElectricalEnergyFlow is a real with unit W
  LiquidMaterialFlow is a real with unit L/s
  EnergyPotential is a real with unit Wh
  ControlSignal is a boolean
  Distance is a real with unit m
  SpatialMeasure is a Distance of at least 0.0 [m]
  Efficiency is a real  of at least 0.0 and at most 1.0


define verb
  provide to
  convert into
  send to


define relation
  BatteryEfficiencyModel
    relating parameters
      * potential is an EnergyPotential
      * output is an ElectricalEnergyFlow

# ---8<--- [start:attached-comment]
world
  comments
    pump #< Can be sourced by manufacturer XYZ.
         #< Part number CFG.PMP.0.1

  variables
    torque is a MechanicalEnergyFlow #< Comments on variable torque.
# ---8<--- [end:attached-comment]
    water-flow is a LiquidMaterialFlow
    drive-length is a SpatialMeasure
    pump-length is a SpatialMeasure

  design-requirements
    min-water-flow: water-flow must be at least 1.0 [L/s]

  design-constraints
    dc-drive-length: drive-length must be equal to pump-length

  components
    pump is a CentrifugalPump with arguments
      * torque
      * water-flow
      * pump-length

    drive-mechanism is an ElectricalDriveMechanism with arguments
      * torque
      * drive-length

  goal-requirements
    provide-torque: drive-mechanism must provide torque to pump

  need
    IP68: drive-mechanism must be IP68 compliant


define component CentrifugalPump
  parameters
    torque is a MechanicalEnergyFlow
    water-flow is a LiquidMaterialFlow
    length is a SpatialMeasure property

  transformation-requirements
    convert-torque: must convert torque into water-flow


define component ElectricalDriveMechanism
  parameters
    torque is a MechanicalEnergyFlow
    length is a SpatialMeasure property

  variables
    power-potential is an EnergyPotential
    power is an ElectricalEnergyFlow
    motor-control-signal is a ControlSignal

  transformation-requirements
    convert-power-potential: must convert power-potential into torque

  components
    power-source is a Battery with arguments
      * power-potential
      * power

    motor is a BrushlessMotor with arguments
      * power
      * torque

    power-switch is a Switch with arguments
      * motor-control-signal

  goal-requirements
    provide-power: power-source must provide power to motor
    send-control-signal: power-switch must send motor-control-signal to power-source

  behavior-requirements
    toggle-power:
      case on:
        when
          * c1: motor-control-signal is equal to True [-]
        then
          * r1: power must be at least 300 [W]
      case off:
        when no other case applies
        then
          * r2: power must be equal to 0 [W]


define component BrushlessMotor
  parameters
    power is an ElectricalEnergyFlow
    torque is a MechanicalEnergyFlow

  variables
    conversion is an Efficiency

  transformation-requirements
    convert-power: must convert power into torque with subclauses
      * s1: conversion must be at least 0.8


define component Battery
  parameters
    power-potential is an EnergyPotential
    power is an ElectricalEnergyFlow

  transformation-constraints
    convert-potential: does convert power-potential into power

  relations
    efficiency-model: BatteryEfficiencyModel
      relating arguments
      * power-potential
      * power


define component Switch
  parameters
    motor-control-signal is a ControlSignal

Note

Regular comments are discarded by the compiler and should aid in reading or writing the ESL specification itself. They do not end up in the processed output content.

Attached comment

The attached comments are directly tied to a component, variable, relation, need, constraint, or requirement and are included and available as additional information in any output document we generate. Attached comments can be added using the #< combination or in a special comment section, like so:

world.esl
1
2
3
4
5
6
7
world
  comments
    pump #< Can be sourced by manufacturer XYZ.
         #< Part number CFG.PMP.0.1

  variables
    torque is a MechanicalEnergyFlow #< Comments on variable torque.
world.esl
# ---8<--- [start:regular-comment]
# Specification of a drive-mechanism driving a pump.
# ---8<--- [end:regular-comment]
define type
  MechanicalEnergyFlow is a real with unit Nm
  ElectricalEnergyFlow is a real with unit W
  LiquidMaterialFlow is a real with unit L/s
  EnergyPotential is a real with unit Wh
  ControlSignal is a boolean
  Distance is a real with unit m
  SpatialMeasure is a Distance of at least 0.0 [m]
  Efficiency is a real  of at least 0.0 and at most 1.0


define verb
  provide to
  convert into
  send to


define relation
  BatteryEfficiencyModel
    relating parameters
      * potential is an EnergyPotential
      * output is an ElectricalEnergyFlow

# ---8<--- [start:attached-comment]
world
  comments
    pump #< Can be sourced by manufacturer XYZ.
         #< Part number CFG.PMP.0.1

  variables
    torque is a MechanicalEnergyFlow #< Comments on variable torque.
# ---8<--- [end:attached-comment]
    water-flow is a LiquidMaterialFlow
    drive-length is a SpatialMeasure
    pump-length is a SpatialMeasure

  design-requirements
    min-water-flow: water-flow must be at least 1.0 [L/s]

  design-constraints
    dc-drive-length: drive-length must be equal to pump-length

  components
    pump is a CentrifugalPump with arguments
      * torque
      * water-flow
      * pump-length

    drive-mechanism is an ElectricalDriveMechanism with arguments
      * torque
      * drive-length

  goal-requirements
    provide-torque: drive-mechanism must provide torque to pump

  need
    IP68: drive-mechanism must be IP68 compliant


define component CentrifugalPump
  parameters
    torque is a MechanicalEnergyFlow
    water-flow is a LiquidMaterialFlow
    length is a SpatialMeasure property

  transformation-requirements
    convert-torque: must convert torque into water-flow


define component ElectricalDriveMechanism
  parameters
    torque is a MechanicalEnergyFlow
    length is a SpatialMeasure property

  variables
    power-potential is an EnergyPotential
    power is an ElectricalEnergyFlow
    motor-control-signal is a ControlSignal

  transformation-requirements
    convert-power-potential: must convert power-potential into torque

  components
    power-source is a Battery with arguments
      * power-potential
      * power

    motor is a BrushlessMotor with arguments
      * power
      * torque

    power-switch is a Switch with arguments
      * motor-control-signal

  goal-requirements
    provide-power: power-source must provide power to motor
    send-control-signal: power-switch must send motor-control-signal to power-source

  behavior-requirements
    toggle-power:
      case on:
        when
          * c1: motor-control-signal is equal to True [-]
        then
          * r1: power must be at least 300 [W]
      case off:
        when no other case applies
        then
          * r2: power must be equal to 0 [W]


define component BrushlessMotor
  parameters
    power is an ElectricalEnergyFlow
    torque is a MechanicalEnergyFlow

  variables
    conversion is an Efficiency

  transformation-requirements
    convert-power: must convert power into torque with subclauses
      * s1: conversion must be at least 0.8


define component Battery
  parameters
    power-potential is an EnergyPotential
    power is an ElectricalEnergyFlow

  transformation-constraints
    convert-potential: does convert power-potential into power

  relations
    efficiency-model: BatteryEfficiencyModel
      relating arguments
      * power-potential
      * power


define component Switch
  parameters
    motor-control-signal is a ControlSignal

Multi-line comments are made by repeating the (attached) comment symbols on every line. The comments section works by naming any component, variable or relation instance you want to attach a comment to and using the attached comment sign. This can help separating the comment documentation from the requirements. Valid targets in the comments section are an instance of a component, variable, relation, need, constraint, or requirement. This can be used to refer to test protocols for specific requirements.

Next!

Press next (or N on your keyboard) to head over to the next page! P is for Previous.