task body MESSEN is

  -- Typdeklarationen
  type BIT_T is (OFF, ON);
  for BIT_T use (OFF => 0; ON => 1);
  for BIT_T'SIZE use 1;

  type LEER_T is array(1..7) of BIT_T;
  for LEER_T'SIZE use 7;

  type REGISTER_T is record
    WERT    : WERT_T;
    GUELTIG : BIT_T;
    LEER    : LEER_T;
  end record;

  for REGISTER_T use record
    WERT    at 0 range 0..7;
    GUELTIG at 0 range 8..8;
    LEER    at 0 range 9..15;;
  end record;
  for REGISTER_TīSIZE use 16;
  pragma PACK(REGISTER_T);

  -- Variablendeklarationen
  REGISTER: REGISTER_T;
  pragma VOLATILE(REGISTER);
  for REGISTER use at 8#777700#;
  TMP_REG: REGISTER_T;
  pragma VOLATILE(REGISTER);
  TMP_WERT: WERT_T

  begin
    loop
      select
        accept FUELLSTAND(WERT: out WERT_T) do
          WERT := TMP_WERT;
        end FUELLSTAND;
      else
        -- hier polling, ginge auch eleganter
        TMP_REG:=REGISTER;
        if TMP_REG.GUELTIG=OFF then
          TMP_WERT:=TMP_REG.WERT;
        end if;
      end select;
    end loop;
  exception
    when CONSTRAINT_ERROR => Fehlerbehandlung;
end MESSEN;