Node('fi2.psi.ch',
     'vacuum furnace ILL Type',
     'tcp://5000',
)

Mod('htr_io',
    'frappy_psi.tdkpower.IO',
    'powersupply communicator',
    uri = 'serial:///dev/ttyUSB0',
   )

Mod('htr',
    'frappy_psi.tdkpower.Power',
    'heater power',
    io= 'htr_io',
   )

Mod('out',
    'frappy_psi.tdkpower.Output',
    'heater output',
    io = 'htr_io',
    maxvolt = 5,
    maxcurrent = 25,
   )

Mod('relais',
    'frappy_psi.ionopimax.DigitalOutput',
    'relais for power output',
    addr = 'o2',
   )

Mod('T_main',
    'frappy_psi.ionopimax.CurrentInput',
    'sample temperature',
    addr = 'ai4',
    valuerange = (0, 1372),
    value = Param(unit='degC'),
   )


Mod('T_extra',
    'frappy_psi.ionopimax.CurrentInput',
    'extra temperature',
    addr = 'ai3',
    valuerange = (0, 1372),
    value = Param(unit='degC'),

   )

Mod('T_htr',
    'frappy_psi.ionopimax.CurrentInput',
    'heater temperature',
    addr = 'ai2',
    valuerange = (0, 1372),
    value = Param(unit='degC'),
   )

Mod('T_wall',
    'frappy_psi.ionopimax.VoltageInput',
    'furnace wall temperature',
    addr = 'av2',
    rawrange = (0, 1.5),
    valuerange = (0, 150),
    value = Param(unit='degC'),
   )

Mod('T',
    'frappy_psi.picontrol.PI',
    'controlled Temperature',
    input = 'T_htr',
    output = 'out',
    relais = 'relais',
    p = 2,
    i = 0.01,
   )

Mod('interlocks',
    'frappy_psi.furnace.Interlocks',
    'interlock parameters',
    input = 'T_htr',
    wall_T = 'T_wall',
    vacuum = 'p',
    relais = 'relais',
    control = 'T',
    wall_limit = 50,
    vacuum_limit = 0.1,
   )

Mod('p_io',
    'frappy_psi.pfeiffer.IO',
    'pressure io',
    uri='serial:///dev/ttyUSBlower',
   )

Mod('p',
    'frappy_psi.pfeiffer.Pressure',
    'pressure reading',
    io = 'p_io',
   )

